Commit f8626fcb authored by hongguangwu's avatar hongguangwu

MVP1.7.9-20

parent 6933bdc6
......@@ -153,6 +153,13 @@ public class SocialHandleSearchVo extends TDispatchInfo {
@Schema(description ="社保ID")
@ExcelIgnore
private String socialId;
/**
* 社保ID
*/
@TableField(exist = false)
@Schema(description ="社保IDList税友花名册使用")
@ExcelIgnore
private List<String> socialIdList;
/**
* 税友自动化办理,此标识区分于页面的导出功能,值为1 时 默认取值派单审核通过 且 未办理的派单数据
......
......@@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.*;
import org.springframework.security.core.parameters.P;
import org.springframework.web.client.RestTemplate;
import java.security.SignatureException;
......@@ -141,7 +142,15 @@ public class SocialFriendConfig {
json.put("ywblzhlb", ywblzhlbArr);
// type 1社保增 2社保减 3医保增 4医保减
setEmpInfo(json, listVo, type);
if (Common.isNotNull(vo.getQyzgshbxzyhmc())) {
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
qyzgshbxzyhmclbArr.add(vo.getQyzgshbxzyhmc());
json.put("qyzgshbxzyhmclb", qyzgshbxzyhmclbArr);
} else if (Common.isNotNull(vo.getQyzgjbylbxcbdjb())) {
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
qyzgshbxzyhmclbArr.add(vo.getQyzgjbylbxcbdjb());
json.put("qyzgshbxzyhmclb", qyzgshbxzyhmclbArr);
}
HttpEntity<String> formEntity = new HttpEntity<>(json.toString(), headers);
// 推的json
TSocialFriendBackLog backLogPush = new TSocialFriendBackLog();
......@@ -276,7 +285,6 @@ public class SocialFriendConfig {
private void setEmpInfoAdd(JSONObject json, List<SociaFriendYgsAddVo> listVo, int type) {
// 参保人员名单 数组
JSONArray cbrymdArr = new JSONArray();
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
JSONObject cbrymdOne;
// 2025-3-14 15:44:32 单个改造为批量
......@@ -397,7 +405,6 @@ public class SocialFriendConfig {
// 企业职工社会保险增员花名册 安徽非必填!
// 社保增员必填
tszdxx.put("qyzgshbxzyhmc", vo.getQyzgshbxzyhmc());
qyzgshbxzyhmclbArr.add(vo.getQyzgshbxzyhmc());
} else {
// 企业职工基本医疗保险参保登记表 安徽非必填! 数组
String[] arr = {vo.getQyzgjbylbxcbdjb()};
......@@ -420,7 +427,6 @@ public class SocialFriendConfig {
// 人员名单
String buyType = "cbrymd";
json.put(buyType, cbrymdArr);
json.put("qyzgshbxzyhmclb", qyzgshbxzyhmclbArr);
}
/**
......@@ -434,12 +440,10 @@ public class SocialFriendConfig {
// 参保人员名单 数组
// 参保人员名单 数组
JSONArray cbrymdArr = new JSONArray();
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
JSONObject cbrymdOne = new JSONObject();
// 2025-3-14 15:44:32 单个改造为批量
for (SociaFriendYgsAddVo vo : listVo) {
qyzgshbxzyhmclbArr.add(vo.getQyzgshbxzyhmc());
// 姓名
cbrymdOne.put("xm", vo.getEmpName());
// 证件类型
......@@ -483,7 +487,6 @@ public class SocialFriendConfig {
// 人员名单
String buyType = "tbrymd";
json.put(buyType, cbrymdArr);
json.put("qyzgshbxzyhmclb", qyzgshbxzyhmclbArr);
}
/**
......
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.social.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SociaFriendYgsAddVo;
import java.util.List;
......@@ -40,5 +41,5 @@ public interface TSocialFriendPushService extends IService<TSocialInfo> {
**/
R<String> pushFriend(List<String> dispatchIdList);
R<String> doExportRoster(String socialId, String type, String unitCreditCode);
R<String> doExportRoster(String socialId, String type, String unitCreditCode, List<SociaFriendYgsAddVo> listVo);
}
......@@ -176,14 +176,10 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
canPushType = this.getCanPushType(socialSetMap, vo);
if (1 == canPushType) {
try {
// 房工接口,获取 企业职工社会保险增员花名册 url
urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode());
if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
vo.setQyzgshbxzyhmc(urlR.getData());
}
listVo.add(vo);
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
listVo.add(vo);
socialInfoTemp.add(socialInfo);
socialLog = tSocialSoldierLogService.getFriendLog(vo, typeStr, dispatchItem, remark);
if (socialLog != null) {
......@@ -194,7 +190,12 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
&& !vo.getSocialHouseholdName().equals(ygsAddlist.get(index+1).getSocialHouseholdName())) {
nextFlag = true;
}
if (nextFlag || i % 20 == 0 || index >= ygsAddlist.size()-1) {
if (nextFlag || i % 10 == 0 || index >= ygsAddlist.size()-1) {
// 房工接口,获取 企业职工社会保险增员花名册 url
urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode(), listVo);
if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
vo.setQyzgshbxzyhmc(urlR.getData());
}
i=0;
nextFlag = false;
requestId = socialFriendConfig.pushFriendByInfo(restTemplate, vo, listVo, type, thisTime, backLogList);
......@@ -302,12 +303,6 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
try {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
// 房工接口,获取 企业职工基本医疗保险参保登记表 url
urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode());
if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
vo.setQyzgjbylbxcbdjb(urlR.getData());
}
listVo.add(vo);
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
......@@ -321,7 +316,12 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
&& !vo.getSocialHouseholdName().equals(ysdAddlist.get(index+1).getSocialHouseholdName())) {
nextFlag = true;
}
if (nextFlag || i % 20 == 0 || index >= ysdAddlist.size()-1) {
if (nextFlag || i % 10 == 0 || index >= ysdAddlist.size()-1) {
// 房工接口,获取 企业职工基本医疗保险参保登记表 url
urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode(), listVo);
if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
vo.setQyzgjbylbxcbdjb(urlR.getData());
}
i=0;
requestId = socialFriendConfig.pushFriendByInfo(restTemplate, vo, listVo, type, thisTime, backLogList);
ysdHandleStatus = CommonConstants.TWO_STRING;
......@@ -502,7 +502,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
* @Param socialId:社保明细ID type: 1 社保增 2社保减 3 医保增 4 医保减 unitCreditCode:单位统一信用代码
**/
@Override
public R<String> doExportRoster(String socialId, String type, String unitCreditCode) {
public R<String> doExportRoster(String socialId, String type, String unitCreditCode, List<SociaFriendYgsAddVo> listVo) {
SocialHandleSearchVo searchVo = new SocialHandleSearchVo();
if (Common.isEmpty(socialId) || Common.isEmpty(type) || Common.isEmpty(unitCreditCode)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
......@@ -530,7 +530,11 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
searchVo.setSyFlag(CommonConstants.ONE_STRING);
//税友特殊处理标识
searchVo.setSocialId(socialId);
List<String> socialIdList = new ArrayList<>();
for (SociaFriendYgsAddVo vo : listVo) {
socialIdList.add(vo.getSocialId());
}
searchVo.setSocialIdList(socialIdList);
String fileName = DispatchConstants.SOCIAL_MEDICAL_EXPORT + searchVo.getSocialHouseholdName() + "_" + socialId + CommonConstants.XLS;
String projectRoot = System.getProperty(CommonConstants.USER_DIR);
String filePath = projectRoot + CommonConstants.DOUBLE_LINE + fileName;
......
......@@ -2373,6 +2373,12 @@
<if test="tDispatchInfo.socialId != null and tDispatchInfo.socialId.trim() != ''">
AND a.SOCIAL_ID = #{tDispatchInfo.socialId}
</if>
<if test="tDispatchInfo.socialIdList != null and tDispatchInfo.socialIdList.size > 0 ">
AND a.SOCIAL_ID in
<foreach item="items" index="index" collection="tDispatchInfo.socialIdList" open="(" separator="," close=")">
#{items}
</foreach>
</if>
<if test="tDispatchInfo.syFlag != null and tDispatchInfo.syFlag.trim() == '1'">
AND a.STATUS = '2'
</if>
......
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