Преглед на файлове

Merge branch 'refs/heads/test' into test-fee

wks преди 2 години
родител
ревизия
4b02745986

+ 38 - 1
sql/Online.sql

@@ -37,4 +37,41 @@ CREATE TABLE `ins_labor_cost`  (
                                    `update_user` datetime NULL DEFAULT NULL COMMENT '修改人',
                                    `update_date` datetime NULL DEFAULT NULL COMMENT '修改时间',
                                    PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '人力成本表' ROW_FORMAT = Dynamic;
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '人力成本表' ROW_FORMAT = Dynamic;
+
+
+
+--add by caiyaru 20240806
+DROP TABLE IF EXISTS `sys_qr_code_relation`;
+create table `sys_qr_code_relation`(
+                                           `id` bigint auto_increment PRIMARY KEY comment '主键id',
+                                           `api_type` tinyint comment 'api类型(1、api对接,2、python对接)',
+                                           `ins_company_id` varchar(32) comment '保险公司ID',
+                                           `ins_company_name` varchar(255) comment '保险公司名称',
+                                           `qr_code_type` tinyint comment '二维码类型(0:Base64,1:内部链接,2:外部链接)',
+                                           `create_by` varchar(255) comment '创建操作人',
+                                           `create_time` timestamp comment '创建时间',
+                                           `last_update_by` varchar(255) comment '更新操作人',
+                                           `last_update_time` timestamp comment '更新时间',
+                                           CONSTRAINT  `sys_qr_code_relation_uk` unique(`api_type`,`ins_company_id`,`ins_company_name`,`qr_code_type`)
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin comment='二维码类型关联表' ROW_FORMAT = Dynamic;
+
+INSERT INTO `sys_dict_type`(`id`, `name`, `parent_id`, `itemname`, `description`, `create_time`, `update_time`, `remarks`, `del_flag`, `tenant_id`) VALUES ('108', '车险平台', NULL, 'insurancePlatform', NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, '0', 0);
+INSERT INTO `sys_dict_type`(`id`, `name`, `parent_id`, `itemname`, `description`, `create_time`, `update_time`, `remarks`, `del_flag`, `tenant_id`) VALUES ('108001', '二维码', '108', 'QRCode', NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, '0', 0);
+
+INSERT INTO `sys_dict`( `value`, `label`, `itemname`, `description`, `sort`, `create_by`, `create_time`, `last_update_by`, `last_update_time`, `remarks`, `del_flag`, `create_user_id`, `update_user_id`, `update_time`) VALUES ('0', 'Base64', 'QRCode', 'desc', 0, NULL, NULL, NULL, NULL, 'remark', 0, 0, 0, CURRENT_TIMESTAMP);
+INSERT INTO `sys_dict`( `value`, `label`, `itemname`, `description`, `sort`, `create_by`, `create_time`, `last_update_by`, `last_update_time`, `remarks`, `del_flag`, `create_user_id`, `update_user_id`, `update_time`) VALUES ('1', '内部链接', 'QRCode', 'desc', 0, NULL, NULL, NULL, NULL, 'remark', 0, 0, 0, CURRENT_TIMESTAMP);
+INSERT INTO `sys_dict`( `value`, `label`, `itemname`, `description`, `sort`, `create_by`, `create_time`, `last_update_by`, `last_update_time`, `remarks`, `del_flag`, `create_user_id`, `update_user_id`, `update_time`) VALUES ('2', '外部链接', 'QRCode', 'desc', 0, NULL, NULL, NULL, NULL, 'remark', 0, 0, 0, CURRENT_TIMESTAMP);
+
+
+DROP TABLE IF EXISTS `sys_user_track`;
+create table `sys_user_track`(
+                                     `id` bigint auto_increment PRIMARY KEY comment '主键id',
+                                     `user_id` varchar(30) not null comment '用户id',
+                                     `status` tinyint comment '状态  0,"离司",1,"正常",2,"入司待审核",3,"入司审核驳回",4,"离司待审核",5,"离司审核驳回"',
+                                     `approve_by` varchar(255) comment '审核人',
+                                     `approve_time` timestamp comment '审核时间',
+                                     `approve_mess` varchar(255) comment '审核信息',
+                                     index `idx_sys_user_track_user_id`(`user_id`),
+                                     index `idx_sys_user_track_approve_time`(`approve_time`)
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin comment='系统用户审核轨迹表' ROW_FORMAT = Dynamic;

+ 46 - 58
src/main/java/com/ydtech/modules/order/service/impl/InsDrivingIntentionInsuranceServiceImpl.java

@@ -112,66 +112,54 @@ public class InsDrivingIntentionInsuranceServiceImpl extends ServiceImpl<InsDriv
      */
     @Override
     public List<InsDrivingIntentionInsuranceVo> getInsDrivingIntentionInsuranceRule(NoCarInsuranceQueryVo insuranceVo) {
-        // 添加平安的驾意险的险种信息   2024-07-18
-        PtlAgreement ptlAgreement = ptlAgreementService.getById(insuranceVo.getAgreementId());
         //判断是否是平安
-        if("PAIC1000000".equals(ptlAgreement.getInsuranceCompanyId())){
-            //调用接口返回数据
-          //  ProductDetailsRequest productDetailsRequest  =new ProductDetailsRequest(insuranceVo.getAgreementId(), insuranceVo.getRuleUseNature() ,
-          //          insuranceVo.getOwnAttribute(), insuranceVo.getRuleSeatNum(), insuranceVo.getTonNumber(),
-          //          insuranceVo.getIsUseCombine(), insuranceVo.getCimodelclass(),ptlAgreement.getInsuranceCompanyId());
-           // List<InsDrivingIntentionInsuranceVo> insDrivingIntentionInsuranceVos = pingAnOrderApiService.productQueryList(productDetailsRequest);
-           // return insDrivingIntentionInsuranceVos;
-            return null;
-        }else{
-            LambdaQueryWrapper<PtlAgreementNonCarProductRule> query = new LambdaQueryWrapper<PtlAgreementNonCarProductRule>();
-            ProductsType productType = InsuranceRisk.determineInsuranceInformation(insuranceVo.getKind(), insuranceVo.getRisk());
-            if(insuranceVo.getCompanyCode() != null){
-                List<PtlAgreement> byCompanyCode = ptlAgreementService.getByCompanyCode(insuranceVo.getCompanyCode());
-                List<String> collect = byCompanyCode.stream().map(x -> x.getId()).collect(Collectors.toList());
-                query.in(PtlAgreementNonCarProductRule::getAgreementId, collect);
-            }else {
-                PtlAgreement byAgreementIdNew = ptlAgreementService.getByAgreementIdNew(insuranceVo.getAgreementId());
-                List<PtlAgreement> byCompanyCode = ptlAgreementService.getByCompanyCode(byAgreementIdNew.getInsuranceCompanyId());
-                List<String> collect = byCompanyCode.stream().map(x -> x.getId()).collect(Collectors.toList());
-                query.in(PtlAgreementNonCarProductRule::getAgreementId, collect);
-            }
-            query.le(PtlAgreementNonCarProductRule::getSeatNumMin, insuranceVo.getRuleSeatNum());
-            query.ge(PtlAgreementNonCarProductRule::getSeatNumMax, insuranceVo.getRuleSeatNum());
-            query.eq(PtlAgreementNonCarProductRule::getUseNature, insuranceVo.getRuleUseNature());
-            query.eq(PtlAgreementNonCarProductRule::getProductCode, productType.getCode());
-            if(insuranceVo.getRuleThirdPartyInsurance() != null) {
-                query.ge(PtlAgreementNonCarProductRule::getThirdPartyLnsuranceMin, insuranceVo.getRuleThirdPartyInsurance());
-                query.le(PtlAgreementNonCarProductRule::getThirdPartyLnsuranceMax, insuranceVo.getRuleThirdPartyInsurance());
-            }
-            query.orderBy(true, true, PtlAgreementNonCarProductRule::getSort);
-            List<PtlAgreementNonCarProductRule> list = ptlAgreementNonCarProductRuleService.list(query);
-
-            PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insuranceVo.getAgreementId());
-            Integer apiType = ptlAgreementAttribution.getApiType();
-
-            List<InsDrivingIntentionInsuranceVo> insDrivingIntentionInsuranceVo = getInsDrivingIntentionInsuranceVo(insuranceVo, apiType);
-            if(!list.isEmpty()){
-                //遍历顶级
-                insDrivingIntentionInsuranceVo.stream()
-                        .filter(item -> item.getProjectCode().toString().equals(list.get(0).getParentId()))
-                        .findFirst()
-                        .ifPresent(item -> {
-                            item.setIsDefault(true);
-                            item.setQuantity(1);
-                        });
-                //遍历下级
-                insDrivingIntentionInsuranceVo.stream()
-                        .flatMap(item -> item.getChildren().stream())
-                        .filter(child -> child.getProjectCode().toString().equals(list.get(0).getProductId()))
-                        .findFirst()
-                        .ifPresent(child -> {
-                            child.setIsDefault(true);
-                            child.setQuantity(1);
-                        });
-            }
-            return insDrivingIntentionInsuranceVo;
+        LambdaQueryWrapper<PtlAgreementNonCarProductRule> query = new LambdaQueryWrapper<PtlAgreementNonCarProductRule>();
+        ProductsType productType = InsuranceRisk.determineInsuranceInformation(insuranceVo.getKind(), insuranceVo.getRisk());
+        if(insuranceVo.getCompanyCode() != null){
+            List<PtlAgreement> byCompanyCode = ptlAgreementService.getByCompanyCode(insuranceVo.getCompanyCode());
+            List<String> collect = byCompanyCode.stream().map(PtlAgreement::getId).collect(Collectors.toList());
+            query.in(!collect.isEmpty(), PtlAgreementNonCarProductRule::getAgreementId, collect);
+        }else {
+            PtlAgreement byAgreementIdNew = ptlAgreementService.getByAgreementIdNew(insuranceVo.getAgreementId());
+            List<PtlAgreement> byCompanyCode = ptlAgreementService.getByCompanyCode(byAgreementIdNew.getInsuranceCompanyId());
+            List<String> collect = byCompanyCode.stream().map(PtlAgreement::getId).collect(Collectors.toList());
+            query.in(!collect.isEmpty(), PtlAgreementNonCarProductRule::getAgreementId, collect);
         }
+        query.le(PtlAgreementNonCarProductRule::getSeatNumMin, insuranceVo.getRuleSeatNum());
+        query.ge(PtlAgreementNonCarProductRule::getSeatNumMax, insuranceVo.getRuleSeatNum());
+        query.eq(PtlAgreementNonCarProductRule::getUseNature, insuranceVo.getRuleUseNature());
+        query.eq(PtlAgreementNonCarProductRule::getProductCode, productType.getCode());
+        if(insuranceVo.getRuleThirdPartyInsurance() != null) {
+            query.ge(PtlAgreementNonCarProductRule::getThirdPartyLnsuranceMin, insuranceVo.getRuleThirdPartyInsurance());
+            query.le(PtlAgreementNonCarProductRule::getThirdPartyLnsuranceMax, insuranceVo.getRuleThirdPartyInsurance());
+        }
+        query.orderBy(true, true, PtlAgreementNonCarProductRule::getSort);
+        List<PtlAgreementNonCarProductRule> list = ptlAgreementNonCarProductRuleService.list(query);
+
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insuranceVo.getAgreementId());
+        Integer apiType = ptlAgreementAttribution.getApiType();
+
+        List<InsDrivingIntentionInsuranceVo> insDrivingIntentionInsuranceVo = getInsDrivingIntentionInsuranceVo(insuranceVo, apiType);
+        if(!list.isEmpty()){
+            //遍历顶级
+            insDrivingIntentionInsuranceVo.stream()
+                    .filter(item -> item.getProjectCode().toString().equals(list.get(0).getParentId()))
+                    .findFirst()
+                    .ifPresent(item -> {
+                        item.setIsDefault(true);
+                        item.setQuantity(1);
+                    });
+            //遍历下级
+            insDrivingIntentionInsuranceVo.stream()
+                    .flatMap(item -> item.getChildren().stream())
+                    .filter(child -> child.getProjectCode().toString().equals(list.get(0).getProductId()))
+                    .findFirst()
+                    .ifPresent(child -> {
+                        child.setIsDefault(true);
+                        child.setQuantity(1);
+                    });
+        }
+        return insDrivingIntentionInsuranceVo;
     }
 
     @Override

+ 4 - 8
src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java

@@ -4,10 +4,8 @@ import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.collection.CollUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fasterxml.jackson.core.JsonProcessingException;
-import com.ydtech.config.properties.GuorenApiConfigurationProperties;
 import com.ydtech.config.properties.YongchengApiConfigurationProperties;
 import com.ydtech.constants.InsuranceEnum;
 import com.ydtech.constants.enums.InsuranceRisk;
@@ -76,14 +74,12 @@ import com.ydtech.modules.order.utils.InsuranceLog;
 import com.ydtech.modules.protocol.entity.constants.PtlApiType;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import com.ydtech.utils.DateTimeUtil;
-import com.ydtech.utils.ObjectUtil;
 import com.ydtech.utils.StringUtils;
 import com.ydtech.utils.baidu.FileUtil;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.RequiredArgsConstructor;
-import org.apache.commons.lang3.ObjectUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;
@@ -477,7 +473,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
      * @param regex    正则表达是
      * @return
      */
-    private String processingTime(String errorMsg, String regex, String rule) {
+    private static String processingTime(String errorMsg, String regex, String rule) {
         String coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, regex);
 
         if (coverageEndDate.isEmpty() && errorMsg.contains(rule)) {
@@ -494,7 +490,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
      * @param regex
      * @return
      */
-    private TimeEntity getRepeatStartEndTime(String errorMsg, String regex, String rule) {
+    private static TimeEntity getRepeatStartEndTime(String errorMsg, String regex, String rule) {
         String coverageEndDate = processingTime(errorMsg, regex, rule);
         TimeEntity timeEntity = new TimeEntity();
 
@@ -587,10 +583,10 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
             }
 
             //终保日期
-            TimeEntity timeEntity = getRepeatStartEndTime(ciMsg, SY_REGEX, SY_RULE);
+            TimeEntity timeEntity = getRepeatStartEndTime(ciMsg, SY_REGEX, "");
 
             if (StringUtils.isEmpty(timeEntity.getCoverageEndDate())) {
-                return true;
+                throw new SystemException(ciMsg);
             }
 
             System.err.println("商业新起:" + timeEntity.getNewStartDate());

+ 1 - 1
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -651,7 +651,7 @@
 
     <select id="getAllpremium" resultType="com.ydtech.modules.admin.model.dto.AllpremiumDto">
         SELECT
-            ifnull(sum(  iac.sumpremium ),0) as sumPremium,
+            ifnull(sum(  iac.jqpremium + iac.sypremium + iac.jypremium ),0) as sumPremium,
             count( 0 ) as sumCount
         FROM
             ins_area_company iac  left join ins_orders io on iac.orderno=io.orderno