1、后端
主要增加flow_cc一个表
增加相应的这个表模块功能
@GetMapping(value = "/list") public Result<?> queryPageList(FlowCc flowCc, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { QueryWrapper<FlowCc> queryWrapper = QueryGenerator.initQueryWrapper(flowCc, req.getParameterMap()); queryWrapper.eq("username", iFlowThirdService.getLoginUser().getUsername()); Page<FlowCc> page = new Page<FlowCc>(pageNo, pageSize); IPage<FlowCc> pageList = flowCcService.page(page, queryWrapper); return Result.OK(pageList); }
这里主要修改了增加条件,只显示自己的数据
增加流程抄送类功能
@Override public Boolean flowCc(FlowTaskVo taskVo) { if (StringUtils.isEmpty(taskVo.getCcUsers())) { // 若抄送用户为空,则不需要处理,返回成功 return true; } HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery() .processInstanceId(taskVo.getInstanceId()).singleResult(); String[] usernames = taskVo.getCcUsers().split(","); List<FlowCc> flowCcList = new ArrayList<>(); String initiatorUsername = iFlowThirdService.getLoginUser().getUsername(); String initiatorRealname = iFlowThirdService.getLoginUser().getRealname(); String title = historicProcessInstance.getProcessDefinitionName(); for (String username : usernames) { FlowCc flowCc = new FlowCc(); flowCc.setTitle(title); flowCc.setFlowId(historicProcessInstance.getProcessDefinitionId()); flowCc.setFlowName(historicProcessInstance.getProcessDefinitionName()); flowCc.setDeploymentId(historicProcessInstance.getDeploymentId()); flowCc.setInstanceId(taskVo.getInstanceId()); flowCc.setTaskId(taskVo.getTaskId()); flowCc.setBusinessKey(taskVo.getBusinessKey()); flowCc.setUsername(username); flowCc.setInitiatorUsername(initiatorUsername); flowCc.setInitiatorRealname(initiatorRealname); flowCcList.add(flowCc); } return insertBatch(flowCcList); } /** * 批量插入(包含限制条数,目前现在100条) */ @Override public boolean insertBatch(List<FlowCc> flowCcList) { String sqlStatement = SqlHelper.getSqlStatement(this.currentMapperClass(), SqlMethod.INSERT_ONE); return SqlHelper.executeBatch(this.currentModelClass(), log, flowCcList, 100, (sqlSession, entity) -> sqlSession.insert(sqlStatement, entity)); }
2、前端
通过代码自动生成,拷贝进去,就是详情修改一下如下
/** 流程流转记录 */ handleFlowRecord(row){ console.log("handleFlowRecord row=",row); this.$router.push({ path: '/flowable/task/record/index', query: { procInsId: row.instanceId, deployId: row.deploymentId, taskId: row.taskId, businessKey: row.businessKey, finished: false }}) },
选择抄送人增加一下
<el-form-item label="选择抄送人" prop="ccUsers"> <j-select-user-by-dep v-model="taskForm.ccUsers" /> </el-form-item>
3、效果如下: