wangliang 9 달 전
부모
커밋
a122917b9d

+ 29 - 15
sop-api/src/main/java/com/qmth/sop/server/api/TBDingApplyController.java

@@ -1,6 +1,5 @@
 package com.qmth.sop.server.api;
 
-
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.sop.business.bean.result.DingApplyDoneResult;
@@ -14,6 +13,7 @@ import com.qmth.sop.common.annotation.OperationLog;
 import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.enums.DingExceptionApproveEnum;
 import com.qmth.sop.common.enums.LogTypeEnum;
+import com.qmth.sop.common.enums.RoleTypeEnum;
 import com.qmth.sop.common.util.Result;
 import com.qmth.sop.common.util.ResultUtil;
 import com.qmth.sop.common.util.ServletUtil;
@@ -58,38 +58,50 @@ public class TBDingApplyController {
     @ApiOperation(value = "考勤异常待审核接口")
     @RequestMapping(value = "/flow/task/un_done/list", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = DingApplyUnDoneResult.class) })
-    public Result flowTaskUnDoneList(@ApiParam(value = "服务单元id") @RequestParam(required = false) Long serviceId, @ApiParam(value = "姓名") @RequestParam(required = false) String name,
-            @ApiParam(value = "供应商id") @RequestParam(required = false) Long supplierId, @ApiParam(value = "客户名称") @RequestParam(required = false) String customName,
-            @ApiParam(value = "异常开始时间") @RequestParam(required = false) Long startTime, @ApiParam(value = "异常结束时间") @RequestParam(required = false) Long endTime,
-            @ApiParam(value = "申请开始时间") @RequestParam(required = false) Long applyStartTime, @ApiParam(value = "申请结束时间") @RequestParam(required = false) Long applyEndTime,
+    public Result flowTaskUnDoneList(@ApiParam(value = "服务单元id") @RequestParam(required = false) Long serviceId,
+            @ApiParam(value = "姓名") @RequestParam(required = false) String name,
+            @ApiParam(value = "供应商id") @RequestParam(required = false) Long supplierId,
+            @ApiParam(value = "客户名称") @RequestParam(required = false) String customName,
+            @ApiParam(value = "异常开始时间") @RequestParam(required = false) Long startTime,
+            @ApiParam(value = "异常结束时间") @RequestParam(required = false) Long endTime,
+            @ApiParam(value = "申请开始时间") @RequestParam(required = false) Long applyStartTime,
+            @ApiParam(value = "申请结束时间") @RequestParam(required = false) Long applyEndTime,
+            @ApiParam(value = "角色类型") @RequestParam(required = true) RoleTypeEnum roleType,
             @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
             @ApiParam(value = "页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize)
             throws Exception {
         return ResultUtil.ok(
                 tbDingApplyService.flowTaskUnDoneList(new Page<>(pageNumber, pageSize), serviceId, name, supplierId,
-                        customName, startTime, endTime, applyStartTime, applyEndTime));
+                        customName, startTime, endTime, applyStartTime, applyEndTime, roleType));
     }
 
     @ApiOperation(value = "考勤异常已审核接口")
     @RequestMapping(value = "/flow/task/done/list", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = DingApplyDoneResult.class) })
-    public Result flowTaskDoneList(@ApiParam(value = "服务单元id") @RequestParam(required = false) Long serviceId, @ApiParam(value = "姓名") @RequestParam(required = false) String name,
-            @ApiParam(value = "供应商id") @RequestParam(required = false) Long supplierId, @ApiParam(value = "审核结果") @RequestParam(required = false) DingExceptionApproveEnum dingExceptionApprove,
-            @ApiParam(value = "客户名称") @RequestParam(required = false) String customName, @ApiParam(value = "异常开始时间") @RequestParam(required = false) Long startTime,
-            @ApiParam(value = "异常结束时间") @RequestParam(required = false) Long endTime, @ApiParam(value = "申请开始时间") @RequestParam(required = false) Long applyStartTime,
-            @ApiParam(value = "申请结束时间") @RequestParam(required = false) Long applyEndTime, @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+    public Result flowTaskDoneList(@ApiParam(value = "服务单元id") @RequestParam(required = false) Long serviceId,
+            @ApiParam(value = "姓名") @RequestParam(required = false) String name,
+            @ApiParam(value = "供应商id") @RequestParam(required = false) Long supplierId,
+            @ApiParam(value = "审核结果") @RequestParam(required = false) DingExceptionApproveEnum dingExceptionApprove,
+            @ApiParam(value = "客户名称") @RequestParam(required = false) String customName,
+            @ApiParam(value = "异常开始时间") @RequestParam(required = false) Long startTime,
+            @ApiParam(value = "异常结束时间") @RequestParam(required = false) Long endTime,
+            @ApiParam(value = "申请开始时间") @RequestParam(required = false) Long applyStartTime,
+            @ApiParam(value = "申请结束时间") @RequestParam(required = false) Long applyEndTime,
+            @ApiParam(value = "角色类型") @RequestParam(required = true) RoleTypeEnum roleType,
+            @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
             @ApiParam(value = "页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize)
             throws Exception {
         return ResultUtil.ok(
                 tbDingApplyService.flowTaskDoneList(new Page<>(pageNumber, pageSize), serviceId, name, supplierId,
-                        dingExceptionApprove, customName, startTime, endTime, applyStartTime, applyEndTime));
+                        dingExceptionApprove, customName, startTime, endTime, applyStartTime, applyEndTime, roleType));
     }
 
     @ApiOperation(value = "考勤异常审核接口")
     @RequestMapping(value = "/flow/approve", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = Object.class) })
     @OperationLog(logType = LogTypeEnum.UN_KNOW)
