ソースを参照

Merge branch 'develop' of http://132.232.206.88:3000/lift-manager/lift-server into feature-bieao

别傲 5 年 前
コミット
39c7a52bd5

+ 13 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/controller/PropertyMaintenanceController.java

@@ -1,6 +1,7 @@
 package cn.com.ty.lift.business.maintenance.controller;
 
 import cn.com.ty.lift.business.maintenance.dao.entity.model.request.PropertyMaintenanceVO;
+import cn.com.ty.lift.business.maintenance.dao.entity.model.response.DynamicMessageResponse;
 import cn.com.ty.lift.business.maintenance.dao.entity.model.response.PropertyMtResponse;
 import cn.com.ty.lift.business.maintenance.service.PropertyMaintenanceService;
 import cn.com.xwy.boot.web.dto.RestResponse;
@@ -28,4 +29,16 @@ public class PropertyMaintenanceController {
     public RestResponse<?> maintenanceNumForMonth(@RequestBody PropertyMaintenanceVO propertyMaintenanceVO) {
         return propertyMaintenanceService.queryMaintenancePlanMonth(propertyMaintenanceVO);
     }
+
+    @PostMapping("repair/message")
+    public RestResponse<?> repairMessage(@RequestBody PropertyMaintenanceVO propertyMaintenanceVO) {
+        IPage<DynamicMessageResponse> dynamicMessageResponsePage = new Page<>(propertyMaintenanceVO.getPageNum(), propertyMaintenanceVO.getPageSize());
+        return propertyMaintenanceService.queryEmergencyRepairDynamicMessage(dynamicMessageResponsePage, propertyMaintenanceVO);
+    }
+
+    @PostMapping("maintenance/message")
+    public RestResponse<?> maintenanceMessage(@RequestBody PropertyMaintenanceVO propertyMaintenanceVO) {
+        IPage<DynamicMessageResponse> dynamicMessageResponsePage = new Page<>(propertyMaintenanceVO.getPageNum(), propertyMaintenanceVO.getPageSize());
+        return propertyMaintenanceService.queryMaintenanceSuccessDynamicMessage(dynamicMessageResponsePage, propertyMaintenanceVO);
+    }
 }

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

@@ -0,0 +1,10 @@
+package cn.com.ty.lift.business.maintenance.dao.entity.model.response;
+
+import lombok.Data;
+
+@Data
+public class DynamicMessageResponse {
+    private Long id;
+    private String devicePosition;
+    private Integer hasEvaluate;
+}

+ 7 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/mapper/PropertyMaintenanceMapper.java

@@ -1,6 +1,7 @@
 package cn.com.ty.lift.business.maintenance.dao.mapper;
 
 import cn.com.ty.lift.business.maintenance.dao.entity.model.dto.MaintenancePlanMonthTaskNum;
+import cn.com.ty.lift.business.maintenance.dao.entity.model.response.DynamicMessageResponse;
 import cn.com.ty.lift.business.maintenance.dao.entity.model.response.PropertyMtResponse;
 import cn.com.ty.lift.common.constants.SqlConstants;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -18,4 +19,10 @@ public interface PropertyMaintenanceMapper {
 
     @Select(SqlConstants.QUERY_MAINTENANCE_PLAN_MONTH_TASK_NUM)
     List<MaintenancePlanMonthTaskNum> queryMaintenancePlanMonth(Long userId, String yearMonth);
+
+    @Select(SqlConstants.QUERY_EMERGENCY_REPAIR_DYNAMIC_MESSAGE)
+    List<DynamicMessageResponse> queryEmergencyRepairDynamicMessage(IPage<DynamicMessageResponse> page, Long userId);
+
+    @Select(SqlConstants.QUERY_MAINTENANCE_SUCCESS_DYNAMIC_MESSAGE)
+    List<DynamicMessageResponse> queryMaintenanceSuccessDynamicMessage(IPage<DynamicMessageResponse> page, Long userId);
 }

