diff --git a/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/controller/BmsEnterpriseBasicInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/controller/BmsEnterpriseBasicInfoController.java index d3a08af..9992db6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/controller/BmsEnterpriseBasicInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/controller/BmsEnterpriseBasicInfoController.java @@ -13,6 +13,7 @@ import com.ruoyi.jjh.declaration.entity.request.EnterpriseInfoRequest; import com.ruoyi.jjh.declaration.entity.request.EnterpriseInfoWorkRequest; import com.ruoyi.jjh.declaration.service.IBmsEnterpriseBasicInfoService; import com.ruoyi.jjh.ent.entity.JHeadQuartersRevenue; +import com.ruoyi.jjh.ent.entity.JServicesList; import com.ruoyi.jjh.ent.service.JHeadQuartersRevenueService; import com.ruoyi.jjh.ent.service.JServicesListService; import io.swagger.annotations.Api; @@ -145,53 +146,25 @@ public class BmsEnterpriseBasicInfoController extends BaseController { /** * 将企业库企业更改分类 */ -// @ApiOperation(value = "将企业库企业更改分类", response = BmsEnterpriseBasicInfo.class) -// @GetMapping(value = "/changeType") -// public AjaxResult changeType() { -// List list = bmsEnterpriseBasicInfoService.list(); - //生产性服务业 -// List list1 = jServicesListService.lambdaQuery().eq(JServicesList::getServicesType, 1).list(); - //限上批零住餐 -// List list2 = jServicesListService.lambdaQuery().eq(JServicesList::getServicesType, 4).list(); -// //总部企业 -// List list3 = jHeadQuartersRevenueService.list(); -// for (BmsEnterpriseBasicInfo x : list) { -// for (JServicesList y : list1) { -// if(x.getTyshxydm().equals(y.getTyshxydm())){ -// if(x.getType()==null){ -// x.setType("5"); -// }else { -// x.setType(x.getType()+","+"5"); -// } -// bmsEnterpriseBasicInfoService.updateById(x); -// } -// } -// } -// for (BmsEnterpriseBasicInfo x : list) { -// for (JServicesList y : list2) { -// if(x.getTyshxydm().equals(y.getTyshxydm())){ -// if(x.getType()==null){ -// x.setType("6"); -// }else { -// x.setType(x.getType()+","+"6"); -// } -// bmsEnterpriseBasicInfoService.updateById(x); -// } -// } -// } -// for (BmsEnterpriseBasicInfo x : list) { -// for (JHeadQuartersRevenue y : list3) { -// if (x.getTyshxydm().equals(y.getTyshxydm())) { -// if (x.getType() == null) { -// x.setType("4"); -// } else { -// x.setType(x.getType() + "," + "4"); -// } -// bmsEnterpriseBasicInfoService.updateById(x); -// } -// } -// } -// return success(); -// } - + @ApiOperation(value = "将企业库企业更改分类", response = BmsEnterpriseBasicInfo.class) + @PreAuthorize("@ss.hasAnyRoles('admin')") + @GetMapping(value = "/changeType") + public AjaxResult changeType() { + List list = bmsEnterpriseBasicInfoService.list(); + //生活性服务业 + List list1 = jServicesListService.lambdaQuery().eq(JServicesList::getServicesType, 2).list(); + for (BmsEnterpriseBasicInfo x : list) { + for (JServicesList y : list1) { + if (x.getTyshxydm().equals(y.getTyshxydm())) { + if ("2".equals(x.getType())) { + x.setType("7"); + } else { + x.setType(x.getType() + "," + "7"); + } + bmsEnterpriseBasicInfoService.updateById(x); + } + } + } + return success(); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/entity/BmsEnterpriseBasicInfo.java b/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/entity/BmsEnterpriseBasicInfo.java index ae78899..b0f4a8c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/entity/BmsEnterpriseBasicInfo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/jjh/declaration/entity/BmsEnterpriseBasicInfo.java @@ -41,9 +41,9 @@ public class BmsEnterpriseBasicInfo extends BaseInfoEntity { /** * 分类 1.规上服务业 2其他 3规上工业 4总部企业 5生产性服务业 6限上批零住餐 */ - @ApiModelProperty("分类 1.规上服务业 2其他 3规上工业 4总部企业 5生产性服务业 6限上批零住餐") + @ApiModelProperty("分类 1.规上服务业 2其他 3规上工业 4总部企业 5生产性服务业 6限上批零住餐 7生活性服务业") @JSONField(serialize = false) - @Excel(name = "分类", readConverterExp = "1.规上服务业 2其他 3规上工业 4总部企业 5生产性服务业 6限上批零住餐") + @Excel(name = "分类", readConverterExp = "1.规上服务业 2其他 3规上工业 4总部企业 5生产性服务业 6限上批零住餐 7生活性服务业") private String type;