james 4 дней назад
Родитель
Сommit
42d11ef66e
16 измененных файлов с 283 добавлено и 40 удалено
  1. 6 2
      service-alarm/service-alarm-biz/src/main/java/com/usky/alarm/service/impl/BaseAlarmServiceImpl.java
  2. 3 1
      service-alarm/service-alarm-biz/src/main/java/com/usky/alarm/service/listener/MqttListener.java
  3. 1 0
      service-alarm/service-alarm-biz/src/main/java/com/usky/alarm/service/mqtt/alarm/Alarm.java
  4. 29 29
      service-ems/service-ems-biz/src/main/java/com/usky/ems/service/impl/EnergyDataServiceImpl.java
  5. 13 0
      service-fire/service-fire-api/src/main/java/com/usky/fire/RemotePlanSonService.java
  6. 33 0
      service-fire/service-fire-api/src/main/java/com/usky/fire/factory/RemotePlanSonFactory.java
  7. 35 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/api/planSonApi.java
  8. 11 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionPlanController.java
  9. 5 5
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/TaskController.java
  10. 5 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionPlanService.java
  11. 121 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanServiceImpl.java
  12. 1 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/DmpProductInfoController.java
  13. 4 1
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpDeviceInfoServiceImpl.java
  14. 3 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpProductInfoServiceImpl.java
  15. 12 1
      service-job/src/main/java/com/ruoyi/job/task/RyTask.java
  16. 1 1
      service-vpp/service-vpp-biz/src/main/java/com/usky/vpp/domain/VppDrParticipation.java

+ 6 - 2
service-alarm/service-alarm-biz/src/main/java/com/usky/alarm/service/impl/BaseAlarmServiceImpl.java

@@ -120,10 +120,14 @@ public class BaseAlarmServiceImpl extends AbstractCrudService<BaseAlarmMapper, B
                     return saveResult;
                 }
             }else {
-                throw new BusinessException("告警数据投递失败,请检查产品编码、设备编号、告警类型,是否有误;设备是否激活");
+                //throw new BusinessException("告警数据投递失败,请检查产品编码、设备编号、告警类型,是否有误;设备是否激活");
+                log.error("告警数据投递失败,请检查产品编码、设备编号、告警类型,是否有误;设备是否激活");
+                return false;
             }
         }else {
-            throw new BusinessException("告警数据投递失败,请检查产品编码、设备编号、告警类型,不能为空");
+            //throw new BusinessException("告警数据投递失败,请检查产品编码、设备编号、告警类型,不能为空");
+            log.error("告警数据投递失败,请检查产品编码、设备编号、告警类型,不能为空");
+            return false;
         }
     }
 

+ 3 - 1
service-alarm/service-alarm-biz/src/main/java/com/usky/alarm/service/listener/MqttListener.java

