Explorar el Código

Merge remote-tracking branch 'origin/master'

wanghao hace 5 meses
padre
commit
f4defbaa23

+ 31 - 13
authentication/src/main/java/com/jzg/config/JzgAuthenticationProvider.java

@@ -44,10 +44,7 @@ import org.springframework.util.CollectionUtils;
 
 
 import java.io.Serial;
 import java.io.Serial;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 public class JzgAuthenticationProvider implements AuthenticationProvider {
 public class JzgAuthenticationProvider implements AuthenticationProvider {
@@ -143,19 +140,26 @@ public class JzgAuthenticationProvider implements AuthenticationProvider {
                 throw new SystemException("业务员不存在");
                 throw new SystemException("业务员不存在");
             }
             }
             SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfos.get(0);
             SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfos.get(0);
-            if (sysUserJzgInfo.cannotLogin()) {
-                log.info("用户被禁用/离职,不能登录。sysUserJzgInfo=[{}]", JSONUtil.toJsonStr(sysUserJzgInfo));
-                throw new SystemException("用户已被禁用/离职,无法登录");
+            // 租户系统才会校验这个, 后台管理系统,没有租户的概念
+            if(this.isTenantLogin(system)){
+                if (sysUserJzgInfo.cannotLogin()) {
+                    log.info("用户被禁用/离职,不能登录。sysUserJzgInfo=[{}]", JSONUtil.toJsonStr(sysUserJzgInfo));
+                    throw new SystemException("用户已被禁用/离职,无法登录");
+                }
             }
             }
             salt = weblogUser.getSalt();
             salt = weblogUser.getSalt();
         }
         }
-        // modify by lipf, 用户所属租户如果被禁用,不能登录
-        HttpResult<List<SysTennatVo>> tenants = organizationClient.getTenantList(username);
-        log.info("用户[{}]有[{}]个租户,分别是tenants=[{}]",username, CollUtil.size(tenants.getData()), JSONUtil.toJsonStr(tenants));
-        if(CollectionUtil.isEmpty(tenants.getData())){
-            log.info("用户[{}]所属的租户已经被禁用,无法登录",username);
-            throw new SystemException("用户所属的租户已经被禁用,无法登录");
+        if(this.isTenantLogin(system)){
+            // modify by lipf, 用户所属租户如果被禁用,不能登录
+            HttpResult<List<SysTennatVo>> tenants = organizationClient.getTenantList(username);
+            log.info("用户[{}]有[{}]个租户,分别是tenants=[{}]",username, CollUtil.size(tenants.getData()), JSONUtil.toJsonStr(tenants));
+            if(CollectionUtil.isEmpty(tenants.getData())){
+                log.info("用户[{}]所属的租户已经被禁用,无法登录",username);
+                throw new SystemException("用户所属的租户已经被禁用,无法登录");
+            }
         }
         }
+
+
         //检验短信验证码
         //检验短信验证码
         if(Objects.nonNull(code)){
         if(Objects.nonNull(code)){
             String systemSmsCode = redissonClient.getBucket(RedisKeyConstants.SMS_CODE + username).get().toString();
             String systemSmsCode = redissonClient.getBucket(RedisKeyConstants.SMS_CODE + username).get().toString();
@@ -374,6 +378,20 @@ public class JzgAuthenticationProvider implements AuthenticationProvider {
         }};
         }};
     }
     }
 
 
