ソースを参照

Merge remote-tracking branch 'origin/demo_' into demo_

1 年間 前
コミット
a6bd00ce6d

+ 18 - 0
platform-dao/src/main/java/com/platform/dao/dto/preparation/PreparationRecordDTO.java

@@ -42,4 +42,22 @@ public class PreparationRecordDTO extends BaseDTO implements Serializable {
      */
     private Integer type;
 
+    /**
+     * 创建时间开始
+     */
+    private String createdTimeStart;
+    /**
+     * 创建时间结束
+     */
+    private String createdTimeEnd;
+
+    /**
+     * 创建时间开始
+     */
+    private String updateTimeStart;
+    /**
+     * 创建时间结束
+     */
+    private String updateTimeEnd;
+
 }

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/vo/query/preparation/PreparationRecordVO.java

@@ -23,7 +23,7 @@ public class PreparationRecordVO extends BaseVO implements Serializable {
      */
     private String preparationId;
     /**
-     * 操作人
+     * 操作人 - 审核人
      */
     private String realName;
 

+ 6 - 0
platform-dao/src/main/java/com/platform/dao/vo/query/preparation/PreparationVO.java

@@ -182,4 +182,10 @@ public class PreparationVO extends BaseVO implements Serializable {
      */
     private String receiveVerifyLeader;
 
+    private String receiveDeptName;
+    private String applyVerifyLeaderName;
+    private String receiveVerifyLeaderName;
+
+    private List<PreparationRecordVO> recordList;
+
 }

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

@@ -156,8 +156,9 @@
             </foreach>
         </if>
         <if test="tempUserId != null and tempUserId != ''">
-            and (preparation.user_id = #{tempUserId} or preparation.dispatch_user_id = #{tempUserId}
-            or preparation.repair_user_id = #{tempUserId} or preparation.apply_verify_user_id = #{tempUserId})
+            and (preparation.user_id = #{tempUserId} or preparation.receive_verify_leader = #{tempUserId}
+            or preparation.repair_user_id = #{tempUserId} or preparation.apply_verify_user_id = #{tempUserId}
+            or preparation.apply_verify_leader = #{tempUserId})
         </if>
     </sql>
     <select id="selectList" parameterType="com.platform.dao.dto.preparation.PreparationDTO"

+ 15 - 0
platform-dao/src/main/resources/mapper/preparation/PreparationRecordMapper.xml

@@ -14,6 +14,9 @@
         <if test="status != null ">
             and record.status = #{status}
         </if>
+        <if test="type != null ">
+            and record.type = #{type}
+        </if>
         <if test="remark != null and remark != ''">
             and record.remark = #{remark}
         </if>
@@ -50,6 +53,18 @@
         <if test="keyword != null and keyword != ''">
             and record.id like concat(concat('%',#{keyword}),'%')
         </if>
+        <if test="createdTimeStart != null">
+            and record.created_time <![CDATA[>=]]>; #{createdTimeStart}
+        </if>
+        <if test="createdTimeEnd != null">
+            and record.created_time <![CDATA[<=]]> #{createdTimeEnd}
+        </if>
+        <if test="updateTimeStart != null">
+            and record.update_time <![CDATA[>=]]>; #{updateTimeStart}
+        </if>
+        <if test="updateTimeEnd != null">
+            and record.update_time <![CDATA[<=]]> #{updateTimeEnd}
+        </if>
     </sql>
     <select id="selectList" parameterType="com.platform.dao.dto.preparation.PreparationRecordDTO"
             resultType="com.platform.dao.vo.query.preparation.PreparationRecordVO">

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

@@ -177,6 +177,19 @@ public class PreparationController {
     return new R<>();
   }
 
+  /**
+   * 工单审核
+   * @param preparationDTO 筹建单DTO
+   * @return R
+   */
+  @SysLog("筹建工单审核")
+  @PutMapping("/verify/{id}")
+  public R verify(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody PreparationDTO preparationDTO) {
+    preparationDTO.setId(id);
+    preparationService.handleVerify(preparationDTO);
+    return new R<>();
+  }
+
 
   @GetMapping("/test/{epcId}")
   public R saveTest(@PathVariable("epcId") String epcId) {

+ 13 - 0
platform-rest/src/main/java/com/platform/rest/controller/upms/SysUserController.java

@@ -631,4 +631,17 @@ public class SysUserController {
         dto.setRoleCode(roleName);
         return R.success(sysUserService.selectDeptRoleUser(dto));
     }
+
+    /**
+     * 根据角色名称获取用户集合
+     * @param roleName
+     * @return :
+     */
+    @GetMapping("/query/roleName/{roleName}/{deptId}")
+    public R selectRoleDeptNameUsers(@PathVariable("roleName") String roleName,@PathVariable("deptId") String deptId) {
+        SysUserDTO dto = new SysUserDTO();
+        dto.setRoleCode(roleName);
+        dto.setDeptId(deptId);
+        return R.success(sysUserService.selectDeptRoleUser(dto));
+    }
 }

+ 33 - 22
platform-service/src/main/java/com/platform/service/preparation/impl/PreparationServiceImpl.java

@@ -2,6 +2,7 @@ package com.platform.service.preparation.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.platform.common.bean.AbstractPageResultBean;
+import com.platform.common.bean.DataScope;
 import com.platform.common.cache.ConfigCache;
 import com.platform.common.cache.DictCache;
 import com.platform.common.constant.CommonConstants;
@@ -10,6 +11,7 @@ import com.platform.common.model.UserInfo;
 import com.platform.common.util.*;
 import com.platform.dao.bean.MyPage;
 import com.platform.dao.dto.preparation.PreparationDTO;
+import com.platform.dao.dto.preparation.PreparationRecordDTO;
 import com.platform.dao.dto.upms.SysUserDTO;
 import com.platform.dao.entity.preparation.Preparation;
 import com.platform.dao.entity.preparation.PreparationRecord;
@@ -28,6 +30,7 @@ import com.platform.dao.util.MessageTemplateUtil;
 import com.platform.dao.vo.SysUserRoleVO;
 import com.platform.dao.vo.SysUserVO;
 import com.platform.dao.vo.export.preparation.ExportPreparationNumVO;
+import com.platform.dao.vo.query.preparation.PreparationRecordVO;
 import com.platform.dao.vo.query.preparation.PreparationVO;
 import com.platform.dao.vo.report.AllPreparationReportVO;
 import com.platform.dao.vo.report.PreparationReportByStatusVO;
@@ -280,6 +283,10 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
                 record.setTempUserId(null);
             } else if (record.getSearchType() == 2) { // 待审核工单
                 statusList.add(PreparationStatusEnum.NOT_ALLOCATED.getValue());
+                statusList.add(PreparationStatusEnum.APPLY_MANAGER_VERIFY_SUCCESS.getValue());
+                statusList.add(PreparationStatusEnum.APPLY_LEADER_VERIFY_SUCCESS.getValue());
+                statusList.add(PreparationStatusEnum.FIRST_PROCESSING_VERIFYING.getValue());
+                statusList.add(PreparationStatusEnum.SECOND_PROCESSING_VERIFYING.getValue());
             } else if (record.getSearchType() == 3) { // 我的工单
                 statusList.add(PreparationStatusEnum.NOT_ALLOCATED.getValue());
                 statusList.add(PreparationStatusEnum.PROCESSING.getValue());
@@ -457,28 +464,32 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
         if (!StringUtils.isEmpty(vo.getApplyVerifyUserId())) {
             vo.setApplyVerifyUser(sysUserMapper.selectUserNameById(vo.getApplyVerifyUserId()));
         }
+        // 部门审批负责人
+        if (!StringUtils.isEmpty(vo.getApplyVerifyLeader())) {
+            vo.setApplyVerifyLeaderName(sysUserMapper.selectUserNameById(vo.getApplyVerifyLeader()));
+        }
+        // 收件部门
+        if (!StringUtils.isEmpty(vo.getReceiveDept())) {
+            vo.setReceiveDeptName(sysDeptMapper.selectByPrimaryKey(vo.getReceiveDept()).getName());
+        }
+        // 收件部门审批负责人
+        if (!StringUtils.isEmpty(vo.getReceiveVerifyLeader())) {
+            vo.setReceiveVerifyLeaderName(sysUserMapper.selectUserNameById(vo.getReceiveVerifyLeader()));
+        }
         // 执行部门
         if (!StringUtils.isEmpty(vo.getExecuteDept())) {
             vo.setExecuteDeptName(sysDeptMapper.selectByPrimaryKey(vo.getExecuteDept()).getName());
-            if (vo.getStatus() == PreparationStatusEnum.PROCESSING.getValue()
-                    || vo.getStatus() == PreparationStatusEnum.FINISHED.getValue()) {
-                vo.setDispatchUserName(sysUserMapper.selectUserNameById(vo.getDispatchUserId()));
-            } else {
-                // 获取筹建主管角色
-                SysUserDTO queryUserDTO = new SysUserDTO();
-                queryUserDTO.setRoleCode(SysRoleCodeEnum.PREPARATION_MANAGER.name());
-                queryUserDTO.setDeptId(vo.getExecuteDept());
-                List<SysUserVO> userVOS = sysUserMapper.selectDeptRoleUser(queryUserDTO);
-                // 判断执行部门是否有人接单
-                if (userVOS != null || userVOS.size() > 0) {
-                    StringBuilder info = new StringBuilder();
-                    userVOS.forEach(item -> {
-                        info.append(item.getRealName()).append("、");
-                    });
-                    vo.setExecuteMangers(info.toString());
-                }
-            }
         }
+        // 获取审核记录
+        PreparationRecordDTO recordDTO = new PreparationRecordDTO();
+        recordDTO.setPreparationId(vo.getId());
+        recordDTO.setType(PreparationRecordTypeEnum.VERIFY.getValue());
+        DataScope dataScope = new DataScope();
+        dataScope.put("sortName","created_time");
+        dataScope.put("sortBy","asc");
+        recordDTO.setDataScope(dataScope);
+        List<PreparationRecordVO> recordList = preparationRecordMapper.selectList(recordDTO);
+        vo.setRecordList(recordList);
         return vo;
     }
 
@@ -509,7 +520,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
         switch (preparation.getStatus()) {
             case CommonConstants.PREPARATION_NOT_ALLOCATED:
                 // 主管审批
-                if (!roles.contains(SysRoleCodeEnum.DEPT_MANAGER.name()) || currentUserId.equals(preparation.getApplyVerifyUserId())) {
+                if (!roles.contains(SysRoleCodeEnum.DEPT_MANAGER.name()) || !currentUserId.equals(preparation.getApplyVerifyUserId())) {
                     throw new DeniedException("不具备审核权限");
                 }
                 if (model.getVerifyStatus() == 1) { // 通过
@@ -527,7 +538,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
                 break;
             case CommonConstants.APPLY_MANAGER_VERIFY_SUCCESS:
                 // 负责人审批
-                if (!roles.contains(SysRoleCodeEnum.DEPT_LEADER.name()) || currentUserId.equals(preparation.getApplyVerifyLeader())) {
+                if (!roles.contains(SysRoleCodeEnum.DEPT_LEADER.name()) || !currentUserId.equals(preparation.getApplyVerifyLeader())) {
                     throw new DeniedException("不具备审核权限");
                 }
                 if (model.getVerifyStatus() == 1) { // 通过
@@ -545,7 +556,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
                 break;
             case CommonConstants.FIRST_PROCESSING_VERIFYING:
                 // 申请人费用审批
-                if (currentUserId.equals(preparation.getUserId())) {
+                if (!currentUserId.equals(preparation.getUserId())) {
                     throw new DeniedException("不具备审核权限");
                 }
                 if (model.getVerifyStatus() == 1) { // 通过
@@ -561,7 +572,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
                 break;
             case CommonConstants.SECOND_PROCESSING_VERIFYING:
                 // 申请人验收审批
-                if (currentUserId.equals(preparation.getUserId())) {
+                if (!currentUserId.equals(preparation.getUserId())) {
                     throw new DeniedException("不具备审核权限");
                 }
                 if (model.getVerifyStatus() == 1) { // 通过