1、增加调试接口:实现退货指令点击开始服务逻辑

2、增加调试接口:实现退货指令点击结束服务逻辑
3、pad接口-退货-入库-增加检测:是否已开始服务,如未点击开始服务则不允许入库
4、去除pad退货-退货流程自带的开始、结束服务相关的指令逻辑
This commit is contained in:
1378012178@qq.com 2025-12-24 09:08:36 +08:00
parent 6f5a08663a
commit dc382b91de
3 changed files with 100 additions and 15 deletions

View File

@ -61,6 +61,27 @@ public class InvoicingThdApi {
return Result.OK(pageList);
}
/**
* 退货单-服务指令-开始服务
*
* @param dto
* @return
*/
@ApiOperation(value = "退货单-服务指令-开始服务", notes = "退货单-服务指令-开始服务")
@AutoLog(value = "退货单-服务指令-开始服务", clientType = "app")
@PostMapping(value = "/startDirectiveServe")
public Result<?> startDirectiveServe(@RequestBody InvoicingThdMainEntity dto) {
if (StringUtils.isBlank(dto.getId())) {
return Result.error("缺少参数");
}
boolean result = tuiHuoApi.startDirectiveServe(dto);
if (result) {
return Result.OK("操作成功");
} else {
return Result.error("操作失败");
}
}
/**
* 退货单-开始服务
*
@ -187,6 +208,27 @@ public class InvoicingThdApi {
}
}
/**
* 退货单-服务指令-结束服务
*
* @param dto
* @return
*/
@ApiOperation(value = "退货单-服务指令-结束服务", notes = "退货单-服务指令-结束服务")
@AutoLog(value = "退货单-服务指令-结束服务", clientType = "app")
@PostMapping(value = "/finishDirectiveServe")
public Result<?> finishDirectiveServe(@RequestBody InvoicingThdMainEntity dto) {
if (StringUtils.isBlank(dto.getId())) {
return Result.error("缺少参数");
}
boolean result = tuiHuoApi.finishDirectiveServe(dto);
if (result) {
return Result.OK("操作成功");
} else {
return Result.error("操作失败");
}
}
/**
* 退货单-结束服务
*

View File

@ -16,6 +16,8 @@ public interface ITuiHuoApi {
List<NuKcslEntity> thdNuMaterialList(InvoicingThdMainEntity dto);
boolean startDirectiveServe(InvoicingThdMainEntity dto);
boolean startServe(InvoicingThdMainEntity dto);
Map<String,Object> addThc(InvoicingThdGwcEntity dto);
@ -28,6 +30,8 @@ public interface ITuiHuoApi {
Map<String,String> submitThd(InvoicingThdMainEntity dto);
boolean finishDirectiveServe(InvoicingThdMainEntity dto);
boolean finishServe(InvoicingThdMainEntity dto);
boolean transRead(InvoicingThdMainEntity dto);

View File

@ -132,6 +132,20 @@ public class ThdServiceImpl implements ITuiHuoApi {
return nuKcslMapper.thdNuMaterialList(dto);
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean startDirectiveServe(InvoicingThdMainEntity dto) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
orderEntity.setFlowCode("dyth_cksh");//指令流程flow_code 看接口有标明
orderEntity.setPoolId(dto.getId());//退货主表id 入库时会根据更新为对应退货单号入库时才生成的退货单号
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
invoicingOrdersApi.beginDyThOrder(orderEntity);
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean startServe(InvoicingThdMainEntity dto) {
@ -162,12 +176,6 @@ public class ThdServiceImpl implements ITuiHuoApi {
logData.setElderId(main.getElderId());//长者id
thdLogMapper.insert(logData);
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
orderEntity.setFlowCode("dyth_cksh");//指令流程flow_code 看接口有标明
orderEntity.setPoolId(dto.getId());//退货主表id 入库时会根据更新为对应退货单号入库时才生成的退货单号
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
invoicingOrdersApi.beginDyThOrder(orderEntity);
return true;
}
}
@ -261,6 +269,16 @@ public class ThdServiceImpl implements ITuiHuoApi {
//先进行单子检测
{
//检测是否处于开始服务状态
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
p_.setPoolId(dto.getId());
InvoicingOrdersEntity j = invoicingOrdersApi.getDyThOrderInfo(p_);
if (j == null || !"Y".equals(j.getIzStart())) {
result.put("status", "nodeError");
result.put("message", "请先点击开始服务");
return result;
}
//检测单子状态是否正确
if (main == null || !"1".equals(main.getStatus())) {
result.put("status", "nodeError");
@ -276,7 +294,7 @@ public class ThdServiceImpl implements ITuiHuoApi {
// return result;
// }
//未添加退货物料检测
if(CollectionUtils.isEmpty(gwcList)){
if (CollectionUtils.isEmpty(gwcList)) {
result.put("status", "faild");
result.put("message", "未添加物料");
return result;
@ -284,8 +302,8 @@ public class ThdServiceImpl implements ITuiHuoApi {
}
//处理数据 主表当前数据main
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
{
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String status = "2";//当前节点 - 已入库
String thdNo = null;//退货单号
List<String> wlList = Lists.newArrayList();//本次涉及物料id
@ -505,10 +523,38 @@ public class ThdServiceImpl implements ITuiHuoApi {
}
}
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
orderEntity.setPoolId(dto.getId());//退货主表id 入库时会根据更新为对应退货单号入库时才生成的退货单号
orderEntity.setBizId(main.getThdNo());
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
orderEntity.setNuId(main.getNuId());//护理单元id
orderEntity.setElderId(main.getElderId());//长者id
orderEntity.setFlowCode("dyth_cksh");//指令流程flow_code 看接口有标明
invoicingOrdersApi.updateDyThOrderBizId(orderEntity);
result.put("status", "success");
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean finishDirectiveServe(InvoicingThdMainEntity dto) {
//查询当前状态
QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>();
qw.eq("id", dto.getId());
NuInvoicingThdMain main = thdMainMapper.selectOne(qw);
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
orderEntity.setFlowCode("dyth_cksh");//指令流程flow_code 看接口有标明
orderEntity.setPoolId(dto.getId());//退货主表id 入库时会根据更新为对应退货单号入库时才生成的退货单号
orderEntity.setBizId(main.getThdNo());
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
invoicingOrdersApi.finishDyThOrder(orderEntity);
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean finishServe(InvoicingThdMainEntity dto) {
@ -540,13 +586,6 @@ public class ThdServiceImpl implements ITuiHuoApi {
logData.setElderId(main.getElderId());//长者id
thdLogMapper.insert(logData);
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
orderEntity.setFlowCode("dyth_cksh");//指令流程flow_code 看接口有标明
orderEntity.setPoolId(dto.getId());//退货主表id 入库时会根据更新为对应退货单号入库时才生成的退货单号
orderEntity.setBizId(main.getThdNo());
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
invoicingOrdersApi.finishDyThOrder(orderEntity);
return true;
}
}