| | |
| | | import com.ycl.entity.caseHandler.DispatchInfo; |
| | | import com.ycl.entity.caseHandler.DisposeRecord; |
| | | import com.ycl.entity.caseHandler.WorkflowConfigStep; |
| | | import com.ycl.entity.message.DingMessage; |
| | | import com.ycl.entity.user.UmsAdmin; |
| | | import com.ycl.exception.ApiException; |
| | | import com.ycl.mapper.caseHandler.BaseCaseMapper; |
| | | import com.ycl.mapper.caseHandler.DispatchInfoMapper; |
| | | import com.ycl.mapper.caseHandler.DisposeRecordMapper; |
| | | import com.ycl.mapper.caseHandler.WorkflowConfigStepMapper; |
| | | import com.ycl.mapper.message.DingMessageMapper; |
| | | import com.ycl.service.caseHandler.IDispatchHandleService; |
| | | import com.ycl.service.user.UmsAdminService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | DingCommon dingCommon; |
| | | @Autowired |
| | | UmsAdminService umsAdminService; |
| | | @Autowired |
| | | DingMessageMapper dingMessageMapper; |
| | | @Override |
| | | @Transactional |
| | | public DispatchInfo dispatch(DispatchInfoParam dispatchInfoParam) { |
| | |
| | | stepNextRecord.setCreateTime(LocalDateTime.now()); |
| | | |
| | | disposeRecordMapper.insert(stepNextRecord); |
| | | //发送钉钉工作通知消息 |
| | | log.info("发送一条工作通知"); |
| | | //存钉钉工作通知消息到数据库 |
| | | BaseCase baseCaseForCode = baseCaseMapper.selectById(dispatchInfoParam.getBaseCaseId()); |
| | | String baseCaseCode = baseCaseForCode.getCode(); |
| | | String text ="您有一条工作通知 \n " + |
| | | " 遂昌云执法:有待处理的任务 \n " + |
| | | "·您有1条待处理事件。事件编号: \n " + |
| | | baseCaseCode; |
| | | Long lawEnforcer = dispatchInfoParam.getLawEnforcer(); |
| | | UmsAdmin user = umsAdminService.getById(lawEnforcer); |
| | | dingCommon.sendDingMsgStr(user.getAccountId()+"",text); |
| | | Long accountId = umsAdminService.getById(lawEnforcer).getAccountId(); |
| | | DingMessage dingMessage = DingMessage.builder() |
| | | .accountId(accountId) |
| | | .baseCaseCode(baseCaseCode) |
| | | .createTime(new Date()).build(); |
| | | dingMessageMapper.insert(dingMessage); |
| | | |
| | | return dispatchInfo; |
| | | } |