From 91b92422716cb4c5d0433f77fd2d6d45a69639c4 Mon Sep 17 00:00:00 2001
From: jiaosong <jiaosong6760@dingtalk.com>
Date: 星期二, 15 八月 2023 18:35:17 +0800
Subject: [PATCH] # 工资表配置表 联调修改

---
 server/src/main/java/doumeemes/service/business/impl/CompanyServiceImpl.java |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/doumeemes/service/business/impl/CompanyServiceImpl.java b/server/src/main/java/doumeemes/service/business/impl/CompanyServiceImpl.java
index 726b6bf..d0a26be 100644
--- a/server/src/main/java/doumeemes/service/business/impl/CompanyServiceImpl.java
+++ b/server/src/main/java/doumeemes/service/business/impl/CompanyServiceImpl.java
@@ -14,6 +14,7 @@
 import doumeemes.dao.business.model.CompanyLog;
 import doumeemes.dao.business.model.Multifiles;
 import doumeemes.dao.ext.dto.DingDingConfig;
+import doumeemes.dao.ext.vo.CompanyExtListVO;
 import doumeemes.service.business.CompanyLogService;
 import doumeemes.service.business.CompanyService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -21,9 +22,12 @@
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import doumeemes.service.business.MultifilesService;
+import doumeemes.service.ext.DepartmentExtService;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -46,6 +50,10 @@
 
     @Autowired
     private CompanyLogService companyLogService;
+
+    @Autowired
+    @Lazy
+    private DepartmentExtService departmentExtService;
 
 
     @Override
@@ -115,7 +123,7 @@
         update.setStatus(company.getStatus());
         update.setDingdingInfo(company.getDingdingInfo());
         companyMapper.updateById(update);
-
+        Company company1 = companyMapper.selectById(company.getId());
 //        鏇存柊璁板綍
 
         if(Objects.nonNull(company.getStatus())){
@@ -145,6 +153,15 @@
             companyLogService.create(companyLog);
         }
 
+        initRedisCache(company1);
+    }
+
+
+    private void initRedisCache(Company com) {
+        CompanyExtListVO c = new CompanyExtListVO();
+        BeanUtils.copyProperties(com,c);
+        departmentExtService.loadComDepart(c);
+        departmentExtService.initCompnayCodesByCom(com);
     }
 
     private Boolean isParseObject(String dingdingInfo){
@@ -185,7 +202,7 @@
         QueryWrapper<Company> wrapper = new QueryWrapper<>(company);
         return companyMapper.selectList(wrapper);
     }
-  
+
     @Override
     public PageData<Company> findPage(PageWrap<Company> pageWrap) {
         IPage<Company> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());

--
Gitblit v1.9.3