From e98dac921b48690ce0e9d31e0d9fe4e0c8d8a570 Mon Sep 17 00:00:00 2001 From: wanggeng888 <450292408@qq.com> Date: Mon, 4 Jan 2021 18:10:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=8E=AF=E4=BF=9D=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E4=BF=9D=E5=AD=98=E3=80=81=E9=9A=8F=E6=9C=BA=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E3=80=81=E9=9A=8F=E6=9C=BA=E7=BD=91=E6=A0=BC=E5=91=98?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkitem/v2/CheckItemController.java | 5 +- ....java => IndustryCheckItemController.java} | 35 ++++---- .../taskcheck/v2/TaskCheckController.java | 88 +++++++++++++++++++ .../checkitem/v2/ICheckItemDao.java | 2 +- .../IEnterpriseOfGridOperatorDao.java | 10 +++ ...mV2Dao.java => IIndustryCheckItemDao.java} | 20 +++-- .../dao/taskcheck/v2/ITaskCheckDao.java | 43 +++++++++ .../enums/task/v2/CheckItemListTypeEnum.java | 36 ++++++++ .../enums/task/v2/TaskTypeEnum.java | 36 ++++++++ .../enums/task/v2/TaskTypeSubEnum.java | 26 ++++++ ...emV2DTO.java => IndustryCheckItemDTO.java} | 2 +- .../dtos/taskcheck/v2/TaskCheckV2DTO.java | 14 +++ ...V2VO.java => IndustryCheckItemBindVO.java} | 2 +- ...ItemV2VO.java => IndustryCheckItemVO.java} | 2 +- .../pojo/vos/taskcheck/v2/TaskCheckVO.java | 87 ++++++++++++++++++ .../enterprise/IEnterpriseService.java | 12 ++- .../checkitem/v2/ICheckItemService.java | 8 ++ .../v2/impl/CheckItemServiceImpl.java | 11 ++- .../impl/EnterpriseServiceImpl.java | 19 +++- .../IEnterpriseOfGridOperatorService.java | 9 ++ .../EnterpriseOfGridOperatorServiceImpl.java | 5 ++ ...ce.java => IIndustryCheckItemService.java} | 42 +++++---- ...java => IndustryCheckItemServiceImpl.java} | 87 +++++++++--------- .../taskcheck/v2/ITaskCheckService.java | 53 +++++++++++ .../mapper/enterprise/enterprise-mapper.xml | 3 +- .../enterpriseofgridoperator-mapper.xml | 19 ++++ ...2-mapper.xml => IIndustryCheckItemDao.xml} | 37 +++++++- .../taskcheck/v2/taskcheck-v2-mapper.xml | 76 ++++++++++++++++ .../v2/list-tree-industrycheckitem-v2.html | 2 +- 29 files changed, 689 insertions(+), 102 deletions(-) rename src/main/java/com/cm/inspection/controller/apis/industrycheckitem/v2/{IndustryCheckItemV2Controller.java => IndustryCheckItemController.java} (74%) create mode 100644 src/main/java/com/cm/inspection/controller/apis/taskcheck/v2/TaskCheckController.java rename src/main/java/com/cm/inspection/dao/industrycheckitem/v2/{IIndustryCheckItemV2Dao.java => IIndustryCheckItemDao.java} (75%) create mode 100644 src/main/java/com/cm/inspection/dao/taskcheck/v2/ITaskCheckDao.java create mode 100644 src/main/java/com/cm/inspection/enums/task/v2/CheckItemListTypeEnum.java create mode 100644 src/main/java/com/cm/inspection/enums/task/v2/TaskTypeEnum.java create mode 100644 src/main/java/com/cm/inspection/enums/task/v2/TaskTypeSubEnum.java rename src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/v2/{IndustryCheckItemV2DTO.java => IndustryCheckItemDTO.java} (99%) create mode 100644 src/main/java/com/cm/inspection/pojo/dtos/taskcheck/v2/TaskCheckV2DTO.java rename src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/{IndustryCheckItemBindV2VO.java => IndustryCheckItemBindVO.java} (96%) rename src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/{IndustryCheckItemV2VO.java => IndustryCheckItemVO.java} (97%) create mode 100644 src/main/java/com/cm/inspection/pojo/vos/taskcheck/v2/TaskCheckVO.java rename src/main/java/com/cm/inspection/service/industrycheckitem/v2/{IIndustryCheckItemV2Service.java => IIndustryCheckItemService.java} (67%) rename src/main/java/com/cm/inspection/service/industrycheckitem/v2/impl/{IndustryCheckItemV2ServiceImpl.java => IndustryCheckItemServiceImpl.java} (64%) create mode 100644 src/main/java/com/cm/inspection/service/taskcheck/v2/ITaskCheckService.java rename src/main/resources/mybatis/mapper/industrycheckitem/v2/{industrycheckitem-v2-mapper.xml => IIndustryCheckItemDao.xml} (83%) create mode 100644 src/main/resources/mybatis/mapper/taskcheck/v2/taskcheck-v2-mapper.xml diff --git a/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitem/v2/CheckItemController.java b/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitem/v2/CheckItemController.java index 3a73ae6..23d3aa1 100644 --- a/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitem/v2/CheckItemController.java +++ b/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitem/v2/CheckItemController.java @@ -20,6 +20,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.List; import java.util.Map; @@ -31,11 +32,11 @@ import java.util.Map; * @Version: 1.0 **/ @Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "企业检查项接口") -@RestController("CheckItemV2Controller") +@RestController("checkItemV2Controller") @RequestMapping(ISystemConstant.API_PREFIX + "/enterprise/checkitem/v2") public class CheckItemController extends AbstractController { - @Autowired + @Resource(name = "checkItemV2Service") private ICheckItemService checkItemService; @Autowired private SecurityComponent securityComponent; diff --git a/src/main/java/com/cm/inspection/controller/apis/industrycheckitem/v2/IndustryCheckItemV2Controller.java b/src/main/java/com/cm/inspection/controller/apis/industrycheckitem/v2/IndustryCheckItemController.java similarity index 74% rename from src/main/java/com/cm/inspection/controller/apis/industrycheckitem/v2/IndustryCheckItemV2Controller.java rename to src/main/java/com/cm/inspection/controller/apis/industrycheckitem/v2/IndustryCheckItemController.java index 1c9c563..a542b98 100644 --- a/src/main/java/com/cm/inspection/controller/apis/industrycheckitem/v2/IndustryCheckItemV2Controller.java +++ b/src/main/java/com/cm/inspection/controller/apis/industrycheckitem/v2/IndustryCheckItemController.java @@ -10,12 +10,9 @@ import com.cm.common.pojo.dtos.CurrentUserIdInfoDTO; import com.cm.common.result.ErrorResult; import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultList; -import com.cm.inspection.pojo.dtos.industrycheckitem.IndustryCheckItemDTO; -import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemV2DTO; -import com.cm.inspection.pojo.vos.industrycheckitem.IndustryCheckItemBindVO; -import com.cm.inspection.pojo.vos.industrycheckitem.v2.IndustryCheckItemBindV2VO; -import com.cm.inspection.service.industrycheckitem.IIndustryCheckItemService; -import com.cm.inspection.service.industrycheckitem.v2.IIndustryCheckItemV2Service; +import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemDTO; +import com.cm.inspection.pojo.vos.industrycheckitem.v2.IndustryCheckItemBindVO; +import com.cm.inspection.service.industrycheckitem.v2.IIndustryCheckItemService; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -31,12 +28,12 @@ import java.util.Map; * @Version: 1.0 **/ @Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "行业检查项接口") -@RestController +@RestController("industryCheckItemV2Controller") @RequestMapping(ISystemConstant.API_PREFIX + "/industrycheckitem/v2") -public class IndustryCheckItemV2Controller extends AbstractController { +public class IndustryCheckItemController extends AbstractController { @Autowired - private IIndustryCheckItemV2Service industryCheckItemV2Service; + private IIndustryCheckItemService industryCheckItemService; @Autowired private SecurityComponent securityComponent; @@ -44,8 +41,8 @@ public class IndustryCheckItemV2Controller extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("saveindustrycheckitembyindustryid/{industryId}") @CheckRequestBodyAnnotation - public SuccessResult saveIndustryCheckItemByNatureId(@PathVariable("industryId") String industryId, @RequestBody IndustryCheckItemBindV2VO industryCheckItemBindV2VO) throws Exception { - return industryCheckItemV2Service.saveIndustryCheckItemByNatureId(industryId, industryCheckItemBindV2VO); + public SuccessResult saveIndustryCheckItemByNatureId(@PathVariable("industryId") String industryId, @RequestBody IndustryCheckItemBindVO industryCheckItemBindVO) throws Exception { + return industryCheckItemService.saveIndustryCheckItemByNatureId(industryId, industryCheckItemBindVO); } @ApiOperation(value = "行业检查项详情(通过ID)", notes = "行业检查项详情(通过ID)接口") @@ -54,25 +51,25 @@ public class IndustryCheckItemV2Controller extends AbstractController { }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("getindustrycheckitembyid/{industryCheckItemId}") - public IndustryCheckItemV2DTO getIndustryCheckItemById(@PathVariable("industryCheckItemId") String industryCheckItemId) throws SearchException { - return industryCheckItemV2Service.getIndustryCheckItemById(industryCheckItemId); + public IndustryCheckItemDTO getIndustryCheckItemById(@PathVariable("industryCheckItemId") String industryCheckItemId) throws SearchException { + return industryCheckItemService.getIndustryCheckItemById(industryCheckItemId); } @ApiOperation(value = "行业检查项列表", notes = "行业检查项列表接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listindustrycheckitem") - public List listIndustryCheckItem() throws SearchException { + public List listIndustryCheckItem() throws SearchException { Map params = requestParams(); - return industryCheckItemV2Service.listIndustryCheckItem(params); + return industryCheckItemService.listIndustryCheckItem(params); } @ApiOperation(value = "行业检查项列表(通过场所性质)", notes = "行业检查项列表(通过行业类型)接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listindustrycheckitembyindustryid/{industryId}") - public List listIndustryCheckItemByNatureId(@PathVariable("industryId") String industryId) throws SearchException { + public List listIndustryCheckItemByNatureId(@PathVariable("industryId") String industryId) throws SearchException { Map params = requestParams(); params.put("industryId", industryId); - return industryCheckItemV2Service.listIndustryCheckItem(params); + return industryCheckItemService.listIndustryCheckItem(params); } @ApiOperation(value = "行业检查项分页列表", notes = "行业检查项分页列表接口") @@ -85,10 +82,10 @@ public class IndustryCheckItemV2Controller extends AbstractController { }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listpageindustrycheckitem") - public SuccessResultList> listPageIndustryCheckItem(ListPage page) throws SearchException { + public SuccessResultList> listPageIndustryCheckItem(ListPage page) throws SearchException { Map params = requestParams(); page.setParams(params); - return industryCheckItemV2Service.listPageIndustryCheckItem(page); + return industryCheckItemService.listPageIndustryCheckItem(page); } @ApiOperation(value = "当前用户id信息", notes = "当前用户id信息接口") diff --git a/src/main/java/com/cm/inspection/controller/apis/taskcheck/v2/TaskCheckController.java b/src/main/java/com/cm/inspection/controller/apis/taskcheck/v2/TaskCheckController.java new file mode 100644 index 0000000..7d81c4c --- /dev/null +++ b/src/main/java/com/cm/inspection/controller/apis/taskcheck/v2/TaskCheckController.java @@ -0,0 +1,88 @@ +package com.cm.inspection.controller.apis.taskcheck.v2; + +import com.cm.common.annotation.CheckRequestBodyAnnotation; +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.exception.ParamsException; +import com.cm.common.result.ErrorResult; +import com.cm.common.result.SuccessResult; +import com.cm.common.utils.RegexUtil; +import com.cm.inspection.enums.task.v2.TaskTypeSubEnum; +import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; +import com.cm.inspection.pojo.dtos.gridpersonnel.GridPersonnelDTO; +import com.cm.inspection.pojo.vos.taskcheck.v2.TaskCheckVO; +import com.cm.inspection.service.taskcheck.v2.ITaskCheckService; +import io.swagger.annotations.*; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: TaskCheckV2Controller + * @Description: 环保检查任务 + * @Author: wanggeng + * @Date: 2021/1/3 12:19 下午 + * @Version: 1.0 + */ +@Data +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "环保检查任务") +@RestController("TaskCheckV2Controller") +@RequestMapping(ISystemConstant.API_PREFIX + "/taskcheck//v2") +public class TaskCheckController extends AbstractController { + + @Resource(name = "taskCheckV2Service") + private ITaskCheckService taskCheckService; + + @ApiOperation(value = "新增检查任务", notes = "新增检查任务接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public synchronized SuccessResult save(@RequestBody TaskCheckVO taskCheckVO) throws Exception { + if (taskCheckVO.getTaskTypeSub() == TaskTypeSubEnum.LIMIT.getValue()) { + if (StringUtils.isBlank(taskCheckVO.getStartTime())) { + throw new ParamsException("开始时间不能为空"); + } + if (RegexUtil.isDatetime(taskCheckVO.getStartTime())) { + throw new ParamsException("开始时间格式错误"); + } + if (StringUtils.isBlank(taskCheckVO.getEndTime())) { + throw new ParamsException("结束时间不能为空"); + } + + if (RegexUtil.isDatetime(taskCheckVO.getEndTime())) { + throw new ParamsException("结束时间格式错误"); + } + } + return taskCheckService.save(taskCheckVO); + } + + @ApiOperation(value = "随机企业列表", notes = "随机企业列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "randomCount", value = "随机数", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listrandomenterprise/{randomCount}") + public List listRandomEnterprise(@PathVariable("randomCount") Integer randomCount) { + Map params = requestParams(); + return taskCheckService.listRandomEnterprise(randomCount, params); + } + + @ApiOperation(value = "随机网格员列表", notes = "随机网格员列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "randomCount", value = "随机数", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listrandomgridpersonnel/{randomCount}") + public List listRandomGridPersonnel(@PathVariable("randomCount") Integer randomCount) { + Map params = requestParams(); + return taskCheckService.listRandomGridPersonnel(randomCount, params); + } + +} diff --git a/src/main/java/com/cm/inspection/dao/enterprise/checkitem/v2/ICheckItemDao.java b/src/main/java/com/cm/inspection/dao/enterprise/checkitem/v2/ICheckItemDao.java index a015138..88b1631 100644 --- a/src/main/java/com/cm/inspection/dao/enterprise/checkitem/v2/ICheckItemDao.java +++ b/src/main/java/com/cm/inspection/dao/enterprise/checkitem/v2/ICheckItemDao.java @@ -18,7 +18,7 @@ import java.util.Map; * @Date: 2020-03-25 22:59 * @Version: 1.0 **/ -@Repository("ICheckItemV2Dao") +@Repository("checkItemV2Dao") public interface ICheckItemDao { /** diff --git a/src/main/java/com/cm/inspection/dao/enterpriseofgridoperator/IEnterpriseOfGridOperatorDao.java b/src/main/java/com/cm/inspection/dao/enterpriseofgridoperator/IEnterpriseOfGridOperatorDao.java index 5c859ab..18c406b 100644 --- a/src/main/java/com/cm/inspection/dao/enterpriseofgridoperator/IEnterpriseOfGridOperatorDao.java +++ b/src/main/java/com/cm/inspection/dao/enterpriseofgridoperator/IEnterpriseOfGridOperatorDao.java @@ -137,9 +137,19 @@ public interface IEnterpriseOfGridOperatorDao { /** * 统计认领企业 + * * @param params * @return * @throws SearchException */ Integer countEnterpriseOfGridOperatorSimple(Map params) throws SearchException; + + /** + * 企业网格员列表(简单格式) + * + * @param params + * @return + * @throws SearchException + */ + List listSimple(Map params) throws SearchException; } diff --git a/src/main/java/com/cm/inspection/dao/industrycheckitem/v2/IIndustryCheckItemV2Dao.java b/src/main/java/com/cm/inspection/dao/industrycheckitem/v2/IIndustryCheckItemDao.java similarity index 75% rename from src/main/java/com/cm/inspection/dao/industrycheckitem/v2/IIndustryCheckItemV2Dao.java rename to src/main/java/com/cm/inspection/dao/industrycheckitem/v2/IIndustryCheckItemDao.java index 21f5681..02bdb45 100644 --- a/src/main/java/com/cm/inspection/dao/industrycheckitem/v2/IIndustryCheckItemV2Dao.java +++ b/src/main/java/com/cm/inspection/dao/industrycheckitem/v2/IIndustryCheckItemDao.java @@ -4,8 +4,7 @@ import com.cm.common.exception.RemoveException; import com.cm.common.exception.SaveException; import com.cm.common.exception.SearchException; import com.cm.common.exception.UpdateException; -import com.cm.inspection.pojo.dtos.industrycheckitem.IndustryCheckItemDTO; -import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemV2DTO; +import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemDTO; import org.springframework.stereotype.Repository; import java.util.List; @@ -18,8 +17,8 @@ import java.util.Map; * @Date: 2020-03-27 22:12 * @Version: 1.0 **/ -@Repository -public interface IIndustryCheckItemV2Dao { +@Repository("industryCheckItemV2Dao") +public interface IIndustryCheckItemDao { /** * 新增行业检查项 @@ -60,7 +59,7 @@ public interface IIndustryCheckItemV2Dao { * @return * @throws SearchException */ - IndustryCheckItemV2DTO getIndustryCheckItem(Map params) throws SearchException; + IndustryCheckItemDTO getIndustryCheckItem(Map params) throws SearchException; /** * 行业检查项列表 @@ -69,7 +68,14 @@ public interface IIndustryCheckItemV2Dao { * @return * @throws SearchException */ - List listIndustryCheckItem(Map params) throws SearchException; - + List listIndustryCheckItem(Map params) throws SearchException; + /** + * 行业检查项列表 + * + * @param params + * @return + * @throws SearchException + */ + List listSimple(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 new file mode 100644 index 0000000..8773ea6 --- /dev/null +++ b/src/main/java/com/cm/inspection/dao/taskcheck/v2/ITaskCheckDao.java @@ -0,0 +1,43 @@ +package com.cm.inspection.dao.taskcheck.v2; + +import com.cm.common.exception.SaveException; +import org.springframework.stereotype.Repository; + +import java.util.Map; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: ITaskCheckV2Dao + * @Description: 环保检查任务 + * @Author: wanggeng + * @Date: 2021/1/3 12:25 下午 + * @Version: 1.0 + */ +@Repository("taskCheckV2Dao") +public interface ITaskCheckDao { + /** + * 保存任务 + * + * @param params + * @throws SaveException + */ + void saveTask(Map params) throws SaveException; + + /** + * 保存任务企业 + * + * @param params + * @throws SaveException + */ + void saveTaskEnterprise(Map params) throws SaveException; + + /** + * 保存任务检查项 + * + * @param params + * @throws SaveException + */ + void saveTaskEnterpriseCheckItem(Map params) throws SaveException; +} diff --git a/src/main/java/com/cm/inspection/enums/task/v2/CheckItemListTypeEnum.java b/src/main/java/com/cm/inspection/enums/task/v2/CheckItemListTypeEnum.java new file mode 100644 index 0000000..1c88213 --- /dev/null +++ b/src/main/java/com/cm/inspection/enums/task/v2/CheckItemListTypeEnum.java @@ -0,0 +1,36 @@ +package com.cm.inspection.enums.task.v2; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: CheckItemListTypeEnum + * @Description: 检查项列表类型 + * @Author: wanggeng + * @Date: 2021/1/3 8:56 下午 + * @Version: 1.0 + */ +public enum CheckItemListTypeEnum { + /** + * 默认项(关联+自定义) + */ + DEFAULT(1), + /** + * 关联项 + */ + RELATION(2), + /** + * 自定义项 + */ + CUSTOM(3); + + private int value; + + CheckItemListTypeEnum(int value) { + this.value = value; + } + + public int getValue() { + return value; + } +} diff --git a/src/main/java/com/cm/inspection/enums/task/v2/TaskTypeEnum.java b/src/main/java/com/cm/inspection/enums/task/v2/TaskTypeEnum.java new file mode 100644 index 0000000..3b079bf --- /dev/null +++ b/src/main/java/com/cm/inspection/enums/task/v2/TaskTypeEnum.java @@ -0,0 +1,36 @@ +package com.cm.inspection.enums.task.v2; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: TaskTypeEnum + * @Description: 环保任务类型 + * @Author: wanggeng + * @Date: 2021/1/3 2:47 下午 + * @Version: 1.0 + */ +public enum TaskTypeEnum { + /** + * 指定任务 + */ + ALLOCATE(1), + /** + * 单随机 + */ + SINGLE_RANDOM(2), + /** + * 双随机 + */ + DOUBLE_RANDOM(3); + + private int value; + + TaskTypeEnum (int value) { + this.value = value; + } + + public int getValue() { + return value; + } +} diff --git a/src/main/java/com/cm/inspection/enums/task/v2/TaskTypeSubEnum.java b/src/main/java/com/cm/inspection/enums/task/v2/TaskTypeSubEnum.java new file mode 100644 index 0000000..29323e4 --- /dev/null +++ b/src/main/java/com/cm/inspection/enums/task/v2/TaskTypeSubEnum.java @@ -0,0 +1,26 @@ +package com.cm.inspection.enums.task.v2; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: TaskTypeSubEnum + * @Description: 环保子任务类型 + * @Author: wanggeng + * @Date: 2021/1/3 2:45 下午 + * @Version: 1.0 + */ +public enum TaskTypeSubEnum { + + UN_LIMIT(1), + LIMIT(2); + private int value; + + TaskTypeSubEnum(int value) { + this.value = value; + } + + public int getValue() { + return value; + } +} diff --git a/src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/v2/IndustryCheckItemV2DTO.java b/src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/v2/IndustryCheckItemDTO.java similarity index 99% rename from src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/v2/IndustryCheckItemV2DTO.java rename to src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/v2/IndustryCheckItemDTO.java index 7755722..f057805 100644 --- a/src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/v2/IndustryCheckItemV2DTO.java +++ b/src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/v2/IndustryCheckItemDTO.java @@ -16,7 +16,7 @@ import java.util.List; * @Version: 1.0 **/ @ApiModel -public class IndustryCheckItemV2DTO implements Serializable { +public class IndustryCheckItemDTO implements Serializable { private static final long serialVersionUID = -3848466845851514488L; @ApiModelProperty(name = "industryCheckItemId", value = "主键") diff --git a/src/main/java/com/cm/inspection/pojo/dtos/taskcheck/v2/TaskCheckV2DTO.java b/src/main/java/com/cm/inspection/pojo/dtos/taskcheck/v2/TaskCheckV2DTO.java new file mode 100644 index 0000000..7fa9cd7 --- /dev/null +++ b/src/main/java/com/cm/inspection/pojo/dtos/taskcheck/v2/TaskCheckV2DTO.java @@ -0,0 +1,14 @@ +package com.cm.inspection.pojo.dtos.taskcheck.v2; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: TaskCheckV2DTO + * @Description: 环保检查任务 + * @Author: wanggeng + * @Date: 2021/1/3 12:29 下午 + * @Version: 1.0 + */ +public class TaskCheckV2DTO { +} diff --git a/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemBindV2VO.java b/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemBindVO.java similarity index 96% rename from src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemBindV2VO.java rename to src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemBindVO.java index b9fcb0b..ad24753 100644 --- a/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemBindV2VO.java +++ b/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemBindVO.java @@ -18,7 +18,7 @@ import java.util.List; * @Version: 1.0 **/ @ApiModel -public class IndustryCheckItemBindV2VO { +public class IndustryCheckItemBindVO { @ApiModelProperty(name = "industryCheckItems", value = "行业性质检查项列表") private List industryCheckItems; diff --git a/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemV2VO.java b/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemVO.java similarity index 97% rename from src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemV2VO.java rename to src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemVO.java index ef2d568..402f0e7 100644 --- a/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemV2VO.java +++ b/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemVO.java @@ -12,7 +12,7 @@ import io.swagger.annotations.ApiModelProperty; * @Version: 1.0 **/ @ApiModel -public class IndustryCheckItemV2VO { +public class IndustryCheckItemVO { @ApiModelProperty(name = "checkItemParentId", value = "检查项上级ID") private String checkItemParentId; diff --git a/src/main/java/com/cm/inspection/pojo/vos/taskcheck/v2/TaskCheckVO.java b/src/main/java/com/cm/inspection/pojo/vos/taskcheck/v2/TaskCheckVO.java new file mode 100644 index 0000000..5b0ce3f --- /dev/null +++ b/src/main/java/com/cm/inspection/pojo/vos/taskcheck/v2/TaskCheckVO.java @@ -0,0 +1,87 @@ +package com.cm.inspection.pojo.vos.taskcheck.v2; + +import com.cm.common.annotation.CheckEmptyAnnotation; +import com.cm.common.annotation.CheckNumberAnnotation; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: TaskCheckV2VO + * @Description: 环保检查任务 + * @Author: wanggeng + * @Date: 2021/1/3 12:28 下午 + * @Version: 1.0 + */ +@Data +@ApiModel +public class TaskCheckVO { + + @ApiModelProperty(name = "taskName", value = "任务名称") + @CheckEmptyAnnotation(name = "任务名称") + private String taskName; + @ApiModelProperty(name = "taskSummary", value = "任务说明") + private String taskSummary; + @ApiModelProperty(name = "taskType", value = "任务种类(1:指定任务,2:单随机任务,3:双随机任务)") + @CheckNumberAnnotation(name = "任务种类", types = {"1", "2", "3"}) + private Integer taskType; + @ApiModelProperty(name = "taskTypeSub", value = "子任务种类(1:不限时任务,2:限时任务)") + @CheckNumberAnnotation(name = "子任务种类", types = {"1", "2"}) + private Integer taskTypeSub; + @ApiModelProperty(name = "checkItemListType", value = "检查项列表类型(1:默认项(关联+自定义),2:关联项,3:自定义项)") + @CheckNumberAnnotation(name = "检查项列表类型", types = {"1", "2", "3"}) + private Integer checkItemListType; + @ApiModelProperty(name = "startTime", value = "开始时间") + private String startTime; + @ApiModelProperty(name = "endTime", value = "结束时间") + private String endTime; + @ApiModelProperty(name = "isAllotted", value = "是否已经分配") + private Integer isAllotted; + @ApiModelProperty(name = "area1Id", value = "1级区域") + private String area1Id; + @ApiModelProperty(name = "area2Id", value = "2级区域") + private String area2Id; + @ApiModelProperty(name = "area3Id", value = "3级区域") + private String area3Id; + @ApiModelProperty(name = "area4Id", value = "4级区域") + private String area4Id; + @ApiModelProperty(name = "area5Id", value = "5级区域") + private String area5Id; + @ApiModelProperty(name = "enterprises", value = "企业列表") + private List enterprises; + + @Data + @ApiModel + public static class EnterpriseVO { + + @ApiModelProperty(name = "enterpriseId", value = "企业ID") + private String enterpriseId; + @ApiModelProperty(name = "industryId", value = "行业ID") + private String industryId; + @ApiModelProperty(name = "checkUserId", value = "检查人ID") + private String checkUserId; + @ApiModelProperty(name = "checkItems", value = "检查项列表") + private List checkItems; + + @Data + @ApiModel + public static class CheckItemVO { + + @ApiModelProperty(name = "checkItemId", value = "检查项ID") + private String checkItemId; + @ApiModelProperty(name = "checkItemParentId", value = "检查项上级ID") + private String checkItemParentId; + @ApiModelProperty(name = "checkItemType", value = "检查项类型") + private Integer checkItemType; + + } + + } + + +} 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 c8e6288..36e5d85 100644 --- a/src/main/java/com/cm/inspection/service/enterprise/IEnterpriseService.java +++ b/src/main/java/com/cm/inspection/service/enterprise/IEnterpriseService.java @@ -238,5 +238,15 @@ public interface IEnterpriseService { */ EnterprisePollutionDTO getEnterprisePollutionByEnterpriseId(String enterpriseId) throws SearchException; - + /** + * 企业列表 + * + * @param area1Id + * @param area2Id + * @param area3Id + * @param area4Id + * @param area5Id + * @return + */ + List listSimpleByArea(String area1Id, String area2Id, String area3Id, String area4Id, String area5Id); } diff --git a/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/ICheckItemService.java b/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/ICheckItemService.java index 8dc9c6d..bbee0f5 100644 --- a/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/ICheckItemService.java +++ b/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/ICheckItemService.java @@ -86,4 +86,12 @@ public interface ICheckItemService { */ SuccessResultList> listPage(ListPage page) throws SearchException; + /** + * 检查项列表 + * + * @param enterpriseId 企业ID + * @return + * @throws SearchException + */ + List listByEnterpriseId(String enterpriseId) throws SearchException; } diff --git a/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/impl/CheckItemServiceImpl.java b/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/impl/CheckItemServiceImpl.java index 2849797..7263bda 100644 --- a/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/impl/CheckItemServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/impl/CheckItemServiceImpl.java @@ -18,6 +18,7 @@ import com.github.pagehelper.PageInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -29,10 +30,10 @@ import java.util.Map; * @Date: 2020-03-25 22:59 * @Version: 1.0 **/ -@Service("CheckItemServiceV2Impl") +@Service("checkItemV2Service") public class CheckItemServiceImpl extends BaseService implements ICheckItemService { - @Autowired + @Resource(name = "checkItemV2Dao") private ICheckItemDao checkItemDao; @Override @@ -93,4 +94,10 @@ public class CheckItemServiceImpl extends BaseService implements ICheckItemServi return new SuccessResultList<>(checkItemDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); } + @Override + public List listByEnterpriseId(String enterpriseId) throws SearchException { + Map params = getHashMap(2); + params.put("enterpriseId", enterpriseId); + return list(params); + } } 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 4420100..cb14b4e 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 @@ -30,10 +30,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @ClassName: EnterpriseServiceImpl @@ -383,6 +380,20 @@ public class EnterpriseServiceImpl extends BaseService implements IEnterpriseSer return enterpriseDao.getEnterprisePollution(params); } + @Override + public List listSimpleByArea(String area1Id, String area2Id, String area3Id, String area4Id, String area5Id) { + Map params = getHashMap(10); + params.put("area1", area1Id); + params.put("area2", area2Id); + params.put("area3", area3Id); + params.put("area4", area4Id); + params.put("area5", area5Id); + List oldEnterprises = listEnterprise(params); + List newEnterprises = new ArrayList<>(oldEnterprises.size()); + Collections.copy(newEnterprises, oldEnterprises); + return newEnterprises; + } + /** * 通过企业ID列表获取企业污染因子列表 * diff --git a/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/IEnterpriseOfGridOperatorService.java b/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/IEnterpriseOfGridOperatorService.java index a890059..1321715 100644 --- a/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/IEnterpriseOfGridOperatorService.java +++ b/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/IEnterpriseOfGridOperatorService.java @@ -226,4 +226,13 @@ public interface IEnterpriseOfGridOperatorService { * @throws SearchException */ Integer countEnterpriseOfGridOperator(Map params) throws SearchException; + + /** + * 企业网格员列表(简单格式) + * + * @param params + * @return + * @throws SearchException + */ + List listSimple(Map params) throws SearchException; } diff --git a/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/impl/EnterpriseOfGridOperatorServiceImpl.java b/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/impl/EnterpriseOfGridOperatorServiceImpl.java index 1d0ac9d..3a6af16 100644 --- a/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/impl/EnterpriseOfGridOperatorServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/enterpriseofgridoperator/impl/EnterpriseOfGridOperatorServiceImpl.java @@ -271,6 +271,11 @@ public class EnterpriseOfGridOperatorServiceImpl extends BaseService implements return count == null ? 0 : count; } + @Override + public List listSimple(Map params) throws SearchException { + return enterpriseOfGridOperatorDao.listSimple(params); + } + /** * 初始化未认领地区 * diff --git a/src/main/java/com/cm/inspection/service/industrycheckitem/v2/IIndustryCheckItemV2Service.java b/src/main/java/com/cm/inspection/service/industrycheckitem/v2/IIndustryCheckItemService.java similarity index 67% rename from src/main/java/com/cm/inspection/service/industrycheckitem/v2/IIndustryCheckItemV2Service.java rename to src/main/java/com/cm/inspection/service/industrycheckitem/v2/IIndustryCheckItemService.java index 76a76a2..40a776a 100644 --- a/src/main/java/com/cm/inspection/service/industrycheckitem/v2/IIndustryCheckItemV2Service.java +++ b/src/main/java/com/cm/inspection/service/industrycheckitem/v2/IIndustryCheckItemService.java @@ -5,12 +5,9 @@ import com.cm.common.exception.SearchException; import com.cm.common.pojo.ListPage; import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultList; -import com.cm.inspection.pojo.dtos.industrycheckitem.IndustryCheckItemDTO; -import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemV2DTO; -import com.cm.inspection.pojo.vos.industrycheckitem.IndustryCheckItemBindVO; -import com.cm.inspection.pojo.vos.industrycheckitem.IndustryCheckItemVO; -import com.cm.inspection.pojo.vos.industrycheckitem.v2.IndustryCheckItemBindV2VO; -import com.cm.inspection.pojo.vos.industrycheckitem.v2.IndustryCheckItemV2VO; +import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemDTO; +import com.cm.inspection.pojo.vos.industrycheckitem.v2.IndustryCheckItemBindVO; +import com.cm.inspection.pojo.vos.industrycheckitem.v2.IndustryCheckItemVO; import java.util.List; import java.util.Map; @@ -22,7 +19,7 @@ import java.util.Map; * @Date: 2020-03-27 22:12 * @Version: 1.0 **/ -public interface IIndustryCheckItemV2Service { +public interface IIndustryCheckItemService { /** * 新增行业检查项 @@ -32,18 +29,18 @@ public interface IIndustryCheckItemV2Service { * @return * @throws Exception */ - SuccessResult saveIndustryCheckItemByNatureId(String industryId, IndustryCheckItemBindV2VO industryCheckItemV2VO) throws Exception; + SuccessResult saveIndustryCheckItemByNatureId(String industryId, IndustryCheckItemBindVO industryCheckItemV2VO) throws Exception; /** * 新增行业检查项(APP) * * @param token * @param industryId - * @param industryCheckItemBindV2VO + * @param industryCheckItemBindVO * @return * @throws Exception */ - SuccessResult saveIndustryCheckItemByNatureIdAndToken(String token, String industryId, IndustryCheckItemBindV2VO industryCheckItemBindV2VO) throws Exception; + SuccessResult saveIndustryCheckItemByNatureIdAndToken(String token, String industryId, IndustryCheckItemBindVO industryCheckItemBindVO) throws Exception; /** * 删除行业检查项 @@ -68,22 +65,22 @@ public interface IIndustryCheckItemV2Service { * 修改行业检查项 * * @param industryCheckItemId - * @param industryCheckItemV2VO + * @param industryCheckItemVO * @return * @throws Exception */ - SuccessResult updateIndustryCheckItem(String industryCheckItemId, IndustryCheckItemV2VO industryCheckItemV2VO) throws Exception; + SuccessResult updateIndustryCheckItem(String industryCheckItemId, IndustryCheckItemVO industryCheckItemVO) throws Exception; /** * 修改行业检查项(APP) * * @param token * @param industryCheckItemId - * @param industryCheckItemV2VO + * @param industryCheckItemVO * @return * @throws Exception */ - SuccessResult updateIndustryCheckItemByToken(String token, String industryCheckItemId, IndustryCheckItemV2VO industryCheckItemV2VO) throws Exception; + SuccessResult updateIndustryCheckItemByToken(String token, String industryCheckItemId, IndustryCheckItemVO industryCheckItemVO) throws Exception; /** * 行业检查项详情(通过ID) @@ -92,7 +89,7 @@ public interface IIndustryCheckItemV2Service { * @return * @throws SearchException */ - IndustryCheckItemV2DTO getIndustryCheckItemById(String industryCheckItemId) throws SearchException; + IndustryCheckItemDTO getIndustryCheckItemById(String industryCheckItemId) throws SearchException; /** * 行业检查项列表 @@ -101,7 +98,7 @@ public interface IIndustryCheckItemV2Service { * @return * @throws SearchException */ - List listIndustryCheckItem(Map params) throws SearchException; + List listIndustryCheckItem(Map params) throws SearchException; /** * 行业检查项分页列表 @@ -110,7 +107,7 @@ public interface IIndustryCheckItemV2Service { * @return * @throws SearchException */ - SuccessResultList> listPageIndustryCheckItem(ListPage page) throws SearchException; + SuccessResultList> listPageIndustryCheckItem(ListPage page) throws SearchException; /** * 获取行业检查项列表(通过场所性质) @@ -119,5 +116,14 @@ public interface IIndustryCheckItemV2Service { * @return * @throws SearchException */ - List listIndustryCheckItemByIndustryId(String industryId) throws SearchException; + List listIndustryCheckItemByIndustryId(String industryId) throws SearchException; + + /** + * 行业检查项列表 + * + * @param industryId + * @return + * @throws SearchException + */ + List listByIndustryId(String industryId) throws SearchException; } diff --git a/src/main/java/com/cm/inspection/service/industrycheckitem/v2/impl/IndustryCheckItemV2ServiceImpl.java b/src/main/java/com/cm/inspection/service/industrycheckitem/v2/impl/IndustryCheckItemServiceImpl.java similarity index 64% rename from src/main/java/com/cm/inspection/service/industrycheckitem/v2/impl/IndustryCheckItemV2ServiceImpl.java rename to src/main/java/com/cm/inspection/service/industrycheckitem/v2/impl/IndustryCheckItemServiceImpl.java index 7b35c53..67a4e06 100644 --- a/src/main/java/com/cm/inspection/service/industrycheckitem/v2/impl/IndustryCheckItemV2ServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/industrycheckitem/v2/impl/IndustryCheckItemServiceImpl.java @@ -7,21 +7,19 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultList; import com.cm.common.utils.HashMapUtil; import com.cm.common.utils.UUIDUtil; -import com.cm.inspection.dao.industrycheckitem.v2.IIndustryCheckItemV2Dao; -import com.cm.inspection.pojo.dtos.industrycheckitem.IndustryCheckItemDTO; -import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemV2DTO; -import com.cm.inspection.pojo.vos.industrycheckitem.IndustryCheckItemBindVO; -import com.cm.inspection.pojo.vos.industrycheckitem.IndustryCheckItemVO; -import com.cm.inspection.pojo.vos.industrycheckitem.v2.IndustryCheckItemBindV2VO; -import com.cm.inspection.pojo.vos.industrycheckitem.v2.IndustryCheckItemV2VO; +import com.cm.inspection.dao.industrycheckitem.v2.IIndustryCheckItemDao; +import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemDTO; +import com.cm.inspection.pojo.vos.industrycheckitem.v2.IndustryCheckItemBindVO; +import com.cm.inspection.pojo.vos.industrycheckitem.v2.IndustryCheckItemVO; import com.cm.inspection.service.BaseService; import com.cm.inspection.service.checkitemoption.ICheckItemOptionService; -import com.cm.inspection.service.industrycheckitem.v2.IIndustryCheckItemV2Service; +import com.cm.inspection.service.industrycheckitem.v2.IIndustryCheckItemService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -33,23 +31,23 @@ import java.util.Map; * @Date: 2020-03-27 22:12 * @Version: 1.0 **/ -@Service -public class IndustryCheckItemV2ServiceImpl extends BaseService implements IIndustryCheckItemV2Service { +@Service("industryCheckItemV2Service") +public class IndustryCheckItemServiceImpl extends BaseService implements IIndustryCheckItemService { - @Autowired - private IIndustryCheckItemV2Dao industryCheckItemV2Dao; + @Resource(name = "industryCheckItemV2Dao") + private IIndustryCheckItemDao industryCheckItemDao; @Autowired private ICheckItemOptionService checkItemOptionService; @Override - public SuccessResult saveIndustryCheckItemByNatureId(String industryId, IndustryCheckItemBindV2VO industryCheckItemBindV2VO) throws Exception { - saveIndustryCheckItemInfo(null, industryId, industryCheckItemBindV2VO); + public SuccessResult saveIndustryCheckItemByNatureId(String industryId, IndustryCheckItemBindVO industryCheckItemBindVO) throws Exception { + saveIndustryCheckItemInfo(null, industryId, industryCheckItemBindVO); return new SuccessResult(); } @Override - public SuccessResult saveIndustryCheckItemByNatureIdAndToken(String token, String industryId, IndustryCheckItemBindV2VO industryCheckItemBindV2VO) throws Exception { - saveIndustryCheckItemInfo(token, industryId, industryCheckItemBindV2VO); + public SuccessResult saveIndustryCheckItemByNatureIdAndToken(String token, String industryId, IndustryCheckItemBindVO industryCheckItemBindVO) throws Exception { + saveIndustryCheckItemInfo(token, industryId, industryCheckItemBindVO); return new SuccessResult(); } @@ -58,16 +56,16 @@ public class IndustryCheckItemV2ServiceImpl extends BaseService implements IIndu * * @param token * @param industryId - * @param industryCheckItemBindV2VO + * @param industryCheckItemBindVO * @throws Exception */ - private void saveIndustryCheckItemInfo(String token, String industryId, IndustryCheckItemBindV2VO industryCheckItemBindV2VO) throws Exception { + private void saveIndustryCheckItemInfo(String token, String industryId, IndustryCheckItemBindVO industryCheckItemBindVO) throws Exception { // 清空原数据 Map params = getHashMap(1); params.put("industryId", industryId); - industryCheckItemV2Dao.deleteIndustryCheckItem(params); + industryCheckItemDao.deleteIndustryCheckItem(params); // 保存数据 - for (IndustryCheckItemVO industryCheckItemVO : industryCheckItemBindV2VO.getIndustryCheckItems()) { + for (com.cm.inspection.pojo.vos.industrycheckitem.IndustryCheckItemVO industryCheckItemVO : industryCheckItemBindVO.getIndustryCheckItems()) { params = HashMapUtil.beanToMap(industryCheckItemVO); params.put("industryCheckItemId", UUIDUtil.getUUID()); params.put("industryId", industryId); @@ -76,7 +74,7 @@ public class IndustryCheckItemV2ServiceImpl extends BaseService implements IIndu } else { setSaveInfo(params); } - industryCheckItemV2Dao.saveIndustryCheckItem(params); + industryCheckItemDao.saveIndustryCheckItem(params); } } @@ -106,18 +104,18 @@ public class IndustryCheckItemV2ServiceImpl extends BaseService implements IIndu } else { setUpdateInfo(params); } - industryCheckItemV2Dao.removeIndustryCheckItem(params); + industryCheckItemDao.removeIndustryCheckItem(params); } @Override - public SuccessResult updateIndustryCheckItem(String industryCheckItemId, IndustryCheckItemV2VO industryCheckItemV2VO) throws Exception { - updateIndustryCheckItemInfo(null, industryCheckItemId, industryCheckItemV2VO); + public SuccessResult updateIndustryCheckItem(String industryCheckItemId, IndustryCheckItemVO industryCheckItemVO) throws Exception { + updateIndustryCheckItemInfo(null, industryCheckItemId, industryCheckItemVO); return new SuccessResult(); } @Override - public SuccessResult updateIndustryCheckItemByToken(String token, String industryCheckItemId, IndustryCheckItemV2VO industryCheckItemV2VO) throws Exception { - updateIndustryCheckItemInfo(token, industryCheckItemId, industryCheckItemV2VO); + public SuccessResult updateIndustryCheckItemByToken(String token, String industryCheckItemId, IndustryCheckItemVO industryCheckItemVO) throws Exception { + updateIndustryCheckItemInfo(token, industryCheckItemId, industryCheckItemVO); return new SuccessResult(); } @@ -126,24 +124,24 @@ public class IndustryCheckItemV2ServiceImpl extends BaseService implements IIndu * * @param token * @param industryCheckItemId - * @param industryCheckItemV2VO + * @param industryCheckItemVO */ - private void updateIndustryCheckItemInfo(String token, String industryCheckItemId, IndustryCheckItemV2VO industryCheckItemV2VO) throws Exception { - Map params = HashMapUtil.beanToMap(industryCheckItemV2VO); + private void updateIndustryCheckItemInfo(String token, String industryCheckItemId, IndustryCheckItemVO industryCheckItemVO) throws Exception { + Map params = HashMapUtil.beanToMap(industryCheckItemVO); params.put("industryCheckItemId", industryCheckItemId); if (token != null) { setUpdateInfo(token, params); } else { setUpdateInfo(params); } - industryCheckItemV2Dao.updateIndustryCheckItem(params); + industryCheckItemDao.updateIndustryCheckItem(params); } @Override - public IndustryCheckItemV2DTO getIndustryCheckItemById(String industryCheckItemId) throws SearchException { + public IndustryCheckItemDTO getIndustryCheckItemById(String industryCheckItemId) throws SearchException { Map params = super.getHashMap(1); params.put("industryCheckItemId", industryCheckItemId); - IndustryCheckItemV2DTO industryCheckItemDTO = industryCheckItemV2Dao.getIndustryCheckItem(params); + IndustryCheckItemDTO industryCheckItemDTO = industryCheckItemDao.getIndustryCheckItem(params); if (industryCheckItemDTO != null) { params.clear(); setCheckItemOptions(industryCheckItemDTO, params); @@ -152,36 +150,43 @@ public class IndustryCheckItemV2ServiceImpl extends BaseService implements IIndu } @Override - public List listIndustryCheckItem(Map params) throws SearchException { - List industryCheckItemDTOs = industryCheckItemV2Dao.listIndustryCheckItem(params); + public List listIndustryCheckItem(Map params) throws SearchException { + List industryCheckItemDTOs = industryCheckItemDao.listIndustryCheckItem(params); params.clear(); setCheckItemOptions(industryCheckItemDTOs, params); return industryCheckItemDTOs; } @Override - public SuccessResultList> listPageIndustryCheckItem(ListPage page) throws SearchException { + public SuccessResultList> listPageIndustryCheckItem(ListPage page) throws SearchException { PageHelper.startPage(page.getPage(), page.getRows()); - List industryCheckItemDTOs = industryCheckItemV2Dao.listIndustryCheckItem(page.getParams()); - PageInfo pageInfo = new PageInfo<>(industryCheckItemDTOs); + List industryCheckItemDTOs = industryCheckItemDao.listIndustryCheckItem(page.getParams()); + PageInfo pageInfo = new PageInfo<>(industryCheckItemDTOs); return new SuccessResultList<>(industryCheckItemDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); } @Override - public List listIndustryCheckItemByIndustryId(String industryId) throws SearchException { + public List listIndustryCheckItemByIndustryId(String industryId) throws SearchException { Map params = getHashMap(1); params.put("industryId", industryId); return listIndustryCheckItem(params); } + @Override + public List listByIndustryId(String industryId) throws SearchException { + Map params = getHashMap(2); + params.put("industryId", industryId); + return industryCheckItemDao.listSimple(params); + } + /** * 设置检查选项 * * @param industryCheckItemDTOs * @param params */ - private void setCheckItemOptions(List industryCheckItemDTOs, Map params) { - for (IndustryCheckItemV2DTO industryCheckItemDTO : industryCheckItemDTOs) { + private void setCheckItemOptions(List industryCheckItemDTOs, Map params) { + for (IndustryCheckItemDTO industryCheckItemDTO : industryCheckItemDTOs) { setCheckItemOptions(industryCheckItemDTO, params); } } @@ -192,7 +197,7 @@ public class IndustryCheckItemV2ServiceImpl extends BaseService implements IIndu * @param industryCheckItemDTO * @param params */ - private void setCheckItemOptions(IndustryCheckItemV2DTO industryCheckItemDTO, Map params) { + private void setCheckItemOptions(IndustryCheckItemDTO industryCheckItemDTO, Map params) { params.put("checkItemId", industryCheckItemDTO.getCheckItemId()); industryCheckItemDTO.setCheckItemOptions(checkItemOptionService.listCheckItemOption(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 new file mode 100644 index 0000000..5cb3df0 --- /dev/null +++ b/src/main/java/com/cm/inspection/service/taskcheck/v2/ITaskCheckService.java @@ -0,0 +1,53 @@ +package com.cm.inspection.service.taskcheck.v2; + +import com.cm.common.exception.SearchException; +import com.cm.common.result.SuccessResult; +import com.cm.common.result.SuccessResultList; +import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; +import com.cm.inspection.pojo.dtos.gridpersonnel.GridPersonnelDTO; +import com.cm.inspection.pojo.vos.taskcheck.v2.TaskCheckVO; + +import java.util.List; +import java.util.Map; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: ITaskCheckV2Service + * @Description: 环保任务检查 + * @Author: wanggeng + * @Date: 2021/1/3 12:23 下午 + * @Version: 1.0 + */ +public interface ITaskCheckService { + + /** + * 新增检查任务 + * + * @param taskCheckVO + * @return + * @throws Exception + */ + SuccessResult save(TaskCheckVO taskCheckVO) throws Exception; + + /** + * 随机企业列表 + * + * @param randomCount 随机数 + * @param params + * @return + * @throws SearchException + */ + List listRandomEnterprise(int randomCount, Map params) throws SearchException; + + /** + * 随机网格员列表 + * + * @param randomCount 随机数 + * @param params + * @return + * @throws SearchException + */ + List listRandomGridPersonnel(Integer randomCount, Map params) throws SearchException; +} diff --git a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml index 8d6ea9f..4c6163c 100644 --- a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml +++ b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml @@ -1,7 +1,8 @@ - + + diff --git a/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml b/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml index 00183ca..3319abe 100644 --- a/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml +++ b/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml @@ -665,4 +665,23 @@ + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/industrycheckitem/v2/industrycheckitem-v2-mapper.xml b/src/main/resources/mybatis/mapper/industrycheckitem/v2/IIndustryCheckItemDao.xml similarity index 83% rename from src/main/resources/mybatis/mapper/industrycheckitem/v2/industrycheckitem-v2-mapper.xml rename to src/main/resources/mybatis/mapper/industrycheckitem/v2/IIndustryCheckItemDao.xml index b68c798..c2870d4 100644 --- a/src/main/resources/mybatis/mapper/industrycheckitem/v2/industrycheckitem-v2-mapper.xml +++ b/src/main/resources/mybatis/mapper/industrycheckitem/v2/IIndustryCheckItemDao.xml @@ -1,8 +1,8 @@ - + - + @@ -173,4 +173,37 @@ + + + \ 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 new file mode 100644 index 0000000..6c4ff20 --- /dev/null +++ b/src/main/resources/mybatis/mapper/taskcheck/v2/taskcheck-v2-mapper.xml @@ -0,0 +1,76 @@ + + + + + + + INSERT INTO gen_task_check_v2( + task_id, + task_name, + task_summary, + task_type, + task_type_sub, + start_time, + end_time, + is_allotted, + creator, + gmt_create, + modifier, + gmt_modified, + is_delete + ) VALUES( + #{taskId}, + #{taskName}, + #{taskSummary}, + #{taskType}, + #{taskTypeSub}, + #{startTime}, + #{endTime}, + #{isAllotted}, + #{creator}, + #{gmtCreate}, + #{modifier}, + #{gmtModified}, + #{isDelete} + ) + + + + + INSERT INTO gen_task_enterprise_v2( + task_enterprise_id, + task_check_id, + enterprise_id, + check_user_id, + is_checked, + check_time, + is_completed + ) VALUES( + #{taskEnterpriseId}, + #{taskCheckId}, + #{enterpriseId}, + #{checkUserId}, + #{isChecked}, + #{checkTime}, + #{isCompleted} + ) + + + + + INSERT INTO gen_task_enterprise_check_item_v2( + task_check_id, + task_enterprise_id, + check_item_id, + check_item_parent_id, + check_item_type + ) VALUES( + #{taskCheckId}, + #{taskEnterpriseId}, + #{checkItemId}, + #{checkItemParentId}, + #{checkItemType} + ) + + + \ No newline at end of file diff --git a/src/main/resources/static/route/industrycheckitem/v2/list-tree-industrycheckitem-v2.html b/src/main/resources/static/route/industrycheckitem/v2/list-tree-industrycheckitem-v2.html index 5cd30cd..175c163 100644 --- a/src/main/resources/static/route/industrycheckitem/v2/list-tree-industrycheckitem-v2.html +++ b/src/main/resources/static/route/industrycheckitem/v2/list-tree-industrycheckitem-v2.html @@ -71,7 +71,7 @@ title: 'dictionaryName', name: 'dictionaryName', id: 'dictionaryId', - children: 'subDictionary' + // children: 'subDictionary' }, }, callback: {