| | |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TaskListQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.utils.TemplateMessageSendUtil; |
| | | import com.ruoyi.system.vo.system.*; |
| | | import com.ruoyi.web.controller.tool.EmailUtils; |
| | | import com.ruoyi.web.controller.tool.MsgUtils; |
| | |
| | | private TNoticeSetService noticeSetService; |
| | | @Resource |
| | | private TDictDataService dictDataService; |
| | | @Resource |
| | | private TemplateMessageSendUtil templateMessageSendUtil; |
| | | @Log(title = "审核任务", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "审核任务") |
| | | @PostMapping(value = "/audit") |
| | | public R<Boolean> audit(@RequestBody TTaskAuditDTO dto) throws Exception { |
| | | dto.setAuditTime(LocalDateTime.now()); |
| | | TTask task = taskCleanerService.getById(dto.getTaskId()); |
| | | SysUser auditPerson = sysUserService.selectUserById(tokenService.getLoginUser().getUserId()); |
| | | SysUser sysUser = sysUserService.selectUserById(Long.valueOf(task.getPatrolInspector())); |
| | | |
| | | TTaskDetail one = taskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, dto.getTaskId()) |
| | |
| | | // 增加消息 |
| | | tNotice.setNoticeType(1); |
| | | tNotice.setNoticeContent("【" + location.getLocationName() + "】任务不合格,请重新上传!"); |
| | | |
| | | if (sysUser!=null){ |
| | | |
| | | |
| | | switch (noticeSet.getNoticeType()) { |
| | | case 1: |
| | | msgUtils.sendMsg1(sysUser.getPhonenumber(),location.getLocationName(),"驳回"); |
| | |
| | | } |
| | | break; |
| | | case 3: |
| | | if (StringUtils.hasLength(sysUser.getOpenId())){ |
| | | templateMessageSendUtil.wxTemplateTaskResultRequest(sysUser.getOpenId(), |
| | | location.getLocationName(),"驳回",auditPerson.getNickName()); |
| | | } |
| | | break; |
| | | |
| | | } |
| | |
| | | } |
| | | break; |
| | | case 3: |
| | | if (StringUtils.hasLength(sysUser.getOpenId())){ |
| | | templateMessageSendUtil.wxTemplateTaskResultRequest(sysUser.getOpenId(), |
| | | location.getLocationName(),"驳回",auditPerson.getNickName()); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | |
| | | List<TTaskDetail> tTaskDetails = new ArrayList<>(); |
| | | List<TLocation> locations = locationService.list(); |
| | | List<SysUser> sysUsers = sysUserService.selectAllList(); |
| | | SysUser auditPerson = sysUserService.selectUserById(tokenService.getLoginUser().getUserId()); |
| | | |
| | | List<TTaskDetail> taskDetails = taskDetailService.list(Wrappers.lambdaQuery(TTaskDetail.class) |
| | | .in(TTaskDetail::getTaskId, Arrays.asList(dto.getTaskIds().split(","))) |
| | | .eq(TTaskDetail::getHandleType,1) |
| | |
| | | } |
| | | break; |
| | | case 3: |
| | | if (StringUtils.hasLength(sysUser.getOpenId())){ |
| | | templateMessageSendUtil.wxTemplateTaskResultRequest(sysUser.getOpenId(), |
| | | location.getLocationName(),"驳回",auditPerson.getNickName()); |
| | | } |
| | | break; |
| | | } |
| | | } |