Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
8fdb0447
Commit
8fdb0447
authored
Mar 06, 2023
by
“yiyousong”
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.scsmile.cn/zxf/smart_gov_platform
parents
3ad5b092
97549441
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
278 additions
and
624 deletions
+278
-624
base-manager/doc/api.md
base-manager/doc/api.md
+39
-624
base-manager/src/main/java/com/mortals/xhx/busiz/req/MidReq.java
...nager/src/main/java/com/mortals/xhx/busiz/req/MidReq.java
+17
-0
base-manager/src/main/java/com/mortals/xhx/busiz/rsp/SignResp.java
...ger/src/main/java/com/mortals/xhx/busiz/rsp/SignResp.java
+23
-0
base-manager/src/main/java/com/mortals/xhx/busiz/web/MidSignApiController.java
.../java/com/mortals/xhx/busiz/web/MidSignApiController.java
+127
-0
base-manager/src/main/java/com/mortals/xhx/common/utils/EncryptionUtils.java
...in/java/com/mortals/xhx/common/utils/EncryptionUtils.java
+63
-0
base-manager/src/test/java/com/mortals/httpclient/system/system.http
...r/src/test/java/com/mortals/httpclient/system/system.http
+9
-0
No files found.
base-manager/doc/api.md
View file @
8fdb0447
...
@@ -11502,644 +11502,59 @@ dict|object|字典对象
...
@@ -11502,644 +11502,59 @@ dict|object|字典对象
```
```
## 字典附录
## 微中台
### isBusiness
字典参数key|字典参数值|其它
---|---|---
0|一级业务|-
1|二级业务|-
### canorder
字典参数key|字典参数值|其它
---|---|---
1|允许|-
0|不允许|-
### cantake
字典参数key|字典参数值|其它
---|---|---
1|允许|-
0|不允许|-
### datashow
字典参数key|字典参数值|其它
---|---|---
1|展示|-
0|不展示|-
### status
字典参数key|字典参数值|其它
---|---|---
0|停用|-
1|正常|-
### isAutotable
字典参数key|字典参数值|其它
---|---|---
0|否|-
1|是|-
### isOrder
字典参数key|字典参数值|其它
---|---|---
0|否|-
1|是|-
### isBkb
字典参数key|字典参数值|其它
---|---|---
0|否|-
1|是|-
### isWorkGuide
字典参数key|字典参数值|其它
---|---|---
0|否|-
1|是|-
### usValid
字典参数key|字典参数值|其它
---|---|---
0|否|-
1|是|-
### isSecphone
字典参数key|字典参数值|其它
### 获取微中台签名信息
---|---|---
0|否|-
1|是|-
### isEnglish
字典参数key|字典参数值|其它
---|---|---
0|否|-
1|是|-
### source
字典参数key|字典参数值|其它
---|---|---
0|政务网|-
1|自定义|-
### source
字典参数key|字典参数值|其它
---|---|---
0|政务网|-
1|自定义|-
### filetype
字典参数key|字典参数值|其它
---|---|---
1|示例样表|-
2|空白表格|-
### source
字典参数key|字典参数值|其它
---|---|---
0|政务网|-
1|自定义|-
### source
字典参数key|字典参数值|其它
---|---|---
0|政务网|-
1|自定义|-
### source
字典参数key|字典参数值|其它
---|---|---
0|政务网|-
1|自定义|-
### source
字典参数key|字典参数值|其它
---|---|---
0|政务网|-
1|自定义|-
### policyType
字典参数key|字典参数值|其它
---|---|---
1|法律|-
2|行政法规|-
3|地方法规|-
4|部门规章|-
5|其他|-
6|政府规章|-
7|规范性文件|-
### source
字典参数key|字典参数值|其它
---|---|---
0|政务网|-
1|自定义|-
### messageoff
**请求URL:**
base/mid/sign
字典参数key|字典参数值|其它
---|---|---
1|开|-
0|关|-
### smsplatform
字典参数key|字典参数值|其它
---|---|---
1|容联|-
2|阿里云|-
3|移动|-
### type
字典参数key|字典参数值|其它
---|---|---
1|预约成功短信|-
2|取号成功短信|-
3|临近叫号短信|-
### online
字典参数key|字典参数值|其它
---|---|---
0|离线|-
1|在线|-
2|暂离|-
3|点击暂离|-
4|回归|-
5|登陆|-
### haveSonArea
字典参数key|字典参数值|其它
---|---|---
0|否|-
1|是|-
### workday1
字典参数key|字典参数值|其它
---|---|---
1|上班|-
0|不上|-
### workday2
字典参数key|字典参数值|其它
---|---|---
1|上班|-
0|不上|-
### workday3
字典参数key|字典参数值|其它
---|---|---
1|上班|-
0|不上|-
### workday4
字典参数key|字典参数值|其它
---|---|---
1|上班|-
0|不上|-
### workday5
字典参数key|字典参数值|其它
---|---|---
1|上班|-
0|不上|-
### workday6
字典参数key|字典参数值|其它
---|---|---
1|上班|-
0|不上|-
### workday7
字典参数key|字典参数值|其它
---|---|---
1|上班|-
0|不上|-
### isSite
字典参数key|字典参数值|其它
---|---|---
1|是|-
0|否|-
### status
字典参数key|字典参数值|其它
---|---|---
0|停用|-
1|正常|-
### hongqi
字典参数key|字典参数值|其它
---|---|---
1|是|-
0|否|-
### haveSonArea
字典参数key|字典参数值|其它
---|---|---
True|是|-
False|否|-
### haveSonDept
字典参数key|字典参数值|其它
---|---|---
True|是|-
False|否|-
### haveGetDept
字典参数key|字典参数值|其它
---|---|---
true|是|-
false|否|-
### haveGetMatterList
字典参数key|字典参数值|其它
---|---|---
true|是|-
false|否|-
### areaLevel
字典参数key|字典参数值|其它
---|---|---
1|省|-
2|地市州|-
3|区县|-
4|街道|-
5|社区|-
### status
字典参数key|字典参数值|其它
---|---|---
0|停用|-
1|正常|-
### isMust
**请求方式:**
POST
字典参数key|字典参数值|其它
---|---|---
非必要|非必要|-
必要|必要|-
必要|容缺后补|必要|容缺后补|-
非必要|容缺后补|非必要|容缺后补|-
### materialProperty
字典参数key|字典参数值|其它
---|---|---
纸质|纸质|-
电子|电子|-
纸质|电子|纸质|电子|-
### electronicgs
字典参数key|字典参数值|其它
---|---|---
无|无|-
不限|不限|-
jpg|jpg|-
jpeg|jpeg|-
pdf|pdf|-
word|word|-
pdf|jpg|jpeg|pdf|jpg|jpeg|-
pdf|jpg|pdf|jpg|-
### materialSource
字典参数key|字典参数值|其它
---|---|---
无|无|-
申请人自备|申请人自备|-
政府部门核发|政府部门核发|-
其他|其他|-
### jianmMs
字典参数key|字典参数值|其它
---|---|---
无|无|-
减|减|-
免|免|-
### isjianm
字典参数key|字典参数值|其它
---|---|---
否|否|-
是|是|-
### isLack
字典参数key|字典参数值|其它
---|---|---
必要|必要|-
非必要|非必要|-
### source
字典参数key|字典参数值|其它
---|---|---
0|政务网|-
1|自定义|-
### isBusiness
字典参数key|字典参数值|其它
---|---|---
0|一级业务|-
1|二级业务|-
### status
字典参数key|字典参数值|其它
---|---|---
0|停用|-
1|正常|-
### isShow
字典参数key|字典参数值|其它
---|---|---
1|是|-
0|否|-
### appoveObjectShow
字典参数key|字典参数值|其它
---|---|---
事业法人|事业法人|-
社会组织法人|社会组织法人|-
非法人企业|非法人企业|-
企业法人|企业法人|-
自然人|自然人|-
其他组织|其他组织|-
### operatScopeShow
字典参数key|字典参数值|其它
---|---|---
无|无|-
全国|全国|-
全市|全市|-
全县|全县|-
全镇[乡 街道]|全镇[乡 街道]|-
跨村[社区]|跨村[社区]|-
### appoveTimeLimitShow
字典参数key|字典参数值|其它
---|---|---
网络办件|网络办件|-
行政审批一般件|行政审批一般件|-
综合窗口件|综合窗口件|-
### handleType
字典参数key|字典参数值|其它
---|---|---
窗口办理|窗口办理|-
网上办理|网上办理|-
### isChargesShow
字典参数key|字典参数值|其它
---|---|---
否|否|-
是|是|-
### certificationLevelsShow
字典参数key|字典参数值|其它
---|---|---
实名认证|实名认证|-
单次面签|单次面签|-
每次面签|每次面签|-
### isOnlineSubscribeShow
字典参数key|字典参数值|其它
---|---|---
否|否|-
是|是|-
### isExpressTakeShow
字典参数key|字典参数值|其它
---|---|---
否|否|-
是|是|-
### isProvinceAcquisitionShow
字典参数key|字典参数值|其它
---|---|---
否|否|-
是|是|-
### isApplyProvinceShow
字典参数key|字典参数值|其它
---|---|---
否|否|-
是|是|-
### onlineType
字典参数key|字典参数值|其它
---|---|---
原件预审|原件预审|-
原件核验|原件核验|-
全程网办|全程网办|-
### onlineOperatDeep
字典参数key|字典参数值|其它
---|---|---
互联网咨询|互联网咨询|-
互联网收件|互联网收件|-
互联网预审|互联网预审|-
互联网受理|互联网受理|-
互联网办理|互联网办理|-
互联网办理结果信息反馈|互联网办理结果信息反馈|-
其他|其他|-
### isExpressTakeOnlineShow
字典参数key|字典参数值|其它
---|---|---
否|否|-
是|是|-
### isDoorTakeShow
字典参数key|字典参数值|其它
---|---|---
否|否|-
是|是|-
### eventTypeShow
字典参数key|字典参数值|其它
---|---|---
行政许可|行政许可|-
行政处罚|行政处罚|-
行政强制|行政强制|-
行政征收|行政征收|-
行政给付|行政给付|-
行政检查|行政检查|-
行政确认|行政确认|-
行政奖励|行政奖励|-
行政裁决|行政裁决|-
其他行政权力|其他行政权力|-
主动服务|主动服务|-
依申请服务|依申请服务|-
咨询查询|咨询查询|-
未归类事项|未归类事项|-
### performHierarchyShow
字典参数key|字典参数值|其它
---|---|---
省级|省级|-
市级|市级|-
县级|县级|-
镇[乡 街道]|镇[乡 街道]|-
村[社区]级|村[社区]级|-
### powerSourceShow
字典参数key|字典参数值|其它
---|---|---
法定本级行使|法定本级行使|-
上级下放|上级下放|-
上级授权|上级授权|-
同级授权|同级授权|-
上级委托|上级委托|-
同级委托|同级委托|-
### performDeptTypeShow
字典参数key|字典参数值|其它
---|---|---
法定机关|法定机关|-
授权组织|授权组织|-
受委托组织|受委托组织|-
### goveServiceCenterShow
字典参数key|字典参数值|其它
---|---|---
否|否|-
是|是|-
### isConvenientCenterShow
字典参数key|字典参数值|其它
---|---|---
否|否|-
是|是|-
### terminalHandle
字典参数key|字典参数值|其它
---|---|---
否|否|-
是|是|-
### isOnline
字典参数key|字典参数值|其它
**内容类型:**
application/json;charset=utf-8
---|---|---
否|否|-
是|是|-
### isOnlinePayShow
**简要描述:**
获取微中台签名信息
字典参数key|字典参数值|其它
**请求参数:**
---|---|---
否|否|-
是|是|-
### entrustmentDepartmen
参数名称|类型|必填|描述
:---|:---|:---|:------
method|String|是|请求方法(post或者get)
body|String|是|请求参数体
字典参数key|字典参数值|其它
**请求样例:**
---|---|---
```
否|否|-
{
是|是|-
"method":"post",
"body":"{\"test\":\"哈哈哈\"}"
}
```
**响应参数:**
### matterStatus
参数名称|参数类型|描述
:---|:---|:------
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|object|数据对象
 
