From baf9fe45121b2fd289927869e026e1c771549e76 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Mon, 28 Dec 2020 12:27:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BC=81=E4=B8=9A=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=A3=80=E6=9F=A5=E6=8C=87=E6=A0=87=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndustryCheckItemController.java | 3 - .../v2/IndustryCheckItemV2Controller.java | 101 +++++++++ .../IndustryCheckItemAppController.java | 3 - .../IndustryCheckItemResourceController.java | 3 - .../v2/IIndustryCheckItemV2Dao.java | 75 +++++++ .../v2/IndustryCheckItemV2DTO.java | 176 +++++++++++++++ .../IndustryCheckItemBindVO.java | 2 +- .../v2/IndustryCheckItemBindV2VO.java | 36 ++++ .../v2/IndustryCheckItemV2VO.java | 61 ++++++ .../service/check/impl/CheckServiceImpl.java | 4 - .../IIndustryCheckItemService.java | 4 +- .../v2/IIndustryCheckItemV2Service.java | 123 +++++++++++ .../impl/IndustryCheckItemV2ServiceImpl.java | 200 ++++++++++++++++++ .../v2/industrycheckitem-v2-mapper.xml | 176 +++++++++++++++ .../v2/list-industrycheckitem-v2.html | 183 ++++++++++++++++ .../v2/list-tree-industrycheckitem-v2.html | 107 ++++++++++ 16 files changed, 1241 insertions(+), 16 deletions(-) create mode 100644 src/main/java/com/cm/inspection/controller/apis/industrycheckitem/v2/IndustryCheckItemV2Controller.java create mode 100644 src/main/java/com/cm/inspection/dao/industrycheckitem/v2/IIndustryCheckItemV2Dao.java create mode 100644 src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/v2/IndustryCheckItemV2DTO.java create mode 100644 src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemBindV2VO.java create mode 100644 src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemV2VO.java create mode 100644 src/main/java/com/cm/inspection/service/industrycheckitem/v2/IIndustryCheckItemV2Service.java create mode 100644 src/main/java/com/cm/inspection/service/industrycheckitem/v2/impl/IndustryCheckItemV2ServiceImpl.java create mode 100644 src/main/resources/mybatis/mapper/industrycheckitem/v2/industrycheckitem-v2-mapper.xml create mode 100644 src/main/resources/static/route/industrycheckitem/v2/list-industrycheckitem-v2.html create mode 100644 src/main/resources/static/route/industrycheckitem/v2/list-tree-industrycheckitem-v2.html diff --git a/src/main/java/com/cm/inspection/controller/apis/industrycheckitem/IndustryCheckItemController.java b/src/main/java/com/cm/inspection/controller/apis/industrycheckitem/IndustryCheckItemController.java index 07d4598..cf6ab0d 100644 --- a/src/main/java/com/cm/inspection/controller/apis/industrycheckitem/IndustryCheckItemController.java +++ b/src/main/java/com/cm/inspection/controller/apis/industrycheckitem/IndustryCheckItemController.java @@ -4,7 +4,6 @@ import com.cm.common.annotation.CheckRequestBodyAnnotation; import com.cm.common.base.AbstractController; import com.cm.common.component.SecurityComponent; import com.cm.common.constants.ISystemConstant; -import com.cm.common.exception.RemoveException; import com.cm.common.exception.SearchException; import com.cm.common.pojo.ListPage; import com.cm.common.pojo.dtos.CurrentUserIdInfoDTO; @@ -13,13 +12,11 @@ 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.vos.industrycheckitem.IndustryCheckItemBindVO; -import com.cm.inspection.pojo.vos.industrycheckitem.IndustryCheckItemVO; import com.cm.inspection.service.industrycheckitem.IIndustryCheckItemService; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Arrays; import java.util.List; import java.util.Map; 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/IndustryCheckItemV2Controller.java new file mode 100644 index 0000000..1c9c563 --- /dev/null +++ b/src/main/java/com/cm/inspection/controller/apis/industrycheckitem/v2/IndustryCheckItemV2Controller.java @@ -0,0 +1,101 @@ +package com.cm.inspection.controller.apis.industrycheckitem.v2; + +import com.cm.common.annotation.CheckRequestBodyAnnotation; +import com.cm.common.base.AbstractController; +import com.cm.common.component.SecurityComponent; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.exception.SearchException; +import com.cm.common.pojo.ListPage; +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 io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IndustryCheckItemController + * @Description: 行业检查项 + * @Author: WenG + * @Date: 2020-03-27 22:12 + * @Version: 1.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "行业检查项接口") +@RestController +@RequestMapping(ISystemConstant.API_PREFIX + "/industrycheckitem/v2") +public class IndustryCheckItemV2Controller extends AbstractController { + + @Autowired + private IIndustryCheckItemV2Service industryCheckItemV2Service; + @Autowired + private SecurityComponent securityComponent; + + @ApiOperation(value = "新增行业检查项", notes = "新增行业检查项接口") + @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); + } + + @ApiOperation(value = "行业检查项详情(通过ID)", notes = "行业检查项详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "industryCheckItemId", value = "行业检查项ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getindustrycheckitembyid/{industryCheckItemId}") + public IndustryCheckItemV2DTO getIndustryCheckItemById(@PathVariable("industryCheckItemId") String industryCheckItemId) throws SearchException { + return industryCheckItemV2Service.getIndustryCheckItemById(industryCheckItemId); + } + + @ApiOperation(value = "行业检查项列表", notes = "行业检查项列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listindustrycheckitem") + public List listIndustryCheckItem() throws SearchException { + Map params = requestParams(); + return industryCheckItemV2Service.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 { + Map params = requestParams(); + params.put("industryId", industryId); + return industryCheckItemV2Service.listIndustryCheckItem(params); + } + + @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("listpageindustrycheckitem") + public SuccessResultList> listPageIndustryCheckItem(ListPage page) throws SearchException { + Map params = requestParams(); + page.setParams(params); + return industryCheckItemV2Service.listPageIndustryCheckItem(page); + } + + @ApiOperation(value = "当前用户id信息", notes = "当前用户id信息接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getcurrentuseridinfo") + public CurrentUserIdInfoDTO getCurrentUserIdInfo() { + return securityComponent.getCurrentUserIdInfo(); + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/controller/app/apis/industrycheckitem/IndustryCheckItemAppController.java b/src/main/java/com/cm/inspection/controller/app/apis/industrycheckitem/IndustryCheckItemAppController.java index a503983..1320d4e 100644 --- a/src/main/java/com/cm/inspection/controller/app/apis/industrycheckitem/IndustryCheckItemAppController.java +++ b/src/main/java/com/cm/inspection/controller/app/apis/industrycheckitem/IndustryCheckItemAppController.java @@ -3,7 +3,6 @@ package com.cm.inspection.controller.app.apis.industrycheckitem; import com.cm.common.annotation.CheckRequestBodyAnnotation; import com.cm.common.base.AbstractController; import com.cm.common.constants.ISystemConstant; -import com.cm.common.exception.RemoveException; import com.cm.common.exception.SearchException; import com.cm.common.pojo.ListPage; import com.cm.common.result.ErrorResult; @@ -11,13 +10,11 @@ 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.vos.industrycheckitem.IndustryCheckItemBindVO; -import com.cm.inspection.pojo.vos.industrycheckitem.IndustryCheckItemVO; import com.cm.inspection.service.industrycheckitem.IIndustryCheckItemService; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Arrays; import java.util.List; import java.util.Map; diff --git a/src/main/java/com/cm/inspection/controller/resources/industrycheckitem/IndustryCheckItemResourceController.java b/src/main/java/com/cm/inspection/controller/resources/industrycheckitem/IndustryCheckItemResourceController.java index 1d10bed..590226c 100644 --- a/src/main/java/com/cm/inspection/controller/resources/industrycheckitem/IndustryCheckItemResourceController.java +++ b/src/main/java/com/cm/inspection/controller/resources/industrycheckitem/IndustryCheckItemResourceController.java @@ -3,7 +3,6 @@ package com.cm.inspection.controller.resources.industrycheckitem; import com.cm.common.annotation.CheckRequestBodyAnnotation; import com.cm.common.base.AbstractController; import com.cm.common.constants.ISystemConstant; -import com.cm.common.exception.RemoveException; import com.cm.common.exception.SearchException; import com.cm.common.pojo.ListPage; import com.cm.common.result.ErrorResult; @@ -11,13 +10,11 @@ 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.vos.industrycheckitem.IndustryCheckItemBindVO; -import com.cm.inspection.pojo.vos.industrycheckitem.IndustryCheckItemVO; import com.cm.inspection.service.industrycheckitem.IIndustryCheckItemService; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Arrays; import java.util.List; import java.util.Map; diff --git a/src/main/java/com/cm/inspection/dao/industrycheckitem/v2/IIndustryCheckItemV2Dao.java b/src/main/java/com/cm/inspection/dao/industrycheckitem/v2/IIndustryCheckItemV2Dao.java new file mode 100644 index 0000000..21f5681 --- /dev/null +++ b/src/main/java/com/cm/inspection/dao/industrycheckitem/v2/IIndustryCheckItemV2Dao.java @@ -0,0 +1,75 @@ +package com.cm.inspection.dao.industrycheckitem.v2; + +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 org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IIndustryCheckItemDao + * @Description: 行业检查项 + * @Author: WenG + * @Date: 2020-03-27 22:12 + * @Version: 1.0 + **/ +@Repository +public interface IIndustryCheckItemV2Dao { + + /** + * 新增行业检查项 + * + * @param params + * @throws SaveException + */ + void saveIndustryCheckItem(Map params) throws SaveException; + + /** + * 删除行业检查项 + * + * @param params + * @throws RemoveException + */ + void removeIndustryCheckItem(Map params) throws RemoveException; + + /** + * 删除行业检查项(物理删除) + * + * @param params + * @throws RemoveException + */ + void deleteIndustryCheckItem(Map params) throws RemoveException; + + /** + * 修改行业检查项 + * + * @param params + * @throws UpdateException + */ + void updateIndustryCheckItem(Map params) throws UpdateException; + + /** + * 行业检查项详情 + * + * @param params + * @return + * @throws SearchException + */ + IndustryCheckItemV2DTO getIndustryCheckItem(Map params) throws SearchException; + + /** + * 行业检查项列表 + * + * @param params + * @return + * @throws SearchException + */ + List listIndustryCheckItem(Map params) throws SearchException; + + +} 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/IndustryCheckItemV2DTO.java new file mode 100644 index 0000000..7755722 --- /dev/null +++ b/src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/v2/IndustryCheckItemV2DTO.java @@ -0,0 +1,176 @@ +package com.cm.inspection.pojo.dtos.industrycheckitem.v2; + +import com.cm.inspection.pojo.dtos.checkitemoption.CheckItemOptionDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @ClassName: IndustryCheckItemDTO + * @Description: 行业检查项 + * @Author: WenG + * @Date: 2020-03-27 22:12 + * @Version: 1.0 + **/ +@ApiModel +public class IndustryCheckItemV2DTO implements Serializable { + + private static final long serialVersionUID = -3848466845851514488L; + @ApiModelProperty(name = "industryCheckItemId", value = "主键") + private String industryCheckItemId; + @ApiModelProperty(name = "industryId", value = "行业ID") + private String industryId; + @ApiModelProperty(name = "natureIdDictionaryName", value = "场所性质ID名称") + private String natureIdDictionaryName; + @ApiModelProperty(name = "checkItemParentId", value = "上级检查项ID") + private String checkItemParentId; + @ApiModelProperty(name = "checkItemId", value = "检查项ID") + private String checkItemId; + @ApiModelProperty(name = "nameJoinByCheckItemId", value = "检查项ID的名称") + private String nameJoinByCheckItemId; + @ApiModelProperty(name = "summaryJoinByCheckItemId", value = "检查项ID的说明") + private String summaryJoinByCheckItemId; + @ApiModelProperty(name = "typeJoinByCheckItemId", value = "检查项ID的类型") + private String typeJoinByCheckItemId; + @ApiModelProperty(name = "iconJoinByCheckItemId", value = "检查项ID的图标") + private String iconJoinByCheckItemId; + @ApiModelProperty(name = "iconPressJoinByCheckItemId", value = "检查项ID的图标按压") + private String iconPressJoinByCheckItemId; + @ApiModelProperty(name = "type", value = "类型") + private Integer type; + @ApiModelProperty(name = "checkItemOptions", value = "检查选项列表") + private List checkItemOptions; + + public String getIndustryCheckItemId() { + return industryCheckItemId == null ? "" : industryCheckItemId; + } + + public void setIndustryCheckItemId(String industryCheckItemId) { + this.industryCheckItemId = industryCheckItemId; + } + + public String getIndustryId() { + return industryId == null ? "" : industryId.trim(); + } + + public void setIndustryId(String industryId) { + this.industryId = industryId; + } + + public String getNatureIdDictionaryName() { + return natureIdDictionaryName == null ? "" : natureIdDictionaryName; + } + + public void setNatureIdDictionaryName(String natureIdDictionaryName) { + this.natureIdDictionaryName = natureIdDictionaryName; + } + + public String getCheckItemParentId() { + return checkItemParentId == null ? "" : checkItemParentId; + } + + public void setCheckItemParentId(String checkItemParentId) { + this.checkItemParentId = checkItemParentId; + } + + public String getCheckItemId() { + return checkItemId == null ? "" : checkItemId; + } + + public void setCheckItemId(String checkItemId) { + this.checkItemId = checkItemId; + } + + public String getNameJoinByCheckItemId() { + return nameJoinByCheckItemId == null ? "" : nameJoinByCheckItemId; + } + + public void setNameJoinByCheckItemId(String nameJoinByCheckItemId) { + this.nameJoinByCheckItemId = nameJoinByCheckItemId; + } + + public String getSummaryJoinByCheckItemId() { + return summaryJoinByCheckItemId == null ? "" : summaryJoinByCheckItemId; + } + + public void setSummaryJoinByCheckItemId(String summaryJoinByCheckItemId) { + this.summaryJoinByCheckItemId = summaryJoinByCheckItemId; + } + + public String getTypeJoinByCheckItemId() { + return typeJoinByCheckItemId == null ? "" : typeJoinByCheckItemId; + } + + public void setTypeJoinByCheckItemId(String typeJoinByCheckItemId) { + this.typeJoinByCheckItemId = typeJoinByCheckItemId; + } + + public String getIconJoinByCheckItemId() { + return iconJoinByCheckItemId == null ? "" : iconJoinByCheckItemId; + } + + public void setIconJoinByCheckItemId(String iconJoinByCheckItemId) { + this.iconJoinByCheckItemId = iconJoinByCheckItemId; + } + + public String getIconPressJoinByCheckItemId() { + return iconPressJoinByCheckItemId == null ? "" : iconPressJoinByCheckItemId; + } + + public void setIconPressJoinByCheckItemId(String iconPressJoinByCheckItemId) { + this.iconPressJoinByCheckItemId = iconPressJoinByCheckItemId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public List getCheckItemOptions() { + if (checkItemOptions == null) { + return new ArrayList<>(); + } + return checkItemOptions; + } + + public void setCheckItemOptions(List checkItemOptions) { + this.checkItemOptions = checkItemOptions; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"industryCheckItemId\":\"") + .append(industryCheckItemId).append('\"'); + sb.append(",\"industryId\":\"") + .append(industryId).append('\"'); + sb.append(",\"natureIdDictionaryName\":\"") + .append(natureIdDictionaryName).append('\"'); + sb.append(",\"checkItemParentId\":\"") + .append(checkItemParentId).append('\"'); + sb.append(",\"checkItemId\":\"") + .append(checkItemId).append('\"'); + sb.append(",\"nameJoinByCheckItemId\":\"") + .append(nameJoinByCheckItemId).append('\"'); + sb.append(",\"summaryJoinByCheckItemId\":\"") + .append(summaryJoinByCheckItemId).append('\"'); + sb.append(",\"typeJoinByCheckItemId\":\"") + .append(typeJoinByCheckItemId).append('\"'); + sb.append(",\"iconJoinByCheckItemId\":\"") + .append(iconJoinByCheckItemId).append('\"'); + sb.append(",\"iconPressJoinByCheckItemId\":\"") + .append(iconPressJoinByCheckItemId).append('\"'); + sb.append(",\"type\":") + .append(type); + sb.append(",\"checkItemOptions\":") + .append(checkItemOptions); + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/IndustryCheckItemBindVO.java b/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/IndustryCheckItemBindVO.java index 20439a1..f38e325 100644 --- a/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/IndustryCheckItemBindVO.java +++ b/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/IndustryCheckItemBindVO.java @@ -11,7 +11,7 @@ import java.util.List; * 当你想要放弃的时候,想想当初你为何开始 * * @ClassName: IndustryCheckItemBindVO - * @Description: 行业检查项绑定 + * @Description: 场所性质检查项绑定 * @Author: WangGeng * @Date: 2020/4/15 18:14 * @Version: 1.0 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/IndustryCheckItemBindV2VO.java new file mode 100644 index 0000000..b9fcb0b --- /dev/null +++ b/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemBindV2VO.java @@ -0,0 +1,36 @@ +package com.cm.inspection.pojo.vos.industrycheckitem.v2; + +import com.cm.inspection.pojo.vos.industrycheckitem.IndustryCheckItemVO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.ArrayList; +import java.util.List; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: IndustryCheckItemBindVO + * @Description: 行业检查项绑定 + * @Author: WangGeng + * @Date: 2020/4/15 18:14 + * @Version: 1.0 + **/ +@ApiModel +public class IndustryCheckItemBindV2VO { + + @ApiModelProperty(name = "industryCheckItems", value = "行业性质检查项列表") + private List industryCheckItems; + + public List getIndustryCheckItems() { + if (industryCheckItems == null) { + return new ArrayList<>(); + } + return industryCheckItems; + } + + public void setIndustryCheckItems(List industryCheckItems) { + this.industryCheckItems = industryCheckItems; + } +} \ No newline at end of file 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/IndustryCheckItemV2VO.java new file mode 100644 index 0000000..ef2d568 --- /dev/null +++ b/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/v2/IndustryCheckItemV2VO.java @@ -0,0 +1,61 @@ +package com.cm.inspection.pojo.vos.industrycheckitem.v2; + +import com.cm.common.annotation.CheckNumberAnnotation; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @ClassName: IndustryCheckItemVO + * @Description: 行业检查项 + * @Author: WenG + * @Date: 2020-03-27 22:12 + * @Version: 1.0 + **/ +@ApiModel +public class IndustryCheckItemV2VO { + + @ApiModelProperty(name = "checkItemParentId", value = "检查项上级ID") + private String checkItemParentId; + @ApiModelProperty(name = "checkItemId", value = "检查项ID") + private String checkItemId; + @ApiModelProperty(name = "type", value = "类型") + @CheckNumberAnnotation(name = "类型") + private Integer type; + + public String getCheckItemParentId() { + return checkItemParentId == null ? "" : checkItemParentId; + } + + public void setCheckItemParentId(String checkItemParentId) { + this.checkItemParentId = checkItemParentId; + } + + public String getCheckItemId() { + return checkItemId == null ? "" : checkItemId; + } + + public void setCheckItemId(String checkItemId) { + this.checkItemId = checkItemId; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"checkItemParentId\":\"") + .append(checkItemParentId).append('\"'); + sb.append(",\"checkItemId\":\"") + .append(checkItemId).append('\"'); + sb.append(",\"type\":") + .append(type); + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/main/java/com/cm/inspection/service/check/impl/CheckServiceImpl.java b/src/main/java/com/cm/inspection/service/check/impl/CheckServiceImpl.java index d751d12..1eec4fe 100644 --- a/src/main/java/com/cm/inspection/service/check/impl/CheckServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/check/impl/CheckServiceImpl.java @@ -8,8 +8,6 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.common.token.app.AppTokenManager; -import com.cm.common.token.app.entity.AppToken; -import com.cm.common.utils.DateUtil; import com.cm.common.utils.HashMapUtil; import com.cm.common.utils.UUIDUtil; import com.cm.inspection.dao.check.ICheckDao; @@ -18,7 +16,6 @@ import com.cm.inspection.pojo.dtos.check.CheckSimpleWithEnterpriseDTO; import com.cm.inspection.pojo.dtos.checkitem.CheckItemDTO; import com.cm.inspection.pojo.dtos.checkitemoption.CheckItemOptionDTO; import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; -import com.cm.inspection.pojo.dtos.gridpersonnel.GridPersonnelDTO; import com.cm.inspection.pojo.dtos.hiddendangerreport.HiddenDangerReportDTO; import com.cm.inspection.pojo.dtos.industrycheckitem.IndustryCheckItemDTO; import com.cm.inspection.pojo.vos.check.CheckVO; @@ -41,7 +38,6 @@ import org.activiti.engine.task.Task; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.format.DateTimeFormat; -import org.omg.CORBA.OBJ_ADAPTER; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/cm/inspection/service/industrycheckitem/IIndustryCheckItemService.java b/src/main/java/com/cm/inspection/service/industrycheckitem/IIndustryCheckItemService.java index f1c76b2..2cd9787 100644 --- a/src/main/java/com/cm/inspection/service/industrycheckitem/IIndustryCheckItemService.java +++ b/src/main/java/com/cm/inspection/service/industrycheckitem/IIndustryCheckItemService.java @@ -24,12 +24,12 @@ public interface IIndustryCheckItemService { /** * 新增行业检查项 * - * @param natureId + * @param industryId * @param industryCheckItemVO * @return * @throws Exception */ - SuccessResult saveIndustryCheckItemByNatureId(String natureId, IndustryCheckItemBindVO industryCheckItemVO) throws Exception; + SuccessResult saveIndustryCheckItemByNatureId(String industryId, IndustryCheckItemBindVO industryCheckItemVO) throws Exception; /** * 新增行业检查项(APP) diff --git a/src/main/java/com/cm/inspection/service/industrycheckitem/v2/IIndustryCheckItemV2Service.java b/src/main/java/com/cm/inspection/service/industrycheckitem/v2/IIndustryCheckItemV2Service.java new file mode 100644 index 0000000..76a76a2 --- /dev/null +++ b/src/main/java/com/cm/inspection/service/industrycheckitem/v2/IIndustryCheckItemV2Service.java @@ -0,0 +1,123 @@ +package com.cm.inspection.service.industrycheckitem.v2; + +import com.cm.common.exception.RemoveException; +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 java.util.List; +import java.util.Map; + +/** + * @ClassName: IIndustryCheckItemService + * @Description: 行业检查项 + * @Author: WenG + * @Date: 2020-03-27 22:12 + * @Version: 1.0 + **/ +public interface IIndustryCheckItemV2Service { + + /** + * 新增行业检查项 + * + * @param industryId + * @param industryCheckItemV2VO + * @return + * @throws Exception + */ + SuccessResult saveIndustryCheckItemByNatureId(String industryId, IndustryCheckItemBindV2VO industryCheckItemV2VO) throws Exception; + + /** + * 新增行业检查项(APP) + * + * @param token + * @param industryId + * @param industryCheckItemBindV2VO + * @return + * @throws Exception + */ + SuccessResult saveIndustryCheckItemByNatureIdAndToken(String token, String industryId, IndustryCheckItemBindV2VO industryCheckItemBindV2VO) throws Exception; + + /** + * 删除行业检查项 + * + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removeIndustryCheckItem(String ids) throws RemoveException; + + /** + * 删除行业检查项(APP) + * + * @param token + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removeIndustryCheckItemByToken(String token, String ids) throws RemoveException; + + /** + * 修改行业检查项 + * + * @param industryCheckItemId + * @param industryCheckItemV2VO + * @return + * @throws Exception + */ + SuccessResult updateIndustryCheckItem(String industryCheckItemId, IndustryCheckItemV2VO industryCheckItemV2VO) throws Exception; + + /** + * 修改行业检查项(APP) + * + * @param token + * @param industryCheckItemId + * @param industryCheckItemV2VO + * @return + * @throws Exception + */ + SuccessResult updateIndustryCheckItemByToken(String token, String industryCheckItemId, IndustryCheckItemV2VO industryCheckItemV2VO) throws Exception; + + /** + * 行业检查项详情(通过ID) + * + * @param industryCheckItemId + * @return + * @throws SearchException + */ + IndustryCheckItemV2DTO getIndustryCheckItemById(String industryCheckItemId) throws SearchException; + + /** + * 行业检查项列表 + * + * @param params + * @return + * @throws SearchException + */ + List listIndustryCheckItem(Map params) throws SearchException; + + /** + * 行业检查项分页列表 + * + * @param page + * @return + * @throws SearchException + */ + SuccessResultList> listPageIndustryCheckItem(ListPage page) throws SearchException; + + /** + * 获取行业检查项列表(通过场所性质) + * + * @param industryId + * @return + * @throws SearchException + */ + List listIndustryCheckItemByIndustryId(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/IndustryCheckItemV2ServiceImpl.java new file mode 100644 index 0000000..7b35c53 --- /dev/null +++ b/src/main/java/com/cm/inspection/service/industrycheckitem/v2/impl/IndustryCheckItemV2ServiceImpl.java @@ -0,0 +1,200 @@ +package com.cm.inspection.service.industrycheckitem.v2.impl; + +import com.cm.common.exception.RemoveException; +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.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.service.BaseService; +import com.cm.inspection.service.checkitemoption.ICheckItemOptionService; +import com.cm.inspection.service.industrycheckitem.v2.IIndustryCheckItemV2Service; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IndustryCheckItemServiceImpl + * @Description: 行业检查项 + * @Author: WenG + * @Date: 2020-03-27 22:12 + * @Version: 1.0 + **/ +@Service +public class IndustryCheckItemV2ServiceImpl extends BaseService implements IIndustryCheckItemV2Service { + + @Autowired + private IIndustryCheckItemV2Dao industryCheckItemV2Dao; + @Autowired + private ICheckItemOptionService checkItemOptionService; + + @Override + public SuccessResult saveIndustryCheckItemByNatureId(String industryId, IndustryCheckItemBindV2VO industryCheckItemBindV2VO) throws Exception { + saveIndustryCheckItemInfo(null, industryId, industryCheckItemBindV2VO); + return new SuccessResult(); + } + + @Override + public SuccessResult saveIndustryCheckItemByNatureIdAndToken(String token, String industryId, IndustryCheckItemBindV2VO industryCheckItemBindV2VO) throws Exception { + saveIndustryCheckItemInfo(token, industryId, industryCheckItemBindV2VO); + return new SuccessResult(); + } + + /** + * 新增行业检查项 + * + * @param token + * @param industryId + * @param industryCheckItemBindV2VO + * @throws Exception + */ + private void saveIndustryCheckItemInfo(String token, String industryId, IndustryCheckItemBindV2VO industryCheckItemBindV2VO) throws Exception { + // 清空原数据 + Map params = getHashMap(1); + params.put("industryId", industryId); + industryCheckItemV2Dao.deleteIndustryCheckItem(params); + // 保存数据 + for (IndustryCheckItemVO industryCheckItemVO : industryCheckItemBindV2VO.getIndustryCheckItems()) { + params = HashMapUtil.beanToMap(industryCheckItemVO); + params.put("industryCheckItemId", UUIDUtil.getUUID()); + params.put("industryId", industryId); + if (token != null) { + setSaveInfo(token, params); + } else { + setSaveInfo(params); + } + industryCheckItemV2Dao.saveIndustryCheckItem(params); + } + } + + @Override + public SuccessResult removeIndustryCheckItem(String ids) throws RemoveException { + removeIndustryCheckItemInfo(null, ids); + return new SuccessResult(); + } + + @Override + public SuccessResult removeIndustryCheckItemByToken(String token, String ids) throws RemoveException { + removeIndustryCheckItemInfo(token, ids); + return new SuccessResult(); + } + + /** + * 删除行业检查项 + * + * @param token + * @param ids + */ + private void removeIndustryCheckItemInfo(String token, String ids) { + Map params = getHashMap(3); + params.put("industryCheckItemIds", Arrays.asList(ids.split("_"))); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } + industryCheckItemV2Dao.removeIndustryCheckItem(params); + } + + @Override + public SuccessResult updateIndustryCheckItem(String industryCheckItemId, IndustryCheckItemV2VO industryCheckItemV2VO) throws Exception { + updateIndustryCheckItemInfo(null, industryCheckItemId, industryCheckItemV2VO); + return new SuccessResult(); + } + + @Override + public SuccessResult updateIndustryCheckItemByToken(String token, String industryCheckItemId, IndustryCheckItemV2VO industryCheckItemV2VO) throws Exception { + updateIndustryCheckItemInfo(token, industryCheckItemId, industryCheckItemV2VO); + return new SuccessResult(); + } + + /** + * 修改行业检查项 + * + * @param token + * @param industryCheckItemId + * @param industryCheckItemV2VO + */ + private void updateIndustryCheckItemInfo(String token, String industryCheckItemId, IndustryCheckItemV2VO industryCheckItemV2VO) throws Exception { + Map params = HashMapUtil.beanToMap(industryCheckItemV2VO); + params.put("industryCheckItemId", industryCheckItemId); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } + industryCheckItemV2Dao.updateIndustryCheckItem(params); + } + + @Override + public IndustryCheckItemV2DTO getIndustryCheckItemById(String industryCheckItemId) throws SearchException { + Map params = super.getHashMap(1); + params.put("industryCheckItemId", industryCheckItemId); + IndustryCheckItemV2DTO industryCheckItemDTO = industryCheckItemV2Dao.getIndustryCheckItem(params); + if (industryCheckItemDTO != null) { + params.clear(); + setCheckItemOptions(industryCheckItemDTO, params); + } + return industryCheckItemDTO; + } + + @Override + public List listIndustryCheckItem(Map params) throws SearchException { + List industryCheckItemDTOs = industryCheckItemV2Dao.listIndustryCheckItem(params); + params.clear(); + setCheckItemOptions(industryCheckItemDTOs, params); + return industryCheckItemDTOs; + } + + @Override + public SuccessResultList> listPageIndustryCheckItem(ListPage page) throws SearchException { + PageHelper.startPage(page.getPage(), page.getRows()); + List industryCheckItemDTOs = industryCheckItemV2Dao.listIndustryCheckItem(page.getParams()); + PageInfo pageInfo = new PageInfo<>(industryCheckItemDTOs); + return new SuccessResultList<>(industryCheckItemDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public List listIndustryCheckItemByIndustryId(String industryId) throws SearchException { + Map params = getHashMap(1); + params.put("industryId", industryId); + return listIndustryCheckItem(params); + } + + /** + * 设置检查选项 + * + * @param industryCheckItemDTOs + * @param params + */ + private void setCheckItemOptions(List industryCheckItemDTOs, Map params) { + for (IndustryCheckItemV2DTO industryCheckItemDTO : industryCheckItemDTOs) { + setCheckItemOptions(industryCheckItemDTO, params); + } + } + + /** + * 设置检查选项 + * + * @param industryCheckItemDTO + * @param params + */ + private void setCheckItemOptions(IndustryCheckItemV2DTO industryCheckItemDTO, Map params) { + params.put("checkItemId", industryCheckItemDTO.getCheckItemId()); + industryCheckItemDTO.setCheckItemOptions(checkItemOptionService.listCheckItemOption(params)); + } + +} diff --git a/src/main/resources/mybatis/mapper/industrycheckitem/v2/industrycheckitem-v2-mapper.xml b/src/main/resources/mybatis/mapper/industrycheckitem/v2/industrycheckitem-v2-mapper.xml new file mode 100644 index 0000000..b68c798 --- /dev/null +++ b/src/main/resources/mybatis/mapper/industrycheckitem/v2/industrycheckitem-v2-mapper.xml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + INSERT INTO gen_industry_check_item_v2 ( + industry_check_item_id, + industry_id, + check_item_parent_id, + check_item_id, + type, + creator, + gmt_create, + modifier, + gmt_modified, + is_delete + ) VALUES( + #{industryCheckItemId}, + #{industryId}, + #{checkItemParentId}, + #{checkItemId}, + #{type}, + #{creator}, + #{gmtCreate}, + #{modifier}, + #{gmtModified}, + #{isDelete} + ) + + + + + UPDATE + gen_industry_check_item_v2 + SET + is_delete = 1, + modifier = #{modifier}, + gmt_modified = #{gmtModified} + WHERE + industry_check_item_id IN + + #{industryCheckItemIds[${index}]} + + + + + + DELETE FROM + gen_industry_check_item_v2 + WHERE + + industry_id = #{industryId} + + + industry_check_item_id IN + + #{industryCheckItemIds[${index}]} + + + + + + + UPDATE + gen_industry_check_item_v2 + SET + + industry_id = #{industryId} + + + check_item_parent_id = #{checkItemParentId}, + + + check_item_id = #{checkItemId}, + + + type = #{type} + + modifier = #{modifier}, + gmt_modified = #{gmtModified} + WHERE + industry_check_item_id = #{industryCheckItemId} + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/industrycheckitem/v2/list-industrycheckitem-v2.html b/src/main/resources/static/route/industrycheckitem/v2/list-industrycheckitem-v2.html new file mode 100644 index 0000000..6b68aa6 --- /dev/null +++ b/src/main/resources/static/route/industrycheckitem/v2/list-industrycheckitem-v2.html @@ -0,0 +1,183 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ + + + + \ 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 new file mode 100644 index 0000000..5cd30cd --- /dev/null +++ b/src/main/resources/static/route/industrycheckitem/v2/list-tree-industrycheckitem-v2.html @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + +
+
+
+
+
+
+
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + + \ No newline at end of file