Browse Source

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

别傲 5 years ago
parent
commit
bbfb894675
14 changed files with 185 additions and 33 deletions
  1. 44 22
      lift-business-service/src/main/java/cn/com/ty/lift/business/annualinspection/controller/AnnualInspectionController.java
  2. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/common/CommonController.java
  3. 10 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/controller/EmergencyRepairController.java
  4. 4 4
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/dto/RepairRequest.java
  5. 7 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/controller/PropertyMaintenanceController.java
  6. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/dto/MaintenancePlanMonthTaskNum.java
  7. 1 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/request/MtPlanRequest.java
  8. 5 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/request/PropertyMaintenanceVO.java
  9. 19 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/response/PropertyCalendarResponse.java
  10. 81 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/PropertyMaintenanceService.java
  11. 4 4
      lift-common/src/main/java/cn.com.ty.lift.common/constants/ApiConstants.java
  12. 6 0
      lift-common/src/main/java/cn.com.ty.lift.common/utils/ValuePool.java
  13. 1 0
      lift-push/src/main/java/cn/com/ty/lift/push/app/PushConsumer.java
  14. 1 1
      lift-upload/src/main/java/com/upload/controller/UploadController.java

+ 44 - 22
lift-business-service/src/main/java/cn/com/ty/lift/business/annualinspection/controller/AnnualInspectionController.java

