Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Q
queueForTicket_bl
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
mengmeng
queueForTicket_bl
Commits
ecbfe5ad
Commit
ecbfe5ad
authored
Mar 09, 2021
by
lings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
浙里办等
parent
407909bd
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
256 additions
and
126 deletions
+256
-126
ZhelibanAPP.java
hmit-api/src/main/java/io/hmit/config/ZhelibanAPP.java
+4
-3
ZhelibanUtils.java
hmit-api/src/main/java/io/hmit/config/ZhelibanUtils.java
+6
-67
ApiLoginController.java
.../src/main/java/io/hmit/controller/ApiLoginController.java
+27
-40
AppointmentOrderController.java
...es/appointment/controller/AppointmentOrderController.java
+45
-14
AppointmentOrderDTO.java
.../io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
+2
-0
YynumberDTO.java
...ain/java/io/hmit/modules/appointment/dto/YynumberDTO.java
+12
-1
AppointmentOrderEntity.java
...it/modules/appointment/entity/AppointmentOrderEntity.java
+5
-0
AppointmentOrderService.java
.../modules/appointment/service/AppointmentOrderService.java
+7
-0
AppointmentOrderServiceImpl.java
...appointment/service/impl/AppointmentOrderServiceImpl.java
+35
-0
UserService.java
hmit-api/src/main/java/io/hmit/service/UserService.java
+2
-0
UserServiceImpl.java
...i/src/main/java/io/hmit/service/impl/UserServiceImpl.java
+7
-1
DateUtils.java
...-common/src/main/java/io/hmit/common/utils/DateUtils.java
+40
-0
HttpRequestUtil.java
...n/src/main/java/io/hmit/common/utils/HttpRequestUtil.java
+64
-0
No files found.
hmit-api/src/main/java/io/hmit/config/ZhelibanAPP.java
View file @
ecbfe5ad
...
...
@@ -21,9 +21,10 @@ public class ZhelibanAPP {
//手机
public
static
final
String
SERVICE_CODE
=
"fhcjrzdpyc"
;
public
static
final
String
SERVICE_PASS
=
"fhcjrzdpycpwd"
;
public
static
final
String
APP_BASE_URL
=
"https://puser.zjzwfw.gov.cn/sso/servlet/simpleauth?method="
;
public
static
final
String
SERVICE_CODE
=
"blzwfwyyqhxt"
;
public
static
final
String
SERVICE_PASS
=
"blzwfwyyqhxtpwd"
;
// public static final String APP_BASE_URL = "https://puser.zjzwfw.gov.cn/sso/servlet/simpleauth?method=";
public
static
final
String
APP_BASE_URL
=
"https://appapi.zjzwfw.gov.cn/sso/servlet/simpleauth?method="
;
public
static
final
String
VALIDATION_TICKET
=
"ticketValidation"
;
public
static
final
String
USER_INFO
=
"getUserInfo"
;
...
...
hmit-api/src/main/java/io/hmit/config/ZhelibanUtils.java
View file @
ecbfe5ad
...
...
@@ -123,14 +123,13 @@ public class ZhelibanUtils {
}
public
static
Map
<
String
,
Object
>
getUserInfo
(
Map
<
String
,
Object
>
map
)
{
Map
<
String
,
Object
>
result_map
=
ZhelibanUtils
.
getAppToken
(
map
);
String
current_time
=
String
.
valueOf
(
new
Date
().
getTime
());
String
current_time
=
DateUtils
.
format
(
new
Date
(),
"yyyyMMddHHmmss"
);
if
(
result_map
!=
null
){
System
.
out
.
println
(
result_map
);
if
(
"0"
.
equals
(
result_map
.
get
(
"result"
).
toString
())){
String
params_vailidation
=
"&servicecode="
+
ZhelibanAPP
.
SERVICE_CODE
+
"&time="
+
current_time
+
"&sign="
+
MD5
.
md5
(
ZhelibanAPP
.
SERVICE_CODE
+
ZhelibanAPP
.
SERVICE_PASS
+
current_time
)+
"&token="
+
result_map
.
get
(
"token"
).
toString
()+
"&datatype=json"
;
// String user_result = HttpRequestUtil.sendGet(ZhelibanAPP.APP_BASE_URL);
String
user_result
=
"ssss"
;
System
.
out
.
println
(
" ---------------- aaa ----------- "
+
user_result
);
String
user_result
=
HttpRequestUtil
.
sendZlbGet
(
ZhelibanAPP
.
APP_BASE_URL
+
ZhelibanAPP
.
USER_INFO
,
params_vailidation
);
return
new
Gson
().
fromJson
(
user_result
,
new
TypeToken
<
Map
<
String
,
Object
>>()
{
}.
getType
());
}
else
{
...
...
@@ -151,41 +150,7 @@ public class ZhelibanUtils {
}.
getType
());
}
/***
* 验证令牌并获取用户的登录信息
*
* @param ssotoken
*/
public
static
JSONObject
doQuery
(
String
ssotoken
,
String
projectId
,
String
projectSecret
)
{
JSONObject
param
=
new
JSONObject
();
param
.
put
(
"token"
,
ssotoken
);
// 获取请求签名值
// String signature = DigestHelper.getSignature(param.toString(), projectSecret);
String
signature
=
"ss"
;
// 设置请求的Headers头信息
LinkedHashMap
<
String
,
String
>
headers
=
new
LinkedHashMap
<
String
,
String
>();
headers
.
put
(
"x-esso-project-id"
,
projectId
);
headers
.
put
(
"x-esso-signature"
,
signature
);
headers
.
put
(
"Content-Type"
,
"application/json"
);
headers
.
put
(
"Charset"
,
"UTF-8"
);
// 验证令牌并获取用户的登录信息接口调用地址
String
QUERY_URL
=
"http://ssoapi.zjzwfw.gov.cn/rest/user/query"
;
JSONObject
jsonObj
=
sendPOST
(
QUERY_URL
,
param
.
toString
(),
headers
);
if
(
null
!=
jsonObj
)
{
int
errCode
=
jsonObj
.
getInt
(
"errCode"
);
String
msg
=
jsonObj
.
getString
(
"msg"
);
if
(
0
==
errCode
)
{
/* 用户信息 */
String
info
=
jsonObj
.
getString
(
"info"
);
System
.
out
.
println
(
"用户信息 = "
+
info
);
}
else
{
System
.
out
.
println
(
"验证令牌并获取用户的登录信息失败:"
+
msg
);
}
}
return
jsonObj
;
}
/***
* 向指定URL发送POST方法的请求
...
...
@@ -274,10 +239,9 @@ public class ZhelibanUtils {
public
static
Map
<
String
,
Object
>
getAppToken
(
Map
<
String
,
Object
>
map
)
{
// String current_time = DateUtils.getCurrentTimes();
String
current_time
=
String
.
valueOf
(
new
Date
().
getTime
()
);
String
current_time
=
DateUtils
.
format
(
new
Date
(),
"yyyyMMddHHmmss"
);
String
params_vailidation
=
"&servicecode="
+
ZhelibanAPP
.
SERVICE_CODE
+
"&time="
+
current_time
+
"&sign="
+
MD5
.
md5
(
ZhelibanAPP
.
SERVICE_CODE
+
ZhelibanAPP
.
SERVICE_PASS
+
current_time
)+
"&st="
+
map
.
get
(
"ticket"
).
toString
()+
"&datatype=json"
;
// String valid_result = HttpRequestUtil.sendGet(ZhelibanAPP.APP_BASE_URL+ZhelibanAPP.VALIDATION_TICKET);
String
valid_result
=
"sss"
;
String
valid_result
=
HttpRequestUtil
.
sendZlbGet
(
ZhelibanAPP
.
APP_BASE_URL
+
ZhelibanAPP
.
VALIDATION_TICKET
,
params_vailidation
);
return
new
Gson
().
fromJson
(
valid_result
,
new
TypeToken
<
Map
<
String
,
Object
>>()
{
}.
getType
());
}
...
...
@@ -423,7 +387,7 @@ public class ZhelibanUtils {
return
result
;
}
public
static
JSONObject
HttpRequestGetUserInfoByMobile
(
String
request
,
Map
<
String
,
Object
>
headParam
,
String
type
){
@SuppressWarnings
(
"unused"
)
JSONObject
jsonObject
=
null
;
StringBuffer
buffer
=
new
StringBuffer
();
try
{
...
...
@@ -457,27 +421,7 @@ public class ZhelibanUtils {
return
jsonObject
;
}
/* public static void pushMessageToUser(String title, String content, String action, String departmentLabel) {
CaiYunUtil caiYunUtil = new CaiYunUtil();
caiYunUtil.pushMessageTo(title, content, action, departmentLabel);
}*/
/*public static void pushMessageTo(String title, String content, String action, String departmentLabel) {
String[] s1 = null;
List<String> stringList = yspQueryService.queryMobileByDepartmentLabel(departmentLabel);
for (int i = 0; i < stringList.size(); i++) {
Map map = CaiYunUtil.getUserInfoByMobile(CaiYunUtil.getAccessToken().get("accessToken").toString(), yspQueryService.getOrgSecret(), stringList.get(i));
s1[i] = map.get("uid").toString();
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("title", title);
jsonObject.put("content", content);
jsonObject.put("action", action);
jsonObject.put("receivers", s1);
CaiYunUtil.pushMessage(yspQueryService.getAccessToken(), yspQueryService.getOrgSecret(), null, jsonObject.toString());
}*/
private
static
String
getUtf8Url
(
String
url
)
{
char
[]
chars
=
url
.
toCharArray
();
...
...
@@ -571,11 +515,6 @@ public class ZhelibanUtils {
}
public
static
void
main
(
String
[]
args
)
throws
UnsupportedEncodingException
,
NoSuchAlgorithmException
{
//System.out.println(URLEncoder.encode("给付", "UTF-8"));
//System.out.println(StringEscapeUtils.unescapeHtml("给付"));
//System.out.println(StringEscapeUtils.unescapeHtml("\\u7ED9\\u4ED8"));
//7.StringEscapeUtils
//输出结果为<html>
System
.
out
.
println
(
StringEscapeUtils
.
escapeJava
(
"String"
));
...
...
hmit-api/src/main/java/io/hmit/controller/ApiLoginController.java
View file @
ecbfe5ad
package
io
.
hmit
.
controller
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
io.hmit.annotation.Login
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.utils.Result
;
import
io.hmit.common.validator.ValidatorUtils
;
import
io.hmit.config.ZhelibanUtils
;
import
io.hmit.dto.LoginDTO
;
import
io.hmit.entity.TokenEntity
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.service.TokenService
;
import
io.hmit.service.UserService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -19,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.UUID
;
...
...
@@ -62,13 +68,17 @@ public class ApiLoginController {
//个人登录 - 单点登陆
@RequestMapping
(
value
=
"/check_user"
)
@ResponseBody
public
void
checkUser
(
@RequestParam
Map
<
String
,
Object
>
map
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
UnsupportedEncodingException
{
@ApiOperation
(
"单点登录"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ticket"
,
value
=
"票据"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"String"
)
,
})
public
Result
checkUser
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
map
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
UnsupportedEncodingException
{
// 获取到票据信息ticket
System
.
out
.
println
(
"开始进入这个checkuser了————————————————————"
);
System
.
out
.
println
(
map
);
String
redirectUrl
=
""
;
String
Token
=
""
;
Long
userId
;
Map
<
String
,
Object
>
userMap
=
new
HashMap
<>()
;
if
(
map
.
get
(
"ticket"
)
!=
null
){
System
.
out
.
println
(
"Ticket 是"
+
map
.
get
(
"ticket"
)+
"——————————————————————"
);
...
...
@@ -76,53 +86,30 @@ public class ApiLoginController {
System
.
out
.
println
(
"UserMap是——————————————————————————————"
);
System
.
out
.
println
(
user_map
);
if
(
user_map
.
get
(
"idnum"
)
!=
null
){
System
.
out
.
println
(
user_map
.
get
(
"idnum"
));
String
params
=
"idnum="
+
URLEncoder
.
encode
(
user_map
.
get
(
"idnum"
).
toString
(),
"UTF8"
)+
"&mobile="
+
URLEncoder
.
encode
(
user_map
.
get
(
"mobile"
).
toString
(),
"UTF8"
)+
"&username="
+
URLEncoder
.
encode
(
user_map
.
get
(
"username"
).
toString
(),
"UTF8"
);
if
(
map
.
get
(
"sp"
)
!=
null
)
{
redirectUrl
=
map
.
get
(
"sp"
)
+
"?"
+
params
;
}
//判断是否已经存在了这条信息
//
UserEntity oldUser=userService.queryByIdnum(URLEncoder.encode(user_map.get("idnum").toString(), "UTF8"));
UserEntity
oldUser
=
userService
.
getUserByUserId
(
222L
);
UserEntity
oldUser
=
userService
.
queryByIdnum
(
URLEncoder
.
encode
(
user_map
.
get
(
"idnum"
).
toString
(),
"UTF8"
));
if
(
oldUser
==
null
){
//将获得的信息保存到个人登陆表
UserEntity
user
=
new
UserEntity
();
user
.
setUsername
(
user_map
.
get
(
"username"
).
toString
());
user
.
setMobile
(
URLEncoder
.
encode
(
user_map
.
get
(
"mobile"
).
toString
(),
"UTF8"
));
user
.
setPassword
(
URLEncoder
.
encode
(
user_map
.
get
(
"idnum"
).
toString
(),
"UTF8"
));
// userService.save(user);
// //将获得的信息保存到个人信息表
// CjroneDisabledPersonEntity disabledPersonEntity=new CjroneDisabledPersonEntity();
// disabledPersonEntity.setName(user_map.get("username").toString());
// // disabledPersonEntity.setMobilePhone(URLEncoder.encode(user_map.get("mobile").toString(), "UTF8"));
// disabledPersonEntity.setIdCard(URLEncoder.encode(user_map.get("idnum").toString(), "UTF8"));
// // disabledPersonEntity.setSex(URLEncoder.encode(user_map.get("sex").toString(), "UTF8"));
// disabledPersonEntity.setPostcode(URLEncoder.encode(user_map.get("postcode").toString(), "UTF8"));
// disabledPersonEntity.setBirthday(URLEncoder.encode(user_map.get("birthday").toString(), "UTF8"));
// disabledPersonEntity.setPresentAddress(user_map.get("homeaddress").toString());
// cjroneDisabledPersonService.save(disabledPersonEntity);
}
//生成token返回
// UserEntity tbuser=userService.queryByIdnum(URLEncoder.encode(user_map.get("idnum").toString(), "UTF8"));
// Token = jwtUtils.generateToken(tbuser.getUserId());
user
.
setIdCardNo
(
URLEncoder
.
encode
(
user_map
.
get
(
"idnum"
).
toString
(),
"UTF8"
));
userService
.
insert
(
user
);
}
userId
=
user
.
getId
();
}
else
{
//return R.error().put("msg","票据信息不能为空!");
if
(
map
.
get
(
"sp"
)
!=
null
)
{
redirectUrl
=
map
.
get
(
"sp"
).
toString
()+
"?1=1"
;
userId
=
oldUser
.
getId
();
}
TokenEntity
tokenEntity
=
tokenService
.
createToken
(
userId
);
userMap
.
put
(
"token"
,
tokenEntity
.
getToken
());
userMap
.
put
(
"expire"
,
tokenEntity
.
getExpireDate
().
getTime
()
-
System
.
currentTimeMillis
());
}
return
new
Result
().
ok
(
userMap
);
}
else
{
return
new
Result
().
error
(
"票据信息为空"
);
}
String
record_id
=
UUID
.
randomUUID
().
toString
();
System
.
out
.
println
(
"Url: "
+
redirectUrl
+
"&recordId="
+
record_id
+
"&token="
+
Token
);
response
.
setHeader
(
"refresh"
,
"1;URL="
+
redirectUrl
+
"&recordId="
+
record_id
+
"&token="
+
Token
);
}
}
hmit-api/src/main/java/io/hmit/modules/appointment/controller/AppointmentOrderController.java
View file @
ecbfe5ad
...
...
@@ -2,6 +2,7 @@ package io.hmit.modules.appointment.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.gson.JsonObject
;
import
io.hmit.annotation.LoginUser
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.utils.ConvertUtils
;
...
...
@@ -14,6 +15,7 @@ import io.hmit.common.validator.ValidatorUtils;
import
io.hmit.common.validator.group.AddGroup
;
import
io.hmit.common.validator.group.DefaultGroup
;
import
io.hmit.common.validator.group.UpdateGroup
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.appointment.dto.*
;
import
io.hmit.modules.appointment.entity.AppointmentOrderEntity
;
import
io.hmit.modules.appointment.service.AppointmentOrderService
;
...
...
@@ -56,10 +58,19 @@ public class AppointmentOrderController {
@ApiImplicitParam
(
name
=
Constant
.
PAGE
,
value
=
"当前页码,从1开始"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
LIMIT
,
value
=
"每页显示记录数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER_FIELD
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER
,
value
=
"排序方式,可选值(asc、desc)"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
Constant
.
ORDER
,
value
=
"排序方式,可选值(asc、desc)"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"appointmentIdCard"
,
value
=
"预约人身份证"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"appointmentPhone"
,
value
=
"预约人电话"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Result
<
PageData
<
AppointmentOrderDTO
>>
page
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
PageData
<
AppointmentOrderDTO
>
page
=
appointmentOrderService
.
page
(
params
);
page
.
getList
().
forEach
(
l
->{
//判断已取号或者消除过号
if
(
null
!=
l
.
getStatus
()
&&(
2
==
l
.
getStatus
()
||
4
==
l
.
getStatus
())
){
YynumberDTO
yynumberDTO
=
appointmentOrderService
.
findByYuNumber
(
l
.
getAppointmentNum
());
l
.
setYynumberDTO
(
yynumberDTO
);
}
});
return
new
Result
<
PageData
<
AppointmentOrderDTO
>>().
ok
(
page
);
}
...
...
@@ -68,7 +79,9 @@ public class AppointmentOrderController {
@ApiOperation
(
"信息,预约详情接口"
)
public
Result
<
AppointmentOrderDTO
>
get
(
@PathVariable
(
"id"
)
Long
id
){
AppointmentOrderDTO
data
=
appointmentOrderService
.
get
(
id
);
if
(
null
!=
data
.
getStatus
()
&&(
2
==
data
.
getStatus
()
||
4
==
data
.
getStatus
())
)
{
data
.
setYynumberDTO
(
appointmentOrderService
.
findByYuNumber
(
data
.
getAppointmentNum
()));
}
return
new
Result
<
AppointmentOrderDTO
>().
ok
(
data
);
}
...
...
@@ -140,6 +153,19 @@ public class AppointmentOrderController {
return
new
Result
();
}
@GetMapping
(
"/deleteOverNum/{id}"
)
@ApiOperation
(
"消除过号"
)
public
Result
deleteOverNum
(
@PathVariable
(
"id"
)
Long
id
,
@ApiIgnore
@LoginUser
UserEntity
user
){
AppointmentOrderDTO
data
=
appointmentOrderService
.
get
(
id
);
data
.
setStatus
(
4
);
data
.
setStatusName
(
"已消除过号"
);
data
.
setUpdateDate
(
new
Date
());
data
.
setUpdater
(
user
.
getId
());
appointmentOrderService
.
update
(
data
);
return
new
Result
();
}
@GetMapping
(
value
=
"/signin/{appointmentOrderId}"
)
@ApiOperation
(
"签到"
)
...
...
@@ -164,18 +190,23 @@ public class AppointmentOrderController {
"&sTel="
+
appointmentPhone
+
"&sName="
+
appointmentPerson
+
"&sCardID="
+
appointmentIdCard
;
String
Url
=
"http://www.nb-fh.cn/getAllarticleCast"
;
String
s
=
HttpRequestUtil
.
sendGetAndRetrieveContent
(
Url
);
JSONObject
json
=
JSONObject
.
parseObject
(
s
);
String
s
=
HttpRequestUtil
.
sendGetAndRetrieveContent
(
url
);
YynumberDTO
yynumberDTO
=
JSONObject
.
parseObject
(
s
,
YynumberDTO
.
class
);
//根据接口返回的结果更新预约单号
if
(
"0"
.
equals
(
yynumberDTO
.
getNStatus
())){
appointmentOrderDTO
.
setAppointmentNum
(
yynumberDTO
.
getSPaperNumber
());
appointmentOrderDTO
.
setTicketDate
(
yynumberDTO
.
getSRegTime
());
appointmentOrderDTO
.
setWaitNum
(
yynumberDTO
.
getNWait
());
appointmentOrderDTO
.
setServiceWindow
(
yynumberDTO
.
getListWin
().
toString
());
appointmentOrderDTO
.
setStatus
(
2
);
appointmentOrderDTO
.
setStatusName
(
"签到"
);
appointmentOrderDTO
.
setUpdateDate
(
new
Date
());
appointmentOrderService
.
update
(
appointmentOrderDTO
);
return
new
Result
();
}
else
{
return
new
Result
().
error
(
yynumberDTO
.
getSMsg
());
}
}
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
View file @
ecbfe5ad
...
...
@@ -93,6 +93,8 @@ public class AppointmentOrderDTO implements Serializable {
@ApiModelProperty
(
value
=
"等候人数"
)
private
Integer
waitNum
;
private
YynumberDTO
yynumberDTO
;
public
AppointmentOrderDTO
assembleAppointmentOrderDTO
(
ReservationDTO
reservationDTO
){
AppointmentOrderDTO
dto
=
new
AppointmentOrderDTO
();
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/dto/YynumberDTO.java
View file @
ecbfe5ad
package
io
.
hmit
.
modules
.
appointment
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
@ApiModel
(
value
=
"取号后的号码信息"
)
public
class
YynumberDTO
{
/**
...
...
@@ -16,15 +19,23 @@ public class YynumberDTO {
* sQueueName : 预约-交通违法处理
* listWin : ["B03","B04","B05","B06"]
*/
@ApiModelProperty
(
value
=
"0:正确号码,号码未呼,有等候人数,人数在 nWait,1:正确号码,号码已呼,呼叫时间在sCallTime,2:无效号码,3:其它错误,4:输入查询参数错误"
)
private
int
nStatus
;
@ApiModelProperty
(
value
=
"错误的消息提示语,字符串"
)
private
String
sMsg
;
@ApiModelProperty
(
value
=
"预约信息唯一ID"
)
private
String
sPaperNumber
;
@ApiModelProperty
(
value
=
" 整数,等候人数"
)
private
int
nWait
;
@ApiModelProperty
(
value
=
"预约信息唯一ID"
)
private
int
nid
;
@ApiModelProperty
(
value
=
"号码取号时间 格式2018-12-21 13:49:21"
)
private
String
sRegTime
;
@ApiModelProperty
(
value
=
"号码被呼叫的时间 格式 2018-12-21 13:51:21"
)
private
String
sCallTime
;
@ApiModelProperty
(
value
=
"业务名称"
)
private
String
sQueueName
;
@ApiModelProperty
(
value
=
"字符串数组,对应办理窗口"
)
private
List
<
String
>
listWin
;
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/entity/AppointmentOrderEntity.java
View file @
ecbfe5ad
...
...
@@ -3,6 +3,7 @@ package io.hmit.modules.appointment.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.hmit.common.entity.BaseEntity
;
import
io.hmit.modules.appointment.dto.YynumberDTO
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
...
...
@@ -110,4 +111,8 @@ public class AppointmentOrderEntity extends BaseEntity {
*/
private
Integer
waitNum
;
@TableField
(
exist
=
false
)
private
YynumberDTO
yynumberDTO
;
}
hmit-api/src/main/java/io/hmit/modules/appointment/service/AppointmentOrderService.java
View file @
ecbfe5ad
...
...
@@ -4,7 +4,10 @@ import io.hmit.common.page.PageData;
import
io.hmit.common.service.CrudService
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.dto.ReservationOrderInfoDTO
;
import
io.hmit.modules.appointment.dto.YynumberDTO
;
import
io.hmit.modules.appointment.entity.AppointmentOrderEntity
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -21,10 +24,14 @@ public interface AppointmentOrderService extends CrudService<AppointmentOrderEnt
// PageData<AppointmentOrderDTO> getAppointmentInfoPage(Map<String, Object> params, String identity);
List
<
ReservationOrderInfoDTO
>
getAppointmentInfoPage
(
String
identity
);
// PageData<AppointmentOrderDTO> page(Map<String, Object> params);
Integer
waitingNum
(
String
appointmentTime
);
Integer
serviceWaitingNum
(
Long
serviceId
);
YynumberDTO
findByYuNumber
(
String
sPaperNumber
);
}
hmit-api/src/main/java/io/hmit/modules/appointment/service/impl/AppointmentOrderServiceImpl.java
View file @
ecbfe5ad
package
io
.
hmit
.
modules
.
appointment
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
io.hmit.common.constant.Constant
;
...
...
@@ -7,14 +8,20 @@ import io.hmit.common.page.PageData;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.DateUtils
;
import
io.hmit.common.utils.HttpRequestUtil
;
import
io.hmit.common.utils.MD5
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.appointment.dao.AppointmentOrderDao
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.dto.ReservationOrderInfoDTO
;
import
io.hmit.modules.appointment.dto.YynumberDTO
;
import
io.hmit.modules.appointment.entity.AppointmentOrderEntity
;
import
io.hmit.modules.appointment.service.AppointmentOrderService
;
import
io.hmit.modules.appointment.service.AppointmentServiceService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.annotation.Resource
;
import
java.util.*
;
...
...
@@ -30,6 +37,8 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
@Resource
private
AppointmentOrderDao
appointmentOrderDao
;
@Resource
private
AppointmentOrderService
appointmentOrderService
;
@Resource
private
AppointmentServiceService
appointmentServiceService
;
...
...
@@ -109,6 +118,20 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
}
*/
// public PageData<AppointmentOrderDTO> page( Map<String, Object> params){
// //分页
// IPage<AppointmentOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
//
// //查询
//// List<AppointmentOrderEntity> list = appointmentOrderDao.;
//
//// for (AppointmentOrderEntity appointmentOrderEntity : list) {
//// YynumberDTO yynumberDTO = appointmentOrderService.findByYuNumber(appointmentOrderEntity.getAppointmentNum());
//// appointmentOrderEntity.setYynumberDTO(yynumberDTO);
//// }
// return getPageData(list, page.getTotal(), AppointmentOrderDTO.class);
// }
@Override
public
Integer
waitingNum
(
String
appointmentTime
)
{
...
...
@@ -121,5 +144,17 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
return
appointmentOrderDao
.
serviceWaitingNum
(
serviceId
)
;
}
@Override
public
YynumberDTO
findByYuNumber
(
String
sPaperNumber
)
{
//调用取号机接口,。
// String url = "http://IP:8223/smartqueue/getpaperwait?sPaperNumber=" +sPaperNumber;
String
url
=
"http://IP:8223/smartqueue/getpaperwait?sPaperNumber="
+
sPaperNumber
;
// String s = HttpRequestUtil.sendGetAndRetrieveContent(url);
String
s
=
"{\"nStatus\":1,\"sMsg\":\"号码已被呼叫\",\"nWait\":0,\"sCallTime\":\"2021-03-08 16:27:09\",\"sRegTime\":\"2021-03-08 16:26:55\",\"sQueueName\":\"不动产档案查询\",\"listWin\":[\"38号窗口\",\"39号窗口\",\"40号窗口\",\"41号窗口\",\"42号窗口\",\"43号窗口\"]}"
;
YynumberDTO
yynumberDTO
=
JSONObject
.
parseObject
(
s
,
YynumberDTO
.
class
);
return
yynumberDTO
;
}
}
hmit-api/src/main/java/io/hmit/service/UserService.java
View file @
ecbfe5ad
...
...
@@ -17,6 +17,8 @@ public interface UserService extends BaseService<UserEntity> {
UserEntity
getUserByUserId
(
Long
userId
);
UserEntity
queryByIdnum
(
String
idnum
);
/**
* 用户登录
*
...
...
hmit-api/src/main/java/io/hmit/service/impl/UserServiceImpl.java
View file @
ecbfe5ad
package
io
.
hmit
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.hmit.common.exception.ErrorCode
;
import
io.hmit.common.exception.HmitException
;
import
io.hmit.common.service.impl.BaseServiceImpl
;
...
...
@@ -33,6 +34,11 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return
baseDao
.
getUserByUserId
(
userId
);
}
@Override
public
UserEntity
queryByIdnum
(
String
idnum
)
{
return
baseDao
.
selectOne
(
new
QueryWrapper
<
UserEntity
>().
eq
(
"id_card_no"
,
idnum
));
}
@Override
public
Map
<
String
,
Object
>
login
(
LoginDTO
dto
)
{
...
...
hmit-common/src/main/java/io/hmit/common/utils/DateUtils.java
View file @
ecbfe5ad
...
...
@@ -196,6 +196,46 @@ public class DateUtils {
return
dateTime
.
plusYears
(
years
).
toDate
();
}
public
static
String
getCurrentTimes
()
{
Calendar
c
=
Calendar
.
getInstance
();
//可以对每个时间域单独修改
int
year
=
c
.
get
(
Calendar
.
YEAR
);
int
month
=
c
.
get
(
Calendar
.
MONTH
)
+
1
;
int
date
=
c
.
get
(
Calendar
.
DATE
);
int
hour
=
c
.
get
(
Calendar
.
HOUR_OF_DAY
);
int
minute
=
c
.
get
(
Calendar
.
MINUTE
);
int
second
=
c
.
get
(
Calendar
.
SECOND
);
String
year1
=
String
.
valueOf
(
year
);
if
(
year
<
10
){
year1
=
"0"
+
year1
;
}
String
month1
=
String
.
valueOf
(
month
);
if
(
month
<
10
){
month1
=
"0"
+
month1
;
}
String
date1
=
String
.
valueOf
(
date
);
if
(
date
<
10
){
date1
=
"0"
+
date1
;
}
String
hour1
=
String
.
valueOf
(
hour
);
if
(
hour
<
10
){
hour1
=
"0"
+
hour1
;
}
String
minute1
=
String
.
valueOf
(
minute
);
if
(
minute
<
10
){
minute1
=
"0"
+
minute1
;
}
String
second1
=
String
.
valueOf
(
second
);
if
(
second
<
10
){
second1
=
"0"
+
second1
;
}
return
year1
+
month1
+
date1
+
hour1
+
minute1
+
second1
;
}
/**
* 将一段时间段拆分成子区间 按照时间间隔拆分
...
...
hmit-common/src/main/java/io/hmit/common/utils/HttpRequestUtil.java
View file @
ecbfe5ad
...
...
@@ -10,6 +10,9 @@ import java.io.InputStreamReader;
import
java.io.PrintWriter
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.util.List
;
import
java.util.Map
;
public
class
HttpRequestUtil
{
...
...
@@ -42,6 +45,67 @@ public class HttpRequestUtil {
return
resultCode
;
}
/**
* 向指定浙里办URL发送GET方法的请求
*
* @param url
* 发送请求的URL
* @param param
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return URL 所代表远程资源的响应结果
*/
public
static
String
sendZlbGet
(
String
url
,
String
param
)
{
String
result
=
""
;
BufferedReader
in
=
null
;
try
{
String
urlNameString
=
null
;
if
(
url
.
indexOf
(
"ticketValidation"
)
!=
-
1
||
url
.
indexOf
(
"getUserInfo"
)
!=
-
1
){
urlNameString
=
url
+
param
;
}
else
{
urlNameString
=
url
+
"?"
+
param
;
}
System
.
out
.
println
(
urlNameString
);
URL
realUrl
=
new
URL
(
urlNameString
);
// 打开和URL之间的连接
URLConnection
connection
=
realUrl
.
openConnection
();
// 设置通用的请求属性
connection
.
setRequestProperty
(
"accept"
,
"*/*"
);
connection
.
setRequestProperty
(
"connection"
,
"Keep-Alive"
);
connection
.
setRequestProperty
(
"user-agent"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"
);
// 建立实际的连接
connection
.
connect
();
// 获取所有响应头字段
Map
<
String
,
List
<
String
>>
map
=
connection
.
getHeaderFields
();
// 遍历所有的响应头字段
for
(
String
key
:
map
.
keySet
())
{
System
.
out
.
println
(
key
+
"--->"
+
map
.
get
(
key
));
}
// 定义 BufferedReader输入流来读取URL的响应
in
=
new
BufferedReader
(
new
InputStreamReader
(
connection
.
getInputStream
(),
"UTF-8"
));
String
line
;
while
((
line
=
in
.
readLine
())
!=
null
)
{
result
+=
line
;
}
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"发送GET请求出现异常!"
+
e
);
e
.
printStackTrace
();
}
// 使用finally块来关闭输入流
finally
{
try
{
if
(
in
!=
null
)
{
in
.
close
();
}
}
catch
(
Exception
e2
)
{
e2
.
printStackTrace
();
}
}
return
result
;
}
/***
* 向指定URL发送GET方法的请求
* @param url 发送请求的URL
...
...
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