Commit 19be885b authored by huyuchen's avatar huyuchen

明细接口改造

parent 83211816
...@@ -69,6 +69,17 @@ public class EkpDaprUtils { ...@@ -69,6 +69,17 @@ public class EkpDaprUtils {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpmanagerinfo/inner/pushManangerInfoToEkp", JSON.toJSONString(incomeParam), String.class, SecurityConstants.FROM_IN); return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpmanagerinfo/inner/pushManangerInfoToEkp", JSON.toJSONString(incomeParam), String.class, SecurityConstants.FROM_IN);
} }
/**
* @Author huyc
* @Description 新增管理费明细数据
* @Date 9:23 2024/03/14
* @Param
* @return
**/
public R<EkpSocialPushInfoVo> jobPushManagerInfoToEkp(List<EkpIncomeParamManage> incomeParam) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpmanagerinfo/inner/jobPushManagerInfoToEkp", JSON.toJSONString(incomeParam), EkpSocialPushInfoVo.class, SecurityConstants.FROM_IN);
}
/** /**
* @Author huyc * @Author huyc
* @Description 新增风险金明细数据 * @Description 新增风险金明细数据
...@@ -79,4 +90,16 @@ public class EkpDaprUtils { ...@@ -79,4 +90,16 @@ public class EkpDaprUtils {
public R<String> pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam) { public R<String> pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpriskinfo/inner/pushRiskInfoToEkp", JSON.toJSONString(incomeParam), String.class, SecurityConstants.FROM_IN); return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpriskinfo/inner/pushRiskInfoToEkp", JSON.toJSONString(incomeParam), String.class, SecurityConstants.FROM_IN);
} }
/**
* @Author huyc
* @Description 新增风险金明细数据
* @Date 11:15 2024/03/18
* @Param
* @return
**/
public R<EkpSocialPushInfoVo> jobpushRiskInfoToEkp(List<EkpIncomeParamRisk> incomeParam) {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpriskinfo/inner/jobPushRiskInfoToEkp", JSON.toJSONString(incomeParam), EkpSocialPushInfoVo.class, SecurityConstants.FROM_IN);
}
} }
package com.yifu.cloud.plus.v1.ekp.controller; package com.yifu.cloud.plus.v1.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.service.EkpManagerInfoService; import com.yifu.cloud.plus.v1.ekp.service.EkpManagerInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
...@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* *
* *
...@@ -36,4 +39,17 @@ public class TEkpManagerInfoController { ...@@ -36,4 +39,17 @@ public class TEkpManagerInfoController {
public String pushManangerInfoToEkp(@RequestBody EkpIncomeParamManage incomeParam) { public String pushManangerInfoToEkp(@RequestBody EkpIncomeParamManage incomeParam) {
return ekpManagerInfoService.pushManangerInfoToEkp(incomeParam); return ekpManagerInfoService.pushManangerInfoToEkp(incomeParam);
} }
/**
* @param incomeParamList
* @Description: 推送管理费明细数据
* @Author: huyc
* @Date: 2024/3/14
* @return:
**/
@Inner
@PostMapping("/inner/jobPushManagerInfoToEkp")
public EkpSocialPushInfoVo jobPushManagerInfoToEkp(@RequestBody List<EkpIncomeParamManage> incomeParamList) {
return ekpManagerInfoService.jobPushManagerInfoToEkp(incomeParamList);
}
} }
package com.yifu.cloud.plus.v1.ekp.controller; package com.yifu.cloud.plus.v1.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.service.EkpRiskInfoService; import com.yifu.cloud.plus.v1.ekp.service.EkpRiskInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
...@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* *
...@@ -37,4 +40,18 @@ public class TEkpRiskInfoController { ...@@ -37,4 +40,18 @@ public class TEkpRiskInfoController {
public String pushRiskInfoToEkp(@RequestBody EkpIncomeParamRisk incomeParam) { public String pushRiskInfoToEkp(@RequestBody EkpIncomeParamRisk incomeParam) {
return ekpRiskInfoService.pushRiskInfoToEkp(incomeParam); return ekpRiskInfoService.pushRiskInfoToEkp(incomeParam);
} }
/**
* @param incomeParam
* @Description: 推送管理费明细数据
* @Author: huyc
* @Date: 2024/3/14
* @return:
**/
@Inner
@PostMapping("/inner/jobPushRiskInfoToEkp")
public EkpSocialPushInfoVo jobPushRiskInfoToEkp(@RequestBody List<EkpIncomeParamRisk> incomeParam) {
return ekpRiskInfoService.jobPushRiskInfoToEkp(incomeParam);
}
} }
...@@ -2,7 +2,11 @@ package com.yifu.cloud.plus.v1.ekp.service; ...@@ -2,7 +2,11 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpManagerInfo; import com.yifu.cloud.plus.v1.ekp.entity.EkpManagerInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/** /**
* *
...@@ -13,4 +17,6 @@ import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage; ...@@ -13,4 +17,6 @@ import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
public interface EkpManagerInfoService extends IService<EkpManagerInfo> { public interface EkpManagerInfoService extends IService<EkpManagerInfo> {
String pushManangerInfoToEkp(EkpIncomeParamManage incomeParam); String pushManangerInfoToEkp(EkpIncomeParamManage incomeParam);
@Transactional
EkpSocialPushInfoVo jobPushManagerInfoToEkp(List<EkpIncomeParamManage> incomeParam);
} }
...@@ -2,7 +2,11 @@ package com.yifu.cloud.plus.v1.ekp.service; ...@@ -2,7 +2,11 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpRiskInfo; import com.yifu.cloud.plus.v1.ekp.entity.EkpRiskInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/** /**
* *
...@@ -13,4 +17,6 @@ import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk; ...@@ -13,4 +17,6 @@ import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
public interface EkpRiskInfoService extends IService<EkpRiskInfo> { public interface EkpRiskInfoService extends IService<EkpRiskInfo> {
String pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam); String pushRiskInfoToEkp(EkpIncomeParamRisk incomeParam);
@Transactional
EkpSocialPushInfoVo jobPushRiskInfoToEkp(List<EkpIncomeParamRisk> incomeParam);
} }
...@@ -6,6 +6,7 @@ import com.yifu.cloud.plus.v1.ekp.entity.EkpManagerInfo; ...@@ -6,6 +6,7 @@ import com.yifu.cloud.plus.v1.ekp.entity.EkpManagerInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpManagerInfoMapper; import com.yifu.cloud.plus.v1.ekp.mapper.EkpManagerInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpManagerInfoService; import com.yifu.cloud.plus.v1.ekp.service.EkpManagerInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
...@@ -14,6 +15,8 @@ import lombok.extern.log4j.Log4j2; ...@@ -14,6 +15,8 @@ import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional; import java.util.Optional;
/** /**
...@@ -66,11 +69,72 @@ public class EkpManagerInfoServiceImpl extends ServiceImpl<EkpManagerInfoMapper, ...@@ -66,11 +69,72 @@ public class EkpManagerInfoServiceImpl extends ServiceImpl<EkpManagerInfoMapper,
int i = baseMapper.insert(managerInfo); int i = baseMapper.insert(managerInfo);
return i <= 0 ? null : managerInfo.getFdId(); return i <= 0 ? null : managerInfo.getFdId();
} catch (Exception e) { } catch (Exception e) {
log.error("管理费明细推送失败:",e); log.error("管理费明细推送失败:", e);
return null; return null;
} }
} }
/**
* //@Description: 管理费明细推送至ekp
* //@Author: huyc
* //@Date: 2024-3-14
* //@return: void
**/
public EkpSocialPushInfoVo jobPushManagerInfoToEkp(List<EkpIncomeParamManage> incomeParamList) {
List<EkpManagerInfo> managerInfolist = new ArrayList<>();
EkpManagerInfo managerInfoCount;
EkpDeptInfoVo deptInfo;
List<String> paymentIds = new ArrayList<>();
try {
for (EkpIncomeParamManage incomeParam : incomeParamList) {
//根据项目编码获取ekp所有项目信息
deptInfo = baseMapper.getEkpDeptInfoByNo(incomeParam.getFd_3adfef5e5b9d34());
//去重 防止重复推送
managerInfoCount = baseMapper.selectOne(Wrappers.<EkpManagerInfo>query().lambda()
.eq(EkpManagerInfo::getFd_3b13dc864a3052, incomeParam.getFd_3b13dae9bd70f8())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(managerInfoCount).isPresent()) {
return null;
}
EkpManagerInfo managerInfo = new EkpManagerInfo();
//对象信息赋值
copyManagerProperties(incomeParam, managerInfo);
//项目信息
managerInfo.setFd_3b16e47cb6874c_text(deptInfo.getDeptName());
managerInfo.setFd_3b16e47cb6874c(deptInfo.getFdId());
//实际结算月份
if ("结算月本月数据".equals(deptInfo.getSocialType())) {
managerInfo.setFd_3ae0c23cb3fccc(incomeParam.getFd_3ae0c23cb3fccc());
} else if ("结算月上月数据".equals(deptInfo.getSocialType())) {
managerInfo.setFd_3ae0c23cb3fccc(DateUtil.dateToString(DateUtil.addMonthByDate(DateUtil.parseDate(incomeParam.getFd_3ae0c23cb3fccc(), "yyyy-MM"), -1), "yyyy-MM"));
} else {
managerInfo.setFd_3ae0c23cb3fccc("");
}
//是否全部结算
managerInfo.setFd_3b13b15f5b63fa("全量未结算数据".equals(deptInfo.getSocialType()) ? "是" : "否");
//创建时间
managerInfo.setCreateTime(DateUtil.getCurrentDateTime());
managerInfolist.add(managerInfo);
paymentIds.add(managerInfo.getFd_3b13dc864a3052());
}
if (!managerInfolist.isEmpty()) {
boolean flag = this.saveBatch(managerInfolist);
if (flag) {
//推送成功保存社保明细合并的数据对应关系
EkpSocialPushInfoVo pushInfoVo = new EkpSocialPushInfoVo();
pushInfoVo.setPaymentIds(paymentIds);
return pushInfoVo;
}
}
} catch (Exception e) {
log.error("管理费明细推送失败:", e);
return null;
}
return null;
}
private void copyManagerProperties(EkpIncomeParamManage incomeParam, EkpManagerInfo managerInfo) { private void copyManagerProperties(EkpIncomeParamManage incomeParam, EkpManagerInfo managerInfo) {
//项目编码 //项目编码
managerInfo.setFd_3adfef5e5b9d34(incomeParam.getFd_3adfef5e5b9d34()); managerInfo.setFd_3adfef5e5b9d34(incomeParam.getFd_3adfef5e5b9d34());
...@@ -109,7 +173,7 @@ public class EkpManagerInfoServiceImpl extends ServiceImpl<EkpManagerInfoMapper, ...@@ -109,7 +173,7 @@ public class EkpManagerInfoServiceImpl extends ServiceImpl<EkpManagerInfoMapper,
//收款状态 //收款状态
managerInfo.setFd_3adfefaaef583e("未收"); managerInfo.setFd_3adfefaaef583e("未收");
//单号 //单号
managerInfo.setFd_3adfef7f5d2b52("GLF" + LocalDateTimeUtils.formatTime(LocalDateTime.now(),DateUtil.DATE_PATTERN) managerInfo.setFd_3adfef7f5d2b52("GLF" + LocalDateTimeUtils.formatTime(LocalDateTime.now(), DateUtil.DATE_PATTERN)
+ "_" + managerInfo.getFd_3b13dc864a3052()); + "_" + managerInfo.getFd_3b13dc864a3052());
} }
} }
...@@ -6,6 +6,7 @@ import com.yifu.cloud.plus.v1.ekp.entity.EkpRiskInfo; ...@@ -6,6 +6,7 @@ import com.yifu.cloud.plus.v1.ekp.entity.EkpRiskInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpRiskInfoMapper; import com.yifu.cloud.plus.v1.ekp.mapper.EkpRiskInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpRiskInfoService; import com.yifu.cloud.plus.v1.ekp.service.EkpRiskInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
...@@ -14,6 +15,8 @@ import lombok.extern.log4j.Log4j2; ...@@ -14,6 +15,8 @@ import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional; import java.util.Optional;
/** /**
...@@ -70,6 +73,67 @@ public class EkpRiskInfoServiceImpl extends ServiceImpl<EkpRiskInfoMapper, EkpRi ...@@ -70,6 +73,67 @@ public class EkpRiskInfoServiceImpl extends ServiceImpl<EkpRiskInfoMapper, EkpRi
} }
} }
/**
* //@Description: 风险金明细推送至ekp
* //@Author: huyc
* //@Date: 2024-3-14
* //@return: void
**/
public EkpSocialPushInfoVo jobPushRiskInfoToEkp(List<EkpIncomeParamRisk> incomeParamList) {
List<String> paymentIds = new ArrayList<>();
List<EkpRiskInfo> riskInfoList = new ArrayList();
EkpRiskInfo riskInfoCount;
EkpDeptInfoVo deptInfo;
try {
for (EkpIncomeParamRisk incomeParam : incomeParamList) {
//根据项目编码获取ekp所有项目信息
deptInfo = baseMapper.getEkpDeptInfoByNo(incomeParam.getFd_3adfef5e5b9d34());
//去重 防止重复推送
riskInfoCount = baseMapper.selectOne(Wrappers.<EkpRiskInfo>query().lambda()
.eq(EkpRiskInfo::getFd_3b13db120a8224, incomeParam.getFd_3b13dac4c03022())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(riskInfoCount).isPresent()) {
return null;
}
EkpRiskInfo riskInfoInfo = new EkpRiskInfo();
//对象信息赋值
copyManagerProperties(incomeParam, riskInfoInfo);
//项目信息
riskInfoInfo.setFd_3b16e4cd2c9a86_text(deptInfo.getDeptName());
riskInfoInfo.setFd_3b16e4cd2c9a86(deptInfo.getFdId());
//实际结算月份
if ("结算月本月数据".equals(deptInfo.getSocialType())) {
riskInfoInfo.setFd_3ae0c3044e5958(incomeParam.getFd_3ae0c3044e5958());
} else if ("结算月上月数据".equals(deptInfo.getSocialType())) {
riskInfoInfo.setFd_3ae0c3044e5958(DateUtil.dateToString(DateUtil.addMonthByDate(DateUtil.parseDate(incomeParam.getFd_3ae0c3044e5958(), "yyyy-MM"), -1), "yyyy-MM"));
} else {
riskInfoInfo.setFd_3ae0c3044e5958("");
}
//是否全部结算
riskInfoInfo.setFd_3b13b218b76a36("全量未结算数据".equals(deptInfo.getSocialType()) ? "是" : "否");
//创建时间
riskInfoInfo.setCreateTime(DateUtil.getCurrentDateTime());
paymentIds.add(riskInfoInfo.getFd_3b13db120a8224());
riskInfoList.add(riskInfoInfo);
}
if (!riskInfoList.isEmpty()) {
boolean flag = this.saveBatch(riskInfoList);
if (flag) {
//推送成功保存社保明细合并的数据对应关系
EkpSocialPushInfoVo pushInfoVo = new EkpSocialPushInfoVo();
pushInfoVo.setPaymentIds(paymentIds);
return pushInfoVo;
}
}
} catch (Exception e) {
log.error("管理费明细推送失败:", e);
return null;
}
return null;
}
private void copyManagerProperties(EkpIncomeParamRisk incomeParam, EkpRiskInfo riskInfoInfo) { private void copyManagerProperties(EkpIncomeParamRisk incomeParam, EkpRiskInfo riskInfoInfo) {
//项目编码 //项目编码
riskInfoInfo.setFd_3adfef5e5b9d34(incomeParam.getFd_3adfef5e5b9d34()); riskInfoInfo.setFd_3adfef5e5b9d34(incomeParam.getFd_3adfef5e5b9d34());
......
...@@ -73,6 +73,8 @@ public interface TIncomeMapper extends BaseMapper<TIncome> { ...@@ -73,6 +73,8 @@ public interface TIncomeMapper extends BaseMapper<TIncome> {
**/ **/
int deleteIncomeDetailByApplyNo(@Param("applyNo") String applyNo); int deleteIncomeDetailByApplyNo(@Param("applyNo") String applyNo);
void updateIncomeByIdList(@Param("list") List<String> list);
/** /**
* @param idSet * @param idSet
* @param dept * @param dept
......
...@@ -39,7 +39,6 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo; ...@@ -39,7 +39,6 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants; import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome; import com.yifu.cloud.plus.v1.yifu.social.entity.TIncome;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail; import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSendEkpError;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TIncomeMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.TIncomeMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TPaymentInfoMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.TPaymentInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService; import com.yifu.cloud.plus.v1.yifu.social.service.TIncomeDetailService;
...@@ -321,62 +320,61 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl ...@@ -321,62 +320,61 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
@Override @Override
public void pushDetail() { public void pushDetail() {
List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda() //管理费处理
.eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)); long count = baseMapper.selectCount(Wrappers.<TIncome>query().lambda()
Map<String, Integer> map = new HashMap<>(); .eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)
Map<String, String> idMap = new HashMap<>(); .eq(TIncome::getFeeType, CommonConstants.ONE_STRING));
//收入更新 if (count > 0) {
List<TIncome> updateList = new ArrayList<>(); List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda()
for (TIncome income : list) { .eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)
String sendBack = this.getSendBack(income); .eq(TIncome::getFeeType, CommonConstants.ONE_STRING));
income.setSendTime(new Date()); int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
if (Common.isNotNull(sendBack) && sendBack.length() == 19) { if (!list.isEmpty()) {
income.setSendStatus(CommonConstants.ONE_STRING); List<TIncome> pushList;
income.setSendMonth(DateUtil.addMonth(0)); int k = 0;
income.setEkpId(sendBack); for (int j = 0; j < i; j++) {
updateList.add(income); synchronized (this) {
if (updateList.size() >= CommonConstants.FIVES_INT) { if (j == i - 1) {
baseMapper.updateIncomeById(updateList); pushList = list.subList(k, list.size());
updateList.clear(); } else {
} pushList = list.subList(k, k + 1000);
} else { }
if (Common.isNotNull(map.get(sendBack)) && map.get(sendBack) > 0) { k = k + 1000;
int i = map.get(sendBack) + 1; if (Common.isNotNull(pushList)) {
map.put(sendBack, i); //推送数据封装并推送
idMap.put(sendBack, income.getId()); doJointSocialTask.asynchronousEkpIncomePush(pushList);
//单个异常超过十次,保存异常内容
if (i >= 10) {
baseMapper.updateIncomeById(updateList);
for (Map.Entry<String, Integer> entry : map.entrySet()) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(income.getId());
error.setTitle(entry.getKey());
error.setNums(entry.getValue());
tSendEkpErrorService.save(error);
} }
break;
} }
} else {
map.put(sendBack, 1);
idMap.put(sendBack, income.getId());
} }
} }
} }
for (Map.Entry<String, Integer> entry : map.entrySet()) { //风险金处理
TSendEkpError error = new TSendEkpError(); long countRisk = baseMapper.selectCount(Wrappers.<TIncome>query().lambda()
error.setCreateTime(new Date()); .eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)
error.setCreateDay(DateUtil.getThisDay()); .eq(TIncome::getFeeType, CommonConstants.ZERO_STRING));
error.setType(CommonConstants.FIVE_STRING); if (countRisk > 0) {
error.setLinkId(idMap.get(entry.getKey())); List<TIncome> list = baseMapper.selectList(Wrappers.<TIncome>query().lambda()
error.setTitle(entry.getKey()); .eq(TIncome::getSendStatus, CommonConstants.ZERO_STRING)
error.setNums(entry.getValue()); .eq(TIncome::getFeeType, CommonConstants.ZERO_STRING));
tSendEkpErrorService.save(error); int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
} if (!list.isEmpty()) {
if (Common.isNotNull(updateList)){ List<TIncome> pushList;
baseMapper.updateIncomeById(updateList); int k = 0;
for (int j = 0; j < i; j++) {
synchronized (this) {
if (j == i - 1) {
pushList = list.subList(k, list.size());
} else {
pushList = list.subList(k, k + 1000);
}
k = k + 1000;
if (Common.isNotNull(pushList)) {
//推送数据封装并推送
doJointSocialTask.asynchronousEkpIncomeRiskPush(pushList);
}
}
}
}
} }
} }
......
...@@ -1444,6 +1444,73 @@ public class DoJointSocialTask { ...@@ -1444,6 +1444,73 @@ public class DoJointSocialTask {
log.info("推送收入到EKP结束"); log.info("推送收入到EKP结束");
} }
/**
* @Description: 管理费批量推送
* @Author: huyc
* @Date: 2024-3-19
* @return: void
**/
@Async
public void asynchronousEkpIncomePush(List<TIncome> pushList) {
List<EkpIncomeParamManage> incomeList = new ArrayList<>();
for (TIncome income : pushList) {
EkpIncomeParamManage sendParam = new EkpIncomeParamManage();
this.copyToEkpManage(income, sendParam);
incomeList.add(sendParam);
}
R<EkpSocialPushInfoVo> info = ekpDaprUtil.jobPushManagerInfoToEkp(incomeList);
if (!Common.isEmpty(info) && Common.isNotNull(info.getData())) {
EkpSocialPushInfoVo vo = info.getData();
List<String> idList = vo.getPaymentIds();
if (Common.isNotNull(idList)) {
incomeMapper.updateIncomeByIdList(idList);
}
} else {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(pushList.get(0).getId());
error.setTitle("管理费批量推送失败");
error.setNums(1);
tSendEkpErrorService.save(error);
}
}
/**
* @Description: 风险金批量推送
* @Author: huyc
* @Date: 2024-3-19
* @return: void
**/
@Async
public void asynchronousEkpIncomeRiskPush(List<TIncome> pushList) {
List<EkpIncomeParamRisk> incomeList = new ArrayList<>();
for (TIncome income : pushList) {
EkpIncomeParamRisk sendParam = new EkpIncomeParamRisk();
this.copyToEkpRisk(income, sendParam);
incomeList.add(sendParam);
}
R<EkpSocialPushInfoVo> info = ekpDaprUtil.jobpushRiskInfoToEkp(incomeList);
if (!Common.isEmpty(info) && Common.isNotNull(info.getData())) {
EkpSocialPushInfoVo vo = info.getData();
List<String> idList = vo.getPaymentIds();
if (Common.isNotNull(idList)) {
incomeMapper.updateIncomeByIdList(idList);
}
} else {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.FIVE_STRING);
error.setLinkId(pushList.get(0).getId());
error.setTitle("风险金批量推送失败");
error.setNums(1);
tSendEkpErrorService.save(error);
}
}
public void asynchronousEkpForecastFundAsso(List<TForecastLibrary> unPushInfo, public void asynchronousEkpForecastFundAsso(List<TForecastLibrary> unPushInfo,
Map<String, TSettleDomainSelectVo> selectVoMap) { Map<String, TSettleDomainSelectVo> selectVoMap) {
initEkpForecastFund(unPushInfo, selectVoMap); initEkpForecastFund(unPushInfo, selectVoMap);
......
...@@ -318,4 +318,16 @@ ...@@ -318,4 +318,16 @@
</foreach> </foreach>
</update> </update>
<!-- ekp收入更新 -->
<update id="updateIncomeByIdList">
update t_income p
set p.SEND_STATUS = '1'
,p.SEND_MONTH = DATE_FORMAT(CURRENT_DATE(),'%Y%m')
,p.SEND_TIME = now()
where p.id in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper> </mapper>
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