浏览代码

bug修复

yang 4 年之前
父节点
当前提交
7247c283db

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

@@ -345,16 +345,21 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
             // 1:弃用 2:正常
             if (Objects.equals(1, liftStatus)) return RestResponse.fail(MessageUtils.get("msg.error.lift.status"));
             update(Wrappers.<PlatformCompanyLiftRelevance>update()
-                    .set("update_date",LocalDateTime.now())
-                    .set("lift_company_status",CommonEnum.LiftStatus.NORMAL.getCode())
-                    .eq("lift_id",request.getLiftId()));
+                    .set("update_date", LocalDateTime.now())
+                    .set("lift_company_status", CommonEnum.LiftStatus.NORMAL.getCode())
+                    .eq("lift_id", request.getLiftId()));
         } else {
             update(Wrappers.<PlatformCompanyLiftRelevance>update()
-                    .set("update_date",LocalDateTime.now())
-                    .set("lift_company_status",CommonEnum.LiftStatus.STOP_INSURANCE.getCode())
-                    .eq("lift_id",request.getLiftId()));
+                    .set("update_date", LocalDateTime.now())
+                    .set("lift_company_status", CommonEnum.LiftStatus.STOP_INSURANCE.getCode())
+                    .eq("lift_id", request.getLiftId()));
             //清除维保计划
             maintenancePlanService.cleanPlan(request.getMtCompanyId(), request.getLiftId());
+            //解除维保工关联
+            projectLiftRelevanceService.update(Wrappers.<ProjectLiftRelevance>update()
+                    .set("worker_id", 0)
+                    .eq("mt_company_id",request.getMtCompanyId())
+                    .eq("lift_id", request.getLiftId()));
         }
         return RestResponse.success(null, MessageUtils.get("msg.modify.success"));
     }
@@ -383,7 +388,14 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
         boolean result = update(Wrappers.<PlatformCompanyLiftRelevance>update()
                 .set("update_date", LocalDateTime.now())
                 .set("lift_company_status", CommonEnum.LiftStatus.STOP_INSURANCE.getCode())
-                .in("lift_id",liftIds));
+                .in("lift_id", liftIds));
+
+        //批量解除维保工ID
+        projectLiftRelevanceService.update(Wrappers.<ProjectLiftRelevance>update()
+                .set("worker_id", 0)
+                .in("lift_id", liftIds)
+                .eq("mt_company_id",request.getMtCompanyId()));
+
         if (!result) {
             return RestResponse.fail(MessageUtils.get("msg.modify.batch.fail"));
         }

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

@@ -112,7 +112,7 @@
 		<if test="request.projectStatus!=null and request.projectStatus!=''">
 			AND p.project_status = #{request.projectStatus,jdbcType=VARCHAR}
 		</if>
-        ORDER BY p.end_date
+        ORDER BY p.end_date asc,id desc
 	</select>
 
 	<!-- 根据甲方公司ID和项目状态查询公司项目管理列表-->