Ver Fonte

Merge branch 'test-d' into helixiao-dev

# Conflicts:
#	src/main/java/com/ydtech/modules/scheme/entity/vo/SchemeRuleAttrMappingVo.java
helixiao há 1 ano atrás
pai
commit
24464336c4

+ 4 - 20
src/main/java/com/ydtech/modules/admin/controller/taskStatistics/TaskStatisticsController.java

@@ -14,6 +14,7 @@ import com.ydtech.modules.admin.service.TaskStatisticsService;
 import com.ydtech.modules.admin.utils.KztGetDeptUtils;
 import io.swagger.annotations.*;
 import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -399,17 +400,9 @@ public class TaskStatisticsController {
      **/
     @PostMapping("getBusinessAgentData")
     @ApiOperation(value = "控制台-业务数据-代理人")
-    public HttpResult<IPage<BusinessAgentData>> getBusinessAgentData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
+    public HttpResult<IPage<BusinessAgentData>> getBusinessAgentData(@RequestBody TaskStatisticsVo taskStatisticsVo) {
         try{
-            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
-            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
-            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
-                if("1".equals(kztGetDeptUtilsDto.getType())){
-                    taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
-                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
-                    taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
-                }
-            }
+
             IPage<BusinessAgentData> result = taskStatisticsService.getBusinessAgentData(taskStatisticsVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){
@@ -424,17 +417,8 @@ public class TaskStatisticsController {
      **/
     @PostMapping("getBusinessAgentDataTotal")
     @ApiOperation(value = "控制台-业务数据-代理人-合计")
-    public HttpResult<BusinessAgentData> getBusinessAgentDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
+    public HttpResult<BusinessAgentData> getBusinessAgentDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo) {
         try{
-            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
-            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
-            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
-                if("1".equals(kztGetDeptUtilsDto.getType())){
-                    taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
-                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
-                    taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
-                }
-            }
             BusinessAgentData result = taskStatisticsService.getBusinessAgentDataTotal(taskStatisticsVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){

+ 9 - 0
src/main/java/com/ydtech/modules/admin/model/vo/PersonAreaVo.java

@@ -1,11 +1,14 @@
 package com.ydtech.modules.admin.model.vo;
 
+import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
 
 
 @Data
+@NoArgsConstructor
 public class PersonAreaVo implements Serializable {
 
     private static final long serialVersionUID = -8235445978142897003L;
@@ -24,4 +27,10 @@ public class PersonAreaVo implements Serializable {
     private String countyName;
 
 
+
+    public PersonAreaVo(CustomerInfoVo customerInfoVo) {
+        this.provinceCode = customerInfoVo.getProvince();
+        this.cityCode = customerInfoVo.getCity();
+        this.countyCode = customerInfoVo.getCounty();
+    }
 }

+ 3 - 0
src/main/java/com/ydtech/modules/admin/model/vo/TaskStatisticsVo.java

@@ -163,4 +163,7 @@ public class TaskStatisticsVo implements Serializable {
 
     @ApiModelProperty(value = "筛选录单开始时间")
     private String enterTimeEnd;
+
+    @ApiModelProperty(value = "时间类型")
+    private String timeType;
 }

+ 27 - 14
src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java

@@ -689,6 +689,9 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
         pageVo.setPageNum(taskStatisticsVo.getPageNum());
         pageVo.setPageSize(taskStatisticsVo.getPageSize());
 
+        if(StringUtils.isNotEmpty(taskStatisticsVo.getTreeType()) &&  (StringUtils.isEmpty(taskStatisticsVo.getTreeUserId()) &&  StringUtils.isEmpty(taskStatisticsVo.getDeptId()) ) ){
+            return new Page<>(taskStatisticsVo.getPageNum(), taskStatisticsVo.getPageNum());
+        }
 
         HashMap<String, String> dateMapByType = getDateMapByTypeNew(taskStatisticsVo.getDateType(), taskStatisticsVo.getCreatetimeStart(), taskStatisticsVo.getCreatetimeEnd());
         taskStatisticsVo.setCreatetimeStart(dateMapByType.get("startDate"));
@@ -861,6 +864,9 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
                 taskStatisticsVo.setUserIds(new ArrayList<>());
             }
         }
+        if (StringUtils.isNotEmpty(taskStatisticsVo.getTreeType()) && (StringUtils.isEmpty(taskStatisticsVo.getTreeUserId()) && StringUtils.isEmpty(taskStatisticsVo.getDeptId()))) {
+            return new BusinessAgentData();
+        }
 
         String deptId = BaseController.getDeptId();
         BusinessAgentData result = this.taskStatisticsMapper.getBusinessAgentDataTotalAdd(taskStatisticsVo);
@@ -882,7 +888,7 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
         BigDecimal subtract = entranceAllFee.subtract(exportAllFee);
         result.setDistributionAmount(subtract); //毛利润
         if(subtract.compareTo(BigDecimal.ZERO)>0){
-            BigDecimal resultDivided = subtract.divide(sumPremium, 2, RoundingMode.HALF_UP); //人均产能
+            BigDecimal resultDivided = subtract.divide(sumPremium, 4, RoundingMode.HALF_UP); //人均产能
             result.setDistributionAmountRate(resultDivided);
         }else {
             result.setDistributionAmountRate(BigDecimal.ZERO);
@@ -1140,20 +1146,27 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
         String  endDateStr = new String();
         if (StringUtils.isNotEmpty(type)) {
             switch (type) {
-                case "1" : startDateStr= SliceUpDateUtil.getBeforeDay(new Date(),0) + " 00:00:00";
-                           endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0) + " 23:59:59";
-                           break;
-                case "2" : startDateStr= SliceUpDateUtil.getBeforeDay(new Date(),1) + " 00:00:00";
-                           endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0) + " 23:59:59";
-                           break;
-                case "3" : startDateStr= SliceUpDateUtil.getBeforeDay(new Date(),6) + " 00:00:00";
-                           endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0) + " 23:59:59";
-                           break;
+                case "1" :  startDateStr = SliceUpDateUtil.getBeforeDay(new Date(),0) + " 00:00:00";
+                    endDateStr = SliceUpDateUtil.getBeforeDay(new Date(),0) + " 23:59:59";
+                    break;
+                case "2" :  startDateStr = SliceUpDateUtil.getBeforeDay(new Date(),1) + " 00:00:00";
+                    endDateStr = SliceUpDateUtil.getBeforeDay(new Date(),0) + " 23:59:59";
+                    break;
+                case "3" :  startDateStr = SliceUpDateUtil.getBeforeDay(new Date(),6) + " 00:00:00";
+                    endDateStr = SliceUpDateUtil.getBeforeDay(new Date(),0) + " 23:59:59";
+                    break;
+            }
+            if (StringUtils.isNotEmpty(taskStatisticsVo.getTimeType())) {
+                switch (taskStatisticsVo.getTimeType()) {
+                    case "1" :  taskStatisticsVo.setEnterTimeStart(startDateStr);
+                        taskStatisticsVo.setEnterTimeEnd(endDateStr);
+                        break;
+                    case "2" :  taskStatisticsVo.setSigningTimeStart(startDateStr);
+                        taskStatisticsVo.setSigningTimeEnd(endDateStr);
+                        break;
+                }
             }
-            taskStatisticsVo.setSigningTimeStart(startDateStr);
-            taskStatisticsVo.setSigningTimeEnd(endDateStr);
-            taskStatisticsVo.setEnterTimeStart(startDateStr);
-            taskStatisticsVo.setEnterTimeEnd(endDateStr);
         }
     }
+
 }

