Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huang.tao
/
jmai-platform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2c397c16
authored
Jan 27, 2026
by
zhu.zewen
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
新增云签相关接口
parent
603864e2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
682 additions
and
14 deletions
config/application-dev.yaml
jmai-physic/src/main/java/com/jmai/physic/cloudsign/CloudSignCallbackRequest.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/CloudSignCallbackResponse.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/CloudsignService.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GenloginqrcodeRequest.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GenloginqrcodeRespon.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetCertInfoRequest.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetCertInfoResponse.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetLoginResultRequest.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetLoginResultResponse.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetstampRequest.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetstampRespon.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/LoginBypinRequest.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/PinLoginRequest.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/QRCodeLoginRequest.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/QRCodeLoginResponse.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/QueryStatusRequest.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/QueryStatusResponse.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/SignDataRequest.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/SignDataRespon.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/VerifyDataRequest.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/VerifyDataResponse.java
jmai-physic/src/main/java/com/jmai/physic/cloudsign/cloudsign-webapi-V2.4.txt
jmai-physic/src/main/java/com/jmai/physic/config/CloudSignProperties.java
jmai-physic/src/main/java/com/jmai/physic/controller/CloudSignController.java
jmai-sys/src/main/java/com/jmai/sys/aop/AuthAspect.java
jmai-sys/src/main/java/com/jmai/sys/consts/HeaderCode.java
jmai-sys/src/main/java/com/jmai/sys/ctx/SpringContextUtils.java
config/application-dev.yaml
View file @
2c397c16
...
...
@@ -59,10 +59,47 @@ mysql-bak:
username
:
jmai
password
:
IhxDs1fPoIkEpdLZ
# ################################################
# 云签配置
# ################################################
# 仅测试用
cloudsign
:
businessOrgCode
:
455835303
businessSystemCode
:
1176
businessSystemAppID
:
w6qpjDk1WBSrFCfgcj
# 云签名服务基础地址
# 内网
# host: http://192.168.2.194:18087
# 公网测试
host
:
http://www.jztech.top:18087
# 是否开启测试:true - 开启,false - 关闭(默认)
testEnabled
:
true
# 生产
businessOrgCode
:
xxx
businessSystemCode
:
xxx
businessSystemAppID
:
xxx
# 测试
testBusinessOrgCode
:
455835303
testBusinessSystemCode
:
1176
testBusinessSystemAppID
:
w6qpjDk1WBSrFCfgcj
# API
# PIN码登录接口
pinloginUrl
:
/v1.0/cloudsign/loginbypin
# 生成登录二维码接口
genloginqrcodeUrl
:
/v1.0/cloudsign/genloginqrcode
# 二维码登录接口
qrcodeloginUrl
:
/v1.0/cloudsign/genloginqrcode
# 签名数据接口
signdataUrl
:
/v1.0/cloudsign/signdata
# 获取印章接口
getstampUrl
:
/v1.0/cloudsign/getstamp
# 查询用户令牌状态接口
querystatusUrl
:
/v1.0/cloudsign/usertoken/queryStatus
# 获取登录结果接口
getloginresultUrl
:
/v1.0/cloudsign/getLoginResult/web
# 获取证书信息接口
getcertinfoUrl
:
/v1.0/cloudsign/getcertinfo
# 验证数据接口
verifydataUrl
:
/v1.0/cloudsign/verify/data
# ################################################
# 交接单配置
...
...
jmai-physic/src/main/java/com/jmai/physic/cloudsign/CloudSignCallbackRequest.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"CloudSignCallbackRequest"
,
description
=
"云签系统回调请求参数"
)
public
class
CloudSignCallbackRequest
{
@ApiModelProperty
(
value
=
"此次登录任务的唯一标识,通301返回值"
,
required
=
true
)
private
String
claimUuid
;
@ApiModelProperty
(
value
=
"登录状态:0表示登录成功,1表示登录失败,2表示取消登录"
,
required
=
true
)
private
String
loginStatus
;
@ApiModelProperty
(
value
=
"云签账号"
,
required
=
true
)
private
String
relBizNo
;
@ApiModelProperty
(
value
=
"加密令牌,用于登录后的CA签名等操作使用"
)
private
String
encryptedToken
;
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/CloudSignCallbackResponse.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"CloudSignCallbackResponse"
,
description
=
"云签系统回调响应参数"
)
public
class
CloudSignCallbackResponse
{
@ApiModelProperty
(
value
=
"状态码,非0表示执行失败"
)
private
Integer
statusCode
;
@ApiModelProperty
(
value
=
"状态信息"
)
private
String
eventMsg
;
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/CloudsignService.java
View file @
2c397c16
This diff is collapsed.
Click to expand it.
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GenloginqrcodeRequest.java
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"GenloginqrcodeRequest"
,
description
=
"获取登录二维码请求参数"
)
public
class
GenloginqrcodeRequest
{
@ApiModelProperty
(
value
=
"深圳市卫生计生组织机构代码,每个医院均有独立编码"
,
required
=
true
)
private
String
businessOrgCode
;
@ApiModelProperty
(
value
=
"深圳市CA业务系统编码,每个业务系统均有独立编码"
,
required
=
true
)
private
String
businessSystemCode
;
@ApiModelProperty
(
value
=
"业务系统应用ID,业务系统的唯一标识号"
,
required
=
true
)
private
String
businessSystemAppID
;
@ApiModelProperty
(
value
=
"通知回调地址"
)
private
String
notifyUrl
;
@ApiModelProperty
(
value
=
"二维码图片格式:1-JPG,2-PNG"
)
private
Integer
imageFormat
;
}
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GenloginqrcodeRespon.java
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"GenloginqrcodeRespon"
,
description
=
"获取登录二维码响应参数"
)
public
class
GenloginqrcodeRespon
{
@ApiModelProperty
(
value
=
"状态码,非0表示执行失败"
)
private
Integer
statusCode
;
@ApiModelProperty
(
value
=
"状态信息"
)
private
String
eventMsg
;
@ApiModelProperty
(
value
=
"事件值对象"
)
private
EventValue
eventValue
;
@Data
@ApiModel
(
value
=
"GenloginqrcodeRespon.EventValue"
,
description
=
"事件值对象"
)
public
static
class
EventValue
{
@ApiModelProperty
(
value
=
"二维码图片Base64编码"
)
private
String
qRCodeBase64
;
@ApiModelProperty
(
value
=
"二维码有效时长,单位秒"
)
private
Integer
durateTime
;
@ApiModelProperty
(
value
=
"二维码唯一标识"
)
private
String
claimUuid
;
@ApiModelProperty
(
value
=
"加密令牌"
)
private
String
encryptedToken
;
}
}
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetCertInfoRequest.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"GetCertInfoRequest"
,
description
=
"获取Base64编码证书请求参数"
)
public
class
GetCertInfoRequest
{
@ApiModelProperty
(
value
=
"深圳市卫生计生组织机构代码,每个医院均有独立编码"
,
required
=
true
)
private
String
businessOrgCode
;
@ApiModelProperty
(
value
=
"云签账号"
,
required
=
true
)
private
String
relBizNo
;
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetCertInfoResponse.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"GetCertInfoResponse"
,
description
=
"获取Base64编码证书响应参数"
)
public
class
GetCertInfoResponse
{
@ApiModelProperty
(
value
=
"状态码,非0表示执行失败"
)
private
Integer
statusCode
;
@ApiModelProperty
(
value
=
"状态信息"
)
private
String
eventMsg
;
@ApiModelProperty
(
value
=
"事件值对象"
)
private
EventValue
eventValue
;
@Data
@ApiModel
(
value
=
"GetCertInfoResponse.EventValue"
,
description
=
"事件值对象"
)
public
static
class
EventValue
{
@ApiModelProperty
(
value
=
"base64编码格式证书"
)
private
String
base64Cert
;
}
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetLoginResultRequest.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"GetLoginResultRequest"
,
description
=
"查询云签二维码扫码结果请求参数"
)
public
class
GetLoginResultRequest
{
@ApiModelProperty
(
value
=
"深圳市卫生计生组织机构代码,每个医院均有独立编码"
,
required
=
true
)
private
String
businessOrgCode
;
@ApiModelProperty
(
value
=
"深圳市CA业务系统编码,每个业务系统均有独立编码"
,
required
=
true
)
private
String
businessSystemCode
;
@ApiModelProperty
(
value
=
"业务系统应用ID,业务系统的唯一标识号"
,
required
=
true
)
private
String
businessSystemAppID
;
@ApiModelProperty
(
value
=
"云签登录任务的唯一标识,由301返回值获得"
)
private
String
claimUuid
;
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetLoginResultResponse.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"GetLoginResultResponse"
,
description
=
"查询云签二维码扫码结果响应参数"
)
public
class
GetLoginResultResponse
{
@ApiModelProperty
(
value
=
"状态码,非0表示执行失败"
)
private
Integer
statusCode
;
@ApiModelProperty
(
value
=
"状态信息"
)
private
String
eventMsg
;
@ApiModelProperty
(
value
=
"事件值对象"
)
private
EventValue
eventValue
;
@Data
@ApiModel
(
value
=
"GetLoginResultResponse.EventValue"
,
description
=
"事件值对象"
)
public
static
class
EventValue
{
@ApiModelProperty
(
value
=
"登录状态:1表示登录成功,不为1表示查询失败"
)
private
String
loginStatus
;
@ApiModelProperty
(
value
=
"加密令牌,用于登录后的CA签名等操作使用"
)
private
String
encryptedToken
;
@ApiModelProperty
(
value
=
"云签账号"
)
private
String
relBizNo
;
}
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetstampRequest.java
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"GetstampRequest"
,
description
=
"获取手写签名图片请求参数"
)
public
class
GetstampRequest
{
@ApiModelProperty
(
value
=
"签章账号"
,
required
=
true
)
private
String
relBizNo
;
}
jmai-physic/src/main/java/com/jmai/physic/cloudsign/GetstampRespon.java
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"GetstampRespon"
,
description
=
"获取手写签名图片响应参数"
)
public
class
GetstampRespon
{
@ApiModelProperty
(
value
=
"状态码,非0表示执行失败"
)
private
Integer
statusCode
;
@ApiModelProperty
(
value
=
"状态信息"
)
private
String
eventMsg
;
@ApiModelProperty
(
value
=
"事件值对象"
)
private
EventValue
eventValue
;
@Data
@ApiModel
(
value
=
"GetstampRespon.EventValue"
,
description
=
"事件值对象"
)
public
static
class
EventValue
{
@ApiModelProperty
(
value
=
"base64编码的签名图片"
)
private
String
stampBase64
;
}
...
...
jmai-physic/src/main/java/com/jmai/physic/cloudsign/LoginBypinRequest.java
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"LoginBypinRequest"
,
description
=
"PIN码登录请求参数"
)
public
class
LoginBypinRequest
{
@ApiModelProperty
(
value
=
"深圳市卫生计生组织机构代码,每个医院均有独立编码"
,
hidden
=
true
)
private
String
businessOrgCode
;
@ApiModelProperty
(
value
=
"深圳市 CA 业务系统编码,每个业务系统均有独立编码"
,
hidden
=
true
)
private
String
businessSystemCode
;
private
String
businessSystemAppID
;
@ApiModelProperty
(
value
=
"业务系统应用 ID,业务系统的唯一标识号"
,
hidden
=
true
)
private
String
businessSystemAppId
;
@ApiModelProperty
(
value
=
"医生工号(当前用户工号)"
,
hidden
=
true
)
private
String
relBizNo
;
@ApiModelProperty
(
value
=
"医生在业务系统输入的证书 PIN 码,进行 Base64 编码后的字符串。"
+
"注意:云签数字证书申请成功后,医生手机上会收到 PIN 码,可通过云签 APP 进行修改。"
,
required
=
true
)
private
String
userEncodePin
;
@ApiModelProperty
(
value
=
"登录方式,1 表示 PIN 码认证"
,
required
=
true
)
private
Integer
loginType
;
}
jmai-physic/src/main/java/com/jmai/physic/cloudsign/PinLoginRequest.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"PinLoginRequest"
,
description
=
"PIN码登录请求参数"
)
public
class
PinLoginRequest
{
@ApiModelProperty
(
value
=
"深圳市卫生计生组织机构代码,每个医院均有独立编码"
,
hidden
=
true
)
private
String
businessOrgCode
;
@ApiModelProperty
(
value
=
"深圳市 CA 业务系统编码,每个业务系统均有独立编码"
,
hidden
=
true
)
private
String
businessSystemCode
;
@ApiModelProperty
(
value
=
"业务系统应用 ID,业务系统的唯一标识号"
,
hidden
=
true
)
private
String
businessSystemAppId
;
@ApiModelProperty
(
value
=
"医生工号(当前用户工号)"
,
hidden
=
true
)
private
String
relBizNo
;
@ApiModelProperty
(
value
=
"医生在业务系统输入的证书 PIN 码,进行 Base64 编码后的字符串。"
+
"注意:云签数字证书申请成功后,医生手机上会收到 PIN 码,可通过云签 APP 进行修改。"
,
required
=
true
)
private
String
userEncodePin
;
@ApiModelProperty
(
value
=
"登录方式,1 表示 PIN 码认证"
,
required
=
true
)
private
Integer
loginType
;
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/QRCodeLoginRequest.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"QRCodeLoginRequest"
,
description
=
"二维码登录请求参数"
)
public
class
QRCodeLoginRequest
{
@ApiModelProperty
(
value
=
"深圳市卫生计生组织机构代码,每个医院均有独立编码"
,
required
=
true
)
private
String
businessOrgCode
;
@ApiModelProperty
(
value
=
"深圳市CA业务系统编码,每个业务系统均有独立编码"
,
required
=
true
)
private
String
businessSystemCode
;
@ApiModelProperty
(
value
=
"业务系统应用ID,业务系统的唯一标识号"
,
required
=
true
)
private
String
businessSystemAppID
;
@ApiModelProperty
(
value
=
"通知回调地址"
)
private
String
notifyUrl
;
@ApiModelProperty
(
value
=
"二维码图片格式:1-JPG,2-PNG"
)
private
Integer
imageFormat
;
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/QRCodeLoginResponse.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"QRCodeLoginResponse"
,
description
=
"二维码登录响应参数"
)
public
class
QRCodeLoginResponse
{
@ApiModelProperty
(
value
=
"状态码,非0表示执行失败"
)
private
Integer
statusCode
;
@ApiModelProperty
(
value
=
"状态信息"
)
private
String
eventMsg
;
@ApiModelProperty
(
value
=
"事件值对象"
)
private
EventValue
eventValue
;
@Data
@ApiModel
(
value
=
"QRCodeLoginResponse.EventValue"
,
description
=
"事件值对象"
)
public
static
class
EventValue
{
@ApiModelProperty
(
value
=
"二维码图片Base64编码"
)
private
String
qRCodeBase64
;
@ApiModelProperty
(
value
=
"二维码有效时长,单位秒"
)
private
Integer
durateTime
;
@ApiModelProperty
(
value
=
"二维码唯一标识"
)
private
String
claimUuid
;
@ApiModelProperty
(
value
=
"加密令牌"
)
private
String
encryptedToken
;
}
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/QueryStatusRequest.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"QueryStatusRequest"
,
description
=
"检查云签状态请求参数"
)
public
class
QueryStatusRequest
{
@ApiModelProperty
(
value
=
"深圳市卫生计生组织机构代码,每个医院均有独立编码"
,
required
=
true
)
private
String
businessOrgCode
;
@ApiModelProperty
(
value
=
"深圳市CA业务系统编码,每个业务系统均有独立编码"
,
required
=
true
)
private
String
businessSystemCode
;
@ApiModelProperty
(
value
=
"业务系统应用ID,业务系统的唯一标识号"
,
required
=
true
)
private
String
businessSystemAppID
;
@ApiModelProperty
(
value
=
"加密口令,通过登录接口获取"
,
required
=
true
)
private
String
encryptedToken
;
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/QueryStatusResponse.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"QueryStatusResponse"
,
description
=
"检查云签状态响应参数"
)
public
class
QueryStatusResponse
{
@ApiModelProperty
(
value
=
"状态码,非0表示执行失败"
)
private
Integer
statusCode
;
@ApiModelProperty
(
value
=
"状态信息"
)
private
String
eventMsg
;
@ApiModelProperty
(
value
=
"事件值对象"
)
private
EventValue
eventValue
;
@Data
@ApiModel
(
value
=
"QueryStatusResponse.EventValue"
,
description
=
"事件值对象"
)
public
static
class
EventValue
{
@ApiModelProperty
(
value
=
"加密令牌剩余有效时间,单位为秒;若加密令牌失效或已过期,值为-1"
)
private
String
time
;
}
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/SignDataRequest.java
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"SignDataRequest"
,
description
=
"云签证书数字签名请求参数"
)
public
class
SignDataRequest
{
@ApiModelProperty
(
value
=
"深圳市卫生计生组织机构代码,每个医院均有独立编码"
,
required
=
true
)
private
String
businessOrgCode
;
@ApiModelProperty
(
value
=
"深圳市CA业务系统编码,每个业务系统均有独立编码"
,
required
=
true
)
private
String
businessSystemCode
;
private
String
businessSystemAppID
;
@ApiModelProperty
(
value
=
"业务系统应用ID,业务系统的唯一标识号"
,
required
=
true
)
private
String
businessSystemAppId
;
@ApiModelProperty
(
value
=
"业务类型代码"
,
required
=
true
)
private
String
businessTypeCode
;
@ApiModelProperty
(
value
=
"加密令牌"
,
required
=
true
)
private
String
encryptedToken
;
@ApiModelProperty
(
value
=
"患者ID"
)
private
String
patientId
;
@ApiModelProperty
(
value
=
"业务ID"
)
private
String
bizId
;
@ApiModelProperty
(
value
=
"待签名数据的Base64编码"
,
required
=
true
)
private
String
base64SourceData
;
@ApiModelProperty
(
value
=
"是否包含时间戳"
)
private
Boolean
withTsa
;
...
...
jmai-physic/src/main/java/com/jmai/physic/cloudsign/SignDataRespon.java
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"SignDataRespon"
,
description
=
"云签证书数字签名响应参数"
)
public
class
SignDataRespon
{
@ApiModelProperty
(
value
=
"状态码,非0表示执行失败"
)
private
Integer
statusCode
;
@ApiModelProperty
(
value
=
"状态信息"
)
private
String
eventMsg
;
@ApiModelProperty
(
value
=
"事件值对象"
)
private
EventValue
eventValue
;
@Data
@ApiModel
(
value
=
"SignDataRespon.EventValue"
,
description
=
"事件值对象"
)
public
static
class
EventValue
{
@ApiModelProperty
(
value
=
"签名数据"
)
private
String
signedData
;
@ApiModelProperty
(
value
=
"时间戳"
)
private
Integer
timestamp
;
}
}
jmai-physic/src/main/java/com/jmai/physic/cloudsign/VerifyDataRequest.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"VerifyDataRequest"
,
description
=
"云签证书数字签名验证请求参数"
)
public
class
VerifyDataRequest
{
@ApiModelProperty
(
value
=
"深圳市卫生计生组织机构代码,每个医院均有独立编码"
,
required
=
true
)
private
String
businessOrgCode
;
@ApiModelProperty
(
value
=
"医生工号"
,
required
=
true
)
private
String
relBizNo
;
@ApiModelProperty
(
value
=
"base64编码格式证书,通过304接口获取"
,
required
=
true
)
private
String
signCert
;
@ApiModelProperty
(
value
=
"签名原文,与302接口传入的base64SourceData字段须一致"
,
required
=
true
)
private
String
sourceData
;
@ApiModelProperty
(
value
=
"签名值"
,
required
=
true
)
private
String
signedData
;
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/VerifyDataResponse.java
0 → 100644
View file @
2c397c16
package
com
.
jmai
.
physic
.
cloudsign
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"VerifyDataResponse"
,
description
=
"云签证书数字签名验证响应参数"
)
public
class
VerifyDataResponse
{
@ApiModelProperty
(
value
=
"状态码,非0表示执行失败"
)
private
Integer
statusCode
;
@ApiModelProperty
(
value
=
"状态信息"
)
private
String
eventMsg
;
}
\ No newline at end of file
jmai-physic/src/main/java/com/jmai/physic/cloudsign/cloudsign-webapi-V2.4.txt
0 → 100644
View file @
2c397c16
This diff is collapsed.
Click to expand it.
jmai-physic/src/main/java/com/jmai/physic/config/CloudSignProperties.java
View file @
2c397c16
package
com
.
jmai
.
physic
.
config
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
...
...
@@ -8,8 +9,108 @@ import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties
(
prefix
=
"cloudsign"
)
public
class
CloudSignProperties
{
/**
* 云签名服务基础地址
*/
private
String
host
=
"http://192.168.2.194:18087"
;
/**
* 深圳市卫生计生组织机构代码,每个医院均有独立编码
*/
private
String
businessOrgCode
;
/**
* 深圳市 CA 业务系统编码,每个业务系统均有独立编码
*/
private
String
businessSystemCode
;
private
String
businessSystemApplD
;
/**
* 业务系统应用 ID,业务系统的唯一标识号
*/
private
String
businessSystemAppld
;
/**
* 登录方式,1-PIN码认证
*/
private
Integer
loginType
=
1
;
//=========================================
/**
* 是否启用测试:true表示启用测试,false表示不启用测试(默认为false)
*/
private
Boolean
testEnabled
=
false
;
/**
* 测试用的组织机构代码
*/
private
String
testBusinessOrgCode
=
"455767873"
;
/**
* 测试用的业务系统编码
*/
private
String
testBusinessSystemCode
=
"9998"
;
/**
* 测试用的业务系统应用ID
*/
private
String
testBusinessSystemAppId
=
"o7d7q8ehm4tkrc6o"
;
/**
* 测试用的医生工号
*/
@Deprecated
private
String
testRelBizNo
=
"WN123456"
;
/**
* 测试用的用户编码PIN码
*/
@Deprecated
private
String
testUserEncodePin
=
"MTIzNDU2"
;
//=========================================
// 云签名API端点配置
//=========================================
/**
* PIN码登录接口
*/
private
String
pinloginUrl
=
"/v1.0/cloudsign/loginbypin"
;
/**
* 生成登录二维码接口
*/
private
String
genloginqrcodeUrl
=
"/v1.0/cloudsign/genloginqrcode"
;
/**
* 二维码登录接口
*/
private
String
qrcodeloginUrl
=
"/v1.0/cloudsign/genloginqrcode"
;
/**
* 签名数据接口
*/
private
String
signdataUrl
=
"/v1.0/cloudsign/signdata"
;
/**
* 获取印章接口
*/
private
String
getstampUrl
=
"/v1.0/cloudsign/getstamp"
;
/**
* 查询用户令牌状态接口
*/
private
String
querystatusUrl
=
"/v1.0/cloudsign/usertoken/queryStatus"
;
/**
* 获取登录结果接口
*/
private
String
getloginresultUrl
=
"/v1.0/cloudsign/getLoginResult/web"
;
/**
* 获取证书信息接口
*/
private
String
getcertinfoUrl
=
"/v1.0/cloudsign/getcertinfo"
;
/**
* 验证数据接口
*/
private
String
verifydataUrl
=
"/v1.0/cloudsign/verify/data"
;
}
jmai-physic/src/main/java/com/jmai/physic/controller/CloudSignController.java
View file @
2c397c16
package
com
.
jmai
.
physic
.
controller
;
import
com.jmai.physic.cloudsign.CloudsignService
;
import
com.jmai.physic.cloudsign.GenloginqrcodeRespon
;
import
com.jmai.physic.cloudsign.LoginBypinRequest
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.jmai.api.exception.ServiceException
;
import
com.jmai.physic.cloudsign.*
;
import
com.jmai.physic.cloudsign.QRCodeLoginRequest
;
import
com.jmai.physic.cloudsign.QRCodeLoginResponse
;
import
com.jmai.physic.config.CloudSignProperties
;
import
com.jmai.sys.aop.Auth
;
import
com.jmai.sys.ctx.SpringContextUtils
;
import
com.jmai.sys.dto.ResponseData
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -14,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
@Auth
@Slf4j
@RestController
@RequestMapping
(
"/cloudsign"
)
...
...
@@ -21,13 +28,165 @@ import javax.annotation.Resource;
public
class
CloudSignController
{
@Resource
private
CloudsignService
cloudsignService
;
@Resource
private
CloudSignProperties
cloudSignProperties
;
@PostMapping
(
"/queryStatus"
)
@ApiOperation
(
value
=
"检查云签状态"
)
public
ResponseData
<
QueryStatusResponse
>
queryStatus
(
@RequestBody
QueryStatusRequest
queryStatusRequest
)
{
String
workNo
=
SpringContextUtils
.
getWorkNo
();
if
(
ObjectUtil
.
isEmpty
(
workNo
))
{
throw
new
ServiceException
(
"当前用户工号为空"
);
}
queryStatusRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getBusinessOrgCode
());
queryStatusRequest
.
setBusinessSystemCode
(
cloudSignProperties
.
getBusinessSystemCode
());
queryStatusRequest
.
setBusinessSystemAppID
(
cloudSignProperties
.
getBusinessSystemAppld
());
if
(
cloudSignProperties
.
getTestEnabled
())
{
queryStatusRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getTestBusinessOrgCode
());
queryStatusRequest
.
setBusinessSystemCode
(
cloudSignProperties
.
getTestBusinessSystemCode
());
queryStatusRequest
.
setBusinessSystemAppID
(
cloudSignProperties
.
getTestBusinessSystemAppId
());
}
else
{
queryStatusRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getBusinessOrgCode
());
queryStatusRequest
.
setBusinessSystemCode
(
cloudSignProperties
.
getBusinessSystemCode
());
queryStatusRequest
.
setBusinessSystemAppID
(
cloudSignProperties
.
getBusinessSystemAppld
());
}
QueryStatusResponse
queryStatus
=
cloudsignService
.
queryStatus
(
queryStatusRequest
);
return
ResponseData
.
ok
(
queryStatus
);
}
@PostMapping
(
"/loginByPin"
)
@ApiOperation
(
value
=
"PIN码登录"
)
public
ResponseData
<
GenloginqrcodeRespon
>
loginByPin
(
@RequestBody
PinLoginRequest
pinLoginRequest
)
{
String
workNo
=
SpringContextUtils
.
getWorkNo
();
if
(
ObjectUtil
.
isEmpty
(
workNo
))
{
throw
new
ServiceException
(
"当前用户工号为空"
);
}
@PostMapping
(
"/loginbypin"
)
@ApiOperation
(
value
=
"查询药品申请审核单"
)
public
ResponseData
<
GenloginqrcodeRespon
>
loginbypin
(
@RequestBody
LoginBypinRequest
loginBypinRequest
)
{
GenloginqrcodeRespon
loginbypin
=
cloudsignService
.
loginbypin
(
loginBypinRequest
);
return
ResponseData
.
ok
(
loginbypin
);
pinLoginRequest
.
setRelBizNo
(
workNo
);
pinLoginRequest
.
setUserEncodePin
(
pinLoginRequest
.
getUserEncodePin
());
if
(
cloudSignProperties
.
getTestEnabled
())
{
pinLoginRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getTestBusinessOrgCode
());
pinLoginRequest
.
setBusinessSystemCode
(
cloudSignProperties
.
getTestBusinessSystemCode
());
pinLoginRequest
.
setBusinessSystemAppId
(
cloudSignProperties
.
getTestBusinessSystemAppId
());
}
else
{
pinLoginRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getBusinessOrgCode
());
pinLoginRequest
.
setBusinessSystemCode
(
cloudSignProperties
.
getBusinessSystemCode
());
pinLoginRequest
.
setBusinessSystemAppId
(
cloudSignProperties
.
getBusinessSystemAppld
());
}
GenloginqrcodeRespon
pinLogin
=
cloudsignService
.
pinLogin
(
pinLoginRequest
);
return
ResponseData
.
ok
(
pinLogin
);
}
@PostMapping
(
"/loginByQrcode"
)
@ApiOperation
(
value
=
"二维码登录"
)
public
ResponseData
<
QRCodeLoginResponse
>
loginByQrcode
(
@RequestBody
QRCodeLoginRequest
qrCodeLoginRequest
)
{
String
workNo
=
SpringContextUtils
.
getWorkNo
();
if
(
ObjectUtil
.
isEmpty
(
workNo
))
{
throw
new
ServiceException
(
"当前用户工号为空"
);
}
if
(
cloudSignProperties
.
getTestEnabled
())
{
qrCodeLoginRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getTestBusinessOrgCode
());
qrCodeLoginRequest
.
setBusinessSystemCode
(
cloudSignProperties
.
getTestBusinessSystemCode
());
qrCodeLoginRequest
.
setBusinessSystemAppID
(
cloudSignProperties
.
getTestBusinessSystemAppId
());
}
else
{
qrCodeLoginRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getBusinessOrgCode
());
qrCodeLoginRequest
.
setBusinessSystemCode
(
cloudSignProperties
.
getBusinessSystemCode
());
qrCodeLoginRequest
.
setBusinessSystemAppID
(
cloudSignProperties
.
getBusinessSystemAppld
());
}
QRCodeLoginResponse
qrCodeLogin
=
cloudsignService
.
qrCodeLogin
(
qrCodeLoginRequest
);
return
ResponseData
.
ok
(
qrCodeLogin
);
}
@PostMapping
(
"/loginByQrcode/callback"
)
@ApiOperation
(
value
=
"二维码登录回调"
)
public
ResponseData
<
CloudSignCallbackResponse
>
loginByQrcodeCallback
(
@RequestBody
CloudSignCallbackRequest
callbackRequest
)
{
log
.
info
(
"接收到云签登录回调,claimUuid: {}, loginStatus: {}, relBizNo: {}"
,
callbackRequest
.
getClaimUuid
(),
callbackRequest
.
getLoginStatus
(),
callbackRequest
.
getRelBizNo
());
try
{
// 处理登录回调逻辑
// 这里可以根据登录状态更新用户登录状态或执行其他业务逻辑
// 示例逻辑:
// 1. 根据claimUuid找到对应的登录请求
// 2. 根据loginStatus处理不同状态(登录成功、失败、取消)
// 3. 如果登录成功,保存加密令牌encryptedToken供后续使用
// 构造响应
CloudSignCallbackResponse
response
=
new
CloudSignCallbackResponse
();
response
.
setStatusCode
(
0
);
response
.
setEventMsg
(
"回调通知成功."
);
return
ResponseData
.
ok
(
response
);
}
catch
(
Exception
e
)
{
log
.
error
(
"处理云签登录回调失败"
,
e
);
CloudSignCallbackResponse
response
=
new
CloudSignCallbackResponse
();
response
.
setStatusCode
(-
11
);
response
.
setEventMsg
(
"处理登录二维码请求失败, 系统异常."
);
return
ResponseData
.
ok
(
response
);
}
}
@PostMapping
(
"/getLoginByQrcodeResult"
)
@ApiOperation
(
value
=
"查询二维码扫码结果"
)
public
ResponseData
<
GetLoginResultResponse
>
getLoginByQrcodeResult
(
@RequestBody
GetLoginResultRequest
getLoginResultRequest
)
{
String
workNo
=
SpringContextUtils
.
getWorkNo
();
if
(
ObjectUtil
.
isEmpty
(
workNo
))
{
throw
new
ServiceException
(
"当前用户工号为空"
);
}
if
(
cloudSignProperties
.
getTestEnabled
())
{
getLoginResultRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getTestBusinessOrgCode
());
getLoginResultRequest
.
setBusinessSystemCode
(
cloudSignProperties
.
getTestBusinessSystemCode
());
getLoginResultRequest
.
setBusinessSystemAppID
(
cloudSignProperties
.
getTestBusinessSystemAppId
());
}
else
{
getLoginResultRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getBusinessOrgCode
());
getLoginResultRequest
.
setBusinessSystemCode
(
cloudSignProperties
.
getBusinessSystemCode
());
getLoginResultRequest
.
setBusinessSystemAppID
(
cloudSignProperties
.
getBusinessSystemAppld
());
}
GetLoginResultResponse
getLoginResult
=
cloudsignService
.
getLoginResult
(
getLoginResultRequest
);
return
ResponseData
.
ok
(
getLoginResult
);
}
@PostMapping
(
"/getCertInfo"
)
@ApiOperation
(
value
=
"获取Base64编码证书"
)
public
ResponseData
<
GetCertInfoResponse
>
getCertInfo
(
@RequestBody
GetCertInfoRequest
getCertInfoRequest
)
{
String
workNo
=
SpringContextUtils
.
getWorkNo
();
if
(
ObjectUtil
.
isEmpty
(
workNo
))
{
throw
new
ServiceException
(
"当前用户工号为空"
);
}
if
(
cloudSignProperties
.
getTestEnabled
())
{
getCertInfoRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getTestBusinessOrgCode
());
}
else
{
getCertInfoRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getBusinessOrgCode
());
}
GetCertInfoResponse
getCertInfo
=
cloudsignService
.
getCertInfo
(
getCertInfoRequest
);
return
ResponseData
.
ok
(
getCertInfo
);
}
@PostMapping
(
"/verifyData"
)
@ApiOperation
(
value
=
"云签证书数字签名验证"
)
public
ResponseData
<
VerifyDataResponse
>
verifyData
(
@RequestBody
VerifyDataRequest
verifyDataRequest
)
{
String
workNo
=
SpringContextUtils
.
getWorkNo
();
if
(
ObjectUtil
.
isEmpty
(
workNo
))
{
throw
new
ServiceException
(
"当前用户工号为空"
);
}
if
(
cloudSignProperties
.
getTestEnabled
())
{
verifyDataRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getTestBusinessOrgCode
());
}
else
{
verifyDataRequest
.
setBusinessOrgCode
(
cloudSignProperties
.
getBusinessOrgCode
());
}
VerifyDataResponse
verifyData
=
cloudsignService
.
verifyData
(
verifyDataRequest
);
return
ResponseData
.
ok
(
verifyData
);
}
}
jmai-sys/src/main/java/com/jmai/sys/aop/AuthAspect.java
View file @
2c397c16
...
...
@@ -156,6 +156,7 @@ public class AuthAspect extends AbstractService {
SpringContextUtils
.
set
(
USER_ID
,
userToken
.
getUserId
().
toString
());
SpringContextUtils
.
set
(
USER_NAME
,
userToken
.
getUserName
());
SpringContextUtils
.
set
(
USER_TYPE
,
userToken
.
getUserType
().
toString
());
SpringContextUtils
.
set
(
WORK_NO
,
userToken
.
getWorkNo
());
SpringContextUtils
.
set
(
DEPT_ID
,
userToken
.
getDeptId
().
toString
());
SpringContextUtils
.
set
(
AUTH_DEPT_LIST
,
userToken
.
getAuthDeptList
());
SpringContextUtils
.
set
(
ROLE_LIST
,
userToken
.
getRoleList
());
...
...
jmai-sys/src/main/java/com/jmai/sys/consts/HeaderCode.java
View file @
2c397c16
...
...
@@ -37,6 +37,7 @@ public interface HeaderCode {
String
USER_ID
=
"User-Id"
;
String
USER_NAME
=
"User-Name"
;
String
USER_TYPE
=
"User-Type"
;
String
WORK_NO
=
"Work-No"
;
String
DEPT_ID
=
"Dept-Id"
;
String
AUTH_DEPT_LIST
=
"Auth-Dept-List"
;
String
ROLE_LIST
=
"Role-List"
;
...
...
jmai-sys/src/main/java/com/jmai/sys/ctx/SpringContextUtils.java
View file @
2c397c16
...
...
@@ -173,6 +173,9 @@ public class SpringContextUtils implements ApplicationContextAware {
public
static
String
getUserName
()
{
return
get
(
HeaderCode
.
USER_NAME
);
}
public
static
String
getWorkNo
()
{
return
get
(
HeaderCode
.
WORK_NO
);
}
public
static
Long
getUserType
()
{
String
value
=
get
(
HeaderCode
.
USER_TYPE
);
return
Optional
.
ofNullable
(
value
)
...
...
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