Commit f2cf2ebc authored by zhaji's avatar zhaji

"feature-zhaJi:新增操作时的备注字段"

parent df73b011
......@@ -89,5 +89,23 @@ public class InsuranceRefundHandlingParam implements Serializable {
@Schema(description = "办理人")
private String updateBy;
/**
* 派单人
*/
@Schema(description = "派单人")
private String createName;
/**
* 派单开始时间
*/
@Schema(description = "派单开始时间")
private String createStartTime;
/**
* 派单结束时间
*/
@Schema(description = "派单结束时间")
private String createEndTime;
}
......@@ -323,7 +323,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this.saveBatch(detailList);
}
//操作记录
addOperate(detailList,user,InsurancesConstants.ADD);
addOperate(detailList,user,InsurancesConstants.ADD,null);
return R.ok(listResult,InsurancesConstants.ADD_SUCCESS);
}
......@@ -368,7 +368,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this.saveBatch(detailList);
}
//操作记录
addOperate(detailList,user,InsurancesConstants.BATCH);
addOperate(detailList,user,InsurancesConstants.BATCH,null);
return R.ok(listResult,InsurancesConstants.BATCH_SUCCESS);
}
......@@ -468,7 +468,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
//操作记录
addOperate(detailList,user,InsurancesConstants.REPLACE);
addOperate(detailList,user,InsurancesConstants.REPLACE,null);
return R.ok(listResult,InsurancesConstants.REPLACE_SUCCESS);
}
......@@ -500,7 +500,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
byId.setDeleteFlag(CommonConstants.ONE_INT);
this.updateById(byId);
//操作记录
addOperate(Arrays.asList(byId),user,InsurancesConstants.DELETE);
addOperate(Arrays.asList(byId),user,InsurancesConstants.DELETE,null);
return R.ok(InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -756,7 +756,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed(InsurancesConstants.EDIT_NOT_ALLOW);
}
//操作记录
addOperate(Arrays.asList(byId),user,InsurancesConstants.EDIT);
addOperate(Arrays.asList(byId),user,InsurancesConstants.EDIT,null);
return R.ok(InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -850,7 +850,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this.saveOrUpdateBatch(detailList);
}
//操作记录
addOperate(detailList,user,InsurancesConstants.EXPORT);
addOperate(detailList,user,InsurancesConstants.EXPORT,null);
//针对是替换类型的做处理,每一条替换数据对应一条被替换数据
List<InsuranceExportListVO> listVOS = insuranceExportList.stream().filter(e -> e.getBuyType() == CommonConstants.FOUR_INT).collect(Collectors.toList());
......@@ -1008,7 +1008,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//根据项目编码获取项目名称
setProjectNameByDeptNo(errorList);
//操作记录
addOperate(successList,user,InsurancesConstants.ROLLBACK);
addOperate(successList,user,InsurancesConstants.ROLLBACK,null);
return R.ok(errorList,InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -1168,7 +1168,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//根据项目编码获取项目名称
setProjectNameByDeptNo(errorList);
//操作记录
addOperate(successList,user,InsurancesConstants.SUCCESSFUL);
addOperate(successList,user,InsurancesConstants.SUCCESSFUL,null);
return R.ok(errorList, InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -1271,7 +1271,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
//操作记录
addOperate(detailList,user,InsurancesConstants.REGISTERED);
addOperate(detailList,user,InsurancesConstants.REGISTERED,null);
return R.ok(listResult,InsurancesConstants.OPERATE_SUCCESS);
}
......@@ -2601,7 +2601,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(List<TInsuranceDetail> detailList,YifuUser user,String operateDesc){
private void addOperate(List<TInsuranceDetail> detailList,YifuUser user,String operateDesc,String remark){
if (CollectionUtils.isNotEmpty(detailList)){
try {
List<TInsuranceOperate> operateList = new ArrayList<>();
......@@ -2962,7 +2962,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
//操作记录
addOperate(detailList,user,InsurancesConstants.INSURANCE_REFUND_EXPORT);
addOperate(detailList,user,InsurancesConstants.INSURANCE_REFUND_EXPORT,null);
}
return R.ok(refundExportList);
}
......@@ -3034,9 +3034,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateBatchById(successList);
//操作记录
if(CommonConstants.FOUR_INT == refundType){
addOperate(successList,user,InsurancesConstants.INSURANCE_REFUND_SUCCESS);
addOperate(successList,user,InsurancesConstants.INSURANCE_REFUND_SUCCESS,null);
}else{
addOperate(successList,user,InsurancesConstants.INSURANCE_REFUND_FAILED);
addOperate(successList,user,InsurancesConstants.INSURANCE_REFUND_FAILED,null);
}
return R.ok(errorList,"操作成功");
}
......@@ -3135,205 +3135,210 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(CollectionUtils.isNotEmpty(successList)){
threadPool.execute(() -> {
for (DeptChangeCheckParam success : successList) {
EKPInteractiveParam interactiveParam = new EKPInteractiveParam();
TInsuranceDetail one = getOne(lambdaQuery().getWrapper().eq(TInsuranceDetail::getId, success.getId()));
BeanCopyUtils.copyProperties(one,interactiveParam);
//更新新的客户,项目信息
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
Integer oldSettleType = success.getOldSettleType();
Integer newSettleType = success.getNewSettleType();
updateWrapper.eq(TInsuranceDetail ::getId,success.getId())
//新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
//实际保费
BigDecimal actualPremium = success.getActualPremium();
//预估保费
BigDecimal estimatePremium = success.getEstimatePremium();
//EKP推送类
EKPInteractiveParam interactiveParam = new EKPInteractiveParam();
TInsuranceDetail one = getOne(lambdaQuery().getWrapper().eq(TInsuranceDetail::getId, success.getId()));
BeanCopyUtils.copyProperties(one,interactiveParam);
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
Integer oldSettleType = success.getOldSettleType();
Integer newSettleType = success.getNewSettleType();
//更新新的项目编码,结算方式,预估保费,实际保费
updateWrapper.eq(TInsuranceDetail ::getId,success.getId())
.set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo())
.set(TInsuranceDetail :: getSettleType,success.getNewSettleType())
.set(TInsuranceDetail :: getSettleType,newSettleType)
.set(TInsuranceDetail :: getActualPremium,actualPremium)
.set(TInsuranceDetail :: getEstimatePremium,estimatePremium)
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
String insuranceDetailId = success.getId();
//结算信息id
String defaultSettleId = success.getDefaultSettleId();
//实际保费
BigDecimal actualPremium = success.getActualPremium();
//如果变更前为单独结算
if(CommonConstants.ONE_INT == oldSettleType){
//登记了保单保费
if (!BigDecimalUtils.isNullOrZero(actualPremium)) {
//根据旧的结算id获取旧的结算信息
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//作废旧的数据,生成作废结算信息记录
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo());
cancel.setInsDetailId(success.getId());
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
//如果已经推送过实际保费,则先作废,再推送新的实际保费
if (byId.getIsActualPush() == CommonConstants.ONE_INT) {
//TODO: 2022/8/2
//推送至EKP执行作废操作
interactiveParam.setActualPremium(one.getActualPremium());
interactiveParam.setCustomerCode(success.getOldCustomerCode());
interactiveParam.setCustomerName(success.getOldCustomerName());
interactiveParam.setDeptNo(success.getOldDeptNo());
interactiveParam.setDeptName(success.getOldDeptName());
interactiveParam.setInteractiveType(CommonConstants.THREE_INT);
String deleteBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(deleteBody)) {
//推送成功更新作废推送状态
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType) {
//生成新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
tInsuranceSettleService.save(newInsuranceSettle);
//赋值新的结算信息id
updateWrapper.set(TInsuranceDetail::getDefaultSettleId, newInsuranceSettle.getId());
update(updateWrapper);
// TODO: 2022/8/2
//推送新的结算信息至EKP
//更新项目编码
update(updateWrapper);
//商险id
String insuranceDetailId = success.getId();
//旧结算信息id
String oldDefaultSettleId = success.getDefaultSettleId();
//如果变更前为单独结算
if(CommonConstants.ONE_INT == oldSettleType){
//登记了保单保费
if (!BigDecimalUtils.isNullOrZero(actualPremium)) {
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(actualPremium);
newInsuranceSettle.setEstimatePremium(estimatePremium);
//存储新的结算信息
tInsuranceSettleService.save(newInsuranceSettle);
updateWrapper.set(TInsuranceDetail::getDefaultSettleId, newInsuranceSettle.getId());
//更新新的结算信息
update(updateWrapper);
//根据旧的结算id获取旧的结算信息
TInsuranceSettle byId = tInsuranceSettleService.getById(oldDefaultSettleId);
//作废旧的数据,生成作废结算信息记录
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo());
cancel.setInsDetailId(insuranceDetailId);
cancel.setSettleId(oldDefaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
//如果已经推送过实际保费,则先作废,再推送新的实际保费
if (byId.getIsActualPush() == CommonConstants.ONE_INT) {
//TODO: 2022/8/2
//推送至EKP执行作废操作
interactiveParam.setActualPremium(one.getActualPremium());
interactiveParam.setCustomerCode(success.getOldCustomerCode());
interactiveParam.setCustomerName(success.getOldCustomerName());
interactiveParam.setDeptNo(success.getOldDeptNo());
interactiveParam.setDeptName(success.getOldDeptName());
interactiveParam.setInteractiveType(CommonConstants.THREE_INT);
String deleteBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(deleteBody)) {
//推送成功更新作废推送状态
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType) {
//推送新的结算信息至EKP
interactiveParam.setSettleType(CommonConstants.ONE_INT);
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setActualPremium(success.getActualPremium());
String addBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(addBody)){
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else {
//异常处理 // TODO: 2022/8/9
}
}
//变更后为合并结算
if (CommonConstants.ZERO_INT == newSettleType) {
// TODO: 2022/8/2
//先推送预估,再推送实际
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
//推送预估单
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(null);
interactiveParam.setSettleType(CommonConstants.ZERO_INT);
String estimateBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(estimateBody)) {
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
//推送实缴单
interactiveParam.setSettleType(CommonConstants.ONE_INT);
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setEstimatePremium(null);
interactiveParam.setActualPremium(success.getActualPremium());
String addBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(addBody)){
String actualBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(actualBody)) {
//推送成功后更新本地推送状态
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else {
//异常处理 // TODO: 2022/8/9
}
}
//变更后为合并结算
if (CommonConstants.ZERO_INT == newSettleType) {
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
//生成新的结算信息
tInsuranceSettleService.save(newInsuranceSettle);
//赋值新的预估费用和新的结算信息
updateWrapper.set(TInsuranceDetail::getEstimatePremium, success.getEstimatePremium());
updateWrapper.set(TInsuranceDetail::getDefaultSettleId, newInsuranceSettle.getId());
update(updateWrapper);
//推送EKP
// TODO: 2022/8/2
//先推送预估,再推送实际
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
//推送预估单
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(null);
interactiveParam.setSettleType(CommonConstants.ZERO_INT);
String estimateBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(estimateBody)) {
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
//推送实缴单
interactiveParam.setSettleType(CommonConstants.ONE_INT);
interactiveParam.setEstimatePremium(null);
interactiveParam.setActualPremium(success.getActualPremium());
String actualBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(actualBody)) {
//推送成功后更新本地推送状态
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
}else{
//异常处理 // TODO: 2022/8/9
}
}
}
}
}else{
//异常处理 // TODO: 2022/8/9
}
}else{
// TODO: 2022/8/9 已有实缴但是未推送属于异常,暂时不推
}
//未登记保单保费
if(BigDecimalUtils.isNullOrZero(actualPremium)){
//变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType){
//变更项目且不做处理
update(updateWrapper);
}
//变更后为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
//生成预估结算信息
TInsuranceSettle tInsuranceSettle = new TInsuranceSettle();
tInsuranceSettle.setInsDetailId(success.getId());
tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
tInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
tInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
tInsuranceSettle.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(tInsuranceSettle);
//将结算id赋值给保单信息,并新增预估费用
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium())
.set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId());
update(updateWrapper);
//推送结算信息至EKP
// TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(null);
interactiveParam.setSettleType(CommonConstants.ZERO_INT);
String estimateBody = EKPUtil.sendToEKP(interactiveParam);
if(StringUtils.isNotBlank(estimateBody)){
//推送成功后更新本地推送状态
tInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
tInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
tInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(tInsuranceSettle);
}else{
}
//未登记保单保费
if(BigDecimalUtils.isNullOrZero(actualPremium)){
//变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType){
//变更项目且不做处理
//update(updateWrapper);
}
//变更后为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
//生成预估结算信息
TInsuranceSettle tInsuranceSettle = new TInsuranceSettle();
tInsuranceSettle.setInsDetailId(success.getId());
tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
tInsuranceSettle.setEstimatePremium(estimatePremium);
tInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
tInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
tInsuranceSettle.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(tInsuranceSettle);
//将结算id赋值给保单信息,并新增预估费用
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId());
update(updateWrapper);
//推送结算信息至EKP
// TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(null);
interactiveParam.setSettleType(CommonConstants.ZERO_INT);
String estimateBody = EKPUtil.sendToEKP(interactiveParam);
if(StringUtils.isNotBlank(estimateBody)){
//推送成功后更新本地推送状态
tInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
tInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
tInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(tInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
}
}
}
}
//变更前为合并结算
if(CommonConstants.ZERO_INT == oldSettleType){
//如果已经登记保费
if (!BigDecimalUtils.isNullOrZero(actualPremium)){
//作废旧的结算信息
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo());
cancel.setInsDetailId(success.getId());
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
}
//变更前为合并结算
if(CommonConstants.ZERO_INT == oldSettleType){
//作废旧的结算信息
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo());
cancel.setInsDetailId(success.getId());
cancel.setSettleId(oldDefaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
TInsuranceSettle byId = tInsuranceSettleService.getById(oldDefaultSettleId);
//如果已经登记保费
if (!BigDecimalUtils.isNullOrZero(actualPremium)){
//新增新的结算信息
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettleService.save(newInsuranceSettle);
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
if(byId.getIsActualPush() == CommonConstants.ONE_INT && byId.getIsEstimatePush() == CommonConstants.ONE_INT){
//推送作废结算信息至EKP
// TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getOldCustomerCode());
......@@ -3343,7 +3348,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
interactiveParam.setInteractiveType(CommonConstants.THREE_INT);
interactiveParam.setEstimatePremium(one.getEstimatePremium());
interactiveParam.setActualPremium(one.getActualPremium());
interactiveParam.setSettleType(CommonConstants.ZERO_INT);
interactiveParam.setSettleType(CommonConstants.ONE_INT);
String deleteBody = EKPUtil.sendToEKP(interactiveParam);
if(StringUtils.isNotBlank(deleteBody)){
//推送成功更新作废推送状态
......@@ -3351,21 +3356,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleCancelService.updateById(cancel);
//变更为单独结算
if (CommonConstants.ONE_INT == newSettleType){
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
tInsuranceSettleService.save(newInsuranceSettle);
//更新预估费用为0.00
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送新的结算信息至EKP,先推预估单,再推实际保费
//推送新的结算信息至EKP,推实际保费
// TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
......@@ -3388,23 +3382,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettleService.save(newInsuranceSettle);
//更新预估费用为新的预估费用
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送新的结算信息
// TODO: 2022/8/2
// 推送新的结算信息 TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
......@@ -3423,27 +3401,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
//todo 异常情况,需进行处理
}
}
}else{
//异常处理 // TODO: 2022/8/9
//todo 异常情况,需进行处理
}
}else{
//todo 异常情况,需进行处理
}
//如果没有登记保费
if (BigDecimalUtils.isNullOrZero(actualPremium)){
//作废旧的结算信息
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo());
cancel.setInsDetailId(success.getId());
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
//推送至EKP
// TODO: 2022/8/2
}
//如果没有登记保费
if (BigDecimalUtils.isNullOrZero(actualPremium)){
if(byId.getIsEstimatePush() == CommonConstants.ONE_INT){
//推送至EKP TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getOldCustomerCode());
interactiveParam.setCustomerName(success.getOldCustomerName());
interactiveParam.setDeptNo(success.getOldDeptNo());
......@@ -3466,7 +3437,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
......@@ -3475,8 +3445,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettleService.save(newInsuranceSettle);
//更新预估费用
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
//更新结算信息
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送新的结算信息至EKP
......@@ -3503,9 +3472,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else{
//异常处理 // TODO: 2022/8/9
}
}else{
//todo 异常情况,需进行处理
}
}
}
//新增操作信息
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(success.getId());
......
......@@ -739,6 +739,15 @@
<if test="param.updateBy != null and param.updateBy.trim() != ''">
and refund.UPDATE_BY = #{param.updateBy}
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and refund.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.createStartTime != null and param.createStartTime.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.createStartTime}, ' 00:00:00')
</if>
<if test="param.createEndTime != null and param.createEndTime.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.createEndTime}, ' 23:59:59')
</if>
ORDER BY refund.CREATE_TIME DESC,detail.ID ASC
</select>
<!-- 查询保单列表-->
......
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