Sfoglia il codice sorgente

项目电梯列表增加经纬度返回

别傲 5 anni fa
parent
commit
f855f77956

+ 5 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/response/LiftResponse.java

@@ -89,4 +89,9 @@ public class LiftResponse {
      * 手机号
      */
     private String mobile;
+
+    /**
+     * 经纬度
+     */
+    private String coordinate;
 }

+ 12 - 8
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/MaintenancePlanService.java

@@ -446,9 +446,11 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
         if (isNotNull && ObjectUtil.isEmpty(updateInterval)) {
             //获取当前时间后的维保计划列表,并清除计划
             planList = findPlanList(liftId, projectId, mtCompanyId, currentTime, "plan");
-            removeByIds(planList.stream().map(MaintenancePlan::getId).collect(Collectors.toList()));
-            //按照修改时间重新生成计划
-            plans = generatePlan(plan, periods, interval, updateTime, endDate);
+            if (CollUtil.isNotEmpty(planList)) {
+                removeByIds(planList.stream().map(MaintenancePlan::getId).collect(Collectors.toList()));
+                //按照修改时间重新生成计划
+                plans = generatePlan(plan, periods, interval, updateTime, endDate);
+            } else return false;
         } else if (isNull && ObjectUtil.isNotEmpty(updateInterval)) {
             //获取当前期数后的维保计划列表,并清除计划
             planList = findPlanList(mtCompanyId, liftId, periods);
@@ -462,11 +464,13 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
         } else if (isNotNull && ObjectUtil.isNotEmpty(updateInterval)) {
             //获取当前期数后的维保计划列表,并清除计划
             planList = findPlanList(mtCompanyId, liftId, periods);
-            removeByIds(planList.stream().map(MaintenancePlan::getId).collect(Collectors.toList()));
-            //更新项目电梯关联表保养间隔
-            projectLiftRelevanceService.modify(relevance);
-            //按照修改时间重新生成计划
-            plans = generatePlan(plan, periods, updateInterval, updateTime, endDate);
+            if (CollUtil.isNotEmpty(planList)) {
+                removeByIds(planList.stream().map(MaintenancePlan::getId).collect(Collectors.toList()));
+                //更新项目电梯关联表保养间隔
+                projectLiftRelevanceService.modify(relevance);
+                //按照修改时间重新生成计划
+                plans = generatePlan(plan, periods, updateInterval, updateTime, endDate);
+            } else return false;
         }
         MaintenancePlan newPlan = plans.get(0);
         String workerName = commonMapper.queryUserNameById(workerId);

+ 1 - 0
lift-business-service/src/main/resources/mapper/capital/CapitalRepairMapper.xml

@@ -80,6 +80,7 @@
                 l.lift_type              AS liftType,
                 l.device_position        AS devicePosition,
                 lb.name                  AS liftBrand,
+                l.coordinate             AS coordinate,
                 l.annual_inspection_date AS annualInspectionDate,
                 pclr.id                  AS companyRelevanceId,
                 crlr.id                  AS projectRelevanceId,

+ 1 - 0
lift-business-service/src/main/resources/mapper/lift/LiftMapper.xml

@@ -130,6 +130,7 @@
         l.device_position AS devicePosition,
         lb.name AS liftBrand,
         l.annual_inspection_date AS annualInspectionDate,
+        l.coordinate AS coordinate,
         pclr.id AS companyRelevanceId,
         pclr.lift_company_status AS liftStatus,
         plr.id AS projectRelevanceId,