Commit 4473d93d authored by 李灿灿's avatar 李灿灿

feat:优化测试

parent 69a49880
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -80,4 +82,10 @@ public class InsuranceRegisterParam implements Serializable {
*/
@Schema(description = "错误信息")
private String errorMessage;
/**
* 数据传递对象,校验通过后不需要再查数据库
*/
@JsonIgnore
private TInsuranceDetail detail = new TInsuranceDetail();
}
......@@ -1727,6 +1727,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public R<List<InsuranceRegisterParam>> registeredPolicyPremium(List<InsuranceRegisterParam> paramList) {
long l = System.currentTimeMillis();
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
......@@ -1756,20 +1757,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for (InsuranceRegisterParam success : listSuccess) {
//登记保单保费
//查数据:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 + 购买标准
TInsuranceDetail detail = baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, success.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, success.getEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, success.getInsuranceCompanyName())
.eq(TInsuranceDetail::getInsuranceTypeName, success.getInsuranceTypeName())
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(success.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(success.getPolicyEnd()))
.eq(TInsuranceDetail::getBuyStandard, success.getBuyStandard())
//排除替换类型,解决保单保费挂靠问题
.ne(TInsuranceDetail::getBuyType,CommonConstants.FOUR_INT)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
TInsuranceDetail detail = success.getDetail();
actualMoney = detail.getActualPremium();
if (StringUtils.isNotBlank(success.getInvoiceNo())){
detail.setInvoiceNo(success.getInvoiceNo());
......@@ -2010,6 +1998,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (operatList.stream().allMatch(e->e.getErrorMessage().equals(CommonConstants.RESULT_DATA_SUCESS))) {
operatList = null;
}
long e = System.currentTimeMillis();
long r = e-l;
log.info("共耗时:",r);
return R.ok(operatList,InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -3613,6 +3604,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
param.setErrorMessage(CommonConstants.RESULT_DATA_SUCESS);
//数据传递对象,校验通过后不需要再查数据库
BeanCopyUtils.copyProperties(detail,param.getDetail());
}
return paramList.stream().distinct().collect(Collectors.toList());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment