From 8c132142d0ee8b72372e589c6b1856fbd6e1f21e Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期三, 21 一月 2026 17:04:54 +0800
Subject: [PATCH] 仓库列表优化
---
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutConfService.java | 36 ++++++++++++++++++++++++------------
1 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutConfService.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutConfService.java
index a45f339..c76b494 100644
--- a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutConfService.java
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutConfService.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.fzzy.igds.constant.Constant;
import com.fzzy.igds.constant.RedisConst;
+import com.fzzy.igds.domain.Dept;
import com.fzzy.igds.mapper.InoutConfMapper;
import com.fzzy.igds.mapper.InoutSysConfMapper;
import com.fzzy.igds.domain.InoutConf;
@@ -31,6 +32,8 @@
public class InoutConfService {
@Resource
private ISysDeptService iSysDeptService;
+ @Resource
+ private CoreDeptService deptService;
@Resource
private InoutConfMapper inoutConfMapper;
@Resource
@@ -146,7 +149,7 @@
*
*/
public void flushInoutSysConfCache() {
- List<InoutSysConf> list = getSysConfData();
+ List<InoutSysConf> list = listInoutSysConf(null,null);
if(null == list || list.isEmpty()){
return;
}
@@ -181,16 +184,16 @@
* @return
*/
public List<InoutConf> getInoutConfList(String companyId, String deptId) {
+ QueryWrapper<InoutConf> queryWrapper = new QueryWrapper<>();
+
if (StringUtils.isEmpty(companyId)) {
companyId = ContextUtil.getCompanyId();
}
- if (StringUtils.isEmpty(deptId)) {
- deptId = ContextUtil.subDeptId(null);
- }
- QueryWrapper<InoutConf> queryWrapper = new QueryWrapper<>();
-
- queryWrapper.eq("dept_id", deptId);
queryWrapper.eq("company_id", companyId);
+
+ if (StringUtils.isNotEmpty(deptId)) {
+ queryWrapper.eq("dept_id", deptId);
+ }
return inoutConfMapper.selectList(queryWrapper);
}
@@ -244,12 +247,21 @@
* 璁剧疆缂撳瓨
*
* @param companyId
- * @param deptId
*/
- public void flushInoutConfCache(String companyId, String deptId) {
- List<InoutConf> list = this.getInoutConfList(companyId, deptId);
- String key = RedisConst.buildKey(companyId, Constant.CACHE_INOUT_CONF_LIST, deptId);
- redisCache.setCacheObject(key, list);
+ public void flushInoutConfCache(String companyId) {
+ List<Dept> depts = deptService.listDept(null, companyId, null);
+ if(null == depts || depts.isEmpty()){
+ return;
+ }
+ List<InoutConf> inoutConfList;
+ for (Dept dept : depts) {
+ inoutConfList = this.getInoutConfList(companyId, dept.getId());
+ if(null == inoutConfList || inoutConfList.isEmpty()){
+ continue;
+ }
+ String key = RedisConst.buildKey(companyId, Constant.CACHE_INOUT_CONF_LIST, dept.getId());
+ redisCache.setCacheObject(key, inoutConfList);
+ }
}
/**
--
Gitblit v1.9.3