From 5790d7573a83278667878e0f73104f8fc8ec5cf3 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期二, 10 三月 2026 11:03:51 +0800
Subject: [PATCH] 巡检统计信息纠正

---
 fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java |   43 ++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java
index 7ddcb88..cbe55e4 100644
--- a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java
@@ -48,10 +48,11 @@
         QueryWrapper<Quantity> queryWrapper = new QueryWrapper<>();
 
         param.setCompanyId(ContextUtil.getCompanyId());
-        param.setDeptId(ContextUtil.subDeptId(null));
         queryWrapper.eq("company_id", param.getCompanyId());
-        queryWrapper.eq("dept_id", param.getDeptId());
-
+        //搴撳尯妫�绱�
+        if (StringUtils.isNotBlank(param.getDeptId())) {
+            queryWrapper.like("dept_id", param.getDeptId());
+        }
         //浠撳簱妫�绱�
         if (StringUtils.isNotBlank(param.getDepotId())) {
             queryWrapper.eq("depot_id", param.getDepotId());
@@ -69,6 +70,42 @@
     }
 
     /**
+     * 鏌ヨ鏁版嵁鍒楄〃
+     * @param depotId
+     * @param limit    鏌ヨ鏉℃暟
+     * @return
+     */
+    public List<Quantity> getQuantityList(String depotId, Integer limit) {
+        if (StringUtils.isEmpty(depotId)) {
+            return null;
+        }
+
+        QueryWrapper<Quantity> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("depot_id", depotId);
+        queryWrapper.orderByDesc("receive_date");
+        queryWrapper.last("LIMIT " + limit);
+
+        return quantityMapper.selectList(queryWrapper);
+    }
+
+    /**
+     * 淇濆瓨鏁版嵁
+     *
+     * @param data
+     */
+    public void saveData(Quantity data) {
+
+        data.setUpdateBy(ContextUtil.getLoginUserName());
+        data.setUpdateTime(new Date());
+
+        if(StringUtils.isBlank(data.getCreateBy())){
+            data.setCreateBy(ContextUtil.getLoginUserName());
+            data.setCreateTime(new Date());
+        }
+        quantityMapper.insert(data);
+    }
+
+    /**
      * 鏌ヨ閰嶇疆淇℃伅锛屾牴鎹簱鍖虹紪鐮佽幏鍙�
      *
      * @param companyId

--
Gitblit v1.9.3