Compare commits
	
		
			No commits in common. "d5bab8289b76ab19ab89f97324fdd7f58734cf43" and "21e8ccab3501b6aa0e7447e6bfdf284ac81de718" have entirely different histories.
		
	
	
		
			d5bab8289b
			...
			21e8ccab35
		
	
		
| @ -37,7 +37,6 @@ public class InspectionStepInfo extends Model<InspectionStepInfo> { | |||||||
|     //创建人id |     //创建人id | ||||||
|     private Integer creator; |     private Integer creator; | ||||||
|     //更新时间 |     //更新时间 | ||||||
|     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |  | ||||||
|     private Date updateTime; |     private Date updateTime; | ||||||
|     //更新人id |     //更新人id | ||||||
|     private Integer updater; |     private Integer updater; | ||||||
|  | |||||||
| @ -1458,7 +1458,6 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa | |||||||
|     public InspectionInfoVo inspectionDetail(Long inspectionInfoId) { |     public InspectionInfoVo inspectionDetail(Long inspectionInfoId) { | ||||||
|         InspectionInfo info = inspectionInfoService.getById(inspectionInfoId); |         InspectionInfo info = inspectionInfoService.getById(inspectionInfoId); | ||||||
|         OrderInfo order = orderService.getById(info.getInspectionOrderId()); |         OrderInfo order = orderService.getById(info.getInspectionOrderId()); | ||||||
|         InspectionGoodsSku sku = skuService.getById(order.getSkuId()); |  | ||||||
|         AdminUserDO buyUser = userService.getUser(info.getUserId()); |         AdminUserDO buyUser = userService.getUser(info.getUserId()); | ||||||
|         AdminUserDO worker = userService.getUser(info.getWorkId()); |         AdminUserDO worker = userService.getUser(info.getWorkId()); | ||||||
|         InspectionInfoVo res =new  InspectionInfoVo(); |         InspectionInfoVo res =new  InspectionInfoVo(); | ||||||
| @ -1486,7 +1485,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa | |||||||
|         res.setStatus(info.getStatus()); |         res.setStatus(info.getStatus()); | ||||||
|         res.setGoodsId(order.getGoodsId()); |         res.setGoodsId(order.getGoodsId()); | ||||||
|         res.setGoodsPrice(order.getGoodsPrice()); |         res.setGoodsPrice(order.getGoodsPrice()); | ||||||
|         res.setGoodsName(sku.getSkuName()); |         res.setGoodsName(order.getGoodsTitle()); | ||||||
|         res.setIsOnline(order.getIsOnline()); |         res.setIsOnline(order.getIsOnline()); | ||||||
|         res.setIsRetrial(info.getIsRetrial()); |         res.setIsRetrial(info.getIsRetrial()); | ||||||
|         res.setIsPass(info.getIsPass()); |         res.setIsPass(info.getIsPass()); | ||||||
|  | |||||||
| @ -28,7 +28,6 @@ import org.springframework.stereotype.Service; | |||||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||||
| 
 | 
 | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
| import java.time.LocalDateTime; |  | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| import java.util.Map; | import java.util.Map; | ||||||
| @ -91,21 +90,6 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod | |||||||
|         //更新 |         //更新 | ||||||
|         this.updateById(workNode); |         this.updateById(workNode); | ||||||
| 
 | 
 | ||||||
|         // 插入步骤信息 |  | ||||||
|         InspectionStepInfo inspectionStepInfo = new InspectionStepInfo(); |  | ||||||
|         inspectionStepInfo.setInspectionInfoId(inspectionId); |  | ||||||
|         DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper<DlInspectionProject>() |  | ||||||
|                 .eq(DlInspectionProject::getId, workNode.getProjectId())); |  | ||||||
|         if (ObjectUtil.isNotNull(project)) { |  | ||||||
|             inspectionStepInfo.setTitle(project.getProjectName()); |  | ||||||
|         } else { |  | ||||||
|             inspectionStepInfo.setTitle("检测项目"); |  | ||||||
|         } |  | ||||||
|         inspectionStepInfo.setCreateTime(DateUtil.date()); |  | ||||||
|         inspectionStepInfo.setCreator(Integer.parseInt(SecurityFrameworkUtils.getLoginUserId() + "")); |  | ||||||
|         inspectionStepInfo.setWorkNodeId(workNodeId); |  | ||||||
|         inspectionStepService.save(inspectionStepInfo); |  | ||||||
| 
 |  | ||||||
|         //查询用户 信息 |         //查询用户 信息 | ||||||
|         //修改工单表中当前施工人 |         //修改工单表中当前施工人 | ||||||
| //        inspectionInfo.setWorkId(workerUser.getId()); | //        inspectionInfo.setWorkId(workerUser.getId()); | ||||||
| @ -159,16 +143,6 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod | |||||||
|         // 更新流程 |         // 更新流程 | ||||||
| //        this.updateById(workNode); | //        this.updateById(workNode); | ||||||
|         baseMapper.cancelAnOrder(workNode); |         baseMapper.cancelAnOrder(workNode); | ||||||
| 
 |  | ||||||
|         // 删除步骤信息 |  | ||||||
|         DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper<DlInspectionProject>() |  | ||||||
|                 .eq(DlInspectionProject::getId, workNode.getProjectId())); |  | ||||||
|         inspectionStepService.remove(new LambdaQueryWrapper<InspectionStepInfo>() |  | ||||||
|                 .and(i -> |  | ||||||
|                         i.eq(InspectionStepInfo::getInspectionInfoId, inspectionId) |  | ||||||
|                                 .eq(InspectionStepInfo::getWorkNodeId, workNodeId) |  | ||||||
|                                 .eq(InspectionStepInfo::getTitle, project.getProjectName()) |  | ||||||
|                 )); |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
| @ -205,46 +179,40 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod | |||||||
|         LambdaQueryWrapper<InspectionWorkNode> queryWrapper = new LambdaQueryWrapper<>(); |         LambdaQueryWrapper<InspectionWorkNode> queryWrapper = new LambdaQueryWrapper<>(); | ||||||
|         queryWrapper.eq(InspectionWorkNode::getInspectionInfoId, workNode.getInspectionInfoId()); |         queryWrapper.eq(InspectionWorkNode::getInspectionInfoId, workNode.getInspectionInfoId()); | ||||||
|         //是否还有进行中或者待开始的状态 |         //是否还有进行中或者待开始的状态 | ||||||
|         queryWrapper.in(InspectionWorkNode::getStatus, "0", "1"); |         queryWrapper.in(InspectionWorkNode::getStatus, "0","1"); | ||||||
|         List<InspectionWorkNode> inspectionWorkNodes = this.list(queryWrapper); |         List<InspectionWorkNode> inspectionWorkNodes = this.list(queryWrapper); | ||||||
|         boolean flag = true; |         boolean flag = true; | ||||||
|         //判断是否是最后一个流程 |         //判断是否是最后一个流程 | ||||||
|         if (inspectionWorkNodes.size() == 1 && inspectionWorkNodes.get(0).getId().equals(workNode.getId())) { |         if (inspectionWorkNodes.size() == 1 && inspectionWorkNodes.get(0).getId().equals(workNode.getId())){ | ||||||
|             flag = false; |             flag = false; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // 更新或插入步骤信息 | 
 | ||||||
|  |         // 插入步骤信息 | ||||||
|  |         InspectionStepInfo inspectionStepInfo = new InspectionStepInfo(); | ||||||
|  |         inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(workNode.getInspectionInfoId()))); | ||||||
|  | 
 | ||||||
|  |         //根据projectId查询项目名称 | ||||||
|         DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper<DlInspectionProject>() |         DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper<DlInspectionProject>() | ||||||
|                 .eq(DlInspectionProject::getId, workNode.getProjectId())); |                 .eq(DlInspectionProject::getId, workNode.getProjectId())); | ||||||
|         InspectionStepInfo stepInfo = inspectionStepService.getOne(new LambdaQueryWrapper<InspectionStepInfo>() |         String stepTitle = ""; | ||||||
|                 .and(i -> i.eq(InspectionStepInfo::getInspectionInfoId, workNode.getInspectionInfoId()) |  | ||||||
|                         .eq(InspectionStepInfo::getWorkNodeId, workNode.getId()) |  | ||||||
|                         .eq(InspectionStepInfo::getTitle, ObjectUtil.isNotEmpty(project) ? project.getProjectName() : workNode.getProjectName()) |  | ||||||
|                 )); |  | ||||||
|         if (ObjectUtil.isNotEmpty(stepInfo)) { |  | ||||||
|             stepInfo.setUpdateTime(DateUtil.date()); |  | ||||||
|             stepInfo.setUpdater(Integer.parseInt(SecurityFrameworkUtils.getLoginUserId() + "")); |  | ||||||
|         } else { |  | ||||||
|             stepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(workNode.getInspectionInfoId()))); |  | ||||||
|         if (ObjectUtil.isNotNull(project)) { |         if (ObjectUtil.isNotNull(project)) { | ||||||
|                 stepInfo.setTitle(project.getProjectName()); |             inspectionStepInfo.setTitle(project.getProjectName()); | ||||||
|         } else { |         } else { | ||||||
|                 stepInfo.setTitle("项目检测完成"); |             inspectionStepInfo.setTitle("项目检测完成"); | ||||||
|             } |  | ||||||
|             stepInfo.setWorkNodeId(workNode.getId()); |  | ||||||
|             stepInfo.setCreateTime(DateUtil.date()); |  | ||||||
|             stepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId()))); |  | ||||||
|             stepInfo.setUpdater(Integer.parseInt(String.valueOf(loginUser.getId()))); |  | ||||||
|             stepInfo.setUpdateTime(DateUtil.date()); |  | ||||||
|         } |         } | ||||||
|         if (ObjectUtil.isNotEmpty(inspectionWorkNode.getRemark())) { |         if (ObjectUtil.isNotEmpty(inspectionWorkNode.getRemark())) { | ||||||
|             stepInfo.setContent(inspectionWorkNode.getRemark()); |             inspectionStepInfo.setContent(inspectionWorkNode.getRemark()); | ||||||
|         } |         } | ||||||
|         if (ObjectUtil.isNotEmpty(inspectionWorkNode.getDealImages())) { |         if (ObjectUtil.isNotEmpty(inspectionWorkNode.getDealImages())) { | ||||||
|             stepInfo.setImages(inspectionWorkNode.getDealImages()); |             inspectionStepInfo.setImages(inspectionWorkNode.getDealImages()); | ||||||
|         } |         } | ||||||
|         inspectionStepService.saveOrUpdate(stepInfo); |         inspectionStepInfo.setWorkNodeId(workNode.getId()); | ||||||
|  |         inspectionStepInfo.setCreateTime(DateUtil.date()); | ||||||
|  |         inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId()))); | ||||||
|  |         inspectionStepService.save(inspectionStepInfo); | ||||||
|         if (!flag) { |         if (!flag) { | ||||||
|  |             stepTitle = "检测结束"; | ||||||
|             //设置工单状态为已完成 |             //设置工单状态为已完成 | ||||||
|             inspectionInfo.setStatus("1"); |             inspectionInfo.setStatus("1"); | ||||||
|             //设置工单通过 |             //设置工单通过 | ||||||
| @ -255,12 +223,12 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod | |||||||
|             inspectionInfo.setMakeCert("1"); |             inspectionInfo.setMakeCert("1"); | ||||||
| 
 | 
 | ||||||
|             //步骤结束 |             //步骤结束 | ||||||
|             stepInfo = new InspectionStepInfo(); |             inspectionStepInfo = new InspectionStepInfo(); | ||||||
|             stepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(workNode.getInspectionInfoId()))); |             inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(workNode.getInspectionInfoId()))); | ||||||
|             stepInfo.setTitle("检测结束"); |             inspectionStepInfo.setTitle(stepTitle); | ||||||
|             stepInfo.setCreateTime(DateUtil.date()); |             inspectionStepInfo.setCreateTime(DateUtil.date()); | ||||||
|             stepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId()))); |             inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId()))); | ||||||
|             inspectionStepService.save(stepInfo); |             inspectionStepService.save(inspectionStepInfo); | ||||||
|         } |         } | ||||||
| //        else { | //        else { | ||||||
| //            //修改工单表当前流程 | //            //修改工单表当前流程 | ||||||
| @ -377,7 +345,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod | |||||||
| 
 | 
 | ||||||
