This commit is contained in:
许允枞 2024-11-15 17:46:37 +08:00
parent 4662ae356e
commit 035d61cb33
9 changed files with 117 additions and 35 deletions

View File

@ -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("操作成功");
}
}

View File

@ -40,6 +40,8 @@ public class InspectionStepInfo extends Model<InspectionStepInfo> {
private Date updateTime;
//更新人id
private Integer updater;
//检测节点id
private String workNodeId;
@TableField(exist = false)
private String nickname;
}

View File

@ -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<InspectionWorkNode> workNodes;
}

View File

@ -31,4 +31,10 @@ public interface InspectionWorkNodeMapper extends BaseMapper<InspectionWorkNode>
Map getRoyaltySum(@Param("inspectionWorkNode") InspectionWorkNode inspectionWorkNode);
void cancelAnOrder(InspectionWorkNode workNode);
/**
* 批量修改检测状态
* @param workNodes
*/
void recheck(@Param("list") List<InspectionWorkNode> workNodes);
}

View File

@ -54,4 +54,10 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
IPage<Map> getRoyaltyList(IPage page, InspectionWorkNode inspectionWorkNode);
Map getRoyaltySum(InspectionWorkNode inspectionWorkNode);
/**
* 重新检测
* @param workNodes
*/
void recheck(InspectionWorkNode workNodes);
}

View File

@ -300,7 +300,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
ShopMallPartners partners = appInspectionPartnerService.shopInfo();
LambdaQueryWrapper<PartnerWorker> 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());

View File

@ -96,21 +96,21 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
inspectionInfo.setWorkerPhone(workerUser.getMobile());
inspectionInfoService.updateById(inspectionInfo);
//新增步骤
//根据projectId查询项目名称
DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper<DlInspectionProject>()
.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<DlInspectionProject>()
// .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<InspectionWorkNod
//根据工单id查询工单
InspectionInfo inspectionInfo = inspectionInfoService.selectInspectionInfoById(workNode.getInspectionInfoId());
//判断是否是最后一个项目 根据工单id查询
//判断是否是还有项目完成 根据工单id查询
//根据工单id查询流程列表
LambdaQueryWrapper<InspectionWorkNode> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(InspectionWorkNode::getInspectionInfoId, workNode.getInspectionInfoId());
//是否还有进行中或者待开始的状态
queryWrapper.in(InspectionWorkNode::getStatus, "0","1");
List<InspectionWorkNode> 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<InspectionWorkNod
if (ObjectUtil.isNotEmpty(inspectionWorkNode.getDealImages())) {
inspectionStepInfo.setImages(inspectionWorkNode.getDealImages());
}
inspectionStepInfo.setWorkNodeId(workNode.getId());
inspectionStepInfo.setCreateTime(DateUtil.date());
inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
inspectionStepService.save(inspectionStepInfo);
@ -221,19 +228,20 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
inspectionStepInfo.setCreateTime(DateUtil.date());
inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
inspectionStepService.save(inspectionStepInfo);
} else {
//修改工单表当前流程
inspectionInfo.setNowOrderNum(workNode.getOrderNum() + 1);
//获取下一节点
InspectionWorkNode nextNode = getNextNode(inspectionWorkNodes, workNode);
/*给下一单人员发送信息*/
List<UserDTO> listByUserId = roleService.getListByUserId(nextNode.getRoleId());
List<Long> 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<UserDTO> listByUserId = roleService.getListByUserId(nextNode.getRoleId());
// List<Long> 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<InspectionWorkNod
return baseMapper.getRoyaltySum(inspectionWorkNode);
}
/**
* 重新检测
*
* @param workNodes
*/
@Override
public void recheck(InspectionWorkNode workNodes) {
//获取当前登陆人
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
//将传递过来的流程节点全部改为未进行
baseMapper.recheck(workNodes.getWorkNodes());
//将检测工单设置为重审
InspectionInfo info = inspectionInfoService.getById(workNodes.getInspectionInfoId());
info.setIsRetrial("1");
info.setIsPass("0");
//更新工单表
inspectionInfoService.updateById(info);
// 添加步骤信息表
InspectionStepInfo stepInfo = new InspectionStepInfo();
stepInfo.setInspectionInfoId(Integer.parseInt(workNodes.getInspectionInfoId().toString()));
stepInfo.setTitle("重审");
stepInfo.setCreateTime(DateUtil.date());
stepInfo.setCreator(Integer.parseInt(loginUser.getId().toString()));
if (ObjectUtil.isNotEmpty(workNodes.getRemark())) {
stepInfo.setContent(workNodes.getRemark());
}
if (ObjectUtil.isNotEmpty(workNodes.getDealImages())) {
stepInfo.setImages(workNodes.getDealImages());
}
inspectionStepService.save(stepInfo);
}
/**
* 判断传入的 InspectionWorkNode 对象是否在集合中有后续项目
*
@ -392,6 +432,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
// 添加步骤信息表
InspectionStepInfo stepInfo = new InspectionStepInfo();
stepInfo.setInspectionInfoId(Integer.parseInt(inspectionWorkNode.getInspectionInfoId().toString()));
stepInfo.setWorkNodeId(inspectionWorkNode.getId());
stepInfo.setTitle("重审");
if (ObjectUtil.isNotEmpty(inspectionWorkNode.getRemark())) {
stepInfo.setContent(inspectionWorkNode.getRemark());

View File

@ -6,6 +6,15 @@
SET status = '0', deal_user_id = null, deal_user_name = null, deal_images = null, remark = null
WHERE id = #{id} AND inspection_info_id = #{inspectionInfoId}
</update>
<update id="recheck">
UPDATE inspection_work_node
SET status = '0', deal_user_id = null, deal_user_name = null, deal_images = null, remark = null
WHERE id in (
<foreach collection="list" item="item" separator=",">
#{item.id}
</foreach>
)
</update>
<select id="getWeorkNodesById" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionWorkNode"
parameterType="java.lang.Integer">

View File

@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectInspectionInfoVo">
select id, inspection_order_id, work_id, worker_name, worker_phone, is_pass, status, start_time, end_time, year, month, day, create_time, creator, update_time, updater from inspection_info
select id,buy_name,buy_phone,user_address, inspection_order_id, work_id, worker_name, worker_phone, is_pass, status, start_time, end_time, year, month, day, create_time, creator, update_time, updater from inspection_info
</sql>
<select id="selectInspectionInfoList" parameterType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo" resultMap="InspectionInfoResult">
@ -45,8 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectInspectionInfoById" parameterType="Long" resultMap="InspectionInfoResult">
<include refid="selectInspectionInfoVo"/>
where id = #{id}
select info.*,o.sku_name,o.sku_id,o.goods_id
from inspection_info info
left join order_info o on info.inspection_order_id = o.id
where info.id = #{id}
</select>
<insert id="insertInspectionInfo" parameterType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">