+    /**
+     * 判断是否是租户登录
+     *
+     * @return true 表示是租户登录, false 表示非租户登录
+     * @author lipf
+     * @date 2026/4/30 10:18
+     */
+    private boolean isTenantLogin(String system) {
+        Set<String> clients = new HashSet<>();
+        clients.add("APP");
+        clients.add("PLATFORM");
+        return !clients.contains(system);
+    }
+
 
 
     @Override
     @Override
     public boolean supports(Class<?> authentication) {
     public boolean supports(Class<?> authentication) {

+ 3 - 3
partner/src/main/java/com/jzg/service/Impl/PartnerLiftingRecordServiceImpl.java

@@ -190,11 +190,11 @@ public class PartnerLiftingRecordServiceImpl extends ServiceImpl<PartnerLiftingR
     public void updateAppStatus(PartnerLiftingRecord liftingRecord){
     public void updateAppStatus(PartnerLiftingRecord liftingRecord){
         PartnerUser partnerUser = partnerUserMapper.selectOne(new LambdaQueryWrapper<PartnerUser>().eq(PartnerUser::getUserId, liftingRecord.getUserId())
         PartnerUser partnerUser = partnerUserMapper.selectOne(new LambdaQueryWrapper<PartnerUser>().eq(PartnerUser::getUserId, liftingRecord.getUserId())
                 .eq(PartnerUser::getGrade, liftingRecord.getAfterChange()));
                 .eq(PartnerUser::getGrade, liftingRecord.getAfterChange()));
-        if(partnerUser == null){
+        if(Objects.nonNull(partnerUser)){
             log.error("根据userId=[{}], grade=[{}]没有找到对应的合伙人",liftingRecord.getUserId() , liftingRecord.getAfterChange());
             log.error("根据userId=[{}], grade=[{}]没有找到对应的合伙人",liftingRecord.getUserId() , liftingRecord.getAfterChange());
-            throw new RuntimeException("没有找到对应的合伙人信息。请核实");
+            premiumDetailsMapper.updateAppStatus(String.valueOf(partnerUser.getGrade()), liftingRecord.getUserId(),partnerUser.getIdentityTime());
         }
         }
-        premiumDetailsMapper.updateAppStatus(String.valueOf(partnerUser.getGrade()), liftingRecord.getUserId(),partnerUser.getIdentityTime());
+
     }
     }
 
 
 
 

+ 15 - 7
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/api/build/ChengTaiAPIQuoteResultsVoBuild.java

@@ -78,7 +78,7 @@ public final class ChengTaiAPIQuoteResultsVoBuild {
             sumTax = Double.parseDouble(String.valueOf(premiumCalculationResponse.getCompRisk().getCarShipTax().getSumPayTax()));
             sumTax = Double.parseDouble(String.valueOf(premiumCalculationResponse.getCompRisk().getCarShipTax().getSumPayTax()));
         }
         }
         // 商业金额
         // 商业金额
-        if (Objects.nonNull(premiumCalculationResponse.getCommRisk())) {
+        if (Objects.nonNull(premiumCalculationResponse.getCommRisk()) && Objects.nonNull(premiumCalculationResponse.getCommRisk().getBasePart())) {
             syPremium = Double.parseDouble(premiumCalculationResponse.getCommRisk().getBasePart().getSumPremuim());
             syPremium = Double.parseDouble(premiumCalculationResponse.getCommRisk().getBasePart().getSumPremuim());
         }
         }
         // 非车金额
         // 非车金额
@@ -95,13 +95,21 @@ public final class ChengTaiAPIQuoteResultsVoBuild {
 
 
     private static QuoteResultsVo.ScoreVo buildScoreVo(PremiumCalculationResponse premiumCalculationResponse) {
     private static QuoteResultsVo.ScoreVo buildScoreVo(PremiumCalculationResponse premiumCalculationResponse) {
         QuoteResultsVo.ScoreVo scoreVo = new QuoteResultsVo.ScoreVo();
         QuoteResultsVo.ScoreVo scoreVo = new QuoteResultsVo.ScoreVo();
-        scoreVo.setJqAdjustRate(premiumCalculationResponse.getCompRisk().getBasePart().getDiscount().toString());
-        scoreVo.setSyAdjustRate(premiumCalculationResponse.getCommRisk().getBasePart().getDiscount().toString());
+        if (null != premiumCalculationResponse.getCompRisk() && null != premiumCalculationResponse.getCompRisk().getBasePart()){
+            scoreVo.setJqRenewal(premiumCalculationResponse.getCompRisk().getBasePart().getRenewalFlag());
+            scoreVo.setCiClaims(premiumCalculationResponse.getCompRisk().getBasePart().getClaimsNum());
+            if (null != premiumCalculationResponse.getCompRisk().getBasePart().getDiscount()) {
+                scoreVo.setJqAdjustRate(premiumCalculationResponse.getCompRisk().getBasePart().getDiscount().toString());
+            }
+        }
+        if (null != premiumCalculationResponse.getCommRisk() && null != premiumCalculationResponse.getCommRisk().getBasePart()) {
+            scoreVo.setBiClaims(premiumCalculationResponse.getCommRisk().getBasePart().getClaimsNum());
+            scoreVo.setSyRenewal(premiumCalculationResponse.getCommRisk().getBasePart().getRenewalFlag());
+            if (null != premiumCalculationResponse.getCommRisk().getBasePart().getDiscount()){
+                scoreVo.setSyAdjustRate(premiumCalculationResponse.getCommRisk().getBasePart().getDiscount().toString());
+            }
+        }
         scoreVo.setLossRation(premiumCalculationResponse.getYztScore().getCentile().toString());
         scoreVo.setLossRation(premiumCalculationResponse.getYztScore().getCentile().toString());
-        scoreVo.setJqRenewal(premiumCalculationResponse.getCompRisk().getBasePart().getRenewalFlag());
-        scoreVo.setSyRenewal(premiumCalculationResponse.getCommRisk().getBasePart().getRenewalFlag());
-        scoreVo.setCiClaims(premiumCalculationResponse.getCompRisk().getBasePart().getClaimsNum());
-        scoreVo.setBiClaims(premiumCalculationResponse.getCommRisk().getBasePart().getClaimsNum());
         return scoreVo;
         return scoreVo;
     }
     }
 
 

+ 9 - 6
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/api/service/impl/ChengTaiApiRequestImpl.java

@@ -187,12 +187,14 @@ public class ChengTaiApiRequestImpl implements ChengTaiApiRequest {
             }
             }
         }
         }
         // 转保车处理
         // 转保车处理
