|
|
@@ -1,11 +1,18 @@
|
|
|
package com.ruoyi.project.ps.patrol.service.impl;
|
|
|
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.project.ps.dev.domain.*;
|
|
|
+import com.ruoyi.project.ps.dev.mapper.*;
|
|
|
+import com.ruoyi.project.ps.inspection.domain.*;
|
|
|
+import com.ruoyi.project.ps.inspection.mapper.*;
|
|
|
import com.ruoyi.project.ps.patrol.domain.TPsPatrolPlan;
|
|
|
import com.ruoyi.project.ps.patrol.mapper.TPsPatrolPlanMapper;
|
|
|
import com.ruoyi.project.ps.patrol.service.ITPsPatrolPlanService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Calendar;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -19,6 +26,82 @@ public class TPsPatrolPlanServiceImpl implements ITPsPatrolPlanService {
|
|
|
@Autowired
|
|
|
private TPsPatrolPlanMapper tPsPatrolPlanMapper;
|
|
|
|
|
|
+ // 设备 Mapper 注入
|
|
|
+ @Autowired
|
|
|
+ private TPsDevAlarmMapper tPsDevAlarmMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevCabinetMapper tPsDevCabinetMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevCallsystemMapper tPsDevCallsystemMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevCofferMapper tPsDevCofferMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevCurtainMapper tPsDevCurtainMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevExtinguisherMapper tPsDevExtinguisherMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevEyewashMapper tPsDevEyewashMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevFgsMapper tPsDevFgsMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevFiredoorMapper tPsDevFiredoorMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevHydrantMapper tPsDevHydrantMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevLiftMapper tPsDevLiftMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevMonitorMapper tPsDevMonitorMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevPitMapper tPsDevPitMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevRainvalveMapper tPsDevRainvalveMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevSteamMapper tPsDevSteamMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevSumpMapper tPsDevSumpMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevUtilitystationMapper tPsDevUtilitystationMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsDevVentvalveMapper tPsDevVentvalveMapper;
|
|
|
+
|
|
|
+ // 巡检 Mapper 注入
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionAlarmMapper tPsInspectionAlarmMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionCabinetMapper tPsInspectionCabinetMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionCallsystemMapper tPsInspectionCallsystemMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionCofferMapper tPsInspectionCofferMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionCurtainMapper tPsInspectionCurtainMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionExtinguisherMapper tPsInspectionExtinguisherMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionEyewashMapper tPsInspectionEyewashMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionFgsMapper tPsInspectionFgsMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionFiredoorMapper tPsInspectionFiredoorMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionHydrantMapper tPsInspectionHydrantMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionLiftMapper tPsInspectionLiftMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionMonitorMapper tPsInspectionMonitorMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionPitMapper tPsInspectionPitMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionRainvalveMapper tPsInspectionRainvalveMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionSteamMapper tPsInspectionSteamMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionSumpMapper tPsInspectionSumpMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionUtilitystationMapper tPsInspectionUtilitystationMapper;
|
|
|
+ @Autowired
|
|
|
+ private TPsInspectionVentvalveMapper tPsInspectionVentvalveMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询检查计划
|
|
|
*
|
|
|
@@ -71,6 +154,29 @@ public class TPsPatrolPlanServiceImpl implements ITPsPatrolPlanService {
|
|
|
*/
|
|
|
@Override
|
|
|
public int deleteTPsPatrolPlanByIds(Long[] ids) {
|
|
|
+ // 批量删除计划前,先删除所有关联的巡检记录
|
|
|
+ for (Long id : ids) {
|
|
|
+ tPsInspectionAlarmMapper.deleteTPsInspectionAlarmByPlanId(id);
|
|
|
+ tPsInspectionCabinetMapper.deleteTPsInspectionCabinetByPlanId(id);
|
|
|
+ tPsInspectionCallsystemMapper.deleteTPsInspectionCallsystemByPlanId(id);
|
|
|
+ tPsInspectionCofferMapper.deleteTPsInspectionCofferByPlanId(id);
|
|
|
+ tPsInspectionCurtainMapper.deleteTPsInspectionCurtainByPlanId(id);
|
|
|
+ tPsInspectionExtinguisherMapper.deleteTPsInspectionExtinguisherByPlanId(id);
|
|
|
+ tPsInspectionEyewashMapper.deleteTPsInspectionEyewashByPlanId(id);
|
|
|
+ tPsInspectionFgsMapper.deleteTPsInspectionFgsByPlanId(id);
|
|
|
+ tPsInspectionFiredoorMapper.deleteTPsInspectionFiredoorByPlanId(id);
|
|
|
+ tPsInspectionHydrantMapper.deleteTPsInspectionHydrantByPlanId(id);
|
|
|
+ tPsInspectionLiftMapper.deleteTPsInspectionLiftByPlanId(id);
|
|
|
+ tPsInspectionMonitorMapper.deleteTPsInspectionMonitorByPlanId(id);
|
|
|
+ tPsInspectionPitMapper.deleteTPsInspectionPitByPlanId(id);
|
|
|
+ tPsInspectionRainvalveMapper.deleteTPsInspectionRainvalveByPlanId(id);
|
|
|
+ tPsInspectionSteamMapper.deleteTPsInspectionSteamByPlanId(id);
|
|
|
+ tPsInspectionSumpMapper.deleteTPsInspectionSumpByPlanId(id);
|
|
|
+ tPsInspectionUtilitystationMapper.deleteTPsInspectionUtilitystationByPlanId(id);
|
|
|
+ tPsInspectionVentvalveMapper.deleteTPsInspectionVentvalveByPlanId(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 批量删除巡检计划
|
|
|
return tPsPatrolPlanMapper.deleteTPsPatrolPlanByIds(ids);
|
|
|
}
|
|
|
|
|
|
@@ -82,6 +188,260 @@ public class TPsPatrolPlanServiceImpl implements ITPsPatrolPlanService {
|
|
|
*/
|
|
|
@Override
|
|
|
public int deleteTPsPatrolPlanById(Long id) {
|
|
|
+ // 删除计划前,先删除所有关联的巡检记录
|
|
|
+ tPsInspectionAlarmMapper.deleteTPsInspectionAlarmByPlanId(id);
|
|
|
+ tPsInspectionCabinetMapper.deleteTPsInspectionCabinetByPlanId(id);
|
|
|
+ tPsInspectionCallsystemMapper.deleteTPsInspectionCallsystemByPlanId(id);
|
|
|
+ tPsInspectionCofferMapper.deleteTPsInspectionCofferByPlanId(id);
|
|
|
+ tPsInspectionCurtainMapper.deleteTPsInspectionCurtainByPlanId(id);
|
|
|
+ tPsInspectionExtinguisherMapper.deleteTPsInspectionExtinguisherByPlanId(id);
|
|
|
+ tPsInspectionEyewashMapper.deleteTPsInspectionEyewashByPlanId(id);
|
|
|
+ tPsInspectionFgsMapper.deleteTPsInspectionFgsByPlanId(id);
|
|
|
+ tPsInspectionFiredoorMapper.deleteTPsInspectionFiredoorByPlanId(id);
|
|
|
+ tPsInspectionHydrantMapper.deleteTPsInspectionHydrantByPlanId(id);
|
|
|
+ tPsInspectionLiftMapper.deleteTPsInspectionLiftByPlanId(id);
|
|
|
+ tPsInspectionMonitorMapper.deleteTPsInspectionMonitorByPlanId(id);
|
|
|
+ tPsInspectionPitMapper.deleteTPsInspectionPitByPlanId(id);
|
|
|
+ tPsInspectionRainvalveMapper.deleteTPsInspectionRainvalveByPlanId(id);
|
|
|
+ tPsInspectionSteamMapper.deleteTPsInspectionSteamByPlanId(id);
|
|
|
+ tPsInspectionSumpMapper.deleteTPsInspectionSumpByPlanId(id);
|
|
|
+ tPsInspectionUtilitystationMapper.deleteTPsInspectionUtilitystationByPlanId(id);
|
|
|
+ tPsInspectionVentvalveMapper.deleteTPsInspectionVentvalveByPlanId(id);
|
|
|
+
|
|
|
+ // 删除巡检计划
|
|
|
return tPsPatrolPlanMapper.deleteTPsPatrolPlanById(id);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建巡检计划并生成巡检记录
|
|
|
+ *
|
|
|
+ * @param tPsPatrolPlan 巡检计划
|
|
|
+ * @param userId 用户ID
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int createPatrolPlanWithInspections(TPsPatrolPlan tPsPatrolPlan, String userId) {
|
|
|
+ // 插入检查计划并获取插入结果
|
|
|
+ if (tPsPatrolPlanMapper.insertTPsPatrolPlan(tPsPatrolPlan) <= 0) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 根据计划年月,设置为每月15号,计算截止日期,默认为当月最后一天
|
|
|
+ Calendar cd = Calendar.getInstance();
|
|
|
+ cd.set(Math.toIntExact(tPsPatrolPlan.getPlanYear()), Math.toIntExact(tPsPatrolPlan.getPlanMonth() - 1), 15);
|
|
|
+ Date deadline = DateUtils.getLastMonthDay(cd.getTime());
|
|
|
+
|
|
|
+ // 统计设备数量
|
|
|
+ int devNum = 0;
|
|
|
+
|
|
|
+ // 根据不同的巡检类型(1-19)查询对应设备列表,并生成相应的巡检任务记录
|
|
|
+ switch (tPsPatrolPlan.getPatrolType()) {
|
|
|
+ case "1":
|
|
|
+ TPsDevAlarm tPsDevAlarm = new TPsDevAlarm();
|
|
|
+ tPsDevAlarm.setStatus("1");
|
|
|
+ List<TPsDevAlarm> tPsDevAlarms = tPsDevAlarmMapper.selectTPsDevAlarmList(tPsDevAlarm);
|
|
|
+ devNum = tPsDevAlarms.size();
|
|
|
+ for (TPsDevAlarm dev : tPsDevAlarms) {
|
|
|
+ TPsInspectionAlarm alarm = new TPsInspectionAlarm(dev.getDevNo(), dev.getPosition(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), tPsPatrolPlan.getId(), userId);
|
|
|
+ tPsInspectionAlarmMapper.insertTPsInspectionAlarm(alarm);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ TPsDevCabinet tPsDevCabinet = new TPsDevCabinet();
|
|
|
+ tPsDevCabinet.setStatus("1");
|
|
|
+ List<TPsDevCabinet> tPsDevCabinets = tPsDevCabinetMapper.selectTPsDevCabinetList(tPsDevCabinet);
|
|
|
+ devNum = tPsDevCabinets.size();
|
|
|
+ for (TPsDevCabinet dev : tPsDevCabinets) {
|
|
|
+ TPsInspectionCabinet inspectionCabinet = new TPsInspectionCabinet(dev.getPosition(), dev.getModelNo(), dev.getBoxNo(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), tPsPatrolPlan.getId(), userId, dev.getValveType(), dev.getValveSpecification(), dev.getValveLength(), dev.getBoltPointDistance(), dev.getBoltHoleCount());
|
|
|
+ tPsInspectionCabinetMapper.insertTPsInspectionCabinet(inspectionCabinet);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ TPsDevCallsystem tPsDevCallsystem = new TPsDevCallsystem();
|
|
|
+ tPsDevCallsystem.setStatus("1");
|
|
|
+ List<TPsDevCallsystem> tPsDevCallsystems = tPsDevCallsystemMapper.selectTPsDevCallsystemList(tPsDevCallsystem);
|
|
|
+ devNum = tPsDevCallsystems.size();
|
|
|
+ for (TPsDevCallsystem dev : tPsDevCallsystems) {
|
|
|
+ TPsInspectionCallsystem inspectionCallsystem = new TPsInspectionCallsystem(dev.getDevNo(), dev.getPosition(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionCallsystemMapper.insertTPsInspectionCallsystem(inspectionCallsystem);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "4":
|
|
|
+ TPsDevCoffer tPsDevCoffer = new TPsDevCoffer();
|
|
|
+ tPsDevCoffer.setStatus("1");
|
|
|
+ List<TPsDevCoffer> tPsDevCoffers = tPsDevCofferMapper.selectTPsDevCofferList(tPsDevCoffer);
|
|
|
+ devNum = tPsDevCoffers.size();
|
|
|
+ for (TPsDevCoffer dev : tPsDevCoffers) {
|
|
|
+ TPsInspectionCoffer inspectionCoffer = new TPsInspectionCoffer(dev.getCofferNo(), dev.getPosition(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionCofferMapper.insertTPsInspectionCoffer(inspectionCoffer);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "5":
|
|
|
+ TPsDevCurtain tPsDevCurtain = new TPsDevCurtain();
|
|
|
+ tPsDevCurtain.setStatus("1");
|
|
|
+ List<TPsDevCurtain> tPsDevCurtains = tPsDevCurtainMapper.selectTPsDevCurtainList(tPsDevCurtain);
|
|
|
+ devNum = tPsDevCurtains.size();
|
|
|
+ for (TPsDevCurtain dev : tPsDevCurtains) {
|
|
|
+ TPsInspectionCurtain inspectionCurtain = new TPsInspectionCurtain(dev.getPosition(), dev.getCurtainName(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionCurtainMapper.insertTPsInspectionCurtain(inspectionCurtain);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "6":
|
|
|
+ TPsDevExtinguisher tPsDevExtinguisher = new TPsDevExtinguisher();
|
|
|
+ tPsDevExtinguisher.setStatus("1");
|
|
|
+ List<TPsDevExtinguisher> tPsDevExtinguishers = tPsDevExtinguisherMapper.selectTPsDevExtinguisherList(tPsDevExtinguisher);
|
|
|
+ devNum = tPsDevExtinguishers.size();
|
|
|
+ for (TPsDevExtinguisher dev : tPsDevExtinguishers) {
|
|
|
+ TPsInspectionExtinguisher inspectionExtinguisher = new TPsInspectionExtinguisher(dev.getFireExtinguisherNo(), dev.getPosition(), dev.getFireExtinguisherModel(), tPsPatrolPlan.getDetectionFrequency(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId(), dev.getDevType());
|
|
|
+ tPsInspectionExtinguisherMapper.insertTPsInspectionExtinguisher(inspectionExtinguisher);
|
|
|
+ }
|
|
|
+ // 若检测频率为"每半个月一次",且为上半月的,则截止时间为当前月 15号
|
|
|
+ if ("1".equals(tPsPatrolPlan.getDetectionFrequency())) {
|
|
|
+ deadline = cd.getTime();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "7":
|
|
|
+ TPsDevEyewash tPsDevEyewash = new TPsDevEyewash();
|
|
|
+ tPsDevEyewash.setStatus("1");
|
|
|
+ List<TPsDevEyewash> tPsDevEyewashs = tPsDevEyewashMapper.selectTPsDevEyewashList(tPsDevEyewash);
|
|
|
+ devNum = tPsDevEyewashs.size();
|
|
|
+ for (TPsDevEyewash dev : tPsDevEyewashs) {
|
|
|
+ TPsInspectionEyewash inspectionEyewash = new TPsInspectionEyewash(dev.getDevNo(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionEyewashMapper.insertTPsInspectionEyewash(inspectionEyewash);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "8":
|
|
|
+ TPsDevFgs tPsDevFgs = new TPsDevFgs();
|
|
|
+ tPsDevFgs.setStatus("1");
|
|
|
+ List<TPsDevFgs> tPsDevFgss = tPsDevFgsMapper.selectTPsDevFgsList(tPsDevFgs);
|
|
|
+ devNum = tPsDevFgss.size();
|
|
|
+ for (TPsDevFgs dev : tPsDevFgss) {
|
|
|
+ TPsInspectionFgs inspectionFgs = new TPsInspectionFgs(dev.getFgsNo(), dev.getPosition(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionFgsMapper.insertTPsInspectionFgs(inspectionFgs);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "9":
|
|
|
+ TPsDevFiredoor tPsDevFiredoor = new TPsDevFiredoor();
|
|
|
+ tPsDevFiredoor.setStatus("1");
|
|
|
+ List<TPsDevFiredoor> tPsDevFiredoors = tPsDevFiredoorMapper.selectTPsDevFiredoorList(tPsDevFiredoor);
|
|
|
+ devNum = tPsDevFiredoors.size();
|
|
|
+ for (TPsDevFiredoor dev : tPsDevFiredoors) {
|
|
|
+ TPsInspectionFiredoor inspectionFiredoor = new TPsInspectionFiredoor(dev.getDoorNo(), dev.getDoorName(), dev.getPosition(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionFiredoorMapper.insertTPsInspectionFiredoor(inspectionFiredoor);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "10":
|
|
|
+ TPsDevHydrant tPsDevHydrant = new TPsDevHydrant();
|
|
|
+ tPsDevHydrant.setStatus("1");
|
|
|
+ List<TPsDevHydrant> tPsDevHydrants = tPsDevHydrantMapper.selectTPsDevHydrantList(tPsDevHydrant);
|
|
|
+ devNum = tPsDevHydrants.size();
|
|
|
+ for (TPsDevHydrant dev : tPsDevHydrants) {
|
|
|
+ TPsInspectionHydrant inspectionHydrant = new TPsInspectionHydrant(
|
|
|
+ dev.getPosition(),
|
|
|
+ dev.getEquipId(),
|
|
|
+ dev.getHydrantQty(),
|
|
|
+ dev.getHoseQty(),
|
|
|
+ dev.getWrenchQty(),
|
|
|
+ tPsPatrolPlan.getPlanMonth(),
|
|
|
+ tPsPatrolPlan.getPlanYear(),
|
|
|
+ userId,
|
|
|
+ tPsPatrolPlan.getId()
|
|
|
+ );
|
|
|
+ inspectionHydrant.setGroupNo(dev.getGroupNo());
|
|
|
+ tPsInspectionHydrantMapper.insertTPsInspectionHydrant(inspectionHydrant);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "11":
|
|
|
+ TPsDevLift tPsDevLift = new TPsDevLift();
|
|
|
+ tPsDevLift.setStatus("1");
|
|
|
+ List<TPsDevLift> tPsDevLifts = tPsDevLiftMapper.selectTPsDevLiftList(tPsDevLift);
|
|
|
+ devNum = tPsDevLifts.size();
|
|
|
+ for (TPsDevLift dev : tPsDevLifts) {
|
|
|
+ TPsInspectionLift inspectionLift = new TPsInspectionLift(dev.getDevNo(), dev.getPosition(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionLiftMapper.insertTPsInspectionLift(inspectionLift);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "12":
|
|
|
+ TPsDevMonitor tPsDevMonitor = new TPsDevMonitor();
|
|
|
+ tPsDevMonitor.setStatus("1");
|
|
|
+ List<TPsDevMonitor> tPsDevMonitors = tPsDevMonitorMapper.selectTPsDevMonitorList(tPsDevMonitor);
|
|
|
+ devNum = tPsDevMonitors.size();
|
|
|
+ for (TPsDevMonitor dev : tPsDevMonitors) {
|
|
|
+ TPsInspectionMonitor inspectionMonitor = new TPsInspectionMonitor(dev.getDevNo(), dev.getPosition(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionMonitorMapper.insertTPsInspectionMonitor(inspectionMonitor);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "13":
|
|
|
+ TPsDevPit tPsDevPit = new TPsDevPit();
|
|
|
+ tPsDevPit.setStatus("1");
|
|
|
+ List<TPsDevPit> tPsDevPits = tPsDevPitMapper.selectTPsDevPitList(tPsDevPit);
|
|
|
+ devNum = tPsDevPits.size();
|
|
|
+ for (TPsDevPit dev : tPsDevPits) {
|
|
|
+ TPsInspectionPit inspectionPit = new TPsInspectionPit(dev.getDevNo(), dev.getPosition(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionPitMapper.insertTPsInspectionPit(inspectionPit);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "14":
|
|
|
+ TPsDevRainvalve tPsDevRainvalve = new TPsDevRainvalve();
|
|
|
+ tPsDevRainvalve.setStatus("1");
|
|
|
+ List<TPsDevRainvalve> tPsDevRainvalves = tPsDevRainvalveMapper.selectTPsDevRainvalveList(tPsDevRainvalve);
|
|
|
+ devNum = tPsDevRainvalves.size();
|
|
|
+ for (TPsDevRainvalve dev : tPsDevRainvalves) {
|
|
|
+ TPsInspectionRainvalve inspectionRainvalve = new TPsInspectionRainvalve(dev.getPosition(), dev.getValveName(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionRainvalveMapper.insertTPsInspectionRainvalve(inspectionRainvalve);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "15":
|
|
|
+ TPsDevSteam tPsDevSteam = new TPsDevSteam();
|
|
|
+ tPsDevSteam.setStatus("1");
|
|
|
+ List<TPsDevSteam> tPsDevSteams = tPsDevSteamMapper.selectTPsDevSteamList(tPsDevSteam);
|
|
|
+ devNum = tPsDevSteams.size();
|
|
|
+ for (TPsDevSteam dev : tPsDevSteams) {
|
|
|
+ TPsInspectionSteam inspectionSteam = new TPsInspectionSteam(dev.getPosition(), dev.getSteamName(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionSteamMapper.insertTPsInspectionSteam(inspectionSteam);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "16":
|
|
|
+ TPsDevSump tPsDevSump = new TPsDevSump();
|
|
|
+ tPsDevSump.setStatus("1");
|
|
|
+ List<TPsDevSump> tPsDevSumps = tPsDevSumpMapper.selectTPsDevSumpList(tPsDevSump);
|
|
|
+ devNum = tPsDevSumps.size();
|
|
|
+ for (TPsDevSump dev : tPsDevSumps) {
|
|
|
+ TPsInspectionSump inspectionSump = new TPsInspectionSump(dev.getSumpNo(), dev.getPosition(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionSumpMapper.insertTPsInspectionSump(inspectionSump);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "17":
|
|
|
+ TPsDevUtilitystation tPsDevUtilitystation = new TPsDevUtilitystation();
|
|
|
+ tPsDevUtilitystation.setStatus("1");
|
|
|
+ List<TPsDevUtilitystation> tPsDevUtilitystations = tPsDevUtilitystationMapper.selectTPsDevUtilitystationList(tPsDevUtilitystation);
|
|
|
+ devNum = tPsDevUtilitystations.size();
|
|
|
+ for (TPsDevUtilitystation dev : tPsDevUtilitystations) {
|
|
|
+ TPsInspectionUtilitystation inspectionUtilitystation = new TPsInspectionUtilitystation(dev.getPosition(), dev.getUtilityStationName(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionUtilitystationMapper.insertTPsInspectionUtilitystation(inspectionUtilitystation);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "18":
|
|
|
+ TPsDevVentvalve tPsDevVentvalve = new TPsDevVentvalve();
|
|
|
+ tPsDevVentvalve.setStatus("1");
|
|
|
+ List<TPsDevVentvalve> tPsDevVentvalves = tPsDevVentvalveMapper.selectTPsDevVentvalveList(tPsDevVentvalve);
|
|
|
+ devNum = tPsDevVentvalves.size();
|
|
|
+ for (TPsDevVentvalve dev : tPsDevVentvalves) {
|
|
|
+ TPsInspectionVentvalve inspectionVentvalve = new TPsInspectionVentvalve(dev.getPosition(), dev.getVentvalveNo(), tPsPatrolPlan.getPlanMonth(), tPsPatrolPlan.getPlanYear(), userId, tPsPatrolPlan.getId());
|
|
|
+ tPsInspectionVentvalveMapper.insertTPsInspectionVentvalve(inspectionVentvalve);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "19":
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 更新计划中的设备数量、未完成数、已完成数及截止时间
|
|
|
+ tPsPatrolPlan.setDevNum((long) devNum);
|
|
|
+ tPsPatrolPlan.setUncheckedNum((long) devNum);
|
|
|
+ tPsPatrolPlan.setCheckedNum(0L);
|
|
|
+ tPsPatrolPlan.setDeadline(deadline);
|
|
|
+
|
|
|
+ // 成功后返回成功信息
|
|
|
+ return tPsPatrolPlanMapper.updateTPsPatrolPlan(tPsPatrolPlan);
|
|
|
+ }
|
|
|
}
|