Commit a2269f48 authored by huyuchen's avatar huyuchen

明细接口改造

parent 6fd44dcf
......@@ -179,12 +179,14 @@ public class EkpFundInfoServiceImpl extends ServiceImpl<EkpFundInfoMapper, EkpFu
fundInfoList.add(fundInfo);
paymentIds.add(fundParam.getFd_3b0afbaf10df2c());
}
boolean flag = this.saveBatch(fundInfoList);
if (flag) {
//推送成功更新明细状态
EkpSocialPushInfoVo pushInfoVo = new EkpSocialPushInfoVo();
pushInfoVo.setPaymentIds(paymentIds);
return pushInfoVo;
if (!fundInfoList.isEmpty()) {
boolean flag = this.saveBatch(fundInfoList);
if (flag) {
//推送成功更新明细状态
EkpSocialPushInfoVo pushInfoVo = new EkpSocialPushInfoVo();
pushInfoVo.setPaymentIds(paymentIds);
return pushInfoVo;
}
}
} catch (Exception e) {
log.error("公积金明细推送失败");
......
......@@ -194,13 +194,15 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
paymentIds.add(socialParam.getFd_3b0afbe1f94a08());
}
}
boolean flag = this.saveBatch(socialInfoList);
if (flag) {
//推送成功保存社保明细合并的数据对应关系
EkpSocialPushInfoVo pushInfoVo = new EkpSocialPushInfoVo();
pushInfoVo.setUnPushInfo(socialPushList);
pushInfoVo.setPaymentIds(paymentIds);
return pushInfoVo;
if (!socialInfoList.isEmpty()) {
boolean flag = this.saveBatch(socialInfoList);
if (flag) {
//推送成功保存社保明细合并的数据对应关系
EkpSocialPushInfoVo pushInfoVo = new EkpSocialPushInfoVo();
pushInfoVo.setUnPushInfo(socialPushList);
pushInfoVo.setPaymentIds(paymentIds);
return pushInfoVo;
}
}
}catch (Exception e) {
log.error("社保明细推送失败");
......
......@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.social.util;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
......@@ -1120,6 +1121,13 @@ public class DoJointSocialTask {
socialParam.setFd_3b3cab77923f44(CommonConstants.EMPTY_STRING);
//预估
socialParam.setYgFlag(CommonConstants.ONE_STRING);
//缴纳地拼接
StringBuilder adress = new StringBuilder();
adress.append(null!= library.getSocialProvince() ? RedisUtil.redis.opsForValue().get(CacheConstants.AREA_LABEL + library.getSocialProvince()) : "")
.append(null!= library.getSocialCity() ? "_" + RedisUtil.redis.opsForValue().get(CacheConstants.AREA_LABEL + library.getSocialCity()) : "")
.append(null!= library.getSocialTown() ? "_" + RedisUtil.redis.opsForValue().get(CacheConstants.AREA_LABEL + library.getSocialTown()) : "");
socialParam.setFd_3b5cc58d1a70fe(adress.toString());
insertList.add(socialParam);
}
R<EkpSocialPushInfoVo> info = ekpDaprUtil.pushSocialInfoToEkp(insertList);
......@@ -1170,9 +1178,9 @@ public class DoJointSocialTask {
log.info("推送公积金预估费用到EKP-线程开始");
TSettleDomain settleDomain;
EkpPushFundParam fundParam;
List<EkpPushFundParam> paramList = new ArrayList<>();
for (TForecastLibrary library : unPushInfo) {
try {
List<EkpPushFundParam> insertList = new ArrayList<>();
try {
for (TForecastLibrary library : unPushInfo) {
//获取项目信息
settleDomain = selectVoMap.get(library.getDeptNo());
if (Common.isEmpty(settleDomain)) {
......@@ -1292,70 +1300,41 @@ public class DoJointSocialTask {
fundParam.setFd_3b0afbaf10df2c(library.getId());
// 薪酬申请编号
fundParam.setFd_3b3cabde83d1d0(CommonConstants.EMPTY_STRING);
String body = ekpFundUtil.sendToEKP(fundParam);
if (Common.isEmpty(body) || body.length() != 32) {
paramList.add(fundParam);
}
if (Common.isNotNull(body) && body.length() == 32) {
library.setDataPush(CommonConstants.ONE_INT);
forecastLibraryMapper.updateById(library);
} else {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setCreateUserName("公积金预估费用推送");
error.setLinkId(library.getId());
error.setTitle(body);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
}
} catch (Exception e) {
//缴纳地拼接
StringBuilder adress = new StringBuilder();
adress.append(null != library.getFundProvince() ? RedisUtil.redis.opsForValue().get(CacheConstants.AREA_LABEL + library.getFundProvince()) : "")
.append(null != library.getFundCity() ? "_" + RedisUtil.redis.opsForValue().get(CacheConstants.AREA_LABEL + library.getFundCity()) : "")
.append(null != library.getFundTown() ? "_" + RedisUtil.redis.opsForValue().get(CacheConstants.AREA_LABEL + library.getFundTown()) : "");
fundParam.setFd_3b5cc487bb46fa(adress.toString());
insertList.add(fundParam);
}
R<EkpSocialPushInfoVo> info = ekpDaprUtil.pushFundInfoToEkp(insertList);
if (Common.isNotNull(info) && Common.isNotNull(info.getData())) {
EkpSocialPushInfoVo vo = info.getData();
List<String> idList = vo.getPaymentIds();
forecastLibraryMapper.updatePushStatus(idList);
} else {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setCreateUserName("公积金预估费用推送");
error.setLinkId(library.getId());
error.setTitle(e.getMessage());
error.setLinkId(unPushInfo.get(0).getId());
error.setTitle("公积金预估明细批量保存失败");
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
log.error("推送公积金预估费用到EKP错误", e);
}
}
//推送失败的数据重新推送
if (!paramList.isEmpty()) {
for (EkpPushFundParam s:paramList) {
try {
String body = ekpFundUtil.sendToEKP(s);
if (Common.isNotNull(body) && body.length() == 32) {
TForecastLibrary library = forecastLibraryMapper.selectById(s.getFd_3b0afbaf10df2c());
library.setDataPush(CommonConstants.ONE_INT);
forecastLibraryMapper.updateById(library);
} else {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setCreateUserName("公积金预估费用推送");
error.setLinkId(s.getFd_3b0afbaf10df2c());
error.setTitle(body);
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
}
}catch (Exception e) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setCreateUserName("公积金预估费用推送");
error.setLinkId(s.getFd_3b0afbaf10df2c());
error.setTitle(e.getMessage());
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
log.error("推送公积金预估费用到EKP错误", e);
}
}
} catch (Exception e) {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
error.setCreateDay(DateUtil.getThisDay());
error.setType(CommonConstants.TWO_STRING);
error.setCreateUserName("公积金预估费用推送");
error.setLinkId(unPushInfo.get(0).getId());
error.setTitle(e.getMessage());
error.setNums(CommonConstants.ONE_INT);
tSendEkpErrorService.saveError(error);
log.error("推送公积金预估费用到EKP错误", e);
}
log.info("推送公积金预估费用到EKP结束");
}
......
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