sgj
2026-03-02 747a4a421dc8c1faf1c768aaac0fc7abc258e2c0
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);
        }
    }
    /**