From dc382b91dea51564893a0b61928b5e62cde10e1e Mon Sep 17 00:00:00 2001 From: "1378012178@qq.com" <1378012178@qq.com> Date: Wed, 24 Dec 2025 09:08:36 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=9A=E5=AE=9E=E7=8E=B0=E9=80=80=E8=B4=A7?= =?UTF-8?q?=E6=8C=87=E4=BB=A4=E7=82=B9=E5=87=BB=E5=BC=80=E5=A7=8B=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E9=80=BB=E8=BE=91=202=E3=80=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=8E=A5=E5=8F=A3=EF=BC=9A=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E9=80=80=E8=B4=A7=E6=8C=87=E4=BB=A4=E7=82=B9=E5=87=BB=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E6=9C=8D=E5=8A=A1=E9=80=BB=E8=BE=91=203=E3=80=81pad?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3-=E9=80=80=E8=B4=A7-=E5=85=A5=E5=BA=93-?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A3=80=E6=B5=8B=EF=BC=9A=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=B7=B2=E5=BC=80=E5=A7=8B=E6=9C=8D=E5=8A=A1=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9C=AA=E7=82=B9=E5=87=BB=E5=BC=80=E5=A7=8B=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=88=99=E4=B8=8D=E5=85=81=E8=AE=B8=E5=85=A5=E5=BA=93=204?= =?UTF-8?q?=E3=80=81=E5=8E=BB=E9=99=A4pad=E9=80=80=E8=B4=A7-=E9=80=80?= =?UTF-8?q?=E8=B4=A7=E6=B5=81=E7=A8=8B=E8=87=AA=E5=B8=A6=E7=9A=84=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E3=80=81=E7=BB=93=E6=9D=9F=E6=9C=8D=E5=8A=A1=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84=E6=8C=87=E4=BB=A4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pad/invoicing/api/InvoicingThdApi.java | 42 +++++++++++ .../nu/modules/invoicing/api/ITuiHuoApi.java | 4 ++ .../thd/service/impl/ThdServiceImpl.java | 69 +++++++++++++++---- 3 files changed, 100 insertions(+), 15 deletions(-) diff --git a/nursing-unit-api/src/main/java/com/nu/modules/pad/invoicing/api/InvoicingThdApi.java b/nursing-unit-api/src/main/java/com/nu/modules/pad/invoicing/api/InvoicingThdApi.java index 9f8ed23b..1f5ebba1 100644 --- a/nursing-unit-api/src/main/java/com/nu/modules/pad/invoicing/api/InvoicingThdApi.java +++ b/nursing-unit-api/src/main/java/com/nu/modules/pad/invoicing/api/InvoicingThdApi.java @@ -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("操作失败"); + } + } + /** * 退货单-结束服务 * diff --git a/nursing-unit-invoicing/nu-invoicing-api/nu-invoicing-local-api/src/main/java/com/nu/modules/invoicing/api/ITuiHuoApi.java b/nursing-unit-invoicing/nu-invoicing-api/nu-invoicing-local-api/src/main/java/com/nu/modules/invoicing/api/ITuiHuoApi.java index b434d178..329ba740 100644 --- a/nursing-unit-invoicing/nu-invoicing-api/nu-invoicing-local-api/src/main/java/com/nu/modules/invoicing/api/ITuiHuoApi.java +++ b/nursing-unit-invoicing/nu-invoicing-api/nu-invoicing-local-api/src/main/java/com/nu/modules/invoicing/api/ITuiHuoApi.java @@ -16,6 +16,8 @@ public interface ITuiHuoApi { List thdNuMaterialList(InvoicingThdMainEntity dto); + boolean startDirectiveServe(InvoicingThdMainEntity dto); + boolean startServe(InvoicingThdMainEntity dto); Map addThc(InvoicingThdGwcEntity dto); @@ -28,6 +30,8 @@ public interface ITuiHuoApi { Map submitThd(InvoicingThdMainEntity dto); + boolean finishDirectiveServe(InvoicingThdMainEntity dto); + boolean finishServe(InvoicingThdMainEntity dto); boolean transRead(InvoicingThdMainEntity dto); diff --git a/nursing-unit-invoicing/nu-invoicing-biz/src/main/java/com/nu/modules/thd/service/impl/ThdServiceImpl.java b/nursing-unit-invoicing/nu-invoicing-biz/src/main/java/com/nu/modules/thd/service/impl/ThdServiceImpl.java index 143e8e84..1e9e0db7 100644 --- a/nursing-unit-invoicing/nu-invoicing-biz/src/main/java/com/nu/modules/thd/service/impl/ThdServiceImpl.java +++ b/nursing-unit-invoicing/nu-invoicing-biz/src/main/java/com/nu/modules/thd/service/impl/ThdServiceImpl.java @@ -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 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 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; } }