瀏覽代碼

筹建优化

guarantee-lsq 1 年之前
父節點
當前提交
4cad0d6c19

+ 1 - 1
platform-dao/src/main/resources/mapper/preparation/PreparationMapper.xml

@@ -170,7 +170,7 @@
         </where>
     </select>
 
-    <select id="getCountByUserId" resultType="Integer"
+    <select id="getCountByUserId" resultType="com.platform.dao.vo.query.preparation.PreparationVO"
     parameterType="com.platform.dao.dto.preparation.PreparationDTO">
         select status, count(1) counts from t_preparation
         <where>

+ 5 - 0
platform-rest/src/main/java/com/platform/rest/controller/preparation/PreparationController.java

@@ -115,6 +115,11 @@ public class PreparationController {
     return new R<>(preparationService.selectPageList(preparationDTO, pageNum, pageSize));
   }
 
+  @GetMapping("/page/wechat")
+  public R<AbstractPageResultBean<PreparationVO>> queryWechat(PreparationDTO preparationDTO, @RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "20") int pageSize) {
+    return new R<>(preparationService.selectWechatPageList(preparationDTO, pageNum, pageSize));
+  }
+
   /**
    * 获取列表
    *

+ 20 - 8
platform-service/src/main/java/com/platform/service/preparation/PreparationService.java

@@ -22,19 +22,20 @@ import java.util.List;
 public interface PreparationService extends IBaseService<Preparation, PreparationDTO> {
     List<PreparationReportByStatusVO> getPreparationReportGroupByStatus(PreparationDTO dto, Integer year, LocalDate startMonth, LocalDate endMonth);
 
- List<AllPreparationReportVO> getAllPreparationReport(PreparationDTO dto, Integer year, LocalDate startMonth, LocalDate endMonth);
+    List<AllPreparationReportVO> getAllPreparationReport(PreparationDTO dto, Integer year, LocalDate startMonth, LocalDate endMonth);
 
 
- /**
-    * 批量删除
-    *
-    * @param ids :
-    * @return :
-    */
+    /**
+     * 批量删除
+     *
+     * @param ids :
+     * @return :
+     */
     int batchDelete(List<String> ids);
 
     /**
      * 分页查询
+     *
      * @param record
      * @param pageNum
      * @param pageSize
@@ -44,6 +45,7 @@ public interface PreparationService extends IBaseService<Preparation, Preparatio
 
     /**
      * 报修生成任务
+     *
      * @param model
      * @return
      */
@@ -51,16 +53,26 @@ public interface PreparationService extends IBaseService<Preparation, Preparatio
 
     /**
      * 主管派工
+     *
      * @param model
      */
     void dispatchPreparation(PreparationDTO model);
 
     /**
      * 完成筹建维修
+     *
      * @param model
      */
     void completePreparation(PreparationDTO model);
 
     PreparationVO getVOById(String id);
 
-                                                                                                                                                                                                                                                                            }
+    /**
+     * 手机端分页数据
+     * @param record
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    AbstractPageResultBean<PreparationVO> selectWechatPageList(PreparationDTO record, int pageNum, int pageSize);
+}

+ 11 - 0
platform-service/src/main/java/com/platform/service/preparation/impl/PreparationServiceImpl.java

@@ -390,6 +390,17 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
         return vo;
     }
 
+    @Override
+    public AbstractPageResultBean<PreparationVO> selectWechatPageList(PreparationDTO record, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        UserInfo userInfo = SecurityUtils.getUserInfo();
+        record.setTempUserId(userInfo.getUserId());
+        if(record.getStatus() != null && record.getStatus() == -1){
+            record.setStatus(null);
+        }
+        return new MyPage(mapper.selectList(record));
+    }
+
     private String getParentPositionId(String positionId){
         SbPosition sbPosition = sbPositionMapper.selectByPrimaryKey(positionId);
         while(!StringUtils.isEmpty(sbPosition.getParentId())){

+ 22 - 28
platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java

@@ -327,30 +327,31 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
         }
         return noticeNumberVO;
     }
-    private  NoticeNumberVO addPrepationNums(NoticeNumberVO noticeNumberVO,PreparationDTO preparationDTO){
+    private void addPrepationNums(NoticeNumberVO noticeNumberVO,PreparationDTO preparationDTO){
         List<PreparationVO> preparationVOS = preparationMapper.getCountByUserId(preparationDTO);
-        for (PreparationVO vo:preparationVOS){
-            if (vo.getStatus()==1){
-                //待修
+        for (PreparationVO vo : preparationVOS){
+            if (vo.getStatus() == 1){
+                // 待修
                 noticeNumberVO.setNotDealNum(vo.getCounts()==null?initNum:vo.getCounts());
-            }else if (vo.getStatus()==2){
-                //维修中
+            }else if (vo.getStatus() == 2){
+                // 维修中
                 noticeNumberVO.setYesDealNum(vo.getCounts()==null?initNum:vo.getCounts());
             }
-            else if (vo.getStatus()==3){
-                //待验收
-                noticeNumberVO.setNotAcceptancedNum(vo.getCounts()==null?initNum:vo.getCounts());
+            else if (vo.getStatus() == 3){
+                // 已完成
+                noticeNumberVO.setFinishNum(vo.getCounts() == null ? initNum : vo.getCounts());
+                //noticeNumberVO.setNotAcceptancedNum(vo.getCounts()==null?initNum:vo.getCounts());
             }
-            else if (vo.getStatus()==4){
+            /*else if (vo.getStatus()==4){
                 //驳回
                 noticeNumberVO.setReturnNum(vo.getCounts()==null?initNum:vo.getCounts());
             }
             else if (vo.getStatus()==5){
                 //已完成
                 noticeNumberVO.setFinishNum(vo.getCounts()==null?initNum:vo.getCounts());
-            }
+            }*/
         }
