FengChaoYu il y a 6 mois
Parent
commit
aced27e8c0

+ 7 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/contract/CompanyCaAuthLogic.java

@@ -11,7 +11,9 @@ import com.gree.mall.manager.commonmapper.CommonMapper;
 import com.gree.mall.manager.enums.IsYesNoEnum;
 import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.plus.entity.AdminWebsit;
 import com.gree.mall.manager.plus.entity.CompanyCaAuth;
+import com.gree.mall.manager.plus.service.AdminWebsitService;
 import com.gree.mall.manager.plus.service.CompanyCaAuthService;
 import com.gree.mall.manager.utils.fadada.Auth4FDDUtil;
 import com.gree.mall.manager.utils.oss.OSSUtil;
@@ -33,6 +35,7 @@ public class CompanyCaAuthLogic {
     private final CommonLogic commonLogic;
     private final CommonMapper commonMapper;
     private final CompanyCaAuthService companyCaAuthService;
+    private final AdminWebsitService adminWebsitService;
     private final OSSUtil ossUtil;
     @Value("${fadada.company.auth.page-modify}")
     private String fddAuthPageModify;
@@ -56,6 +59,8 @@ public class CompanyCaAuthLogic {
     }
 
     public void add(CompanyCaAuth companyCaAuth) {
+        final AdminWebsit websit = adminWebsitService.getById(companyCaAuth.getWebsitId());
+        companyCaAuth.setCompanyName(websit.getName());
         CompanyCaAuth caAuth = companyCaAuthService.lambdaQuery()
                 .eq(CompanyCaAuth::getWebsitId, companyCaAuth.getWebsitId())
                 .one();
@@ -68,6 +73,8 @@ public class CompanyCaAuthLogic {
     }
 
     public void update(CompanyCaAuth companyCaAuth) {
+        final AdminWebsit websit = adminWebsitService.getById(companyCaAuth.getWebsitId());
+        companyCaAuth.setCompanyName(websit.getName());
         this.checkInfo(companyCaAuth);
         CompanyCaAuth byId = companyCaAuthService.getById(companyCaAuth.getCompanyCaAuthId());