修改必填、选填方式
This commit is contained in:
parent
9b025f0f99
commit
d966d17fde
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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<HiddenDangerReportVO> hiddenDangerReports = checkVO.getHiddenDangerReports();
|
||||
int isAllPass = 1;
|
||||
// 获取企业信息
|
||||
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(checkVO.getEnterpriseId());
|
||||
// 获取企业检查项列表
|
||||
List<IndustryCheckItemDTO> 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;
|
||||
}
|
||||
}
|
||||
|
@ -108,4 +108,12 @@ public interface IIndustryCheckItemService {
|
||||
*/
|
||||
SuccessResultList<List<IndustryCheckItemDTO>> listPageIndustryCheckItem(ListPage page) throws SearchException;
|
||||
|
||||
/**
|
||||
* 获取行业检查项列表(通过行业)
|
||||
*
|
||||
* @param industryId
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<IndustryCheckItemDTO> listIndustryCheckItemByIndustryId(String industryId) throws SearchException;
|
||||
}
|
||||
|
@ -142,4 +142,11 @@ public class IndustryCheckItemServiceImpl extends BaseService implements IIndust
|
||||
return new SuccessResultList<>(industryCheckItemDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IndustryCheckItemDTO> listIndustryCheckItemByIndustryId(String industryId) throws SearchException {
|
||||
Map<String, Object> params = getHashMap(1);
|
||||
params.put("industryId", industryId);
|
||||
return listIndustryCheckItem(params);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
<id column="check_item_id" property="checkItemId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="summary" property="summary"/>
|
||||
<result column="type" property="type"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 新增检查项 -->
|
||||
@ -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 @@
|
||||
</if>
|
||||
<if test="summary != null and summary != ''">
|
||||
summary = #{summary},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type},
|
||||
</if>
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -9,7 +9,7 @@
|
||||
<result column="check_item_id" property="checkItemId"/>
|
||||
<result column="name_join_by_check_item_id" property="nameJoinByCheckItemId"/>
|
||||
<result column="summary_join_by_check_item_id" property="summaryJoinByCheckItemId"/>
|
||||
<result column="type_join_by_check_item_id" property="typeJoinByCheckItemId"/>
|
||||
<result column="type" property="type"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 新增行业检查项 -->
|
||||
@ -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 @@
|
||||
</if>
|
||||
<if test="checkItemId != null and checkItemId != ''">
|
||||
check_item_id = #{checkItemId},
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
type = #{type}
|
||||
</if>
|
||||
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
|
||||
|
@ -99,7 +99,7 @@
|
||||
<tbody>
|
||||
{{# for(var i = 0, item; item = d[i++]; ) { }}
|
||||
<tr>
|
||||
<td>{{item.nameJoinByCheckItemId}}({{item.typeJoinByCheckItemId == '1' ? '必查': '选查'}})</td>
|
||||
<td>{{item.nameJoinByCheckItemId}}({{item.type == '1' ? '必查': '选查'}})</td>
|
||||
<td>
|
||||
<input type="radio" name="hd_checkResult_{{item.checkItemId}}" value="0" title="未检查" lay-filter="checkResultFilter" checked>
|
||||
<input type="radio" name="hd_checkResult_{{item.checkItemId}}" value="1" title="通过" lay-filter="checkResultFilter">
|
||||
|
@ -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) {
|
||||
|
@ -33,13 +33,6 @@
|
||||
<input type="text" id="summary" name="summary" class="layui-input" value="" placeholder="请输入说明" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">类型</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="type" value="1" title="必查" checked>
|
||||
<input type="radio" name="type" value="2" title="选查">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
|
@ -33,13 +33,6 @@
|
||||
<input type="text" id="summary" name="summary" class="layui-input" value="" placeholder="请输入说明" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">类型</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="type" value="1" title="必查">
|
||||
<input type="radio" name="type" value="2" title="选查">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
|
@ -97,7 +97,7 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'typeJoinByCheckItemId', width: 150, title: '检查项类型', align:'center',
|
||||
{field: 'type', width: 150, title: '检查项类型', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
|
@ -45,6 +45,13 @@
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">类型</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="type" value="1" title="必查" checked>
|
||||
<input type="radio" name="type" value="2" title="选查">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
|
@ -45,6 +45,13 @@
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">类型</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="type" value="1" title="必查">
|
||||
<input type="radio" name="type" value="2" title="选查">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
@ -127,7 +134,7 @@
|
||||
top.restAjax.get(top.restAjax.path('api/industrycheckitem/getindustrycheckitembyid/{industryCheckItemId}', [industryCheckItemId]), {}, null, function(code, data) {
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
dataFormData[i] = data[i];
|
||||
dataFormData[i] = data[i] +'';
|
||||
}
|
||||
form.val('dataForm', dataFormData);
|
||||
form.render(null, 'dataForm');
|
||||
|
Loading…
Reference in New Issue
Block a user