-        String ciQuestion = premiumCalculationResponse.getCompRisk() != null
-                ? premiumCalculationResponse.getCompRisk().getBasePart().getQuestion()
-                : null;
-        String biQuestion = premiumCalculationResponse.getCommRisk() != null
-                ? premiumCalculationResponse.getCommRisk().getBasePart().getQuestion()
-                : null;
+        String ciQuestion = null;
+        String biQuestion = null;
+        if (premiumCalculationResponse.getCompRisk() != null && premiumCalculationResponse.getCompRisk().getBasePart() != null){
+            ciQuestion = premiumCalculationResponse.getCompRisk().getBasePart().getQuestion();
+        }
+        if (premiumCalculationResponse.getCommRisk() != null && premiumCalculationResponse.getCommRisk().getBasePart() != null){
+            biQuestion = premiumCalculationResponse.getCommRisk().getBasePart().getQuestion();
+        }
         // 订单号
         // 订单号
         if (ciQuestion!= null || biQuestion != null) {
         if (ciQuestion!= null || biQuestion != null) {
             String orderNumber = premiumCalculationResponse.getCompRisk() != null
             String orderNumber = premiumCalculationResponse.getCompRisk() != null
@@ -207,6 +209,7 @@ public class ChengTaiApiRequestImpl implements ChengTaiApiRequest {
             }
             }
             String sendBody = JSON.toJSONString(bodyMap);
             String sendBody = JSON.toJSONString(bodyMap);
             if (!"{}".equals(sendBody)) {
             if (!"{}".equals(sendBody)) {
+                // 获取图片中的二维码
                 String ocrStr = HttpUtil.sendPost("http://39.98.41.104:8088/getres", sendBody);
                 String ocrStr = HttpUtil.sendPost("http://39.98.41.104:8088/getres", sendBody);
                 CheckCodeResp resp = JSONUtil.toBean(ocrStr, CheckCodeResp.class);
                 CheckCodeResp resp = JSONUtil.toBean(ocrStr, CheckCodeResp.class);
                 if(StringUtils.isNotEmpty(resp.getJqImageCode())){
                 if(StringUtils.isNotEmpty(resp.getJqImageCode())){

+ 24 - 20
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java

@@ -682,26 +682,30 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
                 ? insuredAddress
                 ? insuredAddress
                 : orgClient.queryByAddress(quoteVo.getPolicyHolderInfo().getAddr(), quoteVo.getPolicyHolderInfo().getIdentifyNumber());
                 : orgClient.queryByAddress(quoteVo.getPolicyHolderInfo().getAddr(), quoteVo.getPolicyHolderInfo().getIdentifyNumber());
 
 
-        quoteVo.getOwnersInfo().setProvinceCode(ownerAddress.getData().getProvinceCode());
-        quoteVo.getOwnersInfo().setProvince(ownerAddress.getData().getProvinceName());
-        quoteVo.getOwnersInfo().setCityCode(ownerAddress.getData().getCityCode());
-        quoteVo.getOwnersInfo().setCity(ownerAddress.getData().getCityName());
-        quoteVo.getOwnersInfo().setCountyCode(ownerAddress.getData().getCountyCode());
-        quoteVo.getOwnersInfo().setCounty(ownerAddress.getData().getCountyName());
-
-        quoteVo.getInsuredPersonInfo().setProvinceCode(insuredAddress.getData().getProvinceCode());
-        quoteVo.getInsuredPersonInfo().setProvince(insuredAddress.getData().getProvinceName());
-        quoteVo.getInsuredPersonInfo().setCityCode(insuredAddress.getData().getCityCode());
-        quoteVo.getInsuredPersonInfo().setCity(insuredAddress.getData().getCityName());
-        quoteVo.getInsuredPersonInfo().setCountyCode(insuredAddress.getData().getCountyCode());
-        quoteVo.getInsuredPersonInfo().setCounty(insuredAddress.getData().getCountyName());
-
-        quoteVo.getPolicyHolderInfo().setProvinceCode(policyAddress.getData().getProvinceCode());
-        quoteVo.getPolicyHolderInfo().setProvince(policyAddress.getData().getProvinceName());
-        quoteVo.getPolicyHolderInfo().setCityCode(policyAddress.getData().getCityCode());
-        quoteVo.getPolicyHolderInfo().setCity(policyAddress.getData().getCityName());
-        quoteVo.getPolicyHolderInfo().setCountyCode(policyAddress.getData().getCountyCode());
-        quoteVo.getPolicyHolderInfo().setCounty(policyAddress.getData().getCountyName());
+        if (null != ownerAddress.getData()){
+            quoteVo.getOwnersInfo().setProvinceCode(ownerAddress.getData().getProvinceCode());
+            quoteVo.getOwnersInfo().setProvince(ownerAddress.getData().getProvinceName());
+            quoteVo.getOwnersInfo().setCityCode(ownerAddress.getData().getCityCode());
+            quoteVo.getOwnersInfo().setCity(ownerAddress.getData().getCityName());
+            quoteVo.getOwnersInfo().setCountyCode(ownerAddress.getData().getCountyCode());
+            quoteVo.getOwnersInfo().setCounty(ownerAddress.getData().getCountyName());
+        }
+        if (null != insuredAddress.getData()) {
+            quoteVo.getInsuredPersonInfo().setProvinceCode(insuredAddress.getData().getProvinceCode());
+            quoteVo.getInsuredPersonInfo().setProvince(insuredAddress.getData().getProvinceName());
+            quoteVo.getInsuredPersonInfo().setCityCode(insuredAddress.getData().getCityCode());
+            quoteVo.getInsuredPersonInfo().setCity(insuredAddress.getData().getCityName());
+            quoteVo.getInsuredPersonInfo().setCountyCode(insuredAddress.getData().getCountyCode());
+            quoteVo.getInsuredPersonInfo().setCounty(insuredAddress.getData().getCountyName());
+        }
+        if (null != policyAddress.getData()) {
+            quoteVo.getPolicyHolderInfo().setProvinceCode(policyAddress.getData().getProvinceCode());
+            quoteVo.getPolicyHolderInfo().setProvince(policyAddress.getData().getProvinceName());
+            quoteVo.getPolicyHolderInfo().setCityCode(policyAddress.getData().getCityCode());
+            quoteVo.getPolicyHolderInfo().setCity(policyAddress.getData().getCityName());
+            quoteVo.getPolicyHolderInfo().setCountyCode(policyAddress.getData().getCountyCode());
+            quoteVo.getPolicyHolderInfo().setCounty(policyAddress.getData().getCountyName());
+        }
     }
     }
 
 
     @Override
     @Override