From 830bc1621fa7dc468c95ce56082a10343c0b830b Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期四, 03 七月 2025 23:12:28 +0800 Subject: [PATCH] 保洁巡检本周代码 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTaskController.java | 44 ++++++++++++++++++-------------------------- 1 files changed, 18 insertions(+), 26 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTaskController.java index 3239352..5bcbb49 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTaskController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTaskController.java @@ -176,6 +176,9 @@ public R<Boolean> audit(@RequestBody TTaskAuditDTO dto) { dto.setAuditTime(LocalDateTime.now()); TTask task = taskCleanerService.getById(dto.getTaskId()); + TTaskDetail one = taskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, dto.getTaskId()) + .orderByDesc(BaseModel::getCreateTime).last("limit 1").one(); + dto.setClearStatus(one.getClearStatus()); TLocation location = locationService.getById(task.getLocationId()); TNotice tNotice = new TNotice(); TNoticeSet noticeSet = noticeSetService.lambdaQuery().eq(TNoticeSet::getType, 2).last("limit 1") @@ -198,38 +201,25 @@ // 如果是初次审核就通过 将状态设置为已完成 List<TTaskDetail> list = tTaskDetailService.lambdaQuery().eq(TTaskDetail::getTaskId, dto.getTaskId()).list(); if (list.isEmpty()){ - if (dto.getClearStatus()==1){ task.setStatus(6); taskCleanerService.updateById(task); - }else{ - task.setStatus(4); - taskCleanerService.updateById(task); -// 增加消息 - tNotice.setNoticeType(1); - tNotice.setNoticeContent("【"+location.getLocationName()+"】任务不合格,请重新上传!"); - } - - }else{ - if (dto.getClearStatus()==1){ - task.setStatus(5); - taskCleanerService.updateById(task); - // 增加消息 tNotice.setNoticeType(2); tNotice.setNoticeContent("【"+location.getLocationName()+"】任务已通过"); - }else{ - task.setStatus(4); - taskCleanerService.updateById(task); - // 增加消息 - tNotice.setNoticeType(1); - tNotice.setNoticeContent("【"+location.getLocationName()+"】任务不合格,请重新上传!"); - } - + }else{ + task.setStatus(5); + taskCleanerService.updateById(task); + tNotice.setNoticeType(2); + tNotice.setNoticeContent("【"+location.getLocationName()+"】任务已通过"); } - } noticeService.save(tNotice); dto.setAuditPerson(tokenService.getLoginUser().getUserId()+""); taskDetailService.save(dto); + one.setAuditPerson(tokenService.getLoginUser().getUserId()+""); + one.setAuditTime(LocalDateTime.now()); + one.setAuditRemark(dto.getAuditRemark()); + one.setAuditStatus(dto.getAuditStatus()); + taskDetailService.updateById(one); return R.ok(); } @Log(title = "批量审核任务", businessType = BusinessType.UPDATE) @@ -340,9 +330,11 @@ byId4.setUnqualifiedName(byId3.getDataContent()); } } - SysUser sysUser = sysUserService.selectUserById(Long.valueOf(byId4.getAuditPerson())); - if (sysUser!=null){ - byId4.setAuditPersonName(sysUser.getUserName()); + if (byId4.getAuditPerson()!=null){ + SysUser sysUser = sysUserService.selectUserById(Long.valueOf(byId4.getAuditPerson())); + if (sysUser!=null){ + byId4.setAuditPersonName(sysUser.getUserName()); + } } taskDetailVO.setTaskDetail(byId4); return R.ok(taskDetailVO); -- Gitblit v1.7.1