From 087db8aee2e9cbfb44b8e61531c1cace5e36a6e2 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期日, 28 四月 2024 14:53:52 +0800
Subject: [PATCH] ERP接口同步

---
 src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java
index f90e61a..b00b121 100644
--- a/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java
@@ -5,6 +5,7 @@
 import com.baomidou.mybatisplus.plugins.Page;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.core.common.Cools;
+import com.core.common.DateUtils;
 import com.core.exception.CoolException;
 import com.zy.asrs.entity.OrderDetl;
 import com.zy.asrs.entity.Pla;
@@ -28,8 +29,8 @@
     @Autowired
     private PlaQtyService plaQtyService;
 
-    public Pla selectByBatchAndPackageNo(String batch, Integer packageNo) {
-        return this.selectOne(new EntityWrapper<Pla>().eq("batch",batch).eq("package_no",packageNo));
+    public Pla selectByBatchAndPackageNo(String batch, Integer packageNo, String brand) {
+        return this.selectOne(new EntityWrapper<Pla>().eq("batch",batch).eq("package_no",packageNo).eq("brand",brand).eq(false,"status","鍏ㄩ儴鍑哄簱"));
     }
 
     @Override
@@ -117,7 +118,7 @@
             plaQtyService.insert(plaQtyReturned);
 
             //鐩存帴鏇存柊pla鐨勫簱瀛�
-            Pla pla = this.selectByBatchAndPackageNo(plaQty.getBatch(), plaQty.getPackageNo());
+            Pla pla = this.selectByBatchAndPackageNo(plaQty.getBatch(), plaQty.getPackageNo(),plaQty.getBrand());
             //pla.setStatus(GlobleParameter.PLA_STATUS_0);
             pla.setModifyTime(new Date());
 
@@ -154,11 +155,18 @@
     public Page<Pla> getStockStatisAll(Page<Pla> page) {
 
         List<Pla> plaList;
-        if(Cools.isEmpty(page.getCondition().get("brand"))){
-            plaList=baseMapper.getStockStatisAll();
-        }else {
-            plaList = baseMapper.getStockStatisAllByBrand(page.getCondition().get("brand").toString());
+        Date stime = null;
+        Date etime = null;
+        Object create_time = page.getCondition().get("create_time");
+        Object brand = page.getCondition().get("brand");
+        Object status = page.getCondition().get("status");
+        String createTime = create_time == null ? null : create_time.toString();
+        if(!Cools.isEmpty(createTime)){
+            String[] dates = createTime.split(" - ");
+            stime = DateUtils.convert(dates[0]);
+            etime = DateUtils.convert(dates[1]);
         }
+        plaList=baseMapper.getStockStatisAll(brand == null ? null:brand.toString(), status == null ? null:status.toString(),  stime,etime);
 
         double weightSum = plaList.stream().mapToDouble(Pla::getWeight).sum();
 

--
Gitblit v1.9.1