更新检测相关功能

This commit is contained in:
许允枞 2024-11-05 18:04:02 +08:00
parent 538067d7e0
commit ef1cd46a97
7 changed files with 37 additions and 11 deletions

View File

@ -140,8 +140,9 @@ public class InspectionInfoController extends BaseController {
* @param inspectionWorkNode
*/
@PostMapping("controls")
public void controls(@RequestBody InspectionWorkNode inspectionWorkNode){
public CommonResult controls(@RequestBody InspectionWorkNode inspectionWorkNode){
inspectionWorkNodeService.updateImageAndStep(inspectionWorkNode);
return success("操作成功");
}
/**

View File

@ -291,7 +291,7 @@ public class ShopInspectionGoodsController extends BaseController
*/
@GetMapping("/partnerGoodsListCol")
public CommonResult partnerGoodsListCol() throws Exception {
ShopMallPartners partners = appInspectionPartnerService.shopInfo();
ShopMallPartners partners = appInspectionPartnerService.shopInfoByUserId();
return success(shopInspectionGoodsService.partnerGoodsListCol(partners.getPartnerId()));
}

View File

@ -196,7 +196,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
@Override
public ShopMallPartners shopInfoByUserId() throws Exception {
LambdaQueryWrapper<ShopMallPartners> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.orderByDesc(ShopMallPartners::getPartnerId).last("limit 1");
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).last("limit 1");
ShopMallPartners partner = this.getOne(queryWrapper);
if (ObjectUtil.isEmpty(partner)){
throw new Exception("未查询到信息");
@ -1454,9 +1454,11 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
InspectionInfoVo res =new InspectionInfoVo();
BeanUtils.copyProperties(order,res);
res.setInspectionId(info.getId());
res.setWorkerAvatar(Optional.ofNullable(worker.getAvatar()).orElse(null));
res.setWorkerName(Optional.ofNullable(worker.getNickname()).orElse(null));
res.setWorkerPhone(worker.getMobile());
if (ObjectUtil.isNotNull(worker)) {
res.setWorkerAvatar(Optional.ofNullable(worker.getAvatar()).orElse(null));
res.setWorkerName(Optional.ofNullable(worker.getNickname()).orElse(null));
res.setWorkerPhone(worker.getMobile());
}
res.setBuyUserName(Optional.ofNullable(buyUser.getNickname()).orElse(""));
res.setBuyUserPhone(buyUser.getMobile());
res.setCarNum(info.getCarNum());

View File

@ -119,7 +119,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
@Transactional(rollbackFor = Exception.class)
public int insertInspectionInfo(InspectionInfo inspectionInfo) throws Exception {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
ShopMallPartners partners = appInspectionPartnerService.shopInfo();
ShopMallPartners partners = appInspectionPartnerService.shopInfoByUserId();
if (ObjectUtils.isEmpty(inspectionInfo.getInspectionWorkNodes())) {
throw new RuntimeException("请选择检测项目");
@ -240,6 +240,8 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
stepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
stepInfo.setTitle("检测开始");
stepInfo.setContent("检测开始");
stepInfo.setCreateTime(new Date());
stepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
boolean save = inspectionStepInfoService.save(stepInfo);
return save ? 1 : 0;
}

View File

@ -160,6 +160,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
//步骤结束
inspectionStepInfo = new InspectionStepInfo();
inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(workNode.getInspectionInfoId())));
inspectionStepInfo.setTitle(stepTitle);
inspectionStepInfo.setContent(stepTitle);
inspectionStepInfo.setCreateTime(DateUtil.date());
@ -213,7 +214,8 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
* @param inspectionWorkNode
*/
public void returnInspectionInfo(InspectionWorkNode inspectionWorkNode){
// 通过
// 获取当前登录人
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
//通过工单id获取工单
InspectionInfo info = inspectionInfoService.getById(inspectionWorkNode.getInspectionInfoId());
info.setIsPass("0");
@ -226,7 +228,22 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
stepInfo.setInspectionInfoId(Integer.parseInt(inspectionWorkNode.getInspectionInfoId().toString()));
stepInfo.setTitle("退办理");
stepInfo.setContent("退办理");
stepInfo.setCreateTime(DateUtil.date());
stepInfo.setCreator(Integer.parseInt(loginUser.getId().toString()));
inspectionStepService.save(stepInfo);
stepInfo = new InspectionStepInfo();
stepInfo.setInspectionInfoId(Integer.parseInt(inspectionWorkNode.getInspectionInfoId().toString()));
stepInfo.setTitle("检测结束");
stepInfo.setContent("检测结束");
stepInfo.setCreateTime(DateUtil.date());
stepInfo.setCreator(Integer.parseInt(loginUser.getId().toString()));
inspectionStepService.save(stepInfo);
//将流程节点改为已完成
InspectionWorkNode byId = this.getById(inspectionWorkNode.getId());
byId.setStatus("2");
baseMapper.updateById(byId);
}
/**
@ -239,6 +256,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
//通过工单id获取工单
InspectionInfo info = inspectionInfoService.getById(inspectionWorkNode.getInspectionInfoId());
info.setIsRetrial("1");
info.setIsPass("0");
info.setNowOrderNum(workNode.getOrderNum());
// 将选择的重审项目之后的所有项目设置为待开始

View File

@ -8,5 +8,6 @@
FROM inspection_work_node wn
LEFT JOIN inspection_project ip ON ip.id = wn.project_id
WHERE wn.inspection_info_id = #{inspectionId}
ORDER BY wn.order_num ASC
</select>
</mapper>

View File

@ -270,11 +270,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
ii.*,
iwn.id AS workNodeId,
iwn.status AS workNodeStatus
iwn.status AS workNodeStatus,
oi.order_no AS orderNo,
oi.phonenumber AS buyPhone
FROM
inspection_info ii
JOIN
inspection_work_node iwn ON ii.id = iwn.inspection_info_id
JOIN order_info oi ON ii.inspection_order_id = oi.id
<where>
-- ii.status = '0' -- 工单正在进行中
-- ii.now_order_num = iwn.order_num -- 当前工单步骤与流程节点顺序一致
@ -298,9 +301,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectionInfo.status == 3">
AND iwn.status = '2' AND iwn.deal_user_id = #{inspectionInfo.dealUserId}
</if>
</where>
ORDER BY ii.create_time DESC
</select>
</mapper>