xiongchao 3 жил өмнө
parent
commit
307877ba3d

+ 3 - 3
platform-dao/src/main/java/com/platform/dao/enums/RepairApplicationFormStatusEnum.java

@@ -17,11 +17,11 @@ public enum RepairApplicationFormStatusEnum {
      */
     NOT_ALLOCATED(1),
     /**
-     * 已分配
+     * 待接收
      */
     ALLOCATED(2),
     /**
-     * 已接收处理
+     * 维修
      */
     PROCESSING(3),
     /**
@@ -37,7 +37,7 @@ public enum RepairApplicationFormStatusEnum {
      */
     REBACK(5),
     /**
-     * 已关闭
+     * 	已完成
      */
     FINISHED(6);
     private final Integer value;

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/enums/WorkplaceBacklogDetailTypeEnum.java

@@ -24,7 +24,7 @@ public enum WorkplaceBacklogDetailTypeEnum {
     REPAIR_BACK(5, "维修驳回通知"),
     REPAIR_OK(6, "维修结束通知"),
     REPAIR_RECEIVE(23, "维修接收通知"),
-    REPAIR_EXAMINE(24, "维修关闭审核通知"),
+    REPAIR_EXAMINE(24, "维修审核通知"),
     CHECK_RUN_EXPIRE(7, "润滑任务过期通知"),
     CHECK_BAOYANG_EXPIRE(8, "保养任务过期通知"),
 

+ 5 - 0
platform-dao/src/main/java/com/platform/dao/vo/index/GatherTaskVO.java

@@ -38,4 +38,9 @@ public class GatherTaskVO extends BaseVO implements Serializable {
      */
     private Integer repairTask;
 
+    /**
+     * 维修验收任务
+     */
+    private Integer repairCheckTask;
+
 }

+ 4 - 1
platform-rest/src/main/java/com/platform/rest/controller/index/IndexController.java

@@ -49,8 +49,11 @@ public class IndexController {
         int oilTask = sbOilService.countUserTask(userInfo.getUserId());
         // 维修任务
         int repairTask = repairApplicationFormService.countUserTask(userInfo.getUserId());
+
+        // 维修任务
+        int repairCheckTask = repairApplicationFormService.countUserCheckTask(userInfo.getUserId());
         return R.success(new GatherTaskVO().setMaintainTask(maintainTask)
-                .setLubricationTask(lubricationTask).setOilTask(oilTask).setRepairTask(repairTask));
+                .setLubricationTask(lubricationTask).setOilTask(oilTask).setRepairTask(repairTask).setRepairCheckTask(repairCheckTask));
     }
 
 }

+ 11 - 4
platform-rest/src/main/java/com/platform/rest/controller/mobile/IgnoreController.java

@@ -85,11 +85,18 @@ public class IgnoreController {
      */
     @GetMapping("/sb/task/{sbId}")
     public R getSbTaskUser(@PathVariable("sbId") String sbId) {
-        // 保养任务:根据类型查询,1:设备的、设备使用人的,2:设备维修人的任务
-        int lubricationTask = checkJobService.countSbTask(sbId, CheckStandardTypeEnum.POLLING.getValue(), CheckJobStatusEnum.NOT_EXECUTE.getValue(),1);
+        // 保养任务:根据类型查询,1:设备的、设备使用人的,未完成的,已过期的
+        List<Integer> checkStatusList = new ArrayList<Integer>();
+        checkStatusList.add(CheckJobStatusEnum.NOT_EXECUTE.getValue());
+        checkStatusList.add(CheckJobStatusEnum.EXECUTING.getValue());
+        checkStatusList.add(CheckJobStatusEnum.OUT_OF_DATE.getValue());
+        int lubricationTask = checkJobService.countSbTask(sbId, CheckStandardTypeEnum.POLLING.getValue(), checkStatusList,1);
 
-        // 维修任务:所有的
-        int repairTask = repairApplicationFormService.countSbTask(sbId, new ArrayList<Integer>());
+        // 维修任务:所有的未完成的
+        List<Integer> repairStatusList = new ArrayList<Integer>();
+        repairStatusList.add(RepairApplicationFormStatusEnum.NOT_ALLOCATED.getValue());
+        repairStatusList.add(RepairApplicationFormStatusEnum.PROCESSING.getValue());
+        int repairTask = repairApplicationFormService.countSbTask(sbId, repairStatusList);
         return R.success(new GatherTaskVO().setLubricationTask(lubricationTask).setRepairTask(repairTask));
     }
 

+ 1 - 1
platform-service/src/main/java/com/platform/service/check/CheckJobService.java

@@ -103,7 +103,7 @@ public interface CheckJobService extends IBaseService<CheckJob, CheckJobDTO> {
      *  @param searchType   :1:使用人员,2维修人员,3全部任务
      * @return :
      */
-    int countSbTask(String sbId, Integer type, Integer status, Integer searchType);
+    int countSbTask(String sbId, Integer type, List<Integer>  status, Integer searchType);
 
     void executeJobBatch(List<String> ids);
 

+ 2 - 2
platform-service/src/main/java/com/platform/service/check/impl/CheckJobServiceImpl.java

@@ -746,7 +746,7 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
     }
 
     @Override
-    public int countSbTask(String sbId, Integer type, Integer status, Integer searchType) {
+    public int countSbTask(String sbId, Integer type, List<Integer> status, Integer searchType) {
         Weekend<CheckJob> weekend = new Weekend<>(CheckJob.class);
         WeekendCriteria<CheckJob, Object> weekendCriteria = weekend.weekendCriteria();
         weekendCriteria.andEqualTo(CheckJob::getSbId, sbId);
@@ -762,7 +762,7 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
             }
         }
         if(status !=null){
-            weekendCriteria.andEqualTo(CheckJob::getStatus, status);
+            weekendCriteria.andIn(CheckJob::getStatus, status);
         }
         return mapper.selectCountByExample(weekend);
     }