+ 11 - 1
src/main/java/com/ydtech/modules/admin/service/impl/UserReportServiceImpl.java

@@ -340,6 +340,7 @@ public class UserReportServiceImpl implements UserReportService {
             List<QxFrontlineAgentDto> getQxFrontlineAgentList = sysUserMapper.getQxFrontlineAgentList(qxFrontlineAgentVo);
             if (qxFrontlineAgentVo.getManagementSource().equals("1")) {// 渠道
                 getQxFrontlineAgentList .clear();
+
                 getQxFrontlineAgentList.addAll(userReportMapper.selectChannelPersonOld(qxFrontlineAgentVo));
             } else if (qxFrontlineAgentVo.getManagementSource().equals("2")) {// 代理人
                 this.agentPerson(getQxFrontlineAgentList, qxFrontlineAgentVo);
@@ -399,8 +400,17 @@ public class UserReportServiceImpl implements UserReportService {
 
     @Override
     public HttpResult agentExcel(QxFrontlineAgentVo qxFrontlineAgentVo) {
-//        QxFrontlineAgentExcel
 
+        String leaderId = qxFrontlineAgentVo.getLeaderId();
+        if(StringUtils.isNotEmpty(leaderId)) {
+            //获取领导人下级所有
+            List<String> ids = new ArrayList<>();
+            List<String> userList = this.getUserTreeHx(leaderId, ids);
+            userList.add(leaderId);
+            if (userList.size() > 0) {
+                qxFrontlineAgentVo.setLeaderIds(userList);
+            }
+        }
         HashMap<String, String> map = getDateMapByType(qxFrontlineAgentVo.getDays(), qxFrontlineAgentVo.getCreatetimeStart(), qxFrontlineAgentVo.getCreatetimeEnd());
         qxFrontlineAgentVo.setCreatetimeStart(map.get("startDate"));
         qxFrontlineAgentVo.setCreatetimeEnd(map.get("endDate"));

+ 5 - 4
src/main/java/com/ydtech/modules/ins/model/vo/CustomerInfoVo.java

@@ -1,7 +1,8 @@
 package com.ydtech.modules.ins.model.vo;
 
 import com.ydtech.validation.annotation.CheckDateTime;
-import com.ydtech.validation.annotation.CheckIdentifyNumber;
+import com.ydtech.validation.annotation.CheckIdentifyNumberClass;
+import com.ydtech.validation.annotation.CodeNotNull;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
@@ -22,21 +23,21 @@ import javax.validation.constraints.NotNull;
 @NoArgsConstructor
 @AllArgsConstructor
 @ApiModel(value = "人员信息")
+@CodeNotNull()
+@CheckIdentifyNumberClass()
 public class CustomerInfoVo {
 
     @NotNull(message = "车主、投保人、被保人姓名不能为空")
     @ApiModelProperty("姓名")
     private String name;
 
-    @NotNull(message = "车主、投保人、被保人身份证号不能为空")
     @ApiModelProperty("身份证号")
     private String identifyNumber;
 
-//    @NotNull(message = "(企业)车主、投保人、被保人组织机构代码不能为空")
     @ApiModelProperty("组织机构代码")
     private String organizationCode;
 
-//    @NotNull(message = "车主、投保人、被保人身份证类型不能为空")
+    @NotNull(message = "车主、投保人、被保人身份证类型不能为空")
     @ApiModelProperty("身份证类型")
     private String identifyType;
 

+ 26 - 19
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/InsurePremiumRequest.java

@@ -54,7 +54,6 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
     public InsurePremiumRequest(BaseQuoteInfoVo quoteInfoVo,
                                 CarInfoResponse.CarModelListDTO carModelListDTO,
                                 QueryCarActualValueResponse carActualValueResponse,
-                                PersonAreaVo personAreaVo,
                                 ChengTaiConfigureParameters parameters,
                                 BaseQuoteVo<InsDrivingIntentionInsurance> quoteVo){
         super(parameters.getPartnerCode());
@@ -62,7 +61,7 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
         InsuredObjectDTO insuredObject = new InsuredObjectDTO(quoteInfoVo, carModelListDTO,carActualValueResponse);
         this.insuredObject = insuredObject;
         // 客户信息
-        OwnerDTO owner = new OwnerDTO(quoteInfoVo.getOwnerInfo(), personAreaVo);
+        OwnerDTO owner = new OwnerDTO(quoteInfoVo.getOwnerInfo());
         this.owner = owner;
         // 交强险
         Boolean isJq = InsuranceRisk.getFlagByTRAFFIC(quoteInfoVo.getRiskList());
@@ -646,25 +645,33 @@ public class InsurePremiumRequest extends ChengTaiBaseRequest{
         @JsonProperty("relationWithCar")
         private String relationWithCar;
 
-        public OwnerDTO(CustomerInfoVo ownerInfo, PersonAreaVo personAreaVo){
-            this.type = "1";
+        public OwnerDTO(CustomerInfoVo ownerInfo){
+            if ("1".equals(ownerInfo.getProperty())){
+                this.type = "1"; // 个人
+                this.identifyTypeCode = "01";
+                this.identifyTypeName = "居民身份证";
+                this.identifyNumber = ownerInfo.getIdentifyNumber();
+                this.sex = "男".equals(ownerInfo.getGender()) ? "1" : "2";
+                this.age = IDCardUtils.getAgeFromIDCard(ownerInfo.getIdentifyNumber());
+                this.birthday = IDCardUtils.GetBirthday(ownerInfo.getIdentifyNumber());
+                this.identifyValidDate = ownerInfo.getIdentifyValidDate();
+                this.identifyValidEndDate = ownerInfo.getIdentifyValidEndDate();
+                this.longTerm = "0";
+            }else{
+                this.type = "2"; // 机构
+                this.identifyTypeCode = "3";
+                this.identifyTypeName = "营业执照";
+                this.identifyNumber = ownerInfo.getOrganizationCode();
+            }
             this.isTerror = "0";
             this.name = ownerInfo.getName();
-            this.identifyTypeCode = "01";
-            this.identifyTypeName = "居民身份证";
-            this.identifyNumber = ownerInfo.getIdentifyNumber();
-            this.province = personAreaVo.getProvinceCode();
-            this.city = personAreaVo.getCityCode();
-            this.district = personAreaVo.getCountyCode();
-            this.addr = ownerInfo.getAddr();
-            this.mobile = ownerInfo.getMobile();
-            this.identifyValidDate = ownerInfo.getIdentifyValidDate();
-            this.identifyValidEndDate = ownerInfo.getIdentifyValidEndDate();
-            this.longTerm = "0";
-            this.sex = "男".equals(ownerInfo.getGender()) ? "1" : "2";
-            this.birthday = IDCardUtils.GetBirthday(ownerInfo.getIdentifyNumber());
-            this.relationWithInsured = "0";
-            this.relationWithCar = "1";
+//            this.province = personAreaVo.getProvinceCode();
+//            this.city = personAreaVo.getCityCode();
+//            this.district = personAreaVo.getCountyCode();
+//            this.addr = ownerInfo.getAddr();
+//            this.mobile = ownerInfo.getMobile();
+//            this.relationWithInsured = "0";
+//            this.relationWithCar = "1";
 
         }
     }

+ 64 - 25
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/SubmitVerifyRequest.java

@@ -1,8 +1,10 @@
 package com.ydtech.modules.order.entity.api.chengtai.request;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.modules.admin.model.vo.PersonAreaVo;
+import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
@@ -83,25 +85,43 @@ public class SubmitVerifyRequest extends ChengTaiBaseRequest{
         private String addr;
         @JsonProperty("mobile")
         private String mobile;
+        @JsonProperty("organizationCode")
+        private String organizationCode;
+        @JsonProperty("tel")
+        private String tel;
+        @JsonProperty("linkerName")
+        private String linkerName;
+        @JsonProperty("unitTypeCode")
+        private String unitTypeCode;
+
 
         public ApplicantDTO(InsOrders insOrders, PersonAreaVo applyPersonAreaVo){
             // 获取投保人信息
-            JSONObject applyInfo = insOrders.getApplyinfo();
-            this.type = "1";
-            this.name = applyInfo.getString("name");
-            this.identifyTypeCode = "01";
-            this.identifyTypeName = "居民身份证";
-            this.identifyNumber = applyInfo.getString("identifyNumber");
+            CustomerInfoVo applyInfo = JSON.toJavaObject(insOrders.getApplyinfo(),CustomerInfoVo.class);
+            if("0".equals(applyInfo.getProperty())){
+                this.type = "2";
+                this.identifyTypeCode = "1";
+                this.identifyNumber = applyInfo.getOrganizationCode();
+                this.organizationCode = applyInfo.getOrganizationCode();
+                this.tel = applyInfo.getMobile();
+                this.linkerName = applyInfo.getName();
+                this.unitTypeCode = "900"; // 单位性质 900:其他
+            }else{
+                this.type = "1";
+                this.identifyTypeCode = "01";
+                this.identifyNumber = applyInfo.getIdentifyNumber();
+                this.sex = IDCardUtils.GetSex(identifyNumber).equalsIgnoreCase("FEMALE") ? "2" : "1";
+                this.birthday = IDCardUtils.GetBirthday(applyInfo.getIdentifyNumber());
+            }
+            this.name = applyInfo.getName();
             this.province = applyPersonAreaVo.getProvinceCode();
             this.city = applyPersonAreaVo.getCityCode();
             this.district = applyPersonAreaVo.getCountyCode();
-            this.addr = applyInfo.getString("addr");
-            this.mobile = applyInfo.getString("mobile");
-            this.sex = IDCardUtils.GetSex(identifyNumber).equalsIgnoreCase("FEMALE") ? "2" : "1";
-            this.identifyValidDate = applyInfo.getString("identifyValidDate");
-            this.identifyValidEndDate = applyInfo.getString("identifyValidEndDate");
+            this.addr = applyInfo.getAddr();
+            this.mobile = applyInfo.getMobile();
+            this.identifyValidDate = applyInfo.getIdentifyValidDate();
+            this.identifyValidEndDate = applyInfo.getIdentifyValidEndDate();
             this.longTerm = "0";
-            this.birthday = IDCardUtils.GetBirthday(applyInfo.getString("identifyNumber"));
         }
     }
 
@@ -143,25 +163,44 @@ public class SubmitVerifyRequest extends ChengTaiBaseRequest{
         private String relationWithInsured;
         @JsonProperty("relationWithCar")
         private String relationWithCar;
+        @JsonProperty("organizationCode")
+        private String organizationCode;
+        @JsonProperty("tel")
+        private String tel;
+        @JsonProperty("linkerName")
+        private String linkerName;
+        @JsonProperty("unitTypeCode")
+        private String unitTypeCode;
 
         public InsuredDTO(InsOrders insOrders, PersonAreaVo personAreaVo){
-            // 获取被保人信息
-            JSONObject insureinfo = insOrders.getInsureinfo();
-            this.type = "1";
-            this.name = insureinfo.getString("name");
-            this.identifyTypeCode = "01";
-            this.identifyTypeName = "居民身份证";
-            this.identifyNumber = insureinfo.getString("identifyNumber");
+            // 获取投保人信息
+            CustomerInfoVo insureInfo = JSON.toJavaObject(insOrders.getInsureinfo(),CustomerInfoVo.class);
+            if("0".equals(insureInfo.getProperty())){
+                this.type = "2";
+                this.identifyTypeCode = "1";
+                this.identifyNumber = insureInfo.getOrganizationCode();
+                this.organizationCode = insureInfo.getOrganizationCode();
+                this.tel = insureInfo.getMobile();
+                this.linkerName = insureInfo.getName();
+                this.unitTypeCode = "900"; // 单位性质 900:其他
+            }else{
+                this.type = "1";
+                this.identifyTypeCode = "01";
+                this.identifyNumber = insureInfo.getIdentifyNumber();
+                this.sex = IDCardUtils.GetSex(identifyNumber).equalsIgnoreCase("FEMALE") ? "2" : "1";
+                this.birthday = IDCardUtils.GetBirthday(insureInfo.getIdentifyNumber());
+                this.relationWithInsured = "0";
+                this.relationWithCar = "1";
+            }
+            this.name = insureInfo.getName();
             this.province = personAreaVo.getProvinceCode();
             this.city = personAreaVo.getCityCode();
             this.district = personAreaVo.getCountyCode();
-            this.addr = insureinfo.getString("addr");
-            this.mobile = insureinfo.getString("mobile");
-            this.sex = IDCardUtils.GetSex(identifyNumber).equalsIgnoreCase("FEMALE") ? "2" : "1";
-            this.identifyValidDate = insureinfo.getString("identifyValidDate");
-            this.identifyValidEndDate = insureinfo.getString("identifyValidEndDate");
+            this.addr = insureInfo.getAddr();
+            this.mobile = insureInfo.getMobile();
+            this.identifyValidDate = insureInfo.getIdentifyValidDate();
+            this.identifyValidEndDate = insureInfo.getIdentifyValidEndDate();
             this.longTerm = "0";
-            this.birthday = IDCardUtils.GetBirthday(insureinfo.getString("identifyNumber"));
         }
     }
 

+ 86 - 64
src/main/java/com/ydtech/modules/order/service/impl/ChengTaiOrderApiServiceImpl.java

@@ -121,10 +121,7 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
         QueryCarActualValueResponse carActualValueResponse = chengTaiRequestApiComponents.queryActualValue(carActualValueRequest,httpHeaders);
 
         /** 4. 报价 */
-        PersonAreaVo personAreaVo = new PersonAreaVo();
-        buildRegion(quoteInfoVo,personAreaVo);
-        InsurePremiumRequest insurePremiumRequest = new InsurePremiumRequest(quoteInfoVo,carModelListDTO, carActualValueResponse,personAreaVo,parameters,quoteVo);
-
+        InsurePremiumRequest insurePremiumRequest = new InsurePremiumRequest(quoteInfoVo,carModelListDTO, carActualValueResponse,parameters,quoteVo);
         // 重复报价
         InsurePremiumResponse insurePremiumResponse = this.getResponse(insurePremiumRequest, httpHeaders);
 
@@ -490,62 +487,75 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
         return quoteRespVo;
     }
 
-    /**
-     * 获取地区编码
-     * @param quoteInfoVo
-     * @param personAreaVo
-     */
-    private void buildRegion(BaseQuoteInfoVo quoteInfoVo, PersonAreaVo personAreaVo) {
-
-        //车主
-        CustomerInfoVo owner = quoteInfoVo.getOwnerInfo();
-        //被保人
-        CustomerInfoVo insured = quoteInfoVo.getInsuredPersonInfo();
-        //投保人
-        CustomerInfoVo applicant = quoteInfoVo.getPolicyHolderInfo();
-
-        //车主地区信息
-        PersonAreaVo ownerPersonAreaVo = sysAreaService.queryByAddressYc(owner.getAddr(), owner.getIdentifyNumber());
-        PersonAreaVo insuredPersonAreaVo;
-        PersonAreaVo applicantPersonAreaVo;
-
-        //车主是否与投保人相同
-        if (owner.getIdentifyNumber().equals(insured.getIdentifyNumber())) {
-            insuredPersonAreaVo = ownerPersonAreaVo;
-        } else {
-            //投保人地区信息
-            insuredPersonAreaVo = sysAreaService.queryByAddressYc(insured.getAddr(), insured.getIdentifyNumber());
-        }
-
-        //车主是否与被保人相同
-        if (owner.getIdentifyNumber().equals(applicant.getIdentifyNumber())) {
-            applicantPersonAreaVo = ownerPersonAreaVo;
-        } else { //投保人是否与被保人相同
-            if (insured.getIdentifyNumber().equals(applicant.getIdentifyNumber())) {
-                applicantPersonAreaVo = insuredPersonAreaVo;
-            } else {
-                applicantPersonAreaVo = sysAreaService.queryByAddressYc(applicant.getAddr(), applicant.getIdentifyNumber());
-            }
-        }
-
-        if (!Objects.isNull(ownerPersonAreaVo)) {
-            personAreaVo.setProvinceCode(ownerPersonAreaVo.getProvinceCode());
-            personAreaVo.setCityCode(ownerPersonAreaVo.getCityCode());
-            personAreaVo.setCountyCode(ownerPersonAreaVo.getCountyCode());
-        }
-
-        if (!Objects.isNull(insuredPersonAreaVo)) {
-            personAreaVo.setProvinceCode(insuredPersonAreaVo.getProvinceCode());
-            personAreaVo.setCityCode(insuredPersonAreaVo.getCityCode());
-            personAreaVo.setCountyCode(insuredPersonAreaVo.getCountyCode());
-        }
-
-        if (!Objects.isNull(applicantPersonAreaVo)) {
-            personAreaVo.setProvinceCode(applicantPersonAreaVo.getProvinceCode());
-            personAreaVo.setCityCode(applicantPersonAreaVo.getCityCode());
-            personAreaVo.setCountyCode(applicantPersonAreaVo.getCountyCode());
-        }
-    }
+//    /**
+//     * 获取地区编码
+//     * @param quoteInfoVo
+//     * @param personAreaVo
+//     */
+//    private void buildRegion(BaseQuoteInfoVo quoteInfoVo, PersonAreaVo personAreaVo) {
+//
+//        //车主
+//        CustomerInfoVo owner = quoteInfoVo.getOwnerInfo();
+//        //被保人
+//        CustomerInfoVo insured = quoteInfoVo.getInsuredPersonInfo();
+//        //投保人
+//        CustomerInfoVo applicant = quoteInfoVo.getPolicyHolderInfo();
+//
+//        //车主地区信息
+//        PersonAreaVo ownerPersonAreaVo;
+//        if("0".equals(owner.getProperty())){
+//            ownerPersonAreaVo = sysAreaService.queryByAddressYc(owner.getAddr(), owner.getIdentifyNumber());
+//        }else {
+//            ownerPersonAreaVo = new PersonAreaVo(owner);
+//        }
+//        PersonAreaVo insuredPersonAreaVo;
+//        PersonAreaVo applicantPersonAreaVo;
+//
+//        //车主是否与投保人相同
+//        if (owner.getIdentifyNumber().equals(insured.getIdentifyNumber())) {
+//            insuredPersonAreaVo = ownerPersonAreaVo;
+//        } else {
+//            if("0".equals(owner.getProperty())){
+//                //投保人地区信息
+//                insuredPersonAreaVo = sysAreaService.queryByAddressYc(insured.getAddr(), insured.getIdentifyNumber());
+//            }else{
+//                insuredPersonAreaVo = new PersonAreaVo(insured);
+//            }
+//        }
+//
+//        //车主是否与被保人相同
+//        if (owner.getIdentifyNumber().equals(applicant.getIdentifyNumber())) {
+//            applicantPersonAreaVo = ownerPersonAreaVo;
+//        } else { //投保人是否与被保人相同
+//            if (insured.getIdentifyNumber().equals(applicant.getIdentifyNumber())) {
+//                applicantPersonAreaVo = insuredPersonAreaVo;
+//            } else {
+//                if("0".equals(owner.getProperty())){
+//                    applicantPersonAreaVo = sysAreaService.queryByAddressYc(applicant.getAddr(), applicant.getIdentifyNumber());
+//                }else{
+//                    applicantPersonAreaVo = new PersonAreaVo(applicant);
+//                }
+//            }
+//        }
+//
+//        if (!Objects.isNull(ownerPersonAreaVo)) {
+//            personAreaVo.setProvinceCode(ownerPersonAreaVo.getProvinceCode());
+//            personAreaVo.setCityCode(ownerPersonAreaVo.getCityCode());
+//            personAreaVo.setCountyCode(ownerPersonAreaVo.getCountyCode());
+//        }
+//
+//        if (!Objects.isNull(insuredPersonAreaVo)) {
+//            personAreaVo.setProvinceCode(insuredPersonAreaVo.getProvinceCode());
+//            personAreaVo.setCityCode(insuredPersonAreaVo.getCityCode());
+//            personAreaVo.setCountyCode(insuredPersonAreaVo.getCountyCode());
+//        }
+//
+//        if (!Objects.isNull(applicantPersonAreaVo)) {
+//            personAreaVo.setProvinceCode(applicantPersonAreaVo.getProvinceCode());
+//            personAreaVo.setCityCode(applicantPersonAreaVo.getCityCode());
+//            personAreaVo.setCountyCode(applicantPersonAreaVo.getCountyCode());
+//        }
+//    }
 
     @Override
     public HttpResult<Object> submitImages(String companyId) throws Exception {
@@ -602,10 +612,22 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
                 ptlAgreementAttribution);
         HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
         // 2 提交核保
-        JSONObject applyInfo = insOrders.getApplyinfo();
-        JSONObject insureinfo = insOrders.getInsureinfo();
-        PersonAreaVo applyPersonAreaVo = sysAreaService.queryByAddressYc(applyInfo.getString("addr"), applyInfo.getString("identifyNumber"));
-        PersonAreaVo insurePersonAreaVo = sysAreaService.queryByAddressYc(insureinfo.getString("addr"), insureinfo.getString("identifyNumber"));
+        CustomerInfoVo applyInfo = JSON.toJavaObject(insOrders.getApplyinfo(),CustomerInfoVo.class);
+        CustomerInfoVo insureInfo = JSON.toJavaObject(insOrders.getInsureinfo(),CustomerInfoVo.class);
+        String applyProperty = applyInfo.getProperty();
+        String insureProperty = insureInfo.getProperty();
+        PersonAreaVo applyPersonAreaVo;
+        PersonAreaVo insurePersonAreaVo;
+        if ("0".equals(applyProperty)) {
+            applyPersonAreaVo = new PersonAreaVo(applyInfo);
+        }else{
+            applyPersonAreaVo = sysAreaService.queryByAddressYc(applyInfo.getAddr(), applyInfo.getIdentifyNumber());
+        }
+        if ("0".equals(insureProperty)) {
+            insurePersonAreaVo = new PersonAreaVo(insureInfo);
+        }else{
+            insurePersonAreaVo = sysAreaService.queryByAddressYc(insureInfo.getAddr(), insureInfo.getIdentifyNumber());
+        }
 
         List<SubmitVerifyRequest.EngageListDTO> engageDTO = new ArrayList<>();
         // 获取特约

+ 67 - 85
src/main/java/com/ydtech/modules/scheme/entity/vo/SchemeRuleAttrMappingVo.java

@@ -9,6 +9,7 @@ import com.ydtech.modules.order.entity.api.dajia.constants.TypeVehicleMapping;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
 import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesAttr;
+import com.ydtech.utils.StringUtils;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -37,76 +38,36 @@ public class SchemeRuleAttrMappingVo {
                                                                    CustomerInfoVo insuredPersonInfo,
                                                                    PtlNewCarJudgeRules carJudgeRule) {
         List<SchemeRuleAttrMappingVo> ruleAttrMappingVoList = new ArrayList<>();
-        //所属性质(1个人 2企业 3机关)
-        String property = carInfo.getProperty();
-        if ("2".equals(property)) {
-            //车牌号
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("LicenseNo", carInfo.getLicenseNo()));
-            //品牌型号
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("BrandandModel", carInfo.getModelcname()));
-            //座位数
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("PassengerCarSeatingCapacity", carInfo.getSeatCount()));
-            //新车购置价
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("PurchasePriceofNewVehicle", carInfo.getPurchasePrice()));
-            //车辆用途
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("NatureOfUse", TypeVehicleMapping.getByCode(carInfo.getVehicleUse())));
-            //车辆种类
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarType", VehicleType.getByCode(carInfo.getCimodelclass())));
-            //使用性质
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("carnature", VehicleUsage.valueOf("VU_" + carInfo.getCarnature()).getDesc()));
-            //核定载质量
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("AuthorizedLoadWeight", carInfo.getLimitLoad()));
-            //整备质量
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CurbWeight", carInfo.getVehicleweight()));
-            //能源类型
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("NewEnergy", carInfo.getEnergyType()));
-            //注册日期
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("RegistrationDate", carInfo.getRegisterDate()));
-            //是否过户
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("TransferVehicle", carInfo.isTransferFlag() ? "1" : "0"));
-            //是否新车
-            //使用注册日期算出自然月 然后判断是否是新旧车
-            LocalDate registrationDate = LocalDate.parse(carInfo.getRegisterDate());
-            LocalDate currentDate = LocalDate.now();
-
-            boolean isNoLicenseFlag = false;
-
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("NewAndOldCars", isNoLicenseFlag ? "1" : "0"));
-
-
-
-        }else {
-
-            //车牌号
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("LicenseNo", carInfo.getLicenseNo()));
-            //品牌型号
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("BrandandModel", carInfo.getModelcname()));
-            //座位数
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("PassengerCarSeatingCapacity", carInfo.getSeatCount()));
-            //新车购置价
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("PurchasePriceofNewVehicle", carInfo.getPurchasePrice()));
-            //车辆用途
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("NatureOfUse", TypeVehicleMapping.getByCode(carInfo.getVehicleUse())));
-            //车辆种类
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarType", VehicleType.getByCode(carInfo.getCimodelclass())));
-            //使用性质
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("carnature", VehicleUsage.valueOf("VU_" + carInfo.getCarnature()).getDesc()));
-            //核定载质量
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("AuthorizedLoadWeight", carInfo.getLimitLoad()));
-            //整备质量
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CurbWeight", carInfo.getVehicleweight()));
-            //能源类型
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("NewEnergy", carInfo.getEnergyType()));
-            //注册日期
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("RegistrationDate", carInfo.getRegisterDate()));
-            //是否过户
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("TransferVehicle", carInfo.isTransferFlag() ? "1" : "0"));
-            //是否新车
-            //使用注册日期算出自然月 然后判断是否是新旧车
-            LocalDate registrationDate = LocalDate.parse(carInfo.getRegisterDate());
-            LocalDate currentDate = LocalDate.now();
-
-            boolean isNoLicenseFlag = false;
+        //车牌号
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("LicenseNo", carInfo.getLicenseNo()));
+        //品牌型号
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("BrandandModel", carInfo.getModelcname()));
+        //座位数
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("PassengerCarSeatingCapacity", carInfo.getSeatCount()));
+        //新车购置价
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("PurchasePriceofNewVehicle", carInfo.getPurchasePrice()));
+        //车辆用途
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("NatureOfUse", TypeVehicleMapping.getByCode(carInfo.getVehicleUse())));
+        //车辆种类
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarType", VehicleType.getByCode(carInfo.getCimodelclass())));
+        //使用性质
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("carnature", VehicleUsage.valueOf("VU_" + carInfo.getCarnature()).getDesc()));
+        //核定载质量
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("AuthorizedLoadWeight", carInfo.getLimitLoad()));
+        //整备质量
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CurbWeight", carInfo.getVehicleweight()));
+        //能源类型
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("NewEnergy", carInfo.getEnergyType()));
+        //注册日期
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("RegistrationDate", carInfo.getRegisterDate()));
+        //是否过户
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("TransferVehicle", carInfo.isTransferFlag() ? "1" : "0"));
+        //是否新车
+        //使用注册日期算出自然月 然后判断是否是新旧车
+        LocalDate registrationDate = LocalDate.parse(carInfo.getRegisterDate());
+        LocalDate currentDate = LocalDate.now();
+
+        boolean isNoLicenseFlag = false;
 //        if (carJudgeRule != null) {
 //            if (carJudgeRule.getUnitTypeCode().equals("天")) {
 //                long days = ChronoUnit.DAYS.between(registrationDate, currentDate);
