Commit 47d251fb authored by zhaji's avatar zhaji

Merge branch 'develop' into feature-zhaji

parents 2e074fd1 acf519f5
...@@ -76,6 +76,14 @@ public class InsurancesConstants { ...@@ -76,6 +76,14 @@ public class InsurancesConstants {
* 投保信息不存在 * 投保信息不存在
*/ */
public static final String DATA_IS_NOT_EXIST = "投保信息不存在"; public static final String DATA_IS_NOT_EXIST = "投保信息不存在";
/**
* 结算信息不存在
*/
public static final String SETTLE_DATA_IS_NOT_EXIST = "结算信息不存在";
/**
* 推送信息不存在
*/
public static final String PUSH_DATA_IS_NOT_EXIST = "推送信息不存在";
/** /**
* 被替换员工投保记录不存在 * 被替换员工投保记录不存在
*/ */
...@@ -253,21 +261,21 @@ public class InsurancesConstants { ...@@ -253,21 +261,21 @@ public class InsurancesConstants {
*/ */
public static final String INSURANCE_CITY_NAME_NOT_EXIST = "商险购买地市不存在"; public static final String INSURANCE_CITY_NAME_NOT_EXIST = "商险购买地市不存在";
/** /**
* 商险办理省名称不能为空 * 商险办理省名称不能为空
*/ */
public static final String INSURANCE_HANDLE_PROVINCE_NAME_NOT_EMPTY = "商险办理省名称不能为空"; public static final String INSURANCE_HANDLE_PROVINCE_NAME_NOT_EMPTY = "商险办理省名称不能为空";
/** /**
* 商险办理省不存在 * 商险办理省不存在
*/ */
public static final String INSURANCE_HANDLE_PROVINCE_NAME_NOT_EXIST = "商险办理省不存在"; public static final String INSURANCE_HANDLE_PROVINCE_NAME_NOT_EXIST = "商险办理省不存在";
/** /**
* 商险办理城市名称不能为空 * 商险办理城市名称不能为空
*/ */
public static final String INSURANCE_HANDLE_CITY_NAME_NOT_EMPTY = "商险办理城市名称不能为空"; public static final String INSURANCE_HANDLE_CITY_NAME_NOT_EMPTY = "商险办理城市名称不能为空";
/** /**
* 商险办理城市不存在 * 商险办理城市不存在
*/ */
public static final String INSURANCE_HANDLE_CITY_NAME_NOT_EXIST = "商险办理城市不存在"; public static final String INSURANCE_HANDLE_CITY_NAME_NOT_EXIST = "商险办理城市不存在";
/** /**
* 结算月不能为空 * 结算月不能为空
*/ */
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author licancan
* @description EKP2INSURANCES 更新结算请求参数
* @date 2022-08-01 09:50:33
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "EKP2INSURANCES 更新结算请求参数")
public class UpdateInsuranceSettleParam implements Serializable {
private static final long serialVersionUID = 1459385763943903153L;
/**
* 结算信息
*/
@Schema(description = "结算信息")
private List<SettleData> settleData;
/**
* 推送信息
*/
@Schema(description = "推送信息")
private PushData pushData;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class SettleData implements Serializable {
private static final long serialVersionUID = 4572786452410956413L;
/**
* 结算单号(唯一标识) 生成规则:商险明细id + "_" + 结算id
*/
@Schema(description = "结算单号(唯一标识)")
private String sn;
/**
* 结算状态
*/
@Schema(description = "结算状态")
private String settleStatus;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class PushData implements Serializable {
private static final long serialVersionUID = 4572786452410956413L;
/**
* 推送时间
*/
@Schema(description = "推送时间")
private LocalDateTime pushTime;
}
}
...@@ -36,6 +36,20 @@ public class TInsuranceDetailController { ...@@ -36,6 +36,20 @@ public class TInsuranceDetailController {
private TInsuranceDetailService tInsuranceDetailService; private TInsuranceDetailService tInsuranceDetailService;
/***********************商险办理********************************/ /***********************商险办理********************************/
/**
* EKP2INSURANCES 更新结算状态
*
* @author licancan
* @param param
* @return {@link R<String>}
*/
@Operation(summary = "更新结算状态", description = "更新结算状态")
@PostMapping("/updateInsuranceSettle")
public R<String> updateInsuranceSettle(@RequestBody UpdateInsuranceSettleParam param) {
return tInsuranceDetailService.updateInsuranceSettle(param);
}
/** /**
* 投保办理分页查询 * 投保办理分页查询
* *
......
...@@ -18,6 +18,16 @@ import java.util.List; ...@@ -18,6 +18,16 @@ import java.util.List;
public interface TInsuranceDetailService extends IService<TInsuranceDetail> { public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
/***********************商险办理********************************/ /***********************商险办理********************************/
/**
* EKP2INSURANCES 更新结算状态
*
* @author licancan
* @param param
* @return {@link R<String>}
*/
R<String> updateInsuranceSettle(UpdateInsuranceSettleParam param);
/** /**
* 投保办理分页查询 * 投保办理分页查询
* *
......
...@@ -80,6 +80,49 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -80,6 +80,49 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
/***********************商险办理********************************/ /***********************商险办理********************************/
/**
* EKP2INSURANCES 更新结算状态
*
* @param param
* @return {@link R<String>}
* @author licancan
*/
@Override
public R<String> updateInsuranceSettle(UpdateInsuranceSettleParam param) {
if(!Optional.ofNullable(param).isPresent()){
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
}
if (CollectionUtils.isEmpty(param.getSettleData())){
return R.failed(InsurancesConstants.SETTLE_DATA_IS_NOT_EXIST);
}
if (!Optional.ofNullable(param.getPushData()).isPresent()){
return R.failed(InsurancesConstants.PUSH_DATA_IS_NOT_EXIST);
}
try {
LocalDateTime pushTime = param.getPushData().getPushTime();
List<UpdateInsuranceSettleParam.SettleData> settleData = param.getSettleData();
List<TInsuranceSettle> list = new ArrayList<>();
for (UpdateInsuranceSettleParam.SettleData settleDatum : settleData) {
TInsuranceSettle settle = new TInsuranceSettle();
String settleId = settleDatum.getSn().split("_")[1];
settle.setId(settleId);
settle.setUpdateTime(pushTime);
settle.setSettleHandleStatus(settleDatum.getSettleStatus());
if (CommonConstants.THREE_STRING.equals(settleDatum.getSettleStatus())){
settle.setSettleDoneTime(pushTime);
}
list.add(settle);
}
if (CollectionUtils.isNotEmpty(list)){
tInsuranceSettleService.saveOrUpdateBatch(list);
}
}catch (Exception e){
e.printStackTrace();
return R.failed();
}
return R.ok();
}
/** /**
* 投保办理分页查询 * 投保办理分页查询
* *
......
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