-    public Result flowApprove(@ApiParam(value = "流程任务id", required = true) @RequestParam Long taskId, @ApiParam(value = "审核结果", required = true) @RequestParam DingExceptionApproveEnum dingExceptionApprove,
+    public Result flowApprove(@ApiParam(value = "流程任务id", required = true) @RequestParam Long taskId,
+            @ApiParam(value = "审核结果", required = true) @RequestParam DingExceptionApproveEnum dingExceptionApprove,
             @ApiParam(value = "审核用户id") @RequestParam(required = false) Long userId) throws InterruptedException {
         return ResultUtil.ok(tbDingApplyService.flowApprove(taskId, dingExceptionApprove, userId));
     }
@@ -98,7 +110,8 @@ public class TBDingApplyController {
     @RequestMapping(value = "/flow/batch/approve", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = Object.class) })
     @OperationLog(logType = LogTypeEnum.UN_KNOW)
-    public Result flowBatchApprove(@ApiParam(value = "流程任务id数组", required = true) @RequestParam List<Long> taskIds, @ApiParam(value = "审核结果", required = true) @RequestParam DingExceptionApproveEnum dingExceptionApprove,
+    public Result flowBatchApprove(@ApiParam(value = "流程任务id数组", required = true) @RequestParam List<Long> taskIds,
+            @ApiParam(value = "审核结果", required = true) @RequestParam DingExceptionApproveEnum dingExceptionApprove,
             @ApiParam(value = "审核用户id") @RequestParam(required = false) Long userId) throws InterruptedException {
         return ResultUtil.ok(tbDingApplyService.flowBatchApprove(taskIds, dingExceptionApprove, userId));
     }
@@ -113,7 +126,8 @@ public class TBDingApplyController {
     @ApiOperation(value = "补卡申请-区协查询审核人")
     @RequestMapping(value = "/find_region_coordinator_auditor", method = RequestMethod.POST)
     @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = SearchResult.class) })
-    public Result findRegionCoordinatorAuditor(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
+    public Result findRegionCoordinatorAuditor(
+            @ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         return ResultUtil.ok(tbDingApplyService.findRegionCoordinatorAuditor(serviceId, requestUser.getId()));
     }

+ 17 - 6
sop-business/src/main/java/com/qmth/sop/business/service/TBDingApplyService.java

@@ -2,9 +2,13 @@ package com.qmth.sop.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.sop.business.bean.result.*;
+import com.qmth.sop.business.bean.result.DingApplyDoneResult;
+import com.qmth.sop.business.bean.result.DingApplyUnDoneResult;
+import com.qmth.sop.business.bean.result.SearchResult;
+import com.qmth.sop.business.bean.result.TBDingApplyViewResult;
 import com.qmth.sop.business.entity.TBDingApply;
 import com.qmth.sop.common.enums.DingExceptionApproveEnum;
+import com.qmth.sop.common.enums.RoleTypeEnum;
 
 import java.util.List;
 import java.util.Map;
@@ -40,10 +44,12 @@ public interface TBDingApplyService extends IService<TBDingApply> {
      * @param endTime
      * @param applyStartTime
      * @param applyEndTime
+     * @param roleType
      * @return
      */
     IPage<DingApplyUnDoneResult> flowTaskUnDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId,
-            String customName, Long startTime, Long endTime, Long applyStartTime, Long applyEndTime) throws Exception;
+            String customName, Long startTime, Long endTime, Long applyStartTime, Long applyEndTime,
+            RoleTypeEnum roleType) throws Exception;
 
     /**
      * 异常已审核接口
@@ -58,10 +64,12 @@ public interface TBDingApplyService extends IService<TBDingApply> {
      * @param endTime
      * @param applyStartTime
      * @param applyEndTime
+     * @param roleType 
      * @return
      */
     IPage<DingApplyDoneResult> flowTaskDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId,
