|
|
@@ -480,11 +480,20 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
if(quoteVo.getSignDate() == null){
|
|
|
throw new SystemException("请选择签单日期");
|
|
|
}
|
|
|
+ //添加协议判断逻辑 add by 2024-07-10
|
|
|
+ if(quoteVo.getAgreementId() == null){
|
|
|
+ throw new SystemException("请选择协议");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public boolean saveSubOrder(BaseQuoteInfoVo quoteInfo, BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
|
|
|
+ //添加暂存标志 add by hxl 2024-07-10 0 暂存 1 保存
|
|
|
+ if(quoteVo.getStageFlag() == null){
|
|
|
+ throw new SystemException("暂存标志为空");
|
|
|
+ }
|
|
|
|
|
|
validQuoteVo(quoteVo);
|
|
|
|
|
|
@@ -499,6 +508,14 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
}
|
|
|
|
|
|
InsOrders insOrders = insOrdersService.getById(quoteInfo.getOrderNo());
|
|
|
+ //添加暂存处理 add by hxl 2024-07-10 0 暂存
|
|
|
+ if(quoteVo.getStageFlag()==0){
|
|
|
+ //设置为报价中
|
|
|
+ insOrders.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
+ }else{
|
|
|
+ //设置为已承保状态
|
|
|
+ insOrders.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ }
|
|
|
PtlAgreement byAgreementIdNew = ptlAgreementService.getByAgreementIdNew(quoteVo.getAgreementId());
|
|
|
quoteVo = checkQuoteVo(quoteVo);
|
|
|
|
|
|
@@ -538,9 +555,14 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
insAreaCompany.setJqRenewal(quoteVo.getJqRenewal());
|
|
|
insAreaCompany.setSyRenewal(quoteVo.getSyRenewal());
|
|
|
insAreaCompany.setScore(quoteVo.getScore());
|
|
|
-
|
|
|
- //设置为已承保状态
|
|
|
- insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ //添加暂存处理 add by hxl 2024-07-10 0 暂存
|
|
|
+ if(quoteVo.getStageFlag()==0){
|
|
|
+ //设置为报价中
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
+ }else{
|
|
|
+ //设置为已承保状态
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ }
|
|
|
insAreaCompany.setCompanyId(byAgreementIdNew.getInsuranceCompanyId());
|
|
|
insAreaCompany.setInscompany(byAgreementIdNew.getInsuranceCompany());
|
|
|
//保单号
|
|
|
@@ -652,10 +674,11 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
|
|
|
//计算费用
|
|
|
feeRuleSchemeNewService.calcCostsExternal(costsNews.get(0),insAreaCompany);
|
|
|
-
|
|
|
- //审核表数据插入
|
|
|
- insFeeAuditService.saveDefaultInsFeeAuditAndHistory(insAreaCompany.getOrderno(), insAreaCompany.getId(), FeeAuditAuditstatus.UNREVICEWED.getCode(),null);
|
|
|
-
|
|
|
+ // add by hxl 2024-07-10 保存时查询审核表
|
|
|
+ if(quoteVo.getStageFlag()==1){
|
|
|
+ //审核表数据插入
|
|
|
+ insFeeAuditService.saveDefaultInsFeeAuditAndHistory(insAreaCompany.getOrderno(), insAreaCompany.getId(), FeeAuditAuditstatus.UNREVICEWED.getCode(),null);
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -690,8 +713,8 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Page<InsAreaCompany> getRejectOrder(Page page,String userId) {
|
|
|
- Page<InsAreaCompany> rejectOrder = baseMapper.getRejectOrder(page, userId);
|
|
|
+ public Page<InsAreaCompany> getRejectOrder(Page page,String userId,RejectPageQueryVo rejectPageQueryVo) {
|
|
|
+ Page<InsAreaCompany> rejectOrder = baseMapper.getRejectOrder(page, userId,rejectPageQueryVo);
|
|
|
return rejectOrder;
|
|
|
}
|
|
|
|
|
|
@@ -703,10 +726,21 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public boolean updateOrderAndSubOrder(InsOrdersEditingVo insOrdersEditingVo) {
|
|
|
+ if(StringUtils.isBlank(insOrdersEditingVo.getAgreementId())){
|
|
|
+ throw new SystemException("请选择协议!!");
|
|
|
+ }
|
|
|
InsOrders insOrders = new InsOrders();
|
|
|
BeanUtils.copyProperties(insOrdersEditingVo,insOrders);
|
|
|
//更新创建时间
|
|
|
insOrders.setCreatetime(LocalDateTime.now());
|
|
|
+ //添加暂存处理 add by hxl 2024-07-10 0 暂存
|
|
|
+ if(insOrdersEditingVo.getStageFlag()==0){
|
|
|
+ //设置为报价中
|
|
|
+ insOrders.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
+ }else{
|
|
|
+ //设置为已承保状态
|
|
|
+ insOrders.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ }
|
|
|
insOrdersService.updateById(insOrders);
|
|
|
String subOrderNo = insOrdersEditingVo.getInsAreaCompanyList().get(0).getId();
|
|
|
//处理保单
|
|
|
@@ -724,15 +758,13 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
if(insOrdersEditingVo.getJqSignList() != null && !insOrdersEditingVo.getJqSignList().isEmpty()){
|
|
|
externalPolicy.setJqSign(insOrdersEditingVo.getJqSignList().get(0).getUrl());
|
|
|
}
|
|
|
- insAreaCompanyExternalPolicyService.updateById(externalPolicy);
|
|
|
-
|
|
|
- //处理子订单
|
|
|
- InsAreaCompany insAreaCompany = insOrdersEditingVo.getInsAreaCompanyList().get(0);
|
|
|
- this.updateById(insAreaCompany);
|
|
|
-
|
|
|
+ insAreaCompanyExternalPolicyService.updateBySuOrderNo(externalPolicy);
|
|
|
//通过协议id 查询费用
|
|
|
PtlAgreement ptlAgreement = ptlAgreementService.getById(insOrdersEditingVo.getAgreementId());
|
|
|
-
|
|
|
+ //处理子订单重新赋值 add by hxl 2024-07-01 处理编辑数据不更新的bug
|
|
|
+ InsAreaCompany insAreaCompany = insOrdersEditingVo.getInsAreaCompanyList().get(0);
|
|
|
+ insAreaCompany =getNewEntity(insAreaCompany,insOrdersEditingVo,ptlAgreement);
|
|
|
+ this.updateById(insAreaCompany);
|
|
|
//查找协议的费用
|
|
|
AgreementProductQueryVo agreementProductQueryVo = new AgreementProductQueryVo();
|
|
|
List<String> productId = new ArrayList<>();
|
|
|
@@ -802,11 +834,87 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
|
|
|
|
|
|
//计算费用
|
|
|
feeRuleSchemeNewService.calcCostsExternal(costsNews.get(0),insAreaCompany);
|
|
|
-
|
|
|
- //重新进入审核状态
|
|
|
- insFeeAuditService.saveDefaultInsFeeAuditAndHistory(insAreaCompany.getOrderno(), insAreaCompany.getId(), FeeAuditAuditstatus.UNREVICEWED.getCode(),null);
|
|
|
+ // add by hxl 2024-07-10 保存时查询审核表
|
|
|
+ if(insOrdersEditingVo.getStageFlag()==1){
|
|
|
+ //重新进入审核状态
|
|
|
+ insFeeAuditService.saveDefaultInsFeeAuditAndHistory(insAreaCompany.getOrderno(), insAreaCompany.getId(), FeeAuditAuditstatus.UNREVICEWED.getCode(),null);
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/7/11 17:28
|
|
|
+ * @Description: 重新赋值更新
|
|
|
+ */
|
|
|
+ private InsAreaCompany getNewEntity(InsAreaCompany insAreaCompany, InsOrdersEditingVo insOrdersEditingVo,PtlAgreement ptlAgreement) {
|
|
|
+ insAreaCompany.setAgreementId(insOrdersEditingVo.getAgreementId());
|
|
|
+ //设置时间
|
|
|
+ insAreaCompany.setJqStartDate(insOrdersEditingVo.getJqstartdate());
|
|
|
+ insAreaCompany.setJqEndDate(insOrdersEditingVo.getJqenddate());
|
|
|
+ insAreaCompany.setSyStartDate(insOrdersEditingVo.getSystartdate());
|
|
|
+ insAreaCompany.setSyEndDate(insOrdersEditingVo.getSyenddate());
|
|
|
+
|
|
|
+ insAreaCompany.setJqRenewal(insOrdersEditingVo.getJqRenewal());
|
|
|
+ insAreaCompany.setSyRenewal(insOrdersEditingVo.getSyRenewal());
|
|
|
+ insAreaCompany.setScore(insOrdersEditingVo.getScore());
|
|
|
+ //添加暂存处理 add by hxl 2024-07-10 0 暂存
|
|
|
+ if(insOrdersEditingVo.getStageFlag()==0){
|
|
|
+ //设置为报价中
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
|
|
|
+ }else{
|
|
|
+ //设置为已承保状态
|
|
|
+ insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
|
|
|
+ }
|
|
|
+ insAreaCompany.setCompanyId(ptlAgreement.getInsuranceCompanyId());
|
|
|
+ insAreaCompany.setInscompany(ptlAgreement.getInsuranceCompany());
|
|
|
+ //保单号
|
|
|
+ insAreaCompany.setJqpolicyno(insOrdersEditingVo.getJqpolicyno());
|
|
|
+ insAreaCompany.setSypolicyno(insOrdersEditingVo.getSypolicyno());
|
|
|
+ JSONArray noPolicyno = new JSONArray();
|
|
|
+ JSONObject noPolicy = new JSONObject();
|
|
|
+ noPolicy.put("application", insOrdersEditingVo.getJypolicyno());
|
|
|
+ noPolicyno.add(noPolicy);
|
|
|
+ insAreaCompany.setCrossInsurance(noPolicyno);
|
|
|
+ insAreaCompany.setRiskinfo(insOrdersEditingVo.getRisk());
|
|
|
+ insAreaCompany.setKindinfo(insOrdersEditingVo.getKing());
|
|
|
+ //设置保费
|
|
|
+ insAreaCompany.setJqpremium(StringUtils.isNotBlank(insOrdersEditingVo.getJqpremium())?new BigDecimal(insOrdersEditingVo.getJqpremium()):BigDecimal.ZERO);
|
|
|
+ insAreaCompany.setSypremium(StringUtils.isNotBlank(insOrdersEditingVo.getSypremium())?new BigDecimal(insOrdersEditingVo.getSypremium()):BigDecimal.ZERO);
|
|
|
+ insAreaCompany.setJypremium(StringUtils.isNotBlank(insOrdersEditingVo.getJypremium())?new BigDecimal(insOrdersEditingVo.getJypremium()):BigDecimal.ZERO);
|
|
|
+ insAreaCompany.setTaxamount(StringUtils.isNotBlank(insOrdersEditingVo.getTaxamount())?new BigDecimal(insOrdersEditingVo.getTaxamount()):BigDecimal.ZERO);
|
|
|
+ insAreaCompany.setSumpremium(insAreaCompany.getJqpremium()
|
|
|
+ .add(insAreaCompany.getSypremium())
|
|
|
+ .add(insAreaCompany.getJypremium())
|
|
|
+ .add(insAreaCompany.getTaxamount()));
|
|
|
+ insAreaCompany.setOperatorId(BaseController.getUser().getId());
|
|
|
+ insAreaCompany.setOperatorName(BaseController.getUser().getName());
|
|
|
+ insAreaCompany.setOperatorTime(new Date());
|
|
|
+ insAreaCompany.setSigningTime(insOrdersEditingVo.getSignDate());
|
|
|
+ insAreaCompany.setCreatetime(LocalDateTime.now());
|
|
|
+ //通过主订单的信息判断 更新险种信息
|
|
|
+ List<RiskInfoVo> risks = insOrdersEditingVo.getRisk() == null ? new JSONArray().toJavaList(RiskInfoVo.class) :
|
|
|
+ insOrdersEditingVo.getRisk().toJavaList(RiskInfoVo.class);
|
|
|
+ List<KindInfoVo> kinds = insOrdersEditingVo.getKing() == null ? new JSONArray().toJavaList(KindInfoVo.class) :
|
|
|
+ insOrdersEditingVo.getKing().toJavaList(KindInfoVo.class);
|
|
|
+ //获取订单的险种信息
|
|
|
+ InsOrders insOrders = new InsOrders();
|
|
|
+ insOrders.productInformation(risks, kinds);
|
|
|
+ insAreaCompany.setProductid(insOrders.getProductid());
|
|
|
+ insAreaCompany.setProduct(insOrders.getProduct());
|
|
|
+ return insAreaCompany;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/7/10 17:41
|
|
|
+ * @Description: 获取暂存订单的数据
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Page<InsAreaCompany> getStageOrder(Page page, String userId,RejectPageQueryVo rejectPageQueryVo) {
|
|
|
+ return baseMapper.getStageOrder(page, userId,rejectPageQueryVo);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|