From 009b5fb6029e2c3ea97c89163d4d69a43589c9c2 Mon Sep 17 00:00:00 2001 From: yewj Date: Thu, 10 Oct 2024 16:35:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E8=B0=AD=E7=A7=91=E5=AE=A4=E6=94=B6?= =?UTF-8?q?=E8=B4=B9=E5=87=BA=E5=BA=93=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/config/WebSocketServer.java | 4 +- .../controller/inout/IoOrderController.java | 10 +- .../com/glxp/api/dao/inv/InvProductDao.java | 7 +- .../service/inv/impl/InvProductService.java | 4 + .../api/service/sync/SpsWebSocketClient.java | 4 +- .../thrsys/impl/ThrInvOrderServiceImpl.java | 10 +- .../mybatis/mapper/inv/invProductDao.xml | 102 ++++++++++-------- 7 files changed, 91 insertions(+), 50 deletions(-) diff --git a/src/main/java/com/glxp/api/config/WebSocketServer.java b/src/main/java/com/glxp/api/config/WebSocketServer.java index 7f29a35d6..74d390c60 100644 --- a/src/main/java/com/glxp/api/config/WebSocketServer.java +++ b/src/main/java/com/glxp/api/config/WebSocketServer.java @@ -91,14 +91,14 @@ public class WebSocketServer { this.session.getBasicRemote().sendText(message); } - public static void sendInfo(String message, String type) { + public static void sendInfo(String message, String type) { log.info("推送消息到窗口" + type + ",推送内容:" + message); for (WebSocketServer item : webSocketSet) { try { if (type == null) { item.sendMessage(new WebSocketEntity("sid", message)); - } else { + } else { item.sendMessage(new WebSocketEntity(type, message)); } } catch (IOException e) { diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java index 12ae50288..492225066 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -771,12 +771,18 @@ public class IoOrderController extends BaseController { @PostMapping("udiwms/inout/order/finish/pt/delete") @Log(title = "单据管理", businessType = BusinessType.DELETE) public BaseResponse deleteAll(@RequestBody DeleteRequest deleteRequest) { - - List orderEntities = orderService.findAllByAction("SC71021292871198"); + List orderEntities = new ArrayList<>(); + List orderEntities1 = orderService.findAllByAction("SC71021292871198"); + List orderEntities2 = orderService.findAllByAction("SC72854426720051"); + if (CollUtil.isNotEmpty(orderEntities2)) + orderEntities.addAll(orderEntities2); + if (CollUtil.isNotEmpty(orderEntities1)) + orderEntities.addAll(orderEntities1); Boolean b = redisUtil.getBool("deleteAllOrder"); if (b) return ResultVOUtils.error("当前删除任务正在执行,请勿重复点击!"); redisUtil.set("deleteAllOrder", true); + orderEntities.forEach(item -> { List delBillNos = new ArrayList<>(); diff --git a/src/main/java/com/glxp/api/dao/inv/InvProductDao.java b/src/main/java/com/glxp/api/dao/inv/InvProductDao.java index f200caa1c..6de571c56 100644 --- a/src/main/java/com/glxp/api/dao/inv/InvProductDao.java +++ b/src/main/java/com/glxp/api/dao/inv/InvProductDao.java @@ -94,10 +94,15 @@ public interface InvProductDao extends BaseMapperPlus filterReCount(Long relId, String batchNo, List unitFks); + + InvProductEntity selectExitInv(@Param("invCode") String invCode, @Param("supId") Long supId, @Param("relIdFk") Long relIdFk); + + } diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvProductService.java b/src/main/java/com/glxp/api/service/inv/impl/InvProductService.java index 78fb47260..8e0bf3e35 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvProductService.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvProductService.java @@ -191,6 +191,10 @@ public class InvProductService extends ServiceImpl invProductEntities = invProductService.selectByRelId(relId, null, null, thrInvOrder.getInvCode()); @@ -918,6 +919,10 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService { if (StrUtil.isEmpty(item.getSupId()) && invProductEntity1 != null) { item.setSupId(invProductEntity1.getSupId()); } + + if (bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + thrInvOrderDetail.setBatchNo(invProductEntities.get(0).getBatchNo()); + } } if (StrUtil.isEmpty(item.getSupId())) { CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(relId); @@ -1662,7 +1667,10 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService { thrInvOrderDetail.setPrice(BigDecimal.ZERO); else thrInvOrderDetail.setPrice(udiRlSupEntity.getPrice()); - + if (item.getMainAction().equals(ConstantType.TYPE_PUT)) { + InvProductEntity invProductEntity = (InvProductEntity) invProductService.selectExitInv(thrInvOrderDetail.getInvCode(), Long.parseLong(udiRlSupEntity.getCustomerId()), Long.parseLong(udiRlSupEntity.getUdiRlIdFk())); + thrInvOrderDetail.setBatchNo(invProductEntity.getBatchNo()); + } if (count1 <= IntUtil.value(thrInvOrderDetail.getReCount())) { int relCount = IntUtil.value(thrInvOrderDetail.getReCount()) - count1; for (int j = i + 1; j < udiRlSupEntitys.size(); j++) { diff --git a/src/main/resources/mybatis/mapper/inv/invProductDao.xml b/src/main/resources/mybatis/mapper/inv/invProductDao.xml index ccf42ddbd..0d397c3fd 100644 --- a/src/main/resources/mybatis/mapper/inv/invProductDao.xml +++ b/src/main/resources/mybatis/mapper/inv/invProductDao.xml @@ -38,12 +38,12 @@ bp.basicPrductRemak8, ip.price from inv_product ip - inner join basic_udirel on ip.relIdFk = basic_udirel.id - inner join basic_products bp on basic_udirel.uuid = bp.uuid - left join basic_corp on ip.supId = basic_corp.erpId - left join auth_dept on auth_dept.code = ip.deptCode - left join auth_warehouse on auth_warehouse.code = ip.invCode - left join auth_space `as` on ip.invSpaceCode = `as`.code + inner join basic_udirel on ip.relIdFk = basic_udirel.id + inner join basic_products bp on basic_udirel.uuid = bp.uuid + left join basic_corp on ip.supId = basic_corp.erpId + left join auth_dept on auth_dept.code = ip.deptCode + left join auth_warehouse on auth_warehouse.code = ip.invCode + left join auth_space `as` on ip.invSpaceCode = `as`.code AND bp.cpmctymc like concat('%', #{cpmctymc}, '%') @@ -135,10 +135,10 @@ sum(ip.outCount) outCount, sum(ip.reCount) reCount from inv_product ip - inner join basic_udirel bu on ip.relIdFk = bu.id - inner join basic_products bp on bu.uuid = bp.uuid - left join basic_corp bc on ip.supId = bc.erpId - left join auth_warehouse aw on aw.code = ip.invCode + inner join basic_udirel bu on ip.relIdFk = bu.id + inner join basic_products bp on bu.uuid = bp.uuid + left join basic_corp bc on ip.supId = bc.erpId + left join auth_warehouse aw on aw.code = ip.invCode bp.diType = 1 @@ -189,9 +189,9 @@ bp.manufactory, bp.zczbhhzbapzbh FROM inv_product_detail ip - LEFT JOIN basic_udirel bu ON bu.id = ip.relId - LEFT JOIN basic_products bp ON bu.uuid = bp.uuid - LEFT JOIN basic_corp ON ip.supId = basic_corp.erpId + LEFT JOIN basic_udirel bu ON bu.id = ip.relId + LEFT JOIN basic_products bp ON bu.uuid = bp.uuid + LEFT JOIN basic_corp ON ip.supId = basic_corp.erpId AND bp.nameCode like concat('%', #{nameCode}, '%') @@ -228,10 +228,10 @@ select ip.relIdFk, bp.cpmctymc, bp.ggxh, bp.ylqxzcrbarmc, bp.zczbhhzbapzbh from inv_product ip - left join inv_product_detail ipd on ip.relIdFk = ipd.relId and ip.invCode = ipd.invCode and - ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') - left join basic_udirel bu on bu.id = ip.relIdFk - left join basic_products bp on bp.uuid = bu.uuid + left join inv_product_detail ipd on ip.relIdFk = ipd.relId and ip.invCode = ipd.invCode and + ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') + left join basic_udirel bu on bu.id = ip.relIdFk + left join basic_products bp on bp.uuid = bu.uuid AND bp.cpmctymc like concat('%', #{cpmctymc}, '%') @@ -368,13 +368,13 @@ ip.deptCode, ip.invCode from inv_product ip - inner join basic_udirel on ip.relIdFk = basic_udirel.id - inner join basic_products bp on basic_udirel.uuid = bp.uuid - left join basic_corp on ip.supId = basic_corp.erpId - left join auth_dept on auth_dept.code = ip.deptCode - left join auth_warehouse on auth_warehouse.code = ip.invCode - left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and - ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') + inner join basic_udirel on ip.relIdFk = basic_udirel.id + inner join basic_products bp on basic_udirel.uuid = bp.uuid + left join basic_corp on ip.supId = basic_corp.erpId + left join auth_dept on auth_dept.code = ip.deptCode + left join auth_warehouse on auth_warehouse.code = ip.invCode + left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and + ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') bp.diType = 1 @@ -458,13 +458,13 @@ ip.price, ip.invCode from inv_product ip - inner join basic_udirel on ip.relIdFk = basic_udirel.id - inner join basic_products bp on basic_udirel.uuid = bp.uuid - left join basic_corp on ip.supId = basic_corp.erpId - left join auth_dept on auth_dept.code = ip.deptCode - left join auth_warehouse on auth_warehouse.code = ip.invCode - left join basic_product_category_rel on basic_product_category_rel.relId = basic_udirel.id - left join basic_product_category on basic_product_category_rel.code = basic_product_category.code + inner join basic_udirel on ip.relIdFk = basic_udirel.id + inner join basic_products bp on basic_udirel.uuid = bp.uuid + left join basic_corp on ip.supId = basic_corp.erpId + left join auth_dept on auth_dept.code = ip.deptCode + left join auth_warehouse on auth_warehouse.code = ip.invCode + left join basic_product_category_rel on basic_product_category_rel.relId = basic_udirel.id + left join basic_product_category on basic_product_category_rel.code = basic_product_category.code bp.diType = 1 @@ -553,6 +553,24 @@ + + +