@@ -122,37 +83,59 @@ public class SchemeRuleAttrMappingVo {
 //            }
 //        }
 
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("NewAndOldCars", isNoLicenseFlag ? "1" : "0"));
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("NewAndOldCars", isNoLicenseFlag ? "1" : "0"));
 
-            //发证日期
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("DateofIssuance", carInfo.getIssueDate()));
-            //车长
+        //发证日期
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("DateofIssuance", carInfo.getIssueDate()));
+        //车长
 //        ruleAttrMappingVoList.add(new RuleAttrMappingVo("VehicleLength", carInfo.getCarLength()));
 
-            //车主 证件号码(前6位)
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarOwnersIDNumber", ownerInfo.getIdentifyNumber()));
+        boolean boo = false;
+
+        // 车主
+        if (StringUtils.isBlank(ownerInfo.getProperty()) || !"0".equals(ownerInfo.getProperty())){
             //车主 年龄
             ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarOwnersAge", ownerInfo.getAge()));
             //车主 性别
             ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarOwnersSex", ownerInfo.getGender().equals("男") ? "1" : "2"));
-            //车主 姓名
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarOwnerName", ownerInfo.getName()));
+            //车主 证件号码(前6位)
+            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarOwnersIDNumber", ownerInfo.getIdentifyNumber()));
+        }
+//        else{
+//            //车主 营业执照号
+//            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarOwnersCode", ownerInfo.getOrganizationCode()));
+//        }
 
