|
@@ -8,10 +8,10 @@ import com.ydtech.constants.enums.dict.insurance.EnergyType;
|
|
|
import com.ydtech.exception.SystemException;
|
|
import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.admin.model.dto.SysUserLinkPtlAgreementDto;
|
|
import com.ydtech.modules.admin.model.dto.SysUserLinkPtlAgreementDto;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
|
|
+import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.KindInfoVo;
|
|
import com.ydtech.modules.ins.model.vo.KindInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.RiskInfoVo;
|
|
import com.ydtech.modules.ins.model.vo.RiskInfoVo;
|
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
|
-import com.ydtech.modules.order.entity.InsOrders;
|
|
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
|
import com.ydtech.modules.protocol.constants.DispatchTypeConstants;
|
|
import com.ydtech.modules.protocol.constants.DispatchTypeConstants;
|
|
@@ -294,11 +294,18 @@ public class PtlTaxSourceServiceImpl extends ServiceImpl<PtlTaxSourceNewMapper,
|
|
|
PtlTaxSourceNew ptlTaxSourceNew = ptlTaxSourceNewMapper.selectById(ptlTaxSourceNewAddVo.getId());
|
|
PtlTaxSourceNew ptlTaxSourceNew = ptlTaxSourceNewMapper.selectById(ptlTaxSourceNewAddVo.getId());
|
|
|
ptlTaxSourceNew =ptlTaxSourceNew.getNewEntity(ptlTaxSourceNewAddVo,ptlTaxSourceNew);
|
|
ptlTaxSourceNew =ptlTaxSourceNew.getNewEntity(ptlTaxSourceNewAddVo,ptlTaxSourceNew);
|
|
|
if(ptlTaxSourceNewDefault!=null){
|
|
if(ptlTaxSourceNewDefault!=null){
|
|
|
- //当前数据为默认的话,将之前的数据设置为非默认
|
|
|
|
|
- if("1".equals(ptlTaxSourceNew.getDefaultFlag()) ){
|
|
|
|
|
- //将旧数据设置数据为非默认
|
|
|
|
|
- ptlTaxSourceNewDefault.setDefaultFlag("0");
|
|
|
|
|
- ptlTaxSourceNewMapper.updateById(ptlTaxSourceNewDefault);
|
|
|
|
|
|
|
+ List<PtlTaxSourceNew> list = this.list(new LambdaQueryWrapper<PtlTaxSourceNew>().eq(PtlTaxSourceNew::getInsCompanyId,ptlTaxSourceNewAddVo.getInsCompanyId()));
|
|
|
|
|
+ if("0".equals(ptlTaxSourceNewAddVo.getDefaultFlag()) && ptlTaxSourceNewDefault.getId().compareTo(Long.valueOf(ptlTaxSourceNewAddVo.getId())) ==0 ){
|
|
|
|
|
+ if(list ==null || list.size()==0 || list.size()==1){
|
|
|
|
|
+ throw new SystemException("只存在一条数据,不允许修改为非默认");
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //当前数据为默认的话,将之前的数据设置为非默认
|
|
|
|
|
+ if("1".equals(ptlTaxSourceNew.getDefaultFlag()) ){
|
|
|
|
|
+ //将旧数据设置数据为非默认
|
|
|
|
|
+ ptlTaxSourceNewDefault.setDefaultFlag("0");
|
|
|
|
|
+ ptlTaxSourceNewMapper.updateById(ptlTaxSourceNewDefault);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ptlTaxSourceNew.setDispatchContent(content);
|
|
ptlTaxSourceNew.setDispatchContent(content);
|
|
@@ -591,8 +598,16 @@ public class PtlTaxSourceServiceImpl extends ServiceImpl<PtlTaxSourceNewMapper,
|
|
|
String thirdPartyLiabilityInsurance =InsuranceRisk.getStringByB(kinds);
|
|
String thirdPartyLiabilityInsurance =InsuranceRisk.getStringByB(kinds);
|
|
|
//9.能源类型
|
|
//9.能源类型
|
|
|
String energyType = EnergyType.isNewEnergy(quoteInfo.getCarInfo().getEnergyType()) ? "1" : "0";
|
|
String energyType = EnergyType.isNewEnergy(quoteInfo.getCarInfo().getEnergyType()) ? "1" : "0";
|
|
|
|
|
+ //10.新车购置价
|
|
|
|
|
+ String price = quoteInfo.getCarInfo().getPurchasePrice();
|
|
|
|
|
+ //11. 投被信息
|
|
|
|
|
+ // 投保人信息
|
|
|
|
|
+ CustomerInfoVo policyHolderInfo = quoteInfo.getPolicyHolderInfo();
|
|
|
|
|
+ // 被保人信息
|
|
|
|
|
+ CustomerInfoVo insuredPersonInfo = quoteInfo.getInsuredPersonInfo();
|
|
|
//报价信息
|
|
//报价信息
|
|
|
- msg = getString(msg, licenseNo,seats,exhaustScale,cimodelclassVal,vehicleUseVal,yqInsureFlag,cxInsureFlag,thirdPartyLiabilityInsurance);
|
|
|
|
|
|
|
+ msg = getString(msg, licenseNo,seats,exhaustScale,cimodelclassVal,vehicleUseVal,yqInsureFlag,cxInsureFlag,thirdPartyLiabilityInsurance,energyType,price,policyHolderInfo,insuredPersonInfo);
|
|
|
|
|
+
|
|
|
//通过调度id查询调度规则是否包含车牌、排量
|
|
//通过调度id查询调度规则是否包含车牌、排量
|
|
|
boolean isExcludeLicense = false;
|
|
boolean isExcludeLicense = false;
|
|
|
boolean isExcludeSeats = false;
|
|
boolean isExcludeSeats = false;
|
|
@@ -603,6 +618,13 @@ public class PtlTaxSourceServiceImpl extends ServiceImpl<PtlTaxSourceNewMapper,
|
|
|
boolean isExcludeCxInsureFlag= false;
|
|
boolean isExcludeCxInsureFlag= false;
|
|
|
boolean isExcludeThirdPartyLiabilityInsurance= false;
|
|
boolean isExcludeThirdPartyLiabilityInsurance= false;
|
|
|
boolean isEnergyType = false;
|
|
boolean isEnergyType = false;
|
|
|
|
|
+ //三者险是否投保
|
|
|
|
|
+ boolean isExcludeThirdPartyLiabilityInsuranceFlag= false;
|
|
|
|
|
+ //行车购置价
|
|
|
|
|
+ boolean priceFlag= false;
|
|
|
|
|
+ //投被是否一致
|
|
|
|
|
+ boolean custemerFlag= false;
|
|
|
|
|
+
|
|
|
//通过默认公司id查询所有的协议按优先级排序
|
|
//通过默认公司id查询所有的协议按优先级排序
|
|
|
Long ptlTaxSourceNewId = ptlTaxSourceNew.getId();
|
|
Long ptlTaxSourceNewId = ptlTaxSourceNew.getId();
|
|
|
List<PtlAgreementDispatchRulesAttrLink> list = ptlAgreementDispatchRulesAttrLinkService.list(new LambdaQueryWrapper<PtlAgreementDispatchRulesAttrLink>()
|
|
List<PtlAgreementDispatchRulesAttrLink> list = ptlAgreementDispatchRulesAttrLinkService.list(new LambdaQueryWrapper<PtlAgreementDispatchRulesAttrLink>()
|
|
@@ -645,13 +667,30 @@ public class PtlTaxSourceServiceImpl extends ServiceImpl<PtlTaxSourceNewMapper,
|
|
|
if(!isExcludeThirdPartyLiabilityInsurance){
|
|
if(!isExcludeThirdPartyLiabilityInsurance){
|
|
|
quoteInfoErorMsg+= DispatchTypeConstants.matchKey(DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_8.getCode())+"的值为"+(thirdPartyLiabilityInsurance==null?"不投保":thirdPartyLiabilityInsurance)+"未匹配"+"\n";
|
|
quoteInfoErorMsg+= DispatchTypeConstants.matchKey(DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_8.getCode())+"的值为"+(thirdPartyLiabilityInsurance==null?"不投保":thirdPartyLiabilityInsurance)+"未匹配"+"\n";
|
|
|
}
|
|
}
|
|
|
|
|
+ isExcludeThirdPartyLiabilityInsuranceFlag = judgeIsExcludeFlag(thirdPartyLiabilityInsurance, list, dispatchRulesAttrList,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_12.getCode());
|
|
|
|
|
+ if(!isExcludeThirdPartyLiabilityInsuranceFlag){
|
|
|
|
|
+ quoteInfoErorMsg+= DispatchTypeConstants.matchKey(DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_12.getCode())+"的值为"+(thirdPartyLiabilityInsurance==null?"不投保":thirdPartyLiabilityInsurance)+"未匹配"+"\n";
|
|
|
|
|
+ }
|
|
|
|
|
+ //验证新车购置价
|
|
|
|
|
+ priceFlag = judgeIsExcludeFlag(price, list, dispatchRulesAttrList,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_10.getCode());
|
|
|
|
|
+ if(!priceFlag){
|
|
|
|
|
+ quoteInfoErorMsg+= DispatchTypeConstants.matchKey(DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_10.getCode())+"的值为"+(price==null?"":price)+"未匹配"+"\n";
|
|
|
|
|
+ }
|
|
|
|
|
+ String custimers = getCustomersFlag(policyHolderInfo, insuredPersonInfo)?"0":"1";
|
|
|
|
|
+ String custimersMsg = getCustomersAllMsg(policyHolderInfo, insuredPersonInfo);
|
|
|
|
|
+ //验证投被是否一致
|
|
|
|
|
+ custemerFlag = judgeIsExcludeFlag(custimers, list, dispatchRulesAttrList,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_11.getCode());
|
|
|
|
|
+ if(!custemerFlag){
|
|
|
|
|
+ quoteInfoErorMsg+= DispatchTypeConstants.matchKey(DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_11.getCode())+"的值为"+(custimersMsg==null?"":custimersMsg)+"未匹配"+"\n";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
logger.info("==============================="+ptlTaxSourceNew.getAgreementId()+"协议调度规则对象为:"+ptlTaxSourceNew.toString()+"=====================================");
|
|
logger.info("==============================="+ptlTaxSourceNew.getAgreementId()+"协议调度规则对象为:"+ptlTaxSourceNew.toString()+"=====================================");
|
|
|
logger.info("==============================="+ptlTaxSourceNew.getAgreementId()+"协议调度规则内容为:"+ptlTaxSourceNew.getDispatchContent()+"===============================");
|
|
logger.info("==============================="+ptlTaxSourceNew.getAgreementId()+"协议调度规则内容为:"+ptlTaxSourceNew.getDispatchContent()+"===============================");
|
|
|
logger.info("==============================="+ptlTaxSourceNew.getAgreementId()+"报价参数信息为:"+msg+"===============================");
|
|
logger.info("==============================="+ptlTaxSourceNew.getAgreementId()+"报价参数信息为:"+msg+"===============================");
|
|
|
logger.info("==============================="+ptlTaxSourceNew.getAgreementId()+"未匹配信息为:"+quoteInfoErorMsg+"===============================");
|
|
logger.info("==============================="+ptlTaxSourceNew.getAgreementId()+"未匹配信息为:"+quoteInfoErorMsg+"===============================");
|
|
|
//if (isExclude && isExcludeLicense && isExcludeSeats && isExcludeVolume && isExcludeCimodelclass && isExcludeVehicleUse && isExcludeYqInsureFlag && isExcludeCxInsureFlag && isExcludeThirdPartyLiabilityInsurance ) {
|
|
//if (isExclude && isExcludeLicense && isExcludeSeats && isExcludeVolume && isExcludeCimodelclass && isExcludeVehicleUse && isExcludeYqInsureFlag && isExcludeCxInsureFlag && isExcludeThirdPartyLiabilityInsurance ) {
|
|
|
- if (isExcludeLicense && isExcludeSeats && isExcludeVolume && isExcludeCimodelclass && isExcludeVehicleUse && isExcludeYqInsureFlag && isExcludeCxInsureFlag && isExcludeThirdPartyLiabilityInsurance && isEnergyType) {
|
|
|
|
|
|
|
+ if (isExcludeLicense && isExcludeSeats && isExcludeVolume && isExcludeCimodelclass && isExcludeVehicleUse && isExcludeYqInsureFlag && isExcludeCxInsureFlag && isExcludeThirdPartyLiabilityInsurance && isEnergyType
|
|
|
|
|
+ && isExcludeThirdPartyLiabilityInsuranceFlag && priceFlag && custemerFlag) {
|
|
|
agreementId = ptlTaxSourceNew.getAgreementId();
|
|
agreementId = ptlTaxSourceNew.getAgreementId();
|
|
|
}
|
|
}
|
|
|
PtlTaxSourceNewRecord ptlTaxSourceNewRecord=new PtlTaxSourceNewRecord(orderno, ptlTaxSourceNew.toString(), ptlTaxSourceNew.getDispatchContent(), msg, quoteInfoErorMsg,new Date(), userId);
|
|
PtlTaxSourceNewRecord ptlTaxSourceNewRecord=new PtlTaxSourceNewRecord(orderno, ptlTaxSourceNew.toString(), ptlTaxSourceNew.getDispatchContent(), msg, quoteInfoErorMsg,new Date(), userId);
|
|
@@ -686,7 +725,7 @@ public class PtlTaxSourceServiceImpl extends ServiceImpl<PtlTaxSourceNewMapper,
|
|
|
* @Date: 2024/5/28 9:12
|
|
* @Date: 2024/5/28 9:12
|
|
|
* @Description: 前台信息拼接
|
|
* @Description: 前台信息拼接
|
|
|
*/
|
|
*/
|
|
|
- private static String getString(String allMag, String val1,String val2,String val3,String val4,String val5,String val6,String val7,String val8) {
|
|
|
|
|
|
|
+ private static String getString(String allMag, String val1,String val2,String val3,String val4,String val5,String val6,String val7,String val8,String energyType,String price,CustomerInfoVo tbrMsg,CustomerInfoVo bbrMsg) {
|
|
|
String msg="";
|
|
String msg="";
|
|
|
allMag += getAllString(msg, val1,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_1.getCode());
|
|
allMag += getAllString(msg, val1,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_1.getCode());
|
|
|
allMag +=getAllString(msg, val2,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_2.getCode());
|
|
allMag +=getAllString(msg, val2,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_2.getCode());
|
|
@@ -696,6 +735,12 @@ public class PtlTaxSourceServiceImpl extends ServiceImpl<PtlTaxSourceNewMapper,
|
|
|
allMag +=getAllString(msg, "1".equals(val6)?"是":"否",DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_6.getCode());
|
|
allMag +=getAllString(msg, "1".equals(val6)?"是":"否",DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_6.getCode());
|
|
|
allMag +=getAllString(msg, "1".equals(val7)?"是":"否",DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_7.getCode());
|
|
allMag +=getAllString(msg, "1".equals(val7)?"是":"否",DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_7.getCode());
|
|
|
allMag +=getAllString(msg, val8,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_8.getCode());
|
|
allMag +=getAllString(msg, val8,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_8.getCode());
|
|
|
|
|
+ //能源类型
|
|
|
|
|
+ allMag +=getAllString(msg, energyType,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_9.getCode());
|
|
|
|
|
+ //新车购置价
|
|
|
|
|
+ allMag +=getAllString(msg, price,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_10.getCode());
|
|
|
|
|
+ //投被信息
|
|
|
|
|
+ allMag +=getAllTBmsgString(msg, tbrMsg,bbrMsg,DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_10.getCode());
|
|
|
return allMag;
|
|
return allMag;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -715,6 +760,60 @@ public class PtlTaxSourceServiceImpl extends ServiceImpl<PtlTaxSourceNewMapper,
|
|
|
return msg;
|
|
return msg;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/10/30 17:00
|
|
|
|
|
+ * @Description: 获取投保人和被保人信息
|
|
|
|
|
+ */
|
|
|
|
|
+ private static String getAllTBmsgString(String msg, CustomerInfoVo tbr,CustomerInfoVo bbr,String code) {
|
|
|
|
|
+ msg +=DispatchTypeConstants.matchKey(code)+"的值为" +getCustomersAllMsg(tbr,bbr)+"\n";
|
|
|
|
|
+ return msg;
|
|
|
|
|
+ }
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/10/30 17:38
|
|
|
|
|
+ * @Description: 获取投被信息
|
|
|
|
|
+ */
|
|
|
|
|
+ private static String getCustomersAllMsg(CustomerInfoVo tbr,CustomerInfoVo bbr) {
|
|
|
|
|
+ String tbrMsg ="";
|
|
|
|
|
+ String bbrMsg ="";
|
|
|
|
|
+ if(tbr!=null){
|
|
|
|
|
+ String name = tbr.getName()==null?"": tbr.getName();
|
|
|
|
|
+ String idCard= tbr.getIdentifyNumber()==null?"": tbr.getIdentifyNumber();
|
|
|
|
|
+ tbrMsg+="投保人姓名为:"+name+";";
|
|
|
|
|
+ tbrMsg+="投保人身份证为:"+idCard+";";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(bbr!=null){
|
|
|
|
|
+ String name = bbr.getName()==null?"": bbr.getName();
|
|
|
|
|
+ String idCard= bbr.getIdentifyNumber()==null?"": bbr.getIdentifyNumber();
|
|
|
|
|
+ bbrMsg+="被保人姓名为:"+name+";";
|
|
|
|
|
+ bbrMsg+="被保人身份证为:"+idCard+";";
|
|
|
|
|
+ }
|
|
|
|
|
+ return tbrMsg+bbrMsg;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/10/30 17:00
|
|
|
|
|
+ * @Description: 判断投被是否一致
|
|
|
|
|
+ */
|
|
|
|
|
+ private static boolean getCustomersFlag(CustomerInfoVo tbr,CustomerInfoVo bbr) {
|
|
|
|
|
+ if(tbr!=null && bbr!=null){
|
|
|
|
|
+ String tbr_name = tbr.getName()==null?"": tbr.getName();
|
|
|
|
|
+ String tbr_idCard= tbr.getIdentifyNumber()==null?"": tbr.getIdentifyNumber();
|
|
|
|
|
+ String bbr_name = bbr.getName()==null?"": tbr.getName();
|
|
|
|
|
+ String bbr_idCard= bbr.getIdentifyNumber()==null?"": tbr.getIdentifyNumber();
|
|
|
|
|
+ if(tbr_name.equals(bbr_name) && tbr_idCard.equals(bbr_idCard) ){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @version
|
|
* @version
|
|
|
* @author: hxl
|
|
* @author: hxl
|
|
@@ -723,9 +822,16 @@ public class PtlTaxSourceServiceImpl extends ServiceImpl<PtlTaxSourceNewMapper,
|
|
|
*/
|
|
*/
|
|
|
private static boolean judgeIsExcludeFlag(String val, List<PtlAgreementDispatchRulesAttrLink> list, List<PtlAgreementDispatchRulesAttr> dispatchRulesAttrList,String code) {
|
|
private static boolean judgeIsExcludeFlag(String val, List<PtlAgreementDispatchRulesAttrLink> list, List<PtlAgreementDispatchRulesAttr> dispatchRulesAttrList,String code) {
|
|
|
boolean isExcludeFlag;
|
|
boolean isExcludeFlag;
|
|
|
- if(StringUtils.isBlank(val)){
|
|
|
|
|
- if(!DispatchTypeConstants.removalOfCode().contains(code)){
|
|
|
|
|
- throw new SystemException(DispatchTypeConstants.matchKey(code)+"不能为空");
|
|
|
|
|
|
|
+ //if(StringUtils.isBlank(val)){
|
|
|
|
|
+ // if(!DispatchTypeConstants.removalOfCode().contains(code)){
|
|
|
|
|
+ // throw new SystemException(DispatchTypeConstants.matchKey(code)+"不能为空");
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ if(DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_12.getCode().equals(code)){
|
|
|
|
|
+ if(StringUtils.isNotBlank(val)){
|
|
|
|
|
+ val = "不投保".equals(val)?"0":"1";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ val = "0";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
isExcludeFlag = RulesMergeStrUtils.judgeVal(list, (DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_1.getCode().equals(code))?val.substring(0, 2):val, code, dispatchRulesAttrList);
|
|
isExcludeFlag = RulesMergeStrUtils.judgeVal(list, (DispatchTypeConstants.DISPATCH_TYPE_CONSTANTS_1.getCode().equals(code))?val.substring(0, 2):val, code, dispatchRulesAttrList);
|