CarPriceReq.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. package com.ydtech.modules.ins.model.guoRen;
  2. import cn.hutool.core.date.DateUtil;
  3. import com.alibaba.fastjson.annotation.JSONField;
  4. import com.fasterxml.jackson.annotation.JsonIgnore;
  5. import com.fasterxml.jackson.annotation.JsonProperty;
  6. import com.ydtech.constants.enums.InsuranceRisk;
  7. import com.ydtech.modules.ins.model.vo.CarInfoVo;
  8. import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
  9. import com.ydtech.modules.ins.model.vo.KindInfoVo;
  10. import com.ydtech.modules.ins.model.vo.RiskInfoVo;
  11. import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
  12. import com.ydtech.utils.StringUtils;
  13. import lombok.Data;
  14. import lombok.NoArgsConstructor;
  15. import java.util.List;
  16. @NoArgsConstructor
  17. @Data
  18. public class CarPriceReq {
  19. @JsonProperty(value = "bc")
  20. @JSONField(name = "bc")
  21. private BcDTO bc;
  22. @JsonProperty(value = "basePartVo")
  23. @JSONField(name = "basePartVo")
  24. private BasePartVoDTO basePartVo;
  25. @JsonProperty(value = "bi")
  26. @JSONField(name = "bi")
  27. private BiDTO bi;
  28. @JsonProperty(value = "ci")
  29. @JSONField(name = "ci")
  30. private CiDTO ci;
  31. @JsonIgnore
  32. public static CarPriceReq buildCarPriceParam(BaseQuoteInfoVo yaQuoteInfoVo, VinQueryResp.DataDTO vinQ, ChannelInfoDto channelInfo) {
  33. CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
  34. CustomerInfoVo ownerInfo = yaQuoteInfoVo.getOwnerInfo();
  35. List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
  36. List<KindInfoVo> kindInfoVList = yaQuoteInfoVo.getKindList();
  37. //交强
  38. RiskInfoVo ciRiskInfo = (RiskInfoVo) riskList.stream().filter(x -> x.getRiskCode().equals(InsuranceRisk.TRAFFIC.getCode())).findFirst().orElse(null);
  39. //商业
  40. RiskInfoVo biRiskInfo = (RiskInfoVo) riskList.stream().filter(x -> x.getRiskCode().equals(InsuranceRisk.BUSINESS.getCode())).findFirst().orElse(null);
  41. // riskList.stream().forEach(a ->{
  42. // if(a.getRiskCode().equals("0507")){
  43. // ciRiskInfo = a;
  44. // }
  45. // });
  46. CarPriceReq req = new CarPriceReq();
  47. BcDTO bc = new BcDTO();
  48. bc.setLoginComCode(channelInfo.getComCode());
  49. /**
  50. * 主信息====================
  51. */
  52. BcDTO.PrpTmainDTO prpTmain = new BcDTO.PrpTmainDTO();
  53. //机构代码
  54. prpTmain.setComCode(channelInfo.getComCode());
  55. prpTmain.setArgueSolution("1");
  56. prpTmain.setUnitMaintenanceName(channelInfo.getUnitMaintenanceName());
  57. prpTmain.setBusinessNature("2");
  58. //渠道标志(我司提供)
  59. prpTmain.setActivityPlan("TQDL");
  60. //签单时间 signDate 字符串 Y 默认为投保当天
  61. prpTmain.setSignDate(DateUtil.today());
  62. prpTmain.setHandlerCode(channelInfo.getHandlerCode());
  63. prpTmain.setChanneltypeoneName(channelInfo.getChannelTypeOneName());
  64. prpTmain.setUnitMaintenanceCode(channelInfo.getUnitMaintenanceCode());
  65. prpTmain.setUnitmainTenanceType1(channelInfo.getUnitmainTenanceType1());
  66. prpTmain.setUnitmainTenanceType2(channelInfo.getUnitmainTenanceType2());
  67. prpTmain.setChanneltypetwoName(channelInfo.getChannelTypeTwoName());
  68. prpTmain.setHandler1Code(channelInfo.getHandlerCode());
  69. prpTmain.setComName(channelInfo.getComName());
  70. prpTmain.setComCode(channelInfo.getComCode());
  71. prpTmain.setOperateDate(DateUtil.today());
  72. //起保日期 商业险起保日期,如果单交强,传交强起保日期
  73. prpTmain.setStartDate(biRiskInfo == null ? ciRiskInfo.getStartDate() : biRiskInfo.getStartDate());
  74. prpTmain.setEProposalFlag("1");
  75. //购车发票日期
  76. prpTmain.setBusiness(carInfo.getIssueDate());
  77. prpTmain.setAgentName(channelInfo.getAgentName());
  78. prpTmain.setChanneltypetwoName(channelInfo.getChannelTypeTwoName());
  79. prpTmain.setChanneltypeoneName(channelInfo.getChannelTypeOneName());
  80. //代理人
  81. prpTmain.setAgentCode(channelInfo.getAgentCode());
  82. prpTmain.setAgreementNo(channelInfo.getAgreementNo());
  83. prpTmain.setUnitmainTenanceType2Name(channelInfo.getUnitmainTenanceType2Name());
  84. prpTmain.setChanneltypeone(channelInfo.getChannelTypeOne());
  85. prpTmain.setHandler1Name(channelInfo.getHandler1Name());
  86. prpTmain.setChanneltypetwo(channelInfo.getChannelTypeTwo());
  87. /**
  88. * 车辆信息====================
  89. */
  90. BcDTO.PrpTitemCarDTO prpTitemCar = new BcDTO.PrpTitemCarDTO();
  91. prpTitemCar.setFrameNo(carInfo.getFrameNo());
  92. prpTitemCar.setLicenseNo(carInfo.getLicenseNo());
  93. prpTitemCar.setNewEnergyFlag("0");
  94. //类比排量
  95. prpTitemCar.setExhaustScalelb(vinQ.getExHaustScale());
  96. //排量
  97. prpTitemCar.setExhaustScale(vinQ.getExHaustScale());
  98. // prpTitemCar.setTonCount(carInfo.getLimitLoad());
  99. prpTitemCar.setTonCount(vinQ.getTonCount());
  100. //新车标识 newCarFlag 字符串 新车传空,非新车-1
  101. prpTitemCar.setNewCarFlag(StringUtils.isEmpty(carInfo.getLicenseNo()) ? "" : "-1");
  102. prpTitemCar.setLicenseKindCode("02");
  103. prpTitemCar.setPurchasePrice(vinQ.getPurchasePriceSZ());
  104. prpTitemCar.setClauseType("F54");
  105. prpTitemCar.setVinNo(carInfo.getVinNo());
  106. prpTitemCar.setVehicleBrand(vinQ.getBrandNameBC());
  107. // prpTitemCar.setVehicleBrand(carInfo.getCarBrand());
  108. prpTitemCar.setCompleteKerbMass(vinQ.getCompleteKerbMass());
  109. prpTitemCar.setLoanVehicleFlag("0");
  110. prpTitemCar.setChgOwnerFlag(carInfo.isTransferFlag() ? "1" : "0");
  111. prpTitemCar.setProductType("0101");
  112. prpTitemCar.setClauseTypeSystem("04");
  113. prpTitemCar.setEngineNo(carInfo.getEngineNo());
  114. prpTitemCar.setBrandName(vinQ.getBrandNameBC());
  115. prpTitemCar.setCertifiCateDate(carInfo.getIssueDate());
  116. //使用性质 8A 家庭自用
  117. prpTitemCar.setUseNatureCode("8A");
  118. //初登日期
  119. prpTitemCar.setEnrollDate(carInfo.getIssueDate());
  120. //核定载客数
  121. prpTitemCar.setSeatCount(carInfo.getSeatCount());
  122. prpTitemCar.setFuelType("0");
  123. prpTitemCar.setTermsSystem("04");
  124. prpTitemCar.setTonCountlb(vinQ.getTonCount());
  125. // prpTitemCar.setTonCountlb("0");
  126. prpTitemCar.setVinClick("0");
  127. prpTitemCar.setMaincarKindCode("A");
  128. //过户日期
  129. prpTitemCar.setChgOwnerDate(carInfo.getTransferDate());
  130. /**
  131. * vin car
  132. */
  133. prpTitemCar.setBrandCode(vinQ.getBrandCode());
  134. prpTitemCar.setModelCode(vinQ.getModelCodeBC());
  135. prpTitemCar.setModelName(vinQ.getBrandNameBC());
  136. prpTitemCar.setNewFuelModel(vinQ.getNewFuelModel());
  137. /**
  138. * 车主信息
  139. */
  140. prpTitemCar.setCarOwner(ownerInfo.getName());
  141. prpTitemCar.setCarOwnerIdentifyNumber(ownerInfo.getIdentifyNumber());
  142. prpTitemCar.setCarOwnerIdentifyType("01");
  143. //车主客户性质 carOwnerNature 字符串 Y 1:机关 2:企业 0:个人
  144. prpTitemCar.setCarOwnerNature("0");
  145. prpTitemCar.setIDValidStartDate(ownerInfo.getIdentifyValidDate());
  146. prpTitemCar.setIdValidDate(ownerInfo.getIdentifyValidEndDate());
  147. /**
  148. * 整合
  149. */
  150. bc.setPrpTmain(prpTmain);
  151. bc.setPrpTitemCar(prpTitemCar);
  152. //登录机构
  153. bc.setLoginComCode(channelInfo.getComCode());
  154. //保费计算折扣 0是第一次计算保费,1是价费联动,2是批折扣,默认0
  155. bc.setFeeandDiscountFlag("0");
  156. //险种信息 0500-车险 摩托车、拖拉机的商业险-0521
  157. bc.setRiskCode("0500");
  158. //是否涉及农险业务 默认0
  159. bc.setAgriFlagBC("0");
  160. BasePartVoDTO basePartVo = new BasePartVoDTO();
  161. basePartVo.setEditType("EditType_ProposalInput");
  162. basePartVo.setInputType("34");
  163. basePartVo.setLoginComCode(channelInfo.getComCode());
  164. basePartVo.setLoginComCodeSub(channelInfo.getComCode().substring(0, 2));
  165. // basePartVo.setLoginRiskCode("0500");
  166. basePartVo.setUserCode(channelInfo.getAgentCode());
  167. req.setBi(new BiDTO());
  168. req.setCi(new CiDTO());
  169. req.setBc(bc);
  170. req.setBasePartVo(basePartVo);
  171. return req;
  172. }
  173. @NoArgsConstructor
  174. @Data
  175. public static class BcDTO {
  176. @JsonProperty(value = "prpTitemCar")
  177. @JSONField(name = "prpTitemCar")
  178. private PrpTitemCarDTO prpTitemCar;
  179. @JsonProperty(value = "loginComCode")
  180. @JSONField(name = "loginComCode")
  181. private String loginComCode;
  182. @JsonProperty(value = "prpTmain")
  183. @JSONField(name = "prpTmain")
  184. private PrpTmainDTO prpTmain;
  185. @JsonProperty(value = "feeandDiscountFlag")
  186. @JSONField(name = "feeandDiscountFlag")
  187. private String feeandDiscountFlag;
  188. @JsonProperty(value = "riskCode")
  189. @JSONField(name = "riskCode")
  190. private String riskCode;
  191. @JsonProperty(value = "agriFlagBC")
  192. @JSONField(name = "agriFlagBC")
  193. private String agriFlagBC;
  194. @NoArgsConstructor
  195. @Data
  196. public static class PrpTitemCarDTO {
  197. @JsonProperty(value = "frameNo")
  198. @JSONField(name = "frameNo")
  199. private String frameNo;
  200. @JsonProperty(value = "licenseNo")
  201. @JSONField(name = "licenseNo")
  202. private String licenseNo;
  203. @JsonProperty(value = "newEnergyFlag")
  204. @JSONField(name = "newEnergyFlag")
  205. private String newEnergyFlag;
  206. @JsonProperty(value = "exhaustScalelb")
  207. @JSONField(name = "exhaustScalelb")
  208. private String exhaustScalelb;
  209. @JsonProperty(value = "tonCount")
  210. @JSONField(name = "tonCount")
  211. private String tonCount;
  212. @JsonProperty(value = "newCarFlag")
  213. @JSONField(name = "newCarFlag")
  214. private String newCarFlag;
  215. @JsonProperty(value = "licenseKindCode")
  216. @JSONField(name = "licenseKindCode")
  217. private String licenseKindCode;
  218. @JsonProperty(value = "purchasePrice")
  219. @JSONField(name = "purchasePrice")
  220. private String purchasePrice;
  221. @JsonProperty(value = "clauseType")
  222. @JSONField(name = "clauseType")
  223. private String clauseType;
  224. @JsonProperty(value = "vinNo")
  225. @JSONField(name = "vinNo")
  226. private String vinNo;
  227. @JsonProperty(value = "vehicleBrand")
  228. @JSONField(name = "vehicleBrand")
  229. private String vehicleBrand;
  230. @JsonProperty(value = "carOwner")
  231. @JSONField(name = "carOwner")
  232. private String carOwner;
  233. @JsonProperty(value = "modelCode")
  234. @JSONField(name = "modelCode")
  235. private String modelCode;
  236. @JsonProperty(value = "exhaustScale")
  237. @JSONField(name = "exhaustScale")
  238. private String exhaustScale;
  239. @JsonProperty(value = "completeKerbMass")
  240. @JSONField(name = "completeKerbMass")
  241. private String completeKerbMass;
  242. @JsonProperty(value = "loanVehicleFlag")
  243. @JSONField(name = "loanVehicleFlag")
  244. private String loanVehicleFlag;
  245. @JsonProperty(value = "chgOwnerFlag")
  246. @JSONField(name = "chgOwnerFlag")
  247. private String chgOwnerFlag;
  248. @JsonProperty(value = "carOwnerIdentifyNumber")
  249. @JSONField(name = "carOwnerIdentifyNumber")
  250. private String carOwnerIdentifyNumber;
  251. @JsonProperty(value = "productType")
  252. @JSONField(name = "productType")
  253. private String productType;
  254. @JsonProperty(value = "brandCode")
  255. @JSONField(name = "brandCode")
  256. private String brandCode;
  257. @JsonProperty(value = "chgOwnerDate")
  258. @JSONField(name = "chgOwnerDate")
  259. private String chgOwnerDate;
  260. @JsonProperty(value = "clauseTypeSystem")
  261. @JSONField(name = "clauseTypeSystem")
  262. private String clauseTypeSystem;
  263. @JsonProperty(value = "engineNo")
  264. @JSONField(name = "engineNo")
  265. private String engineNo;
  266. @JsonProperty(value = "brandName")
  267. @JSONField(name = "brandName")
  268. private String brandName;
  269. @JsonProperty(value = "certifiCateDate")
  270. @JSONField(name = "certifiCateDate")
  271. private String certifiCateDate;
  272. @JsonProperty(value = "useNatureCode")
  273. @JSONField(name = "useNatureCode")
  274. private String useNatureCode;
  275. @JsonProperty(value = "enrollDate")
  276. @JSONField(name = "enrollDate")
  277. private String enrollDate;
  278. @JsonProperty(value = "seatCount")
  279. @JSONField(name = "seatCount")
  280. private String seatCount;
  281. @JsonProperty(value = "carOwnerIdentifyType")
  282. @JSONField(name = "carOwnerIdentifyType")
  283. private String carOwnerIdentifyType;
  284. @JsonProperty(value = "carOwnerNature")
  285. @JSONField(name = "carOwnerNature")
  286. private String carOwnerNature;
  287. @JsonProperty(value = "modelName")
  288. @JSONField(name = "modelName")
  289. private String modelName;
  290. @JsonProperty(value = "fuelType")
  291. @JSONField(name = "fuelType")
  292. private String fuelType;
  293. @JsonProperty(value = "termsSystem")
  294. @JSONField(name = "termsSystem")
  295. private String termsSystem;
  296. @JsonProperty(value = "tonCountlb")
  297. @JSONField(name = "tonCountlb")
  298. private String tonCountlb;
  299. @JsonProperty(value = "newFuelModel")
  300. @JSONField(name = "newFuelModel")
  301. private String newFuelModel;
  302. @JsonProperty(value = "vinClick")
  303. @JSONField(name = "vinClick")
  304. private String vinClick;
  305. @JsonProperty(value = "maincarKindCode")
  306. @JSONField(name = "maincarKindCode")
  307. private String maincarKindCode;
  308. //车主证件有效期起期
  309. // @JsonProperty(value = "IDValidStartDate")
  310. @JSONField(name = "IDValidStartDate")
  311. @JsonProperty(value = "IDValidStartDate")
  312. private String IDValidStartDate;
  313. //车主证件有效期止期
  314. @JsonProperty(value = "idValidDate")
  315. @JSONField(name = "idValidDate")
  316. private String idValidDate;
  317. }
  318. @NoArgsConstructor
  319. @Data
  320. public static class PrpTmainDTO {
  321. //代理人代码
  322. @JsonProperty(value = "agentCode")
  323. @JSONField(name = "agentCode")
  324. private String agentCode;
  325. //代理协议
  326. @JsonProperty(value = "agreementNo")
  327. @JSONField(name = "agreementNo")
  328. private String agreementNo;
  329. @JsonProperty(value = "unitmainTenanceType2Name")
  330. @JSONField(name = "unitmainTenanceType2Name")
  331. private String unitmainTenanceType2Name;
  332. @JsonProperty(value = "channeltypeone")
  333. @JSONField(name = "channeltypeone")
  334. private String channeltypeone;
  335. @JsonProperty(value = "argueSolution")
  336. @JSONField(name = "argueSolution")
  337. private String argueSolution;
  338. @JsonProperty(value = "handler1Name")
  339. @JSONField(name = "handler1Name")
  340. private String handler1Name;
  341. @JsonProperty(value = "channeltypetwo")
  342. @JSONField(name = "channeltypetwo")
  343. private String channeltypetwo;
  344. @JsonProperty(value = "agentName")
  345. @JSONField(name = "agentName")
  346. private String agentName;
  347. @JsonProperty(value = "unitMaintenanceName")
  348. @JSONField(name = "unitMaintenanceName")
  349. private String unitMaintenanceName;
  350. @JsonProperty(value = "businessNature")
  351. @JSONField(name = "businessNature")
  352. private String businessNature;
  353. @JsonProperty(value = "activityPlan")
  354. @JSONField(name = "activityPlan")
  355. private String activityPlan;
  356. @JsonProperty(value = "signDate")
  357. @JSONField(name = "signDate")
  358. private String signDate;
  359. @JsonProperty(value = "handlerCode")
  360. @JSONField(name = "handlerCode")
  361. private String handlerCode;
  362. @JsonProperty(value = "channeltypeoneName")
  363. @JSONField(name = "channeltypeoneName")
  364. private String channeltypeoneName;
  365. @JsonProperty(value = "unitMaintenanceCode")
  366. @JSONField(name = "unitMaintenanceCode")
  367. private String unitMaintenanceCode;
  368. @JsonProperty(value = "unitmainTenanceType1")
  369. @JSONField(name = "unitmainTenanceType1")
  370. private String unitmainTenanceType1;
  371. @JsonProperty(value = "unitmainTenanceType2")
  372. @JSONField(name = "unitmainTenanceType2")
  373. private String unitmainTenanceType2;
  374. @JsonProperty(value = "channeltypetwoName")
  375. @JSONField(name = "channeltypetwoName")
  376. private String channeltypetwoName;
  377. @JsonProperty(value = "handler1Code")
  378. @JSONField(name = "handler1Code")
  379. private String handler1Code;
  380. @JsonProperty(value = "comName")
  381. @JSONField(name = "comName")
  382. private String comName;
  383. @JsonProperty(value = "comCode")
  384. @JSONField(name = "comCode")
  385. private String comCode;
  386. @JsonProperty(value = "operateDate")
  387. @JSONField(name = "operateDate")
  388. private String operateDate;
  389. @JsonProperty(value = "startDate")
  390. @JSONField(name = "startDate")
  391. private String startDate;
  392. @JsonProperty(value = "eProposalFlag")
  393. @JSONField(name = "eProposalFlag")
  394. private String eProposalFlag;
  395. @JsonProperty(value = "business")
  396. @JSONField(name = "business")
  397. private String business;
  398. }
  399. }
  400. @NoArgsConstructor
  401. @Data
  402. public static class BasePartVoDTO {
  403. /**
  404. * 编辑类型
  405. * 投保单录入 EditType_ProposalInput
  406. * 投保单修改
  407. * EditType_ProposalModify
  408. */
  409. @JsonProperty(value = "editType")
  410. @JSONField(name = "editType")
  411. private String editType;
  412. /**
  413. * 输入类型
  414. * 34-同保
  415. */
  416. @JsonProperty(value = "inputType")
  417. @JSONField(name = "inputType")
  418. private String inputType;
  419. /**
  420. * 登录机构
  421. */
  422. @JsonProperty(value = "loginComCode")
  423. @JSONField(name = "loginComCode")
  424. private String loginComCode;
  425. /**
  426. * 登录机构地区编码
  427. * 取登录机构前两位
  428. */
  429. @JsonProperty(value = "loginComCodeSub")
  430. @JSONField(name = "loginComCodeSub")
  431. private String loginComCodeSub;
  432. /**
  433. * 险种代码
  434. * 0500同保
  435. */
  436. @JsonProperty(value = "loginRiskCode")
  437. @JSONField(name = "loginRiskCode")
  438. private String loginRiskCode;
  439. /**
  440. * 业务员代码
  441. */
  442. @JsonProperty(value = "userCode")
  443. @JSONField(name = "userCode")
  444. private String userCode;
  445. }
  446. @NoArgsConstructor
  447. @Data
  448. public static class BiDTO {
  449. }
  450. @NoArgsConstructor
  451. @Data
  452. public static class CiDTO {
  453. }
  454. // private static BcDTO.PrpTmainDTO buildPrpTmain(){
  455. // BcDTO.PrpTmainDTO tmain = new BcDTO.PrpTmainDTO();
  456. // tmain.setUnitmainTenanceType2Name();
  457. // "unitmainTenanceType2Name":"直通网销",
  458. // "channeltypeone":"60",
  459. // "argueSolution":"1",
  460. // "handler1Name":"徐丽",
  461. // "channeltypetwo":"0201",
  462. // "agentName":"徐丽",
  463. // "unitMaintenanceName":"南京测试标准件",
  464. // "businessNature":"0",
  465. // "activityPlan":"IXX",
  466. // "signDate":"2022-06-17",
  467. // "handlerCode":"S0300042",
  468. // "channeltypeoneName":"行销",
  469. // "unitMaintenanceCode":"0315G022105203121",
  470. // "unitmainTenanceType1":"G",
  471. // "unitmainTenanceType2":"06",
  472. // "channeltypetwoName":"行销传统",
  473. // "handler1Code":"S0300042",
  474. // "comName":"江苏南京溧水支公司个客综合",
  475. // "comCode":"031514A3",
  476. // "operateDate":"2022-06-17",
  477. // "startDate":"2022-06-18",
  478. // "eProposalFlag":"1",
  479. // "business":"2020-06-18"
  480. // }
  481. }