-            //投保人 证件号码(前6位)
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("ApplicantIDNumber", policyHolderInfo.getIdentifyNumber()));
+        // 投保人
+        if (StringUtils.isBlank(policyHolderInfo.getProperty()) || !"0".equals(policyHolderInfo.getProperty())){
             //投保人 年龄
             ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("ApplicantAge", policyHolderInfo.getAge()));
             //投保人 性别
             ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("ApplicantSex", policyHolderInfo.getGender().equals("男") ? "1" : "2"));
-
-            //被保人 证件号码(前6位)
-            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("InsuredIDNumber", insuredPersonInfo.getIdentifyNumber()));
+            //投保人 证件号码(前6位)
+            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("ApplicantIDNumber", policyHolderInfo.getIdentifyNumber()));
+        }
+//        else{
+//            //投保人 营业执照号
+//            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarPolicyCode", ownerInfo.getOrganizationCode()));
+//        }
+        // 被保人
+        if (StringUtils.isBlank(insuredPersonInfo.getProperty()) || !"0".equals(insuredPersonInfo.getProperty())){
             //被保人 年龄
             ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("InsuredAge", insuredPersonInfo.getAge()));
             //被保人 性别
             ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("InsuredSex", insuredPersonInfo.getGender().equals("男") ? "1" : "2"));