-        return null;
+        noticeNumberVO.setReturnNum(noticeNumberVO.getNotDealNum().add(noticeNumberVO.getYesDealNum()).add(noticeNumberVO.getFinishNum()));
     }
     @Override
     public NoticeNumberVO getNoticeNumberVO() {
@@ -366,7 +367,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
         StringBuffer sb=new StringBuffer();
         CheckJobDTO checkJobDTO=new CheckJobDTO();
         checkJobDTO.setType(2);
-        //先统计待接单(NOT_ALLOCATED(1))数量,所有人都能看到
+        // 先统计待接单(NOT_ALLOCATED(1))数量,所有人都能看到
         repairApplicationFormDTO.setStatus(RepairApplicationFormStatusEnum.NOT_ALLOCATED.getValue());
         repairApplicationFormVOS= mapper.getRepairCount(repairApplicationFormDTO);
         repairApplicationFormDTO=new RepairApplicationFormDTO();
@@ -375,7 +376,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
                 noticeNumberVO.setWaitForReceiveNum(vo.getRepairCount());
             }
         }
-        if(userInfo.getSuperAdmin()==1){//超级管理员
+        if(userInfo.getSuperAdmin()==1){ //超级管理员
             noticeNumberVO.setRoleFlag(0);
             repairApplicationFormVOS= mapper.getRepairCount(null);
             checkJobVOS=checkJobMapper.getCheckJobCount1(checkJobDTO);
@@ -480,7 +481,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
                 noticeNumberVO.setRoleFlag(4);
                 noticeNumberVO=addStoreNums(noticeNumberVO,inStoreFormDTO,outStoreFormDTO,storeCheckJobDTO);
             }
-            else if (sb.toString().contains(SysRoleCodeEnum.PREPARATION_MANAGER.name())){
+            /*else if (sb.toString().contains(SysRoleCodeEnum.PREPARATION_MANAGER.name())){
                 //筹建主管-- dispatchUserId
                 noticeNumberVO.setRoleFlag(8);
                 PreparationDTO preparationDTO = new PreparationDTO();
@@ -493,20 +494,13 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
                 PreparationDTO preparationDTO = new PreparationDTO();
                 preparationDTO.setRepairUserId(userInfo.getUserId());
                 addPrepationNums(noticeNumberVO,preparationDTO);
-            }
+            }*/
         }
-
-        //待办
-        //待签收
-//        MyPage<ActApplyInfo> myPage = (MyPage<ActApplyInfo>)(activitiController.showTaskListClaim(1,10).getData());
-//        noticeNumberVO.setWaitForSignInNum(new BigDecimal(myPage.getTotal()));
-//        //待审批
-//        MyPage<ActApplyInfo> myPage1=(MyPage<ActApplyInfo>)(activitiController.showTaskList(1,10).getData());
-//        noticeNumberVO.setWaitForExamineNum(new BigDecimal(myPage1.getTotal()));
-//        //通知
-////        BigDecimal num=workplaceBacklogMapper.getWorkplaceBacklogCount("1");
-        BigDecimal num=workplaceBacklogMapper.getWorkplaceBacklogCount(userInfo.getUserId());
-        Long t2=System.currentTimeMillis();
+        // 筹建统计数据,不区分角色
+        PreparationDTO preparationDTO = new PreparationDTO();
+        addPrepationNums(noticeNumberVO,preparationDTO);
+        // 通知
+        BigDecimal num = workplaceBacklogMapper.getWorkplaceBacklogCount(userInfo.getUserId());
         noticeNumberVO.setUnreadNum(num);
         return noticeNumberVO;
     }