wangliang 2 жил өмнө
parent
commit
d6bbe5a55c

+ 3 - 30
src/main/java/com/qmth/eds/service/impl/AuthInfoServiceImpl.java

@@ -6,22 +6,13 @@ import com.qmth.boot.core.solar.model.AppInfo;
 import com.qmth.boot.core.solar.model.OrgInfo;
 import com.qmth.boot.core.solar.service.SolarService;
 import com.qmth.eds.bean.dto.AuthOrgInfoDto;
-import com.qmth.eds.common.contant.SystemConstant;
 import com.qmth.eds.common.entity.BasicSchool;
 import com.qmth.eds.common.entity.SysCollege;
 import com.qmth.eds.common.entity.SysOrg;
 import com.qmth.eds.common.entity.TSAuth;
 import com.qmth.eds.common.enums.AuthEnum;
 import com.qmth.eds.common.enums.ExceptionResultEnum;
-import com.qmth.eds.common.enums.UploadFileEnum;
-import com.qmth.eds.common.util.FileStoreUtil;
-import com.qmth.eds.core.config.DictionaryConfig;
-import com.qmth.eds.mapper.BasicSchoolMapper;
-import com.qmth.eds.mapper.SysCollegeMapper;
-import com.qmth.eds.mapper.SysOrgMapper;
-import com.qmth.eds.mapper.TSAuthMapper;
 import com.qmth.eds.service.*;
-import org.apache.commons.codec.digest.DigestUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
@@ -29,9 +20,6 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
-import java.io.File;
-import java.io.FileInputStream;
-import java.time.LocalDateTime;
 import java.util.*;
 
 /**
@@ -50,36 +38,21 @@ public class AuthInfoServiceImpl implements AuthInfoService {
     @Resource
     TSAuthService tsAuthService;
 
-    @Resource
-    TSAuthMapper tsAuthMapper;
-
     @Resource
     CommonCacheService commonCacheService;
 
     @Resource
     BasicSchoolService basicSchoolService;
 
-    @Resource
-    BasicSchoolMapper basicSchoolMapper;
-
     @Resource
     SysCollegeService sysCollegeService;
 
-    @Resource
-    FileStoreUtil fileStoreUtil;
-
-    @Resource
-    DictionaryConfig dictionaryConfig;
-
     @Resource
     AuthInfoService authInfoService;
 
     @Resource
     SysOrgService sysOrgService;
 
-    @Resource
-    SysOrgMapper sysOrgMapper;
-
     /**
      * 授权信息初始化
      */
@@ -219,12 +192,12 @@ public class AuthInfoServiceImpl implements AuthInfoService {
             QueryWrapper<TSAuth> tsAuthQueryWrapper = new QueryWrapper<>();
             tsAuthQueryWrapper.lambda().in(TSAuth::getSchoolId, orgIdsSet);
             tsAuthService.remove(tsAuthQueryWrapper);
-            tsAuthMapper.insertBatch(tsAuthList);
+            tsAuthService.saveOrUpdateBatch(tsAuthList);
 
             if (!CollectionUtils.isEmpty(basicSchoolSet)) {
                 commonCacheService.removeSchoolIdCache();
                 commonCacheService.removeSchoolCodeCache();
-                basicSchoolMapper.insertBatch(basicSchoolSet);
+                basicSchoolService.saveOrUpdateBatch(basicSchoolSet);
 
                 // 往学院表插入一条数据
                 for (BasicSchool basicSchool : basicSchoolSet) {
@@ -235,7 +208,7 @@ public class AuthInfoServiceImpl implements AuthInfoService {
 
             if (!CollectionUtils.isEmpty(sysOrgSet)) {
                 commonCacheService.removeOrgCache();
-                sysOrgMapper.insertBatch(sysOrgSet);
+                sysOrgService.saveOrUpdateBatch(sysOrgSet);
             }
         }
     }