Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-support-rlwx
Project
Project
Details
Activity
Releases
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
rl
hls-support-rlwx
Commits
72375a1c
Commit
72375a1c
authored
Aug 19, 2020
by
5359
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into develop
parents
612f424e
59335049
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
125 additions
and
3 deletions
+125
-3
SignHclcController.java
...om/hand/app/esignHclc/controllers/SignHclcController.java
+18
-3
IOrganSignInfoHclcService.java
...hand/app/esignHclc/service/IOrganSignInfoHclcService.java
+4
-0
OrganSignInfoHclcServiceImpl.java
.../esignHclc/service/impl/OrganSignInfoHclcServiceImpl.java
+103
-0
No files found.
core/src/main/java/com/hand/app/esignHclc/controllers/SignHclcController.java
View file @
72375a1c
...
...
@@ -324,7 +324,22 @@ public class SignHclcController extends BaseController {
signUserInfoHclc
.
setOpenId
(
dto
.
getOpenId
());
signUserInfoHclc
=
signHclcService
.
selectByPrimaryKey
(
iRequest
,
signUserInfoHclc
);
if
(
Objects
.
nonNull
(
signUserInfoHclc
)
&&
Objects
.
nonNull
(
signUserInfoHclc
.
getOpenId
()))
{
if
(
"Y"
.
equalsIgnoreCase
(
dto
.
getManagerAuthFlag
())){
map
=
organSignHclcService
.
bindOrgansAgent
(
signUserInfoHclc
);
}
else
if
(
"N"
.
equalsIgnoreCase
(
dto
.
getManagerAuthFlag
())){
map
=
organSignHclcService
.
unBindOrgansAgent
(
signUserInfoHclc
);
}
else
{
map
.
put
(
"code"
,
"000003"
);
map
.
put
(
"message"
,
"managerAuthFlag参数有误,请检查!"
);
continue
;
}
if
(
"0"
.
equalsIgnoreCase
(
map
.
get
(
"code"
).
toString
())){
signHclcService
.
updateByPrimaryKeySelective
(
iRequest
,
dto
);
map
.
put
(
"code"
,
"000000"
);
map
.
put
(
"message"
,
"操作成功!"
);
}
else
{
map
.
put
(
"code"
,
"000004"
);
}
}
}
catch
(
Exception
e
)
{
map
.
put
(
"code"
,
"000002"
);
...
...
@@ -334,8 +349,8 @@ public class SignHclcController extends BaseController {
}
}
map
.
put
(
"code"
,
"000000"
);
map
.
put
(
"message"
,
"操作成功!"
);
//
map.put("code", "000000");
//
map.put("message", "操作成功!");
return
map
;
}
...
...
core/src/main/java/com/hand/app/esignHclc/service/IOrganSignInfoHclcService.java
View file @
72375a1c
...
...
@@ -25,4 +25,8 @@ public interface IOrganSignInfoHclcService extends IBaseService<SignUserInfoHclc
List
<
SignUserInfoHclc
>
getOrganIndividualInfoQuery
(
IRequest
iRequest
,
SignUserInfoHclc
signInfoHclc
);
Map
<
String
,
Object
>
setOrganIndividualAssignment
(
IRequest
iRequest
,
SignUserInfoHclc
info
);
Map
<
String
,
Object
>
bindOrgansAgent
(
SignUserInfoHclc
info
);
Map
<
String
,
Object
>
unBindOrgansAgent
(
SignUserInfoHclc
info
);
}
core/src/main/java/com/hand/app/esignHclc/service/impl/OrganSignInfoHclcServiceImpl.java
View file @
72375a1c
...
...
@@ -56,6 +56,8 @@ public class OrganSignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHc
public
static
final
String
signatureSysName
=
"HCLC_ELECTRONIC_SIGNATURE"
;
public
static
final
String
organsApiName
=
"outerOrgans"
;
public
static
final
String
deleteApiName
=
"organizationsDelete"
;
public
static
final
String
unBindApiName
=
"orgUnbindAcc"
;
public
static
final
String
bindApiName
=
"orgBindAcc"
;
private
static
final
String
HASH_ALGORITHM
=
"HmacSHA256"
;
//业务系统接口信息
...
...
@@ -717,6 +719,107 @@ public class OrganSignInfoHclcServiceImpl extends BaseServiceImpl<SignUserInfoHc
return
map
;
}
/**
* 外部机构绑定经办人
* @param signInfoHclc
* @return
*/
public
Map
<
String
,
Object
>
bindOrgansAgent
(
SignUserInfoHclc
signInfoHclc
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
//业务方交互上下文信息
JSONObject
result
=
new
JSONObject
();
//绑定经办人账户
result
.
put
(
"accountId"
,
signInfoHclc
.
getAgentAccountId
());
//当前登录账户ID
result
.
put
(
"loginId"
,
signInfoHclc
.
getAgentAccountId
());
//机构账户
result
.
put
(
"orgId"
,
signInfoHclc
.
getAccountId
());
JSONObject
json
=
new
JSONObject
(
result
);
String
param
=
json
.
toString
();
//获取HMAC加密后的X-timevale-signature签名信息
AlgorithmHelper
algorithmHelper
=
new
AlgorithmHelper
();
String
EncryptedString
=
algorithmHelper
.
getXtimevaleSignature
(
param
,
projectSecret
,
HASH_ALGORITHM
,
"UTF-8"
);
//设置http请求head信息
Map
<
String
,
String
>
headInfo
=
new
HashMap
<
String
,
String
>();
headInfo
.
put
(
"x-timevale-project-id"
,
projectId
);
headInfo
.
put
(
"x-timevale-signature"
,
EncryptedString
);
try
{
//初始化接口信息
String
url
=
iSignInfoHclcService
.
getApiUrl
(
signatureSysName
,
bindApiName
);
//发送http请求
SignHclcUtils
signHclcUtils1
=
new
SignHclcUtils
();
String
stringResult
=
signHclcUtils1
.
postString
(
url
,
json
,
headInfo
,
signHclcUtils1
.
APPLICATION_JSON
);
//解析返回结果
JSONObject
jsonResult
=
JSONObject
.
parseObject
(
stringResult
);
if
(
"0"
.
equalsIgnoreCase
(
jsonResult
.
getString
(
"errCode"
)))
{
JSONObject
data
=
jsonResult
.
getJSONObject
(
"data"
);
map
.
put
(
"code"
,
jsonResult
.
getString
(
"errCode"
));
map
.
put
(
"message"
,
"绑定经办人成功!"
);
}
else
{
map
.
put
(
"code"
,
jsonResult
.
getString
(
"errCode"
));
map
.
put
(
"message"
,
"绑定经办人失败,"
+
jsonResult
.
getString
(
"msg"
));
}
}
catch
(
Exception
e
)
{
map
.
put
(
"code"
,
"000004"
);
map
.
put
(
"message"
,
"绑定经办人失败,"
+
e
.
getMessage
());
}
return
map
;
}
/**
* 外部机构解绑经办人
* @param signInfoHclc
* @return
*/
public
Map
<
String
,
Object
>
unBindOrgansAgent
(
SignUserInfoHclc
signInfoHclc
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
JSONObject
result
=
new
JSONObject
();
//绑定经办人账户
result
.
put
(
"accountId"
,
signInfoHclc
.
getAgentAccountId
());
//当前登录账户ID
result
.
put
(
"loginId"
,
signInfoHclc
.
getAgentAccountId
());
//机构账户
result
.
put
(
"orgId"
,
signInfoHclc
.
getAccountId
());
JSONObject
json
=
new
JSONObject
(
result
);
String
param
=
json
.
toString
();
//获取HMAC加密后的X-timevale-signature签名信息
AlgorithmHelper
algorithmHelper
=
new
AlgorithmHelper
();
String
EncryptedString
=
algorithmHelper
.
getXtimevaleSignature
(
param
,
projectSecret
,
HASH_ALGORITHM
,
"UTF-8"
);
//设置http请求head信息
Map
<
String
,
String
>
headInfo
=
new
HashMap
<
String
,
String
>();
headInfo
.
put
(
"x-timevale-project-id"
,
projectId
);
headInfo
.
put
(
"x-timevale-signature"
,
EncryptedString
);
try
{
//初始化接口信息
String
url
=
iSignInfoHclcService
.
getApiUrl
(
signatureSysName
,
unBindApiName
);
//发送http请求
SignHclcUtils
signHclcUtils1
=
new
SignHclcUtils
();
String
stringResult
=
signHclcUtils1
.
postString
(
url
,
json
,
headInfo
,
signHclcUtils1
.
APPLICATION_JSON
);
//解析返回结果
JSONObject
jsonResult
=
JSONObject
.
parseObject
(
stringResult
);
if
(
"0"
.
equalsIgnoreCase
(
jsonResult
.
getString
(
"errCode"
)))
{
JSONObject
data
=
jsonResult
.
getJSONObject
(
"data"
);
map
.
put
(
"code"
,
jsonResult
.
getString
(
"errCode"
));
map
.
put
(
"message"
,
"解绑经办人成功!"
);
}
else
{
map
.
put
(
"code"
,
jsonResult
.
getString
(
"errCode"
));
map
.
put
(
"message"
,
"解绑经办人失败,"
+
jsonResult
.
getString
(
"msg"
));
}
}
catch
(
Exception
e
)
{
map
.
put
(
"code"
,
"000004"
);
map
.
put
(
"message"
,
"解绑经办人失败,"
+
e
.
getMessage
());
}
return
map
;
}
public
Map
<
String
,
Object
>
deleteOrgansAccount
(
IRequest
iRequest
,
SignUserInfoHclc
signInfoHclc
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
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