+ 23 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/PropertyMaintenanceService.java

@@ -2,6 +2,7 @@ package cn.com.ty.lift.business.maintenance.service;
 
 import cn.com.ty.lift.business.maintenance.dao.entity.model.dto.MaintenancePlanMonthTaskNum;
 import cn.com.ty.lift.business.maintenance.dao.entity.model.request.PropertyMaintenanceVO;
+import cn.com.ty.lift.business.maintenance.dao.entity.model.response.DynamicMessageResponse;
 import cn.com.ty.lift.business.maintenance.dao.entity.model.response.PropertyCalendarResponse;
 import cn.com.ty.lift.business.maintenance.dao.entity.model.response.PropertyMtResponse;
 import cn.com.ty.lift.business.maintenance.dao.mapper.PropertyMaintenanceMapper;
@@ -126,4 +127,26 @@ public class PropertyMaintenanceService {
         }
         return page;
     }
+
+    /**
+     * 物管,动态消息,急修分页
+     *
+     * @param dynamicMessageResponseIPage pageNum,pageSize
+     * @param propertyMaintenanceVO       userId
+     * @return 急修分页
+     */
+    public RestResponse<?> queryEmergencyRepairDynamicMessage(IPage<DynamicMessageResponse> dynamicMessageResponseIPage, PropertyMaintenanceVO propertyMaintenanceVO) {
+        return RestResponse.success(propertyMaintenanceMapper.queryEmergencyRepairDynamicMessage(dynamicMessageResponseIPage, propertyMaintenanceVO.getUserId()));
+    }
+
+    /**
+     * 物管,动态消息,维保分页
+     *
+     * @param dynamicMessageResponseIPage pageNum,pageSize
+     * @param propertyMaintenanceVO       userId
+     * @return 维保分页
+     */
+    public RestResponse<?> queryMaintenanceSuccessDynamicMessage(IPage<DynamicMessageResponse> dynamicMessageResponseIPage, PropertyMaintenanceVO propertyMaintenanceVO) {
+        return RestResponse.success(propertyMaintenanceMapper.queryMaintenanceSuccessDynamicMessage(dynamicMessageResponseIPage, propertyMaintenanceVO.getUserId()));
+    }
 }

+ 16 - 0
lift-common/src/main/java/cn.com.ty.lift.common/constants/SqlConstants.java

@@ -80,4 +80,20 @@ public interface SqlConstants {
                     "   where project_id in (select project_id from project_user where user_id = #{userId})" +
                     "       and DATE_FORMAT(plan_date, '%Y-%m') = #{yearMonth}" +
                     "       group by plan_date, status";
+
+    //动态消息,当日急修完成是否已经评价列表
+    String QUERY_EMERGENCY_REPAIR_DYNAMIC_MESSAGE =
+            "select     er.id id,l.device_position devicePosition, has_evaluate hasEvaluate" +
+                    "    from emergency_repair er" +
+                    "       left join lift l on er.lift_id = l.id" +
+                    "    where DATE_FORMAT(er.recovery_date, '%Y%m%d') = DATE_FORMAT(CURDATE(), '%Y%m%d')" +
+                    "       and project_id in (select project_id from project_user where user_id = #{userId})";
+
+    //动态消息,当日维保完成是否已经评价列表
+    String QUERY_MAINTENANCE_SUCCESS_DYNAMIC_MESSAGE =
+            "select     mr.id id,l.device_position devicePosition, has_evaluate hasEvaluate" +
+                    "    from maintenance_record mr" +
+                    "        left join lift l on mr.lift_id = l.id" +
+                    "    where DATE_FORMAT(mr.recovery_date, '%Y%m%d')  = DATE_FORMAT(CURDATE(), '%Y%m%d')" +
+                    "      and project_id in (select project_id from project_user where user_id = #{userId})";
 }