فهرست منبع

项目电梯入参统一成mtCompanyId

别傲 5 سال پیش
والد
کامیت
0290c1722b
14فایلهای تغییر یافته به همراه73 افزوده شده و 55 حذف شده
  1. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/controller/LiftController.java
  2. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/request/LiftChooseRequest.java
  3. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/request/LiftExtensionRequest.java
  4. 2 2
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/request/LiftRequest.java
  5. 33 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/request/PlatformCompanyBatchRequest.java
  6. 8 14
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/request/PlatformCompanyRequest.java
  7. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/request/ProjectLiftRequest.java
  8. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/LiftService.java
  9. 13 13
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/PlatformCompanyLiftRelevanceService.java
  10. 4 4
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/MaintenancePlanService.java
  11. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/project/dao/entity/model/request/CompanyRequest.java
  12. 0 6
      lift-business-service/src/main/java/cn/com/ty/lift/business/project/dao/entity/model/request/ProjectCompanyRequest.java
  13. 6 6
      lift-business-service/src/main/resources/mapper/lift/LiftMapper.xml
  14. 1 4
      lift-business-service/src/main/resources/mapper/project/ProjectMapper.xml

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/library/controller/LiftController.java

@@ -196,7 +196,7 @@ public class LiftController {
      * @date 2019/12/5 5:24 PM
      */
     @PostMapping("batch/stop/insurance")
-    public RestResponse batchStopInsurance(@RequestBody PlatformCompanyRequest request) {
+    public RestResponse batchStopInsurance(@Valid @RequestBody PlatformCompanyBatchRequest request) {
         return platformService.batchStopInsurance(request);
     }
 

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

@@ -18,5 +18,5 @@ public class LiftChooseRequest extends BaseRequestModel {
      * 公司ID
      */
     @NotNull(message = "notEmpty")
-    private Long companyId;
+    private Long mtCompanyId;
 }

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

@@ -44,7 +44,7 @@ public class LiftExtensionRequest {
     /**
      * 电梯id
      */
-    private String id;
+    private Long id;
 
     /**
      * 电梯

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

@@ -16,7 +16,7 @@ public class LiftRequest extends BaseRequestModel {
     /**
      * 电梯状态(服务中:1,停止:0)
      */
-    private Byte liftStatus;
+    private String liftStatus;
 
     /**
      * 区域ID
@@ -51,5 +51,5 @@ public class LiftRequest extends BaseRequestModel {
     /**
      * 公司ID
      */
-    private Long companyId;
+    private Long mtCompanyId;
 }

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

@@ -0,0 +1,33 @@
+package cn.com.ty.lift.business.library.dao.entity.model.request;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author bieao
+ * @date 2020/1/3
+ * @description 批量停保请求
+ */
+@Data
+public class PlatformCompanyBatchRequest {
+
+    /**
+     * 公司id
+     */
+    @NotNull(message = "notEmpty")
+    private Long mtCompanyId;
+
+    /**
+     * 电梯id列表
+     */
+    @NotNull(message = "notEmpty")
+    private List<Long> idList;
+
+    /**
+     * 公司电梯关联表主键id列表
+     */
+    @NotNull(message = "notEmpty")
+    private List<Long> platformCompanyIdList;
+}

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

@@ -2,37 +2,31 @@ package cn.com.ty.lift.business.library.dao.entity.model.request;
 
 import lombok.Data;
 
-import java.util.List;
+import javax.validation.constraints.NotNull;
 
 /**
  * @author bieao
  * @date 2019/12/5
- * @description
+ * @description 停保请求
  */
 @Data
 public class PlatformCompanyRequest {
-    /**
-     * 电梯id列表
-     */
-    private List<Long> idList;
-
-    /**
-     * 公司电梯关联表主键id列表
-     */
-    private List<Long> platformCompanyIdList;
 
     /**
      * 公司电梯关联表主键id
      */
-    private Long platformCompanyId;
+    @NotNull(message = "notEmpty")
+    private Long relevanceId;
 
     /**
      * 公司id
      */
-    private String companyId;
+    @NotNull(message = "notEmpty")
+    private Long companyId;
 
     /**
      * 电梯id
      */
-    private String liftId;
+    @NotNull(message = "notEmpty")
+    private Long liftId;
 }

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

@@ -18,7 +18,7 @@ public class ProjectLiftRequest extends BaseRequestModel {
      * 公司ID
      */
     @NotNull(message = "notEmpty")
-    private Long companyId;
+    private Long mtCompanyId;
     /**
      * 项目ID
      */

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/LiftService.java

@@ -193,7 +193,7 @@ public class LiftService extends ServiceImpl<LiftMapper,Lift> {
             }
             id = lift.getId();
         } else {
-            id = Long.parseLong(request.getId());
+            id = request.getId();
         }
         //新增电梯来源
         String source = request.getSource();

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

@@ -2,13 +2,13 @@ package cn.com.ty.lift.business.library.service;
 
 import cn.com.ty.lift.business.framework.util.MessageUtils;
 import cn.com.ty.lift.business.library.dao.entity.PlatformCompanyLiftRelevance;
+import cn.com.ty.lift.business.library.dao.entity.model.request.PlatformCompanyBatchRequest;
 import cn.com.ty.lift.business.library.dao.entity.model.request.SelectBatchPlatformCompanyRequest;
 import cn.com.ty.lift.business.library.dao.entity.model.request.PlatformCompanyRequest;
 import cn.com.ty.lift.business.library.dao.mapper.PlatformCompanyLiftRelevanceMapper;
 import cn.com.ty.lift.business.maintenance.service.MaintenancePlanService;
 import cn.com.ty.lift.business.project.dao.entity.Project;
 import cn.com.ty.lift.business.project.dao.mapper.ProjectMapper;
-import cn.com.ty.lift.common.constants.ApiConstants;
 import cn.com.ty.lift.common.constants.CommonEnum;
 import cn.com.xwy.boot.web.dto.RestResponse;
 import cn.hutool.core.util.ObjectUtil;
@@ -43,7 +43,7 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
     private MaintenancePlanService maintenancePlanService;
 
     /**
-     * @param id 电梯id
+     * @param id          电梯id
      * @param mtCompanyId 公司id
      * @return PlatformCompanyLiftRelevance
      * @description 新增平台电梯、企业电梯关联表数据
@@ -66,7 +66,7 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
      * @description 查询该公司下是否有此电梯
      * @date 2019/12/20 11:39 AM
      */
-    public boolean findCompanyLiftExist(Map<String,Object> paramMap) {
+    public boolean findCompanyLiftExist(Map<String, Object> paramMap) {
         return mapper.findCompanyLiftExist(paramMap) > 0;
     }
 
@@ -136,7 +136,7 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
             default:
                 break;
         }
-        return RestResponse.success(null, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.add.success"));
+        return RestResponse.success(null, MessageUtils.get("msg.add.success"));
     }
 
     /**
@@ -144,13 +144,13 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
      * @param request companyId 公司id
      * @param request liftId 电梯id
      * @return 1.成功, 0.失败, 消息描述
-     * @description 更新电梯状态为停保,并清除维保计划
+     * @description 更新电梯状态为停保, 并清除维保计划
      * @date 2019/12/5 5:24 PM
      */
     @Transactional(rollbackFor = Exception.class)
     public RestResponse stopInsurance(PlatformCompanyRequest request) {
         PlatformCompanyLiftRelevance entry = new PlatformCompanyLiftRelevance();
-        entry.setId(request.getPlatformCompanyId());
+        entry.setId(request.getRelevanceId());
         entry.setLiftCompanyStatus(CommonEnum.LiftStatus.STOP_INSURANCE.getCode());
         boolean result = updateById(entry);
         if (!result) {
@@ -161,7 +161,7 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
         if (!ret) {
             return RestResponse.fail(MessageUtils.get("msg.modify.batch.fail"));
         }
-        return RestResponse.success(null, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.modify.batch.success"));
+        return RestResponse.success(null, MessageUtils.get("msg.modify.batch.success"));
     }
 
     /**
@@ -169,11 +169,11 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
      * @param request companyId 公司id
      * @param request idList 电梯id列表
      * @return 1.成功, 0.失败, 消息描述
-     * @description 批量更新电梯状态为停保,并清除维保计划
+     * @description 批量更新电梯状态为停保, 并清除维保计划
      * @date 2019/12/31 9:54 AM
      */
     @Transactional(rollbackFor = Exception.class)
-    public RestResponse batchStopInsurance(PlatformCompanyRequest request){
+    public RestResponse batchStopInsurance(PlatformCompanyBatchRequest request) {
         //公司电梯关联表主键id列表
         List<Long> companyIdList = request.getPlatformCompanyIdList();
         //批量查询公司下电梯数据
@@ -188,17 +188,17 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
             return RestResponse.fail(MessageUtils.get("msg.modify.batch.fail"));
         }
         //批量清除维保计划
-        boolean ret = maintenancePlanService.removeMaintenancePlan(request.getCompanyId(),request.getIdList());
+        boolean ret = maintenancePlanService.removeMaintenancePlan(request.getMtCompanyId(), request.getIdList());
         if (!ret) {
             return RestResponse.fail(MessageUtils.get("msg.modify.batch.fail"));
         }
-        return RestResponse.success(null, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.modify.batch.success"));
+        return RestResponse.success(null, MessageUtils.get("msg.modify.batch.success"));
     }
 
-    public List<PlatformCompanyLiftRelevance> listByCompany(Long companyId){
+    public List<PlatformCompanyLiftRelevance> listByCompany(Long companyId) {
         QueryWrapper<PlatformCompanyLiftRelevance> queryWrapper = new QueryWrapper<>();
         LambdaQueryWrapper<PlatformCompanyLiftRelevance> lambdaQueryWrapper = queryWrapper.lambda();
-        lambdaQueryWrapper.eq(PlatformCompanyLiftRelevance::getMtCompanyId,companyId);
+        lambdaQueryWrapper.eq(PlatformCompanyLiftRelevance::getMtCompanyId, companyId);
         return list(lambdaQueryWrapper);
     }
 }

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

@@ -205,15 +205,15 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
 
 
     /**
-     * @param companyId 公司id
+     * @param mtCompanyId 公司id
      * @param idList    电梯id列表
      * @return 是否成功
      * @description 批量清除维保计划
      * @date 2019/12/28 2:00 PM
      */
-    public boolean removeMaintenancePlan(String companyId, List<Long> idList) {
+    public boolean removeMaintenancePlan(Long mtCompanyId, List<Long> idList) {
         QueryWrapper<MaintenancePlan> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("mt_company_id", companyId);
+        queryWrapper.eq("mt_company_id", mtCompanyId);
         queryWrapper.in("lift_id", idList);
         return remove(queryWrapper);
     }
@@ -225,7 +225,7 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
      * @description 清空维保计划
      * @date 2019/12/21 3:39 PM
      */
-    public boolean cleanPlan(String mtCompanyId, String liftId) {
+    public boolean cleanPlan(Long mtCompanyId, Long liftId) {
         Map<String, Object> columnMap = new HashMap<>(2);
         columnMap.put("mt_company_id", mtCompanyId);
         columnMap.put("lift_id", liftId);

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

@@ -18,5 +18,5 @@ public class CompanyRequest extends BaseRequestModel {
      * 公司id
      */
     @NotNull(message = "notEmpty")
-    private Long companyId;
+    private Long mtCompanyId;
 }

+ 0 - 6
lift-business-service/src/main/java/cn/com/ty/lift/business/project/dao/entity/model/request/ProjectCompanyRequest.java

@@ -23,12 +23,6 @@ public class ProjectCompanyRequest extends BaseRequestModel {
     @NotNull(message = "notEmpty")
     private Long ppCompanyId;
 
-    /**
-     * 甲方联系人id
-     */
-    @NotNull(message = "notEmpty")
-    private Long ppContactId;
-
     /**
      * 项目状态
      */

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

@@ -81,8 +81,8 @@
         LEFT JOIN project p ON pclr.mt_company_id = p.mt_company_id and plr.project_id = p.id
         LEFT JOIN lift_brand lb ON l.lift_brand = lb.code
 		WHERE 1=1
-        <if test="request.companyId!=null and request.companyId!=''">
-			AND pclr.mt_company_id = #{request.companyId,jdbcType=BIGINT}
+        <if test="request.mtCompanyId!=null and request.mtCompanyId!=''">
+			AND pclr.mt_company_id = #{request.mtCompanyId,jdbcType=BIGINT}
         </if>
 		<if test="request.liftStatus != null and request.liftStatus != '' and request.liftStatus == 1">
 			AND pclr.lift_company_status != 1
@@ -123,8 +123,8 @@
 		  LEFT JOIN user_info ui ON plr.worker_id = ui.user_id
           LEFT JOIN platform_company_lift_relevance pclr ON plr.lift_id = pclr.lift_id AND pclr.id = plr.relevance_id
         WHERE 1=1
-		<if test="request.companyId!=null and request.companyId!=''">
-			AND plr.mt_company_id = #{request.companyId,jdbcType=BIGINT}
+		<if test="request.mtCompanyId!=null and request.mtCompanyId!=''">
+			AND plr.mt_company_id = #{request.mtCompanyId,jdbcType=BIGINT}
 		</if>
         <if test="request.projectId!=null and request.projectId!=''">
             AND plr.project_id = #{request.projectId,jdbcType=BIGINT}
@@ -152,8 +152,8 @@
 		WHERE 1=1
 		AND pclr.lift_company_status != '1'
 		AND l.lift_status = '2'
-		<if test="request.companyId!=null and request.companyId!=''">
-			AND plr.mt_company_id != #{request.companyId,jdbcType=BIGINT}
+		<if test="request.mtCompanyId!=null and request.mtCompanyId!=''">
+			AND plr.mt_company_id != #{request.mtCompanyId,jdbcType=BIGINT}
 		</if>
 	</select>
 

+ 1 - 4
lift-business-service/src/main/resources/mapper/project/ProjectMapper.xml

@@ -115,9 +115,6 @@
 		<if test="request.ppCompanyId!=null and request.ppCompanyId!=''">
 			AND a.pp_company_id = #{request.ppCompanyId,jdbcType=BIGINT}
 		</if>
-		<if test="request.ppContactId!=null and request.ppContactId!=''">
-			AND a.pp_contact_id = #{request.ppContactId,jdbcType=BIGINT}
-		</if>
 		<!--查询项目状态为2:服务中的项目-->
 		<if test="request.projectStatus!=null and request.projectStatus!='' and request.projectStatus == 2">
 			AND a.project_status = #{request.projectStatus,jdbcType=TINYINT}
@@ -155,7 +152,7 @@
 		FROM project_lift_relevance plr
 		LEFT JOIN project p ON plr.project_id = p.id
 		WHERE 1=1
-		<if test="request.companyId!=null and request.companyId!=''">
+		<if test="request.mtCompanyId!=null and request.mtCompanyId!=''">
 			AND plr.mt_company_id = #{request.companyId,jdbcType=VARCHAR}
 		</if>
 	</select>