Pārlūkot izejas kodu

Merge branch 'feature-bieao' of lift-manager/lift-server into develop

bieao 5 gadi atpakaļ
vecāks
revīzija
1ab07119b8

+ 2 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/response/MtRecordResponse.java

@@ -60,6 +60,8 @@ public class MtRecordResponse extends MaintenanceRecord {
     private long repairDiff;
 
     private String repairDuration;
+
+    private String devicePosition;
     /**
      * 重新getter方法,换算时长
      * XX天XX小时XX分XX秒

+ 2 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/MaintenanceRecordService.java

@@ -164,7 +164,8 @@ public class MaintenanceRecordService extends ServiceImpl<MaintenanceRecordMappe
         //获取当前时间后的维保计划列表,并清除计划
         maintenancePlanService.removeByIds(planList.stream().map(MaintenancePlan::getId).collect(Collectors.toList()));
         //按照修改时间重新生成计划
-        List<MaintenancePlan> plans = maintenancePlanService.generatePlan(plan, periods, interval, request.getCurrentTime(), endDate);
+        LocalDate beginTime = request.getCurrentTime().plusDays(interval);
+        List<MaintenancePlan> plans = maintenancePlanService.generatePlan(plan, periods, interval, beginTime, endDate);
         return maintenancePlanService.saveBatch(plans, plans.size());
     }
 

+ 10 - 8
lift-business-service/src/main/resources/mapper/maintenance/MaintenanceRecordMapper.xml

@@ -42,6 +42,7 @@
         <result column="worker_name" property="workerName" jdbcType="VARCHAR"/>
         <result column="repair_diff" property="repairDiff" jdbcType="BIGINT"/>
         <result column="star_level" property="starLevel" jdbcType="INTEGER"/>
+        <result column="device_position" property="devicePosition" jdbcType="VARCHAR"/>
     </resultMap>
 
     <sql id="Base_Column_List">
@@ -143,22 +144,22 @@
             AND <![CDATA[ mr.work_date = #{request.currentTime}]]>
         </if>
         <if test="request.beginTime!=null">
-            AND <![CDATA[ mr.plan_date >= #{request.beginTime}]]>
+            AND <![CDATA[ mr.work_date >= #{request.beginTime}]]>
         </if>
         <if test="request.endTime!=null">
-            AND <![CDATA[ mr.plan_date <= #{request.endTime}]]>
+            AND <![CDATA[ mr.work_date <= #{request.endTime}]]>
         </if>
 	</select>
 
     <!--app端 保养任务统计 (1:保养中、2:已完成) -->
     <select id="countRecordByWorkerId" resultType="cn.com.ty.lift.business.maintenance.dao.entity.model.MaintenanceCount"
             parameterType="cn.com.ty.lift.business.maintenance.dao.entity.model.request.MaintenanceRecordRequest">
-        SELECT  t.plan_date,
+        SELECT  t.planDate,
                 MAX(CASE t.status WHEN '1' THEN t.total ELSE 0 END) inProgress,
                 MAX(CASE t.status WHEN '2' THEN t.total ELSE 0 END) complete
         FROM (
             SELECT mr.status,
-                  mr.plan_date,
+                  mr.work_date as planDate,
                  count(1) total
         FROM maintenance_record mr
                 LEFT JOIN project p ON mr.project_id = p.id
@@ -178,15 +179,15 @@
             <otherwise/>
         </choose>
         <if test="request.beginTime!=null">
-            AND <![CDATA[ mr.plan_date >= #{request.beginTime}]]>
+            AND <![CDATA[ mr.work_date >= #{request.beginTime}]]>
         </if>
         <if test="request.endTime!=null">
-            AND <![CDATA[ mr.plan_date <= #{request.endTime}]]>
+            AND <![CDATA[ mr.work_date <= #{request.endTime}]]>
         </if>
-        GROUP BY plan_date,
+        GROUP BY planDate,
         status
         ) t
-        GROUP BY t.plan_date
+        GROUP BY t.planDate
     </select>
 
     <select id="findRecordByLiftId"
@@ -268,6 +269,7 @@
         mr.*,
         li.use_company_code,
         li.registration_code,
+        li.device_position,
         li.category,
         mc.name AS mt_company_name,
         ui.`name` AS worker_name,

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

@@ -98,7 +98,8 @@
 		<if test="request.condition!=null and request.condition!=''">
 			AND (p.project_name LIKE CONCAT('%',#{request.condition,jdbcType=VARCHAR},'%')
 			OR p.project_code LIKE CONCAT('%',#{request.condition,jdbcType=VARCHAR},'%')
-			OR p.address LIKE CONCAT('%',#{request.condition,jdbcType=VARCHAR},'%'))
+			OR p.address LIKE CONCAT('%',#{request.condition,jdbcType=VARCHAR},'%')
+		    OR r.user_id LIKE CONCAT('%',#{request.condition,jdbcType=VARCHAR},'%'))
 		</if>
 		<if test="request.projectStatus!=null and request.projectStatus!=''">
 			AND p.project_status = #{request.projectStatus,jdbcType=VARCHAR}