+ 1 - 0
platform-service/src/main/java/com/platform/service/repair/RepairApplicationFormService.java

@@ -111,4 +111,5 @@ public interface RepairApplicationFormService extends IBaseService<RepairApplica
 
     void examine(String id);
 
+    int countUserCheckTask(String userId);
 }

+ 23 - 4
platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java

@@ -466,8 +466,6 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
 
         // 1. 将维修单的状态修改已完成
         RepairApplicationForm applicationForm = mapper.selectById(dto.getId());
-        RepairForm repairForm = new RepairForm();
-        repairForm.setId(dto.getId());
         applicationForm.setStatus(RepairApplicationFormStatusEnum.WAIT_SUBMIT.getValue());
 
         // 驳回重新完成的,不用更新这个时间,驳回应该状态是完成待审核,不需要重新维修
@@ -566,7 +564,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
             domain = domain + "/";
         }
         String repairUrl = domain + "repair/application/form/check?no=" + applicationForm.getNo();
-        SpringContextHolder.publishEvent(new WorkplaceBacklogEvent(WorkplaceBacklogTypeEnum.RECEIVE.getValue(), WorkplaceBacklogDetailTypeEnum.REPAIR_EXAMINE.getValue(),
+        SpringContextHolder.publishEvent(new WorkplaceBacklogEvent(WorkplaceBacklogTypeEnum.REPAIR.getValue(), WorkplaceBacklogDetailTypeEnum.REPAIR_EXAMINE.getValue(),
                 applicationForm.getId(), MessageTemplateUtil.getFreemarkerHtmlContentCheck(repairUrl,BeanConverterUtil.copyObjectProperties(applicationForm, RepairApplicationFormDTO.class), sbInfoVO),
                 applicationForm.getId(), ListUtils.newArrayList(userVO.getUserId()), ListUtils.newArrayList(userVO.getEmail())));
     }
@@ -609,7 +607,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
                 domain = domain + "/";
             }
             String repairUrl = domain + "repair/application/form/check?no=" + applicationForm.getNo();
-            SpringContextHolder.publishEvent(new WorkplaceBacklogEvent(WorkplaceBacklogTypeEnum.RECEIVE.getValue(), WorkplaceBacklogDetailTypeEnum.REPAIR_EXAMINE.getValue(),
+            SpringContextHolder.publishEvent(new WorkplaceBacklogEvent(WorkplaceBacklogTypeEnum.REPAIR.getValue(), WorkplaceBacklogDetailTypeEnum.REPAIR_EXAMINE.getValue(),
                     applicationForm.getId(), MessageTemplateUtil.getFreemarkerHtmlContentCheck(repairUrl,BeanConverterUtil.copyObjectProperties(applicationForm, RepairApplicationFormDTO.class), BeanConverterUtil.copyObjectProperties(info, SbInfoVO.class)),
                     applicationForm.getId(), ListUtils.newArrayList(userVO.getUserId()), ListUtils.newArrayList(userVO.getEmail())));
         }else{
@@ -640,10 +638,31 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
                 applicationForm.getId(), ListUtils.newArrayList(applicationForm.getRepairUserId()), ListUtils.newArrayList(noticeUser.getEmail())));
     }
 
+    /**
+     * 维修任务:未完成的
+     *
+     * @param userId :
+     * @return
+     */
     @Override
     public int countUserTask(String userId) {
         Weekend<RepairApplicationForm> weekend = new Weekend<>(RepairApplicationForm.class);
         weekend.weekendCriteria().andEqualTo(RepairApplicationForm::getRepairUserId, userId);
+        List<Integer> repairStatusList = new ArrayList<Integer>();
+        repairStatusList.add(RepairApplicationFormStatusEnum.NOT_ALLOCATED.getValue());
+        repairStatusList.add(RepairApplicationFormStatusEnum.ALLOCATED.getValue());
+        repairStatusList.add(RepairApplicationFormStatusEnum.PROCESSING.getValue());
+        weekend.weekendCriteria().andIn(RepairApplicationForm::getStatus, repairStatusList);
+        return mapper.selectCountByExample(weekend);
+    }
+
+    @Override
+    public int countUserCheckTask(String userId) {
+        Weekend<RepairApplicationForm> weekend = new Weekend<>(RepairApplicationForm.class);
+        weekend.weekendCriteria().andEqualTo(RepairApplicationForm::getCheckUserId, userId);
+        List<Integer> repairStatusList = new ArrayList<Integer>();
+        repairStatusList.add(RepairApplicationFormStatusEnum.NOT_ACCEPTANCE.getValue());
+        weekend.weekendCriteria().andIn(RepairApplicationForm::getStatus, repairStatusList);
         return mapper.selectCountByExample(weekend);
     }