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
0d2e617e
Commit
0d2e617e
authored
Jul 07, 2025
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.12-测试瓜子接口
parent
c426ddf2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
240 additions
and
7 deletions
+240
-7
GzConfig.java
...com/yifu/cloud/plus/v1/yifu/archives/config/GzConfig.java
+122
-2
TGzController.java
...cloud/plus/v1/yifu/archives/controller/TGzController.java
+117
-4
GZSign.java
...va/com/yifu/cloud/plus/v1/yifu/archives/utils/GZSign.java
+1
-1
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/config/GzConfig.java
View file @
0d2e617e
...
...
@@ -4,6 +4,9 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.gson.Gson
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContactInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -14,9 +17,11 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -76,10 +81,125 @@ public class GzConfig {
return
false
;
}
public
boolean
updateGzOfferStatus
(
RestTemplate
restTemplate
,
Map
<
String
,
Object
>
params
)
{
String
gzBankUrl
=
appUrl
+
"/eim-hr-induction/api/hr/induction/open/offer/update-status
"
;
public
boolean
updateGzOfferStatus
(
RestTemplate
restTemplate
,
Map
<
String
,
Object
>
params
,
String
sortedParams
)
{
String
gzBankUrl
=
appUrl
+
"/eim-hr-induction/api/hr/induction/open/offer/update-status
?"
+
sortedParams
;
// 创建请求头并添加Authorization
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
headers
.
setContentType
(
type
);
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
headers
.
set
(
"Authorization"
,
"00000000"
);
// 设置Authorization头
Gson
gson
=
new
Gson
();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity
<
String
>
entity
=
new
HttpEntity
<>(
gson
.
toJson
(
params
),
headers
);
// 发送GET请求
String
result
=
restTemplate
.
exchange
(
gzBankUrl
,
HttpMethod
.
POST
,
entity
,
String
.
class
).
getBody
();
System
.
out
.
println
(
result
);
if
(
result
!=
null
&&
result
.
contains
(
"code"
)
&&
result
.
contains
(
"data"
))
{
JSONObject
resultObject
=
JSON
.
parseObject
(
result
);
String
code
=
resultObject
.
getString
(
"code"
);
if
(
Common
.
isNotNull
(
code
)
&&
"S00000"
.
equals
(
code
))
{
System
.
out
.
println
(
"成功"
);
return
true
;
}
}
return
false
;
}
public
boolean
pushGzEmpInfo
(
RestTemplate
restTemplate
,
TGzEmpInfo
a
,
String
sortedParams
)
{
String
gzBankUrl
=
appUrl
+
"/eim-hr-induction/api/hr/induction/open/offer/person-info?"
+
sortedParams
;
// 创建请求头并添加Authorization
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
headers
.
setContentType
(
type
);
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
headers
.
set
(
"Authorization"
,
"00000000"
);
// 设置Authorization头
Gson
gson
=
new
Gson
();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity
<
String
>
entity
=
new
HttpEntity
<>(
gson
.
toJson
(
a
),
headers
);
// 发送GET请求
String
result
=
restTemplate
.
exchange
(
gzBankUrl
,
HttpMethod
.
POST
,
entity
,
String
.
class
).
getBody
();
System
.
out
.
println
(
result
);
if
(
result
!=
null
&&
result
.
contains
(
"code"
)
&&
result
.
contains
(
"data"
))
{
JSONObject
resultObject
=
JSON
.
parseObject
(
result
);
String
code
=
resultObject
.
getString
(
"code"
);
if
(
Common
.
isNotNull
(
code
)
&&
"S00000"
.
equals
(
code
))
{
System
.
out
.
println
(
"成功"
);
return
true
;
}
}
return
false
;
}
public
boolean
pushGzEmpContract
(
RestTemplate
restTemplate
,
TEmpContactInfo
a
,
String
sortedParams
)
{
String
gzBankUrl
=
appUrl
+
"/eim-hr-induction/api/hr/induction/open/offer/person-contract?"
+
sortedParams
;
// 创建请求头并添加Authorization
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
headers
.
setContentType
(
type
);
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
headers
.
set
(
"Authorization"
,
"00000000"
);
// 设置Authorization头
Gson
gson
=
new
Gson
();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity
<
String
>
entity
=
new
HttpEntity
<>(
gson
.
toJson
(
a
),
headers
);
// 发送GET请求
String
result
=
restTemplate
.
exchange
(
gzBankUrl
,
HttpMethod
.
POST
,
entity
,
String
.
class
).
getBody
();
System
.
out
.
println
(
result
);
if
(
result
!=
null
&&
result
.
contains
(
"code"
)
&&
result
.
contains
(
"data"
))
{
JSONObject
resultObject
=
JSON
.
parseObject
(
result
);
String
code
=
resultObject
.
getString
(
"code"
);
if
(
Common
.
isNotNull
(
code
)
&&
"S00000"
.
equals
(
code
))
{
System
.
out
.
println
(
"成功"
);
return
true
;
}
}
return
false
;
}
public
boolean
pushGzEmpContractFile
(
RestTemplate
restTemplate
,
TEmpContactInfo
a
,
String
sortedParams
)
{
String
gzBankUrl
=
appUrl
+
"/eim-hr-induction/api/hr/induction/open/offer/person-contract?"
+
sortedParams
;
// 创建请求头并添加Authorization
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
headers
.
setContentType
(
type
);
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
headers
.
set
(
"Authorization"
,
"00000000"
);
// 设置Authorization头
Gson
gson
=
new
Gson
();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity
<
String
>
entity
=
new
HttpEntity
<>(
gson
.
toJson
(
a
),
headers
);
// 发送GET请求
String
result
=
restTemplate
.
exchange
(
gzBankUrl
,
HttpMethod
.
POST
,
entity
,
String
.
class
).
getBody
();
System
.
out
.
println
(
result
);
if
(
result
!=
null
&&
result
.
contains
(
"code"
)
&&
result
.
contains
(
"data"
))
{
JSONObject
resultObject
=
JSON
.
parseObject
(
result
);
String
code
=
resultObject
.
getString
(
"code"
);
if
(
Common
.
isNotNull
(
code
)
&&
"S00000"
.
equals
(
code
))
{
System
.
out
.
println
(
"成功"
);
return
true
;
}
}
return
false
;
}
public
boolean
pushGzFileList
(
RestTemplate
restTemplate
,
List
<
Map
<
String
,
Object
>>
aList
,
String
sortedParams
)
{
for
(
Map
<
String
,
Object
>
a
:
aList
)
{
if
(
pushGzFileOne
(
restTemplate
,
a
,
sortedParams
))
{
System
.
out
.
println
(
"成功"
);
}
}
return
true
;
}
public
boolean
pushGzFileOne
(
RestTemplate
restTemplate
,
Map
<
String
,
Object
>
params
,
String
sortedParams
)
{
String
gzBankUrl
=
appUrl
+
"/eim-hr-induction/api/hr/induction/open/offer/person-contract?"
+
sortedParams
;
// 创建请求头并添加Authorization
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
headers
.
setContentType
(
type
);
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
headers
.
set
(
"Authorization"
,
"00000000"
);
// 设置Authorization头
Gson
gson
=
new
Gson
();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null)
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TGzController.java
View file @
0d2e617e
...
...
@@ -18,10 +18,17 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
controller
;
import
com.yifu.cloud.plus.v1.yifu.archives.config.GzConfig
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContactInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TGzOfferInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContactInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TGzEmpInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TGzOfferInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.utils.GZSign
;
import
com.yifu.cloud.plus.v1.yifu.archives.utils.ReturnGz
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
...
...
@@ -30,7 +37,9 @@ import org.springframework.web.bind.annotation.*;
import
org.springframework.web.client.RestTemplate
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -50,6 +59,9 @@ public class TGzController {
private
GzConfig
gzConfig
;
private
final
TGzOfferInfoService
tGzOfferInfoService
;
private
final
TGzEmpInfoService
tGzEmpInfoService
;
private
final
TAttaInfoService
tAttaInfoService
;
private
final
TEmpContactInfoService
tEmpContactInfoService
;
private
RestTemplate
restTemplate
=
new
RestTemplate
();
...
...
@@ -109,6 +121,8 @@ public class TGzController {
params
.
put
(
"pageSize"
,
pageSize
);
params
.
put
(
"startTime"
,
startTime
);
params
.
put
(
"endTime"
,
endTime
);
params
.
put
(
"appsecret"
,
gzConfig
.
getAppsecret
());
params
.
put
(
"tid"
,
gzConfig
.
getTid
());
GZSign
.
addSignature
(
params
,
gzConfig
.
getAppkey
(),
gzConfig
.
getAppsecret
());
params
.
remove
(
"startTime"
,
startTime
);
...
...
@@ -119,9 +133,9 @@ public class TGzController {
}
/**
* @Description:
offer状态更新
* @Description:
1、offer状态更新接口;
* @Author: hgw
* @Date: 2025-7-
4 17:18:27
* @Date: 2025-7-
11 11:11:11
* @return: boolean
**/
@GetMapping
(
"/updateGzOfferStatus"
)
...
...
@@ -129,15 +143,114 @@ public class TGzController {
,
@RequestParam
(
required
=
false
)
String
phone
,
@RequestParam
(
required
=
false
)
String
email
,
@RequestParam
(
required
=
false
)
String
entryDate
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"appsecret"
,
gzConfig
.
getAppsecret
());
params
.
put
(
"tid"
,
gzConfig
.
getTid
());
GZSign
.
addSignature
(
params
,
gzConfig
.
getAppkey
(),
gzConfig
.
getAppsecret
());
String
sortedParams
=
GZSign
.
getEncodeString
(
params
);
params
=
new
HashMap
<>();
params
.
put
(
"bizId"
,
bizId
);
params
.
put
(
"status"
,
status
);
params
.
put
(
"phone"
,
phone
);
params
.
put
(
"email"
,
email
);
params
.
put
(
"entryDate"
,
entryDate
);
GZSign
.
addSignature
(
params
,
gzConfig
.
getAppkey
(),
gzConfig
.
getAppsecret
());
return
gzConfig
.
updateGzOfferStatus
(
restTemplate
,
params
,
sortedParams
);
}
return
gzConfig
.
updateGzOfferStatus
(
restTemplate
,
params
);
/**
* @Description: 2、员工信息回推接口;
* @Author: hgw
* @Date: 2025-7-11 11:11:11
* @return: boolean
**/
@GetMapping
(
"/pushGzEmpInfo"
)
public
boolean
pushGzEmpInfo
(
@RequestParam
(
required
=
false
)
String
gzEmpId
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"appsecret"
,
gzConfig
.
getAppsecret
());
params
.
put
(
"tid"
,
gzConfig
.
getTid
());
GZSign
.
addSignature
(
params
,
gzConfig
.
getAppkey
(),
gzConfig
.
getAppsecret
());
String
sortedParams
=
GZSign
.
getEncodeString
(
params
);
if
(
Common
.
isEmpty
(
gzEmpId
))
{
// 653497199507262524 李丽
gzEmpId
=
"1942036120125800449"
;
}
TGzEmpInfo
a
=
tGzEmpInfoService
.
getById
(
gzEmpId
);
return
gzConfig
.
pushGzEmpInfo
(
restTemplate
,
a
,
sortedParams
);
}
/**
* @Description: 3、合同信息回推接口;
* @Author: hgw
* @Date: 2025-7-11 11:11:11
* @return: boolean
**/
@GetMapping
(
"/pushGzEmpContract"
)
public
boolean
pushGzEmpContract
(
@RequestParam
(
required
=
false
)
String
empContractId
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"appsecret"
,
gzConfig
.
getAppsecret
());
params
.
put
(
"tid"
,
gzConfig
.
getTid
());
GZSign
.
addSignature
(
params
,
gzConfig
.
getAppkey
(),
gzConfig
.
getAppsecret
());
String
sortedParams
=
GZSign
.
getEncodeString
(
params
);
if
(
Common
.
isEmpty
(
empContractId
))
{
// 653497199507262524 李丽
empContractId
=
"1942036120125800449"
;
}
TEmpContactInfo
a
=
tEmpContactInfoService
.
getById
(
empContractId
);
return
gzConfig
.
pushGzEmpContract
(
restTemplate
,
a
,
sortedParams
);
}
/**
* @Description: 4、合同附件推送接口;
* @Author: hgw
* @Date: 2025-7-11 11:11:11
* @return: boolean
**/
@GetMapping
(
"/pushGzEmpContractFile"
)
public
boolean
pushGzEmpContractFile
(
@RequestParam
(
required
=
false
)
String
empContractId
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"appsecret"
,
gzConfig
.
getAppsecret
());
params
.
put
(
"tid"
,
gzConfig
.
getTid
());
GZSign
.
addSignature
(
params
,
gzConfig
.
getAppkey
(),
gzConfig
.
getAppsecret
());
String
sortedParams
=
GZSign
.
getEncodeString
(
params
);
if
(
Common
.
isEmpty
(
empContractId
))
{
// 653497199507262524 李丽
empContractId
=
"1942036120125800449"
;
}
TGzEmpInfo
a
=
tGzEmpInfoService
.
getById
(
empContractId
);
return
gzConfig
.
pushGzEmpInfo
(
restTemplate
,
a
,
sortedParams
);
}
/**
* @Description: 5:员工文件信息上传接口
* @Author: hgw
* @Date: 2025-7-11 11:11:11
* @return: boolean
**/
@GetMapping
(
"/pushGzEmpInfoFile"
)
public
boolean
pushGzEmpInfoFile
(
@RequestParam
(
required
=
false
)
String
gzEmpId
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"appsecret"
,
gzConfig
.
getAppsecret
());
params
.
put
(
"tid"
,
gzConfig
.
getTid
());
GZSign
.
addSignature
(
params
,
gzConfig
.
getAppkey
(),
gzConfig
.
getAppsecret
());
String
sortedParams
=
GZSign
.
getEncodeString
(
params
);
if
(
Common
.
isEmpty
(
gzEmpId
))
{
// 653497199507262524 李丽
gzEmpId
=
"1942036120125800449"
;
}
List
<
TAttaInfo
>
aList
=
tAttaInfoService
.
getTAttaInfoListByDoMainId
(
gzEmpId
);
List
<
Map
<
String
,
Object
>>
attaMapList
=
new
ArrayList
<>();
Map
<
String
,
Object
>
attaMap
;
TGzEmpInfo
tGzEmpInfo
;
for
(
TAttaInfo
a
:
aList
)
{
tGzEmpInfo
=
tGzEmpInfoService
.
getById
(
a
.
getDomainId
());
if
(
tGzEmpInfo
!=
null
&&
Common
.
isNotNull
(
tGzEmpInfo
.
getBizId
()))
{
attaMap
=
new
HashMap
<>();
attaMap
.
put
(
"bizId"
,
tGzEmpInfo
.
getBizId
());
// TODO-文件名称带后缀
attaMap
.
put
(
"fileName"
,
a
.
getAttaName
());
// TODO-文件数据 Base64
attaMap
.
put
(
"fileData"
,
null
);
attaMapList
.
add
(
attaMap
);
}
}
return
gzConfig
.
pushGzFileList
(
restTemplate
,
attaMapList
,
sortedParams
);
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/utils/GZSign.java
View file @
0d2e617e
...
...
@@ -93,7 +93,7 @@ public class GZSign {
* @return
*/
private
static
String
generateSignature
(
Map
<
String
,
Object
>
params
,
String
appKey
,
String
appSecret
)
{
if
(
params
==
null
||
params
.
size
()
==
0
)
{
if
(
params
==
null
)
{
return
null
;
}
params
.
put
(
APP_KEY
,
appKey
);
...
...
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