+            //被保人 证件号码(前6位)
+            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("InsuredIDNumber", insuredPersonInfo.getIdentifyNumber()));
+        }
+//        else{
+//            //被保人 营业执照号
+//            ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarInsuredCode", ownerInfo.getOrganizationCode()));
+//        }
+        //车主 姓名
+        ruleAttrMappingVoList.add(new SchemeRuleAttrMappingVo("CarOwnerName", ownerInfo.getName()));
 
-            //2024-06-20 起保日期 月份判断
+        //2024-06-20 起保日期 月份判断
 //        if(quoteInfoVo.get() != null && !insAreaCompany.getJqStartDate().equals("")){
 //            LocalDateTime jqStartDate = LocalDateTime.parse(insAreaCompany.getJqStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
 //            ruleAttrMappingVoList.add(new RuleAttrMappingVo("JqStartMonth", String.valueOf(jqStartDate.getMonthValue())));
@@ -161,7 +144,6 @@ public class SchemeRuleAttrMappingVo {
 //            LocalDateTime syStartDate = LocalDateTime.parse(insAreaCompany.getSyStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
 //            ruleAttrMappingVoList.add(new RuleAttrMappingVo("SyStartMonth", String.valueOf(syStartDate.getMonthValue())));
 //        }
-        }
 
         return ruleAttrMappingVoList;
     }