appId|String|应用id
 
appKey|String|应用key
 
timeStamp|String|时间戳
 
nonce|String|随机数
 
secretKey|String|密码
 
sign|String|签名
字典参数key|字典参数值|其它
---|---|---
停用|停用|-
在用|在用|-
### source
**响应消息样例:**
```
{
"code":1,
"data":{
}
}
```
字典参数key|字典参数值|其它
---|---|---
0|政务网|-
1|自定义|-
##
# deviceType
##
字典附录
字典参数key|字典参数值|其它
---|---|---
pdj|排队机|-
ckp|窗口屏|-
hjq|呼叫器|-
jzxsp|集中显示屏|-
dsj|导视机|-
pjq|评级器|-
zzfwzd|自助服务终端|-
tdj|填单机|-
ybj|样表机|-
### imageResolution
字典参数key|字典参数值|其它
---|---|---
1|1920
*
1080|-
2|1080
*
1920|-
3|1280
*
1280|-
base-manager/src/main/java/com/mortals/xhx/busiz/req/MidReq.java
0 → 100644
View file @
8fdb0447
package
com.mortals.xhx.busiz.req
;
import
lombok.Data
;
/**
* 微中台请求接口
* @author:
* @date: 2023/3/2 18:08
*/
@Data
public
class
MidReq
{
private
String
method
;
private
String
body
;
}
base-manager/src/main/java/com/mortals/xhx/busiz/rsp/SignResp.java
0 → 100644
View file @
8fdb0447
package
com.mortals.xhx.busiz.rsp
;
import
lombok.Data
;
/**
* @author karlhoo
*/
@Data
public
class
SignResp
{
private
String
appId
;
private
String
appKey
;
private
String
timeStamp
;
private
String
nonce
;
private
String
secretKey
;
private
String
sign
;
}
base-manager/src/main/java/com/mortals/xhx/busiz/web/MidSignApiController.java
0 → 100644
View file @
8fdb0447
package
com.mortals.xhx.busiz.web
;
import
cn.hutool.core.codec.Base64
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.crypto.digest.DigestAlgorithm
;
import
cn.hutool.crypto.digest.Digester
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.busiz.req.MidReq
;
import
com.mortals.xhx.busiz.rsp.SignResp
;
import
com.mortals.xhx.common.utils.EncryptionUtils
;
import
com.mortals.xhx.module.dept.model.DeptEntity
;
import
com.mortals.xhx.module.dept.model.DeptQuery
;
import
com.mortals.xhx.module.dept.service.DeptService
;
import
com.mortals.xhx.module.matter.model.MatterEntity
;
import
com.mortals.xhx.module.matter.model.MatterQuery
;
import
com.mortals.xhx.module.matter.service.MatterService
;
import
com.mortals.xhx.module.site.model.SiteMatterEntity
;
import
com.mortals.xhx.module.site.model.SiteMatterQuery
;
import
com.mortals.xhx.module.site.service.SiteMatterService
;
import
com.mortals.xhx.module.window.model.WindowEntity
;
import
com.mortals.xhx.module.window.model.WindowMatterEntity
;
import
com.mortals.xhx.module.window.model.WindowMatterQuery
;
import
com.mortals.xhx.module.window.model.WindowQuery
;
import
com.mortals.xhx.module.window.service.WindowMatterService
;
import
com.mortals.xhx.module.window.service.WindowService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.client.CookieStore
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.impl.client.BasicCookieStore
;
import
org.apache.http.impl.client.HttpClientBuilder
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 微中台签名接口
*
* @author:
* @date: 2023/3/2 18:07
*/
@RestController
@RequestMapping
(
"mid"
)
@Slf4j
public
class
MidSignApiController
{
@Value
(
"${mid.appId:01C67D56D0630517}"
)
private
String
appId
;
@Value
(
"${mid.appKey:a0b946c858aa8d06}"
)
private
String
appKey
;
@Value
(
"${mid.secretKey:ad80c59e575a78ab}"
)
private
String
secretKey
;
@PostMapping
(
value
=
"sign"
)
@UnAuth
public
Rest
<
SignResp
>
midSign
(
@RequestBody
MidReq
midReq
)
{
SignResp
signResp
=
new
SignResp
();
try
{
Map
<
String
,
String
>
headerMap
=
new
HashMap
<>();
if
(
"post"
.
equalsIgnoreCase
(
midReq
.
getMethod
())){
headerMap
.
put
(
"appId"
,
appId
);
headerMap
.
put
(
"appKey"
,
appKey
);
JSONObject
object1
=
JSONObject
.
parseObject
(
midReq
.
getBody
());
headerMap
.
put
(
"body"
,
object1
.
toJSONString
());
String
timeStamp
=
System
.
currentTimeMillis
()
+
""
;
headerMap
.
put
(
"timeStamp"
,
timeStamp
);
String
nonce
=
RandomUtil
.
randomNumbers
(
6
);
headerMap
.
put
(
"nonce"
,
nonce
);
headerMap
.
put
(
"secretKey"
,
secretKey
);
signResp
.
setAppId
(
appId
);
signResp
.
setAppKey
(
appKey
);
signResp
.
setTimeStamp
(
timeStamp
);
signResp
.
setNonce
(
nonce
);
signResp
.
setSecretKey
(
secretKey
);
}
else
if
(
"get"
.
equalsIgnoreCase
(
midReq
.
getMethod
())){
HashMap
<
String
,
String
>
paramsMap
=
JSON
.
parseObject
(
midReq
.
getBody
(),
HashMap
.
class
);
if
(!
paramsMap
.
isEmpty
())
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
paramsMap
.
entrySet
())
{
headerMap
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
}
StringBuilder
signSb
=
new
StringBuilder
();
signSb
.
append
(
"appId"
).
append
(
"="
).
append
(
headerMap
.
get
(
"appId"
)).
append
(
"&"
);
signSb
.
append
(
"appKey"
).
append
(
"="
).
append
(
headerMap
.
get
(
"appKey"
)).
append
(
"&"
);
signSb
.
append
(
"body"
).
append
(
"="
).
append
(
headerMap
.
get
(
"body"
)).
append
(
"&"
);
signSb
.
append
(
"nonce"
).
append
(
"="
).
append
(
headerMap
.
get
(
"nonce"
)).
append
(
"&"
);
signSb
.
append
(
"secretKey"
).
append
(
"="
).
append
(
headerMap
.
get
(
"secretKey"
)).
append
(
"&"
);
signSb
.
append
(
"timeStamp"
).
append
(
"="
).
append
(
headerMap
.
get
(
"timeStamp"
)).
append
(
"&"
);
/* for (Map.Entry<String, String> params : headerMap.entrySet()) {
signSb.append(params.getKey()).append("=").append(params.getValue() + "").append("&");
}*/
String
signStr
=
signSb
.
substring
(
0
,
signSb
.
length
()
-
1
);
log
.
info
(
"签名源字符串: "
+
signStr
);
String
sign
=
EncryptionUtils
.
SHA256
(
signStr
);
log
.
info
(
"签名计算结果: "
+
sign
);
signResp
.
setSign
(
sign
);
return
Rest
.
ok
(
signResp
);
}
catch
(
Exception
e
)
{
log
.
error
(
"签名异常"
,
e
);
return
Rest
.
fail
(
"签名异常!"
);
}
}
}
base-manager/src/main/java/com/mortals/xhx/common/utils/EncryptionUtils.java
0 → 100644
View file @
8fdb0447
package
com.mortals.xhx.common.utils
;
import
lombok.extern.slf4j.Slf4j
;
import
java.security.MessageDigest
;
@Slf4j
public
class
EncryptionUtils
{
private
enum
DigestType
{
MD5
(
"MD5"
),
SHA
(
"SHA"
),
SHA256
(
"SHA-256"
);
private
String
name
;
private
DigestType
(
String
name
){
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
}
private
final
static
String
digest
(
String
sourceStr
,
DigestType
type
)
{
char
hexDigits
[]={
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
};
try
{
byte
[]
btInput
=
sourceStr
.
getBytes
();
// 获得摘要算法的 MessageDigest 对象
MessageDigest
mdInst
=
MessageDigest
.
getInstance
(
type
.
name
);
// 使用指定的字节更新摘要
mdInst
.
update
(
btInput
);
// 获得密文
byte
[]
md
=
mdInst
.
digest
();
// 把密文转换成十六进制的字符串形式
int
length
=
md
.
length
;
char
str
[]
=
new
char
[
length
*
2
];
int
k
=
0
;
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
byte
byte0
=
md
[
i
];
str
[
k
++]
=
hexDigits
[
byte0
>>>
4
&
0xf
];
str
[
k
++]
=
hexDigits
[
byte0
&
0xf
];
}
return
new
String
(
str
);
}
catch
(
Exception
e
)
{
log
.
error
(
"签名失败"
,
e
);
return
""
;
}
}
public
final
static
String
MD5
(
String
s
)
{
return
digest
(
s
,
DigestType
.
MD5
);
}
public
final
static
String
SHA
(
String
s
)
{
return
digest
(
s
,
DigestType
.
SHA
);
}
public
final
static
String
SHA256
(
String
s
){
return
digest
(
s
,
DigestType
.
SHA256
);
}
}
base-manager/src/test/java/com/mortals/httpclient/system/system.http
View file @
8fdb0447
...
@@ -84,6 +84,15 @@ Content-Type: application/json
...
@@ -84,6 +84,15 @@ Content-Type: application/json
{}
{}
###midsign
POST {{baseUrl}}/mid/sign
Content-Type: application/json
{
"method":"post",
"body":"{\"test\":\"哈哈哈\"}"
}
###短信设置编辑
###短信设置编辑
GET {{baseUrl}}/sms/set/edit?id={{SmsSet_id}}
GET {{baseUrl}}/sms/set/edit?id={{SmsSet_id}}
Accept: application/json
Accept: application/json
...
...
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