From 035d61cb3359b99ac983f70c19b934d488040d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Fri, 15 Nov 2024 17:46:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionInfoController.java | 13 ++- .../inspection/entity/InspectionStepInfo.java | 2 + .../inspection/entity/InspectionWorkNode.java | 5 + .../mapper/InspectionWorkNodeMapper.java | 6 ++ .../service/IInspectionWorkNodeService.java | 6 ++ .../impl/InspectionInfoServiceImpl.java | 2 +- .../impl/InspectionWorkNodeServiceImpl.java | 101 ++++++++++++------ .../mapper/InspectionWorkNodeMapper.xml | 9 ++ .../inspection/InspectionInfoMapper.xml | 8 +- 9 files changed, 117 insertions(+), 35 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java index 8bfb43f0..b275071d 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java @@ -63,7 +63,7 @@ public class InspectionInfoController extends BaseController { /** * 获取【请填写功能名称】详细信息 */ - @PreAuthorize("@ss.hasPermi('system:info:query')") +// @PreAuthorize("@ss.hasPermi('system:info:query')") @GetMapping(value = "/{id}") public CommonResult getInfo(@PathVariable("id") Long id) { return success(inspectionInfoService.selectInspectionInfoById(id)); @@ -242,4 +242,15 @@ public class InspectionInfoController extends BaseController { inspectionWorkNode.setDealUserId(loginUser.getId()); return success(inspectionWorkNodeService.getRoyaltySum(inspectionWorkNode)); } + + /** + * 重新审核 + * @param inspectionWorkNode + * @return + */ + @PostMapping("recheck") + public CommonResult recheck(@RequestBody InspectionWorkNode inspectionWorkNode){ + inspectionWorkNodeService.recheck(inspectionWorkNode); + return success("操作成功"); + } } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionStepInfo.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionStepInfo.java index 9fdaa285..bafac7a6 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionStepInfo.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionStepInfo.java @@ -40,6 +40,8 @@ public class InspectionStepInfo extends Model { private Date updateTime; //更新人id private Integer updater; + //检测节点id + private String workNodeId; @TableField(exist = false) private String nickname; } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionWorkNode.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionWorkNode.java index 4c1536fe..8e3a1054 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionWorkNode.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/entity/InspectionWorkNode.java @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.IdType; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; +import java.util.List; + import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -98,4 +100,7 @@ public class InspectionWorkNode extends TenantBaseDO { private String rescueStart; @TableField(exist = false) private String rescueEnd; + /*重检或复检时需要传*/ + @TableField(exist = false) + private List workNodes; } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionWorkNodeMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionWorkNodeMapper.java index 50e9d5f0..d2bcaf7d 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionWorkNodeMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/InspectionWorkNodeMapper.java @@ -31,4 +31,10 @@ public interface InspectionWorkNodeMapper extends BaseMapper Map getRoyaltySum(@Param("inspectionWorkNode") InspectionWorkNode inspectionWorkNode); void cancelAnOrder(InspectionWorkNode workNode); + + /** + * 批量修改检测状态 + * @param workNodes + */ + void recheck(@Param("list") List workNodes); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionWorkNodeService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionWorkNodeService.java index e838d732..526ee66e 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionWorkNodeService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/IInspectionWorkNodeService.java @@ -54,4 +54,10 @@ public interface IInspectionWorkNodeService extends IService IPage getRoyaltyList(IPage page, InspectionWorkNode inspectionWorkNode); Map getRoyaltySum(InspectionWorkNode inspectionWorkNode); + + /** + * 重新检测 + * @param workNodes + */ + void recheck(InspectionWorkNode workNodes); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java index 42f707b9..98cb040f 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java @@ -300,7 +300,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl workerQueryWrapper = new LambdaQueryWrapper<>(); workerQueryWrapper.eq(PartnerWorker::getUserId, loginUser.getId()).eq(PartnerWorker::getPartnerId, partners.getPartnerId()); - PartnerWorker worker = workerService.getOne(workerQueryWrapper); +// PartnerWorker worker = workerService.getOne(workerQueryWrapper); AdminUserDO workerUser = userService.getUser(loginUser.getId()); // if (ObjectUtils.isNotEmpty(worker)) { inspectionInfo.setWorkId(workerUser.getId()); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java index 2f00dffa..aa5ebb0d 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionWorkNodeServiceImpl.java @@ -96,21 +96,21 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl() - .eq(DlInspectionProject::getId, workNode.getProjectId())); - - InspectionStepInfo inspectionStepInfo = new InspectionStepInfo(); - inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId()))); - if (ObjectUtil.isNotNull(project)) { - inspectionStepInfo.setTitle(project.getProjectName() + "项目开始检测"); - } else { - inspectionStepInfo.setTitle("项目检测开始"); - } - inspectionStepInfo.setCreateTime(DateUtil.date()); - inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(workerUser.getId()))); - inspectionStepService.save(inspectionStepInfo); +// //新增步骤 +// //根据projectId查询项目名称 +// DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper() +// .eq(DlInspectionProject::getId, workNode.getProjectId())); +// +// InspectionStepInfo inspectionStepInfo = new InspectionStepInfo(); +// inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId()))); +// if (ObjectUtil.isNotNull(project)) { +// inspectionStepInfo.setTitle(project.getProjectName() + "项目开始检测"); +// } else { +// inspectionStepInfo.setTitle("项目检测开始"); +// } +// inspectionStepInfo.setCreateTime(DateUtil.date()); +// inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(workerUser.getId()))); +// inspectionStepService.save(inspectionStepInfo); } /** @@ -173,13 +173,19 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(InspectionWorkNode::getInspectionInfoId, workNode.getInspectionInfoId()); + //是否还有进行中或者待开始的状态 + queryWrapper.in(InspectionWorkNode::getStatus, "0","1"); List inspectionWorkNodes = this.list(queryWrapper); - //判断当前是否是最后一个项目 根据顺序号判断 - boolean flag = hasNextNode(inspectionWorkNodes, workNode); + boolean flag = true; + //判断是否是最后一个流程 + if (inspectionWorkNodes.size() == 1 && inspectionWorkNodes.get(0).getId().equals(workNode.getId())){ + flag = false; + } + // 插入步骤信息 InspectionStepInfo inspectionStepInfo = new InspectionStepInfo(); @@ -200,6 +206,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl listByUserId = roleService.getListByUserId(nextNode.getRoleId()); - List ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList()); - if (ObjectUtil.isNotNull(inspectionInfo.getLeadManId())){ - ids.add(inspectionInfo.getLeadManId()); - } - sendSocketMessage(ids); } +// else { +// //修改工单表当前流程 +// inspectionInfo.setNowOrderNum(workNode.getOrderNum() + 1); +// //获取下一节点 +// InspectionWorkNode nextNode = getNextNode(inspectionWorkNodes, workNode); +// /*给下一单人员发送信息*/ +// List listByUserId = roleService.getListByUserId(nextNode.getRoleId()); +// List ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList()); +// if (ObjectUtil.isNotNull(inspectionInfo.getLeadManId())){ +// ids.add(inspectionInfo.getLeadManId()); +// } +// sendSocketMessage(ids); +// } //将节点状态改为已完成 inspectionWorkNode.setStatus("2"); @@ -295,6 +303,38 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl + + UPDATE inspection_work_node + SET status = '0', deal_user_id = null, deal_user_name = null, deal_images = null, remark = null + WHERE id in ( + + #{item.id} + + ) + @@ -45,8 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"