Explorar o código

电梯停保和批量停保参数修改

别傲 %!s(int64=5) %!d(string=hai) anos
pai
achega
634bc90423

+ 5 - 4
lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/request/PlatformCompanyBatchRequest.java

@@ -2,6 +2,7 @@ package cn.com.ty.lift.business.library.dao.entity.model.request;
 
 import lombok.Data;
 
+import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.util.List;
 
@@ -22,12 +23,12 @@ public class PlatformCompanyBatchRequest {
     /**
      * 电梯id列表
      */
-    @NotNull(message = "notEmpty")
-    private List<Long> idList;
+    @NotEmpty(message = "notEmpty")
+    private List<Long> liftList;
 
     /**
      * 公司电梯关联表主键id列表
      */
-    @NotNull(message = "notEmpty")
-    private List<Long> platformCompanyIdList;
+    @NotEmpty(message = "notEmpty")
+    private List<Long> relevanceIdList;
 }

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/request/PlatformCompanyRequest.java

@@ -22,7 +22,7 @@ public class PlatformCompanyRequest {
      * 公司id
      */
     @NotNull(message = "notEmpty")
-    private Long companyId;
+    private Long mtCompanyId;
 
     /**
      * 电梯id

+ 8 - 8
lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/PlatformCompanyLiftRelevanceService.java

@@ -140,8 +140,8 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
     }
 
     /**
-     * @param request platformCompanyId 公司电梯关联表主键id
-     * @param request companyId 公司id
+     * @param request relevanceId 公司电梯关联表主键id
+     * @param request mtCompanyId 公司id
      * @param request liftId 电梯id
      * @return 1.成功, 0.失败, 消息描述
      * @description 更新电梯状态为停保, 并清除维保计划
@@ -154,14 +154,14 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
         entry.setLiftCompanyStatus(CommonEnum.LiftStatus.STOP_INSURANCE.getCode());
         boolean result = updateById(entry);
         if (!result) {
-            return RestResponse.fail(MessageUtils.get("msg.modify.batch.fail"));
+            return RestResponse.fail(MessageUtils.get("msg.modify.fail"));
         }
         //清除维保计划
-        boolean ret = maintenancePlanService.cleanPlan(request.getCompanyId(), request.getLiftId());
+        boolean ret = maintenancePlanService.cleanPlan(request.getMtCompanyId(), request.getLiftId());
         if (!ret) {
-            return RestResponse.fail(MessageUtils.get("msg.modify.batch.fail"));
+            return RestResponse.fail(MessageUtils.get("msg.modify.fail"));
         }
-        return RestResponse.success(null, MessageUtils.get("msg.modify.batch.success"));
+        return RestResponse.success(null, MessageUtils.get("msg.modify.success"));
     }
 
     /**
@@ -175,7 +175,7 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
     @Transactional(rollbackFor = Exception.class)
     public RestResponse batchStopInsurance(PlatformCompanyBatchRequest request) {
         //公司电梯关联表主键id列表
-        List<Long> companyIdList = request.getPlatformCompanyIdList();
+        List<Long> companyIdList = request.getRelevanceIdList();
         //批量查询公司下电梯数据
         List<PlatformCompanyLiftRelevance> list = mapper.selectBatchIds(companyIdList);
         if (ObjectUtil.isEmpty(list)) {
@@ -188,7 +188,7 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
             return RestResponse.fail(MessageUtils.get("msg.modify.batch.fail"));
         }
         //批量清除维保计划
-        boolean ret = maintenancePlanService.removeMaintenancePlan(request.getMtCompanyId(), request.getIdList());
+        boolean ret = maintenancePlanService.removeMaintenancePlan(request.getMtCompanyId(), request.getLiftList());
         if (!ret) {
             return RestResponse.fail(MessageUtils.get("msg.modify.batch.fail"));
         }

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

@@ -206,15 +206,15 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
 
     /**
      * @param mtCompanyId 公司id
-     * @param idList    电梯id列表
+     * @param liftList 电梯id列表
      * @return 是否成功
      * @description 批量清除维保计划
      * @date 2019/12/28 2:00 PM
      */
-    public boolean removeMaintenancePlan(Long mtCompanyId, List<Long> idList) {
+    public boolean removeMaintenancePlan(Long mtCompanyId, List<Long> liftList) {
         QueryWrapper<MaintenancePlan> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("mt_company_id", mtCompanyId);
-        queryWrapper.in("lift_id", idList);
+        queryWrapper.in("lift_id", liftList);
         return remove(queryWrapper);
     }
 

+ 1 - 5
lift-business-service/src/main/resources/application.yml

@@ -10,6 +10,7 @@ spring:
     url: jdbc:mysql://132.232.206.88:3306/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
     username: root
     password: ms.c88pocY/
+    driver-class-name: com.mysql.cj.jdbc.Driver
 
   #redis缓存配置
   redis:
@@ -24,10 +25,5 @@ spring:
         max-wait: 20000ms
         min-idle: 0
 
-#自动添加createTime、isDelete 等字段
-xwy:
-  mybatis:
-    audit:
-      enabled: true
 mybatis-plus:
   mapper-locations: classpath*:/mapper/**/**Mapper.xml