+ 27 - 0
src/main/java/com/ydtech/utils/IDCardUtils.java

@@ -285,6 +285,33 @@ public class IDCardUtils {
         return strYear + "-" + strMonth + "-" + strDay;
     }
 
+    /**
+     * 在判定已经是正确的身份证号码之后,查找出此人年龄
+     * @param idCard
+     * @return
+     */
+    public static int getAgeFromIDCard(String idCard) {
+        String birthday = idCard.substring(6, 14);
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+        try {
+            Date birthDate = dateFormat.parse(birthday);
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(birthDate);
+            Calendar now = Calendar.getInstance();
+            int age = now.get(Calendar.YEAR) - calendar.get(Calendar.YEAR);
+            if (now.get(Calendar.MONTH) < calendar.get(Calendar.MONTH)
+                    || (now.get(Calendar.MONTH) == calendar.get(Calendar.MONTH)
+                    && now.get(Calendar.DAY_OF_MONTH) < calendar.get(Calendar.DAY_OF_MONTH))) {
+                age--;
+            }
+            return age;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return 0;
+    }
+
+
     /**
      * <p>
      * 设置地区编码

+ 44 - 0
src/main/java/com/ydtech/validation/CodeNotNullValidator.java

@@ -0,0 +1,44 @@
+package com.ydtech.validation;
+
+import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
+import com.ydtech.utils.StringUtils;
+import com.ydtech.validation.annotation.CodeNotNull;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+public class CodeNotNullValidator implements ConstraintValidator<CodeNotNull, Object> {
+
+
+    @Override
+    public void initialize(CodeNotNull constraintAnnotation) {
+        ConstraintValidator.super.initialize(constraintAnnotation);
+    }
+
+    @Override
+    public boolean isValid(Object value, ConstraintValidatorContext context) {
+        // 将传入的value转换为实体类对象
+        if (value instanceof CustomerInfoVo) {
+            CustomerInfoVo entity = (CustomerInfoVo) value;
+            // 现在可以通过entity对象获取所有的字段值
+            if(StringUtils.isBlank(entity.getProperty()) || "1".equals(entity.getProperty())){
+                if(StringUtils.isBlank(entity.getIdentifyNumber())){
+                    // 添加违反约束的上下文信息
+                    context.disableDefaultConstraintViolation(); // 禁用默认的违约信息
+                    context.buildConstraintViolationWithTemplate("车主、投保人、被保人身份证号不能为空")
+                            .addConstraintViolation(); // 使用自定义的message
+                    return false;
+                }
+            }else{
+                if(StringUtils.isBlank(entity.getOrganizationCode())){
+                    // 添加违反约束的上下文信息
+                    context.disableDefaultConstraintViolation(); // 禁用默认的违约信息
+                    context.buildConstraintViolationWithTemplate("(企业)车主、投保人、被保人组织机构代码不能为空")
+                            .addConstraintViolation(); // 使用自定义的message
+                    return false;
+                }
+            }
+        }
+        return true; // 假设总是返回true,实际中需要根据依赖字段和当前字段的值来判断
+    }
+}

+ 30 - 0
src/main/java/com/ydtech/validation/IdentifyNumberValidatorClass.java

@@ -0,0 +1,30 @@
+package com.ydtech.validation;
+
+import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
+import com.ydtech.modules.ins.utils.CommonUtil;
+import com.ydtech.utils.StringUtils;
+import com.ydtech.validation.annotation.CheckIdentifyNumberClass;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+public class IdentifyNumberValidatorClass implements ConstraintValidator<CheckIdentifyNumberClass, Object> {
+
+
+    @Override
+    public void initialize(CheckIdentifyNumberClass constraintAnnotation) {
+        ConstraintValidator.super.initialize(constraintAnnotation);
+    }
+    @Override
+    public boolean isValid(Object value, ConstraintValidatorContext context) {
+        // 将传入的value转换为实体类对象
+        if (value instanceof CustomerInfoVo) {
+            CustomerInfoVo entity = (CustomerInfoVo) value;
+            // 现在可以通过entity对象获取所有的字段值
+            if(StringUtils.isBlank(entity.getProperty()) || "1".equals(entity.getProperty())){
+                return CommonUtil.isIDCard(entity.getIdentifyNumber());
+            }
+        }
+        return true; // 假设总是返回true,实际中需要根据依赖字段和当前字段的值来判断
+    }
+}

+ 22 - 0
src/main/java/com/ydtech/validation/annotation/CheckIdentifyNumberClass.java

@@ -0,0 +1,22 @@
+package com.ydtech.validation.annotation;
+
+import com.ydtech.validation.CodeNotNullValidator;
+import com.ydtech.validation.IdentifyNumberValidator;
+import com.ydtech.validation.IdentifyNumberValidatorClass;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import java.lang.annotation.*;
+
+@Documented
+@Constraint(validatedBy = IdentifyNumberValidatorClass.class)
+@Target({ElementType.FIELD, ElementType.TYPE, ElementType.ANNOTATION_TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface CheckIdentifyNumberClass {
+
+    String message() default "身份证信息不合法";
+
+    Class<?>[] groups() default {};
+
+    Class<? extends Payload>[] payload() default {};
+}

+ 17 - 0
src/main/java/com/ydtech/validation/annotation/CodeNotNull.java

@@ -0,0 +1,17 @@
+package com.ydtech.validation.annotation;
+
+import com.ydtech.validation.CodeNotNullValidator;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import java.lang.annotation.*;
+
+@Documented
+@Constraint(validatedBy = CodeNotNullValidator.class)
+@Target({ElementType.FIELD, ElementType.TYPE, ElementType.ANNOTATION_TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface CodeNotNull {
+    String message() default "";
+    Class<?>[] groups() default {};
+    Class<? extends Payload>[] payload() default {};
+}

+ 0 - 4
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -1984,10 +1984,6 @@
         WHERE
         su4.id IN ( su1.id, su2.id, su3.id )
         ) AS subquery
-        WHERE
-        <if test = "managementSource != null  and  managementSource != ''" >
-         management_source = #{managementSource}
-        </if>
         ORDER BY 1
        ) > 0 )
     </select>

+ 0 - 2
src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml

@@ -306,7 +306,6 @@
         LEFT JOIN esm_ins_company eic on eic.id = pa.partner_companies_id
         <where>
             iac.orderstatus = '3'
-            and io.orderstatus = '3'
 
             <if test="vo.userId !=null  and vo.userId!=''">
                 and su.id=#{vo.userId}
@@ -347,7 +346,6 @@
                        left join sys_user su on io.userid =su.id
               <where>
                   iac.orderstatus = '3'
-                  and io.orderstatus = '3'
 
                   <if test="vo.userId !=null  and vo.userId!=''">
                       and su.id=#{vo.userId}