From 69cd9f59a0fabf12f8c9147fcba7f69817a870b3 Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期一, 06 十一月 2023 23:40:59 +0800
Subject: [PATCH] 更新仓内抓拍2

---
 igds-inout/src/main/java/com/ld/igds/m/service/HInoutNoticeService.java |   24 +++++++-----------------
 1 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/igds-inout/src/main/java/com/ld/igds/m/service/HInoutNoticeService.java b/igds-inout/src/main/java/com/ld/igds/m/service/HInoutNoticeService.java
index 21f6ab5..293b6fe 100644
--- a/igds-inout/src/main/java/com/ld/igds/m/service/HInoutNoticeService.java
+++ b/igds-inout/src/main/java/com/ld/igds/m/service/HInoutNoticeService.java
@@ -27,23 +27,18 @@
     public void pageQueryIn(Page<InoutNoticeIn> page, Map<String, Object> param) throws Exception {
 
         String hql = " from " + InoutNoticeIn.class.getName()
-                + " where companyId =:companyId";
+                + " where companyId =:companyId and deptId =:deptId";
 
         Map<String, Object> args = new HashMap<String, Object>();
         args.put("companyId", ContextUtil.getCompanyId());
+        args.put("deptId", ContextUtil.subDeptId(null));
 
         Object year = param.get("year");
         if (year == null) {
             param.put("year", DateFormatUtils.format(new Date(), "yyyy"));
         }
 
-        String str = (String) param.get("deptId");
-        if (StringUtils.isNotEmpty(str)) {
-            hql += " and deptId =:deptId";
-            args.put("deptId", str);
-        }
-
-        str = (String) param.get("id");
+        String str = (String) param.get("id");
         if (StringUtils.isNotEmpty(str)) {
             hql += " and id=:id";
             args.put("id", str);
@@ -143,23 +138,18 @@
     public void pageQueryOut(Page<InoutNoticeOut> page, Map<String, Object> param) throws Exception {
 
         String hql = " from " + InoutNoticeOut.class.getName()
-                + " where companyId =:companyId";
+                + " where companyId =:companyId and deptId =:deptId";
 
         Map<String, Object> args = new HashMap<String, Object>();
         args.put("companyId", ContextUtil.getCompanyId());
+        args.put("deptId", ContextUtil.subDeptId(null));
 
         Object year = param.get("year");
         if (year == null) {
             param.put("year", DateFormatUtils.format(new Date(), "yyyy"));
         }
 
-        String str = (String) param.get("deptId");
-        if (StringUtils.isNotEmpty(str)) {
-            hql += " and deptId =:deptId";
-            args.put("deptId", str);
-        }
-
-        str = (String) param.get("id");
+        String str = (String) param.get("id");
         if (StringUtils.isNotEmpty(str)) {
             hql += " and id =:id";
             args.put("id", str);
@@ -303,7 +293,7 @@
         }
 
         str = (String) parameter.get("key");
-        if (StringUtils.isNoneEmpty(str)) {
+        if (StringUtils.isNotEmpty(str)) {
             hql += " and (name like:name or customerName like:customerName) ";
             args.put("name", "%" + str + "%");
             args.put("customerName", "%" + str + "%");

--
Gitblit v1.9.3