@@ -44,6 +44,7 @@ public class MqttListener {
             String[] code5 = TopListener.SMOKE_ALERT.getCode().split("/");
             String[] code6 = TopListener.ELECTRICAL_ALERT.getCode().split("/");
             String[] code7 = TopListener.LIQUID_ALERT.getCode().split("/");
+            String[] code8 = TopListener.LR_SMOKE_ALERT.getCode().split("/");
             Object mqttReceivedTopic = message.getHeaders().get("mqtt_receivedTopic");
             if (null != mqttReceivedTopic) {
                 String topic = mqttReceivedTopic.toString();
@@ -55,7 +56,8 @@ public class MqttListener {
                         (topic.indexOf(code4[2]) != -1 && topic.indexOf(code4[5]) != -1) ||
                         (topic.indexOf(code5[2]) != -1 && topic.indexOf(code5[5]) != -1) ||
                         (topic.indexOf(code6[2]) != -1 && topic.indexOf(code6[5]) != -1) ||
-                        (topic.indexOf(code7[2]) != -1 && topic.indexOf(code7[5]) != -1)) {
+                        (topic.indexOf(code7[2]) != -1 && topic.indexOf(code7[5]) != -1) ||
+                        (topic.indexOf(code8[2]) != -1 && topic.indexOf(code8[5]) != -1)) {
                     mqttBaseVO.setDescribe("alarm");
                 }else {
                     mqttBaseVO.setDescribe("fireInfoAndAlarm");

+ 1 - 0
service-alarm/service-alarm-biz/src/main/java/com/usky/alarm/service/mqtt/alarm/Alarm.java

@@ -51,6 +51,7 @@ public class Alarm implements MqttStrategy {
         String[] code4 = TopListener.VIDEO_ALERT.getCode().split("/");
         LambdaQueryWrapper<DmpDevice> queryWrapper1 = Wrappers.lambdaQuery();
         queryWrapper1.select(DmpDevice::getProductCode,DmpDevice::getDeviceUuid)
+                .eq(DmpDevice::getCompanyCode,topic.split("/")[3])
                 .eq(DmpDevice::getDeviceId, map.get("devId").toString())
                 .eq(DmpDevice::getDeleteFlag, 0);
         List<DmpDevice> list = dmpDeviceService.list(queryWrapper1);

+ 29 - 29
service-ems/service-ems-biz/src/main/java/com/usky/ems/service/impl/EnergyDataServiceImpl.java

@@ -186,7 +186,7 @@ public class EnergyDataServiceImpl implements EnergyDataService {
             }
 
             Map<String, Object> meter = new HashMap<>();
-            meter.put("id", buildingId + device.getDeviceId().substring(device.getDeviceId().length() - 3));
+            meter.put("id", buildingId + "M" + device.getDeviceId().substring(device.getDeviceId().length() - 3));
             meter.put("name", device.getDeviceName());
 
             List<Map<String, String>> functions = new ArrayList<>();
@@ -196,30 +196,30 @@ public class EnergyDataServiceImpl implements EnergyDataService {
                 functions.add(createFunction("WPP", String.valueOf(data.getTotalActiveEnergyF()), null));
             }
             
-            // 正向有功功率
-            if (data.getTotalActivePower() != null) {
-                functions.add(createFunction("Ps", String.valueOf(data.getTotalActivePower()), null));
-            }
-            
-            // 正向无功功率
-            if (data.getTotalReactiveEnergyF() != null) {
-                functions.add(createFunction("Qs", String.valueOf(data.getTotalReactiveEnergyF()), null));
-            }
-            
-            // A相电压
-            if (data.getVoltageA() != null) {
-                functions.add(createFunction("Ua", String.valueOf(data.getVoltageA()), null));
-            }
-            
-            // B相电压
-            if (data.getVoltageB() != null) {
-                functions.add(createFunction("Ub", String.valueOf(data.getVoltageB()), null));
-            }
-            
-            // C相电压
-            if (data.getVoltageC() != null) {
-                functions.add(createFunction("Uc", String.valueOf(data.getVoltageC()), null));
-            }
+//            // 正向有功功率
+//            if (data.getTotalActivePower() != null) {
+//                functions.add(createFunction("Ps", String.valueOf(data.getTotalActivePower()), null));
+//            }
+//
+//            // 正向无功功率
+//            if (data.getTotalReactiveEnergyF() != null) {
+//                functions.add(createFunction("Qs", String.valueOf(data.getTotalReactiveEnergyF()), null));
+//            }
+//
+//            // A相电压
+//            if (data.getVoltageA() != null) {
+//                functions.add(createFunction("Ua", String.valueOf(data.getVoltageA()), null));
+//            }
+//
+//            // B相电压
+//            if (data.getVoltageB() != null) {
+//                functions.add(createFunction("Ub", String.valueOf(data.getVoltageB()), null));
+//            }
+//
+//            // C相电压
+//            if (data.getVoltageC() != null) {
+//                functions.add(createFunction("Uc", String.valueOf(data.getVoltageC()), null));
+//            }
             
             // A相电流
             if (data.getCurrentA() != null) {
@@ -236,10 +236,10 @@ public class EnergyDataServiceImpl implements EnergyDataService {
                 functions.add(createFunction("Ic", String.valueOf(data.getCurrentC()), null));
             }
             
-            // 功率因数
-            if (data.getTotalPowerFactor() != null) {
-                functions.add(createFunction("PFs", String.valueOf(data.getTotalPowerFactor()), null));
-            }
+//            // 功率因数
+//            if (data.getTotalPowerFactor() != null) {
+//                functions.add(createFunction("PFs", String.valueOf(data.getTotalPowerFactor()), null));
+//            }
 
             meter.put("functions", functions);
             meters.add(meter);

+ 13 - 0
service-fire/service-fire-api/src/main/java/com/usky/fire/RemotePlanSonService.java

@@ -0,0 +1,13 @@
+package com.usky.fire;
+
+
+import com.usky.fire.factory.RemoteFireFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+
+@FeignClient(contextId = "remotePlanSonService", value = "service-fire" , fallbackFactory = RemoteFireFallbackFactory.class)
+public interface RemotePlanSonService {
+
+    @GetMapping("/addPlanSon")
+    void addPlanSon();
+}

+ 33 - 0
service-fire/service-fire-api/src/main/java/com/usky/fire/factory/RemotePlanSonFactory.java

@@ -0,0 +1,33 @@
+package com.usky.fire.factory;
+
+import com.usky.common.core.exception.FeignBadRequestException;
+import com.usky.fire.RemotePlanSonService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * 用户服务降级处理
+ *
+ * @author ruoyi
+ */
+@Component
+public class RemotePlanSonFactory implements FallbackFactory<RemotePlanSonService>
+{
+    private static final Logger log = LoggerFactory.getLogger(RemoteFireFallbackFactory.class);
+
+    @Override
+    public RemotePlanSonService create(Throwable throwable)
+    {
+        log.error("用户服务调用失败:{}", throwable.getMessage());
+        return new RemotePlanSonService()
+        {
+            @Override
+            public void addPlanSon() {
+                throw new FeignBadRequestException(500,"生成子计划数据异常"+throwable.getMessage());
+            }
+        };
+    }
+}

+ 35 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/api/planSonApi.java

@@ -0,0 +1,35 @@
+package com.usky.fire.controller.api;
+
+import com.usky.common.core.bean.ApiResult;
+import com.usky.fire.RemoteFireService;
+import com.usky.fire.RemotePlanSonService;
+import com.usky.fire.service.PatrolInspectionPlanService;
+import com.usky.fire.service.PatrolInspectionPlanSonService;
+import com.usky.system.RemoteDeptService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ *  数据统一查询 前端控制器
+ * </p>
+ *
+ */
+@RestController
+public class planSonApi implements RemotePlanSonService {
+
+    @Autowired
+    private PatrolInspectionPlanService patrolInspectionPlanService;
+
+    @Override
+    public void addPlanSon(){
+        patrolInspectionPlanService.addPatrolInspectionPlanSon();
+    }
+
+
+}

+ 11 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionPlanController.java

@@ -123,5 +123,16 @@ public class PatrolInspectionPlanController {
         return ApiResult.success();
     }
 
+    /**
+     * 巡查自检-近七天子计划缺失补插(已存在则跳过)
+     *
+     * @return
+     */
+    @GetMapping("supplementNearSevenDaysPlanSon")
+    public ApiResult<Void> supplementNearSevenDaysPlanSon() {
+        patrolInspectionPlanService.supplementNearSevenDaysPlanSon();
+        return ApiResult.success();
+    }
+
 }
 

+ 5 - 5
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/TaskController.java

@@ -78,11 +78,11 @@ public class TaskController {
         demReportDataService.regularReportData();
     }
 
-    @Scheduled(cron = "0 0 23 * * ? ")//每天23点
-    public void task5(){
-        System.out.println(Thread.currentThread().getName() + "巡检计划分批次创建执行中");
-        patrolInspectionPlanService.addPatrolInspectionPlanSon();
-    }
+//    @Scheduled(cron = "0 0 23 * * ? ")//每天23点
+//    public void task5(){
+//        System.out.println(Thread.currentThread().getName() + "巡检计划分批次创建执行中");
+//        patrolInspectionPlanService.addPatrolInspectionPlanSon();
+//    }
 
 //    @Scheduled(cron = "0 5 * * * ?") //每个小时第五分钟执行
 //    public void task6(){

+ 5 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionPlanService.java

@@ -28,6 +28,11 @@ public interface PatrolInspectionPlanService extends CrudService<PatrolInspectio
 
     void addPatrolInspectionPlanSon();
 
+    /**
+     * 查询近七天符合时间段的主计划,检查其近七天子计划是否存在;不存在则补插,已存在则跳过
+     */
+    void supplementNearSevenDaysPlanSon();
+
     void delPatrolInspectionPlan(Integer id);
 
     CommonPage<PatrolInspectionPlanDataVo> patrolInspectionPlanList(String planName,Integer planType, Integer areaId,Integer pageNum, Integer pageSize, Integer id);

+ 121 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanServiceImpl.java

@@ -572,6 +572,127 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
         }
     }
 
+    /**
+     * 查询近七天(今天 ~ 今天+6)符合时间段的主计划,按日检查子计划是否存在;
+     * 不存在则补插子计划及地点关联,已存在则跳过
+     */
+    @Override
+    @Transactional
+    public void supplementNearSevenDaysPlanSon() {
+        String todayStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+        LocalDate startOfNearSeven = LocalDate.now();
+        LocalDate endOfNearSeven = OnlineMethod.getDate(todayStr, "yyyy-MM-dd", true, 6);
+
+        // 查询近七天时间范围内生效的主计划:开始日期 <= 近七天末天,结束日期 >= 今天
+        LambdaQueryWrapper<PatrolInspectionPlan> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.le(PatrolInspectionPlan::getStartDate, endOfNearSeven)
+                .ge(PatrolInspectionPlan::getEndDate, startOfNearSeven)
+                .eq(PatrolInspectionPlan::getEnable, 1)
+                .eq(PatrolInspectionPlan::getPlanType, 1);
+        List<PatrolInspectionPlan> list = this.list(queryWrapper);
+        if (CollectionUtils.isEmpty(list)) {
+            return;
+        }
+
+        List<Integer> planIdList = new ArrayList<>();
+        for (int i = 0; i < list.size(); i++) {
+            planIdList.add(list.get(i).getId());
+        }
+
+        // 巡检日程关联信息
+        LambdaQueryWrapper<PatrolInspectionPlanSchedule> queryWrapper1 = Wrappers.lambdaQuery();
+        queryWrapper1.in(PatrolInspectionPlanSchedule::getPlanId, planIdList);
+        List<PatrolInspectionPlanSchedule> scheduleList = planScheduleService.list(queryWrapper1);
+        if (CollectionUtils.isEmpty(scheduleList)) {
+            throw new BusinessException("无巡检日程关联信息");
+        }
+
+        // 主计划地点关联
+        LambdaQueryWrapper<PatrolInspectionPlanSite> queryWrapper2 = Wrappers.lambdaQuery();
+        queryWrapper2.in(PatrolInspectionPlanSite::getPlanId, planIdList);
+        List<PatrolInspectionPlanSite> siteList = planSiteService.list(queryWrapper2);
+        if (CollectionUtils.isEmpty(siteList)) {
+            throw new BusinessException("无主计划地点关联信息");
+        }
+
+        // 查询近七天已存在的子计划(按主计划id + 巡检日期判断是否存在)
+        LambdaQueryWrapper<PatrolInspectionPlanSon> queryWrapper3 = Wrappers.lambdaQuery();
+        queryWrapper3.select(PatrolInspectionPlanSon::getPlanId, PatrolInspectionPlanSon::getInspectionDate)
+                .in(PatrolInspectionPlanSon::getPlanId, planIdList)
+                .ge(PatrolInspectionPlanSon::getInspectionDate, startOfNearSeven)
+                .le(PatrolInspectionPlanSon::getInspectionDate, endOfNearSeven);
+        List<PatrolInspectionPlanSon> planSonList = patrolInspectionPlanSonService.list(queryWrapper3);
+        List<String> existPlanSonKeyList = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(planSonList)) {
+            for (int i = 0; i < planSonList.size(); i++) {
+                existPlanSonKeyList.add(planSonList.get(i).getPlanId() + "_" + planSonList.get(i).getInspectionDate());
+            }
+        }
+
+        // 逐日检查并补插缺失的子计划
+        for (int dayOffset = 0; dayOffset < 7; dayOffset++) {
+            LocalDate targetDate = dayOffset == 0 ? startOfNearSeven
+                    : OnlineMethod.getDate(todayStr, "yyyy-MM-dd", true, dayOffset);
+            Date date = Date.from(targetDate.atStartOfDay(ZoneOffset.ofHours(8)).toInstant());
+            String week = OnlineMethod.getWeekOfDate(date);
+
+            for (int m = 0; m < list.size(); m++) {
+                PatrolInspectionPlan plan = list.get(m);
+                // 目标日期需落在该主计划有效期内
+                if (plan.getStartDate().isAfter(targetDate) || plan.getEndDate().isBefore(targetDate)) {
+                    continue;
+                }
+                String existKey = plan.getId() + "_" + targetDate;
+                // 已存在则不做任何操作
+                if (existPlanSonKeyList.contains(existKey)) {
+                    continue;
+                }
+                // 休息日不生成子计划
+                if (plan.getRestDay() != null && plan.getRestDay().contains(week)) {
+                    continue;
+                }
+
+                for (int j = 0; j < scheduleList.size(); j++) {
+                    if (!plan.getId().equals(scheduleList.get(j).getPlanId())) {
+                        continue;
+                    }
+                    PatrolInspectionPlanSon patrolInspectionPlanSon = new PatrolInspectionPlanSon();
+                    patrolInspectionPlanSon.setPlanId(plan.getId());
+                    patrolInspectionPlanSon.setInspectionDate(targetDate);
+                    patrolInspectionPlanSon.setStartTime(scheduleList.get(j).getStartTime());
+                    patrolInspectionPlanSon.setEndTime(scheduleList.get(j).getEndTime());
+                    patrolInspectionPlanSon.setPersonnelId(scheduleList.get(j).getPersonnelId());
+                    patrolInspectionPlanSon.setAreaId(plan.getAreaId());
+                    patrolInspectionPlanSon.setPlanType(plan.getPlanType());
+                    patrolInspectionPlanSon.setPlanCycle(plan.getPlanCycle());
+                    patrolInspectionPlanSon.setPlanFrequency(plan.getPlanFrequency());
+                    patrolInspectionPlanSon.setLapTime(plan.getLapTime());
+                    patrolInspectionPlanSon.setIntervalTime(plan.getIntervalTime());
+                    patrolInspectionPlanSon.setPlanDescribe(plan.getPlanDescribe());
+                    patrolInspectionPlanSon.setCompletion(0);
+                    patrolInspectionPlanSon.setCreateTime(LocalDateTime.now());
+                    patrolInspectionPlanSon.setCreator(plan.getCreator());
+                    patrolInspectionPlanSon.setAlternateField("0");
+                    patrolInspectionPlanSon.setTenantId(plan.getTenantId());
+                    patrolInspectionPlanSon.setCompanyId(plan.getCompanyId());
+                    patrolInspectionPlanSonService.save(patrolInspectionPlanSon);
+                    Integer zfid = patrolInspectionPlanSon.getId();
+                    for (int k = 0; k < siteList.size(); k++) {
+                        if (plan.getId().equals(siteList.get(k).getPlanId())) {
+                            PatrolInspectionPlanSiteSon planSiteSon = new PatrolInspectionPlanSiteSon();
+                            planSiteSon.setPlanId(zfid);
+                            planSiteSon.setSiteId(siteList.get(k).getSiteId());
+                            planSiteSon.setInspectionStatus(1);
+                            planSiteSonService.save(planSiteSon);
+                        }
+                    }
+                }
+                // 补插后加入已存在标记,避免同日重复创建
+                existPlanSonKeyList.add(existKey);
+            }
+        }
+    }
+
     @Override
     @Transactional
     public void delPatrolInspectionPlan(Integer id) {

+ 1 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/DmpProductInfoController.java

@@ -9,6 +9,7 @@ import com.usky.iot.domain.DmpProductInfo;
 import com.usky.iot.service.DmpProductInfoService;
 import com.usky.iot.service.vo.DmpProductInfoRequest;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;

+ 4 - 1
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpDeviceInfoServiceImpl.java

@@ -548,7 +548,10 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
             dmpDeviceInfo.setCreatedTime(LocalDateTime.now());
             dmpDeviceInfo.setTenantId(SecurityUtils.getTenantId());
 
-            dmpDeviceInfo.setServiceStatus(1);
+            if(dmpDeviceInfo.getServiceStatus() == null) {
+                dmpDeviceInfo.setServiceStatus(1);
+            }
+
             if (StringUtils.isBlank(dmpDeviceInfo.getDeviceUuid())) {
                 dmpDeviceInfo.setDeviceUuid(UUIDUtils.uuid().substring(0, 16));
             }

+ 3 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpProductInfoServiceImpl.java

@@ -29,6 +29,7 @@ import com.usky.iot.service.vo.DmpProductInfoRequest;
 import com.usky.transfer.RemoteTransferService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -70,6 +71,7 @@ public class DmpProductInfoServiceImpl extends AbstractCrudService<DmpProductInf
     private RemoteTsdbProxyService remoteTsdbProxyService;
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void add(List<DmpProductInfo> dmpProductInfo) {
         if (CollectionUtils.isEmpty(dmpProductInfo)) {
             throw new BusinessException("数据不能为空");
@@ -218,6 +220,7 @@ public class DmpProductInfoServiceImpl extends AbstractCrudService<DmpProductInf
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void update(DmpProductInfo dmpProductInfo) {
         dmpProductInfo.setUpdatedTime(new Date());
         if (checkNameUnique(dmpProductInfo)){

+ 12 - 1
service-job/src/main/java/com/ruoyi/job/task/RyTask.java

@@ -4,6 +4,7 @@ import com.usky.cdi.AlarmDataSyncTaskService;
 import com.usky.cdi.RemotecdiTaskService;
 import com.usky.common.core.utils.StringUtils;
 import com.usky.eg.RemoteEgService;
+import com.usky.fire.RemotePlanSonService;
 import com.usky.meeting.RemoteMeetingService;
 import com.usky.ems.RemoteEmsTaskService;
 import com.usky.vpp.RemoteVppTaskService;
@@ -44,9 +45,13 @@ public class RyTask {
     @Autowired
     private RemoteEgService remoteEgService;
 
+    @Autowired
+    private RemotePlanSonService remotePlanSonService;
+
     @Autowired
     private RemoteVppTaskService remoteVppTaskService;
 
+
     public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
         System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
     }
@@ -134,10 +139,16 @@ public class RyTask {
         remoteEgService.egDeviceStatus();
     }
 
+    // 创建巡检子计划
+    public void addPlanSon(){
+        System.out.println(Thread.currentThread().getName() + "巡检计划分批次创建执行中");
+        remotePlanSonService.addPlanSon();
+    }
+
     // 刷新站点平均完成率
     public void refreshSiteAvgCompletionRate() {
         System.out.println("refreshSiteAvgCompletionRate start......");
         remoteVppTaskService.refreshSiteAvgCompletionRate();
-    }
+	}
 
 }

+ 1 - 1
service-vpp/service-vpp-biz/src/main/java/com/usky/vpp/domain/VppDrParticipation.java

@@ -35,7 +35,7 @@ public class VppDrParticipation implements Serializable {
     private BigDecimal declaredCapacityKw;
     @TableField("cleared_capacity_kw")
     private BigDecimal clearedCapacityKw;
-    /** 完成率 = 出清容量 / 申报出清容量 */
+    /** 完成率 = 出清容量 / 申报容量 */
     @TableField("completion_rate")
     private BigDecimal completionRate;
     @TableField("declared_at")