安全交底人,单人变多人页面调整

liujun-2024-05-23-接口漏洞修复
liujun 2024-02-04 16:56:31 +08:00
parent 8fc630c2c9
commit c11f5a4182
4 changed files with 75 additions and 13 deletions

View File

@ -339,8 +339,6 @@ public class AppHotworkCfdController extends BaseController {
pd2.put("GUARDIAN_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("GUARDIAN_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
// pd2.put("GUARDIAN_CONTENT", pd.get("CONTENT"));
// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
hotworkCfdService.edit(pd2);
}
@ -1405,15 +1403,16 @@ public class AppHotworkCfdController extends BaseController {
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData condition = new PageData();
condition.put("showInfo",pd.getString("showInfo"));
condition.put("HOTWORK_ID",pd.getString("HOTWORK_ID"));
map.put("measuresList", hotworkCfdService.listAllMeasures(condition));
pd = hotworkCfdService.findById(pd); //根据ID读取
// created by liu jun 添加(交底人、项目主管部门负责人、安全措施确认人)
hotworkCfdService.addInfo(pd);
PageData condition = new PageData();
condition.putAll(pd);
if ("0.9".equals(condition.getString("APPLY_STATUS"))){
condition.put("APPLY_STATUS","1");
}
map.put("measuresList", hotworkCfdService.listAllMeasures(condition));
map.put("gasList", hotworkGasCfdService.listAll(pd));
map.put("imgList", hotworkAcceptUserCfdService.findByIds(pd));
map.put("imgList1", hotworkAcceptUserCfdService.findById(pd));
@ -1548,7 +1547,6 @@ public class AppHotworkCfdController extends BaseController {
*/
@RequestMapping(value="/safetyList")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "列表")
public Object safetyList(Page page) throws Exception{
PageData response = new PageData();
try {
@ -1577,7 +1575,61 @@ public class AppHotworkCfdController extends BaseController {
PageData response = new PageData();
try {
PageData request = this.getPageData();
hotworkCfdService.confessApproval(request, files);
PageData condition = new PageData();
condition.put("HOTWORK_ID",request.get("HOTWORK_ID"));
condition.put("USER_ID",request.get("USER_ID"));
condition.put("CORPINFO_ID",request.get("CORPINFO_ID"));
condition.put("TYPE","0");
condition.put("APPROVAL_STATUS","1");
hotworkCfdService.confessApproval(condition, files);
response.put("result", "success");
return response;
} catch (Exception e) {
e.printStackTrace();
response.put("result", "error");
response.put("message", e.getMessage());
return response;
}
}
/**
*
* created by liu jun
* @date 2024-02-03
*/
@RequestMapping(value = "/safetyApproval")
@ResponseBody
public Object safetyApproval(@RequestParam(value = "FFILE", required = false) MultipartFile[] files) throws Exception {
PageData response = new PageData();
try {
PageData request = this.getPageData();
PageData condition = new PageData();
condition.put("HOTWORK_ID",request.get("HOTWORK_ID"));
condition.put("USER_ID",request.get("USER_ID"));
condition.put("CORPINFO_ID",request.get("CORPINFO_ID"));
condition.put("TYPE","2");
condition.put("APPROVAL_STATUS","1");
hotworkCfdService.confessApproval(condition, files);
// 保存安全项信息
condition.clear();
condition.put("HOTWORK_ID", request.get("HOTWORK_ID"));
hotworkToMeasuresCfdService.delete(condition);
List<JSONObject> list = (List<JSONObject>) JSON.parse(request.get("measuresList").toString());
for (JSONObject json : list) {
PageData measures = new PageData();
measures.put("HOTWORKTOMEASURES_ID", this.get32UUID()); // 主键
measures.put("HOTWORK_ID", condition.get("HOTWORK_ID"));
measures.put("BUS_HOTWORK_MEASURES_ID", json.get("BUS_HOTWORK_MEASURES_ID"));
measures.put("ANSWER1", json.get("ANSWER1"));
measures.put("ANSWER2", json.get("ANSWER2"));
measures.put("ANSWER3", json.get("ANSWER3"));
measures.put("ANSWER4", json.get("ANSWER4"));
measures.put("STATUS", json.get("STATUS"));
measures.put("CONFIRM_ID", request.get("OPERATOR"));
measures.put("CONFIRM_NAME", request.get("ACTION_USER"));
hotworkToMeasuresCfdService.save(measures);
}
response.put("result", "success");
return response;
} catch (Exception e) {

View File

@ -193,13 +193,13 @@ public class HotworkCfdServiceImpl implements HotworkCfdService {
conditon.put("HOTWORK_ID", request.get("HOTWORK_ID"));
conditon.put("IS_DELETE", "0");
conditon.put("VALID_FLAG", "1");
conditon.put("TYPE", "0");
conditon.put("TYPE", request.getString("TYPE"));
conditon.put("USER_ID", request.get("USER_ID"));
List<PageData> approvalInfos = busHotworkCfdExamineMapper.findByCondition(conditon);
if(approvalInfos.size() == 0) throw new RuntimeException("未找到审批信息,请联系管理员");
if (approvalInfos.size() > 1) throw new RuntimeException("审批信息异常,请联系管理员");
PageData entity = approvalInfos.get(0);
entity.put("APPROVAL_STATUS", "1");
entity.put("APPROVAL_STATUS", request.getString("APPROVAL_STATUS"));
entity.put("APPROVAL_SIGNATURE", Warden.saveFile(files,request.getString("CORPINFO_ID")));
entity.put("APPROVAL_SIGNATURE_TIME", DateUtil.getTime());
busHotworkCfdExamineMapper.edit(entity);
@ -392,12 +392,16 @@ public class HotworkCfdServiceImpl implements HotworkCfdService {
pd.put("BELONGING_USER_NAME", belong.getString("USER_NAME"));
pd.put("BELONGING_DEPARTMENT_ID", belong.getString("DEPARTMENT_ID"));
pd.put("BELONGING_DEPARTMENT_NAME", belong.getString("DEPARTMENT_NAME"));
pd.put("BELONGING_SIGNATURE", belong.getString("APPROVAL_SIGNATURE"));
pd.put("BELONGING_SIGNATURE_TIME", belong.getString("APPROVAL_SIGNATURE_TIME"));
// 安全项检查人
PageData safety = approvalInfos.stream().filter(x -> "2".equals(x.getString("TYPE"))).findFirst().orElse(null);
pd.put("SAFETY_USER_ID", safety.getString("USER_ID"));
pd.put("SAFETY_USER_NAME", safety.getString("USER_NAME"));
pd.put("SAFETY_DEPARTMENT_ID", safety.getString("DEPARTMENT_ID"));
pd.put("SAFETY_DEPARTMENT_NAME", safety.getString("DEPARTMENT_NAME"));
pd.put("SAFETY_SIGNATURE", safety.getString("APPROVAL_SIGNATURE"));
pd.put("SAFETY_SIGNATURE_TIME", safety.getString("APPROVAL_SIGNATURE_TIME"));
}
}

View File

@ -299,7 +299,7 @@
</if>
<if test="pd.USER_ID != null and pd.USER_ID != ''">
and exists (select 1 from bus_hotwork_cfd_examine bhce where bhce.USER_ID = #{pd.USER_ID} and bhce.IS_DELETE =
'0' and bhce.VALID_FLAG = '1' and bhce.APPROVAL_STATUS = '0' and bhce.TYPE = '0' and bhce.HOTWORK_ID = f.HOTWORK_ID)
'0' and bhce.VALID_FLAG = '1' and bhce.APPROVAL_STATUS = '0' and bhce.TYPE = #{pd.TYPE} and bhce.HOTWORK_ID = f.HOTWORK_ID)
</if>
ORDER BY f.APPLY_STATUS,f.CREATTIME DESC

View File

@ -1653,10 +1653,16 @@
<if test="APPLY_STATUS != '1' and APPLY_STATUS != 1">
left join BUS_HOTWORKTOMEASURES_CFD eo on eo.BUS_HOTWORK_MEASURES_ID = f.BUS_HOTWORK_MEASURES_ID
</if>
<if test="showInfo == '1'">
left join BUS_HOTWORKTOMEASURES_CFD eo on eo.BUS_HOTWORK_MEASURES_ID = f.BUS_HOTWORK_MEASURES_ID
</if>
where f.ISDELETE = '0'
<if test="APPLY_STATUS != '1' and APPLY_STATUS != 1">
and eo.HOTWORK_ID = #{HOTWORK_ID}
</if>
<if test="showInfo == '1'">
and eo.HOTWORK_ID = #{HOTWORK_ID}
</if>
order by f.ORDER
</select>