Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
4cc19266
You need to sign in or sign up before continuing.
Commit
4cc19266
authored
Jan 22, 2026
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.7.19-税友相关
parent
06398a3f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
517 additions
and
62 deletions
+517
-62
SocialFriendConfig.java
.../cloud/plus/v1/yifu/social/config/SocialFriendConfig.java
+479
-53
TSocialFriendMapper.java
...cloud/plus/v1/yifu/social/mapper/TSocialFriendMapper.java
+2
-0
TSocialFriendPushServiceImpl.java
...ifu/social/service/impl/TSocialFriendPushServiceImpl.java
+31
-9
TSocialFriendMapper.xml
...ial-biz/src/main/resources/mapper/TSocialFriendMapper.xml
+5
-0
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/config/SocialFriendConfig.java
View file @
4cc19266
...
...
@@ -92,7 +92,8 @@ public class SocialFriendConfig {
* @return: java.lang.String
**/
public
String
pushFriendByInfo
(
RestTemplate
restTemplate
,
SociaFriendYgsAddVo
vo
,
List
<
SociaFriendYgsAddVo
>
listVo
,
int
type
,
String
bizNo
,
List
<
TSocialFriendBackLog
>
backLogList
,
TSocialFriendBackLogService
tSocialFriendBackLogService
)
{
,
int
type
,
String
bizNo
,
List
<
TSocialFriendBackLog
>
backLogList
,
TSocialFriendBackLogService
tSocialFriendBackLogService
,
boolean
isHuiZhou
)
{
String
addId
=
""
;
String
appAddUrl
=
urlPre
;
if
(
type
==
1
||
type
==
3
)
{
...
...
@@ -121,6 +122,76 @@ public class SocialFriendConfig {
headers
.
add
(
VERSION
,
version
);
JSONObject
json
=
new
JSONObject
();
// 区分徽州区与其他地方,组装不同的参数格式:
if
(
isHuiZhou
)
{
this
.
getJsonObjectByHuiZhou
(
json
,
vo
,
listVo
,
type
,
bizNo
);
}
else
{
this
.
getJsonObjectByBase
(
json
,
vo
,
listVo
,
type
,
bizNo
);
}
HttpEntity
<
String
>
formEntity
=
new
HttpEntity
<>(
json
.
toString
(),
headers
);
// 推的json
TSocialFriendBackLog
backLogPush
=
new
TSocialFriendBackLog
();
backLogPush
.
setSocialId
(
vo
.
getSocialId
());
backLogPush
.
setType
(
5
);
backLogPush
.
setLogInfo
(
JSON
.
toJSONString
(
json
,
features
));
backLogPush
.
setCreateTime
(
LocalDateTime
.
now
());
backLogList
.
add
(
backLogPush
);
TSocialFriendBackLog
errorSave
=
new
TSocialFriendBackLog
();
errorSave
.
setSocialId
(
bizNo
);
errorSave
.
setType
(
20
);
errorSave
.
setLogInfo
(
JSON
.
toJSONString
(
json
,
features
));
errorSave
.
setCreateTime
(
LocalDateTime
.
now
());
tSocialFriendBackLogService
.
save
(
errorSave
);
String
dataResultList
=
restTemplate
.
postForObject
(
appAddUrl
,
formEntity
,
String
.
class
);
// {"head":{"code":"00000000","description":"成功","msg":"成功","time":"2024-12-06 17:10:26","status":"Y"
// ,"body":{"requestId":"85440b327d71466abcd9c5c81d5bb172"
if
(
Common
.
isNotNull
(
dataResultList
))
{
errorSave
.
setType
(
21
);
tSocialFriendBackLogService
.
updateById
(
errorSave
);
// 拉取的数据日志
TSocialFriendBackLog
backLog
=
new
TSocialFriendBackLog
();
StringBuilder
ids
=
new
StringBuilder
();
String
idTemp
;
for
(
SociaFriendYgsAddVo
tempVo
:
listVo
)
{
if
(
Common
.
isNotNull
(
tempVo
.
getEmpIdcard
()))
{
idTemp
=
tempVo
.
getEmpIdcard
();
}
else
if
(
Common
.
isNotNull
(
tempVo
.
getSocialId
()))
{
idTemp
=
tempVo
.
getSocialId
();
}
else
{
idTemp
=
vo
.
getSocialId
();
}
ids
.
append
(
idTemp
).
append
(
","
);
}
backLogPush
.
setSocialId
(
ids
.
toString
());
backLog
.
setSocialId
(
ids
.
toString
());
backLog
.
setType
(
type
);
backLog
.
setLogInfo
(
dataResultList
);
backLog
.
setCreateTime
(
LocalDateTime
.
now
());
JSONObject
dataObject
=
JSON
.
parseObject
(
dataResultList
);
String
head
=
dataObject
.
getString
(
"head"
);
if
(
Common
.
isNotNull
(
head
))
{
JSONObject
headObject
=
JSON
.
parseObject
(
head
);
String
status
=
headObject
.
getString
(
"status"
);
if
(
"Y"
.
equals
(
status
))
{
String
body
=
dataObject
.
getString
(
"body"
);
JSONObject
bodyObject
=
JSON
.
parseObject
(
body
);
addId
=
bodyObject
.
getString
(
"requestId"
);
backLog
.
setRequestId
(
addId
);
}
}
backLogList
.
add
(
backLog
);
}
return
addId
;
}
// 2组装安徽通用的所需要的json参数
private
void
getJsonObjectByBase
(
JSONObject
json
,
SociaFriendYgsAddVo
vo
,
List
<
SociaFriendYgsAddVo
>
listVo
,
int
type
,
String
bizNo
)
{
if
(
json
==
null
)
{
json
=
new
JSONObject
();
}
// 外部业务订单号
json
.
put
(
"bizNo"
,
bizNo
);
// 企业名称——户名
...
...
@@ -185,62 +256,98 @@ public class SocialFriendConfig {
json
.
put
(
fileName
,
qyzgshbxzyhmclbArr
);
}
}
}
HttpEntity
<
String
>
formEntity
=
new
HttpEntity
<>(
json
.
toString
(),
headers
);
// 推的json
TSocialFriendBackLog
backLogPush
=
new
TSocialFriendBackLog
();
backLogPush
.
setSocialId
(
vo
.
getSocialId
());
backLogPush
.
setType
(
5
);
backLogPush
.
setLogInfo
(
JSON
.
toJSONString
(
json
,
features
));
backLogPush
.
setCreateTime
(
LocalDateTime
.
now
());
backLogList
.
add
(
backLogPush
);
// 2组装徽州区所需要的json参数
private
void
getJsonObjectByHuiZhou
(
JSONObject
json
,
SociaFriendYgsAddVo
vo
,
List
<
SociaFriendYgsAddVo
>
listVo
,
int
type
,
String
bizNo
)
{
if
(
json
==
null
)
{
json
=
new
JSONObject
();
}
// 外部业务订单号
json
.
put
(
"bizNo"
,
bizNo
);
// 企业名称——户名
json
.
put
(
"qymc"
,
vo
.
getSocialHouseholdName
());
// 税号——户配置的“单位统一信用代码”
json
.
put
(
"nsrsbh"
,
vo
.
getUnitCreditCode
());
// 行政区划代码 户里的缴纳地,精确到市 "340100"
json
.
put
(
"areaid"
,
vo
.
getAreaCode
());
// 登记序号 - 徽州非必填(陈红给的表里是空的,不推送。)
TSocialFriendBackLog
errorSave
=
new
TSocialFriendBackLog
();
errorSave
.
setSocialId
(
bizNo
);
errorSave
.
setType
(
20
);
errorSave
.
setLogInfo
(
JSON
.
toJSONString
(
json
,
features
));
errorSave
.
setCreateTime
(
LocalDateTime
.
now
());
tSocialFriendBackLogService
.
save
(
errorSave
);
String
dataResultList
=
restTemplate
.
postForObject
(
appAddUrl
,
formEntity
,
String
.
class
);
// {"head":{"code":"00000000","description":"成功","msg":"成功","time":"2024-12-06 17:10:26","status":"Y"
// ,"body":{"requestId":"85440b327d71466abcd9c5c81d5bb172"
if
(
Common
.
isNotNull
(
dataResultList
))
{
errorSave
.
setType
(
21
);
tSocialFriendBackLogService
.
updateById
(
errorSave
);
// 拉取的数据日志
TSocialFriendBackLog
backLog
=
new
TSocialFriendBackLog
();
StringBuilder
ids
=
new
StringBuilder
();
String
idTemp
;
for
(
SociaFriendYgsAddVo
tempVo
:
listVo
)
{
if
(
Common
.
isNotNull
(
tempVo
.
getEmpIdcard
()))
{
idTemp
=
tempVo
.
getEmpIdcard
();
}
else
if
(
Common
.
isNotNull
(
tempVo
.
getSocialId
()))
{
idTemp
=
tempVo
.
getSocialId
();
JSONArray
ywblzhlbArr
=
new
JSONArray
();
if
(
type
<
3
)
{
JSONObject
jsonYwblzhlbYgs
=
new
JSONObject
();
// 密码
jsonYwblzhlbYgs
.
put
(
"mm"
,
vo
.
getSocialPassword
());
// 办理项目 例如社保、医保等
jsonYwblzhlbYgs
.
put
(
"blxm"
,
"社保"
);
// 单位编号
jsonYwblzhlbYgs
.
put
(
"dwbh"
,
vo
.
getCustomerNo
());
// 账号
jsonYwblzhlbYgs
.
put
(
"zh"
,
vo
.
getSocialAccount
());
// 密码类型:安徽社保医保都是4:
jsonYwblzhlbYgs
.
put
(
"mmlx"
,
"4"
);
ywblzhlbArr
.
add
(
jsonYwblzhlbYgs
);
}
else
{
idTemp
=
vo
.
getSocialId
();
JSONObject
jsonYwblzhlbYsd
=
new
JSONObject
();
jsonYwblzhlbYsd
.
put
(
"mm"
,
vo
.
getMediclPassword
());
jsonYwblzhlbYsd
.
put
(
"blxm"
,
"医保"
);
//jsonYwblzhlbYsd.put("dwbh", "34010000000000333471")
jsonYwblzhlbYsd
.
put
(
"dwbh"
,
vo
.
getCustomerNoYsd
());
jsonYwblzhlbYsd
.
put
(
"zh"
,
vo
.
getMediclAccount
());
jsonYwblzhlbYsd
.
put
(
"mmlx"
,
"4"
);
ywblzhlbArr
.
add
(
jsonYwblzhlbYsd
);
}
ids
.
append
(
idTemp
).
append
(
","
);
json
.
put
(
"ywblzhlb"
,
ywblzhlbArr
);
// type 1社保增 2社保减 3医保增 4医保减
setEmpInfoForHuiZhou
(
json
,
listVo
,
type
,
vo
.
getQyzgjbylbxcbdjb
());
// 企业职工社会保险增员花名册列表
String
fileName
=
"qyzgshbxzyhmclb"
;
if
(
type
==
2
||
type
==
4
)
{
// 职工社会保险减少花名册
fileName
=
"zgshbxjshmc"
;
if
(
Common
.
isNotNull
(
vo
.
getQyzgshbxzyhmc
()))
{
json
.
put
(
fileName
,
vo
.
getQyzgshbxzyhmc
());
}
else
if
(
Common
.
isNotNull
(
vo
.
getQyzgjbylbxcbdjb
()))
{
json
.
put
(
fileName
,
vo
.
getQyzgjbylbxcbdjb
());
}
backLogPush
.
setSocialId
(
ids
.
toString
());
backLog
.
setSocialId
(
ids
.
toString
());
backLog
.
setType
(
type
);
backLog
.
setLogInfo
(
dataResultList
);
backLog
.
setCreateTime
(
LocalDateTime
.
now
());
JSONObject
dataObject
=
JSON
.
parseObject
(
dataResultList
);
String
head
=
dataObject
.
getString
(
"head"
);
if
(
Common
.
isNotNull
(
head
))
{
JSONObject
headObject
=
JSON
.
parseObject
(
head
);
String
status
=
headObject
.
getString
(
"status"
);
if
(
"Y"
.
equals
(
status
))
{
String
body
=
dataObject
.
getString
(
"body"
);
JSONObject
bodyObject
=
JSON
.
parseObject
(
body
);
addId
=
bodyObject
.
getString
(
"requestId"
);
backLog
.
setRequestId
(
addId
);
}
else
{
JSONArray
qyzgshbxzyhmclbArr
=
new
JSONArray
();
if
(
Common
.
isNotNull
(
vo
.
getQyzgshbxzyhmc
()))
{
qyzgshbxzyhmclbArr
.
add
(
vo
.
getQyzgshbxzyhmc
());
}
else
if
(
Common
.
isNotNull
(
vo
.
getQyzgjbylbxcbdjb
()))
{
qyzgshbxzyhmclbArr
.
add
(
vo
.
getQyzgjbylbxcbdjb
());
}
if
(
type
<
3
&&
vo
.
getImgListYgs
()
!=
null
&&
!
vo
.
getImgListYgs
().
isEmpty
())
{
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr
.
addAll
(
vo
.
getImgListYgs
());
}
if
(
type
>
2
&&
vo
.
getImgListYsd
()
!=
null
&&
!
vo
.
getImgListYsd
().
isEmpty
())
{
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr
.
addAll
(
vo
.
getImgListYsd
());
}
if
(!
qyzgshbxzyhmclbArr
.
isEmpty
())
{
json
.
put
(
fileName
,
qyzgshbxzyhmclbArr
);
}
backLogList
.
add
(
backLog
);
}
return
addId
;
}
/**
* @param json 总传参json
* @param type 1社保增 2社保减 3医保增 4医保减
* @Description: 徽州地区参保人员信息设置
* @Author: hgw
* @Date: 2025/01/20 10:24
* @return: void
**/
private
void
setEmpInfoForHuiZhou
(
JSONObject
json
,
List
<
SociaFriendYgsAddVo
>
listVo
,
int
type
,
String
qyzgjbylbxcbdjb
)
{
if
(
type
==
1
||
type
==
3
)
{
setEmpInfoAddByHuiZhou
(
json
,
listVo
,
type
,
qyzgjbylbxcbdjb
);
}
else
{
setEmpInfoReduceByHuiZhou
(
json
,
listVo
,
type
,
qyzgjbylbxcbdjb
);
}
}
/**
...
...
@@ -515,6 +622,219 @@ public class SocialFriendConfig {
json
.
put
(
buyType
,
cbrymdArr
);
}
/**
* @param json 主json存数据
* @Description: 塞人员名单-1社保增
* @Author: hgw
* @Date: 2024/12/10 18:05
* @return: void
**/
private
void
setEmpInfoAddByHuiZhou
(
JSONObject
json
,
List
<
SociaFriendYgsAddVo
>
listVo
,
int
type
,
String
qyzgjbylbxcbdjb
)
{
// 参保人员名单 数组
JSONArray
cbrymdArr
=
new
JSONArray
();
JSONObject
cbrymdOne
;
String
gj
=
"中国"
;
String
areaName
=
"安徽省|黄山市|徽州区|徽州区徽州街道|徽州街道文峰社区"
;
String
hkxz
=
"本地居民户口"
;
JSONObject
jyxx
;
String
startDate
;
JSONArray
blxmlbArr
;
JSONObject
blxmlbOne
;
String
blxm
=
"社保"
;
// 险种类型 例如养老、工伤、医疗等
String
xzlb
;
if
(
type
>
2
)
{
blxm
=
"医保"
;
}
JSONObject
tszdxx
;
// 企业职工基本医疗保险参保登记表 安徽非必填! 数组
String
[]
arr
=
{
qyzgjbylbxcbdjb
};
JSONArray
ybzyclArr
;
// 2025-3-14 15:44:32 单个改造为批量
for
(
SociaFriendYgsAddVo
vo
:
listVo
)
{
cbrymdOne
=
new
JSONObject
();
// 姓名
cbrymdOne
.
put
(
"xm"
,
vo
.
getEmpName
());
// 证件类型
cbrymdOne
.
put
(
"zzlx"
,
"居民身份证"
);
// 证件号码"828888200908213819"
cbrymdOne
.
put
(
"zzhm"
,
vo
.
getEmpIdcard
());
// 国籍(地区) "中国"
cbrymdOne
.
put
(
"gj"
,
gj
);
// 性别
cbrymdOne
.
put
(
"xb"
,
getSexName
(
vo
.
getEmpIdcard
()));
// 出生日期
cbrymdOne
.
put
(
"csrq"
,
getBirthStr
(
vo
.
getEmpIdcard
()));
// 民族 空的默认汉族
cbrymdOne
.
put
(
"mz"
,
vo
.
getEmpNational
());
// 手机号码
cbrymdOne
.
put
(
"sjhm"
,
vo
.
getEmpMobile
());
// 户口地所在行政区
cbrymdOne
.
put
(
"hkszdxzq"
,
areaName
);
// 户口所在地地址
cbrymdOne
.
put
(
"hkszddz"
,
areaName
);
// 户口性质
//cbrymdOne.put("hkxz", "居民户口(含农业户口、非农业户口)")
cbrymdOne
.
put
(
"hkxz"
,
hkxz
);
// 居住地址
cbrymdOne
.
put
(
"jzdz"
,
areaName
);
// 居住地行政区
cbrymdOne
.
put
(
"jzdzxzq"
,
areaName
);
// 社保起缴日期(养老起缴)yyyy-MM-dd
startDate
=
vo
.
getSocialStartDate
();
// 参加工作日期
cbrymdOne
.
put
(
"cjgzrq"
,
startDate
);
// 文化程度 见字典“受教育程度” 空的默认“大学专科”
//cbrymdOne.put("whcd", "大学专科")
cbrymdOne
.
put
(
"whcd"
,
vo
.
getEducationName
());
// 办理项目列表
blxmlbArr
=
new
JSONArray
();
blxmlbOne
=
new
JSONObject
();
// 险种类型 例如养老、工伤、医疗等
xzlb
=
"企业职工养老,工伤保险,失业保险"
;
if
(
type
>
2
)
{
xzlb
=
null
;
// 2025-12-8 10:30:50 mvp1.7.18-shuiyou分支,
// 改为按单位+个人金额来判断是否需要这个险种,本次只改医疗+大病,生育没有个人金额,养工失没有浮动
// ,同全服福保专员陈红确认
if
(
Common
.
isNotNull
(
vo
.
getUnitMedicalMoney
())
&&
CommonConstants
.
ONE_INTEGER
.
equals
(
vo
.
getUnitMedicalMoney
()))
{
xzlb
=
"职工基本医疗保险"
;
}
if
(
Common
.
isNotNull
(
vo
.
getUnitBirthMoney
())
&&
CommonConstants
.
ONE_INTEGER
.
equals
(
vo
.
getUnitBirthMoney
()))
{
if
(
Common
.
isNotNull
(
xzlb
))
{
xzlb
+=
",生育保险"
;
}
else
{
xzlb
=
"生育保险"
;
}
}
if
(
Common
.
isNotNull
(
vo
.
getUnitBigailmentMoney
())
&&
CommonConstants
.
ONE_INTEGER
.
equals
(
vo
.
getUnitBigailmentMoney
()))
{
if
(
Common
.
isNotNull
(
xzlb
))
{
xzlb
+=
",大额医疗"
;
}
else
{
xzlb
=
"大额医疗"
;
}
}
}
// 办理项目
blxmlbOne
.
put
(
"blxm"
,
blxm
);
// 本次参保日期 格式:yyyy-MM-dd
blxmlbOne
.
put
(
"bccbrq"
,
startDate
);
// 申报工资 社保派单里的“备案基数”
blxmlbOne
.
put
(
"sbgz"
,
vo
.
getRecordBase
());
// 险种类型 例如养老、工伤、医疗等
if
(
Common
.
isNotNull
(
xzlb
))
{
blxmlbOne
.
put
(
"xzlb"
,
xzlb
.
split
(
","
));
}
blxmlbArr
.
add
(
blxmlbOne
);
cbrymdOne
.
put
(
"blxmlb"
,
blxmlbArr
);
// 特色字段信息
tszdxx
=
new
JSONObject
();
// bzlx编制类型 - 非必填,默认非在编(陈红给的表里是空的,不推送。)
// 徽州新字段:是否同步办理用工备案 - 非必填,默认是
tszdxx
.
put
(
"sftbblygba"
,
"是"
);
// sfsjgb是否是机关保 - 非必填,默认否(陈红给的表里是空的,不推送。)
// 徽州新字段:sbjbqy社保经办区域 - 社保必填
tszdxx
.
put
(
"sbjbqy"
,
"安徽省|黄山市|徽州区"
);
// 徽州新字段:htqdlb合同签订类别 - 社保必填
tszdxx
.
put
(
"htqdlb"
,
"新签"
);
// 参保模式 新参、续参
tszdxx
.
put
(
"cbms"
,
"续参"
);
// 增员年月 社保必填;yyyyMM 社保起缴日期(养老起缴)到月
tszdxx
.
put
(
"zyny"
,
vo
.
getSocialStartMonth
());
// 同步办理用工劳动备案 社保必填;是
tszdxx
.
put
(
"tbblygldhtba"
,
"是"
);
// 就业登记时间 社保必填;yyyy-MM-dd
tszdxx
.
put
(
"jydjsj"
,
startDate
);
// 单位就业起始时间 社保必填;yyyy-MM-dd
tszdxx
.
put
(
"dwjyqssj"
,
startDate
);
// 安徽非必填!社保个人身份材料 取文件上传后获取的文件路径。图片总大小不超过1M, 材料仅支持图片格式,支持上传jpeg/jpg/png格式。
if
(
vo
.
getImgListYgs
()
!=
null
&&
!
vo
.
getImgListYgs
().
isEmpty
())
{
// 税友接口只允许一张
tszdxx
.
put
(
"sbzycl"
,
vo
.
getImgListYgs
().
get
(
0
));
}
// 用工形式 社保必填 // 盛宇文档对应,只有3种
tszdxx
.
put
(
"ygxs"
,
vo
.
getContractType
());
// 劳动合同签署情况 社保必填 默认"初签"
tszdxx
.
put
(
"ldhtqsqk"
,
"初签"
);
// 人员类型 默认:在职职工
tszdxx
.
put
(
"rylx"
,
"在职职工"
);
// 医保个人身份材料 安徽非必填! 无
if
(
vo
.
getImgListYsd
()
!=
null
&&
!
vo
.
getImgListYsd
().
isEmpty
())
{
ybzyclArr
=
new
JSONArray
();
ybzyclArr
.
addAll
(
vo
.
getImgListYsd
());
tszdxx
.
put
(
"ybzycl"
,
ybzyclArr
);
}
// 职业工种 社保必填 默认“办事人员和有关人员”
tszdxx
.
put
(
"zygz"
,
"办事人员和有关人员"
);
// 人员身份 个人身份 社保必填 默认“职员”
tszdxx
.
put
(
"grsf"
,
"职员"
);
// 工作时间制度 社保必填
tszdxx
.
put
(
"gzsjzd"
,
vo
.
getWorkingHours
());
// 医保用工形式 医保新参必填 默认“原固定职工”
tszdxx
.
put
(
"ybygxs"
,
"原固定职工"
);
// 毕业院校
tszdxx
.
put
(
"byyx"
,
vo
.
getByyx
());
if
(
type
<
3
)
{
// 企业职工社会保险增员花名册 安徽非必填!
// 社保增员必填
tszdxx
.
put
(
"qyzgshbxzyhmc"
,
vo
.
getQyzgshbxzyhmc
());
// 社保是否批量——徽州区目前无社保批量
/*if (Common.isNotNull(vo.getIsSingleYgsPush()) && CommonConstants.ONE_STRING.equals(vo.getIsSingleYgsPush())) {
tszdxx.put("sfpl", "否");
}*/
}
else
{
if
(
Common
.
isNotNull
(
vo
.
getYbsfqzcb
()))
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
vo
.
getYbsfqzcb
()))
{
tszdxx
.
put
(
"ybsfqzcb"
,
"是"
);
}
else
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getYbsfqzcb
()))
{
tszdxx
.
put
(
"ybsfqzcb"
,
"否"
);
}
}
// 增员、减员必填
tszdxx
.
put
(
"qyzgjbylbxcbdjb"
,
arr
);
// 医保是否批量
if
(
Common
.
isNotNull
(
vo
.
getIsSingleYsdPush
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
vo
.
getIsSingleYsdPush
()))
{
tszdxx
.
put
(
"ybsfpl"
,
"否"
);
}
else
{
tszdxx
.
put
(
"ybsfpl"
,
"是"
);
}
}
cbrymdOne
.
put
(
"tszdxx"
,
tszdxx
);
// 就业信息 社保必填;
jyxx
=
new
JSONObject
();
// 劳动合同类型
jyxx
.
put
(
"ldhtlx"
,
vo
.
getContractTypeTwo
());
// 劳动合同起始日期
jyxx
.
put
(
"ldhtqsrq"
,
startDate
);
// 劳动合同截止日期 派单里的“合同截止日期”
jyxx
.
put
(
"ldhtjzrq"
,
vo
.
getContractEnd
());
cbrymdOne
.
put
(
"jyxx"
,
jyxx
);
cbrymdArr
.
add
(
cbrymdOne
);
}
// 人员名单
String
buyType
=
"cbrymd"
;
json
.
put
(
buyType
,
cbrymdArr
);
}
/**
* @param json 主json存数据
* @Description: 塞人员名单-2社保减
...
...
@@ -523,7 +843,6 @@ public class SocialFriendConfig {
* @return: void
**/
private
void
setEmpInfoReduce
(
JSONObject
json
,
List
<
SociaFriendYgsAddVo
>
listVo
,
int
type
,
String
qyzgjbylbxcbdjb
)
{
// 参保人员名单 数组
// 参保人员名单 数组
JSONArray
cbrymdArr
=
new
JSONArray
();
JSONObject
cbrymdOne
;
...
...
@@ -621,6 +940,113 @@ public class SocialFriendConfig {
json
.
put
(
buyType
,
cbrymdArr
);
}
/**
* @param json 主json存数据
* @Description: 塞人员名单-2社保减
* @Author: hgw
* @Date: 2024/12/10 18:05
* @return: void
**/
private
void
setEmpInfoReduceByHuiZhou
(
JSONObject
json
,
List
<
SociaFriendYgsAddVo
>
listVo
,
int
type
,
String
qyzgjbylbxcbdjb
)
{
// 参保人员名单 数组
JSONArray
cbrymdArr
=
new
JSONArray
();
JSONObject
cbrymdOne
;
JSONArray
blxmlbArr
;
JSONObject
blxmlbOne
;
JSONObject
tszdxx
;
String
blxm
=
"社保"
;
String
[]
arr
=
{
qyzgjbylbxcbdjb
};
JSONArray
ybjyclArr
;
if
(
type
>
2
)
{
blxm
=
"医保"
;
}
// 2025-3-14 15:44:32 单个改造为批量
for
(
SociaFriendYgsAddVo
vo
:
listVo
)
{
cbrymdOne
=
new
JSONObject
();
// 姓名
cbrymdOne
.
put
(
"xm"
,
vo
.
getEmpName
());
// 证件类型
cbrymdOne
.
put
(
"zzlx"
,
"居民身份证"
);
// 证件号码"828888200908213819"
cbrymdOne
.
put
(
"zzhm"
,
vo
.
getEmpIdcard
());
// 办理项目列表
blxmlbArr
=
new
JSONArray
();
blxmlbOne
=
new
JSONObject
();
// 办理项目
blxmlbOne
.
put
(
"blxm"
,
blxm
);
// 中断原因 除死亡以外,其他停保原因默认:“在职人员解除/终止劳动合同” 死亡对应“死亡或失踪”
// 2025-4-14 16:03:54 陈红提的:tbyy 、 zzyy 、 bajcejyy 改为按t_social_friend_reduce_set配置来
blxmlbOne
.
put
(
"tbyy"
,
vo
.
getTbyy
());
// 中断时间 yyyy-MM-dd 默认当前时间
blxmlbOne
.
put
(
"tbsj"
,
DateUtil
.
getLastDay
());
blxmlbArr
.
add
(
blxmlbOne
);
cbrymdOne
.
put
(
"blxmlb"
,
blxmlbArr
);
// 特色字段信息
tszdxx
=
new
JSONObject
();
// 劳动用工备案解除/终止原因 数据字典文档 法律依据 [社保]必填;
tszdxx
.
put
(
"zzyy"
,
vo
.
getZzyy
());
tszdxx
.
put
(
"bajcejyy"
,
vo
.
getBajcejyy
());
// 社保个人身份材料 无
// tszdxx.put("shjycl", )
// 医保个人身份材料 无
// tszdxx.put("ybjycl", )
// 职工社会保险减少花名册 无
// tszdxx.put("zgshbxjshmc", )
if
(
type
>
2
)
{
// 职工基本医疗保险参保登记表
tszdxx
.
put
(
"zgjbylbxcbdjb"
,
arr
);
ybjyclArr
=
new
JSONArray
();
if
(
Common
.
isNotNull
(
vo
.
getAutoLeaveDoc
()))
{
ybjyclArr
.
add
(
vo
.
getAutoLeaveDoc
());
}
if
(
vo
.
getImgListYsd
()
!=
null
&&
!
vo
.
getImgListYsd
().
isEmpty
())
{
ybjyclArr
.
addAll
(
vo
.
getImgListYsd
());
}
tszdxx
.
put
(
"ybjycl"
,
ybjyclArr
);
if
(
type
==
4
&&
"死亡"
.
equals
(
vo
.
getTbyy
()))
{
// 生存状态变更类型
tszdxx
.
put
(
"scztbglx"
,
"死亡"
);
// 生存状态变更原因
tszdxx
.
put
(
"scztbgyy"
,
"死亡"
);
// 入狱/失踪/死亡日期 yyyy-MM-dd
tszdxx
.
put
(
"ryszswrq"
,
vo
.
getLeaveDay
());
}
// 医保是否批量
if
(
Common
.
isNotNull
(
vo
.
getIsSingleYsdPush
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
vo
.
getIsSingleYsdPush
()))
{
tszdxx
.
put
(
"ybsfpl"
,
"否"
);
}
else
{
tszdxx
.
put
(
"ybsfpl"
,
"是"
);
}
}
else
{
// 是否强制停保:目前仅社保,税友暂不支持医保
if
(
Common
.
isNotNull
(
vo
.
getSfqztb
())
&&
"是"
.
equals
(
vo
.
getSfqztb
()))
{
tszdxx
.
put
(
"sfqztb"
,
vo
.
getSfqztb
());
}
if
(
Common
.
isNotNull
(
vo
.
getAutoLeaveDoc
()))
{
tszdxx
.
put
(
"shjycl"
,
vo
.
getAutoLeaveDoc
());
}
else
{
if
(
vo
.
getImgListYgs
()
!=
null
&&
!
vo
.
getImgListYgs
().
isEmpty
())
{
// 税友接口只允许一张
tszdxx
.
put
(
"shjycl"
,
vo
.
getImgListYgs
().
get
(
0
));
}
}
// 社保是否批量——徽州区目前无社保批量
/*if (Common.isNotNull(vo.getIsSingleYgsPush()) && CommonConstants.ONE_STRING.equals(vo.getIsSingleYgsPush())) {
tszdxx.put("sfpl", "否");
}*/
}
cbrymdOne
.
put
(
"tszdxx"
,
tszdxx
);
cbrymdArr
.
add
(
cbrymdOne
);
}
// 人员名单
String
buyType
=
"tbrymd"
;
json
.
put
(
buyType
,
cbrymdArr
);
}
// 测试税友线上信息,慎用
public
String
getFriendByRequestIdOnlineTest
(
RestTemplate
restTemplate
,
String
requestId
,
String
type
)
{
if
(
Common
.
isEmpty
(
requestId
))
{
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/mapper/TSocialFriendMapper.java
View file @
4cc19266
...
...
@@ -70,5 +70,7 @@ public interface TSocialFriendMapper extends BaseMapper<TSocialInfo> {
,
@Param
(
"isAuto"
)
Integer
isAuto
,
@Param
(
"userId"
)
String
userId
);
// 当前徽州区的户名配置表,后续可扩展类型,存其他对应表
List
<
String
>
getSpecialHuName
();
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialFriendPushServiceImpl.java
View file @
4cc19266
...
...
@@ -137,6 +137,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
Map
<
String
,
TSocialFriendReduceSet
>
reduceYgsMap
=
tSocialFriendReduceSetService
.
getFriendReduceMap
(
CommonConstants
.
ONE_STRING
);
Map
<
String
,
TSocialFriendReduceSet
>
reduceYsdMap
=
tSocialFriendReduceSetService
.
getFriendReduceMap
(
CommonConstants
.
TWO_STRING
);
Map
<
String
,
TSocialFriendReduceSet
>
reduceChiZhouMap
=
tSocialFriendReduceSetService
.
getFriendReduceMap
(
CommonConstants
.
THREE_STRING
);
Map
<
String
,
Integer
>
huiZhouMap
=
this
.
getSpecialHuNameMap
();
// 获取时间限制配置(获取 当月启用 的配置)
Map
<
String
,
TSocialDeadlineInfo
>
socialSetMap
=
tSocialDeadlineInfoService
.
getSocialSetByAreaId
();
...
...
@@ -160,24 +161,24 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 养工失新增列表
List
<
SociaFriendYgsAddVo
>
ygsAddlist
=
baseMapper
.
getSocialSoldierYgsAddVoList
(
dispatchIdList
,
pushDispatchIdList
,
isAuto
,
userId
);
if
(
ygsAddlist
!=
null
&&
!
ygsAddlist
.
isEmpty
())
{
this
.
doPushSocialAndLogYgs
(
socialSetMap
,
ygsAddlist
,
1
,
reduceYgsMap
,
zhangMap
,
templateUrl
,
templateSrcMap
,
reduceChiZhouMap
);
this
.
doPushSocialAndLogYgs
(
socialSetMap
,
ygsAddlist
,
1
,
reduceYgsMap
,
zhangMap
,
templateUrl
,
templateSrcMap
,
reduceChiZhouMap
,
huiZhouMap
);
}
// 养工失减少列表
List
<
SociaFriendYgsAddVo
>
ygsReducelist
=
baseMapper
.
getSocialSoldierYgsReduceVoList
(
dispatchIdList
,
pushDispatchIdList
,
isAuto
,
userId
);
if
(
ygsReducelist
!=
null
&&
!
ygsReducelist
.
isEmpty
())
{
this
.
doPushSocialAndLogYgs
(
socialSetMap
,
ygsReducelist
,
2
,
reduceYgsMap
,
zhangMap
,
templateUrl
,
templateSrcMap
,
reduceChiZhouMap
);
this
.
doPushSocialAndLogYgs
(
socialSetMap
,
ygsReducelist
,
2
,
reduceYgsMap
,
zhangMap
,
templateUrl
,
templateSrcMap
,
reduceChiZhouMap
,
huiZhouMap
);
}
// 医生大新增列表
List
<
SociaFriendYgsAddVo
>
ysdAddlist
=
baseMapper
.
getSocialSoldierYsdAddVoList
(
dispatchIdList
,
pushDispatchIdList
,
isAuto
,
userId
);
if
(
ysdAddlist
!=
null
&&
!
ysdAddlist
.
isEmpty
())
{
this
.
doPushSocialAndLogYsd
(
socialSetMap
,
ysdAddlist
,
3
,
reduceYsdMap
,
zhangMap
,
templateUrl
,
templateSrcMap
,
reduceChiZhouMap
);
this
.
doPushSocialAndLogYsd
(
socialSetMap
,
ysdAddlist
,
3
,
reduceYsdMap
,
zhangMap
,
templateUrl
,
templateSrcMap
,
reduceChiZhouMap
,
huiZhouMap
);
}
// 医生大减少列表
List
<
SociaFriendYgsAddVo
>
ysdReducelist
=
baseMapper
.
getSocialSoldierYsdReduceVoList
(
dispatchIdList
,
pushDispatchIdList
,
isAuto
,
userId
);
if
(
ysdReducelist
!=
null
&&
!
ysdReducelist
.
isEmpty
())
{
this
.
doPushSocialAndLogYsd
(
socialSetMap
,
ysdReducelist
,
4
,
reduceYsdMap
,
zhangMap
,
templateUrl
,
templateSrcMap
,
reduceChiZhouMap
);
this
.
doPushSocialAndLogYsd
(
socialSetMap
,
ysdReducelist
,
4
,
reduceYsdMap
,
zhangMap
,
templateUrl
,
templateSrcMap
,
reduceChiZhouMap
,
huiZhouMap
);
}
if
((
ygsAddlist
==
null
||
ygsAddlist
.
isEmpty
())
&&
(
ygsReducelist
==
null
||
ygsReducelist
.
isEmpty
())
...
...
@@ -197,6 +198,18 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
}
}
// 获取特殊的户名称,当前给 徽州区 使用,徽州区需要走不同的分支
private
Map
<
String
,
Integer
>
getSpecialHuNameMap
()
{
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
List
<
String
>
list
=
baseMapper
.
getSpecialHuName
();
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
for
(
String
s
:
list
)
{
map
.
put
(
s
,
CommonConstants
.
ONE_INT
);
}
}
return
map
;
}
/**
* @Description: 推送社保和记录日志
* @Author: hgw
...
...
@@ -206,7 +219,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
private
R
<
String
>
doPushSocialAndLogYgs
(
Map
<
String
,
TSocialDeadlineInfo
>
socialSetMap
,
List
<
SociaFriendYgsAddVo
>
ygsAddlist
,
int
type
,
Map
<
String
,
TSocialFriendReduceSet
>
reduceMap
,
Map
<
String
,
URL
>
zhangMap
,
URL
templateUrl
,
Map
<
String
,
URL
>
templateSrcMap
,
Map
<
String
,
TSocialFriendReduceSet
>
reduceChiZhouMap
)
{
,
Map
<
String
,
TSocialFriendReduceSet
>
reduceChiZhouMap
,
Map
<
String
,
Integer
>
huiZhouMap
)
{
int
canPushType
;
TSocialInfo
socialInfo
;
String
typeStr
=
"提交"
;
...
...
@@ -241,6 +254,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 社保仅补缴生成材料 0否1是
boolean
dataFlagYgs
;
int
nowMonth
=
Integer
.
parseInt
(
DateUtil
.
getThisMonth
());
// 如果是徽州区的社保,要单个推送,且走新分支
boolean
isHuiZhou
;
for
(
int
index
=
0
;
index
<
ygsAddlist
.
size
();
index
++)
{
vo
=
ygsAddlist
.
get
(
index
);
// 派减离职原因转化:
...
...
@@ -310,7 +325,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
isSingle
=
Common
.
isNotNull
(
vo
.
getIsSingle
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
vo
.
getIsSingle
());
isAutoLeaveDoc
=
templateUrl
!=
null
&&
type
==
2
&&
Common
.
isNotNull
(
vo
.
getIsAutoLeaveDoc
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
vo
.
getIsAutoLeaveDoc
());
if
(
isAutoLeaveDoc
||
isSingle
||
nextFlag
||
i
%
10
==
0
||
index
>=
ygsAddlist
.
size
()-
1
)
{
isHuiZhou
=
huiZhouMap
.
get
(
vo
.
getSocialHouseholdName
())
!=
null
;
if
(
isHuiZhou
||
isAutoLeaveDoc
||
isSingle
||
nextFlag
||
i
%
10
==
0
||
index
>=
ygsAddlist
.
size
()-
1
)
{
rosterAutoFlagYgs
=
Common
.
isEmpty
(
vo
.
getRosterAutoFlagYgs
())
||
CommonConstants
.
ONE_STRING
.
equals
(
vo
.
getRosterAutoFlagYgs
());
if
(
rosterAutoFlagYgs
&&
!
huaListVo
.
isEmpty
())
{
...
...
@@ -338,7 +354,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 针对部分传参bizNo却无requestId返回的情况,需要改进代码:
bizNo
=
vo
.
getSocialId
()
+
type
+
thisTime
;
requestId
=
socialFriendConfig
.
pushFriendByInfo
(
restTemplate
,
vo
,
listVo
,
type
,
bizNo
,
backLogList
,
tSocialFriendBackLogService
);
requestId
=
socialFriendConfig
.
pushFriendByInfo
(
restTemplate
,
vo
,
listVo
,
type
,
bizNo
,
backLogList
,
tSocialFriendBackLogService
,
isHuiZhou
);
ygsHandleStatus
=
CommonConstants
.
TWO_STRING
;
remark
=
"已推送提交任务!"
;
if
(
Common
.
isEmpty
(
requestId
))
{
...
...
@@ -506,7 +523,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
private
void
doPushSocialAndLogYsd
(
Map
<
String
,
TSocialDeadlineInfo
>
socialSetMap
,
List
<
SociaFriendYgsAddVo
>
ysdAddlist
,
int
type
,
Map
<
String
,
TSocialFriendReduceSet
>
reduceMap
,
Map
<
String
,
URL
>
zhangMap
,
URL
templateUrl
,
Map
<
String
,
URL
>
templateSrcMap
,
Map
<
String
,
TSocialFriendReduceSet
>
reduceChiZhouMap
)
{
,
Map
<
String
,
TSocialFriendReduceSet
>
reduceChiZhouMap
,
Map
<
String
,
Integer
>
huiZhouMap
)
{
int
canPushType
;
TSocialInfo
socialInfo
;
String
typeStr
=
"提交"
;
...
...
@@ -542,6 +559,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 社保仅补缴生成材料 0否1是
boolean
dataFlagYsd
;
int
nowMonth
=
Integer
.
parseInt
(
DateUtil
.
getThisMonth
());
// 如果是徽州区的医保,可以批量推送,且走新分支
boolean
isHuiZhou
;
for
(
int
index
=
0
;
index
<
ysdAddlist
.
size
();
index
++)
{
vo
=
ysdAddlist
.
get
(
index
);
...
...
@@ -624,6 +643,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
isAutoLeaveDoc
=
templateUrl
!=
null
&&
type
==
4
&&
Common
.
isNotNull
(
vo
.
getIsAutoLeaveDoc
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
vo
.
getIsAutoLeaveDoc
());
// 徽州区的医保可以批量
isHuiZhou
=
huiZhouMap
.
get
(
vo
.
getSocialHouseholdName
())
!=
null
;
if
(
isAutoLeaveDoc
||
isSingle
||
nextFlag
||
i
%
10
==
0
||
index
>=
ysdAddlist
.
size
()-
1
)
{
rosterAutoFlagYsd
=
Common
.
isEmpty
(
vo
.
getRosterAutoFlagYsd
())
||
CommonConstants
.
ONE_STRING
.
equals
(
vo
.
getRosterAutoFlagYsd
());
...
...
@@ -649,7 +670,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
nextFlag
=
false
;
// 针对部分无requestId返回的情况,优化代码
bizNo
=
vo
.
getSocialId
()
+
type
+
thisTime
;
requestId
=
socialFriendConfig
.
pushFriendByInfo
(
restTemplate
,
vo
,
listVo
,
type
,
bizNo
,
backLogList
,
tSocialFriendBackLogService
);
requestId
=
socialFriendConfig
.
pushFriendByInfo
(
restTemplate
,
vo
,
listVo
,
type
,
bizNo
,
backLogList
,
tSocialFriendBackLogService
,
isHuiZhou
);
ysdHandleStatus
=
CommonConstants
.
TWO_STRING
;
remark
=
"已推送提交任务!"
;
if
(
Common
.
isEmpty
(
requestId
))
{
...
...
yifu-social/yifu-social-biz/src/main/resources/mapper/TSocialFriendMapper.xml
View file @
4cc19266
...
...
@@ -377,4 +377,9 @@
order by a.SOCIAL_HOUSEHOLD_NAME asc
</select>
<!-- 查找特殊的户名关系表,当前为 徽州区 的户名称 使用 -->
<select
id=
"getSpecialHuName"
resultType=
"java.lang.String"
>
select a.hu_name from t_social_friend_special_hu a where a.type ='1'
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment