diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java index e8b1394..4378b48 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java @@ -8,6 +8,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.programManagement.entity.BKeyEnterprise; import com.ruoyi.programManagement.entity.BPlanEnterprise; import com.ruoyi.programManagement.entity.request.*; +import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse; import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse; import com.ruoyi.programManagement.mapper.BPlanEnterpriseMapper; import com.ruoyi.programManagement.service.BKeyEnterpriseService; @@ -23,8 +24,6 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import java.text.DecimalFormat; -import java.util.ArrayList; import java.util.List; /** @@ -66,17 +65,17 @@ public class BPlanEnterpriseController extends BaseController { @GetMapping("/list") public AjaxResult list(BPlanEnterprise bPlanEnterprise) { List list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise); - for (BPlanEnterprise a : list) { - String enterPriseId = String.valueOf(a.getEnterpriseId()); - BKeyEnterprise count = bKeyEnterpriseService.getByentCode(enterPriseId); - if (count != null) { - a.setIsPoint(1); - } else { - a.setIsPoint(2); - } - - bPlanEnterpriseService.updateById(a); - } +// for (BPlanEnterprise a : list) { +// String enterPriseId = String.valueOf(a.getEnterpriseId()); +// BKeyEnterprise count = bKeyEnterpriseService.getByentCode(enterPriseId); +// if (count != null) { +// a.setIsPoint(1); +// } else { +// a.setIsPoint(2); +// } +// +// bPlanEnterpriseService.updateById(a); +// } return AjaxResult.success(list); } @@ -86,53 +85,9 @@ public class BPlanEnterpriseController extends BaseController { @ApiOperation(value = "查询首页", response = BPlanEnterPriseTreeResponse.class) @GetMapping("/tree") public AjaxResult tree(BPlanEnterprisePageRequest req) { - //区划list - List list = bAdministrativeDivisionService.selectByEnterPrisecountyList(); - //乡镇list - List listsub = bAdministrativeDivisionService.selectByEnterPriseList(); - List cascadingSelectData = new ArrayList<>(); - DecimalFormat decimalFormat = new DecimalFormat("0.00"); - for (BPlanEnterPrisetDistrictRequest item1 : list) { - req.setCode(item1.getDistrictCode()); - //获取计划企业数量 - Integer getEnterPriseCounty=bPlanEnterpriseService.getgetEnterPriseList(req); - //获取完成执法数量 - Integer getEnterPriseFinsh=bPlanEnterpriseService.getEnterPriseFinsh(req); - //完成率 - double result1 = (double) getEnterPriseFinsh / getEnterPriseCounty; - if(getEnterPriseFinsh.equals(0)||getEnterPriseCounty.equals(0)){ - result1=0; - } - if(!getEnterPriseFinsh.equals(0)){ - getEnterPriseFinsh=getEnterPriseFinsh-1; - } - if(!getEnterPriseCounty.equals(0)){ - getEnterPriseCounty=getEnterPriseCounty-1; - } - String formattedResult1 = decimalFormat.format(result1); - BPlanEnterPrisetDistrictRequest parentDto = new BPlanEnterPrisetDistrictRequest(item1.getDistrictCode(),item1.getDistrict(),getEnterPriseCounty,getEnterPriseFinsh,formattedResult1); - for (BPlanEnterPriseTreeRequest item2 : listsub) { - if (item2.getCountyCode() != null && !item2.getCountyCode().equals("")) { - if (item2.getCountyCode().substring(0,6).equals(item1.getDistrictCode())) { - req.setCode(item2.getCountyCode()); - //获取计划企业数量 - Integer getEnterPriseTown=bPlanEnterpriseService.getgetEnterPriseList(req); - //获取完成执法数量 - Integer getEnterPriseTownFinsh=bPlanEnterpriseService.getEnterPriseFinsh(req); - //完成率 - double result2 = (double) getEnterPriseTownFinsh / getEnterPriseTown; - if(getEnterPriseTown.equals(0)||getEnterPriseTownFinsh.equals(0)){ - result2=0; - } - String formattedResult2 = decimalFormat.format(result2); - BPlanEnterPriseTreeRequest childDto = new BPlanEnterPriseTreeRequest(item2.getCounty(), item2.getCountyCode(),item2.getSort(),getEnterPriseTown,getEnterPriseTownFinsh,formattedResult2); - parentDto.addChild(childDto); - } - } - } - cascadingSelectData.add(parentDto); - } - return success(cascadingSelectData); + + + return success(bPlanEnterpriseService.getShouyeList(req)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java index f33100d..b244275 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java @@ -112,20 +112,7 @@ public class BPlanEnterprise implements Serializable { @Excel(name = "计划年份") private String plannedYear; - /** - * 计划标题 - */ - @ApiModelProperty(value = "计划标题") - @Excel(name = "计划标题") - private String planName; - - /** - * 计划内容 - */ - @ApiModelProperty(value = "计划内容") - @Excel(name = "计划内容") - private String planContent; /** @@ -189,7 +176,7 @@ public class BPlanEnterprise implements Serializable { * 0:草稿 1:正式 */ @ApiModelProperty(value = "0:草稿 1:正式") - private Integer status; + private Integer status =0; /** @@ -212,5 +199,6 @@ public class BPlanEnterprise implements Serializable { @ApiModelProperty(value = "1当月 2提前 3滞后") private Integer checkAgeing; + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterPriseTreeRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterPriseTreeRequest.java deleted file mode 100644 index 264e90c..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterPriseTreeRequest.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.ruoyi.programManagement.entity.request; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 行政区划书请求类 - */ -@ApiModel -@Data -@Builder(toBuilder = true) -@NoArgsConstructor - -public class BPlanEnterPriseTreeRequest { - - - /** - * 所在乡镇 - * (街道) - */ - @ApiModelProperty("所在乡镇") - private String county; - - - /** - * 所在乡镇(街道)代码 - */ - @ApiModelProperty("所在乡镇(街道)代码") - private String countyCode; - - - /** - * 排序 - */ - @ApiModelProperty("排序") - private String sort; - - /** - * 计划企业数量 - */ - @ApiModelProperty("计划企业数量") - private Integer enterPriseCounty; - - /** - * 计划企业完成数量 - */ - @ApiModelProperty("计划企业完成数量") - private Integer enterPriseFinsh; - - /** - * 完成率 - */ - @ApiModelProperty("完成率") - private String result; - public BPlanEnterPriseTreeRequest(String county, String countyCode, String sort, Integer enterPriseCounty, Integer enterPriseFinsh,String result) { - this.county = county; - this.countyCode = countyCode; - this.enterPriseCounty = enterPriseCounty; - this.enterPriseFinsh = enterPriseFinsh; - this.result=result; - this.sort = sort; - } - - -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterPriseTreeResponse.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterPriseTreeResponse.java deleted file mode 100644 index fa90013..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterPriseTreeResponse.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.ruoyi.programManagement.entity.request; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -/** - * 行政区划书请求类 - */ -@Data -@ApiModel("首页请求类") -public class BPlanEnterPriseTreeResponse { - - - - /** - * 所在县(市,区) - */ - @ApiModelProperty("所在县(市,区)") - private String institutionName; - - - /** - * 执法计划数量 - */ - @ApiModelProperty("执法计划数量") - private Integer plannedEnterpriseCount; - - /** - * 完成执法数量 - */ - @ApiModelProperty("完成执法数量") - private Integer checkEnterpriseCount; - - /** - * 百分比 - */ - @ApiModelProperty("百分比") - private double pt; - - -// private List children; -// -// -// public BPlanEnterPriseTreeResponse(String county, String subdistrict) { -// this.county = county; -// this.subdistrict = subdistrict; -// this.children = new ArrayList<>(); -// } -// -// public void addChild(BPlanEnterPriseTreeResponse childDto) { -// this.children.add(childDto); -// } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterPrisetDistrictRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterPrisetDistrictRequest.java deleted file mode 100644 index d41bf6a..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterPrisetDistrictRequest.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.ruoyi.programManagement.entity.request; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; -import java.util.List; - -@ApiModel -@Data -@Builder(toBuilder = true) -@NoArgsConstructor -@AllArgsConstructor -public class BPlanEnterPrisetDistrictRequest { - /** - * 区划代码 - */ - @ApiModelProperty("区划代码") - private String districtCode; - /** - * 区划 - */ - @ApiModelProperty("区划") - private String district; - - /** - * 计划企业数量 - */ - @ApiModelProperty("计划企业数量") - private Integer enterPriseCounty; - - /** - * 计划企业完成数量 - */ - @ApiModelProperty("计划企业完成数量") - private Integer enterPriseFinsh; - - - /** - * 完成率 - */ - @ApiModelProperty("完成率") - private String result; - - - private List children; - - public BPlanEnterPrisetDistrictRequest(String districtCode, String district, Integer enterPriseCounty, Integer enterPriseFinsh,String result) { - this.districtCode = districtCode; - this.enterPriseCounty = enterPriseCounty; - this.enterPriseFinsh = enterPriseFinsh; - this.district = district; - this.result=result; - this.children = new ArrayList<>(); - } - - public void addChild(BPlanEnterPriseTreeRequest childDto) { - this.children.add(childDto); - } -} - - - diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterprisePageRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterprisePageRequest.java index f134416..7fa1301 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterprisePageRequest.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/request/BPlanEnterprisePageRequest.java @@ -26,9 +26,13 @@ public class BPlanEnterprisePageRequest { /** - * 计划月份 + * 执法地区 */ - @ApiModelProperty(value = "区划代码") - private String code; + @ApiModelProperty(value = "执法地区") + private String lawAreas; + + + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BPlanEnterPriseTreeResponse.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BPlanEnterPriseTreeResponse.java new file mode 100644 index 0000000..193776c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BPlanEnterPriseTreeResponse.java @@ -0,0 +1,46 @@ +package com.ruoyi.programManagement.entity.response; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 行政区划书请求类 + */ +@Data +@ApiModel("首页请求类") +public class BPlanEnterPriseTreeResponse { + + /** + * 执法地区 + */ + @ApiModelProperty(value = "执法地区") + private String lawAreas; + + + /** + * 排序 + */ + @ApiModelProperty(value = "排序") + private String sort; + /** + * 执法计划数量 + */ + @ApiModelProperty("执法计划数量") + private Integer count; + + /** + * 完成执法数量 + */ + @ApiModelProperty("完成执法数量") + private Integer completed; + + /** + * 百分比 + */ + @ApiModelProperty("百分比") + private double completionRate; + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeDivisionMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeDivisionMapper.java index b2e71a1..b1e6d6f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeDivisionMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeDivisionMapper.java @@ -5,8 +5,6 @@ import java.util.List; import com.ruoyi.programManagement.domain.BAdministrativeDivision; import com.ruoyi.programManagement.entity.request.BAdministrativeDistrictRequest; import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest; -import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeRequest; -import com.ruoyi.programManagement.entity.request.BPlanEnterPrisetDistrictRequest; /** * 行政区划Mapper接口 @@ -81,19 +79,9 @@ public interface BAdministrativeDivisionMapper { - /** - * 行政区划区划树结构 - * - * @return list - */ - List selectByEnterPrisecountyList(); - /** - * 行政区划乡镇树结构 - * - * @return list - */ - List selectByEnterPriseList(); + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeMapper.java index d83a8b4..e6a4864 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BAdministrativeMapper.java @@ -2,7 +2,7 @@ package com.ruoyi.programManagement.mapper; import com.ruoyi.programManagement.entity.BAdministrative; import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest; -import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeResponse; +import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse; import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest; import org.apache.ibatis.annotations.Param; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java index b69a95d..653a8d4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java @@ -2,14 +2,8 @@ package com.ruoyi.programManagement.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.programManagement.entity.BPlanEnterprise; -import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest; -import com.ruoyi.programManagement.entity.request.PlanMxRequest; -import com.ruoyi.programManagement.entity.request.checkResultRequest; -import com.ruoyi.programManagement.entity.request.zhifaRequest; -import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse; -import com.ruoyi.programManagement.entity.response.PlanMxResponse; -import com.ruoyi.programManagement.entity.response.zhifaCountResponse; -import com.ruoyi.programManagement.entity.response.zhifaPlanResponse; +import com.ruoyi.programManagement.entity.request.*; +import com.ruoyi.programManagement.entity.response.*; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -86,21 +80,19 @@ public interface BPlanEnterpriseMapper extends BaseMapper { /** - * 根据执法地区分组统计 - * + * 查询首页数据 * @param req * @return */ - Integer getgetEnterPriseList(@Param("req") BPlanEnterprisePageRequest req); + List getShouyeList(@Param("req")BPlanEnterprisePageRequest req); /** - * 获取计划完成企业数量 - * + * 查询首页明细数据 * @param req * @return */ - Integer getEnterPriseFinsh( @Param("req") BPlanEnterprisePageRequest req); + ListgetShouYeMxList(@Param("req") BPlanEnterprisePageRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java index 4c11a66..14548d1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java @@ -50,75 +50,75 @@ public class EnterpristQuartz { @ApiOperation(value = "定时任务") public AjaxResult updateInformationData() { // 查询szs_enterprise_informa tion表中的数据 - List enterpriseInformationList = szsEnterpriseInformationMapper.selectSzsEnterpriseInformationList(null); - // 遍历数据并更新到b_enterprise_new表中 - List szsList = new ArrayList<>(); - for (SzsEnterpriseInformation enterpriseInformation : enterpriseInformationList) { - BEnterpriseNew enterpriseNew = new BEnterpriseNew(); - enterpriseNew.setEnterpriseId(enterpriseInformation.getUuitNo()); - enterpriseNew.setEnterpriseName(enterpriseInformation.getEnterpriseName()); - enterpriseNew.setDistrict(enterpriseInformation.getSubdistrict()); - enterpriseNew.setSupervisionLarge(enterpriseInformation.getSupervisionLarge()); - // 根据enterpriseId判断数据是否已存在 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("enterprise_id", enterpriseInformation.getUuitNo()); - //获取enterpriseName - szsList.add(enterpriseNew.getEnterpriseName()); - Long count = bEnterpriseNewMapper.selectCount(queryWrapper); - if (count > 0) { - // 更新数据 - bEnterpriseNewMapper.updateBEnterpriseNew(enterpriseNew); - } else { - // 插入数据 - bEnterpriseNewMapper.insertBEnterpriseNew(enterpriseNew); - } - } - // 查询b_enterprise_new表中的所有企业名称 - List enterpriseList = bEnterpriseNewMapper.selectBEnterpriseNewList(null); - // 查询b_standardization表中的所有企业名称 - List standardizationList = bStandardizationMapper.selectBStandardizationList(null); - //更新b_enterprise_new表中匹配的企业的STAND_LEVEL字段 - for (BEnterpriseNew enterprise : enterpriseList) { - for (BStandardization standardization : standardizationList) { - if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) { - // 执行更新操作,例如: - enterprise.setStandLevel(standardization.getStandardizedGrade()); - bEnterpriseNewMapper.updateBEnterpriseNew(enterprise); - } else { - enterprise.setStandLevel("/"); - bEnterpriseNewMapper.updateBEnterpriseNew(enterprise); - } - } - } - // 找出在b_standardization表中存在但在b_enterprise_new表中不存在的企业名称 - List notInEnterpriseNew = new ArrayList<>(); - for (BStandardization standardization : standardizationList) { - boolean found = false; - for (BEnterpriseNew enterprise : enterpriseList) { - if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) { - found = true; - break; - } - } - if (!found) { - BStandardization b = new BStandardization(); - b.setStandardizedGrade(standardization.getStandardizedGrade()); - b.setEnterpriseName(standardization.getEnterpriseName()); - notInEnterpriseNew.add(b); - } +// List enterpriseInformationList = szsEnterpriseInformationMapper.selectSzsEnterpriseInformationList(null); +// // 遍历数据并更新到b_enterprise_new表中 +// List szsList = new ArrayList<>(); +// for (SzsEnterpriseInformation enterpriseInformation : enterpriseInformationList) { +// BEnterpriseNew enterpriseNew = new BEnterpriseNew(); +// enterpriseNew.setEnterpriseId(enterpriseInformation.getUuitNo()); +// enterpriseNew.setEnterpriseName(enterpriseInformation.getEnterpriseName()); +// enterpriseNew.setDistrict(enterpriseInformation.getSubdistrict()); +// enterpriseNew.setSupervisionLarge(enterpriseInformation.getSupervisionLarge()); +// // 根据enterpriseId判断数据是否已存在 +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.eq("enterprise_id", enterpriseInformation.getUuitNo()); +// //获取enterpriseName +// szsList.add(enterpriseNew.getEnterpriseName()); +// Long count = bEnterpriseNewMapper.selectCount(queryWrapper); +// if (count > 0) { +// // 更新数据 +// bEnterpriseNewMapper.updateBEnterpriseNew(enterpriseNew); +// } else { +// // 插入数据 +// bEnterpriseNewMapper.insertBEnterpriseNew(enterpriseNew); +// } +// } +// // 查询b_enterprise_new表中的所有企业名称 +// List enterpriseList = bEnterpriseNewMapper.selectBEnterpriseNewList(null); +// // 查询b_standardization表中的所有企业名称 +// List standardizationList = bStandardizationMapper.selectBStandardizationList(null); +// //更新b_enterprise_new表中匹配的企业的STAND_LEVEL字段 +// for (BEnterpriseNew enterprise : enterpriseList) { +// for (BStandardization standardization : standardizationList) { +// if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) { +// // 执行更新操作,例如: +// enterprise.setStandLevel(standardization.getStandardizedGrade()); +// bEnterpriseNewMapper.updateBEnterpriseNew(enterprise); +// } else { +// enterprise.setStandLevel("/"); +// bEnterpriseNewMapper.updateBEnterpriseNew(enterprise); +// } +// } +// } +// // 找出在b_standardization表中存在但在b_enterprise_new表中不存在的企业名称 +// List notInEnterpriseNew = new ArrayList<>(); +// for (BStandardization standardization : standardizationList) { +// boolean found = false; +// for (BEnterpriseNew enterprise : enterpriseList) { +// if (enterprise.getEnterpriseName().equals(standardization.getEnterpriseName())) { +// found = true; +// break; +// } +// } +// if (!found) { +// BStandardization b = new BStandardization(); +// b.setStandardizedGrade(standardization.getStandardizedGrade()); +// b.setEnterpriseName(standardization.getEnterpriseName()); +// notInEnterpriseNew.add(b); +// } - } - // 查询b_enterprise_new表中的所有企业名称 更新检查时间 - for (BEnterpriseNew a : enterpriseList) { - BEnterpriseNew bEnterpriseNew = new BEnterpriseNew(); - List szEnforExamineList = szEnforExamineService.getByEnterPriseCode(a.getEnterpriseId()); - for (SzEnforExamine b:szEnforExamineList) { - bEnterpriseNew.setId(a.getId()); - bEnterpriseNew.setExamineEndTime(b.getExamineEndTime()); - bEnterpriseNewMapper.updateBEnterpriseNew(bEnterpriseNew); - } - } - return AjaxResult.success(notInEnterpriseNew); + // } +// // 查询b_enterprise_new表中的所有企业名称 更新检查时间 +// for (BEnterpriseNew a : enterpriseList) { +// BEnterpriseNew bEnterpriseNew = new BEnterpriseNew(); +// List szEnforExamineList = szEnforExamineService.getByEnterPriseCode(a.getEnterpriseId()); +// for (SzEnforExamine b:szEnforExamineList) { +// bEnterpriseNew.setId(a.getId()); +// bEnterpriseNew.setExamineEndTime(b.getExamineEndTime()); +// bEnterpriseNewMapper.updateBEnterpriseNew(bEnterpriseNew); +// } +// } + return AjaxResult.success(null); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java index b8e3622..9b73a12 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java @@ -1,14 +1,10 @@ package com.ruoyi.programManagement.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.github.pagehelper.PageInfo; import com.ruoyi.programManagement.entity.BPlanEnterprise; -import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest; -import com.ruoyi.programManagement.entity.request.PlanMxRequest; -import com.ruoyi.programManagement.entity.request.checkResultRequest; -import com.ruoyi.programManagement.entity.request.zhifaRequest; +import com.ruoyi.programManagement.entity.request.*; +import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse; import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse; -import com.ruoyi.programManagement.entity.response.zhifaCountResponse; import com.ruoyi.programManagement.entity.response.zhifaPlanResponse; import java.util.List; @@ -91,19 +87,11 @@ public interface BPlanEnterpriseService extends IService { /** - * 根据执法地区统计计划企业数量 + * 查询首页数据 * @param req * @return */ - Integer getgetEnterPriseList(BPlanEnterprisePageRequest req); - - - /** - * 获取计划完成企业数量 - * @param req - * @return - */ - Integer getEnterPriseFinsh(BPlanEnterprisePageRequest req); + List getShouyeList(BPlanEnterprisePageRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeDivisionService.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeDivisionService.java index 07e9772..772cd34 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeDivisionService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeDivisionService.java @@ -3,8 +3,6 @@ package com.ruoyi.programManagement.service; import com.ruoyi.programManagement.domain.BAdministrativeDivision; import com.ruoyi.programManagement.entity.request.BAdministrativeDistrictRequest; import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest; -import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeRequest; -import com.ruoyi.programManagement.entity.request.BPlanEnterPrisetDistrictRequest; import java.util.List; @@ -79,21 +77,10 @@ public interface IBAdministrativeDivisionService { List selectBycountyList(); - /** - * 行政区划区划树结构 - * - * @return list - */ - List selectByEnterPrisecountyList(); - /** - * 行政区划乡镇树结构 - * - * @return list - */ - List selectByEnterPriseList(); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeService.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeService.java index 5686315..a549517 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBAdministrativeService.java @@ -1,7 +1,7 @@ package com.ruoyi.programManagement.service; import com.ruoyi.programManagement.entity.BAdministrative; -import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeResponse; +import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse; import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest; import java.util.List; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeDivisionServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeDivisionServiceImpl.java index 4a754ba..0768c23 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeDivisionServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeDivisionServiceImpl.java @@ -4,8 +4,6 @@ import java.util.List; import com.ruoyi.programManagement.entity.request.BAdministrativeDistrictRequest; import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest; -import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeRequest; -import com.ruoyi.programManagement.entity.request.BPlanEnterPrisetDistrictRequest; import org.springframework.stereotype.Service; import com.ruoyi.programManagement.mapper.BAdministrativeDivisionMapper; import com.ruoyi.programManagement.domain.BAdministrativeDivision; @@ -100,14 +98,5 @@ public class BAdministrativeDivisionServiceImpl implements IBAdministrativeDivis } - @Override - public List selectByEnterPrisecountyList() { - return bAdministrativeDivisionMapper.selectByEnterPrisecountyList(); - } - - @Override - public List selectByEnterPriseList() { - return bAdministrativeDivisionMapper.selectByEnterPriseList(); - } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeServiceImpl.java index 21be348..297a308 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BAdministrativeServiceImpl.java @@ -2,8 +2,7 @@ package com.ruoyi.programManagement.service.impl; import com.ruoyi.programManagement.entity.BAdministrative; -import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest; -import com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeResponse; +import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse; import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest; import com.ruoyi.programManagement.mapper.BAdministrativeMapper; import com.ruoyi.programManagement.service.IBAdministrativeService; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java index 2b7a440..d99a528 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java @@ -4,19 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.ruoyi.programManagement.entity.BPlanEnterprise; -import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest; -import com.ruoyi.programManagement.entity.request.PlanMxRequest; -import com.ruoyi.programManagement.entity.request.checkResultRequest; -import com.ruoyi.programManagement.entity.request.zhifaRequest; -import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse; -import com.ruoyi.programManagement.entity.response.PlanMxResponse; -import com.ruoyi.programManagement.entity.response.zhifaCountResponse; -import com.ruoyi.programManagement.entity.response.zhifaPlanResponse; +import com.ruoyi.programManagement.entity.request.*; +import com.ruoyi.programManagement.entity.response.*; import com.ruoyi.programManagement.mapper.BPlanEnterpriseMapper; import com.ruoyi.programManagement.service.BPlanEnterpriseService; -import io.swagger.models.auth.In; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.HashMap; @@ -47,13 +39,12 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise) - { + public List selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise) { return bPlanEnterpriseMapper.selectBPlanEnterpriseList(bPlanEnterprise); } @Override - public List getZhifa(checkResultRequest req) { + public List getZhifa(checkResultRequest req) { // if(req.getDistrict()!=null && req.getDistrict().contains("000000000")){ // String result = req.getDistrict().replaceAll("0+$", ""); @@ -68,7 +59,7 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl getzhifacount(zhifaRequest req) { + public Map getzhifacount(zhifaRequest req) { List getZhifa = bPlanEnterpriseMapper.getzhifacount(req); PageHelper.startPage(req.getPageNum(), req.getPageSize()); PageInfo pageInfo = new PageInfo<>(getZhifa); @@ -81,21 +72,20 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl getplan() { return bPlanEnterpriseMapper.getplan(); } @Override - public Map getPlanMx(PlanMxRequest req) { + public Map getPlanMx(PlanMxRequest req) { PageHelper.startPage(req.getPageNum(), req.getPageSize()); List getPlanMx = bPlanEnterpriseMapper.getPlanMx(req); PageInfo pageInfo = new PageInfo<>(getPlanMx); Map result = new HashMap<>(); result.put("total", pageInfo.getTotal()); result.put("list", pageInfo.getList()); - return result; + return result; } @Override @@ -104,13 +94,14 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl getShouyeList(BPlanEnterprisePageRequest req) { + List list = null; + if (req.getLawAreas() != null) { + list=bPlanEnterpriseMapper.getShouYeMxList(req); + } else { + list = bPlanEnterpriseMapper.getShouyeList(req); + } + return list; } diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeDivisionMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeDivisionMapper.xml index bfab8c9..65f72b3 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeDivisionMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeDivisionMapper.xml @@ -45,17 +45,7 @@ from b_administrative_division group by districtCode,district - - + diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml index b96770b..851b87b 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml @@ -50,7 +50,7 @@ from b_administrative - - and enterprise_id = #{enterpriseId} - and enterprise_name like concat('%', #{enterpriseName}, '%') - and district = #{district} - and SUPERVISION_LARGE = #{supervisionLarge} - and RISK_LEVEL = #{riskLevel} - and STAND_LEVEL = #{standLevel} - and EXAMINE_END_TIME = #{examineEndTime} - and create_id = #{createId} - and update_id = #{updateId} - and user_id = #{userId} - and dept_id = #{deptId} + + and enterprise_id = #{enterpriseId} + and enterprise_name like concat('%', + #{enterpriseName}, '%') + + and district = #{district} + and SUPERVISION_LARGE = + #{supervisionLarge} + + and RISK_LEVEL = #{riskLevel} + and STAND_LEVEL = #{standLevel} + and EXAMINE_END_TIME = #{examineEndTime} + and create_id = #{createId} + and update_id = #{updateId} + and user_id = #{userId} + and dept_id = #{deptId} - + - + insert into b_enterprise_new @@ -69,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" remark, user_id, dept_id, - + #{enterpriseId}, #{enterpriseName}, @@ -87,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{remark}, #{userId}, #{deptId}, - + @@ -114,11 +135,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from b_enterprise_new where id = #{id} + delete + from b_enterprise_new + where id = #{id} - delete from b_enterprise_new where id in + delete from b_enterprise_new where id in #{id} diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml index 5c6d7af..ec193c3 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml @@ -4,25 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - + select id, enterprise_id, @@ -37,8 +19,6 @@ dept_id, district, planned_year, - plan_name, - plan_content, is_point, enterprise_name, law_sort, @@ -54,20 +34,49 @@ delete @@ -197,20 +206,22 @@ a.dept_id, a.district, a.planned_year, - a.plan_name, - a.plan_content, a.is_point, a.enterprise_name as entprName from b_plan_enterprise a where a.id = #{id} - + SELECT + IFNULL(law_areas, '合计') AS lawAreas, + MAX(law_sort) AS sort, + COUNT(law_areas) AS count, + SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) AS completed, + 100 * SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) / COUNT(law_areas) AS completion_rate + FROM b_plan_enterprise - - AND district like concat('%', #{req.code}, '%') - and planned_year =#{req.plannedYear} @@ -220,17 +231,24 @@ #{item} - + GROUP BY law_areas WITH ROLLUP + ORDER BY + CASE WHEN GROUPING(law_areas) = 1 THEN 1 ELSE 0 END, + sort + - + SELECT + IFNULL(law_hierarchy, '合计') AS lawAreas, + MAX(law_sort) AS sort, + COUNT(law_areas) AS count, + SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) AS completed, + 100 * SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) / COUNT(law_areas) AS completion_rate + FROM b_plan_enterprise - - AND district like concat('%', #{req.code}, '%') - and planned_year =#{req.plannedYear} @@ -240,10 +258,17 @@ #{item} - and check_status = 1 + + and law_areas =#{req.lawAreas} + + GROUP BY law_hierarchy WITH ROLLUP + ORDER BY + CASE WHEN GROUPING(law_hierarchy) = 1 THEN 1 ELSE 0 END, + sort + \ No newline at end of file