Browse Source

流程待办增加crmNo查询

wangliang 1 năm trước cách đây
mục cha
commit
86924bf007

+ 4 - 2
sop-business/src/main/java/com/qmth/sop/business/activiti/service/ActivitiService.java

@@ -76,9 +76,10 @@ public interface ActivitiService {
      * @param serviceId
      * @param customName
      * @param flowTaskTypeEnum
+     * @param crmNo
      * @return
      */
-    public IPage<WorkTaskResult> getFlowTaskList(IPage<Map> iPage, Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum);
+    public IPage<WorkTaskResult> getFlowTaskList(IPage<Map> iPage, Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum, String crmNo);
 
     /**
      * 获取用户待办计数
@@ -88,9 +89,10 @@ public interface ActivitiService {
      * @param serviceId
      * @param customName
      * @param flowTaskTypeEnum
+     * @param crmNo
      * @return
      */
-    public int getFlowTaskListCount(Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum);
+    public int getFlowTaskListCount(Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum, String crmNo);
 
     /**
      * 流程节点转他人审批

+ 6 - 4
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -479,14 +479,15 @@ public class ActivitiServiceImpl implements ActivitiService {
      * @param serviceId
      * @param customName
      * @param flowTaskTypeEnum
+     * @param crmNo
      * @return
      */
     @Override
-    public IPage<WorkTaskResult> getFlowTaskList(IPage<Map> iPage, Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum) {
+    public IPage<WorkTaskResult> getFlowTaskList(IPage<Map> iPage, Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum, String crmNo) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         userId = Objects.nonNull(sysUser) ? sysUser.getId() : userId;
         Map<String, Object> map = new HashMap<>();
-        IPage<WorkTaskResult> workTaskResultIPage = sysUserService.getFlowTaskList(iPage, userId, type, serviceId, customName, flowTaskTypeEnum);
+        IPage<WorkTaskResult> workTaskResultIPage = sysUserService.getFlowTaskList(iPage, userId, type, serviceId, customName, flowTaskTypeEnum, crmNo);
         if (Objects.nonNull(workTaskResultIPage) && !CollectionUtils.isEmpty(workTaskResultIPage.getRecords())) {
             for (WorkTaskResult w : workTaskResultIPage.getRecords()) {
                 List<Task> taskList = taskService.createTaskQuery().taskId(String.valueOf(w.getTaskId())).list();
@@ -513,13 +514,14 @@ public class ActivitiServiceImpl implements ActivitiService {
      * @param serviceId
      * @param customName
      * @param flowTaskTypeEnum
+     * @param crmNo
      * @return
      */
     @Override
-    public int getFlowTaskListCount(Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum) {
+    public int getFlowTaskListCount(Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum, String crmNo) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         userId = Objects.nonNull(sysUser) ? sysUser.getId() : userId;
-        return sysUserService.getFlowTaskListCount(userId, type, serviceId, customName, flowTaskTypeEnum);
+        return sysUserService.getFlowTaskListCount(userId, type, serviceId, customName, flowTaskTypeEnum, crmNo);
     }
 
     /**

+ 4 - 2
sop-business/src/main/java/com/qmth/sop/business/mapper/SysUserMapper.java

@@ -41,9 +41,10 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
      * @param serviceId
      * @param customName
      * @param flowTaskTypeEnum
+     * @param crmNo
      * @return
      */
-    IPage<WorkTaskResult> getFlowTaskList(IPage<Map> iPage, @Param("userId") Long userId, @Param("type") String type, @Param("serviceId") Long serviceId, @Param("customName") String customName, @Param("flowTaskTypeEnum") String flowTaskTypeEnum);
+    IPage<WorkTaskResult> getFlowTaskList(IPage<Map> iPage, @Param("userId") Long userId, @Param("type") String type, @Param("serviceId") Long serviceId, @Param("customName") String customName, @Param("flowTaskTypeEnum") String flowTaskTypeEnum, @Param("crmNo") String crmNo);
 
     /**
      * 获取工作台待办
@@ -53,9 +54,10 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
      * @param serviceId
      * @param customName
      * @param flowTaskTypeEnum
+     * @param crmNo
      * @return
      */
-    int getFlowTaskListCount(@Param("userId") Long userId, @Param("type") String type, @Param("serviceId") Long serviceId, @Param("customName") String customName, @Param("flowTaskTypeEnum") String flowTaskTypeEnum);
+    int getFlowTaskListCount(@Param("userId") Long userId, @Param("type") String type, @Param("serviceId") Long serviceId, @Param("customName") String customName, @Param("flowTaskTypeEnum") String flowTaskTypeEnum, @Param("crmNo") String crmNo);
 
     /**
      * 根据机构id查询用户

+ 4 - 2
sop-business/src/main/java/com/qmth/sop/business/service/SysUserService.java

@@ -135,9 +135,10 @@ public interface SysUserService extends IService<SysUser> {
      * @param serviceId
      * @param customName
      * @param flowTaskTypeEnum
+     * @param crmNo
      * @return
      */
-    IPage<WorkTaskResult> getFlowTaskList(IPage<Map> iPage, Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum);
+    IPage<WorkTaskResult> getFlowTaskList(IPage<Map> iPage, Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum, String crmNo);
 
     /**
      * 获取工作台待办
@@ -147,9 +148,10 @@ public interface SysUserService extends IService<SysUser> {
      * @param serviceId
      * @param customName
      * @param flowTaskTypeEnum
+     * @param crmNo
      * @return
      */
-    int getFlowTaskListCount(Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum);
+    int getFlowTaskListCount(Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum, String crmNo);
 
     /**
      * 根据角色类型查询用户

+ 6 - 4
sop-business/src/main/java/com/qmth/sop/business/service/impl/SysUserServiceImpl.java

@@ -441,11 +441,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
      * @param serviceId
      * @param customName
      * @param flowTaskTypeEnum
+     * @param crmNo
      * @return
      */
     @Override
-    public IPage<WorkTaskResult> getFlowTaskList(IPage<Map> iPage, Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum) {
-        return this.baseMapper.getFlowTaskList(iPage, userId, Objects.nonNull(type) ? type.name() : null, serviceId, customName, Objects.nonNull(flowTaskTypeEnum) ? flowTaskTypeEnum.name() : null);
+    public IPage<WorkTaskResult> getFlowTaskList(IPage<Map> iPage, Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum, String crmNo) {
+        return this.baseMapper.getFlowTaskList(iPage, userId, Objects.nonNull(type) ? type.name() : null, serviceId, customName, Objects.nonNull(flowTaskTypeEnum) ? flowTaskTypeEnum.name() : null, crmNo);
     }
 
     /**
@@ -456,11 +457,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
      * @param serviceId
      * @param customName
      * @param flowTaskTypeEnum
+     * @param crmNo
      * @return
      */
     @Override
-    public int getFlowTaskListCount(Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum) {
-        return this.baseMapper.getFlowTaskListCount(userId, Objects.nonNull(type) ? type.name() : null, serviceId, customName, Objects.nonNull(flowTaskTypeEnum) ? flowTaskTypeEnum.name() : null);
+    public int getFlowTaskListCount(Long userId, TFCustomTypeEnum type, Long serviceId, String customName, FlowTaskTypeEnum flowTaskTypeEnum, String crmNo) {
+        return this.baseMapper.getFlowTaskListCount(userId, Objects.nonNull(type) ? type.name() : null, serviceId, customName, Objects.nonNull(flowTaskTypeEnum) ? flowTaskTypeEnum.name() : null, crmNo);
     }
 
     @Override

+ 6 - 0
sop-business/src/main/resources/mapper/SysUserMapper.xml

@@ -64,6 +64,9 @@
             <if test="customName != null and customName != ''">
                 and sc.name like concat('%', #{customName}, '%')
             </if>
+            <if test="crmNo != null and crmNo != ''">
+                and tbc.crm_no = #{crmNo}
+            </if>
         </where>
         UNION ALL
         select
@@ -119,6 +122,9 @@
             <if test="customName != null and customName != ''">
                 and sc.name like concat('%', #{customName}, '%')
             </if>
+            <if test="crmNo != null and crmNo != ''">
+                and tbc.crm_no = #{crmNo}
+            </if>
         </where>
         ) t
         <where>

+ 5 - 3
sop-server/src/main/java/com/qmth/sop/server/api/TFCustomFlowController.java

@@ -108,9 +108,10 @@ public class TFCustomFlowController {
                                   @ApiParam(value = "服务单元id") @RequestParam(required = false) Long serviceId,
                                   @ApiParam(value = "客户名称") @RequestParam(required = false) String customName,
                                   @ApiParam(value = "待办任务类型", required = true) @RequestParam FlowTaskTypeEnum flowTaskTypeEnum,
+                                  @ApiParam(value = "crm单号") @RequestParam(required = false) String crmNo,
                                   @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) {
-        return ResultUtil.ok(activitiService.getFlowTaskList(new Page<>(pageNumber, pageSize), userId, type, serviceId, customName, flowTaskTypeEnum));
+        return ResultUtil.ok(activitiService.getFlowTaskList(new Page<>(pageNumber, pageSize), userId, type, serviceId, customName, flowTaskTypeEnum, crmNo));
     }
 
     @ApiOperation(value = "获取流程待办计数接口")
@@ -120,8 +121,9 @@ public class TFCustomFlowController {
                                        @ApiParam(value = "流程类型") @RequestParam(required = false) TFCustomTypeEnum type,
                                        @ApiParam(value = "服务单元id") @RequestParam(required = false) Long serviceId,
                                        @ApiParam(value = "客户名称") @RequestParam(required = false) String customName,
-                                       @ApiParam(value = "待办任务类型", required = true) @RequestParam FlowTaskTypeEnum flowTaskTypeEnum) {
-        return ResultUtil.ok(activitiService.getFlowTaskListCount(userId, type, serviceId, customName, flowTaskTypeEnum));
+                                       @ApiParam(value = "待办任务类型", required = true) @RequestParam FlowTaskTypeEnum flowTaskTypeEnum,
+                                       @ApiParam(value = "crm单号") @RequestParam(required = false) String crmNo) {
+        return ResultUtil.ok(activitiService.getFlowTaskListCount(userId, type, serviceId, customName, flowTaskTypeEnum, crmNo));
     }
 
     @ApiOperation(value = "结束流程接口")