更新检测相关功能
This commit is contained in:
parent
538067d7e0
commit
ef1cd46a97
@ -140,8 +140,9 @@ public class InspectionInfoController extends BaseController {
|
|||||||
* @param inspectionWorkNode
|
* @param inspectionWorkNode
|
||||||
*/
|
*/
|
||||||
@PostMapping("controls")
|
@PostMapping("controls")
|
||||||
public void controls(@RequestBody InspectionWorkNode inspectionWorkNode){
|
public CommonResult controls(@RequestBody InspectionWorkNode inspectionWorkNode){
|
||||||
inspectionWorkNodeService.updateImageAndStep(inspectionWorkNode);
|
inspectionWorkNodeService.updateImageAndStep(inspectionWorkNode);
|
||||||
|
return success("操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -291,7 +291,7 @@ public class ShopInspectionGoodsController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/partnerGoodsListCol")
|
@GetMapping("/partnerGoodsListCol")
|
||||||
public CommonResult partnerGoodsListCol() throws Exception {
|
public CommonResult partnerGoodsListCol() throws Exception {
|
||||||
ShopMallPartners partners = appInspectionPartnerService.shopInfo();
|
ShopMallPartners partners = appInspectionPartnerService.shopInfoByUserId();
|
||||||
return success(shopInspectionGoodsService.partnerGoodsListCol(partners.getPartnerId()));
|
return success(shopInspectionGoodsService.partnerGoodsListCol(partners.getPartnerId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
@Override
|
@Override
|
||||||
public ShopMallPartners shopInfoByUserId() throws Exception {
|
public ShopMallPartners shopInfoByUserId() throws Exception {
|
||||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ShopMallPartners> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.orderByDesc(ShopMallPartners::getPartnerId).last("limit 1");
|
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).last("limit 1");
|
||||||
ShopMallPartners partner = this.getOne(queryWrapper);
|
ShopMallPartners partner = this.getOne(queryWrapper);
|
||||||
if (ObjectUtil.isEmpty(partner)){
|
if (ObjectUtil.isEmpty(partner)){
|
||||||
throw new Exception("未查询到信息");
|
throw new Exception("未查询到信息");
|
||||||
@ -1454,9 +1454,11 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
InspectionInfoVo res =new InspectionInfoVo();
|
InspectionInfoVo res =new InspectionInfoVo();
|
||||||
BeanUtils.copyProperties(order,res);
|
BeanUtils.copyProperties(order,res);
|
||||||
res.setInspectionId(info.getId());
|
res.setInspectionId(info.getId());
|
||||||
|
if (ObjectUtil.isNotNull(worker)) {
|
||||||
res.setWorkerAvatar(Optional.ofNullable(worker.getAvatar()).orElse(null));
|
res.setWorkerAvatar(Optional.ofNullable(worker.getAvatar()).orElse(null));
|
||||||
res.setWorkerName(Optional.ofNullable(worker.getNickname()).orElse(null));
|
res.setWorkerName(Optional.ofNullable(worker.getNickname()).orElse(null));
|
||||||
res.setWorkerPhone(worker.getMobile());
|
res.setWorkerPhone(worker.getMobile());
|
||||||
|
}
|
||||||
res.setBuyUserName(Optional.ofNullable(buyUser.getNickname()).orElse(""));
|
res.setBuyUserName(Optional.ofNullable(buyUser.getNickname()).orElse(""));
|
||||||
res.setBuyUserPhone(buyUser.getMobile());
|
res.setBuyUserPhone(buyUser.getMobile());
|
||||||
res.setCarNum(info.getCarNum());
|
res.setCarNum(info.getCarNum());
|
||||||
|
@ -119,7 +119,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int insertInspectionInfo(InspectionInfo inspectionInfo) throws Exception {
|
public int insertInspectionInfo(InspectionInfo inspectionInfo) throws Exception {
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
ShopMallPartners partners = appInspectionPartnerService.shopInfo();
|
ShopMallPartners partners = appInspectionPartnerService.shopInfoByUserId();
|
||||||
|
|
||||||
if (ObjectUtils.isEmpty(inspectionInfo.getInspectionWorkNodes())) {
|
if (ObjectUtils.isEmpty(inspectionInfo.getInspectionWorkNodes())) {
|
||||||
throw new RuntimeException("请选择检测项目");
|
throw new RuntimeException("请选择检测项目");
|
||||||
@ -240,6 +240,8 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
|||||||
stepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
|
stepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
|
||||||
stepInfo.setTitle("检测开始");
|
stepInfo.setTitle("检测开始");
|
||||||
stepInfo.setContent("检测开始");
|
stepInfo.setContent("检测开始");
|
||||||
|
stepInfo.setCreateTime(new Date());
|
||||||
|
stepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
|
||||||
boolean save = inspectionStepInfoService.save(stepInfo);
|
boolean save = inspectionStepInfoService.save(stepInfo);
|
||||||
return save ? 1 : 0;
|
return save ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
@ -160,6 +160,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
|||||||
|
|
||||||
//步骤结束
|
//步骤结束
|
||||||
inspectionStepInfo = new InspectionStepInfo();
|
inspectionStepInfo = new InspectionStepInfo();
|
||||||
|
inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(workNode.getInspectionInfoId())));
|
||||||
inspectionStepInfo.setTitle(stepTitle);
|
inspectionStepInfo.setTitle(stepTitle);
|
||||||
inspectionStepInfo.setContent(stepTitle);
|
inspectionStepInfo.setContent(stepTitle);
|
||||||
inspectionStepInfo.setCreateTime(DateUtil.date());
|
inspectionStepInfo.setCreateTime(DateUtil.date());
|
||||||
@ -213,7 +214,8 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
|||||||
* @param inspectionWorkNode
|
* @param inspectionWorkNode
|
||||||
*/
|
*/
|
||||||
public void returnInspectionInfo(InspectionWorkNode inspectionWorkNode){
|
public void returnInspectionInfo(InspectionWorkNode inspectionWorkNode){
|
||||||
// 通过
|
// 获取当前登录人
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
//通过工单id获取工单
|
//通过工单id获取工单
|
||||||
InspectionInfo info = inspectionInfoService.getById(inspectionWorkNode.getInspectionInfoId());
|
InspectionInfo info = inspectionInfoService.getById(inspectionWorkNode.getInspectionInfoId());
|
||||||
info.setIsPass("0");
|
info.setIsPass("0");
|
||||||
@ -226,7 +228,22 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
|||||||
stepInfo.setInspectionInfoId(Integer.parseInt(inspectionWorkNode.getInspectionInfoId().toString()));
|
stepInfo.setInspectionInfoId(Integer.parseInt(inspectionWorkNode.getInspectionInfoId().toString()));
|
||||||
stepInfo.setTitle("退办理");
|
stepInfo.setTitle("退办理");
|
||||||
stepInfo.setContent("退办理");
|
stepInfo.setContent("退办理");
|
||||||
|
stepInfo.setCreateTime(DateUtil.date());
|
||||||
|
stepInfo.setCreator(Integer.parseInt(loginUser.getId().toString()));
|
||||||
inspectionStepService.save(stepInfo);
|
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获取工单
|
//通过工单id获取工单
|
||||||
InspectionInfo info = inspectionInfoService.getById(inspectionWorkNode.getInspectionInfoId());
|
InspectionInfo info = inspectionInfoService.getById(inspectionWorkNode.getInspectionInfoId());
|
||||||
info.setIsRetrial("1");
|
info.setIsRetrial("1");
|
||||||
|
info.setIsPass("0");
|
||||||
info.setNowOrderNum(workNode.getOrderNum());
|
info.setNowOrderNum(workNode.getOrderNum());
|
||||||
|
|
||||||
// 将选择的重审项目之后的所有项目设置为待开始
|
// 将选择的重审项目之后的所有项目设置为待开始
|
||||||
|
@ -8,5 +8,6 @@
|
|||||||
FROM inspection_work_node wn
|
FROM inspection_work_node wn
|
||||||
LEFT JOIN inspection_project ip ON ip.id = wn.project_id
|
LEFT JOIN inspection_project ip ON ip.id = wn.project_id
|
||||||
WHERE wn.inspection_info_id = #{inspectionId}
|
WHERE wn.inspection_info_id = #{inspectionId}
|
||||||
|
ORDER BY wn.order_num ASC
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -270,11 +270,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
SELECT
|
SELECT
|
||||||
ii.*,
|
ii.*,
|
||||||
iwn.id AS workNodeId,
|
iwn.id AS workNodeId,
|
||||||
iwn.status AS workNodeStatus
|
iwn.status AS workNodeStatus,
|
||||||
|
oi.order_no AS orderNo,
|
||||||
|
oi.phonenumber AS buyPhone
|
||||||
FROM
|
FROM
|
||||||
inspection_info ii
|
inspection_info ii
|
||||||
JOIN
|
JOIN
|
||||||
inspection_work_node iwn ON ii.id = iwn.inspection_info_id
|
inspection_work_node iwn ON ii.id = iwn.inspection_info_id
|
||||||
|
JOIN order_info oi ON ii.inspection_order_id = oi.id
|
||||||
<where>
|
<where>
|
||||||
-- ii.status = '0' -- 工单正在进行中
|
-- ii.status = '0' -- 工单正在进行中
|
||||||
-- ii.now_order_num = iwn.order_num -- 当前工单步骤与流程节点顺序一致
|
-- ii.now_order_num = iwn.order_num -- 当前工单步骤与流程节点顺序一致
|
||||||
@ -298,9 +301,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="inspectionInfo.status == 3">
|
<if test="inspectionInfo.status == 3">
|
||||||
AND iwn.status = '2' AND iwn.deal_user_id = #{inspectionInfo.dealUserId}
|
AND iwn.status = '2' AND iwn.deal_user_id = #{inspectionInfo.dealUserId}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
|
ORDER BY ii.create_time DESC
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user