diff --git a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java index c807eace..ba9ab934 100644 --- a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java +++ b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java @@ -1663,8 +1663,31 @@ public class AppHotworkCfdController extends BaseController { PageData condition = new PageData(); condition.put("showInfo",pd.getString("showInfo")); condition.put("HOTWORK_ID",pd.getString("HOTWORK_ID")); - map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); - +// map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); + List measuresList = hotworkCfdService.listAllMeasures(condition); + for (PageData measure : measuresList) { + String order = measure.getString("ORDER"); + String protectiveMeasures = measure.getString("PROTECTIVE_MEASURES"); + if ("2".equals(order)) { + String answer1 = measure.getString("ANSWER1"); + int startIndex = protectiveMeasures.indexOf('('); + int endIndex = protectiveMeasures.indexOf(')'); + if (startIndex != -1 && endIndex != -1 && startIndex < endIndex) { + protectiveMeasures = protectiveMeasures.substring(0, endIndex) + answer1 + protectiveMeasures.substring(endIndex); + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } else if ("8".equals(order)) { + String[] answers = {measure.getString("ANSWER1"), measure.getString("ANSWER2"), measure.getString("ANSWER3")}; + for (String answer : answers) { + int index = protectiveMeasures.indexOf("()"); + if (index != -1) { + protectiveMeasures = protectiveMeasures.substring(0, index + 1) + answer + protectiveMeasures.substring(index + 1); + } + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } + } + map.put("measuresList", measuresList); pd = hotworkCfdService.findById(pd); //根据ID读取 // created by liu jun 添加(交底人、项目主管部门负责人、安全措施确认人) diff --git a/src/main/java/com/zcloud/controller/highriskwork/HotworkCfdController.java b/src/main/java/com/zcloud/controller/highriskwork/HotworkCfdController.java index a68e9cad..10739baa 100644 --- a/src/main/java/com/zcloud/controller/highriskwork/HotworkCfdController.java +++ b/src/main/java/com/zcloud/controller/highriskwork/HotworkCfdController.java @@ -141,13 +141,36 @@ public class HotworkCfdController extends BaseController { PageData condition = new PageData(); condition.put("showInfo",pd.getString("showInfo")); condition.put("HOTWORK_ID",pd.getString("HOTWORK_ID")); - map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); - +// map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); + List measuresList = hotworkCfdService.listAllMeasures(condition); + for (PageData measure : measuresList) { + String order = measure.getString("ORDER"); + String protectiveMeasures = measure.getString("PROTECTIVE_MEASURES"); + if ("2".equals(order)) { + String answer1 = measure.getString("ANSWER1"); + int startIndex = protectiveMeasures.indexOf('('); + int endIndex = protectiveMeasures.indexOf(')'); + if (startIndex != -1 && endIndex != -1 && startIndex < endIndex) { + protectiveMeasures = protectiveMeasures.substring(0, endIndex) + answer1 + protectiveMeasures.substring(endIndex); + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } else if ("8".equals(order)) { + String[] answers = {measure.getString("ANSWER1"), measure.getString("ANSWER2"), measure.getString("ANSWER3")}; + for (String answer : answers) { + int index = protectiveMeasures.indexOf("()"); + if (index != -1) { + protectiveMeasures = protectiveMeasures.substring(0, index + 1) + answer + protectiveMeasures.substring(index + 1); + } + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } + } + map.put("measuresList", measuresList); pd = hotworkCfdService.findById(pd); //根据ID读取 // created by liu jun 添加(交底人、项目主管部门负责人、安全措施确认人) hotworkCfdService.addInfo(pd); - map.put("measuresList", hotworkCfdService.listAllMeasures(pd)); +// map.put("measuresList", hotworkCfdService.listAllMeasures(pd)); map.put("gasList", hotworkGasCfdService.listAll(pd)); // imgList是接受交底人签字 map.put("imgList", hotworkAcceptUserCfdService.findByIds(pd)); diff --git a/src/main/java/com/zcloud/service/map/impl/MapEightCfdServiceImpl.java b/src/main/java/com/zcloud/service/map/impl/MapEightCfdServiceImpl.java index 4706a68c..66a265a2 100644 --- a/src/main/java/com/zcloud/service/map/impl/MapEightCfdServiceImpl.java +++ b/src/main/java/com/zcloud/service/map/impl/MapEightCfdServiceImpl.java @@ -62,7 +62,31 @@ public class MapEightCfdServiceImpl implements MapEightCfdService { PageData condition = new PageData(); condition.put("showInfo",pd.getString("showInfo")); condition.put("HOTWORK_ID",pd.getString("HOTWORK_ID")); - map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); +// map.put("measuresList", hotworkCfdService.listAllMeasures(condition)); + List measuresList = hotworkCfdService.listAllMeasures(condition); + for (PageData measure : measuresList) { + String order = measure.getString("ORDER"); + String protectiveMeasures = measure.getString("PROTECTIVE_MEASURES"); + if ("2".equals(order)) { + String answer1 = measure.getString("ANSWER1"); + int startIndex = protectiveMeasures.indexOf('('); + int endIndex = protectiveMeasures.indexOf(')'); + if (startIndex != -1 && endIndex != -1 && startIndex < endIndex) { + protectiveMeasures = protectiveMeasures.substring(0, endIndex) + answer1 + protectiveMeasures.substring(endIndex); + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } else if ("8".equals(order)) { + String[] answers = {measure.getString("ANSWER1"), measure.getString("ANSWER2"), measure.getString("ANSWER3")}; + for (String answer : answers) { + int index = protectiveMeasures.indexOf("()"); + if (index != -1) { + protectiveMeasures = protectiveMeasures.substring(0, index + 1) + answer + protectiveMeasures.substring(index + 1); + } + } + measure.put("PROTECTIVE_MEASURES", protectiveMeasures); + } + } + map.put("measuresList", measuresList); map.put("gasList", hotworkGasCfdService.listAll(pd)); map.put("imgList", hotworkacceptuserCfdService.findByIds(pd)); map.put("imgList1", hotworkacceptuserCfdService.findById(pd)); diff --git a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml index 95b4e14d..dd95a7f4 100644 --- a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml +++ b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml @@ -882,7 +882,9 @@ GROUP BY f.HOTWORK_ID - ORDER BY f.APPLY_STATUS,f.CREATTIME DESC + ORDER BY +-- f.APPLY_STATUS, + f.CREATTIME DESC