Commit 8b078f67 authored by huyuchen's avatar huyuchen

明细接口改造

parent 4037c0de
......@@ -24,4 +24,9 @@ public class EkpSocialPushInfoVo implements Serializable {
**/
private List<String> paymentIds;
/**
* 社保id合并
**/
private String paymentIdSum;
}
......@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType;
import org.apache.shardingsphere.transaction.core.TransactionType;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
......@@ -15,5 +18,7 @@ import java.util.List;
*/
public interface EkpSocialInfoService extends IService<EkpSocialInfo> {
@Transactional
@ShardingTransactionType(TransactionType.BASE)
EkpSocialPushInfoVo pushSocialInfoToEkp(List<EkpPushSocialParam> unPushList);
}
......@@ -54,6 +54,7 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
}
EkpSocialInfo socialCount;
try {
StringBuilder stringBuilder = new StringBuilder();
for (EkpPushSocialParam socialParam : unPushList) {
//去重 防止重复推送
socialCount = baseMapper.selectOne(Wrappers.<EkpSocialInfo>query().lambda()
......@@ -184,12 +185,13 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
//创建时间
socialInfo.setCreateTime(DateUtil.getCurrentDateTime());
socialInfoList.add(socialInfo);
TPaymentSocialPush a = new TPaymentSocialPush();
a.setPaymentIds(socialParam.getSocialIds());
a.setId(socialParam.getFd_3b0afbe1f94a08());
socialPushList.add(a);
if (CommonConstants.ZERO_STRING.equals(socialParam.getYgFlag())) {
stringBuilder.append(socialParam.getSocialIds()).append(",");
paymentIds.add(socialParam.getSocialIds());
TPaymentSocialPush a = new TPaymentSocialPush();
a.setPaymentIds(socialParam.getSocialIds());
a.setId(socialParam.getFd_3b0afbe1f94a08());
socialPushList.add(a);
} else {
paymentIds.add(socialParam.getFd_3b0afbe1f94a08());
}
......@@ -201,6 +203,7 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
EkpSocialPushInfoVo pushInfoVo = new EkpSocialPushInfoVo();
pushInfoVo.setUnPushInfo(socialPushList);
pushInfoVo.setPaymentIds(paymentIds);
pushInfoVo.setPaymentIdSum(stringBuilder.toString());
return pushInfoVo;
}
}
......
......@@ -93,7 +93,7 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
* @param searchVo 缴费库
* @return
*/
List<TPaymentInfoPushVo> getTPaymentInfoSumPushList(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
List<TPaymentInfoPushVo> getTPaymentInfoSumPushList(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,@Param("l") int l);
/**
* 缴费库合并导出查询
......@@ -232,7 +232,15 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
* @return
*/
List<TPaymentInfo> getTPaymentFundPushInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,
@Param("userId") String userId);
@Param("userId") String userId,@Param("k") int k);
/**
* 缴费库公积金推送查询
* @param k 分页区间
* @return
*/
List<TPaymentInfo> getTPaymentFundAllPushInfo(@Param("k") int k);
/**
* 缴费库社保收入推送查询
......@@ -254,6 +262,8 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
void updateBySocialPaymentList(@Param("idStr")String idStr);
void batchUpdateSocialPaymentByList(@Param("details") List<String> idStr);
void updateBySocialIncomePayment(@Param("id")String id);
void updateBySocialIncomeFlag(@Param("id")String id);
......
......@@ -2932,9 +2932,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfoPushVo> unPushs;
int i = (int) Math.ceil((double) count / CommonConstants.ONE_THOUSAND_INT);
Map<String, TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
int k = 0;
for (int j = 0; j < i; j++) {
unPushs = baseMapper.getTPaymentInfoSumPushList(null);
synchronized (this) {
unPushs = baseMapper.getTPaymentInfoSumPushList(null, k);
k = k + 1000;
if (Common.isNotNull(unPushs)) {
//推送数据封装并推送
doJointSocialTask.asynchronousEkpPaymentSocial(unPushs, mapSelectVo);
......@@ -2954,13 +2956,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfo> unPushInfo;
int i = (int) Math.ceil((double) count / CommonConstants.ONE_THOUSAND_INT);
Map<String, TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
int k = 0;
for (int j = 0; j < i; j++) {
//获取所有未推送的公积金实缴明细数据
unPushInfo = baseMapper.selectList(Wrappers.<TPaymentInfo>query().lambda()
.eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getLockStatus, CommonConstants.ONE_STRING)
.isNotNull(TPaymentInfo::getFundId).last(" limit 0,1000"));
synchronized (this) {
//获取所有未推送的公积金实缴明细数据
unPushInfo = baseMapper.getTPaymentFundAllPushInfo(k);
k = k + 1000;
if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送
doJointSocialTask.asynchronousEkpPaymentFund(unPushInfo, mapSelectVo);
......@@ -3134,9 +3135,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (count > 0) {
List<TPaymentInfoPushVo> unPushInfo;
int i = (int) Math.ceil((double) count / CommonConstants.ONE_THOUSAND_INT);
int k = 0;
for (int j = 0; j < i; j++) {
unPushInfo = baseMapper.getTPaymentInfoSumPushList(searchVo);
synchronized (this) {
unPushInfo = baseMapper.getTPaymentInfoSumPushList(searchVo, k);
k = k + 1000;
if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送
doJointSocialTask.asynchronousEkpPaymentSocial(unPushInfo, mapSelectVo);
......@@ -3154,9 +3157,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (count > 0) {
List<TPaymentInfo> unPushInfo;
int i = (int) Math.ceil((double) count / CommonConstants.ONE_THOUSAND_INT);
int k = 0;
for (int j = 0; j < i; j++) {
unPushInfo = baseMapper.getTPaymentFundPushInfo(searchVo, user.getId());
synchronized (this) {
unPushInfo = baseMapper.getTPaymentFundPushInfo(searchVo, user.getId(),k);
k = k + 1000;
if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送
doJointSocialTask.asynchronousEkpPaymentFund(unPushInfo, mapSelectVo);
......
......@@ -675,12 +675,14 @@ public class DoJointSocialTask {
R<EkpSocialPushInfoVo> info = ekpDaprUtil.pushSocialInfoToEkp(insertList);
if (Common.isNotNull(info) && Common.isNotNull(info.getData())) {
EkpSocialPushInfoVo vo = info.getData();
List<String> idList = vo.getPaymentIds();
for (String ids : idList) {
paymentInfoMapper.updateBySocialPaymentList(ids);
String idList = vo.getPaymentIdSum();
if (Common.isNotNull(idList)) {
paymentInfoMapper.updateBySocialPaymentList(idList.substring(0,idList.length()-1));
}
List<TPaymentSocialPush> list = vo.getUnPushInfo();
socialPushService.saveBatch(list);
if (!list.isEmpty()) {
socialPushService.saveBatch(list);
}
} else {
TSendEkpError error = new TSendEkpError();
error.setCreateTime(new Date());
......
......@@ -2162,7 +2162,7 @@
<include refid="tPaymentInfo_export_push_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH,a.SOCIAL_PAY_ADDR
limit 0,1000
limit #{l},1000
</select>
<!--tPaymentInfo合并查询-->
......@@ -2467,7 +2467,18 @@
a.PUSH_STATUS = '1' AND a.FUND_ID IS NOT NULL AND a.CREATE_BY = #{userId}
<include refid="tPaymentInfo_export_where"/>
</where>
limit 0,10000
limit #{k},10000
</select>
<!--tPaymentInfo公积金推送查询-->
<select id="getTPaymentFundAllPushInfo" resultMap="tPaymentInfoMap">
SELECT
a.BPO_FLAG,
<include refid="Base_Column_List"/>
FROM t_payment_info a
where
a.PUSH_STATUS = '1' AND a.FUND_ID IS NOT NULL AND lOCK_STATUS = '1'
limit #{k},10000
</select>
<!--tPaymentInfo社保收入推送查询-->
......@@ -2510,6 +2521,15 @@
ID in (${idStr})
</update>
<!-- 批量更改社保公积金推送状态 -->
<update id="batchUpdateSocialPaymentByList">
<foreach collection="details" index="index" item="item" separator=";">
update t_payment_info a set a.PUSH_STATUS = '0',a.UPDATE_TIME = NOW() where
FIND_IN_SET(a.id,#{item})
</foreach>
</update>
<!-- 更改社保公积金推送状态 -->
<update id="updateBySocialIncomePayment">
update t_payment_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