-            DingExceptionApproveEnum dingExceptionApprove, String customName, Long startTime, Long endTime, Long applyStartTime, Long applyEndTime) throws Exception;
+            DingExceptionApproveEnum dingExceptionApprove, String customName, Long startTime, Long endTime,
+            Long applyStartTime, Long applyEndTime, RoleTypeEnum roleType) throws Exception;
 
     /**
      * 考勤异常审核接口
@@ -71,7 +79,8 @@ public interface TBDingApplyService extends IService<TBDingApply> {
      * @param userId
      * @return
      */
-    Boolean flowApprove(Long taskId, DingExceptionApproveEnum dingExceptionApprove, Long userId) throws InterruptedException;
+    Boolean flowApprove(Long taskId, DingExceptionApproveEnum dingExceptionApprove, Long userId)
+            throws InterruptedException;
 
     /**
      * 更新考勤异常打卡时间
@@ -90,7 +99,8 @@ public interface TBDingApplyService extends IService<TBDingApply> {
      * @param userId
      * @return
      */
-    Boolean flowBatchApprove(List<Long> taskIds, DingExceptionApproveEnum dingExceptionApprove, Long userId) throws InterruptedException;
+    Boolean flowBatchApprove(List<Long> taskIds, DingExceptionApproveEnum dingExceptionApprove, Long userId)
+            throws InterruptedException;
 
     /**
      * 审批公用方法
@@ -101,7 +111,8 @@ public interface TBDingApplyService extends IService<TBDingApply> {
      * @return
      * @throws InterruptedException
      */
-    public Boolean taskApprove(Long taskId, Long userId, DingExceptionApproveEnum dingExceptionApprove) throws InterruptedException;
+    public Boolean taskApprove(Long taskId, Long userId, DingExceptionApproveEnum dingExceptionApprove)
+            throws InterruptedException;
 
     /**
      * 考勤异常申请详情接口

+ 7 - 3
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDingApplyServiceImpl.java

@@ -165,12 +165,13 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
      * @param endTime
      * @param applyStartTime
      * @param applyEndTime
+     * @param roleType
      * @return
      */
     @Override
     public IPage<DingApplyUnDoneResult> flowTaskUnDoneList(IPage<Map> iPage, Long serviceId, String name,
-            Long supplierId, String customName, Long startTime, Long endTime, Long applyStartTime, Long applyEndTime)
-            throws Exception {
+            Long supplierId, String customName, Long startTime, Long endTime, Long applyStartTime, Long applyEndTime,
+            RoleTypeEnum roleType) throws Exception {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionDto dpr = sysUserService.buildUserDataPermission(requestUser.getId());
         if (dpr.getHasThirdPmo()) {
@@ -182,6 +183,7 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
             }
             supplierId = userSupplierId;
         }
+        dpr = roleType == RoleTypeEnum.REGION_COORDINATOR ? null : dpr;
         IPage<DingApplyUnDoneResult> dingApplyUnDoneResultIPage = this.baseMapper.flowTaskUnDoneList(iPage, serviceId,
                 name, supplierId, customName, startTime, endTime, applyStartTime, applyEndTime, dpr);
         if (Objects.nonNull(dingApplyUnDoneResultIPage) && !CollectionUtils.isEmpty(
@@ -238,12 +240,13 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
      * @param endTime
      * @param applyStartTime
      * @param applyEndTime
+     * @param roleType
      * @return
      */
     @Override
     public IPage<DingApplyDoneResult> flowTaskDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId,
             DingExceptionApproveEnum dingExceptionApprove, String customName, Long startTime, Long endTime,
-            Long applyStartTime, Long applyEndTime) throws Exception {
+            Long applyStartTime, Long applyEndTime, RoleTypeEnum roleType) throws Exception {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionDto dpr = sysUserService.buildUserDataPermission(requestUser.getId());
         if (dpr.getHasThirdPmo()) {
@@ -255,6 +258,7 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
             }
             supplierId = userSupplierId;
         }
+        dpr = roleType == RoleTypeEnum.REGION_COORDINATOR ? null : dpr;
         IPage<DingApplyDoneResult> dingApplyDoneResultIPage = this.baseMapper.flowTaskDoneList(iPage, serviceId, name,
                 supplierId, Objects.nonNull(dingExceptionApprove) ? dingExceptionApprove.name() : null, customName,
                 startTime, endTime, applyStartTime, applyEndTime, dpr);