diff --git a/src/main/java/com/cm/inspection/controller/app/resources/BigDataResult.java b/src/main/java/com/cm/inspection/controller/app/resources/BigDataResult.java new file mode 100644 index 0000000..dbb37f8 --- /dev/null +++ b/src/main/java/com/cm/inspection/controller/app/resources/BigDataResult.java @@ -0,0 +1,60 @@ +package com.cm.inspection.controller.app.resources; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 大数据页面返回实体 + */ +public class BigDataResult { + + private Map data = new HashMap(); + + private List list = new ArrayList(); + + private String msg = "加载成功"; + + private String state = "200"; + + public static BigDataResult getInstance() { + return new BigDataResult(); + } + + public Map getData() { + return data; + } + + public void setData(Map data) { + this.data = data; + } + + public List getList() { + if (list == null) { + return new ArrayList<>(); + } + return list; + } + + public void setList(List list) { + this.list = list; + } + + public String getMsg() { + return msg == null ? "" : msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getState() { + return state == null ? "" : state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/src/main/java/com/cm/inspection/controller/app/resources/check/CheckV2CountController.java b/src/main/java/com/cm/inspection/controller/app/resources/check/CheckV2CountController.java new file mode 100644 index 0000000..df7f0ad --- /dev/null +++ b/src/main/java/com/cm/inspection/controller/app/resources/check/CheckV2CountController.java @@ -0,0 +1,47 @@ +package com.cm.inspection.controller.app.resources.check; + + +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import com.cm.inspection.controller.app.resources.BigDataResult; +import com.cm.inspection.service.check.ICheck2Service; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +/** + * 检查统计 + */ + +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "环保检查统计接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/check/v2/"+ISystemConstant.APP_RELEASE_SUFFIX) +public class CheckV2CountController extends AbstractController { + + @Autowired + private ICheck2Service check2Service; + + + + @ApiOperation(value = "统计当月检查总数", notes = "统计当月检查总数接口") + @GetMapping("count-themonthcheckdata") + public BigDataResult countTheMonthData(){ + BigDataResult result = new BigDataResult(); + Map params = new HashMap<>(); + Integer count = check2Service.countTheMonthCheckData(params); + params.put("value",count); + result.setData(params); + return result; + } + + + + + +} diff --git a/src/main/java/com/cm/inspection/controller/app/resources/datadictionary/DatadictionaryController.java b/src/main/java/com/cm/inspection/controller/app/resources/datadictionary/DatadictionaryController.java new file mode 100644 index 0000000..c283af5 --- /dev/null +++ b/src/main/java/com/cm/inspection/controller/app/resources/datadictionary/DatadictionaryController.java @@ -0,0 +1,61 @@ +package com.cm.inspection.controller.app.resources.datadictionary; + +import com.cm.common.constants.ISystemConstant; +import com.cm.common.plugin.pojo.dtos.datadictionary.DataDictionaryDTO; +import com.cm.common.plugin.service.datadictionary.impl.DataDictionaryServiceImpl; +import com.cm.inspection.controller.app.resources.BigDataResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "数据字典接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/datadictionary/"+ISystemConstant.APP_RELEASE_SUFFIX) +public class DatadictionaryController { + + @Autowired + private DataDictionaryServiceImpl dataDictionaryService; + + + + + @ApiOperation(value = "根据父级ID获取", notes = "根据父级ID获取接口") + @GetMapping("get-by-parentid/{parentId}") + public BigDataResult getByParentId(@PathVariable("parentId") String parentId){ + BigDataResult result = new BigDataResult(); + List> list = new ArrayList<>(); + if(!StringUtils.isBlank(parentId)){ + List dataDictionaryDTOS = dataDictionaryService.listDictionaryByParentId(parentId); + for (DataDictionaryDTO dataDictionaryDTO : dataDictionaryDTOS) { + Map params = new HashMap<>(); + params.put("id",dataDictionaryDTO.getDictionaryId()); + params.put("name",dataDictionaryDTO.getDictionaryName()); + list.add(params); + } + } + result.setList(list); + return result; + } + + + + + + + + + + + +} diff --git a/src/main/java/com/cm/inspection/controller/app/resources/enterprise/EnterpriseCountController.java b/src/main/java/com/cm/inspection/controller/app/resources/enterprise/EnterpriseCountController.java new file mode 100644 index 0000000..79108fb --- /dev/null +++ b/src/main/java/com/cm/inspection/controller/app/resources/enterprise/EnterpriseCountController.java @@ -0,0 +1,85 @@ +package com.cm.inspection.controller.app.resources.enterprise; + +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.pojo.ListPage; +import com.cm.common.result.SuccessResultList; +import com.cm.inspection.controller.app.resources.BigDataResult; +import com.cm.inspection.enums.enterpriseTypeEnum; +import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; +import com.cm.inspection.service.enterprise.IEnterpriseService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "环保企业接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/enterprise/"+ISystemConstant.APP_RELEASE_SUFFIX) +public class EnterpriseCountController extends AbstractController { + + @Autowired + private IEnterpriseService enterpriseService; + + + + @ApiOperation(value = "统计企业类型", notes = "统计企业类型接口") + @GetMapping("count-enterprisetype") + public BigDataResult countEnterpriseType(){ + BigDataResult result = new BigDataResult(); + + List> list = new ArrayList(); + + Map params1 = new HashMap<>(); + params1.put("enterpriseType",enterpriseTypeEnum.TYOE_1.getValue()); + Integer count1 = enterpriseService.countEnterprisePollution(params1); + params1.clear(); + params1.put("name",enterpriseTypeEnum.TYOE_1.getSummary()); + params1.put("value",count1); + list.add(params1); + + Map params2 = new HashMap<>(); + params2.put("enterpriseType",enterpriseTypeEnum.TYOE_2.getValue()); + Integer count2 = enterpriseService.countEnterprisePollution(params2); + params2.clear(); + params2.put("name",enterpriseTypeEnum.TYOE_2.getSummary()); + params2.put("value",count2); + list.add(params2); + + Map params3 = new HashMap<>(); + params3.put("enterpriseType",enterpriseTypeEnum.TYOE_3.getValue()); + Integer count3 = enterpriseService.countEnterprisePollution(params3); + params3.clear(); + params3.put("name",enterpriseTypeEnum.TYOE_3.getSummary()); + params3.put("value",count3); + list.add(params3); + + result.setList(list); + return result; + + + } + + + + @ApiOperation(value = "企业列表", notes = "企业列表接口") + @GetMapping("enterprise-list") + public SuccessResultList> enterpriseList(ListPage page){ + Map params = requestParams(); + page.setParams(params); + return enterpriseService.listPage(page); + } + + + + + +} diff --git a/src/main/java/com/cm/inspection/controller/app/resources/taskcheck/TaskcheckV2CountController.java b/src/main/java/com/cm/inspection/controller/app/resources/taskcheck/TaskcheckV2CountController.java new file mode 100644 index 0000000..f2e6980 --- /dev/null +++ b/src/main/java/com/cm/inspection/controller/app/resources/taskcheck/TaskcheckV2CountController.java @@ -0,0 +1,249 @@ +package com.cm.inspection.controller.app.resources.taskcheck; + + +import com.alibaba.fastjson.JSONArray; +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.plugin.oauth.service.department.IDepartmentService; +import com.cm.common.plugin.oauth.service.user.IUserService; +import com.cm.common.plugin.pojo.bos.user.UserDepartmentResourceBO; +import com.cm.common.pojo.ListPage; +import com.cm.common.pojo.dtos.department.DepartmentSortDTO; +import com.cm.common.result.ErrorResult; +import com.cm.common.result.SuccessResultList; +import com.cm.inspection.controller.app.resources.BigDataResult; +import com.cm.inspection.pojo.dtos.taskcheck.v2.TaskCheckDTO; +import com.cm.inspection.service.taskcheck.v2.ITaskCheckService; +import io.swagger.annotations.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "环保任务统计接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/taskcheck/v2/"+ISystemConstant.APP_RELEASE_SUFFIX) +public class TaskcheckV2CountController extends AbstractController { + + @Resource(name = "taskCheckV2Service") + private ITaskCheckService taskCheckService; + @Autowired + private IDepartmentService departmentService; + @Autowired + private IUserService userService; + + @Value("${count-big-data.jiniqu-dept-id}") + protected String jinniquId; + @Value("${count-big-data.shengtaiwei-dept-id}") + protected String shengtaiweiId; + + + + @ApiOperation(value = "检查任务分页列表", notes = "检查任务分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpagetask") + public SuccessResultList> listPageTask(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return taskCheckService.listPageTask(page); + } + + + + + @ApiOperation(value = "统计当月任务总数", notes = "统计当月任务总数接口") + @GetMapping("count-themonthtaskcheckdata") + public BigDataResult countTheMonthTaskCheckData(){ + BigDataResult result = new BigDataResult(); + Map params = new HashMap<>(); + Integer count = taskCheckService.countTheMonthTaskData(params); + params.put("value",count); + result.setData(params); + return result; + } + + + + @ApiOperation(value = "统计任务完成度占比", notes = "统计任务完成度占比接口") + @GetMapping("count-taskenterprise") + public BigDataResult countTaskEnterprise(){ + BigDataResult result = new BigDataResult(); + List> list = new ArrayList<>(); + + Map params0 = new HashMap<>(); + params0.put("isCompleted","0"); + Integer integer0 = taskCheckService.countTaskEnterprise(params0); + params0.clear(); + params0.put("name","未完成"); + params0.put("value",integer0); + list.add(params0); + + + Map params1 = new HashMap<>(); + params1.put("isCompleted","1"); + Integer integer1 = taskCheckService.countTaskEnterprise(params1); + params1.clear(); + params1.put("name","已完成"); + params1.put("value",integer1); + list.add(params1); + + result.setList(list); + return result; + } + + + + + + + + @ApiOperation(value = "统计集宁区各科室任务信息", notes = "统计集宁区各科室任务信息接口") + @GetMapping("count-jiniqu-dept-taskcheckdata") + public BigDataResult countDepartmentTaskCheckData1(){ + BigDataResult result = new BigDataResult(); + List> list = new ArrayList<>(); + if(StringUtils.isBlank(jinniquId)){ + result.setList(list); + return result; + } + List departmentSortDTOS = departmentService.listSortByParentId(jinniquId); + for (DepartmentSortDTO departmentSortDTO : departmentSortDTOS) { + Integer count0 = 0; + Integer count1 = 0; + //查询部门用户 + List deptList =new ArrayList<>(); + deptList.add(departmentSortDTO.getDepartmentId()); + final List userIds = this.deptUserUtils(userService.listUserDepartmentResourceByDepartmentIds(deptList)); + if(userIds.size() > 0){ + //统计未完成 + Map params0 = new HashMap<>(); + params0.put("isCompleted","0"); + params0.put("checkUserIds",userIds); + count0 = taskCheckService.countTaskEnterprise(params0); + + //统计已完成 + Map params1 = new HashMap<>(); + params1.put("isCompleted","1"); + params1.put("checkUserIds",userIds); + count1 = taskCheckService.countTaskEnterprise(params1); + } + + //参数封装 + Map params = new HashMap<>(); + params.put("name",departmentSortDTO.getDepartmentName()); + + deptList.clear(); + deptList.add(count1.toString());//完成 + deptList.add(count0.toString());//未完成 + + params.put("columns",deptList); + list.add(params); + } + + result.setList(list); + + return result; + } + + + @ApiOperation(value = "统计生态委各科室任务信息", notes = "统计集宁区各科室任务信息接口") + @GetMapping("count-shengtaiwei-dept-taskcheckdata") + public BigDataResult countDepartmentTaskCheckData2(){ + BigDataResult result = new BigDataResult(); + List> list = new ArrayList<>(); + if(StringUtils.isBlank(shengtaiweiId)){ + result.setList(list); + return result; + } + + List departmentSortDTOS = departmentService.listSortByParentId(shengtaiweiId); + for (DepartmentSortDTO departmentSortDTO : departmentSortDTOS) { + Integer count0 = 0; + Integer count1 = 0; + //查询部门用户 + List deptList =new ArrayList<>(); + deptList.add(departmentSortDTO.getDepartmentId()); + final List userIds = this.deptUserUtils(userService.listUserDepartmentResourceByDepartmentIds(deptList)); + if(userIds.size() > 0){ + //统计未完成 + Map params0 = new HashMap<>(); + params0.put("isCompleted","0"); + params0.put("checkUserIds",userIds); + count0 = taskCheckService.countTaskEnterprise(params0); + + //统计已完成 + Map params1 = new HashMap<>(); + params1.put("isCompleted","1"); + params1.put("checkUserIds",userIds); + count1 = taskCheckService.countTaskEnterprise(params1); + } + + //参数封装 + Map params = new HashMap<>(); + params.put("name",departmentSortDTO.getDepartmentName()); + + deptList.clear(); + deptList.add(count1.toString());//完成 + deptList.add(count0.toString());//未完成 + + params.put("columns",deptList); + list.add(params); + } + + result.setList(list); + + Map dataParams = new HashMap<>(); + List dataList = new ArrayList<>(); + dataList.add("已完成"); + dataList.add("未完成"); + dataParams.put("nameColumns",dataList); + + result.setData(dataParams); + + return result; + } + + @ApiOperation(value = "获取生态委科室数据", notes = "获取生态委科室数据接口") + @GetMapping("departmentdata-shengtaiwei") + public BigDataResult departmentData(){ + BigDataResult result = new BigDataResult(); + List> list = new ArrayList<>(); + List departmentSortDTOS = departmentService.listSortByParentId(shengtaiweiId); + for (DepartmentSortDTO departmentSortDTO : departmentSortDTOS) { + Map params = new HashMap<>(); + params.put("id",departmentSortDTO.getDepartmentId()); + params.put("name",departmentSortDTO.getDepartmentName()); + list.add(params); + } + result.setList(list); + return result; + } + + + + public List deptUserUtils(List list){ + List userList = new ArrayList<>(); + + for (UserDepartmentResourceBO ub : list) { + userList.add(ub.getUserId()); + } + return userList; + } + + +} diff --git a/src/main/java/com/cm/inspection/dao/check/ICheck2Dao.java b/src/main/java/com/cm/inspection/dao/check/ICheck2Dao.java index 0aa5bdf..12f97e4 100644 --- a/src/main/java/com/cm/inspection/dao/check/ICheck2Dao.java +++ b/src/main/java/com/cm/inspection/dao/check/ICheck2Dao.java @@ -21,6 +21,14 @@ import java.util.Map; @Repository public interface ICheck2Dao { + /** + * 统计当月的检查数量 + * @param params + * @return + * @throws SearchException + */ + Integer countTheMonthCheckData(Map params) throws SearchException; + /** * 新增检查表 * diff --git a/src/main/java/com/cm/inspection/dao/enterprise/IEnterpriseDao.java b/src/main/java/com/cm/inspection/dao/enterprise/IEnterpriseDao.java index be09679..0fc429d 100644 --- a/src/main/java/com/cm/inspection/dao/enterprise/IEnterpriseDao.java +++ b/src/main/java/com/cm/inspection/dao/enterprise/IEnterpriseDao.java @@ -148,4 +148,13 @@ public interface IEnterpriseDao { * @throws SearchException */ List listEnterprisePollution(Map params) throws SearchException; + + + /** + * 统计污染因子 + * @param params + * @return + * @throws SearchException + */ + Integer countEnterprisePollution(Map params) throws SearchException; } diff --git a/src/main/java/com/cm/inspection/dao/taskcheck/v2/ITaskCheckDao.java b/src/main/java/com/cm/inspection/dao/taskcheck/v2/ITaskCheckDao.java index 7bc3ea7..4697caa 100644 --- a/src/main/java/com/cm/inspection/dao/taskcheck/v2/ITaskCheckDao.java +++ b/src/main/java/com/cm/inspection/dao/taskcheck/v2/ITaskCheckDao.java @@ -25,6 +25,23 @@ import java.util.Map; */ @Repository("taskCheckV2Dao") public interface ITaskCheckDao { + + /** + * 统计当月任务数量 + * @param params + * @return + * @throws SearchException + */ + Integer countTheMonthTaskData(Map params) throws SearchException; + + /** + * 统计任务企业表 + * @param params + * @return + * @throws SearchException + */ + Integer countTaskEnterprise(Map params) throws SearchException; + /** * 保存任务 * diff --git a/src/main/java/com/cm/inspection/enums/enterpriseTypeEnum.java b/src/main/java/com/cm/inspection/enums/enterpriseTypeEnum.java new file mode 100644 index 0000000..9c2eaaf --- /dev/null +++ b/src/main/java/com/cm/inspection/enums/enterpriseTypeEnum.java @@ -0,0 +1,28 @@ +package com.cm.inspection.enums; + + +/** + * 企业类型枚举类 + */ +public enum enterpriseTypeEnum { + TYOE_1("1","重点监督"), + TYOE_2("2","常态监督"), + TYOE_3("3","优良企业"); + + private String value; + private String summary; + + enterpriseTypeEnum(String value, String summary) { + this.value = value; + this.summary = summary; + } + + public String getValue() { + return value == null ? "" : value; + } + + public String getSummary() { + return summary == null ? "" : summary; + } + +} diff --git a/src/main/java/com/cm/inspection/pojo/dtos/enterprise/EnterprisePollutionDTO.java b/src/main/java/com/cm/inspection/pojo/dtos/enterprise/EnterprisePollutionDTO.java index 6ff27d5..8c6974f 100644 --- a/src/main/java/com/cm/inspection/pojo/dtos/enterprise/EnterprisePollutionDTO.java +++ b/src/main/java/com/cm/inspection/pojo/dtos/enterprise/EnterprisePollutionDTO.java @@ -19,8 +19,12 @@ import java.io.Serializable; public class EnterprisePollutionDTO implements Serializable { private static final long serialVersionUID = -5026176927054951270L; + @ApiModelProperty(name = "enterpriseId", value = "企业ID") private String enterpriseId; + @ApiModelProperty(name = "enterpriseType", value = "企业类型") + private String enterpriseType; + @ApiModelProperty(name = "pollutionFactor", value = "污染因子") private String pollutionFactor; @ApiModelProperty(name = "pollutionFactorDangerous", value = "污染因子危险废物") @@ -46,6 +50,18 @@ public class EnterprisePollutionDTO implements Serializable { this.enterpriseId = enterpriseId; } + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public String getEnterpriseType() { + return enterpriseType; + } + + public void setEnterpriseType(String enterpriseType) { + this.enterpriseType = enterpriseType; + } + public String getPollutionFactor() { return pollutionFactor == null ? "" : pollutionFactor.trim(); } diff --git a/src/main/java/com/cm/inspection/pojo/vos/enterprise/EnterprisePollutionVO.java b/src/main/java/com/cm/inspection/pojo/vos/enterprise/EnterprisePollutionVO.java index bb6f078..4050f1e 100644 --- a/src/main/java/com/cm/inspection/pojo/vos/enterprise/EnterprisePollutionVO.java +++ b/src/main/java/com/cm/inspection/pojo/vos/enterprise/EnterprisePollutionVO.java @@ -18,6 +18,8 @@ import java.io.Serializable; @ApiModel public class EnterprisePollutionVO { + @ApiModelProperty(name = "enterpriseType", value = "企业类型") + private String enterpriseType; @ApiModelProperty(name = "pollutionFactor", value = "污染因子") private String pollutionFactor; @ApiModelProperty(name = "pollutionFactorDangerous", value = "污染因子危险废物") @@ -35,6 +37,14 @@ public class EnterprisePollutionVO { @ApiModelProperty(name = "relatedDocuments", value = "相关文件") private String relatedDocuments; + public String getEnterpriseType() { + return enterpriseType; + } + + public void setEnterpriseType(String enterpriseType) { + this.enterpriseType = enterpriseType; + } + public String getPollutionFactor() { return pollutionFactor == null ? "" : pollutionFactor.trim(); } diff --git a/src/main/java/com/cm/inspection/service/check/ICheck2Service.java b/src/main/java/com/cm/inspection/service/check/ICheck2Service.java index 3b3bf04..8bd3375 100644 --- a/src/main/java/com/cm/inspection/service/check/ICheck2Service.java +++ b/src/main/java/com/cm/inspection/service/check/ICheck2Service.java @@ -25,6 +25,12 @@ public interface ICheck2Service { String BUSINESS_KEY_PREFIX = "check2"; + /** + * 统计当月的检查数据 + * @return + */ + Integer countTheMonthCheckData(Map params); + /** * 新增检查 diff --git a/src/main/java/com/cm/inspection/service/check/impl/Check2ServiceImpl.java b/src/main/java/com/cm/inspection/service/check/impl/Check2ServiceImpl.java index f48f603..4874ea8 100644 --- a/src/main/java/com/cm/inspection/service/check/impl/Check2ServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/check/impl/Check2ServiceImpl.java @@ -84,6 +84,13 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service { private IUserService userService; + public Integer countTheMonthCheckData(Map params){ + return check2Dao.countTheMonthCheckData(params); + } + + + + @Override public void save(String token, Check2VO check2VO) throws Exception { // 如果是任务,将任务标记为已处理 diff --git a/src/main/java/com/cm/inspection/service/enterprise/IEnterpriseService.java b/src/main/java/com/cm/inspection/service/enterprise/IEnterpriseService.java index f2a341a..8239cc9 100644 --- a/src/main/java/com/cm/inspection/service/enterprise/IEnterpriseService.java +++ b/src/main/java/com/cm/inspection/service/enterprise/IEnterpriseService.java @@ -259,4 +259,13 @@ public interface IEnterpriseService { */ List listSimpleByArea(String area1Id, String area2Id, String area3Id, String area4Id, String area5Id); + + /** + * 统计污染因子 + * @param params + * @return + * @throws SearchException + */ + Integer countEnterprisePollution(Map params) throws SearchException; + } diff --git a/src/main/java/com/cm/inspection/service/enterprise/impl/EnterpriseServiceImpl.java b/src/main/java/com/cm/inspection/service/enterprise/impl/EnterpriseServiceImpl.java index 41c9a49..0ca968b 100644 --- a/src/main/java/com/cm/inspection/service/enterprise/impl/EnterpriseServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/enterprise/impl/EnterpriseServiceImpl.java @@ -520,4 +520,10 @@ public class EnterpriseServiceImpl extends BaseService implements IEnterpriseSer return enterpriseDTOs; } + + + public Integer countEnterprisePollution(Map params) throws SearchException { + return enterpriseDao.countEnterprisePollution(params); + } + } diff --git a/src/main/java/com/cm/inspection/service/taskcheck/v2/ITaskCheckService.java b/src/main/java/com/cm/inspection/service/taskcheck/v2/ITaskCheckService.java index 3737d44..0fa02cc 100644 --- a/src/main/java/com/cm/inspection/service/taskcheck/v2/ITaskCheckService.java +++ b/src/main/java/com/cm/inspection/service/taskcheck/v2/ITaskCheckService.java @@ -38,6 +38,22 @@ public interface ITaskCheckService { */ int CHECK_ITEM_LIST_TYPE_CUSTOM = 2; + /** + * 统计企业任务表 + * @param params + * @return + * @throws SearchException + */ + Integer countTaskEnterprise(Map params) throws SearchException; + + /** + * 统计当月任务数量 + * @param params + * @return + * @throws SearchException + */ + Integer countTheMonthTaskData(Map params) throws SearchException; + /** * 新增检查任务 * diff --git a/src/main/java/com/cm/inspection/service/taskcheck/v2/impl/TaskCheckServiceImpl.java b/src/main/java/com/cm/inspection/service/taskcheck/v2/impl/TaskCheckServiceImpl.java index 50e7477..9513f44 100644 --- a/src/main/java/com/cm/inspection/service/taskcheck/v2/impl/TaskCheckServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/taskcheck/v2/impl/TaskCheckServiceImpl.java @@ -82,6 +82,16 @@ public class TaskCheckServiceImpl extends BaseService implements ITaskCheckServi @Autowired private IUserService userService; + public Integer countTheMonthTaskData(Map params) throws SearchException{ + return taskCheckDao.countTheMonthTaskData(params); + } + + public Integer countTaskEnterprise(Map params) throws SearchException{ + return taskCheckDao.countTaskEnterprise(params); + } + + + @Override public SuccessResult save(TaskCheckVO taskCheckVO) throws Exception { // 保存任务 diff --git a/src/main/resources/mybatis/mapper/check/check2-mapper.xml b/src/main/resources/mybatis/mapper/check/check2-mapper.xml index 1b3a757..c512315 100644 --- a/src/main/resources/mybatis/mapper/check/check2-mapper.xml +++ b/src/main/resources/mybatis/mapper/check/check2-mapper.xml @@ -636,5 +636,18 @@ LEFT(t1.gmt_create, 7) = #{checkMonth} + + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml index 951ef5d..a20b682 100644 --- a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml +++ b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml @@ -59,6 +59,7 @@ + @@ -398,6 +399,7 @@ INSERT INTO gen_enterprise_pollution( enterprise_id, + enterprise_type, pollution_factor, pollution_factor_dangerous, pollution_factor_other, @@ -408,6 +410,7 @@ related_documents ) VALUES( #{enterpriseId}, + #{enterpriseType}, #{pollutionFactor}, #{pollutionFactorDangerous}, #{pollutionFactorOther}, @@ -447,6 +450,9 @@ related_documents = #{relatedDocuments}, + + + enterprise_type = #{enterpriseType}, enterprise_id = #{enterpriseId} WHERE @@ -654,6 +660,10 @@ AND t1.remarks = #{remarks} + + AND + t1.industry_type = #{industryType} + AND t1.enterprise_id IN @@ -725,6 +735,7 @@ SELECT enterprise_id, + enterprise_type, pollution_factor, pollution_factor_dangerous, pollution_factor_other, @@ -778,4 +790,14 @@ + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/taskcheck/v2/taskcheck-v2-mapper.xml b/src/main/resources/mybatis/mapper/taskcheck/v2/taskcheck-v2-mapper.xml index 6329755..56a54dc 100644 --- a/src/main/resources/mybatis/mapper/taskcheck/v2/taskcheck-v2-mapper.xml +++ b/src/main/resources/mybatis/mapper/taskcheck/v2/taskcheck-v2-mapper.xml @@ -522,4 +522,43 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/enterprise/update-enterprise-pollution.html b/src/main/resources/static/route/enterprise/update-enterprise-pollution.html index 9ee3040..5e0e5cc 100644 --- a/src/main/resources/static/route/enterprise/update-enterprise-pollution.html +++ b/src/main/resources/static/route/enterprise/update-enterprise-pollution.html @@ -25,6 +25,18 @@
+
+ +
+ +
+
+
diff --git a/src/main/resources/static/route/enterprise/v2/update-enterprise-pollution.html b/src/main/resources/static/route/enterprise/v2/update-enterprise-pollution.html index 9ee3040..f4e63af 100644 --- a/src/main/resources/static/route/enterprise/v2/update-enterprise-pollution.html +++ b/src/main/resources/static/route/enterprise/v2/update-enterprise-pollution.html @@ -25,6 +25,8 @@
+ +