From 351b16d0a3dc194841c2192cacfabf788ecafd5c Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期一, 05 八月 2024 08:19:17 +0800 Subject: [PATCH] # --- zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/OrderServiceImpl.java | 29 ++++++++++++++++++++++++++--- 1 files changed, 26 insertions(+), 3 deletions(-) diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/OrderServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/OrderServiceImpl.java index b7dbae7..8ad4656 100644 --- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/OrderServiceImpl.java +++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/OrderServiceImpl.java @@ -1,6 +1,7 @@ package com.zy.asrs.wms.asrs.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zy.asrs.framework.common.Cools; import com.zy.asrs.framework.exception.CoolException; import com.zy.asrs.wms.asrs.entity.*; import com.zy.asrs.wms.asrs.entity.param.CreateOrderParam; @@ -28,6 +29,17 @@ private OrderDetlService orderDetlService; @Autowired private OrderDetlFieldService orderDetlFieldService; + @Autowired + private OrderNoRuleService orderNoRuleService; + + @Override + @Transactional + public boolean createOrder(List<CreateOrderParam> list) { + for (CreateOrderParam orderParam : list) { + createOrder(orderParam); + } + return true; + } @Override @Transactional @@ -39,8 +51,13 @@ throw new CoolException("璁㈠崟宸插瓨鍦�"); } + String orderNo = param.getOrderNo(); + if (Cools.isEmpty(param.getOrderNo())) { + orderNo = orderNoRuleService.getOrderNo(param.getOrderType().intValue()); + } + Order order = new Order(); - order.setOrderNo(param.getOrderNo()); + order.setOrderNo(orderNo); order.setOrderType(param.getOrderType()); order.setOrderSettle(param.getOrderSettle()); order.setOrderTime(format.format(new Date())); @@ -55,8 +72,14 @@ double anfme = Double.parseDouble(map.get("anfme").toString()); String batch = map.get("batch").toString(); String matnr = map.get("matnr").toString(); - Double qty = Double.parseDouble(map.get("qty").toString()); - Double workQty = Double.parseDouble(map.get("workQty").toString()); + Double qty = 0D; + Double workQty = 0D; + if (map.containsKey("qty")) { + qty = Double.parseDouble(map.get("qty").toString()); + } + if (map.containsKey("workQty")) { + workQty = Double.parseDouble(map.get("workQty").toString()); + } String memo = map.getOrDefault("memo", "").toString(); Mat mat = matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, matnr)); if (mat == null) { -- Gitblit v1.9.1