Commit 2bd69554 authored by fangxinjiang's avatar fangxinjiang

见费出单优化

parent d295e33b
......@@ -3928,7 +3928,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
CommonConstants.ZERO_STRING.equals(insuranceType.getIsJfcd()) &&
CommonConstants.IS_FALSE.equals(settleDomainSelectVo.getBpoEnable())) {
param.setIsJfcd(CommonConstants.ZERO_STRING);
param.setIsNewData(advancePaymentHelper.resolveIsNewDataForNewRecord());
param.setIsNewData(InsurancesConstants.IS_NEW_DATA_YES);//上线后的数据都是新数据,历史数据有数据库更新
}
}
......@@ -3942,7 +3942,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
CommonConstants.ZERO_STRING.equals(insuranceType.getIsJfcd()) &&
CommonConstants.IS_FALSE.equals(settleDomainSelectVo.getBpoEnable())) {
param.setIsJfcd(CommonConstants.ZERO_STRING);
param.setIsNewData(advancePaymentHelper.resolveIsNewDataForNewRecord());
param.setIsNewData(InsurancesConstants.IS_NEW_DATA_YES);//上线后的数据都是新数据,历史数据有数据库更新
}
}
......@@ -5146,12 +5146,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setErrorMessage(InsurancesConstants.BUY_HANDLE_FOUR_NOT_REGISTERED);
continue;
}
if (!advancePaymentHelper.isNewJfcdData(detail) && StringUtils.isNotBlank(detail.getDefaultSettleId())){
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){
settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if (Optional.ofNullable(settle).isPresent()){
settleStatus = getSettleStatusFromEkpInsuranceDetail(detail.getId(), detail.getDefaultSettleId());
if(null != settleStatus){
if(Common.isNotNull(settleStatus.getSettleStatus())) {
if(!advancePaymentHelper.isNewJfcdData(detail) && Common.isNotNull(settleStatus.getSettleStatus())) {
//保费更新或者保单号发票号更新
if (InsurancesConstants.SETTLE_TWO.equals(settleStatus.getSettleStatus())) {
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
......@@ -9506,16 +9506,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Common.isEmpty(vo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
if (Common.isNotNull(vo.getDetailIds())) {
List<String> detailIds = Arrays.asList(vo.getDetailIds().split(CommonConstants.COMMA_STRING));
boolean allNewAdvancePay = detailIds.stream().allMatch(id -> {
TInsuranceDetail detail = baseMapper.selectById(id);
return detail != null && advancePaymentHelper.isNewJfcdData(detail);
});
if (allNewAdvancePay) {
return R.ok();
}
}
try {
log.info("商险状态更新报文"+JSON.toJSONString(vo));
doJointInsuranceTask.updateInsuranceSettleStatus(vo);
......
......@@ -17,10 +17,6 @@ import java.time.format.DateTimeFormatter;
@Component
public class AdvancePaymentHelper {
private static final DateTimeFormatter LAUNCH_TIME_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@Value("${advance-pay.new-data-launch-time:2099-12-31 23:59:59}")
private String newDataLaunchTime;
public boolean isJfcd(TInsuranceDetail detail) {
return detail != null && CommonConstants.ZERO_STRING.equals(detail.getIsJfcd());
......@@ -55,21 +51,6 @@ public class AdvancePaymentHelper {
&& InsurancesConstants.IS_NEW_DATA_YES.equals(param.getIsNewData());
}
/**
* 满足见费出单条件时,按发布时间决定是否新数据。
*/
public String resolveIsNewDataForNewRecord() {
try {
LocalDateTime launch = LocalDateTime.parse(newDataLaunchTime.trim(), LAUNCH_TIME_FORMAT);
if (!LocalDateTime.now().isBefore(launch)) {
return InsurancesConstants.IS_NEW_DATA_YES;
}
} catch (Exception ignored) {
// 配置解析失败时保守走历史逻辑
}
return InsurancesConstants.IS_NEW_DATA_NO;
}
/** HRO is_new_data 与 EKP fd_new_data 同值直传 */
public String toEkpFdNewData(String isNewData) {
if (InsurancesConstants.IS_NEW_DATA_YES.equals(isNewData)) {
......
......@@ -251,6 +251,7 @@ public class DoJointInsuranceTask {
if (Common.isNotNull(viewVo.getId())) {
insuranceId = viewVo.getId().substring(0, 19);
detail = insuranceDetailMapper.selectById(insuranceId);
//(历史见费出单数据走这里,新见费出单不走这里)
if (Common.isNotNull(detail) && advancePaymentHelper.isNewJfcdData(detail)) {
continue;
}
......
......@@ -42,6 +42,3 @@ wx:
agentid: 1000010
authUrl: https://test-wx.worfu.com/yifu-auth/method/oauth/wxLogin
domainName: https://test-wx.worfu.com
\ No newline at end of file
advance-pay:
new-data-launch-time: 2099-12-31 23:59:59
\ No newline at end of file
......@@ -42,6 +42,3 @@ wx:
agentid: 1000009
authUrl: https://wx.worfu.com/yifu-auth/method/oauth/wxLogin
domainName: https://wx.worfu.com
\ No newline at end of file
advance-pay:
new-data-launch-time: 2099-12-31 23:59:59
\ No newline at end of file
......@@ -44,5 +44,3 @@ wx:
domainName: https://test-wx.worfu.com
advance-pay:
new-data-launch-time: 2099-12-31 23:59:59
......@@ -104,7 +104,3 @@ springdoc:
- group: insurances
#按包路径匹配
packagesToScan: com.yifu.cloud.plus.v1.yifu.insurances.controller
# 新提前缴费数据写入切点(满足见费出单且当前时间>=此时间时写 isNewData=1)
advance-pay:
new-data-launch-time: 2099-12-31 23:59:59
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