Commit c8162772 authored by huyuchen's avatar huyuchen

优化修改

parent d4075e80
......@@ -748,4 +748,17 @@ public class TInsuranceDetailController {
tInsuranceDetailService.updateSettleStatus();
}
/**
* 每日定时刷新商险到期数据
*
* @author licancan
* @param
* @return void
*/
@SysLog("每日定时刷新商险到期数据")
@Inner
@PostMapping("/inner/pushActualPremium")
public void pushActualPremium() {
tInsuranceDetailService.pushActualPremium();
}
}
......@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -276,4 +275,6 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
**/
List<InsuranceUpdateVO> selectByIds(@Param("ids") List<String> ids);
List<TInsuranceDetail> selectPushList();
}
......@@ -509,4 +509,6 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @return:
**/
void updateSettleStatus();
void pushActualPremium ();
}
......@@ -7344,4 +7344,55 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return mapSelectVo;
}
/*
* 获取当前保单的结算状态
*
* @author zhaji
* @param
* @return {@link String}
*/
@Override
public void pushActualPremium(){
List<TInsuranceDetail> list = baseMapper.selectPushList();
for (TInsuranceDetail detail: list){
//单独结算
if(StringUtils.isNotBlank(detail.getDefaultSettleId()) && detail.getSettleType() == CommonConstants.ONE_INT) {
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
String s = pushEstimate(detail, CommonConstants.TWO_INT);
//如果推送成功则更改推送状态
if (StringUtils.isNotBlank(s) && Common.isNotNull(settle)) {
settle.setActualPushTime(LocalDateTime.now());
settle.setIsActualPush(CommonConstants.ONE_INT);
tInsuranceSettleService.updateById(settle);
}
}
if(StringUtils.isNotBlank(detail.getDefaultSettleId()) && detail.getSettleType() == CommonConstants.ZERO_INT) {
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
TInsuranceDetail t = new TInsuranceDetail();
BeanUtils.copyProperties(detail,t);
if (Common.isEmpty(detail.getEstimatePremium())) {
detail.setEstimatePremium(detail.getActualPremium());
}
String s1 = pushEstimate(detail, CommonConstants.ONE_INT);
//如果推送成功则更改推送状态
if (StringUtils.isNotBlank(s1) && Common.isNotNull(settle)) {
settle.setIsEstimatePush(CommonConstants.ONE_INT);
settle.setEstimatePushTime(LocalDateTime.now());
tInsuranceSettleService.updateById(settle);
}
if (Common.isEmpty(t.getEstimatePremium())) {
t.setEstimatePremium(t.getActualPremium());
}
String s2 = pushEstimate(t, CommonConstants.TWO_INT);
//如果推送成功则更改推送状态
if (StringUtils.isNotBlank(s2) && Common.isNotNull(settle)) {
settle.setIsActualPush(CommonConstants.ONE_INT);
settle.setActualPushTime(LocalDateTime.now());
tInsuranceSettleService.updateById(settle);
}
}
}
}
}
......@@ -1424,4 +1424,12 @@
</if>
ORDER BY refund.CREATE_TIME DESC,a.ID ASC
</select>
<select id="selectPushList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
SELECT
*
FROM
t_insurance_detail
WHERE ERROR_STATUS = '1'
</select>
</mapper>
......@@ -46,4 +46,17 @@ public class UpdateOverdueTask {
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId(),"/insuranceDetail/inner/updateSettleStatus","", Void.class, SecurityConstants.FROM_IN);
log.info("------------重新更新结算状态同步失败的数据-定时任务结束------------");
}
/**
* 更新商险到期定时任务
*
* @author licancan
* @param
* @return void
*/
public void pushInsEkp() throws Exception {
log.info("-------------推送商险待结算数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId(),"/insuranceDetail/inner/pushActualPremium","", Void.class, SecurityConstants.FROM_IN);
log.info("------------推送商险待结算数据-定时任务结束------------");
}
}
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