Commit a2269f48 authored by huyuchen's avatar huyuchen

明细接口改造

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