Commit a06adabf authored by huyuchen's avatar huyuchen

明细接口改造

parent d64aab7d
......@@ -265,4 +265,8 @@ public class EkpPushSocialParam implements Serializable {
* 社保ids
**/
private String socialIds;
/**
* 是否为预估
**/
private String ygFlag;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.ekp.config;
import com.google.common.collect.Range;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import org.apache.shardingsphere.sharding.api.sharding.standard.PreciseShardingValue;
import org.apache.shardingsphere.sharding.api.sharding.standard.RangeShardingValue;
import org.apache.shardingsphere.sharding.api.sharding.standard.StandardShardingAlgorithm;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
@Component
public class OTAStrategyShardingAlgorithm implements StandardShardingAlgorithm<LocalDateTime> {
public class OTAStrategyShardingAlgorithm implements StandardShardingAlgorithm<String> {
private static final DateTimeFormatter yyyy = DateTimeFormatter.ofPattern("yyyy");
......@@ -24,10 +24,10 @@ public class OTAStrategyShardingAlgorithm implements StandardShardingAlgorithm<L
* @return
*/
@Override
public String doSharding(Collection<String> collection, PreciseShardingValue<LocalDateTime> preciseShardingValue) {
public String doSharding(Collection<String> collection, PreciseShardingValue<String> preciseShardingValue) {
LocalDateTime value = preciseShardingValue.getValue();
String tableSuffix = value.format(yyyy);
String value = preciseShardingValue.getValue();
String tableSuffix = value.substring(0,4);
String logicTableName = preciseShardingValue.getLogicTableName();
String table = logicTableName.concat("_").concat(tableSuffix);
return collection.stream().filter(s -> s.equals(table)).findFirst().orElseThrow(() -> new RuntimeException("逻辑分表不存在"));
......@@ -42,12 +42,12 @@ public class OTAStrategyShardingAlgorithm implements StandardShardingAlgorithm<L
* @return
*/
@Override
public Collection<String> doSharding(Collection<String> collection, RangeShardingValue<LocalDateTime> rangeShardingValue) {
public Collection<String> doSharding(Collection<String> collection, RangeShardingValue<String> rangeShardingValue) {
// 逻辑表名
String logicTableName = rangeShardingValue.getLogicTableName();
// 范围参数
Range<LocalDateTime> valueRange = rangeShardingValue.getValueRange();
Range<String> valueRange = rangeShardingValue.getValueRange();
Set<String> queryRangeTables = extracted(logicTableName, valueRange.lowerEndpoint(), valueRange.upperEndpoint());
ArrayList<String> tables = new ArrayList<>(collection);
tables.retainAll(queryRangeTables);
......@@ -63,12 +63,12 @@ public class OTAStrategyShardingAlgorithm implements StandardShardingAlgorithm<L
* @Date 2022-07-21
* @return 物理表名集合
*/
private Set<String> extracted(String logicTableName, LocalDateTime lowerEndpoint, LocalDateTime upperEndpoint) {
private Set<String> extracted(String logicTableName, String lowerEndpoint, String upperEndpoint) {
Set<String> rangeTable = new HashSet<>();
while (lowerEndpoint.isBefore(upperEndpoint)) {
while (DateUtil.stringToDate(lowerEndpoint + "01").before(DateUtil.stringToDate(upperEndpoint + "01"))) {
String str = getTableNameByDate(lowerEndpoint, logicTableName);
rangeTable.add(str);
lowerEndpoint = lowerEndpoint.plusYears(1);
lowerEndpoint = DateUtil.dateToString(DateUtil.dateIncreaseByYear(DateUtil.stringToDate(lowerEndpoint + "01"),1),DateUtil.DATETIME_YYYYMM);
}
// 获取物理表明
String tableName = getTableNameByDate(upperEndpoint, logicTableName);
......@@ -84,8 +84,8 @@ public class OTAStrategyShardingAlgorithm implements StandardShardingAlgorithm<L
* @Date 2022-07-21
* @return 物理表名
*/
private String getTableNameByDate(LocalDateTime dateTime, String logicTableName) {
String tableSuffix = dateTime.format(yyyy);
private String getTableNameByDate(String dateTime, String logicTableName) {
String tableSuffix = dateTime.substring(0,4);
return logicTableName.concat("_").concat(tableSuffix);
}
......
......@@ -8,6 +8,7 @@ import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo;
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;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentSocialPush;
......@@ -18,20 +19,20 @@ import java.util.*;
import java.util.stream.Collectors;
/**
* 社保明细表
//社保明细表
*
* @author huyc
* @date 2024-02-29 11:21:56
//@author huyc
//@date 2024-02-29 11:21:56
*/
@Log4j2
@Service
public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, EkpSocialInfo> implements EkpSocialInfoService {
/**
* @Description: 社保明细推送至ekp
* @Author: huyc
* @Date: 2024-2-29
* @return: void
//@Description: 社保明细推送至ekp
//@Author: huyc
//@Date: 2024-2-29
//@return: void
**/
public EkpSocialPushInfoVo pushSocialInfoToEkp(List<EkpPushSocialParam> unPushList) {
......@@ -76,14 +77,32 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
}
//获取社保订单明细合计
socialSumInfo = baseMapper.getCostSumInfo(socialInfo.getFd_3adfe8c7e4cf7a(),socialInfo.getFd_3adfe8cb96c41e());
//预估合计
Double ygSum = Common.isEmpty(socialSumInfo) ? 0: socialSumInfo.getYgSum();
//预估个人合计
Double ygPersonSum = Common.isEmpty(socialSumInfo) ? 0: socialSumInfo.getYgPersonSum();
//实缴合计
Double sjSum = Common.isEmpty(socialSumInfo) ? 0: socialSumInfo.getSjSum();
//预估单位合计
Double ygDwSum = Common.isEmpty(socialSumInfo) ? 0: socialSumInfo.getYgDwSum();
//实缴单位合计
Double sjDwSum = Common.isEmpty(socialSumInfo) ? 0: socialSumInfo.getSjDwSum();
//实缴个人合计
Double sjPersonSum = Common.isEmpty(socialSumInfo) ? 0: socialSumInfo.getSjPersonSum();
//应收
Double ys = Common.isEmpty(socialSumInfo) ? 0: socialSumInfo.getYs();
//个人应收
Double personYs = Common.isEmpty(socialSumInfo) ? 0: socialSumInfo.getPersonYs();
//单位应收
Double dwYs = Common.isEmpty(socialSumInfo) ? 0: socialSumInfo.getDwYs();
//单位差异
if("是".equals(socialInfo.getFd_3add9de0be85e4()) && "实缴".equals(socialInfo.getFd_3add9dd7833db8())){
//单位差异
//$列表.求总和$($社保订单明细*总数(实缴单位合计)$)+ $实缴单位合计$ - $列表.求总和$($社保订单明细*总数(预估单位合计)$)
socialInfo.setFd_3adfeb53c70f72(Double.sum(Double.sum(socialSumInfo.getSjDwSum(),socialInfo.getFd_3af9f2e9208e4e()),-socialSumInfo.getYgDwSum()));
socialInfo.setFd_3adfeb53c70f72(Double.sum(Double.sum(sjDwSum,socialInfo.getFd_3af9f2e9208e4e()),-ygDwSum));
//个人差异
//$列表.求总和$($社保订单明细*总数(实缴个人合计)$)+ $实缴个人合计$ - $列表.求总和$($社保订单明细*总数(预估个人合计)$)
socialInfo.setFd_3adfeb5413fb44(Double.sum(Double.sum(socialSumInfo.getSjPersonSum(),socialInfo.getFd_3af9f303037214()),-socialSumInfo.getYgPersonSum()));
socialInfo.setFd_3adfeb5413fb44(Double.sum(Double.sum(sjPersonSum,socialInfo.getFd_3af9f303037214()),-ygPersonSum));
}
//Fd_3adfeb7b624f06应收;Fd_3b35a57aee1428个人应收;fd_3b35a57b6e9d0a单位应收
......@@ -98,13 +117,13 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
if("实缴".equals(deptInfo.getSettleType())){
if("预估".equals(socialInfo.getFd_3add9dd7833db8())){
//$列表.求总和$($社保订单明细*总数(预估合计)$) + $预估合计$ - $列表.求总和$($社保订单明细*总数(应收)$)
socialInfo.setFd_3adfeb7b624f06(Double.sum(Double.sum(socialSumInfo.getYgSum(),socialInfo.getFd_3af9f2883941b4()),-socialSumInfo.getYs()));
socialInfo.setFd_3adfeb7b624f06(Double.sum(Double.sum(ygSum,socialInfo.getFd_3af9f2883941b4()),-ys));
//$列表.求总和$($社保订单明细*总数(预估个人合计)$) + $预估个人合计$ - $列表.求总和$($社保订单明细*总数(个人应收)$)
socialInfo.setFd_3b35a57aee1428(Double.sum(Double.sum(socialSumInfo.getYgPersonSum(),socialInfo.getFd_3af9f285ee1e38()),-socialSumInfo.getPersonYs()));
socialInfo.setFd_3b35a57aee1428(Double.sum(Double.sum(ygPersonSum,socialInfo.getFd_3af9f285ee1e38()),-personYs));
//$列表.求总和$($社保订单明细*总数(预估单位合计)$) + $预估单位合计$ - $列表.求总和$($社保订单明细*总数(单位应收)$)
socialInfo.setFd_3b35a57b6e9d0a(Double.sum(Double.sum(socialSumInfo.getYgDwSum(),socialInfo.getFd_3adfeb4e8064a8()),-socialSumInfo.getDwYs()));
socialInfo.setFd_3b35a57b6e9d0a(Double.sum(Double.sum(ygDwSum,socialInfo.getFd_3adfeb4e8064a8()),-dwYs));
}else{
if(socialSumInfo.getYgSum()>0){
if(ygSum > 0){
//应收
socialInfo.setFd_3adfeb7b624f06(CommonConstants.ZERO_INTEGER.doubleValue());
//个人应收
......@@ -113,28 +132,28 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
socialInfo.setFd_3b35a57b6e9d0a(CommonConstants.ZERO_INTEGER.doubleValue());
}else{
//$列表.求总和$($社保订单明细*总数(实缴合计)$)+ $实缴合计$ - $列表.求总和$($社保订单明细*总数(应收)$)
socialInfo.setFd_3adfeb7b624f06(Double.sum(Double.sum(socialSumInfo.getSjSum(),socialInfo.getFd_3af9f3059e5b9c()),-socialSumInfo.getYs()));
socialInfo.setFd_3adfeb7b624f06(Double.sum(Double.sum(sjSum,socialInfo.getFd_3af9f3059e5b9c()),-ys));
//$列表.求总和$($社保订单明细*总数(实缴个人合计)$)+ $实缴个人合计$ - $列表.求总和$($社保订单明细*总数(个人应收)$)
socialInfo.setFd_3b35a57aee1428(Double.sum(Double.sum(socialSumInfo.getSjPersonSum(),socialInfo.getFd_3af9f303037214()),-socialSumInfo.getPersonYs()));
socialInfo.setFd_3b35a57aee1428(Double.sum(Double.sum(sjPersonSum,socialInfo.getFd_3af9f303037214()),-personYs));
//列表.求总和$($社保订单明细*总数(实缴单位合计)$)+ $实缴单位合计$ - $列表.求总和$($社保订单明细*总数(单位应收)$)
socialInfo.setFd_3b35a57b6e9d0a(Double.sum(Double.sum(socialSumInfo.getSjDwSum(),socialInfo.getFd_3af9f2e9208e4e()),-socialSumInfo.getDwYs()));
socialInfo.setFd_3b35a57b6e9d0a(Double.sum(Double.sum(sjDwSum,socialInfo.getFd_3af9f2e9208e4e()),-dwYs));
}
}
}else{
if("预估".equals(socialInfo.getFd_3add9dd7833db8())){
//$列表.求总和$($社保订单明细*总数(预估合计)$) + $预估合计$-$列表.求总和$($社保订单明细*总数(应收)$)
socialInfo.setFd_3adfeb7b624f06(Double.sum(Double.sum(socialSumInfo.getYgSum(),socialInfo.getFd_3af9f2883941b4()),-socialSumInfo.getYs()));
socialInfo.setFd_3adfeb7b624f06(Double.sum(Double.sum(ygSum,socialInfo.getFd_3af9f2883941b4()),-ys));
//$列表.求总和$( $社保订单明细*总数(预估个人合计)$) + $预估个人合计$-$列表.求总和$($社保订单明细*总数(个人应收)$)
socialInfo.setFd_3b35a57aee1428(Double.sum(Double.sum(socialSumInfo.getYgPersonSum(),socialInfo.getFd_3af9f285ee1e38()),-socialSumInfo.getPersonYs()));
socialInfo.setFd_3b35a57aee1428(Double.sum(Double.sum(ygPersonSum,socialInfo.getFd_3af9f285ee1e38()),-personYs));
//$列表.求总和$($社保订单明细*总数(预估单位合计)$) + $预估单位合计$-$列表.求总和$($社保订单明细*总数(单位应收)$)
socialInfo.setFd_3b35a57b6e9d0a(Double.sum(Double.sum(socialSumInfo.getYgDwSum(),socialInfo.getFd_3adfeb4e8064a8()),-socialSumInfo.getDwYs()));
socialInfo.setFd_3b35a57b6e9d0a(Double.sum(Double.sum(ygDwSum,socialInfo.getFd_3adfeb4e8064a8()),-dwYs));
}else{
//$列表.求总和$($社保订单明细*总数(实缴合计)$)+ $实缴合计$ - $列表.求总和$($社保订单明细*总数(应收)$)
socialInfo.setFd_3adfeb7b624f06(Double.sum(Double.sum(socialSumInfo.getSjSum(),socialInfo.getFd_3af9f3059e5b9c()),-socialSumInfo.getYs()));
socialInfo.setFd_3adfeb7b624f06(Double.sum(Double.sum(sjSum,socialInfo.getFd_3af9f3059e5b9c()),-ys));
//$列表.求总和$($社保订单明细*总数(实缴个人合计)$)+ $实缴个人合计$ - $列表.求总和$($社保订单明细*总数(个人应收)$)
socialInfo.setFd_3b35a57aee1428(Double.sum(Double.sum(socialSumInfo.getSjPersonSum(),socialInfo.getFd_3af9f303037214()),-socialSumInfo.getPersonYs()));
socialInfo.setFd_3b35a57aee1428(Double.sum(Double.sum(sjPersonSum,socialInfo.getFd_3af9f303037214()),-personYs));
//$列表.求总和$($社保订单明细*总数(实缴单位合计)$)+ $实缴单位合计$ - $列表.求总和$($社保订单明细*总数(单位应收)$)
socialInfo.setFd_3b35a57b6e9d0a(Double.sum(Double.sum(socialSumInfo.getSjDwSum(),socialInfo.getFd_3af9f2e9208e4e()),-socialSumInfo.getDwYs()));
socialInfo.setFd_3b35a57b6e9d0a(Double.sum(Double.sum(sjDwSum,socialInfo.getFd_3af9f2e9208e4e()),-dwYs));
}
}
}
......@@ -160,7 +179,11 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
a.setPaymentIds(socialParam.getSocialIds());
a.setId(socialParam.getFd_3b0afbe1f94a08());
socialPushList.add(a);
paymentIds.add(socialParam.getSocialIds());
if (CommonConstants.ZERO_STRING.equals(socialParam.getYgFlag())) {
paymentIds.add(socialParam.getSocialIds());
}else {
paymentIds.add(socialParam.getFd_3b0afbe1f94a08());
}
}
boolean flag = this.saveBatch(socialInfoList);
if (flag) {
......@@ -215,63 +238,63 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
//社保合集ID
socialInfo.setFd_3b6495a5ad6e10(socialParam.getSocialIds());
//预估单位养老
socialInfo.setFd_3af9f257b1b586(Double.valueOf(socialParam.getFd_3af9ec80a9de7a()));
socialInfo.setFd_3af9f257b1b586(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ec80a9de7a()) ? null : Double.valueOf(socialParam.getFd_3af9ec80a9de7a()));
//预估单位医疗
socialInfo.setFd_3af9f25b851e94(Double.valueOf(socialParam.getFd_3af9eba5899c90()));
socialInfo.setFd_3af9f25b851e94(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9eba5899c90()) ? null : Double.valueOf(socialParam.getFd_3af9ec80a9de7a()));
//预估单位失业
socialInfo.setFd_3af9f25f5e9cc4(Double.valueOf(socialParam.getFd_3af9eba5f6e19e()));
socialInfo.setFd_3af9f25f5e9cc4(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9eba5f6e19e()) ? null : Double.valueOf(socialParam.getFd_3af9eba5f6e19e()));
//预估单位工伤
socialInfo.setFd_3af9f2617e530a(Double.valueOf(socialParam.getFd_3af9eba684f592()));
socialInfo.setFd_3af9f2617e530a(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9eba684f592()) ? null : Double.valueOf(socialParam.getFd_3af9eba684f592()));
//预估单位生育
socialInfo.setFd_3af9f263e094c6(Double.valueOf(socialParam.getFd_3af9eba71c0138()));
socialInfo.setFd_3af9f263e094c6(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9eba71c0138()) ? null : Double.valueOf(socialParam.getFd_3af9eba71c0138()));
//预估单位补缴利息
socialInfo.setFd_3af9f267a03bd6(Double.valueOf(socialParam.getFd_3af9eba7c3da5e()));
socialInfo.setFd_3af9f267a03bd6(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9eba7c3da5e()) ? null : Double.valueOf(socialParam.getFd_3af9eba7c3da5e()));
//预估单位大病救助
socialInfo.setFd_3af9f26a3cae94(Double.valueOf(socialParam.getFd_3af9eba863c0ee()));
socialInfo.setFd_3af9f26a3cae94(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9eba863c0ee()) ? null : Double.valueOf(socialParam.getFd_3af9eba863c0ee()));
//预估单位合计
socialInfo.setFd_3adfeb4e8064a8(Double.valueOf(socialParam.getFd_3adfeb4e8064a8()));
socialInfo.setFd_3adfeb4e8064a8(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3adfeb4e8064a8()) ? null : Double.valueOf(socialParam.getFd_3adfeb4e8064a8()));
//预估个人养老
socialInfo.setFd_3af9f27a3974e6(Double.valueOf(socialParam.getFd_3af9ebbd791662()));
socialInfo.setFd_3af9f27a3974e6(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ebbd791662()) ? null : Double.valueOf(socialParam.getFd_3af9ebbd791662()));
//预估个人医疗
socialInfo.setFd_3af9f27ce947ac(Double.valueOf(socialParam.getFd_3af9ebbdd9797e()));
socialInfo.setFd_3af9f27ce947ac(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ebbdd9797e()) ? null : Double.valueOf(socialParam.getFd_3af9ebbdd9797e()));
//预估个人失业
socialInfo.setFd_3af9f27efdd912(Double.valueOf(socialParam.getFd_3af9ebbe29ce1c()));
socialInfo.setFd_3af9f27efdd912(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ebbe29ce1c()) ? null : Double.valueOf(socialParam.getFd_3af9ebbe29ce1c()));
//预估个人补缴利息
socialInfo.setFd_3af9f281651734(Double.valueOf(socialParam.getFd_3af9ebbecc4aa8()));
socialInfo.setFd_3af9f281651734(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ebbecc4aa8()) ? null : Double.valueOf(socialParam.getFd_3af9ebbecc4aa8()));
//预估个人大病救助
socialInfo.setFd_3af9f283a6f288(Double.valueOf(socialParam.getFd_3af9ebbf3e8be2()));
socialInfo.setFd_3af9f283a6f288(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ebbf3e8be2()) ? null : Double.valueOf(socialParam.getFd_3af9ebbf3e8be2()));
//预估个人合计
socialInfo.setFd_3af9f285ee1e38(Double.valueOf(socialParam.getFd_3adfeb52a4d2e2()));
socialInfo.setFd_3af9f285ee1e38(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3adfeb52a4d2e2()) ? null : Double.valueOf(socialParam.getFd_3adfeb52a4d2e2()));
//预估合计
socialInfo.setFd_3af9f2883941b4(Double.valueOf(socialParam.getFd_3af9ed7e813b86()));
socialInfo.setFd_3af9f2883941b4(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ed7e813b86()) ? null : Double.valueOf(socialParam.getFd_3af9ed7e813b86()));
//实缴单位养老
socialInfo.setFd_3af9f2d8df88c0(Double.valueOf(socialParam.getFd_3af9ee3938170a()));
socialInfo.setFd_3af9f2d8df88c0(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3938170a()) ? null : Double.valueOf(socialParam.getFd_3af9ee3938170a()));
//实缴单位医疗
socialInfo.setFd_3af9f2db1e5e16(Double.valueOf(socialParam.getFd_3af9ee39dea6a8()));
socialInfo.setFd_3af9f2db1e5e16(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee39dea6a8()) ? null : Double.valueOf(socialParam.getFd_3af9ee39dea6a8()));
//实缴单位失业
socialInfo.setFd_3af9f2dd5d8fb8(Double.valueOf(socialParam.getFd_3af9ee3a46b7e6()));
socialInfo.setFd_3af9f2dd5d8fb8(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3a46b7e6()) ? null : Double.valueOf(socialParam.getFd_3af9ee3a46b7e6()));
//实缴单位工伤
socialInfo.setFd_3af9f2e03295dc(Double.valueOf(socialParam.getFd_3af9ee3aa9c84a()));
socialInfo.setFd_3af9f2e03295dc(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3aa9c84a()) ? null : Double.valueOf(socialParam.getFd_3af9ee3aa9c84a()));
//实缴单位生育
socialInfo.setFd_3af9f2e237f794(Double.valueOf(socialParam.getFd_3af9ee3afb34c2()));
socialInfo.setFd_3af9f2e237f794(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3afb34c2()) ? null : Double.valueOf(socialParam.getFd_3af9ee3afb34c2()));
//实缴单位补缴利息
socialInfo.setFd_3af9f2e45a5d78(Double.valueOf(socialParam.getFd_3af9ee3b5ddae8()));
socialInfo.setFd_3af9f2e45a5d78(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3b5ddae8()) ? null : Double.valueOf(socialParam.getFd_3af9ee3b5ddae8()));
//实缴单位合计
socialInfo.setFd_3af9f2e9208e4e(Double.valueOf(socialParam.getFd_3af9ee3c0bf286()));
socialInfo.setFd_3af9f2e9208e4e(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3c0bf286()) ? null : Double.valueOf(socialParam.getFd_3af9ee3c0bf286()));
//实缴个人养老
socialInfo.setFd_3af9f2ec516c30(Double.valueOf(socialParam.getFd_3af9ee3e513962()));
socialInfo.setFd_3af9f2ec516c30(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3e513962()) ? null : Double.valueOf(socialParam.getFd_3af9ee3e513962()));
//实缴个人医疗
socialInfo.setFd_3af9f2f8290f24(Double.valueOf(socialParam.getFd_3af9ee3e066d48()));
socialInfo.setFd_3af9f2f8290f24(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3e066d48()) ? null : Double.valueOf(socialParam.getFd_3af9ee3e066d48()));
//实缴个人失业
socialInfo.setFd_3af9f2fa79ee72(Double.valueOf(socialParam.getFd_3af9ee3db44d96()));
socialInfo.setFd_3af9f2fa79ee72(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3db44d96()) ? null : Double.valueOf(socialParam.getFd_3af9ee3db44d96()));
//实缴个人补缴利息
socialInfo.setFd_3af9f2fcde9158(Double.valueOf(socialParam.getFd_3af9ee3d634946()));
socialInfo.setFd_3af9f2fcde9158(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3d634946()) ? null : Double.valueOf(socialParam.getFd_3af9ee3d634946()));
//实缴个人大病救助
socialInfo.setFd_3af9f2ff2c9f42(Double.valueOf(socialParam.getFd_3af9ee3d0ba3b6()));
socialInfo.setFd_3af9f2ff2c9f42(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3d0ba3b6()) ? null : Double.valueOf(socialParam.getFd_3af9ee3d0ba3b6()));
//实缴个人合计
socialInfo.setFd_3af9f303037214(Double.valueOf(socialParam.getFd_3af9ee3cb6d4fa()));
socialInfo.setFd_3af9f303037214(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3cb6d4fa()) ? null : Double.valueOf(socialParam.getFd_3af9ee3cb6d4fa()));
//实缴合计
socialInfo.setFd_3af9f3059e5b9c(Double.valueOf(socialParam.getFd_3af9ee3c6bfc74()));
socialInfo.setFd_3af9f3059e5b9c(CommonConstants.EMPTY_STRING.equals(socialParam.getFd_3af9ee3c6bfc74()) ? null : Double.valueOf(socialParam.getFd_3af9ee3c6bfc74()));
//结算状态
socialInfo.setFd_3add9ea428879a(socialParam.getFd_3add9ea428879a());
//收款状态
......
......@@ -110,7 +110,7 @@
round(sum(ifnull(fd_3b35a57b6e9d0a,0)),2) as dwYs,
round(sum(ifnull(fd_3adfeb7bd97464,0)),2) as yzc,
round(sum(ifnull(fd_3b35a5b03100c4,0)),2) as personYzc,
round(sum(ifnull(fd_3b35a5b0b04d54,0)),2) as dwYzc,
round(sum(ifnull(fd_3b35a5b0b04d54,0)),2) as dwYzc
from ekp_9264ea0160848a681328
where fd_3adfe8c7e4cf7a = #{card} and DATE_FORMAT(fd_3adfe8cb96c41e,'%Y-%m') = #{month}
</select>
......
......@@ -667,6 +667,8 @@ public class DoJointSocialTask {
// 薪酬申请编号
socialParam.setFd_3b3cab77923f44(CommonConstants.EMPTY_STRING);
socialParam.setSocialIds(library.getIds());
//实缴
socialParam.setYgFlag(CommonConstants.ZERO_STRING);
insertList.add(socialParam);
}
R<EkpSocialPushInfoVo> info = ekpDaprUtil.pushSocialInfoToEkp(insertList);
......@@ -921,9 +923,10 @@ public class DoJointSocialTask {
log.info("推送社保预估费用到EKP-线程开始");
TSettleDomain settleDomain;
EkpPushSocialParam socialParam;
List<EkpPushSocialParam> paramList = new ArrayList<>();
for (TForecastLibrary library : unPushInfo) {
try {
List<EkpPushSocialParam> insertList = new ArrayList<>();
try {
for (TForecastLibrary library : unPushInfo) {
//获取项目信息
settleDomain = selectVoMap.get(library.getDeptNo());
if (Common.isEmpty(settleDomain)) {
......@@ -1145,72 +1148,39 @@ public class DoJointSocialTask {
socialParam.setFd_3b0afbe1f94a08(library.getId());
// 薪酬申请编号
socialParam.setFd_3b3cab77923f44(CommonConstants.EMPTY_STRING);
String body = ekpSocialUtil.sendToEKP(socialParam);
if (Common.isEmpty(body) || body.length() != 32) {
paramList.add(socialParam);
}
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) {
//预估
socialParam.setYgFlag(CommonConstants.ONE_STRING);
insertList.add(socialParam);
}
R<EkpSocialPushInfoVo> info = ekpDaprUtil.pushSocialInfoToEkp(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 (EkpPushSocialParam s:paramList) {
try {
String body = ekpSocialUtil.sendToEKP(s);
if (Common.isNotNull(body) && body.length() == 32) {
TForecastLibrary library = forecastLibraryMapper.selectById(s.getFd_3b0afbe1f94a08());
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_3b0afbe1f94a08());
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_3b0afbe1f94a08());
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