From 7cdb188ddd1655cae52c5146db8069d0288a5a97 Mon Sep 17 00:00:00 2001 From: lty <876263681@qq.com> Date: 星期四, 31 七月 2025 12:40:31 +0800 Subject: [PATCH] #erp读取实际数量 --- src/main/java/com/zy/asrs/controller/OpenController.java | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/OpenController.java b/src/main/java/com/zy/asrs/controller/OpenController.java index 14c0445..88f3cfc 100644 --- a/src/main/java/com/zy/asrs/controller/OpenController.java +++ b/src/main/java/com/zy/asrs/controller/OpenController.java @@ -1,6 +1,5 @@ package com.zy.asrs.controller; -import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.core.annotations.AppAuth; @@ -8,11 +7,15 @@ import com.core.common.Cools; import com.core.common.R; import com.core.exception.CoolException; +import com.zy.asrs.entity.AcQuantity; import com.zy.asrs.entity.LocMast; +import com.zy.asrs.entity.OrderDetl; import com.zy.asrs.entity.param.*; import com.zy.asrs.service.LocDetlService; import com.zy.asrs.service.LocMastService; import com.zy.asrs.service.OpenService; +import com.zy.asrs.service.OrderDetlService; +import com.zy.asrs.service.impl.OrderDetlServiceImpl; import com.zy.common.web.BaseController; import com.zy.system.entity.Config; import com.zy.system.service.ConfigService; @@ -22,6 +25,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -48,6 +52,9 @@ @Autowired private LocMastService locMastService; + + @Autowired + private OrderDetlService orderDetlService; @Deprecated @PostMapping("/grouping") @@ -131,6 +138,20 @@ // openService.packageUp(param); // return R.ok(); // } + /** + * 鍗曟嵁瀹為檯鏁伴噺璇诲彇 + * + */ + @PostMapping("/order/AcQuantity/default/v1") + public synchronized R loadQuantity(@RequestBody AcQuantity param){ + List<AcQuantity> OrderDetlList; + if(param.getOrderNo() != null){ + OrderDetlList = orderDetlService.loadQuantity(param.getOrderNo()); + }else{ + return R.error("鍗曟嵁缂栧彿[orderNo]涓嶈兘涓虹┖"); + } + return R.ok().add(OrderDetlList); + } /** * 娣诲姞鍏ュ簱鍗� @@ -225,15 +246,17 @@ * 杩斿洖搴撳瓨鍒╃敤鐜� */ @Synchronized - @PostMapping("/stock/userd/v1") + @PostMapping("/stock/used/v1") public R getRate(@RequestHeader(required = false) String appkey, @RequestBody(required = false) OpenOrderCompleteParam param, HttpServletRequest request) { auth(appkey, param, request); int i = locMastService.selectCount(new EntityWrapper<LocMast>().in("loc_sts", "O")); int i1 = locMastService.selectCount(new EntityWrapper<LocMast>().in("loc_sts", Arrays.asList("D", "F", "P", "Q", "R", "S"))); - double div = NumberUtil.div(i1 - i, i, 2); - return R.ok().add(div); + BigDecimal dividend = new BigDecimal(i1 - i); + BigDecimal divisor = new BigDecimal(i1); + BigDecimal quotient = dividend.divide(divisor,4, BigDecimal.ROUND_HALF_UP); + return R.ok().add(quotient); } -- Gitblit v1.9.1