diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BAdministrativeController.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BAdministrativeController.java index 553cf73..e4b1ae5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BAdministrativeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BAdministrativeController.java @@ -97,7 +97,7 @@ public class BAdministrativeController extends BaseController { for (BAdministrativeTreeRequest item1 : list) { BAdministrativeTreeRequest parentDto = new BAdministrativeTreeRequest(item1.getCounty(), item1.getSubdistrict(), item1.getInstitutionName()); for (BAdministrativeTreeRequest item2 : listsub) { - if (item2.getSubdistrict()!=null){ + if (item2.getSubdistrict()!=null && !item2.getSubdistrict().equals("")){ if (item2.getSubdistrict().substring(0, 10).equals(item1.getCounty().substring(0, 10))) { BAdministrativeTreeRequest childDto = new BAdministrativeTreeRequest(item2.getCounty(), item2.getSubdistrict(), item2.getInstitutionName()); parentDto.addChild(childDto); 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 97ba756..c8c14f0 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 @@ -67,18 +67,43 @@ public class BPlanEnterpriseController extends BaseController { @ApiOperation(value = "查询计划企业列表") @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); + } return AjaxResult.success(list); } /** - * 查询计划企业表树结构 + * 查询首页 */ - @ApiOperation(value = "查询计划企业表树结构") + @ApiOperation(value = "查询首页",response =BPlanEnterPriseTreeResponse.class ) @GetMapping("/tree") public AjaxResult tree(BPlanEnterprisePageRequest req) { List list = bAdministrativeService.selectBPlanEnterPriseTreeRequestRequestList(req); + int plannedEnterpriseCountSum = list.stream() + .mapToInt(BPlanEnterPriseTreeResponse::getPlannedEnterpriseCount) + .sum(); + int checkEnterpriseCountSum = list.stream() + .mapToInt(BPlanEnterPriseTreeResponse::getCheckEnterpriseCount) + .sum(); + double ptSum = (double) checkEnterpriseCountSum /plannedEnterpriseCountSum; + BPlanEnterPriseTreeResponse resultObject = new BPlanEnterPriseTreeResponse(); + resultObject.setInstitutionName("苏州"); + resultObject.setPlannedEnterpriseCount(plannedEnterpriseCountSum); + resultObject.setCheckEnterpriseCount(checkEnterpriseCountSum); + resultObject.setPt(ptSum); + list.add(resultObject); + + return success(list); // List> groupedList = list.stream() // .collect(Collectors.groupingBy(BPlanEnterPriseTreeResponse::getCounty)) // .values() @@ -99,7 +124,7 @@ public class BPlanEnterpriseController extends BaseController { // cascadingSelectData.add(parentDto); // } //} - return success(list); + } @@ -111,8 +136,8 @@ public class BPlanEnterpriseController extends BaseController { */ @GetMapping("{id}") @ApiOperation(value = "通过主键查询单条计划企业表", response = BPlanEnterprise.class) - public AjaxResult getById(@PathVariable Serializable id) { - return success(bPlanEnterpriseService.getById(id)); + public AjaxResult getById(@PathVariable String id) { + return success(bPlanEnterpriseService.selectById(id)); } /** 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 f07bf0f..0083cc6 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 @@ -1,6 +1,7 @@ package com.ruoyi.programManagement.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; @@ -103,8 +104,6 @@ public class BPlanEnterprise implements Serializable { private String district; - - /** * 计划年份 */ @@ -120,7 +119,6 @@ public class BPlanEnterprise implements Serializable { private String planName; - /** * 计划内容 */ @@ -129,11 +127,18 @@ public class BPlanEnterprise implements Serializable { private String planContent; - /** * 是否重点企业1:是2:否 */ @ApiModelProperty(value = "是否重点企业1:是2:否") private Integer isPoint; + + /** + * 企业名称 + */ + @TableField(exist = false) + @ApiModelProperty(value = "企业名称") + private String entprName; + } 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 index 76666bb..fa90013 100644 --- 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 @@ -11,58 +11,35 @@ import java.util.List; * 行政区划书请求类 */ @Data -@ApiModel("行政区划书请求类") +@ApiModel("首页请求类") public class BPlanEnterPriseTreeResponse { - /** - * 计划id - */ - @ApiModelProperty("计划id") - private Long id; + /** * 所在县(市,区) */ @ApiModelProperty("所在县(市,区)") - private String county; - - /** - * 所在乡镇 - * (街道) - */ - @ApiModelProperty("所在乡镇") - private String subdistrict; - + private String institutionName; - /** - * 企业总数 - */ - @ApiModelProperty("企业总数") - private Integer enterpriseCount; /** - * 已计划数 + * 执法计划数量 */ - @ApiModelProperty("已计划数") + @ApiModelProperty("执法计划数量") private Integer plannedEnterpriseCount; /** - * 已计划重点数 + * 完成执法数量 */ - @ApiModelProperty("已计划重点数") - private Integer planneKeyEnterpriseCount; + @ApiModelProperty("完成执法数量") + private Integer checkEnterpriseCount; /** - * 剩余重点数 + * 百分比 */ - @ApiModelProperty("剩余重点数") - private Integer remainingKeyEnterpriseCount; - - /** - * 名称 - */ - @ApiModelProperty("名称") - private String institutionName; + @ApiModelProperty("百分比") + private double pt; // private List children; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BPlanEnterpriseZhifaResponse.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BPlanEnterpriseZhifaResponse.java index 8336520..b4facbf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BPlanEnterpriseZhifaResponse.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BPlanEnterpriseZhifaResponse.java @@ -20,13 +20,14 @@ public class BPlanEnterpriseZhifaResponse { */ @ApiModelProperty(value = "编号") - + @Excel(name = "编号") private Long id; /** * 检查表id */ @ApiModelProperty(value = "检查表id") + private String longId; /** @@ -106,6 +107,7 @@ public class BPlanEnterpriseZhifaResponse { */ @ApiModelProperty(value = "行政区划") + @Excel(name = "行政区划") private String district; @@ -114,6 +116,7 @@ public class BPlanEnterpriseZhifaResponse { */ @ApiModelProperty(value = "企业名称") + @Excel(name = "企业名称") private String entprName; @@ -122,6 +125,7 @@ public class BPlanEnterpriseZhifaResponse { */ @ApiModelProperty(value = "计划年份") + @Excel(name = "计划年份") private String plannedYear; /** @@ -129,6 +133,7 @@ public class BPlanEnterpriseZhifaResponse { */ @ApiModelProperty(value = "检查状态 1=已检查,2=未检查") + @Excel(name = "检查状态",readConverterExp = "1=已检查,2=未检查") private String checkStatus; } 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 bc61853..1b42bbd 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 @@ -85,5 +85,13 @@ public interface BPlanEnterpriseMapper extends BaseMapper { public List selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise); + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + BPlanEnterprise selectById(String id); + } 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 ead670e..c8b9e37 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 @@ -79,5 +79,14 @@ public interface BPlanEnterpriseService extends IService { */ Map getPlanMx(PlanMxRequest req); + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + BPlanEnterprise selectById(String id); + } 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 7271319..3bb6b9a 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 @@ -98,6 +98,11 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl page(SzEntBasicInfoPageRequest req) { - PageHelper.startPage(1,10); + PageHelper.startPage(req.getPageNum(),req.getPageSize()); List szEntBasicInfos = szEntBasicInfoMapper.page(req); PageInfo pageInfo = new PageInfo<>(szEntBasicInfos); Map result =new HashMap<>(); diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml index f3cfd96..32fde21 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BAdministrativeMapper.xml @@ -52,22 +52,32 @@ diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml index a391362..72fb471 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml @@ -175,6 +175,27 @@ + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/yingji/SzEntBasicInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/SzEntBasicInfoMapper.xml index 855c9d2..97609b8 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/SzEntBasicInfoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/SzEntBasicInfoMapper.xml @@ -316,7 +316,8 @@ ) AS s WHERE s.is_point = 1 - + select s.* from( SELECT a.*, CASE WHEN b.ent_code IS NOT NULL THEN 1 ELSE 2 END AS is_point