@@ -184,7 +184,7 @@ public class AnnualInspectionController {
      * 修改年检信息
      * <p>
      * status 状态(0 待完成;1 已完成;2 超期)
-     * stepStatus  :年检阶段状态- 第一阶段 1-2,第二阶段 3,第三阶段 4-7,第四阶段 8-10
+     * stepStatus  :年检阶段状态- 第一阶段(自检) 1-2,第二阶段(报检) 3,第三阶段(场检) 4-7,第四阶段(确认) 8-10
      * stepName : 当前能操作的阶段
      * <p>
      * 1  维保工确认年检计划
@@ -212,7 +212,7 @@ public class AnnualInspectionController {
         AnnualInspection old = annualInspectionService.findByMtCompanyId(entity.getId(), entity.getMtCompanyId());
         Validate.notNull(old, ValuePool.INSPECTION_NOT_EXIST);
         Integer oldStepName = ValuePool.nullable(old.getStepName(), 1);
-        Validate.equals(oldStepName, ValuePool.INSPECTION_STEP_ONE, ValuePool.inspectionOptionOnStageIllegal("第一阶段"));
+        Validate.equals(oldStepName, ValuePool.INSPECTION_STEP_ONE, ValuePool.inspectionOptionOnStageIllegal(ValuePool.INSPECTION_STEP_ONE_DESC));
         old.setIsCheckGoverner(entity.getIsCheckGoverner());
         old.setLoadInspectionSetting(entity.getLoadInspectionSetting());
 
@@ -234,11 +234,17 @@ public class AnnualInspectionController {
         Integer oldStepName = ValuePool.nullable(old.getStepName(), 1);
         Integer oldStepStatus = ValuePool.nullable(old.getStepStatus(), 2);
         Integer stepStatus = entity.getStepStatus();
-        Validate.equals(oldStepName, ValuePool.INSPECTION_STEP_ONE, ValuePool.inspectionStepToNextIllegal("确认操作", "第一阶段"));
-        Validate.between(oldStepStatus, ValuePool.INSPECTION_STAGE_CONFIRM, ValuePool.INSPECTION_STAGE_SELFCHECK, ValuePool.inspectionCurrentStepStatusIllegal( oldStepStatus, "第一阶段"));
-        Validate.equals(stepStatus, ValuePool.INSPECTION_STAGE_SELFCHECK, ValuePool.inspectionNewStepStatusIllegal(stepStatus, "第一阶段"));
+        Validate.equals(oldStepName, ValuePool.INSPECTION_STEP_ONE, ValuePool.inspectionStepToNextIllegal(ValuePool.INSPECTION_STEP_ZERO_DESC, ValuePool.INSPECTION_STEP_ONE_DESC));
+        Validate.between(oldStepStatus, ValuePool.INSPECTION_STAGE_CONFIRM, ValuePool.INSPECTION_STAGE_SELFCHECK, ValuePool.inspectionCurrentStepStatusIllegal( oldStepStatus, ValuePool.INSPECTION_STEP_ONE_DESC));
+        Validate.equals(stepStatus, ValuePool.INSPECTION_STAGE_SELFCHECK, ValuePool.inspectionNewStepStatusIllegal(stepStatus, ValuePool.INSPECTION_STEP_ONE_DESC));
+
+        String selfcheckReportImg = entity.getSelfcheckReportImg();
+        if (selfcheckReportImg.contains(",")) {
+            int count = selfcheckReportImg.length() - selfcheckReportImg.replace(",", "").length();
+            Validate.notTrue(count > 3, ValuePool.INSPECTION_SELF_CHECK_IMAGE_COUNT);
+        }
 
-        old.setSelfcheckReportImg(entity.getSelfcheckReportImg());
+        old.setSelfcheckReportImg(selfcheckReportImg);
         old.setSelfcheckDate(entity.getSelfcheckDate());
         old.setStepStatus(entity.getStepStatus());
 
@@ -259,8 +265,8 @@ public class AnnualInspectionController {
         Validate.notNull(old, ValuePool.INSPECTION_NOT_EXIST);
         Integer oldStepName = ValuePool.nullable(old.getStepName(), 2);
         Integer oldStepStatus = ValuePool.nullable(old.getStepStatus(), 2);
-        Validate.between(oldStepName, ValuePool.INSPECTION_STEP_ONE,ValuePool.INSPECTION_STEP_TWO, ValuePool.inspectionStepToNextIllegal("第一阶段", "第二阶段"));
-        Validate.between(oldStepStatus, ValuePool.INSPECTION_STAGE_SELFCHECK, ValuePool.INSPECTION_STAGE_CONFIRM_CHECK, ValuePool.inspectionCurrentStepStatusIllegal(oldStepStatus, "第二阶段"));
+        Validate.between(oldStepName, ValuePool.INSPECTION_STEP_ONE,ValuePool.INSPECTION_STEP_TWO, ValuePool.inspectionStepToNextIllegal(ValuePool.INSPECTION_STEP_ONE_DESC, ValuePool.INSPECTION_STEP_TWO_DESC));
+        Validate.between(oldStepStatus, ValuePool.INSPECTION_STAGE_SELFCHECK, ValuePool.INSPECTION_STAGE_CONFIRM_CHECK, ValuePool.inspectionCurrentStepStatusIllegal(oldStepStatus, ValuePool.INSPECTION_STEP_TWO_DESC));
 
         old.setCheckDate(entity.getCheckDate());
         old.setInspector(entity.getInspector());
@@ -314,9 +320,9 @@ public class AnnualInspectionController {
         Integer oldStepName = ValuePool.nullable(old.getStepName(), 2);
         Integer oldStepStatus = ValuePool.nullable(old.getStepStatus(), 3);
         Integer stepStatus = entity.getStepStatus();
-        Validate.between(oldStepName,ValuePool.INSPECTION_STEP_TWO, ValuePool.INSPECTION_STEP_THREE, ValuePool.inspectionStepToNextIllegal("第二阶段", "第三阶段"));
-        Validate.between(oldStepStatus, ValuePool.INSPECTION_STAGE_CONFIRM_CHECK, ValuePool.INSPECTION_STAGE_CHECK_UNQUALIFIED, ValuePool.inspectionCurrentStepStatusIllegal(oldStepStatus, "第三阶段"));
-        Validate.between(stepStatus, ValuePool.INSPECTION_STAGE_UPLOAD_CHECK, ValuePool.INSPECTION_STAGE_CHECK_UNQUALIFIED, ValuePool.inspectionNewStepStatusIllegal(stepStatus, "第三阶段"));
+        Validate.between(oldStepName,ValuePool.INSPECTION_STEP_TWO, ValuePool.INSPECTION_STEP_THREE, ValuePool.inspectionStepToNextIllegal(ValuePool.INSPECTION_STEP_TWO_DESC, ValuePool.INSPECTION_STEP_THREE_DESC));
+        Validate.between(oldStepStatus, ValuePool.INSPECTION_STAGE_CONFIRM_CHECK, ValuePool.INSPECTION_STAGE_CHECK_UNQUALIFIED, ValuePool.inspectionCurrentStepStatusIllegal(oldStepStatus, ValuePool.INSPECTION_STEP_THREE_DESC));
+        Validate.between(stepStatus, ValuePool.INSPECTION_STAGE_UPLOAD_CHECK, ValuePool.INSPECTION_STAGE_CHECK_UNQUALIFIED, ValuePool.inspectionNewStepStatusIllegal(stepStatus, ValuePool.INSPECTION_STEP_THREE_DESC));
         LocalDate oldPlanDate = old.getPlanDate();
         if(Objects.nonNull(oldPlanDate)){
             LocalDate deadline = oldPlanDate.plusDays(DateUtils.daysOfYear());
@@ -352,9 +358,9 @@ public class AnnualInspectionController {
         Integer oldStepName = ValuePool.nullable(old.getStepName(), 3);
         Integer oldStepStatus = ValuePool.nullable(old.getStepStatus(), 5);
         Integer stepStatus = entity.getStepStatus();
-        Validate.between(oldStepName, ValuePool.INSPECTION_STEP_THREE, ValuePool.INSPECTION_STEP_FOUR, ValuePool.inspectionStepToNextIllegal("第三阶段", "第四阶段"));
-        Validate.between(oldStepStatus, ValuePool.INSPECTION_STAGE_CHECK_QUALIFIED, ValuePool.INSPECTION_STAGE_CERT_REPORT_UNQUALIFIED, ValuePool.inspectionCurrentStepStatusIllegal(oldStepStatus, "第四阶段"));
-        Validate.between(stepStatus, ValuePool.INSPECTION_STAGE_UPLOAD_CERT_REPORT, ValuePool.INSPECTION_STAGE_CERT_REPORT_UNQUALIFIED, ValuePool.inspectionNewStepStatusIllegal(stepStatus, "第四阶段"));
+        Validate.between(oldStepName, ValuePool.INSPECTION_STEP_THREE, ValuePool.INSPECTION_STEP_FOUR, ValuePool.inspectionStepToNextIllegal(ValuePool.INSPECTION_STEP_THREE_DESC, ValuePool.INSPECTION_STEP_FOUR_DESC));
+        Validate.between(oldStepStatus, ValuePool.INSPECTION_STAGE_CHECK_QUALIFIED, ValuePool.INSPECTION_STAGE_CERT_REPORT_UNQUALIFIED, ValuePool.inspectionCurrentStepStatusIllegal(oldStepStatus, ValuePool.INSPECTION_STEP_FOUR_DESC));
+        Validate.between(stepStatus, ValuePool.INSPECTION_STAGE_UPLOAD_CERT_REPORT, ValuePool.INSPECTION_STAGE_CERT_REPORT_UNQUALIFIED, ValuePool.inspectionNewStepStatusIllegal(stepStatus, ValuePool.INSPECTION_STEP_FOUR_DESC));
 
         old.setStepStatus(entity.getStepStatus());
         old.setAnnualInspectionImg(entity.getAnnualInspectionImg());
@@ -397,13 +403,19 @@ public class AnnualInspectionController {
         Validate.notNull(entity, ValuePool.INSPECTION_NOT_EXIST);
         //1 判断年检完成状态 0
         Integer status = ValuePool.nullable(entity.getStatus(), 0);
-        Validate.equals(status, ValuePool.INSPECTION_STATUS_TO_DO, ValuePool.inspectionCurrentStepStatusIllegal(status, "上传自检报告"));
+        Validate.equals(status, ValuePool.INSPECTION_STATUS_TO_DO, ValuePool.inspectionCurrentStepStatusIllegal(status, ValuePool.INSPECTION_STEP_ONE_DESC));
         //2 判断年检阶段状态 1
         Integer stepName = ValuePool.nullable(entity.getStepName(), 1);
-        Validate.equals(stepName, ValuePool.INSPECTION_STEP_ONE, ValuePool.inspectionCurrentStepStatusIllegal(stepName, "上传自检报告"));
+        Validate.equals(stepName, ValuePool.INSPECTION_STEP_ONE, ValuePool.inspectionCurrentStepStatusIllegal(stepName, ValuePool.INSPECTION_STEP_ONE_DESC));
+
+        String selfcheckReportImg = request.getSelfcheckReportImg();
+        if (selfcheckReportImg.contains(",")) {
+            int count = selfcheckReportImg.length() - selfcheckReportImg.replace(",", "").length();
+            Validate.notTrue(count > 3, ValuePool.INSPECTION_SELF_CHECK_IMAGE_COUNT);
+        }
 
         entity.setSelfcheckDate(request.getSelfcheckDate());
-        entity.setSelfcheckReportImg(request.getSelfcheckReportImg());
+        entity.setSelfcheckReportImg(selfcheckReportImg);
         entity.setStepStatus(ValuePool.INSPECTION_STAGE_SELFCHECK);
         entity.setStepName(ValuePool.INSPECTION_STEP_ONE);
 
@@ -424,10 +436,10 @@ public class AnnualInspectionController {
         Validate.notNull(entity, ValuePool.INSPECTION_NOT_EXIST);
         //1 判断年检完成状态 0
         Integer status = ValuePool.nullable(entity.getStatus(), 0);
-        Validate.equals(status, ValuePool.INSPECTION_STATUS_TO_DO, ValuePool.inspectionCurrentStepStatusIllegal(status, "上传检验结果"));
+        Validate.equals(status, ValuePool.INSPECTION_STATUS_TO_DO, ValuePool.inspectionCurrentStepStatusIllegal(status, ValuePool.INSPECTION_STEP_THREE_DESC));
         //2 判断年检阶段状态 3
         Integer stepName = ValuePool.nullable(entity.getStepName(), 3);
-        Validate.equals(stepName, ValuePool.INSPECTION_STEP_THREE, ValuePool.inspectionCurrentStepStatusIllegal(stepName, "上传检验结果"));
+        Validate.equals(stepName, ValuePool.INSPECTION_STEP_THREE, ValuePool.inspectionCurrentStepStatusIllegal(stepName, ValuePool.INSPECTION_STEP_THREE_DESC));
 
         entity.setCheckDate(request.getCheckDate());
         entity.setCheckResultImg(request.getCheckResultImg());
@@ -451,10 +463,10 @@ public class AnnualInspectionController {
         Validate.notNull(entity, ValuePool.INSPECTION_NOT_EXIST);
         //1 判断年检完成状态 0
         Integer status = ValuePool.nullable(entity.getStatus(), 0);
-        Validate.equals(status, ValuePool.INSPECTION_STATUS_TO_DO, ValuePool.inspectionCurrentStepStatusIllegal(status, "上传年检报告和合格证"));
+        Validate.equals(status, ValuePool.INSPECTION_STATUS_TO_DO, ValuePool.inspectionCurrentStepStatusIllegal(status, ValuePool.INSPECTION_STEP_FOUR_DESC));
         //2 判断年检阶段状态 4
         Integer stepName = ValuePool.nullable(entity.getStepName(), 4);
-        Validate.equals(stepName, ValuePool.INSPECTION_STEP_FOUR, ValuePool.inspectionCurrentStepStatusIllegal(stepName, "上传年检报告和合格证"));
+        Validate.equals(stepName, ValuePool.INSPECTION_STEP_FOUR, ValuePool.inspectionCurrentStepStatusIllegal(stepName, ValuePool.INSPECTION_STEP_FOUR_DESC));
 
         entity.setCertificateImgUrl(request.getCertificateImgUrl());
         entity.setAnnualInspectionImg(request.getAnnualInspectionImg());
@@ -514,7 +526,17 @@ public class AnnualInspectionController {
                 registrationCode = StrUtil.isNotEmpty(registrationCode) ? registrationCode.replace(illegalChars,"-") : "[电梯注册代码]";
                 //图片文件夹 dir/i.AreaName-ProjectName-RegistrationCode/
                 String imgDir = StrUtil.format("{}{}{}.{}-{}-{}{}", dir, File.separator, (i + 1), areaName, projectName, registrationCode, File.separator);
-                downloadImage(ins.getSelfcheckReportImg(), imgDir, "1.自检报告.jpg");
+                String selfcheckReportImg = ins.getSelfcheckReportImg();
+                if (Objects.nonNull(selfcheckReportImg)) {
+                    if (selfcheckReportImg.contains(",")) {
+                        String[] imgs = selfcheckReportImg.split(",");
+                        for (int num = 0; num < imgs.length; num++) {
+                            downloadImage(imgs[num], imgDir, "1.自检报告 "+ (num + 1) +".jpg");
+                        }
+                    } else {
+                        downloadImage(selfcheckReportImg, imgDir, "1.自检报告.jpg");
+                    }
+                }
                 downloadImage(ins.getCheckResultImg(), imgDir, "2.检验结果.jpg");
                 downloadImage(ins.getCertificateImgUrl(), imgDir, "3.合格证.jpg");
                 downloadImage(ins.getAnnualInspectionImg(), imgDir, "4.年检报告.jpg");

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/common/CommonController.java

@@ -87,7 +87,7 @@ public class CommonController {
     @PostMapping("uploads")
     public RestResponse uploads(@RequestParam("files") MultipartFile[] files) {
         Validate.notTrue(ArrayUtil.isEmpty(files), ValuePool.UPLOAD_DATA_MISSING);
-        Map<String, MultipartFile> fileMap = new HashMap<>();
+        Map<String, MultipartFile> fileMap = new LinkedHashMap<>();
         //1 先解析文件格式
         for (MultipartFile file : files) {
             String fileName = handleFile(file);

+ 10 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/controller/EmergencyRepairController.java

@@ -300,6 +300,11 @@ public class EmergencyRepairController {
     @PostMapping("pageWorker")
     @Validation(fields = {"mtCompanyId", "workerId"})
     public RestResponse pageWorker(@Val @RequestBody RepairRequest request) {
+        if (Objects.equals(ValuePool.EMERGENCY_STATE_COMPLETE, request.getStatus())) {
+            request.addDesc("recovery_date");
+        }else{
+            request.addDesc("assign_time");
+        }
         IPage<RepairResponse> pages = emergencyRepairService.pageByCondition(request);
         return RestResponse.success(pages);
     }
@@ -380,6 +385,11 @@ public class EmergencyRepairController {
     @PostMapping("pageByUser")
     @Validation(fields = {"userId"})
     public RestResponse pageByUser(@Val @RequestBody RepairRequest request) {
+        if (Objects.equals(ValuePool.EMERGENCY_STATE_COMPLETE, request.getStatus())) {
+            request.addDesc("recovery_date");
+        }else{
+            request.addDesc("assign_time");
+        }
         IPage<RepairResponse> pages = emergencyRepairService.pageByUser(request);
         return RestResponse.success(pages);
     }

+ 4 - 4
lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/dto/RepairRequest.java

@@ -88,7 +88,7 @@ public class RepairRequest extends PageRequest {
      * 接单时间 app端维保工确认
      */
     @NotNull(message = "缺少接单时间")
-    @PastOrPresent(message = "接单时间不能早于标准北京时间")
+//    @PastOrPresent(message = "接单时间不能早于标准北京时间")
     private LocalDateTime takingTime;
 
     /**
@@ -96,14 +96,14 @@ public class RepairRequest extends PageRequest {
      * 到达时间 app端维保工打卡
      */
     @NotNull(message = "缺少到达时间")
-    @PastOrPresent(message = "到达时间不能早于标准北京时间")
+//    @PastOrPresent(message = "到达时间不能早于标准北京时间")
     private LocalDateTime arriveTime;
 
     /**
      * 停梯时间
      */
     @NotNull(message = "缺少停梯时间")
-    @PastOrPresent(message = "停梯时间不能早于标准北京时间")
+//    @PastOrPresent(message = "停梯时间不能早于标准北京时间")
     private LocalDateTime stopDate;
 
     /**
@@ -177,7 +177,7 @@ public class RepairRequest extends PageRequest {
      * 恢复时间
      */
     @NotNull(message = "缺少恢复时间")
-    @PastOrPresent(message = "恢复时间不得早于标准北京时间")
+//    @PastOrPresent(message = "恢复时间不得早于标准北京时间")
     private LocalDateTime recoveryDate;
 
     /**

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

@@ -3,6 +3,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.PropertyMtResponse;
 import cn.com.ty.lift.business.maintenance.dao.mapper.PropertyMaintenanceMapper;
+import cn.com.ty.lift.business.maintenance.service.PropertyMaintenanceService;
 import cn.com.ty.lift.common.constants.ApiConstants;
 import cn.com.xwy.boot.web.dto.RestResponse;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("property")
 public class PropertyMaintenanceController {
     private final PropertyMaintenanceMapper propertyMaintenanceMapper;
+    private final PropertyMaintenanceService propertyMaintenanceService;
 
     @PostMapping("maintenance")
     public RestResponse maintenance(@RequestBody PropertyMaintenanceVO propertyMaintenanceVO) {
@@ -55,4 +57,9 @@ public class PropertyMaintenanceController {
                         propertyMaintenanceVO.getUserId());
         return page;
     }
+
+    @PostMapping("maintenance/num/month")
+    public RestResponse<?> maintenanceNumForMonth(@RequestBody PropertyMaintenanceVO propertyMaintenanceVO) {
+        return propertyMaintenanceService.queryMaintenancePlanMonth(propertyMaintenanceVO);
+    }
 }

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/dto/MaintenancePlanMonthTaskNum.java

@@ -4,7 +4,7 @@ import lombok.Data;
 
 @Data
 public class MaintenancePlanMonthTaskNum {
-    private Integer month;
+    private Integer day;
     private Integer status;
     private Integer count;
 }

+ 1 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/request/MtPlanRequest.java

@@ -58,4 +58,5 @@ public class MtPlanRequest extends PageRequest {
      */
     @Min(value = 1, message = "维保公司ID有误")
     private Long mtCompanyId;
+
 }

+ 5 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/dao/entity/model/request/PropertyMaintenanceVO.java

@@ -28,4 +28,9 @@ public class PropertyMaintenanceVO {
      */
     private Long pageNum = 1L;
     private Long pageSize = 10L;
+
+    /**
+     * 年月  例 202005  2020年5月
+     */
+    private String yearMonth;
 }

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

@@ -0,0 +1,19 @@
+package cn.com.ty.lift.business.maintenance.dao.entity.model.response;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class PropertyCalendarResponse {
+    private Integer key;
+    private List<Values> value = new ArrayList<>();
+
+    @Data
+    public static class Values {
+        private Integer key;
+        private Integer value;
+    }
+}
+

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

@@ -0,0 +1,81 @@
+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.PropertyCalendarResponse;
+import cn.com.ty.lift.business.maintenance.dao.mapper.PropertyMaintenanceMapper;
+import cn.com.xwy.boot.web.dto.RestResponse;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+@AllArgsConstructor
+@Slf4j
+public class PropertyMaintenanceService {
+    private final PropertyMaintenanceMapper propertyMaintenanceMapper;
+
+    /**
+     * @param propertyMaintenanceVO userId用户id,yearMonth年月 例202005即2020年5月
+     * @return 日历
+     */
+    public RestResponse<?> queryMaintenancePlanMonth(PropertyMaintenanceVO propertyMaintenanceVO) {
+        List<MaintenancePlanMonthTaskNum> planNums = propertyMaintenanceMapper.queryMaintenancePlanMonth(propertyMaintenanceVO.getUserId(), propertyMaintenanceVO.getYearMonth());
+        if (planNums.isEmpty()) {
+            return RestResponse.success();
+        }
+        log.info(planNums.toString());
+        List<PropertyCalendarResponse> calendar = new ArrayList<>();
+        //循环每日,每种状态的维保计划
+        for (MaintenancePlanMonthTaskNum planNum : planNums) {
+            numToCalendar(calendar, planNum);
+        }
+        return RestResponse.success(calendar);
+    }
+
+    /**
+     * 维保计划每日每个状态的数量转前端日历所需格式
+     *
+     * @param calendar 日历
+     * @param planNum  计划数量
+     */
+    private void numToCalendar(List<PropertyCalendarResponse> calendar, MaintenancePlanMonthTaskNum planNum) {
+        boolean hasDay = false;
+        boolean hasStatus = false;
+        //遍历每日
+        for (PropertyCalendarResponse day : calendar) {
+            if (day.getKey().equals(planNum.getDay())) {
+                hasDay = true;
+                //遍历每日的每个状态
+                for (PropertyCalendarResponse.Values status : day.getValue()) {
+                    if (status.getKey().equals(planNum.getStatus())) {
+                        hasStatus = true;
+                        status.setValue(planNum.getCount());
+                    }
+                }
+                //如果遍历到的日期,没有这个状态,新增这个状态
+                if (!hasStatus) {
+                    PropertyCalendarResponse.Values status = new PropertyCalendarResponse.Values();
+                    status.setKey(planNum.getStatus());
+                    status.setValue(planNum.getCount());
+                    day.getValue().add(status);
+                }
+            }
+        }
+        //如果日历中没有这个日期,新增这个日期
+        if (!hasDay) {
+            PropertyCalendarResponse day = new PropertyCalendarResponse();
+            day.setKey(planNum.getDay());
+            List<PropertyCalendarResponse.Values> statuses = day.getValue();
+            PropertyCalendarResponse.Values status = new PropertyCalendarResponse.Values();
+            status.setKey(planNum.getStatus());
+            status.setValue(planNum.getCount());
+            statuses.add(status);
+            day.setValue(statuses);
+            calendar.add(day);
+        }
+    }
+}

+ 4 - 4
lift-common/src/main/java/cn.com.ty.lift.common/constants/ApiConstants.java

@@ -419,10 +419,10 @@ public class ApiConstants {
 
         //物管,根据用户id和月份,查询那一月每天的(待保养/保养中/已完成/计划超期/法规超期)的数量
         String QUERY_MAINTENANCE_PLAN_MONTH_TASK_NUM =
-                "select DATE_FORMAT(plan_date, '%m') month, status, count(status) count" +
-                        "from maintenance_plan" +
-                        "where project_id in (select project_id from project_user where user_id = #{userId})" +
+                "select DATE_FORMAT(plan_date, '%d') day, status, count(status) count" +
+                        "   from maintenance_plan" +
+                        "   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";
+                        "   group by plan_date, status";
     }
 }

+ 6 - 0
lift-common/src/main/java/cn.com.ty.lift.common/utils/ValuePool.java

@@ -129,6 +129,11 @@ public interface ValuePool {
      * 年检 第一阶段
      */
     int    INSPECTION_STEP_ONE                      = 1;
+    String INSPECTION_STEP_ZERO_DESC                = "确认操作";
+    String INSPECTION_STEP_ONE_DESC                 = "自检阶段";
+    String INSPECTION_STEP_TWO_DESC                 = "报检阶段";
+    String INSPECTION_STEP_THREE_DESC               = "场检阶段";
+    String INSPECTION_STEP_FOUR_DESC                = "确认阶段";
     /**
      * 年检 第二阶段
      */
@@ -185,6 +190,7 @@ public interface ValuePool {
     int    INSPECTION_STAGE_CERT_REPORT_UNQUALIFIED = 10;
     String INSPECTION_NOT_EXIST                     = "年检不存在,请确认年检计划";
     String INSPECTION_EXIST_SAME                    = "年检计划已存在。";
+    String INSPECTION_SELF_CHECK_IMAGE_COUNT        = "自检图片不得超过三张。";
     LocalDate INSPECTION_MIN_PLAN_DATE = LocalDate.of(1970,1,1);
 
     static String inspectionStepToNextIllegal(String previous, String current) {

+ 1 - 0
lift-push/src/main/java/cn/com/ty/lift/push/app/PushConsumer.java

@@ -152,6 +152,7 @@ public class PushConsumer {
                 case "急修消息":
                     timeMessage.setType(3);
                     break;
+                case "提醒":
                 case "工作消息":
                     timeMessage.setType(4);
                     break;

+ 1 - 1
lift-upload/src/main/java/com/upload/controller/UploadController.java

@@ -39,7 +39,7 @@ public class UploadController {
     @PostMapping("uploads")
     public RestResponse uploads(@RequestParam("files") MultipartFile[] files) {
         Validate.notTrue(ArrayUtil.isEmpty(files), ValuePool.UPLOAD_DATA_MISSING);
-        Map<String, MultipartFile> fileMap = new HashMap<>();
+        Map<String, MultipartFile> fileMap = new LinkedHashMap<>();
         //1 先解析文件格式
         for (MultipartFile file : files) {
             String fileName = handleFile(file);