|
@@ -1,6 +1,5 @@
|
|
|
package com.ruoyi.project.pssr.controller;
|
|
|
|
|
|
-import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
|
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
|
@@ -9,6 +8,8 @@ import com.ruoyi.framework.web.domain.AjaxResult;
|
|
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
|
|
import com.ruoyi.project.pssr.domain.*;
|
|
|
import com.ruoyi.project.pssr.service.*;
|
|
|
+import com.ruoyi.project.reliability.domain.TSafetyvavle;
|
|
|
+import com.ruoyi.project.reliability.service.ITSafetyvavleService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -41,6 +42,27 @@ public class TPssrAboveallController extends BaseController {
|
|
|
@Autowired
|
|
|
private ITPssrMaterialRawService tPssrMaterialRawService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ITPssrMocService tPssrMocService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITSafetyvavleService tSafetyvavleService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITPssrSafetyValveService tPssrSafetyValveService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITPssrPublicService tPssrPublicService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITPssrTorchvocService tPssrTorchvocService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITPssrLightingService tPssrLightingService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITPssrPowerService tPssrPowerService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询PSSR列表
|
|
|
*/
|
|
@@ -80,11 +102,6 @@ public class TPssrAboveallController extends BaseController {
|
|
|
@Log(title = "PSSR", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody TPssrAboveall tPssrAboveall) {
|
|
|
-// if (StringUtils.isNotEmpty(tPssrAboveall.getUnit())) {
|
|
|
-// String unit = tPssrAboveall.getUnit();
|
|
|
-// tPssrAboveall.setUnit(unit.substring(0, unit.indexOf("_")));
|
|
|
-// tPssrAboveall.setUnitDes(unit.substring(unit.indexOf("_") + 1));
|
|
|
-// }
|
|
|
tPssrAboveallService.insertTPssrAboveall(tPssrAboveall);//新增主表数据
|
|
|
//新增子表数据
|
|
|
for (TPssrSubcontent subcontent : tPssrAboveall.getSubcontents()) {
|
|
@@ -99,8 +116,9 @@ public class TPssrAboveallController extends BaseController {
|
|
|
tPssrSubcontentService.insertTPssrSubcontent(subcontent);
|
|
|
|
|
|
String userId = getUserId().toString();
|
|
|
- if (subcontent.getForShort().equals("xqf")) {
|
|
|
- new Thread(() -> {
|
|
|
+ new Thread(() -> {
|
|
|
+ if (subcontent.getForShort().equals("xqf")) {
|
|
|
+
|
|
|
List<TPssrPatrol> tPssrPatrols = new ArrayList<>();
|
|
|
// 手提式/小推车式灭火器/灭火器材箱检查记录,1
|
|
|
tPssrPatrols.add(getEntity(1L, subcontent.getId()));
|
|
@@ -130,13 +148,12 @@ public class TPssrAboveallController extends BaseController {
|
|
|
tPssrPatrols.add(getEntity(15L, subcontent.getId()));
|
|
|
// 蒸汽幕检查记录,16
|
|
|
tPssrPatrols.add(getEntity(16L, subcontent.getId()));
|
|
|
+ // 急救箱
|
|
|
tPssrPatrols.add(getEntity(27L, subcontent.getId()));
|
|
|
for (TPssrPatrol pssrPatrol : tPssrPatrols) {
|
|
|
tPssrPatrolService.insertTPssrPatrol(pssrPatrol, userId);
|
|
|
}
|
|
|
- }, "新增消气防数据").start();
|
|
|
- } else if (subcontent.getForShort().equals("txjk")) {
|
|
|
- new Thread(() -> {
|
|
|
+ } else if (subcontent.getForShort().equals("txjk")) {
|
|
|
List<TPssrPatrol> tPssrPatrols = new ArrayList<>();
|
|
|
// PAGA系统检查记录,10
|
|
|
tPssrPatrols.add(getEntity(10L, subcontent.getId()));
|
|
@@ -145,26 +162,85 @@ public class TPssrAboveallController extends BaseController {
|
|
|
for (TPssrPatrol pssrPatrol : tPssrPatrols) {
|
|
|
tPssrPatrolService.insertTPssrPatrol(pssrPatrol, userId);
|
|
|
}
|
|
|
- }, "新增通讯监控数据").start();
|
|
|
- } else if (subcontent.getForShort().equals("bxsjcy")) {
|
|
|
- new Thread(() -> {
|
|
|
+ } else if (subcontent.getForShort().equals("bxsjcy")) {
|
|
|
List<TPssrPatrol> tPssrPatrols = new ArrayList<>();
|
|
|
// 四合一/苯系物/硫化氢/二氧化碳/射线一氧化碳检测仪检查记录,18
|
|
|
tPssrPatrols.add(getEntity(18L, subcontent.getId()));
|
|
|
for (TPssrPatrol pssrPatrol : tPssrPatrols) {
|
|
|
tPssrPatrolService.insertTPssrPatrol(pssrPatrol, userId);
|
|
|
}
|
|
|
- }, "新增便携式检测仪数据").start();
|
|
|
- }else if (subcontent.getForShort().equals("yfl")) {
|
|
|
- new Thread(() -> {
|
|
|
- genYfl(subcontent.getId(),userId);
|
|
|
- }, "新增原辅料数据").start();
|
|
|
- }
|
|
|
+ } else if (subcontent.getForShort().equals("yfl")) {
|
|
|
+ genYfl(subcontent.getId(), userId);
|
|
|
+ } else if (subcontent.getForShort().equals("sjbg")) {
|
|
|
+ genMoc(subcontent.getId(), userId);
|
|
|
+ } else if (subcontent.getForShort().equals("aqss")) {
|
|
|
+ genAqf(subcontent, userId);
|
|
|
+ } else if (subcontent.getForShort().equals("gygc")) {
|
|
|
+ genGygc(subcontent.getId(), userId);
|
|
|
+ } else if (subcontent.getForShort().equals("hbss")) {
|
|
|
+ genHbss(subcontent.getId(), userId);
|
|
|
+ } else if (subcontent.getForShort().equals("zmdbr")) {
|
|
|
+ genZmdbr(subcontent.getId(), userId);
|
|
|
+ } else if (subcontent.getForShort().equals("lsdy")) {
|
|
|
+ genLsdy(subcontent.getId(), userId);
|
|
|
+ }
|
|
|
+ }, "新增子表数据").start();
|
|
|
}
|
|
|
}
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 生成临时电源数据
|
|
|
+ */
|
|
|
+ private void genLsdy(Long subId, String userId) {
|
|
|
+ tPssrPowerService.insertTPssrPower(new TPssrPower(subId,"现场电源插座上无接临时用电设备、临时线路。",new Date(),userId));
|
|
|
+ tPssrPowerService.insertTPssrPower(new TPssrPower(subId,"现场电源插座外观完好,无破损,插座盖子上紧,无脱落。",new Date(),userId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成照明、电伴热数据
|
|
|
+ */
|
|
|
+ private void genZmdbr(Long subId, String userId) {
|
|
|
+ tPssrLightingService.insertTPssrLighting(new TPssrLighting(subId, "照明灯外观完好,干净,无破损。", userId, new Date()));
|
|
|
+ tPssrLightingService.insertTPssrLighting(new TPssrLighting(subId, "照明灯无锈蚀。", userId, new Date()));
|
|
|
+ tPssrLightingService.insertTPssrLighting(new TPssrLighting(subId, "照明灯具固定牢固,无松动。", userId, new Date()));
|
|
|
+ tPssrLightingService.insertTPssrLighting(new TPssrLighting(subId, "照明导线完好,无破损。", userId, new Date()));
|
|
|
+ tPssrLightingService.insertTPssrLighting(new TPssrLighting(subId, "照明开关完好。", userId, new Date()));
|
|
|
+ tPssrLightingService.insertTPssrLighting(new TPssrLighting(subId, "照明设备可以正常打开或者关闭。", userId, new Date()));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成环保设施数据
|
|
|
+ */
|
|
|
+ private void genHbss(Long subId, String userId) {
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "火炬系统检修时所加装的盲板已拆除。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "火炬系统已完成氮气置换,氧含量<0.2%。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "公用工程(消防水、仪表风、氮气、电、中、低压蒸汽等)已投用或具备使用条件。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "火炬系统的所有仪表功能检查正常。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "火炬点火用燃料气已引到PCV-9994、PC-9991阀前。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "仪表空气送至PCV-9995阀前。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "加热火炬气的甲醇已充进换热器390-E-903,390-E-903的低压蒸汽管线暖管结束。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "火炬总管分子封用氮已经投用。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "点火器装置和电视监控器等电器设备已送电,设备完好。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "火炬消烟蒸汽已引到蒸汽调节阀前,RO-9991~3的前后闸阀全开,管线上所有疏水器均须投用。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "由LV-9990向水封罐390-V-940注生产工艺水,直到工艺水由从U形管排出。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "设定390-P-940去急冷水塔的流程,投用390-P-940自启动及停车控制器UC-9990。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "投用各火炬总管端点的吹扫气。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "火炬长明灯点火完成,确认正常。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "1", "火炬系统可以接收装置物料排放。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "2", "VOC系统检修时所加装的盲板已拆除。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "2", "VOC系统已完成氮气置换,氧含量合格。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "2", "公用工程(消防水、仪表风、氮气、电、中、低压蒸汽等)已投用或具备使用条件。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "2", "VOC系统的所有仪表功能检查正常。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "2", "VOC系统具备使用条件,开车流程打通,确认正常。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "2", "按操作程序启动390-K-950,确认K950运行正常。", userId, new Date()));
|
|
|
+ tPssrTorchvocService.insertTPssrTorchvoc(new TPssrTorchvoc(subId, "2", "VOC系统运行正常,可以接收VOC排放。", userId, new Date()));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成巡检数据
|
|
|
+ */
|
|
|
private TPssrPatrol getEntity(Long planType, Long subId) {
|
|
|
TPssrPatrol tPssrPatrol = new TPssrPatrol();
|
|
|
tPssrPatrol.setPlanType(planType);
|
|
@@ -172,6 +248,9 @@ public class TPssrAboveallController extends BaseController {
|
|
|
return tPssrPatrol;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 生成原辅料数据
|
|
|
+ */
|
|
|
private void genYfl(Long subId, String userId) {
|
|
|
tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "Electr. Power", "MWH", userId, new Date(), 0L));
|
|
|
tPssrMaterialService.insertTPssrMaterial(new TPssrMaterial(subId, "LP steam", "/", userId, new Date(), 0L));
|
|
@@ -197,6 +276,49 @@ public class TPssrAboveallController extends BaseController {
|
|
|
tPssrMaterialRawService.insertTPssrMaterialRaw(new TPssrMaterialRaw(subId, "Toluene", "Ton", userId, new Date(), 0L));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 生成moc数据
|
|
|
+ */
|
|
|
+ private void genMoc(Long subId, String userId) {
|
|
|
+ //TODO 添加MOC数据
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成安全阀数据
|
|
|
+ */
|
|
|
+ private void genAqf(TPssrSubcontent subcontent, String userId) {
|
|
|
+ for (String unit : subcontent.getUnit().split(",")) {
|
|
|
+ TSafetyvavle query = new TSafetyvavle();
|
|
|
+ query.setSubarea(unit);
|
|
|
+ for (TSafetyvavle vavle : tSafetyvavleService.selectTSafetyvavleList(query)) {
|
|
|
+ TPssrSafetyValve pssr = new TPssrSafetyValve();
|
|
|
+ pssr.setUnit(unit);
|
|
|
+ pssr.setSubId(subcontent.getId());
|
|
|
+ pssr.setDevNo(vavle.getTagno());
|
|
|
+ pssr.setInstallLocation(vavle.getPlacedesc());
|
|
|
+ pssr.setSafetyDev(vavle.getService());
|
|
|
+ pssr.setPidNo(vavle.getPid());
|
|
|
+ pssr.setSetPressure(vavle.getSettingpres());
|
|
|
+ pssr.setCreatedate(new Date());
|
|
|
+ pssr.setCreaterCode(userId);
|
|
|
+ tPssrSafetyValveService.insertTPssrSafetyValve(pssr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成公用工程数据
|
|
|
+ */
|
|
|
+ private void genGygc(Long subId, String userId) {
|
|
|
+ tPssrPublicService.insertTPssrPublic(new TPssrPublic(subId, "公用工程系统N2已投用或具备投用条件。", userId, new Date()));
|
|
|
+ tPssrPublicService.insertTPssrPublic(new TPssrPublic(subId, "公用工程系统IA已投用或具备投用条件。", userId, new Date()));
|
|
|
+ tPssrPublicService.insertTPssrPublic(new TPssrPublic(subId, "公用工程系统PA已投用或具备投用条件。", userId, new Date()));
|
|
|
+ tPssrPublicService.insertTPssrPublic(new TPssrPublic(subId, "公用工程系统CW已投用或具备投用条件。", userId, new Date()));
|
|
|
+ tPssrPublicService.insertTPssrPublic(new TPssrPublic(subId, "公用工程系统各压力等级蒸汽已投用,具备投用条件。", userId, new Date()));
|
|
|
+ tPssrPublicService.insertTPssrPublic(new TPssrPublic(subId, "公用工程系统各压力等级凝液已投用,具备投用条件。", userId, new Date()));
|
|
|
+ tPssrPublicService.insertTPssrPublic(new TPssrPublic(subId, "公用工程系统消防水已投用或具备投用条件。", userId, new Date()));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 修改PSSR
|
|
|
*/
|