wangming 6 месяцев назад
Родитель
Сommit
54075117d2

+ 8 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxQualityPowerHandoverService.java

@@ -3,6 +3,7 @@ package com.rongwei.bscommon.sys.service;
 import com.rongwei.bsentity.domain.ZhcxLowaltitudeDebtfreeCheckMainDo;
 import com.rongwei.bsentity.domain.ZhcxQualityPowerHandoverDo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.dto.power.SaveByMainRequest;
 
 /**
  * <p>
@@ -20,4 +21,11 @@ public interface ZhcxQualityPowerHandoverService extends IService<ZhcxQualityPow
      * @param main
      */
     void saveByLowaltitude(ZhcxLowaltitudeDebtfreeCheckMainDo main);
+
+    /**
+     * 保存送电前交接
+     *
+     * @param req
+     */
+    void saveByCheckMain(SaveByMainRequest req);
 }

+ 6 - 10
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxLowaltitudeDebtfreeCheckServiceImpl.java

@@ -18,6 +18,7 @@ import com.rongwei.bsentity.dto.lowaltitude.AddHoistingPlanDateRequest;
 import com.rongwei.bsentity.dto.lowaltitude.DeleteCheckRequest;
 import com.rongwei.bsentity.dto.lowaltitude.SaveCheckDetailDto;
 import com.rongwei.bsentity.dto.lowaltitude.SaveCheckRequest;
+import com.rongwei.bsentity.dto.power.SaveByMainRequest;
 import com.rongwei.bsentity.dto.project.indicator.DelPhysicalParam;
 import com.rongwei.bsentity.vo.lowaltiude.LowaltitedeDebtfreddCheckVo;
 import com.rongwei.rwadmincommon.system.service.SysGeneralCRUDService;
@@ -278,16 +279,11 @@ public class ZhcxLowaltitudeDebtfreeCheckServiceImpl extends ServiceImpl<ZhcxLow
             return ;
         }
 
-        //生成机电前检验数据 powering
-        final LambdaQueryWrapper<ZhcxLowaltitudeDebtfreeCheckDo> queryCountWrapper = Wrappers.lambdaQuery();
-        queryCountWrapper.eq(ZhcxLowaltitudeDebtfreeCheckDo::getMainid, checkDo.getMainid())
-                .eq(ZhcxLowaltitudeDebtfreeCheckDo::getQualitystatus, "powering");
-        final int count = count(queryCountWrapper);
-        if(count < 4) {
-            return ;
-        }
-        final ZhcxLowaltitudeDebtfreeCheckMainDo main = lowaltitudeDebtfreeCheckMainService.getById(checkDo.getMainid());
-        qualityPowerHandoverService.saveByLowaltitude(main);
+        //生成机电前检验数据
+        final SaveByMainRequest mainRequest = SaveByMainRequest.builder()
+                .mainId(checkDo.getMainid())
+                .build();
+        qualityPowerHandoverService.saveByCheckMain(mainRequest);
     }
 
     /**

+ 28 - 7
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxQualityPowerHandoverServiceImpl.java

@@ -3,15 +3,11 @@ package com.rongwei.bscommon.sys.service.impl;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.rongwei.bscommon.sys.service.ZhcxBaseCheckDetailService;
-import com.rongwei.bscommon.sys.service.ZhcxQualityPowerHandoverDetailService;
-import com.rongwei.bsentity.domain.ZhcxBaseCheckDetailDo;
-import com.rongwei.bsentity.domain.ZhcxLowaltitudeDebtfreeCheckMainDo;
-import com.rongwei.bsentity.domain.ZhcxQualityPowerHandoverDetailDo;
-import com.rongwei.bsentity.domain.ZhcxQualityPowerHandoverDo;
+import com.rongwei.bscommon.sys.service.*;
+import com.rongwei.bsentity.domain.*;
 import com.rongwei.bscommon.sys.dao.ZhcxQualityPowerHandoverDao;
-import com.rongwei.bscommon.sys.service.ZhcxQualityPowerHandoverService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bsentity.dto.power.SaveByMainRequest;
 import com.rongwei.rwcommon.utils.SecurityUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -30,12 +26,18 @@ import java.util.List;
 @Service
 public class ZhcxQualityPowerHandoverServiceImpl extends ServiceImpl<ZhcxQualityPowerHandoverDao, ZhcxQualityPowerHandoverDo> implements ZhcxQualityPowerHandoverService {
 
+    @Autowired
+    private ZhcxLowaltitudeDebtfreeCheckService lowaltitudeDebtfreeCheckService;
+
     @Autowired
     private ZhcxBaseCheckDetailService baseCheckDetailService;
 
     @Autowired
     private ZhcxQualityPowerHandoverDetailService qualityPowerHandoverDetailService;
 
+    @Autowired
+    private ZhcxLowaltitudeDebtfreeCheckMainService lowaltitudeDebtfreeCheckMainService;
+
     /**
      * 通过低空不欠债生成
      *
@@ -96,4 +98,23 @@ public class ZhcxQualityPowerHandoverServiceImpl extends ServiceImpl<ZhcxQuality
         }
         qualityPowerHandoverDetailService.saveBatch(list);
     }
+
+    /**
+     * 保存送电前交接
+     *
+     * @param req
+     */
+    @Override
+    public void saveByCheckMain(SaveByMainRequest req) {
+        //生成机电前检验数据 powering
+        final LambdaQueryWrapper<ZhcxLowaltitudeDebtfreeCheckDo> queryCountWrapper = Wrappers.lambdaQuery();
+        queryCountWrapper.eq(ZhcxLowaltitudeDebtfreeCheckDo::getMainid, req.getMainId())
+                .eq(ZhcxLowaltitudeDebtfreeCheckDo::getQualitystatus, "powering");
+        final int count = lowaltitudeDebtfreeCheckService.count(queryCountWrapper);
+        if(count < 4) {
+            return ;
+        }
+        final ZhcxLowaltitudeDebtfreeCheckMainDo main = lowaltitudeDebtfreeCheckMainService.getById(req.getMainId());
+        saveByLowaltitude(main);
+    }
 }