|         List<Integer> roleIds = new ArrayList<>(); |         List<Integer> roleIds = new ArrayList<>(); | ||||||
|         /*获取所有的角色id*/ |         /*获取所有的角色id*/ | ||||||
|         if (CollUtil.isNotEmpty(workNodes.getWorkNodes())) { |         if(CollUtil.isNotEmpty(workNodes.getWorkNodes())){ | ||||||
|             roleIds = workNodes.getWorkNodes().stream().map(inspectionWorkNode -> inspectionWorkNode.getRoleId()).collect(Collectors.toList()); |             roleIds = workNodes.getWorkNodes().stream().map(inspectionWorkNode -> inspectionWorkNode.getRoleId()).collect(Collectors.toList()); | ||||||
|         } |         } | ||||||
|         //根据角色id获取所有用户 |         //根据角色id获取所有用户 | ||||||
| @ -463,7 +431,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod | |||||||
|      * |      * | ||||||
|      * @param inspectionWorkNode |      * @param inspectionWorkNode | ||||||
|      */ |      */ | ||||||
|     public void retrial(InspectionWorkNode inspectionWorkNode) { |     public void retrial(InspectionWorkNode inspectionWorkNode){ | ||||||
|         LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); |         LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); | ||||||
|         //通过流程节点id查询流程 |         //通过流程节点id查询流程 | ||||||
|         InspectionWorkNode workNode = this.getById(inspectionWorkNode.getId()); |         InspectionWorkNode workNode = this.getById(inspectionWorkNode.getId()); | ||||||
| @ -486,7 +454,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod | |||||||
|         Integer roleId = workNode.getRoleId(); |         Integer roleId = workNode.getRoleId(); | ||||||
|         List<UserDTO> listByUserId = roleService.getListByUserId(roleId); |         List<UserDTO> listByUserId = roleService.getListByUserId(roleId); | ||||||
|         List<Long> ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList()); |         List<Long> ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList()); | ||||||
|         if (ObjectUtil.isNotNull(info.getLeadManId())) { |         if (ObjectUtil.isNotNull(info.getLeadManId())){ | ||||||
|             ids.add(info.getLeadManId()); |             ids.add(info.getLeadManId()); | ||||||
|         } |         } | ||||||
|         sendSocketMessage(ids); |         sendSocketMessage(ids); | ||||||
|  | |||||||
| @ -269,8 +269,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||||||
|         order by  ins.start_time desc |         order by  ins.start_time desc | ||||||
|     </select> |     </select> | ||||||
|     <select id="selectByUser" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo"> |     <select id="selectByUser" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo"> | ||||||
|         SELECT * |  | ||||||
|         FROM ( |  | ||||||
|     SELECT |     SELECT | ||||||
|         ii.*, |         ii.*, | ||||||
|         iwn.id AS workNodeId, |         iwn.id AS workNodeId, | ||||||
| @ -278,8 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||||||
|         oi.order_no AS orderNo, |         oi.order_no AS orderNo, | ||||||
|         oi.phonenumber AS buyPhone, |         oi.phonenumber AS buyPhone, | ||||||
|         ip.project_name AS projectName, |         ip.project_name AS projectName, | ||||||
|         su.nickname AS leadManName, |         su.nickname AS leadManName | ||||||
|         ROW_NUMBER() OVER (PARTITION BY ii.id ORDER BY iwn.update_time DESC) as rn -- 根据需要调整排序逻辑 |  | ||||||
|     FROM |     FROM | ||||||
|         inspection_info ii |         inspection_info ii | ||||||
|     LEFT JOIN |     LEFT JOIN | ||||||
| @ -322,59 +319,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||||||
|             ORDER BY iwn.update_time DESC |             ORDER BY iwn.update_time DESC | ||||||
|         </if> |         </if> | ||||||
|     </where> |     </where> | ||||||
|         ) AS subquery | </select> | ||||||
|         WHERE rn = 1; |  | ||||||
|         <!-- 之前的查询,修改为了一个工单只出现一条,不分项目 --> |  | ||||||
|         <!--    SELECT--> |  | ||||||
|         <!--        ii.*,--> |  | ||||||
|         <!--        iwn.id AS workNodeId,--> |  | ||||||
|         <!--        iwn.status AS workNodeStatus,--> |  | ||||||
|         <!--        oi.order_no AS orderNo,--> |  | ||||||
|         <!--        oi.phonenumber AS buyPhone,--> |  | ||||||
|         <!--        ip.project_name AS projectName,--> |  | ||||||
|         <!--        su.nickname AS leadManName--> |  | ||||||
|         <!--    FROM--> |  | ||||||
|         <!--        inspection_info ii--> |  | ||||||
|         <!--    LEFT JOIN--> |  | ||||||
|         <!--        inspection_work_node iwn ON ii.id = iwn.inspection_info_id--> |  | ||||||
|         <!--    LEFT JOIN--> |  | ||||||
|         <!--        order_info oi ON ii.inspection_order_id = oi.id--> |  | ||||||
|         <!--    LEFT JOIN--> |  | ||||||
|         <!--        inspection_project ip ON iwn.project_id = ip.id--> |  | ||||||
|         <!--    LEFT JOIN--> |  | ||||||
|         <!--        system_users su ON ii.lead_man_id = su.id--> |  | ||||||
|         <!--        <where>--> |  | ||||||
|         <!--        <!– 车牌号模糊查询 –>--> |  | ||||||
|         <!--        <if test="inspectionInfo.carNum != null">--> |  | ||||||
|         <!--            AND ii.car_num LIKE CONCAT('%', #{inspectionInfo.carNum}, '%')--> |  | ||||||
|         <!--        </if>--> |  | ||||||
|         <!--        <!– 待接受 –>--> |  | ||||||
|         <!--        <if test="inspectionInfo.status == 1">--> |  | ||||||
|         <!--            AND  <!– 工单负责人或角色ID匹配 –>--> |  | ||||||
|         <!--            (ii.lead_man_id = #{inspectionInfo.leadManId}--> |  | ||||||
|         <!--            OR iwn.role_id IN--> |  | ||||||
|         <!--            <foreach collection="roleIds" item="roleId" open="(" separator="," close=")">--> |  | ||||||
|         <!--                #{roleId}--> |  | ||||||
|         <!--            </foreach>)--> |  | ||||||
|         <!--            AND ii.status = '0'--> |  | ||||||
|         <!--            AND iwn.status = '0'--> |  | ||||||
|         <!--            -- AND ii.now_order_num = iwn.order_num--> |  | ||||||
|         <!--            ORDER BY ii.create_time DESC--> |  | ||||||
|         <!--        </if>--> |  | ||||||
|         <!--        <!– 进行中 –>--> |  | ||||||
|         <!--        <if test="inspectionInfo.status == 2">--> |  | ||||||
|         <!--            AND ii.status = '0'--> |  | ||||||
|         <!--            AND iwn.status = '1'--> |  | ||||||
|         <!--            AND iwn.deal_user_id = #{inspectionInfo.dealUserId}--> |  | ||||||
|         <!--            ORDER BY iwn.update_time DESC--> |  | ||||||
|         <!--        </if>--> |  | ||||||
|         <!--        <!– 已完成 –>--> |  | ||||||
|         <!--        <if test="inspectionInfo.status == 3">--> |  | ||||||
|         <!--            AND iwn.status = '2'--> |  | ||||||
|         <!--            AND iwn.deal_user_id = #{inspectionInfo.dealUserId}--> |  | ||||||
|         <!--            ORDER BY iwn.update_time DESC--> |  | ||||||
|         <!--        </if>--> |  | ||||||
|         <!--    </where>--> |  | ||||||
|     </select> |  | ||||||
| 
 | 
 | ||||||
| </mapper> | </mapper> | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user