Quellcode durchsuchen

项目列表加入公司id

别傲 vor 5 Jahren
Ursprung
Commit
8ad4136965

+ 0 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/project/controller/ProjectController.java

@@ -1,7 +1,6 @@
 package cn.com.ty.lift.business.project.controller;
 
 import cn.com.ty.lift.business.framework.util.MessageUtils;
-import cn.com.ty.lift.business.library.dao.entity.model.request.LiftLockRequest;
 import cn.com.ty.lift.business.library.dao.entity.model.request.SelectBatchPlatformCompanyRequest;
 import cn.com.ty.lift.business.library.service.PlatformCompanyLiftRelevanceService;
 import cn.com.ty.lift.business.project.dao.entity.Project;

+ 4 - 5
lift-business-service/src/main/java/cn/com/ty/lift/business/project/service/ProjectLiftRelevanceService.java

@@ -103,10 +103,9 @@ public class ProjectLiftRelevanceService extends ServiceImpl<ProjectLiftRelevanc
      * @date 2019/12/5 11:00 AM
      */
     public RestResponse liftLockOrUnLock(LiftLockRequest request) {
-        List<Long> list = request.getLiftList();
-        List<ProjectLiftRelevance> projectLiftList = list(request.getMtCompanyId(), list);
+        List<ProjectLiftRelevance> projectLiftList = list(request.getMtCompanyId(), request.getLiftList());
         if (ObjectUtil.isEmpty(projectLiftList)) {
-            return RestResponse.success();
+            return RestResponse.success(null, MessageUtils.get("msg.company.lift.empty"));
         }
         projectLiftList.forEach(entry -> entry.setLiftLocked(request.getLock()));
         boolean result = updateBatchById(projectLiftList);
@@ -134,14 +133,14 @@ public class ProjectLiftRelevanceService extends ServiceImpl<ProjectLiftRelevanc
         //根据项目id和公司id查询项目下电梯
         List<ProjectLiftRelevance> relevanceList = baseMapper.findIdList(request);
         if (ObjectUtil.isEmpty(relevanceList)) {
-            return RestResponse.success();
+            return RestResponse.success(null, MessageUtils.get("msg.project.status.update"));
         }
         relevanceList.forEach(relevance -> relevance.setLiftLocked(request.getLock()));
         boolean response = updateBatchById(relevanceList);
         if (!response) {
             return RestResponse.fail(MessageUtils.get("msg.modify.fail"));
         }
-        return RestResponse.success(null, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.modify.success"));
+        return RestResponse.success(null, MessageUtils.get("msg.modify.success"));
     }
 
     /**

+ 3 - 1
lift-business-service/src/main/resources/locale/response.properties

@@ -15,4 +15,6 @@ msg.lift.library.exist=\u7535\u68AF\u5E93\u5DF2\u5B58\u5728\u8BE5\u7535\u68AF
 msg.lift.exist=\u516C\u53F8\u4E0B\u5DF2\u6709\u6B64\u7535\u68AF\uFF0C\u4E0D\u80FD\u91CD\u590D\u6DFB\u52A0
 msg.lift.company.exist=\u5176\u4ED6\u516C\u53F8\u5DF2\u6709\u6B64\u7535\u68AF\uFF0C\u8FD4\u56DE\u7535\u68AF\u4FE1\u606F
 msg.pre.judge=\u524D\u7F6E\u6821\u9A8C\u901A\u8FC7
-notEmpty={0}\u4E0D\u80FD\u4E3A\u7A7A
+notEmpty={0}\u4E0D\u80FD\u4E3A\u7A7A
+msg.project.status.update=\u9879\u76EE\u9501\u5B9A\u72B6\u6001\u66F4\u65B0\u6210\u529F\uFF0C\u9879\u76EE\u4E0B\u6682\u65F6\u6CA1\u6709\u7535\u68AF
+msg.company.lift.empty=\u8BE5\u516C\u53F8\u4E0B\u6682\u65F6\u6CA1\u6709\u7535\u68AF

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

@@ -62,7 +62,8 @@
 	</sql>
 
 	<!-- 根据区域,项目,电梯号,电梯品牌,电梯类型,维保工查询电梯列表信息-->
-	<select id="findByCondition" resultType="cn.com.ty.lift.business.library.dao.entity.model.response.LiftResponse" parameterType="cn.com.ty.lift.business.library.dao.entity.model.request.LiftRequest" >
+	<select id="findByCondition" resultType="cn.com.ty.lift.business.library.dao.entity.model.response.LiftResponse"
+			parameterType="cn.com.ty.lift.business.library.dao.entity.model.request.LiftRequest" >
         SELECT
 		l.id                     AS id,
 		l.lift_code              AS liftCode,
@@ -76,12 +77,12 @@
         plr.lift_locked          AS liftLocked
         FROM platform_company_lift_relevance pclr
         LEFT JOIN lift l ON pclr.lift_id = l.id
-        LEFT JOIN project_lift_relevance plr ON pclr.company_id = plr.company_id and pclr.lift_id = plr.lift_id
-        LEFT JOIN project p ON pclr.company_id = p.mt_company_id and plr.project_id = p.id
+        LEFT JOIN project_lift_relevance plr ON pclr.mt_company_id = plr.mt_company_id and pclr.lift_id = plr.lift_id
+        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.company_id = #{request.companyId,jdbcType=BIGINT}
+			AND pclr.mt_company_id = #{request.companyId,jdbcType=BIGINT}
         </if>
 		<if test="request.liftStatus != null and request.liftStatus != '' and request.liftStatus == 1">
 			AND pclr.lift_company_status != 1
@@ -101,7 +102,8 @@
 	</select>
 
 	<!-- 查询项目下电梯列表 -->
-    <select id="findLiftListByProjectId" resultType="cn.com.ty.lift.business.library.dao.entity.model.response.LiftResponse" parameterType="cn.com.ty.lift.business.library.dao.entity.model.request.ProjectLiftRequest">
+    <select id="findLiftListByProjectId" resultType="cn.com.ty.lift.business.library.dao.entity.model.response.LiftResponse"
+			parameterType="cn.com.ty.lift.business.library.dao.entity.model.request.ProjectLiftRequest">
         SELECT
           l.id                      AS id,
           l.lift_code               AS liftCode,
@@ -122,7 +124,7 @@
           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.company_id = #{request.companyId,jdbcType=BIGINT}
+			AND plr.mt_company_id = #{request.companyId,jdbcType=BIGINT}
 		</if>
         <if test="request.projectId!=null and request.projectId!=''">
             AND plr.project_id = #{request.projectId,jdbcType=BIGINT}
@@ -130,7 +132,8 @@
     </select>
 
 	<!-- 选择电梯 -->
-	<select id="chooseLiftList" resultType="cn.com.ty.lift.business.library.dao.entity.model.response.LiftResponse" parameterType="cn.com.ty.lift.business.library.dao.entity.model.request.LiftChooseRequest">
+	<select id="chooseLiftList" resultType="cn.com.ty.lift.business.library.dao.entity.model.response.LiftResponse"
+			parameterType="cn.com.ty.lift.business.library.dao.entity.model.request.LiftChooseRequest">
 		SELECT
 		l.id                      AS id,
 		l.lift_code               AS liftCode,
@@ -150,7 +153,7 @@
 		AND pclr.lift_company_status != '1'
 		AND l.lift_status = '2'
 		<if test="request.companyId!=null and request.companyId!=''">
-			AND plr.company_id != #{request.companyId,jdbcType=BIGINT}
+			AND plr.mt_company_id != #{request.companyId,jdbcType=BIGINT}
 		</if>
 	</select>
 
@@ -170,13 +173,13 @@
 			plr.relevance_id,
 			plr.worker_id,
 			ui.`name` AS worker_name,
-			plr.company_id
+			plr.mt_company_id
 		FROM
 			lift li
 			LEFT JOIN project_lift_relevance plr ON li.id = plr.lift_id
 			LEFT JOIN user_info ui ON plr.worker_id = ui.user_id
 		WHERE
-			plr.company_id = #{mtCompanyId}
+			plr.mt_company_id = #{mtCompanyId}
 			AND plr.project_id = #{projectId}
 	</select>
 

+ 5 - 5
lift-business-service/src/main/resources/mapper/maintenance/MaintenancePlanMapper.xml

@@ -28,7 +28,7 @@
 		l.registration_code         AS registrationCode,
 		l.device_position           AS devicePosition,
 		plr.id                      AS relevanceId,
-		plr.company_id              AS mtCompanyId,
+		plr.mt_company_id           AS mtCompanyId,
 		plr.worker_id               AS workerId,
 		plr.plan_interval           AS planInterval,
 		p.id                        AS projectId,
@@ -39,15 +39,15 @@
 		ui.name                     AS workerName
 		FROM
 		project_lift_relevance plr
-		LEFT JOIN platform_company_lift_relevance pclr ON plr.company_id = pclr.company_id AND plr.lift_id = pclr.lift_id
+		LEFT JOIN platform_company_lift_relevance pclr ON plr.mt_company_id = pclr.mt_company_id AND plr.lift_id = pclr.lift_id
 		LEFT JOIN lift l ON plr.lift_id = l.id
-		LEFT JOIN project p ON plr.company_id = p.mt_company_id AND plr.project_id = p.id
-		LEFT JOIN maintenance_plan mp ON plr.company_id = mp.mt_company_id AND plr.project_id = mp.project_id
+		LEFT JOIN project p ON plr.mt_company_id = p.mt_company_id AND plr.project_id = p.id
+		LEFT JOIN maintenance_plan mp ON plr.mt_company_id = mp.mt_company_id AND plr.project_id = mp.project_id
 		AND mp.status = 0 AND mp.plan_date = (SELECT MIN(plan_date) FROM maintenance_plan WHERE status = 0
 		AND mt_company_id = #{request.mtCompanyId,jdbcType=VARCHAR}) AND plr.lift_id = mp.lift_id
 		LEFT JOIN user_info ui ON plr.worker_id = ui.user_id
 		LEFT JOIN region r ON p.region_id = r.id
-		WHERE plr.company_id = #{request.mtCompanyId,jdbcType=VARCHAR}
+		WHERE plr.mt_company_id = #{request.mtCompanyId,jdbcType=VARCHAR}
 		<if test="request.projectId!=null and request.projectId!=''">
 			AND p.id = #{request.projectId,jdbcType=BIGINT}
 		</if>

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

@@ -68,7 +68,7 @@
         LEFT JOIN region r ON p.region_id = r.id
         LEFT JOIN user_info ui ON r.user_id = ui.user_id
         LEFT JOIN property_company pc ON p.pp_company_id = pc.id
-        WHERE 1 = 1
+        WHERE 1 = 1 AND p.mt_company_id = #{request.mtCompanyId,jdbcType=BIGINT}
 		<if test="request.provinceCode!=null and request.provinceCode!=''">
 			AND p.province_code= #{request.provinceCode,jdbcType=VARCHAR}
 		</if>
@@ -156,7 +156,7 @@
 		LEFT JOIN project p ON plr.project_id = p.id
 		WHERE 1=1
 		<if test="request.companyId!=null and request.companyId!=''">
-			AND plr.company_id = #{request.companyId,jdbcType=VARCHAR}
+			AND plr.mt_company_id = #{request.companyId,jdbcType=VARCHAR}
 		</if>
 	</select>