diff --git a/src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/IndustryCheckItemDTO.java b/src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/IndustryCheckItemDTO.java index 03b0fd4..9c473cf 100644 --- a/src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/IndustryCheckItemDTO.java +++ b/src/main/java/com/cm/inspection/pojo/dtos/industrycheckitem/IndustryCheckItemDTO.java @@ -25,8 +25,8 @@ public class IndustryCheckItemDTO { private String nameJoinByCheckItemId; @ApiModelProperty(name = "summaryJoinByCheckItemId", value = "检查项ID的说明") private String summaryJoinByCheckItemId; - @ApiModelProperty(name = "typeJoinByCheckItemId", value = "检查项ID的类型") - private String typeJoinByCheckItemId; + @ApiModelProperty(name = "type", value = "类型") + private Integer type; public String getIndustryCheckItemId() { return industryCheckItemId == null ? "" : industryCheckItemId; @@ -76,13 +76,32 @@ public class IndustryCheckItemDTO { this.summaryJoinByCheckItemId = summaryJoinByCheckItemId; } - public String getTypeJoinByCheckItemId() { - return typeJoinByCheckItemId == null ? "" : typeJoinByCheckItemId; + public Integer getType() { + return type; } - public void setTypeJoinByCheckItemId(String typeJoinByCheckItemId) { - this.typeJoinByCheckItemId = typeJoinByCheckItemId; + public void setType(Integer type) { + this.type = type; } - + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"industryCheckItemId\":") + .append("\"").append(industryCheckItemId).append("\""); + sb.append(",\"industryId\":") + .append("\"").append(industryId).append("\""); + sb.append(",\"industryIdDictionaryName\":") + .append("\"").append(industryIdDictionaryName).append("\""); + sb.append(",\"checkItemId\":") + .append("\"").append(checkItemId).append("\""); + sb.append(",\"nameJoinByCheckItemId\":") + .append("\"").append(nameJoinByCheckItemId).append("\""); + sb.append(",\"summaryJoinByCheckItemId\":") + .append("\"").append(summaryJoinByCheckItemId).append("\""); + sb.append(",\"type\":") + .append("\"").append(type).append("\""); + sb.append('}'); + return sb.toString(); + } } diff --git a/src/main/java/com/cm/inspection/pojo/vos/checkitem/CheckItemVO.java b/src/main/java/com/cm/inspection/pojo/vos/checkitem/CheckItemVO.java index cceed8a..6ee6a5d 100644 --- a/src/main/java/com/cm/inspection/pojo/vos/checkitem/CheckItemVO.java +++ b/src/main/java/com/cm/inspection/pojo/vos/checkitem/CheckItemVO.java @@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** - * * @ClassName: CheckItemVO * @Description: 检查项 * @Author: WenG @@ -21,9 +20,6 @@ public class CheckItemVO { private String name; @ApiModelProperty(name = "summary", value = "说明") private String summary; - @ApiModelProperty(name = "type", value = "类型") - @CheckNumberAnnotation(name = "类型") - private Integer type; public String getName() { return name == null ? "" : name; @@ -41,13 +37,14 @@ public class CheckItemVO { this.summary = summary; } - public Integer getType() { - return type == null ? 0 : type; + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"name\":") + .append("\"").append(name).append("\""); + sb.append(",\"summary\":") + .append("\"").append(summary).append("\""); + sb.append('}'); + return sb.toString(); } - - public void setType(Integer type) { - this.type = type; - } - - } diff --git a/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/IndustryCheckItemVO.java b/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/IndustryCheckItemVO.java index bc9b052..3866cf5 100644 --- a/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/IndustryCheckItemVO.java +++ b/src/main/java/com/cm/inspection/pojo/vos/industrycheckitem/IndustryCheckItemVO.java @@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** - * * @ClassName: IndustryCheckItemVO * @Description: 行业检查项 * @Author: WenG @@ -20,6 +19,9 @@ public class IndustryCheckItemVO { private String industryId; @ApiModelProperty(name = "checkItemId", value = "检查项ID") private String checkItemId; + @ApiModelProperty(name = "type", value = "类型") + @CheckNumberAnnotation(name = "类型") + private Integer type; public String getIndustryId() { return industryId == null ? "" : industryId; @@ -37,5 +39,24 @@ public class IndustryCheckItemVO { 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("\"industryId\":") + .append("\"").append(industryId).append("\""); + sb.append(",\"checkItemId\":") + .append("\"").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 ddd5e21..07aeab6 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 @@ -13,15 +13,19 @@ import com.cm.inspection.dao.check.ICheckDao; import com.cm.inspection.enums.HiddenDangerCheckResultEnum; import com.cm.inspection.pojo.dtos.check.CheckDTO; import com.cm.inspection.pojo.dtos.checkitem.CheckItemDTO; +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; import com.cm.inspection.pojo.vos.check.InspectVO; import com.cm.inspection.pojo.vos.hiddendangerreport.HiddenDangerReportVO; import com.cm.inspection.service.BaseService; import com.cm.inspection.service.check.ICheckService; +import com.cm.inspection.service.enterprise.IEnterpriseService; import com.cm.inspection.service.gridpersonnel.IGridPersonnelService; import com.cm.inspection.service.hiddendangerreport.IHiddenDangerReportService; +import com.cm.inspection.service.industrycheckitem.IIndustryCheckItemService; import com.cm.inspection.service.process.IProcessService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -53,6 +57,10 @@ public class CheckServiceImpl extends BaseService implements ICheckService { private IProcessService processService; @Autowired private IGridPersonnelService gridPersonnelService; + @Autowired + private IEnterpriseService enterpriseService; + @Autowired + private IIndustryCheckItemService industryCheckItemService; @Override public SuccessResult saveCheck(CheckVO checkVO) throws Exception { @@ -187,10 +195,23 @@ public class CheckServiceImpl extends BaseService implements ICheckService { LOG.debug("1.isCoordination:1,配合处理"); List hiddenDangerReports = checkVO.getHiddenDangerReports(); int isAllPass = 1; + // 获取企业信息 + EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(checkVO.getEnterpriseId()); + // 获取企业检查项列表 + List industryCheckItemDTOs = industryCheckItemService.listIndustryCheckItemByIndustryId(enterpriseDTO.getIndustry()); for (HiddenDangerReportVO hiddenDangerReportVO : hiddenDangerReports) { hiddenDangerReportVO.setCheckId(checkId); hiddenDangerReportService.saveHiddenDangerReportInfo(token, hiddenDangerReportVO); - if (HiddenDangerCheckResultEnum.PASS.getValue() != hiddenDangerReportVO.getCheckResult()) { + // 判断是否是必查项 + boolean isMustCheckItem = false; + for (IndustryCheckItemDTO industryCheckItemDTO : industryCheckItemDTOs) { + if (StringUtils.equals(hiddenDangerReportVO.getCheckItemId(), industryCheckItemDTO.getCheckItemId()) && industryCheckItemDTO.getType() == 1) { + isMustCheckItem = true; + break; + } + } + // 必填项不通过 + if (isMustCheckItem && HiddenDangerCheckResultEnum.PASS.getValue() != hiddenDangerReportVO.getCheckResult()) { isAllPass = 0; } } 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 03b26ec..2a33f9c 100644 --- a/src/main/java/com/cm/inspection/service/industrycheckitem/IIndustryCheckItemService.java +++ b/src/main/java/com/cm/inspection/service/industrycheckitem/IIndustryCheckItemService.java @@ -108,4 +108,12 @@ public interface IIndustryCheckItemService { */ 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/impl/IndustryCheckItemServiceImpl.java b/src/main/java/com/cm/inspection/service/industrycheckitem/impl/IndustryCheckItemServiceImpl.java index 1957c00..1dd1ed3 100644 --- a/src/main/java/com/cm/inspection/service/industrycheckitem/impl/IndustryCheckItemServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/industrycheckitem/impl/IndustryCheckItemServiceImpl.java @@ -142,4 +142,11 @@ public class IndustryCheckItemServiceImpl extends BaseService implements IIndust 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); + } + } diff --git a/src/main/resources/mybatis/mapper/checkitem/checkitem-mapper.xml b/src/main/resources/mybatis/mapper/checkitem/checkitem-mapper.xml index 60d6d33..98f5b0d 100644 --- a/src/main/resources/mybatis/mapper/checkitem/checkitem-mapper.xml +++ b/src/main/resources/mybatis/mapper/checkitem/checkitem-mapper.xml @@ -6,7 +6,6 @@ - @@ -15,7 +14,6 @@ check_item_id, name, summary, - type, creator, gmt_create, modifier, @@ -25,7 +23,6 @@ #{checkItemId}, #{name}, #{summary}, - #{type}, #{creator}, #{gmtCreate}, #{modifier}, @@ -59,9 +56,6 @@ summary = #{summary}, - - - type = #{type}, modifier = #{modifier}, gmt_modified = #{gmtModified} @@ -74,7 +68,6 @@ SELECT t1.name, t1.summary, - t1.type, t1.check_item_id FROM gen_check_item t1 @@ -91,7 +84,6 @@ SELECT t1.name, t1.summary, - t1.type, t1.check_item_id FROM gen_check_item t1 diff --git a/src/main/resources/mybatis/mapper/hiddendangerreport/hiddendangerreport-mapper.xml b/src/main/resources/mybatis/mapper/hiddendangerreport/hiddendangerreport-mapper.xml index 9f0fe57..aed8479 100644 --- a/src/main/resources/mybatis/mapper/hiddendangerreport/hiddendangerreport-mapper.xml +++ b/src/main/resources/mybatis/mapper/hiddendangerreport/hiddendangerreport-mapper.xml @@ -185,8 +185,8 @@ SELECT jt1.name, jt1.summary, - jt1.type, - jt1.check_item_id + jt1.check_item_id, + t1.type FROM gen_hidden_danger_report t1 LEFT JOIN diff --git a/src/main/resources/mybatis/mapper/industrycheckitem/industrycheckitem-mapper.xml b/src/main/resources/mybatis/mapper/industrycheckitem/industrycheckitem-mapper.xml index c0b0d21..627d07e 100644 --- a/src/main/resources/mybatis/mapper/industrycheckitem/industrycheckitem-mapper.xml +++ b/src/main/resources/mybatis/mapper/industrycheckitem/industrycheckitem-mapper.xml @@ -9,7 +9,7 @@ - + @@ -18,6 +18,7 @@ industry_check_item_id, industry_id, check_item_id, + type, creator, gmt_create, modifier, @@ -27,6 +28,7 @@ #{industryCheckItemId}, #{industryId}, #{checkItemId}, + #{type}, #{creator}, #{gmtCreate}, #{modifier}, @@ -60,6 +62,9 @@ check_item_id = #{checkItemId}, + + + type = #{type} modifier = #{modifier}, gmt_modified = #{gmtModified} @@ -72,6 +77,7 @@ SELECT t1.industry_id, t1.check_item_id, + t1.type, t1.industry_check_item_id FROM gen_industry_check_item t1 @@ -91,7 +97,7 @@ dt1.dictionary_name industry_id_dictionary_name, jt1.name name_join_by_check_item_id, jt1.summary summary_join_by_check_item_id, - jt1.type type_join_by_check_item_id, + t1.type, t1.industry_check_item_id FROM gen_industry_check_item t1 diff --git a/src/main/resources/static/route/check/save-check.html b/src/main/resources/static/route/check/save-check.html index a8548df..b759dd7 100644 --- a/src/main/resources/static/route/check/save-check.html +++ b/src/main/resources/static/route/check/save-check.html @@ -99,7 +99,7 @@ {{# for(var i = 0, item; item = d[i++]; ) { }} - {{item.nameJoinByCheckItemId}}({{item.typeJoinByCheckItemId == '1' ? '必查': '选查'}}) + {{item.nameJoinByCheckItemId}}({{item.type == '1' ? '必查': '选查'}}) diff --git a/src/main/resources/static/route/checkitem/list-checkitem.html b/src/main/resources/static/route/checkitem/list-checkitem.html index c7c11e3..d4a0296 100644 --- a/src/main/resources/static/route/checkitem/list-checkitem.html +++ b/src/main/resources/static/route/checkitem/list-checkitem.html @@ -97,20 +97,6 @@ return rowData; } }, - {field: 'type', width: 150, title: '类型', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - if(rowData == 1) { - return '必查'; - } else if(rowData == 2) { - return '选查'; - } - return rowData; - } - }, ]], page: true, parseData: function(data) { diff --git a/src/main/resources/static/route/checkitem/save-checkitem.html b/src/main/resources/static/route/checkitem/save-checkitem.html index 9e9d7e5..4be9465 100644 --- a/src/main/resources/static/route/checkitem/save-checkitem.html +++ b/src/main/resources/static/route/checkitem/save-checkitem.html @@ -33,13 +33,6 @@ -
- -
- - -
-
-
- -
- - -
-
+
+ +
+ + +
+
+
+ +
+ + +
+