Эх сурвалжийг харах

PSSR自动生成数据+模板

jiangbiao 5 сар өмнө
parent
commit
482dcecf86

+ 2 - 2
master/src/main/java/com/ruoyi/common/jpush/JiGuangPushService.java

@@ -17,7 +17,7 @@ import org.springframework.stereotype.Service;
 
 import java.util.Arrays;
 
-@Service
+@Service("jiGuangPushService")
 public class JiGuangPushService {
     Logger log = LoggerFactory.getLogger(this.getClass());
 
@@ -52,7 +52,7 @@ public class JiGuangPushService {
         String[] alias1 = alias;
         if (isDev) {
             for (int i = 0 ;i<alias.length;i++) {
-                alias1[i]="dev-" + alias[i];
+                alias1[i]="dev_" + alias[i];
             }
         }
         // 目标人群

+ 3 - 0
master/src/main/java/com/ruoyi/project/listener/pssr/ConfirmTaskCreateListener.java

@@ -3,6 +3,7 @@ package com.ruoyi.project.listener.pssr;
 import com.alibaba.fastjson.JSON;
 import com.github.stuxuhai.jpinyin.PinyinFormat;
 import com.github.stuxuhai.jpinyin.PinyinHelper;
+import com.ruoyi.common.jpush.JiGuangPushService;
 import com.ruoyi.common.sendEmail.IMailService;
 import com.ruoyi.common.utils.SpringContextUtils;
 import com.ruoyi.project.invoice.domain.TApproveReserveInvoice;
@@ -31,6 +32,7 @@ public class ConfirmTaskCreateListener implements Serializable, TaskListener {
         String id = delegateTask.getExecution().getProcessInstanceBusinessKey();
         ITPssrApproveService approveService = (ITPssrApproveService) SpringContextUtils.getBean("tPssrApproveService");
         ISysUserService sysUserService = (ISysUserService) SpringContextUtils.getBean("sysUserService");
+        JiGuangPushService jiGuangPushService = (JiGuangPushService) SpringContextUtils.getBean("jiGuangPushService");
         IMailService mailService = (IMailService) SpringContextUtils.getBean("mailService");
         TPssrApprove approveEntity = approveService.selectTPssrApproveById(Long.parseLong(id));
         String assignee = delegateTask.getAssignee();
@@ -81,6 +83,7 @@ public class ConfirmTaskCreateListener implements Serializable, TaskListener {
             String html = start + prime + end;
             logger.info("html:" + html);
             mailService.sendHtmlMail(email, "PSSR:您有一个新的待办任务 PSSR:You have a pending PSSR task (" + apNo + ")", html);
+            jiGuangPushService.send("PSSR审批", "您有一个新的待办任务,请及时处理。", assignee);
         } catch (Exception e) {
             logger.error("邮件发送失败" + JSON.toJSONString(e));
         }

+ 724 - 17
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrAboveallController.java

@@ -30,6 +30,7 @@ import java.util.List;
 @RestController
 @RequestMapping("/pssr/aboveall")
 public class TPssrAboveallController extends BaseController {
+    //region 注入服务层对象
     @Autowired
     private ITPssrAboveallService tPssrAboveallService;
 
@@ -69,6 +70,12 @@ public class TPssrAboveallController extends BaseController {
     @Autowired
     private ITPssrHygieneService tPssrHygieneService;
 
+    @Autowired
+    private ITPssrFrameModelService tPssrFrameModelService;
+
+    @Autowired
+    private ITPssrFrameService tPssrFrameService;
+
     @Autowired
     private ITPssrProtectionService tPssrProtectionService;
     @Autowired
@@ -80,6 +87,93 @@ public class TPssrAboveallController extends BaseController {
     @Autowired
     private ITPssrFranklinismService tPssrFranklinismService;
 
+    @Autowired
+    private ITPssrOverhaulExchangerService tPssrOverhaulExchangerService;
+
+    @Autowired
+    private ITPssrOverhaulFilterService tPssrOverhaulFilterService;
+
+    @Autowired
+    private ITPssrOverhaulTowerService tPssrOverhaulTowerService;
+
+    @Autowired
+    private ITPssrOverhaulValveService tPssrOverhaulValveService;
+
+    @Autowired
+    private ITPssrBlindService tPssrBlindService;
+
+    @Autowired
+    private ITPssrLockService tPssrLockService;
+
+    @Autowired
+    private ITPssrPipeService tPssrPipeService;
+
+    @Autowired
+    private ITPssrCleaningService tPssrCleaningService;
+
+    @Autowired
+    private ITPssrAirtightService tPssrAirtightService;
+
+    @Autowired
+    private ITPssrLaboratoryService tPssrLaboratoryService;
+
+    @Autowired
+    private ITPssrCircuitService tPssrCircuitService;
+
+    @Autowired
+    private ITPssrSafetyBleedService tPssrSafetyBleedService;
+
+    @Autowired
+    private ITPssrSafetyBreathService tPssrSafetyBreathService;
+
+    @Autowired
+    private ITPssrSafetyBrustService tPssrSafetyBrustService;
+
+    @Autowired
+    private ITPssrSafetyFlamearresterService tPssrSafetyFlamearresterService;
+
+    @Autowired
+    private ITPssrMotorService tPssrMotorService;
+
+    @Autowired
+    private ITPssrInstrumentCalibrationService tPssrInstrumentCalibrationService;
+
+    @Autowired
+    private ITPssrNitrogenService tPssrNitrogenService;
+
+    @Autowired
+    private ITPssrGasdetectorService tPssrGasdetectorService;
+
+    @Autowired
+    private ITPssrAnalyzerService tPssrAnalyzerService;
+
+    @Autowired
+    private ITPssrMeasureService tPssrMeasureService;
+
+    @Autowired
+    private ITPssrPumpFillService tPssrPumpFillService;
+
+    @Autowired
+    private ITPssrPumpCleaningService tPssrPumpCleaningService;
+
+    @Autowired
+    private ITPssrPumpOverhaulService tPssrPumpOverhaulService;
+
+    @Autowired
+    private ITPssrInstrumentTestService tPssrInstrumentTestService;
+
+    @Autowired
+    private ITPssrAlarmService tPssrAlarmService;
+
+    @Autowired
+    private ITPssrVesselService tPssrVesselService;
+
+    @Autowired
+    private ITPssrProgrammeService tPssrProgrammeService;
+    //endregion
+
+    //region 系统方法
+
     /**
      * 查询PSSR列表
      */
@@ -112,6 +206,38 @@ public class TPssrAboveallController extends BaseController {
         return AjaxResult.success(tPssrAboveallService.selectTPssrAboveallById(id));
     }
 
+
+    /**
+     * 修改PSSR
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:aboveall:edit')")
+    @Log(title = "PSSR", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TPssrAboveall tPssrAboveall) {
+        return toAjax(tPssrAboveallService.updateTPssrAboveall(tPssrAboveall));
+    }
+
+    /**
+     * 删除PSSR
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:aboveall:remove')")
+    @Log(title = "PSSR", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tPssrAboveallService.deleteTPssrAboveallByIds(ids));
+    }
+
+    /**
+     * 查询pssr相关用户
+     */
+    @GetMapping("/listPssrUser")
+    public AjaxResult listPssrUser(TPssrSubcontent sub) {
+        SysUser user = new SysUser();
+        return AjaxResult.success(userService.selectPssrUser(user));
+    }
+    //endregion
+
+    //region 新增
     /**
      * 新增PSSR
      */
@@ -119,6 +245,17 @@ public class TPssrAboveallController extends BaseController {
     @Log(title = "PSSR", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPssrAboveall tPssrAboveall) {
+        boolean model = false;
+        TPssrAboveall aboveall = null;
+        if (tPssrAboveall.getId() != null) {
+            model = true;
+            aboveall = tPssrAboveallService.selectTPssrAboveallById(tPssrAboveall.getId());
+            tPssrAboveall.setUnit(aboveall.getUnit());
+            tPssrAboveall.setRegion(aboveall.getRegion());
+            tPssrAboveall.setId(null);
+            tPssrAboveall.setDrivingTime(aboveall.getDrivingTime());
+            tPssrAboveall.setIncludePublic(aboveall.getIncludePublic());
+        }
         if (tPssrAboveall.getIncludePublic() == 1) {
             tPssrAboveall.setUnit(tPssrAboveall.getUnit() + ",390");
         }
@@ -244,19 +381,63 @@ public class TPssrAboveallController extends BaseController {
                         genRsfh(subcontent.getId(), userId);
                     } else if (subcontent.getForShort().equals("jdjdkj")) {
                         genJdjdkj(subcontent.getId(), userId);
+                    } else if (subcontent.getForShort().equals("zdj")) {
+                        genZdj(subcontent.getId(), subcontent.getUnit(), userId);
                     }
                 }, "新增子表数据").start();
             }
         }
+
+        //同步模板数据
+        if (model) {
+            genPssrDataByModel(aboveall, tPssrAboveall, userId);
+        }
         return AjaxResult.success();
     }
+    //endregion
+
+    //region 生成固定内容数据
 
+    /**
+     * 生成支吊架数据
+     */
+    private void genZdj(Long subId, String units, String userId) {
+        if (StringUtils.isNotEmpty(units)) {
+            for (String unit : units.split(",")) {
+                TPssrFrameModel model = new TPssrFrameModel();
+                model.setUnit(unit);
+                tPssrFrameModelService.selectTPssrFrameModelList(model).forEach(item -> {
+                    TPssrFrame frame = new TPssrFrame();
+                    frame.setSubId(subId);
+                    frame.setRegion(item.getRegion());
+                    frame.setBracketNumber(item.getBracketNumber());
+                    frame.setPipelineNumber(item.getPipelineNumber());
+                    frame.setDevNo(item.getDevNo());
+                    frame.setSupportType(item.getSupportType());
+                    frame.setFramePipe("✔");
+                    frame.setFrameRoot("✔");
+                    frame.setFunctionalPart("✔");
+                    frame.setConnector("✔");
+                    frame.setCreaterCode(userId);
+                    frame.setCreatedate(new Date());
+                    tPssrFrameService.insertTPssrFrame(frame);
+                });
+            }
+        }
+    }
+
+    /**
+     * 生成人身防护数据
+     */
     private void genRsfh(Long subId, String userId) {
         tPssrProtectionService.insertTPssrProtection(new TPssrProtection(subId, "被保温的管道/设备保温防护层外观完好,无缺失。", userId, new Date()));
         tPssrProtectionService.insertTPssrProtection(new TPssrProtection(subId, "保温层连接密封处严密,无管道/设备裸露。", userId, new Date()));
         tPssrProtectionService.insertTPssrProtection(new TPssrProtection(subId, "管道/设备上的保温层不妨碍操作人员进行现场作业。", userId, new Date()));
     }
 
+    /**
+     * 生成静电接地跨接数据
+     */
     private void genJdjdkj(Long subId, String userId) {
         tPssrFranklinismService.insertTPssrFranklinism(new TPssrFranklinism(1L, subId, "电气设备按要求接地,接线规范。", userId, new Date()));
         tPssrFranklinismService.insertTPssrFranklinism(new TPssrFranklinism(2L, subId, "管线按要求跨接,接线规范。", userId, new Date()));
@@ -265,6 +446,9 @@ public class TPssrAboveallController extends BaseController {
         tPssrFranklinismService.insertTPssrFranklinism(new TPssrFranklinism(5L, subId, "接地标记/标识清晰。", userId, new Date()));
     }
 
+    /**
+     * 生成现场卫生数据
+     */
     private void genXcws(Long subId, String userId) {
         tPssrHygieneService.insertTPssrHygiene(new TPssrHygiene(subId, "现场地面无油渍,积水等。", userId, new Date()));
         tPssrHygieneService.insertTPssrHygiene(new TPssrHygiene(subId, "现场无检修施工后的残留物(碎屑, 密封材料, 螺栓,保温材料等) 。", userId, new Date()));
@@ -401,33 +585,556 @@ public class TPssrAboveallController extends BaseController {
         tPssrPublicService.insertTPssrPublic(new TPssrPublic(subId, "公用工程系统低压蒸汽已投用或具备投用条件。", "界区阀已打开,PY9109压力达(    )Mpa,TI9115温度达(    )℃。", "PY9109压力达(    )Mpa,TI9115温度达(    )℃。", userId, new Date()));
         tPssrPublicService.insertTPssrPublic(new TPssrPublic(subId, "公用工程系统精制凝液已投用或具备投用条件。", "界区阀已打开,P3505A/B/C压力达(    )Mpa。", "P3505A/B/C压力达(    )Mpa。", userId, new Date()));
     }
+//endregion
+
+    //region 根据模板旧数据生成数据
 
     /**
-     * 修改PSSR
+     * 根据模板旧数据生成数据
      */
-    @PreAuthorize("@ss.hasPermi('pssr:aboveall:edit')")
-    @Log(title = "PSSR", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody TPssrAboveall tPssrAboveall) {
-        return toAjax(tPssrAboveallService.updateTPssrAboveall(tPssrAboveall));
+    private void genPssrDataByModel(TPssrAboveall model, TPssrAboveall newData, String userId) {
+//        new Thread(() -> {//同步模板数据
+            TPssrSubcontent subcontent = new TPssrSubcontent();
+            subcontent.setAboveallId(model.getId());
+            //查询旧数据对应的子表信息,然后根据模板生成新的子表数据
+            for (TPssrSubcontent oldSub : tPssrSubcontentService.selectTPssrSubcontentList(subcontent)) {
+                //查询模板中是否有该子表数据,如果有则生成新的子表数据
+                TPssrSubcontent sub = new TPssrSubcontent();
+                sub.setAboveallId(newData.getId());
+                sub.setForShort(oldSub.getForShort());
+                TPssrSubcontent newSub = tPssrSubcontentService.selectTPssrSubcontentList(sub).get(0);
+                switch (oldSub.getForShort()) {
+                    case "jxxm":
+                        genJxxm(oldSub, newSub, userId);
+                        break;
+                    case "kgfa":
+                        genKgfa(oldSub, newSub, userId);
+                        break;
+                    case "sjbg":
+                        genSjgb(oldSub, newSub, userId);
+                        break;
+                    case "mb":
+                        genMb(oldSub, newSub, userId);
+                        break;
+                    case "sbqjd":
+                        genSbqjd(oldSub, newSub, userId);
+                        break;
+                    case "qm":
+                        genQm(oldSub, newSub, userId);
+                        break;
+                    case "sksgfmzt":
+                        genSksgfmzt(oldSub, newSub, userId);
+                        break;
+                    case "sys":
+                        genSys(oldSub, newSub, userId);
+                        break;
+                    case "dj":
+                        genDj(oldSub, newSub, userId);
+                        break;
+                    case "dqzh":
+                        genDqzh(oldSub, newSub, userId);
+                        break;
+                    case "aqss":
+                        genAqss(oldSub, newSub, userId);
+                        break;
+                    case "jb":
+                        genJb(oldSub, newSub, userId);
+                        break;
+                    case "ybjy":
+                        genYbjy(oldSub, newSub, userId);
+                        break;
+                    case "yblscs":
+                        genYblscs(oldSub, newSub, userId);
+                        break;
+                    case "bjlszqr":
+                        genBjlszqr(oldSub, newSub, userId);
+                        break;
+                    case "djsb":
+                        genDjsb(oldSub, newSub, userId);
+                        break;
+                    case "qtjcy":
+                        genQtjcy(oldSub, newSub, userId);
+                        break;
+                    case "zxfxy":
+                        genZxfxy(oldSub, newSub, userId);
+                        break;
+                }
+            }
+//        }, "新增模板子表数据").start();
     }
 
     /**
-     * 删除PSSR
+     * 生成短接数据
      */
-    @PreAuthorize("@ss.hasPermi('pssr:aboveall:remove')")
-    @Log(title = "PSSR", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids) {
-        return toAjax(tPssrAboveallService.deleteTPssrAboveallByIds(ids));
+    private void genDj(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrCircuit circuit = new TPssrCircuit();
+        circuit.setSubId(oldSub.getId());
+        for (TPssrCircuit oldItem : tPssrCircuitService.selectTPssrCircuitList(circuit)) {
+            TPssrCircuit newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrCircuitService.insertTPssrCircuit(newItem);
+        }
     }
 
     /**
-     * 查询pssr相关用户
+     * 生成实验室数据
      */
-    @GetMapping("/listPssrUser")
-    public AjaxResult listPssrUser(TPssrSubcontent sub) {
-        SysUser user = new SysUser();
-        return AjaxResult.success(userService.selectPssrUser(user));
+    private void genSys(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrLaboratory laboratory = new TPssrLaboratory();
+        laboratory.setSubId(oldSub.getId());
+        for (TPssrLaboratory oldItem : tPssrLaboratoryService.selectTPssrLaboratoryList(laboratory)) {
+            TPssrLaboratory newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrLaboratoryService.insertTPssrLaboratory(newItem);
+        }
+    }
+
+    /**
+     * 生成锁开锁关数据
+     */
+    private void genSksgfmzt(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrLock lock = new TPssrLock();
+        lock.setSubId(oldSub.getId());
+        for (TPssrLock oldItem : tPssrLockService.selectTPssrLockList(lock)) {
+            TPssrLock newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrLockService.insertTPssrLock(newItem);
+        }
     }
+
+    /**
+     * 生成气密数据
+     */
+    private void genQm(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrAirtight airtight = new TPssrAirtight();
+        airtight.setSubId(oldSub.getId());
+        for (TPssrAirtight oldItem : tPssrAirtightService.selectTPssrAirtightList(airtight)) {
+            TPssrAirtight newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrAirtightService.insertTPssrAirtight(newItem);
+        }
+    }
+
+    /**
+     * 生成设备清洁度数据
+     */
+    private void genSbqjd(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrCleaning cleaning = new TPssrCleaning();
+        cleaning.setSubId(oldSub.getId());
+        for (TPssrCleaning oldItem : tPssrCleaningService.selectTPssrCleaningList(cleaning)) {
+            TPssrCleaning newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrCleaningService.insertTPssrCleaning(newItem);
+        }
+    }
+
+    /**
+     * 生成盲板数据
+     */
+    private void genMb(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrBlind blind = new TPssrBlind();
+        blind.setSubId(oldSub.getId());
+        for (TPssrBlind oldItem : tPssrBlindService.selectTPssrBlindList(blind)) {
+            TPssrBlind newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setInstallDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrBlindService.insertTPssrBlind(newItem);
+        }
+    }
+
+    /**
+     * 生成氮气置换数据
+     */
+    private void genDqzh(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrNitrogen nitrogen = new TPssrNitrogen();
+        nitrogen.setSubId(oldSub.getId());
+        for (TPssrNitrogen oldItem : tPssrNitrogenService.selectTPssrNitrogenList(nitrogen)) {
+            TPssrNitrogen newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrNitrogenService.insertTPssrNitrogen(newItem);
+        }
+    }
+
+    /**
+     * 生成安全设施数据
+     */
+    private void genAqss(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        //泄放阀
+        TPssrSafetyBleed safetyBleed = new TPssrSafetyBleed();
+        safetyBleed.setSubId(oldSub.getId());
+        for (TPssrSafetyBleed oldItem : tPssrSafetyBleedService.selectTPssrSafetyBleedList(safetyBleed)) {
+            TPssrSafetyBleed newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrSafetyBleedService.insertTPssrSafetyBleed(newItem);
+        }
+        //呼吸阀
+        TPssrSafetyBreath safetyBreath = new TPssrSafetyBreath();
+        safetyBreath.setSubId(oldSub.getId());
+        for (TPssrSafetyBreath oldItem : tPssrSafetyBreathService.selectTPssrSafetyBreathList(safetyBreath)) {
+            TPssrSafetyBreath newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrSafetyBreathService.insertTPssrSafetyBreath(newItem);
+        }
+        //爆破片
+        TPssrSafetyBrust safetyBrust = new TPssrSafetyBrust();
+        safetyBrust.setSubId(oldSub.getId());
+        for (TPssrSafetyBrust oldItem : tPssrSafetyBrustService.selectTPssrSafetyBrustList(safetyBrust)) {
+            TPssrSafetyBrust newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrSafetyBrustService.insertTPssrSafetyBrust(newItem);
+        }
+        //阻火器
+        TPssrSafetyFlamearrester safetyFlamearrester = new TPssrSafetyFlamearrester();
+        safetyFlamearrester.setSubId(oldSub.getId());
+        for (TPssrSafetyFlamearrester oldItem : tPssrSafetyFlamearresterService.selectTPssrSafetyFlamearresterList(safetyFlamearrester)) {
+            TPssrSafetyFlamearrester newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrSafetyFlamearresterService.insertTPssrSafetyFlamearrester(newItem);
+        }
+    }
+
+    /**
+     * 生成机泵数据
+     */
+    private void genJb(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrPumpCleaning pumpCleaning = new TPssrPumpCleaning();
+        pumpCleaning.setSubId(oldSub.getId());
+        for (TPssrPumpCleaning oldItem : tPssrPumpCleaningService.selectTPssrPumpCleaningList(pumpCleaning)) {
+            TPssrPumpCleaning newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrPumpCleaningService.insertTPssrPumpCleaning(newItem);
+        }
+        TPssrPumpFill pumpFill = new TPssrPumpFill();
+        pumpFill.setSubId(oldSub.getId());
+        for (TPssrPumpFill oldItem : tPssrPumpFillService.selectTPssrPumpFillList(pumpFill)) {
+            TPssrPumpFill newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrPumpFillService.insertTPssrPumpFill(newItem);
+        }
+        TPssrPumpOverhaul pumpOverhaul = new TPssrPumpOverhaul();
+        pumpOverhaul.setSubId(oldSub.getId());
+        for (TPssrPumpOverhaul oldItem : tPssrPumpOverhaulService.selectTPssrPumpOverhaulList(pumpOverhaul)) {
+            TPssrPumpOverhaul newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrPumpOverhaulService.insertTPssrPumpOverhaul(newItem);
+        }
+    }
+
+    /**
+     * 生成仪表校验数据
+     */
+    private void genYbjy(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrInstrumentCalibration instrumentCalibration = new TPssrInstrumentCalibration();
+        instrumentCalibration.setSubId(oldSub.getId());
+        for (TPssrInstrumentCalibration oldItem : tPssrInstrumentCalibrationService.selectTPssrInstrumentCalibrationList(instrumentCalibration)) {
+            TPssrInstrumentCalibration newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrInstrumentCalibrationService.insertTPssrInstrumentCalibration(newItem);
+        }
+    }
+
+    /**
+     * 生成仪表连锁测试数据
+     */
+    private void genYblscs(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrInstrumentTest instrumentTest = new TPssrInstrumentTest();
+        instrumentTest.setSubId(oldSub.getId());
+        for (TPssrInstrumentTest oldItem : tPssrInstrumentTestService.selectTPssrInstrumentTestList(instrumentTest)) {
+            TPssrInstrumentTest newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrInstrumentTestService.insertTPssrInstrumentTest(newItem);
+        }
+    }
+
+    /**
+     * 生成报警连锁值确认数据
+     */
+    private void genBjlszqr(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrAlarm alarm = new TPssrAlarm();
+        alarm.setSubId(oldSub.getId());
+        for (TPssrAlarm oldItem : tPssrAlarmService.selectTPssrAlarmList(alarm)) {
+            TPssrAlarm newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrAlarmService.insertTPssrAlarm(newItem);
+        }
+    }
+
+    /**
+     * 生成电机设备数据
+     */
+    private void genDjsb(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrMotor motor = new TPssrMotor();
+        motor.setSubId(oldSub.getId());
+        for (TPssrMotor oldItem : tPssrMotorService.selectTPssrMotorList(motor)) {
+            TPssrMotor newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrMotorService.insertTPssrMotor(newItem);
+        }
+    }
+
+    /**
+     * 生成气体检测仪数据
+     */
+    private void genQtjcy(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrGasdetector gasdetector = new TPssrGasdetector();
+        gasdetector.setSubId(oldSub.getId());
+        for (TPssrGasdetector oldItem : tPssrGasdetectorService.selectTPssrGasdetectorList(gasdetector)) {
+            TPssrGasdetector newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrGasdetectorService.insertTPssrGasdetector(newItem);
+        }
+    }
+
+    /**
+     * 生成在线分析仪数据
+     */
+    private void genZxfxy(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrAnalyzer analyzer = new TPssrAnalyzer();
+        analyzer.setSubId(oldSub.getId());
+        for (TPssrAnalyzer oldItem : tPssrAnalyzerService.selectTPssrAnalyzerList(analyzer)) {
+            TPssrAnalyzer newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrAnalyzerService.insertTPssrAnalyzer(newItem);
+        }
+    }
+
+    /**
+     * 生成设计变更数据
+     */
+    private void genSjgb(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrMoc moc = new TPssrMoc();
+        moc.setSubId(oldSub.getId());
+        for (TPssrMoc oldItem : tPssrMocService.selectTPssrMocList(moc)) {
+            TPssrMoc newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setConfirmationDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrMocService.insertTPssrMoc(newItem);
+        }
+    }
+
+    /**
+     * 生成检修项目数据
+     */
+    private void genJxxm(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        //换热器
+        TPssrOverhaulExchanger overhaulExchanger = new TPssrOverhaulExchanger();
+        overhaulExchanger.setSubId(oldSub.getId());
+        for (TPssrOverhaulExchanger exchanger : tPssrOverhaulExchangerService.selectTPssrOverhaulExchangerList(overhaulExchanger)) {
+            TPssrOverhaulExchanger newItem = exchanger;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setCompletionDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrOverhaulExchangerService.insertTPssrOverhaulExchanger(newItem);
+        }
+        //过滤器
+        TPssrOverhaulFilter overhaulFilter = new TPssrOverhaulFilter();
+        overhaulFilter.setSubId(oldSub.getId());
+        for (TPssrOverhaulFilter filter : tPssrOverhaulFilterService.selectTPssrOverhaulFilterList(overhaulFilter)) {
+            TPssrOverhaulFilter newItem = filter;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setCompletionDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrOverhaulFilterService.insertTPssrOverhaulFilter(newItem);
+        }
+        //塔罐
+        TPssrOverhaulTower overhaulTower = new TPssrOverhaulTower();
+        overhaulTower.setSubId(oldSub.getId());
+        for (TPssrOverhaulTower tower : tPssrOverhaulTowerService.selectTPssrOverhaulTowerList(overhaulTower)) {
+            TPssrOverhaulTower newItem = tower;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setCompletionDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrOverhaulTowerService.insertTPssrOverhaulTower(newItem);
+        }
+        //阀门
+        TPssrOverhaulValve overhaulValve = new TPssrOverhaulValve();
+        overhaulValve.setSubId(oldSub.getId());
+        for (TPssrOverhaulValve valve : tPssrOverhaulValveService.selectTPssrOverhaulValveList(overhaulValve)) {
+            TPssrOverhaulValve newItem = valve;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setDoneDate(null);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrOverhaulValveService.insertTPssrOverhaulValve(newItem);
+        }
+    }
+
+    /**
+     * 生成开工方案数据
+     */
+    private void genKgfa(TPssrSubcontent oldSub, TPssrSubcontent newSub, String userId) {
+        TPssrProgramme programme = new TPssrProgramme();
+        programme.setSubId(oldSub.getId());
+        for (TPssrProgramme oldItem : tPssrProgrammeService.selectTPssrProgrammeList(programme)) {
+            TPssrProgramme newItem = oldItem;
+            newItem.setSubId(newSub.getId());
+            newItem.setId(null);
+            newItem.setCreatedate(new Date());
+            newItem.setCreaterCode(userId);
+            newItem.setApproveStatus(0L);
+            newItem.setUpdaterCode(null);
+            newItem.setUpdatedate(null);
+            tPssrProgrammeService.insertTPssrProgramme(newItem);
+        }
+    }
+    //endregion
+
 }

+ 4 - 4
master/src/main/resources/mybatis/pssr/TPssrOverhaulExchangerMapper.xml

@@ -36,10 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectNoConfirmCount"  parameterType="Long" resultType="int">
         SELECT
-            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_EXCHANGER WHERE CONFIRMED_PERSON IS NULL) +
-            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_FILTER WHERE RESP_PERSON IS NULL) +
-            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_TOWER WHERE CONFIRMED_PERSON IS NULL) +
-            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_VALVE WHERE IDENTIFYING_PERSON IS NULL)
+            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_EXCHANGER WHERE sub_id = #{subId} and CONFIRMED_PERSON IS NULL) +
+            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_FILTER WHERE sub_id = #{subId} and RESP_PERSON IS NULL) +
+            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_TOWER WHERE sub_id = #{subId} and CONFIRMED_PERSON IS NULL) +
+            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_VALVE WHERE sub_id = #{subId} and IDENTIFYING_PERSON IS NULL)
         FROM dual
     </select>
 

+ 147 - 63
ui/src/views/pssr/aboveall/index.vue

@@ -26,15 +26,32 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--          type="primary"-->
+      <!--          icon="el-icon-plus"-->
+      <!--          size="mini"-->
+      <!--          @click="handleAdd"-->
+      <!--          v-hasPermi="['pssr:aboveall:add']"-->
+      <!--        >新增-->
+      <!--        </el-button>-->
+      <!--      </el-col>-->
       <el-col :span="1.5">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['pssr:aboveall:add']"
-        >新增
-        </el-button>
+        <el-popover
+          placement="bottom"
+          width="280">
+          <div style="text-align: center; margin: 0">
+            <el-button type="success" size="mini" @click="handleCreate">通过模板新增</el-button>
+            <el-button type="primary" size="mini" @click="handleAdd">直接新增</el-button>
+          </div>
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="mini" slot="reference"
+            v-hasPermi="['pssr:aboveall:add']"
+          >新增
+          </el-button>
+        </el-popover>
       </el-col>
       <!--<el-col :span="1.5">
         <el-button
@@ -58,25 +75,15 @@
         >删除
         </el-button>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="info"
-          icon="el-icon-upload2"
-          size="mini"
-          @click="handleImport"
-          v-hasPermi="['pssr:aboveall:edit']"
-        >导入
-        </el-button>
-      </el-col>
       <!--<el-col :span="1.5">-->
-        <!--<el-button-->
-          <!--type="warning"-->
-          <!--icon="el-icon-download"-->
-          <!--size="mini"-->
-          <!--@click="handleExport"-->
-          <!--v-hasPermi="['pssr:aboveall:export']"-->
-        <!--&gt;导出-->
-        <!--</el-button>-->
+      <!--<el-button-->
+      <!--type="warning"-->
+      <!--icon="el-icon-download"-->
+      <!--size="mini"-->
+      <!--@click="handleExport"-->
+      <!--v-hasPermi="['pssr:aboveall:export']"-->
+      <!--&gt;导出-->
+      <!--</el-button>-->
       <!--</el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
@@ -114,14 +121,14 @@
                       v-hasPermi="['pssr:aboveall:edit']"
                     >修改
                     </el-button>-->
-<!--          <el-button-->
-<!--            size="mini"-->
-<!--            type="text"-->
-<!--            icon="el-icon-delete"-->
-<!--            @click="handleDelete(scope.row)"-->
-<!--            v-hasPermi="['pssr:aboveall:remove']"-->
-<!--          >删除-->
-<!--          </el-button>-->
+          <!--          <el-button-->
+          <!--            size="mini"-->
+          <!--            type="text"-->
+          <!--            icon="el-icon-delete"-->
+          <!--            @click="handleDelete(scope.row)"-->
+          <!--            v-hasPermi="['pssr:aboveall:remove']"-->
+          <!--          >删除-->
+          <!--          </el-button>-->
           <el-button
             size="mini"
             type="text"
@@ -130,17 +137,17 @@
           >检查内容
           </el-button>
           <!--<el-button-->
-            <!--size="mini"-->
-            <!--type="text"-->
-            <!--icon="el-icon-download"-->
-            <!--@click="handleZip(scope.row)"-->
+          <!--size="mini"-->
+          <!--type="text"-->
+          <!--icon="el-icon-download"-->
+          <!--@click="handleZip(scope.row)"-->
           <!--&gt;打包-->
           <!--</el-button>-->
           <!--<el-button-->
-            <!--size="mini"-->
-            <!--type="text"-->
-            <!--icon="el-icon-download"-->
-            <!--@click="handleDownload(scope.row)"-->
+          <!--size="mini"-->
+          <!--type="text"-->
+          <!--icon="el-icon-download"-->
+          <!--@click="handleDownload(scope.row)"-->
           <!--&gt;导出-->
           <!--</el-button>-->
           <el-button
@@ -194,10 +201,10 @@
           <el-col :span="8">
             <el-form-item label="预计开车时间" prop="drivingTime" label-width="140px">
               <el-date-picker clearable
-              v-model="form.drivingTime"
-              type="date"
-              value-format="yyyy-MM-dd"
-              placeholder="选择确认时间">
+                              v-model="form.drivingTime"
+                              type="date"
+                              value-format="yyyy-MM-dd"
+                              placeholder="选择确认时间">
               </el-date-picker>
             </el-form-item>
           </el-col>
@@ -297,6 +304,72 @@
       <input name="fileName" v-model="downloadForm.fileName" hidden/>
       <input name="delete" v-model="downloadForm.delete" hidden/>
     </form>
+
+    <el-dialog :close-on-click-modal="false" title="新增PSSR" :visible.sync="model.open" width="80%" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="模板" prop="id">
+          <el-select v-model="form.id" clearable filterable style="width: 100%;"
+                     placeholder="请选择模板生成PSSR数据">
+            <el-option
+              v-for="item in aboveallList"
+              :label="item.region+'_'+item.unit+(item.remarks==null?'':'_'+item.remarks)"
+              :value="item.id"
+              :key="item.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-card class="mb10">
+          <el-table :data="subcontents" v-loading="subloading" border :row-class-name="tableRowClassName"
+                    @selection-change="handleSubSelectionChange" max-height="500">
+            <el-table-column label="所属部门" align="center" prop="deptUnit" :show-overflow-tooltip="true" width="80"/>
+            <el-table-column label="序号" align="center" prop="serialNumber" :show-overflow-tooltip="true" width="80"/>
+            <el-table-column label="项目" align="center" prop="item" :show-overflow-tooltip="true" width="180"/>
+            <el-table-column label="开车条件检查内容" align="center" prop="content" :show-overflow-tooltip="true"/>
+            <el-table-column type="selection" width="55" align="center"/>
+            <el-table-column label="确认人" align="center" prop="confirm" width="180">
+              <template slot-scope="scope">
+                <el-select v-model="scope.row.confirm" clearable filterable style="width: 100%;"
+                           placeholder="请选择确认人" @change="handleChangeConfirm(scope.row.confirm,scope.row)">
+                  <el-option v-for="user in userOptions"
+                             :label="user.nickName"
+                             :value="user.userId"
+                             :key="user.userId"/>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center" width="100">
+              <template slot-scope="scope">
+                <el-tooltip effect="dark" content="添加本项" placement="top">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    @click="handleAddRow(scope.row)"
+                    :disabled="scope.row.status===1"
+                  >✔
+                  </el-button>
+                </el-tooltip>
+                <el-tooltip effect="dark" content="移除本项" placement="top">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    @click="handleRemoveRow(scope.row)"
+                    :disabled="scope.row.status===0"
+                  >✖
+                  </el-button>
+                </el-tooltip>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-card>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -305,11 +378,11 @@ import {
   addAboveall,
   delAboveall,
   exportAboveall,
-  getAboveall, getPssrUser,
+  genZip,
+  getAboveall,
+  getPssrUser,
   importTemplate,
-  listAboveall,
-  updateAboveall,
-  genZip
+  listAboveall
 } from "@/api/pssr/aboveall";
 import {treeselect} from "@/api/system/dept";
 import {getToken} from "@/utils/auth";
@@ -357,6 +430,9 @@ export default {
       clientHeight: 300,
       // 是否显示弹出层
       open: false,
+      model: {
+        open: false,
+      },
       // 用户导入参数
       upload: {
         // 是否显示弹出层(用户导入)
@@ -396,6 +472,9 @@ export default {
         region: [
           {required: true, message: '区域不能为空!', trigger: "blur"}
         ],
+        id: [
+          {required: true, message: '模板不能为空!', trigger: "blur"}
+        ],
       }
     };
   },
@@ -551,6 +630,18 @@ export default {
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
+    handleCreate() {
+      this.reset();
+      this.model.open = true;
+      this.subloading = true;
+      listPssrModel({
+        pageNum: 1,
+        pageSize: 200
+      }).then(res => {
+        this.subcontents = res.rows;
+        this.subloading = false;
+      })
+    },
     handleAdd() {
       this.reset();
       this.open = true;
@@ -604,19 +695,12 @@ export default {
       this.form.subcontents = this.subcontents;
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.id != null) {
-            updateAboveall(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addAboveall(this.form).then(response => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
+          addAboveall(this.form).then(response => {
+            this.msgSuccess("新增成功");
+            this.open = false;
+            this.model.open = false;
+            this.getList();
+          });
         }
       });
     },