+ 13 - 0
business-entity/src/main/java/com/rongwei/bsentity/dto/power/SaveByMainRequest.java

@@ -0,0 +1,13 @@
+package com.rongwei.bsentity.dto.power;
+
+import lombok.*;
+
+@Setter
+@Getter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class SaveByMainRequest {
+
+    private String mainId;
+}

+ 22 - 2
business-server/src/main/java/com/rongwei/bsserver/controller/DebtfreeController.java

@@ -2,10 +2,12 @@ package com.rongwei.bsserver.controller;
 
 import com.rongwei.bscommon.sys.service.DebtfreeService;
 import com.rongwei.bscommon.sys.service.ZhcxLowaltitudeDebtfreeCheckService;
+import com.rongwei.bscommon.sys.service.ZhcxQualityPowerHandoverService;
 import com.rongwei.bsentity.dto.indicators.ComlpateIndicatorsRequest;
 import com.rongwei.bsentity.dto.lowaltitude.AddHoistingPlanDateRequest;
 import com.rongwei.bsentity.dto.lowaltitude.DeleteCheckRequest;
 import com.rongwei.bsentity.dto.lowaltitude.SaveCheckRequest;
+import com.rongwei.bsentity.dto.power.SaveByMainRequest;
 import com.rongwei.rwcommon.base.R;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,8 +19,13 @@ import java.util.Map;
 @RequestMapping("/debtfree")
 @Slf4j
 public class DebtfreeController {
-@Autowired DebtfreeService debtfreeService;
-@Autowired ZhcxLowaltitudeDebtfreeCheckService zhcxLowaltitudeDebtfreeCheckService;
+    @Autowired
+    private DebtfreeService debtfreeService;
+    @Autowired
+    private ZhcxLowaltitudeDebtfreeCheckService zhcxLowaltitudeDebtfreeCheckService;
+    @Autowired
+    private ZhcxQualityPowerHandoverService qualityPowerHandoverService;
+
     @PostMapping("/dataImport")
     @ResponseBody
     public R dataImport(@RequestBody Map<String,Object> map) {
@@ -98,4 +105,17 @@ public class DebtfreeController {
         return R.ok();
     }
 
+    /**
+     * 更新检查
+     *
+     * @param req
+     * @return
+     */
+    @PostMapping("/savePowerHandoverByMain")
+    @ResponseBody
+    public R savePowerHandoverByMain(@RequestBody SaveByMainRequest req) {
+        qualityPowerHandoverService.saveByCheckMain(req);
+        return R.ok();
+    }
+
 }