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
32bf4407
Commit
32bf4407
authored
Mar 11, 2021
by
mengmeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lings' into 'master'
浙里办等 See merge request
!3
parents
1282ba88
ecbfe5ad
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1215 additions
and
29 deletions
+1215
-29
pom.xml
hmit-api/pom.xml
+18
-1
ZhelibanAPP.java
hmit-api/src/main/java/io/hmit/config/ZhelibanAPP.java
+31
-0
ZhelibanUtils.java
hmit-api/src/main/java/io/hmit/config/ZhelibanUtils.java
+523
-0
ApiLoginController.java
.../src/main/java/io/hmit/controller/ApiLoginController.java
+60
-1
AppointmentOrderController.java
...es/appointment/controller/AppointmentOrderController.java
+70
-25
AppointmentOrderDTO.java
.../io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
+2
-0
YynumberDTO.java
...ain/java/io/hmit/modules/appointment/dto/YynumberDTO.java
+43
-0
AppointmentOrderEntity.java
...it/modules/appointment/entity/AppointmentOrderEntity.java
+5
-0
AppointmentOrderService.java
.../modules/appointment/service/AppointmentOrderService.java
+9
-0
AppointmentOrderServiceImpl.java
...appointment/service/impl/AppointmentOrderServiceImpl.java
+37
-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
pom.xml
hmit-common/pom.xml
+8
-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
+275
-0
MD5.java
hmit-common/src/main/java/io/hmit/common/utils/MD5.java
+61
-0
MyX509TrustManager.java
...rc/main/java/io/hmit/common/utils/MyX509TrustManager.java
+24
-0
No files found.
hmit-api/pom.xml
View file @
32bf4407
...
@@ -17,6 +17,23 @@
...
@@ -17,6 +17,23 @@
<artifactId>
hmit-common
</artifactId>
<artifactId>
hmit-common
</artifactId>
<version>
1.0.0
</version>
<version>
1.0.0
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.60
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
net.sf.json-lib
</groupId>
<artifactId>
json-lib
</artifactId>
<version>
2.4
</version>
</dependency>
<dependency>
<groupId>
net.sf.json-lib
</groupId>
<artifactId>
json-lib
</artifactId>
<version>
2.4
</version>
<classifier>
jdk15
</classifier>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
hmit-api/src/main/java/io/hmit/config/ZhelibanAPP.java
0 → 100644
View file @
32bf4407
package
io
.
hmit
.
config
;
public
class
ZhelibanAPP
{
// 获取请求app_secret的地址
public
static
final
String
APP_REQUEST_SECRET_URL
=
"http://10.68.138.194/gateway/app/refreshTokenByKey.htm"
;
public
static
final
String
APP_KEY
=
"6465b05327cc4a41897907bf81382c29"
;
public
static
final
String
APP_SECRET
=
"fe07f9be363c46449ffae97ae2ad2bda"
;
public
static
final
String
SIGN
=
""
;
public
static
final
String
APP_ID
=
"4438763045"
;
public
static
final
String
APP_KEY_T
=
"249f09c69fe38bf51fe73976cbed2ead"
;
public
static
final
String
TOKEN_URL
=
""
;
public
static
final
String
BASE_URL
=
"http://a.com/"
;
public
static
final
String
AUTH_LOGIN_URL
=
BASE_URL
+
""
;
public
static
final
String
PUSH_MESSAGE_SIMPLE
=
BASE_URL
+
""
;
public
static
final
String
GET_USER_INFO_BY_MOBILE
=
BASE_URL
+
""
;
public
static
final
String
COMMIT_DATA
=
BASE_URL
+
""
;
//手机
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
0 → 100644
View file @
32bf4407
This diff is collapsed.
Click to expand it.
hmit-api/src/main/java/io/hmit/controller/ApiLoginController.java
View file @
32bf4407
package
io
.
hmit
.
controller
;
package
io
.
hmit
.
controller
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
io.hmit.annotation.Login
;
import
io.hmit.annotation.Login
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.utils.Result
;
import
io.hmit.common.utils.Result
;
import
io.hmit.common.validator.ValidatorUtils
;
import
io.hmit.common.validator.ValidatorUtils
;
import
io.hmit.config.ZhelibanUtils
;
import
io.hmit.dto.LoginDTO
;
import
io.hmit.dto.LoginDTO
;
import
io.hmit.entity.TokenEntity
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.service.TokenService
;
import
io.hmit.service.TokenService
;
import
io.hmit.service.UserService
;
import
io.hmit.service.UserService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
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.Map
;
import
java.util.UUID
;
/**
/**
* 登录接口
* 登录接口
...
@@ -53,4 +66,50 @@ public class ApiLoginController {
...
@@ -53,4 +66,50 @@ public class ApiLoginController {
return
new
Result
();
return
new
Result
();
}
}
//个人登录 - 单点登陆
@RequestMapping
(
value
=
"/check_user"
)
@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
);
Long
userId
;
Map
<
String
,
Object
>
userMap
=
new
HashMap
<>();
if
(
map
.
get
(
"ticket"
)
!=
null
){
System
.
out
.
println
(
"Ticket 是"
+
map
.
get
(
"ticket"
)+
"——————————————————————"
);
Map
<
String
,
Object
>
user_map
=
ZhelibanUtils
.
getUserInfo
(
map
);
System
.
out
.
println
(
"UserMap是——————————————————————————————"
);
System
.
out
.
println
(
user_map
);
if
(
user_map
.
get
(
"idnum"
)
!=
null
){
//判断是否已经存在了这条信息
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"
));
user
.
setIdCardNo
(
URLEncoder
.
encode
(
user_map
.
get
(
"idnum"
).
toString
(),
"UTF8"
));
userService
.
insert
(
user
);
userId
=
user
.
getId
();
}
else
{
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
(
"票据信息为空"
);
}
}
}
}
hmit-api/src/main/java/io/hmit/modules/appointment/controller/AppointmentOrderController.java
View file @
32bf4407
package
io
.
hmit
.
modules
.
appointment
.
controller
;
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.constant.Constant
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.DateUtils
;
import
io.hmit.common.utils.DateUtils
;
import
io.hmit.common.utils.HttpRequestUtil
;
import
io.hmit.common.utils.MD5
;
import
io.hmit.common.utils.Result
;
import
io.hmit.common.utils.Result
;
import
io.hmit.common.validator.AssertUtils
;
import
io.hmit.common.validator.AssertUtils
;
import
io.hmit.common.validator.ValidatorUtils
;
import
io.hmit.common.validator.ValidatorUtils
;
import
io.hmit.common.validator.group.AddGroup
;
import
io.hmit.common.validator.group.AddGroup
;
import
io.hmit.common.validator.group.DefaultGroup
;
import
io.hmit.common.validator.group.DefaultGroup
;
import
io.hmit.common.validator.group.UpdateGroup
;
import
io.hmit.common.validator.group.UpdateGroup
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.appointment.dto.*
;
import
io.hmit.modules.appointment.dto.*
;
import
io.hmit.modules.appointment.entity.AppointmentOrderEntity
;
import
io.hmit.modules.appointment.entity.AppointmentOrderEntity
;
import
io.hmit.modules.appointment.service.AppointmentOrderService
;
import
io.hmit.modules.appointment.service.AppointmentOrderService
;
...
@@ -19,7 +25,9 @@ import io.swagger.annotations.ApiImplicitParam;
...
@@ -19,7 +25,9 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -50,10 +58,19 @@ public class AppointmentOrderController {
...
@@ -50,10 +58,19 @@ public class AppointmentOrderController {
@ApiImplicitParam
(
name
=
Constant
.
PAGE
,
value
=
"当前页码,从1开始"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@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
.
LIMIT
,
value
=
"每页显示记录数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER_FIELD
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataType
=
"String"
)
,
@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
){
public
Result
<
PageData
<
AppointmentOrderDTO
>>
page
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
PageData
<
AppointmentOrderDTO
>
page
=
appointmentOrderService
.
page
(
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
);
return
new
Result
<
PageData
<
AppointmentOrderDTO
>>().
ok
(
page
);
}
}
...
@@ -62,7 +79,9 @@ public class AppointmentOrderController {
...
@@ -62,7 +79,9 @@ public class AppointmentOrderController {
@ApiOperation
(
"信息,预约详情接口"
)
@ApiOperation
(
"信息,预约详情接口"
)
public
Result
<
AppointmentOrderDTO
>
get
(
@PathVariable
(
"id"
)
Long
id
){
public
Result
<
AppointmentOrderDTO
>
get
(
@PathVariable
(
"id"
)
Long
id
){
AppointmentOrderDTO
data
=
appointmentOrderService
.
get
(
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
);
return
new
Result
<
AppointmentOrderDTO
>().
ok
(
data
);
}
}
...
@@ -134,15 +153,51 @@ public class AppointmentOrderController {
...
@@ -134,15 +153,51 @@ public class AppointmentOrderController {
return
new
Result
();
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}"
)
@GetMapping
(
value
=
"/signin/{appointmentOrderId}"
)
@ApiOperation
(
"签到"
)
@ApiOperation
(
"签到"
)
public
Result
signin
(
@PathVariable
(
value
=
"appointmentOrderId"
)
Long
appointmentOrderId
){
public
Result
signin
(
@PathVariable
(
value
=
"appointmentOrderId"
)
Long
appointmentOrderId
){
//根据appointmentOrderId获取到订单实体
//根据appointmentOrderId获取到订单实体
AppointmentOrderDTO
appointmentOrderDTO
=
appointmentOrderService
.
get
(
appointmentOrderId
);
AppointmentOrderDTO
appointmentOrderDTO
=
appointmentOrderService
.
get
(
appointmentOrderId
);
String
appointmentIdCard
=
appointmentOrderDTO
.
getAppointmentIdCard
();
String
appointmentPhone
=
appointmentOrderDTO
.
getAppointmentPhone
();
String
serviceId
=
appointmentOrderDTO
.
getServiceId
().
toString
();
String
appointmentPerson
=
appointmentOrderDTO
.
getAppointmentPerson
();
String
sign
=
"hjfhsdjfueytRwYSdsa%hdf^jdshfh*KGh$e"
+
serviceId
+
new
Date
().
getTime
();
//判断签到时间是否在预约时间前
//判断签到时间是否在预约时间前
if (appointmentOrderDTO.getAppointmentTime().getTime() > new Date().getTime()) {
//调用取号机取号接口,获取取号信息,并更新预约号。
// http://IP:8223/smartqueue/yynumber?sQueueInfoID=24&time=1613389800&sign=ee2c3fc1bdabf439f00aa90af6a0a68f&sTel=13988888888&sName=王小二&sCardID=333111123456
String
url
=
"http://IP:8223/smartqueue/yynumber?"
+
"sQueueInfoID="
+
serviceId
+
"&time="
+
new
Date
().
getTime
()+
"&sign="
+
MD5
.
md5
(
sign
)+
"&sTel="
+
appointmentPhone
+
"&sName="
+
appointmentPerson
+
"&sCardID="
+
appointmentIdCard
;
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
.
setStatus
(
2
);
appointmentOrderDTO
.
setStatusName
(
"签到"
);
appointmentOrderDTO
.
setStatusName
(
"签到"
);
appointmentOrderDTO
.
setUpdateDate
(
new
Date
());
appointmentOrderDTO
.
setUpdateDate
(
new
Date
());
...
@@ -150,22 +205,10 @@ public class AppointmentOrderController {
...
@@ -150,22 +205,10 @@ public class AppointmentOrderController {
return
new
Result
();
return
new
Result
();
}
else
{
}
else
{
return new Result().error("预约时间已过,签到失败!"
);
return
new
Result
().
error
(
yynumberDTO
.
getSMsg
()
);
}
}
}
}
@GetMapping(value = "/waitingNum/{appointmentOrderId}")
@ApiOperation("获取当前预约的排队人数")
public Result waitingNum (@PathVariable(value = "appointmentOrderId") Long appointmentOrderId){
//根据appointmentOrderId获取到订单实体
AppointmentOrderDTO appointmentOrderDTO = appointmentOrderService.get(appointmentOrderId);
//获取当前订单预约时间
Integer waitingNum = appointmentOrderService.waitingNum(DateUtils.format(appointmentOrderDTO.getAppointmentTime()));
return new Result().ok(waitingNum);
}*/
@GetMapping
(
value
=
"/serviceWaitingNum/{serviceId}"
)
@GetMapping
(
value
=
"/serviceWaitingNum/{serviceId}"
)
@ApiOperation
(
"获取当前事项的预约排队人数"
)
@ApiOperation
(
"获取当前事项的预约排队人数"
)
...
@@ -202,4 +245,6 @@ public class AppointmentOrderController {
...
@@ -202,4 +245,6 @@ public class AppointmentOrderController {
return
new
Result
();
return
new
Result
();
}
}
}
}
hmit-api/src/main/java/io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
View file @
32bf4407
...
@@ -93,6 +93,8 @@ public class AppointmentOrderDTO implements Serializable {
...
@@ -93,6 +93,8 @@ public class AppointmentOrderDTO implements Serializable {
@ApiModelProperty
(
value
=
"等候人数"
)
@ApiModelProperty
(
value
=
"等候人数"
)
private
Integer
waitNum
;
private
Integer
waitNum
;
private
YynumberDTO
yynumberDTO
;
public
AppointmentOrderDTO
assembleAppointmentOrderDTO
(
ReservationDTO
reservationDTO
){
public
AppointmentOrderDTO
assembleAppointmentOrderDTO
(
ReservationDTO
reservationDTO
){
AppointmentOrderDTO
dto
=
new
AppointmentOrderDTO
();
AppointmentOrderDTO
dto
=
new
AppointmentOrderDTO
();
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/dto/YynumberDTO.java
0 → 100644
View file @
32bf4407
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
{
/**
* nStatus : 0
* sMsg :
* sPaperNumber : Z1001
* nWait : 1
* nid : 4322
* sRegTime : 2018-12-21 13:49:21
* 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 @
32bf4407
...
@@ -3,6 +3,7 @@ package io.hmit.modules.appointment.entity;
...
@@ -3,6 +3,7 @@ package io.hmit.modules.appointment.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.hmit.common.entity.BaseEntity
;
import
io.hmit.common.entity.BaseEntity
;
import
io.hmit.modules.appointment.dto.YynumberDTO
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
@@ -110,4 +111,8 @@ public class AppointmentOrderEntity extends BaseEntity {
...
@@ -110,4 +111,8 @@ public class AppointmentOrderEntity extends BaseEntity {
*/
*/
private
Integer
waitNum
;
private
Integer
waitNum
;
@TableField
(
exist
=
false
)
private
YynumberDTO
yynumberDTO
;
}
}
hmit-api/src/main/java/io/hmit/modules/appointment/service/AppointmentOrderService.java
View file @
32bf4407
...
@@ -4,7 +4,10 @@ import io.hmit.common.page.PageData;
...
@@ -4,7 +4,10 @@ import io.hmit.common.page.PageData;
import
io.hmit.common.service.CrudService
;
import
io.hmit.common.service.CrudService
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.dto.ReservationOrderInfoDTO
;
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.entity.AppointmentOrderEntity
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -21,8 +24,14 @@ public interface AppointmentOrderService extends CrudService<AppointmentOrderEnt
...
@@ -21,8 +24,14 @@ public interface AppointmentOrderService extends CrudService<AppointmentOrderEnt
// PageData<AppointmentOrderDTO> getAppointmentInfoPage(Map<String, Object> params, String identity);
// PageData<AppointmentOrderDTO> getAppointmentInfoPage(Map<String, Object> params, String identity);
List
<
ReservationOrderInfoDTO
>
getAppointmentInfoPage
(
String
identity
);
List
<
ReservationOrderInfoDTO
>
getAppointmentInfoPage
(
String
identity
);
// PageData<AppointmentOrderDTO> page(Map<String, Object> params);
Integer
waitingNum
(
String
appointmentTime
);
Integer
waitingNum
(
String
appointmentTime
);
Integer
serviceWaitingNum
(
Long
serviceId
);
Integer
serviceWaitingNum
(
Long
serviceId
);
YynumberDTO
findByYuNumber
(
String
sPaperNumber
);
}
}
hmit-api/src/main/java/io/hmit/modules/appointment/service/impl/AppointmentOrderServiceImpl.java
View file @
32bf4407
package
io
.
hmit
.
modules
.
appointment
.
service
.
impl
;
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.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.constant.Constant
;
...
@@ -7,14 +8,20 @@ import io.hmit.common.page.PageData;
...
@@ -7,14 +8,20 @@ import io.hmit.common.page.PageData;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.DateUtils
;
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.dao.AppointmentOrderDao
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.dto.ReservationOrderInfoDTO
;
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.entity.AppointmentOrderEntity
;
import
io.hmit.modules.appointment.service.AppointmentOrderService
;
import
io.hmit.modules.appointment.service.AppointmentOrderService
;
import
io.hmit.modules.appointment.service.AppointmentServiceService
;
import
io.hmit.modules.appointment.service.AppointmentServiceService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
...
@@ -30,6 +37,8 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
...
@@ -30,6 +37,8 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
@Resource
@Resource
private
AppointmentOrderDao
appointmentOrderDao
;
private
AppointmentOrderDao
appointmentOrderDao
;
@Resource
private
AppointmentOrderService
appointmentOrderService
;
@Resource
@Resource
private
AppointmentServiceService
appointmentServiceService
;
private
AppointmentServiceService
appointmentServiceService
;
...
@@ -109,6 +118,20 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
...
@@ -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
@Override
public
Integer
waitingNum
(
String
appointmentTime
)
{
public
Integer
waitingNum
(
String
appointmentTime
)
{
...
@@ -120,4 +143,18 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
...
@@ -120,4 +143,18 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
return
appointmentOrderDao
.
serviceWaitingNum
(
serviceId
)
;
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 @
32bf4407
...
@@ -17,6 +17,8 @@ public interface UserService extends BaseService<UserEntity> {
...
@@ -17,6 +17,8 @@ public interface UserService extends BaseService<UserEntity> {
UserEntity
getUserByUserId
(
Long
userId
);
UserEntity
getUserByUserId
(
Long
userId
);
UserEntity
queryByIdnum
(
String
idnum
);
/**
/**
* 用户登录
* 用户登录
*
*
...
...
hmit-api/src/main/java/io/hmit/service/impl/UserServiceImpl.java
View file @
32bf4407
package
io
.
hmit
.
service
.
impl
;
package
io
.
hmit
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.hmit.common.exception.ErrorCode
;
import
io.hmit.common.exception.ErrorCode
;
import
io.hmit.common.exception.HmitException
;
import
io.hmit.common.exception.HmitException
;
import
io.hmit.common.service.impl.BaseServiceImpl
;
import
io.hmit.common.service.impl.BaseServiceImpl
;
...
@@ -33,6 +34,11 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
...
@@ -33,6 +34,11 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return
baseDao
.
getUserByUserId
(
userId
);
return
baseDao
.
getUserByUserId
(
userId
);
}
}
@Override
public
UserEntity
queryByIdnum
(
String
idnum
)
{
return
baseDao
.
selectOne
(
new
QueryWrapper
<
UserEntity
>().
eq
(
"id_card_no"
,
idnum
));
}
@Override
@Override
public
Map
<
String
,
Object
>
login
(
LoginDTO
dto
)
{
public
Map
<
String
,
Object
>
login
(
LoginDTO
dto
)
{
...
...
hmit-common/pom.xml
View file @
32bf4407
...
@@ -14,5 +14,12 @@
...
@@ -14,5 +14,12 @@
<build>
<build>
<finalName>
${project.artifactId}
</finalName>
<finalName>
${project.artifactId}
</finalName>
</build>
</build>
<dependencies>
<dependency>
<groupId>
log4j
</groupId>
<artifactId>
log4j
</artifactId>
<version>
1.2.17
</version>
</dependency>
</dependencies>
</project>
</project>
hmit-common/src/main/java/io/hmit/common/utils/DateUtils.java
View file @
32bf4407
...
@@ -196,6 +196,46 @@ public class DateUtils {
...
@@ -196,6 +196,46 @@ public class DateUtils {
return
dateTime
.
plusYears
(
years
).
toDate
();
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
0 → 100644
View file @
32bf4407
This diff is collapsed.
Click to expand it.
hmit-common/src/main/java/io/hmit/common/utils/MD5.java
0 → 100644
View file @
32bf4407
package
io
.
hmit
.
common
.
utils
;
import
sun.misc.BASE64Encoder
;
import
java.io.UnsupportedEncodingException
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
/**
* 说明:MD5处理
* 创建人:hmit
* 修改时间:
* @version
*/
public
class
MD5
{
public
static
String
md5
(
String
str
)
{
try
{
MessageDigest
md
=
MessageDigest
.
getInstance
(
"MD5"
);
md
.
update
(
str
.
getBytes
());
byte
b
[]
=
md
.
digest
();
int
i
;
StringBuffer
buf
=
new
StringBuffer
(
""
);
for
(
int
offset
=
0
;
offset
<
b
.
length
;
offset
++)
{
i
=
b
[
offset
];
if
(
i
<
0
)
i
+=
256
;
if
(
i
<
16
)
buf
.
append
(
"0"
);
buf
.
append
(
Integer
.
toHexString
(
i
));
}
str
=
buf
.
toString
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
str
;
}
/**利用MD5进行加密
* @param str 待加密的字符串
* @return 加密后的字符串
* @throws NoSuchAlgorithmException 没有这种产生消息摘要的算法
* @throws UnsupportedEncodingException
*/
public
static
String
EncoderByMd5
(
String
str
)
throws
NoSuchAlgorithmException
,
UnsupportedEncodingException
{
//确定计算方法
MessageDigest
md5
=
MessageDigest
.
getInstance
(
"MD5"
);
BASE64Encoder
base64en
=
new
BASE64Encoder
();
//加密后的字符串
String
newstr
=
base64en
.
encode
(
md5
.
digest
(
str
.
getBytes
(
"utf-8"
)));
return
newstr
;
}
public
static
void
main
(
String
[]
args
)
throws
UnsupportedEncodingException
,
NoSuchAlgorithmException
{
System
.
out
.
println
(
md5
(
"hjfhsdjfueytRwYSdsa%hdf^jdshfh*KGh$e241613389800"
));
System
.
out
.
println
(
md5
(
"kkk"
));
System
.
out
.
println
(
EncoderByMd5
(
"180@qq.com"
+
"123456"
));
}
}
hmit-common/src/main/java/io/hmit/common/utils/MyX509TrustManager.java
0 → 100644
View file @
32bf4407
package
io
.
hmit
.
common
.
utils
;
import
java.security.cert.CertificateException
;
import
java.security.cert.X509Certificate
;
import
javax.net.ssl.X509TrustManager
;
public
class
MyX509TrustManager
implements
X509TrustManager
{
@Override
public
void
checkClientTrusted
(
X509Certificate
certificates
[],
String
authType
)
throws
CertificateException
{
}
@Override
public
void
checkServerTrusted
(
X509Certificate
[]
ax509certificate
,
String
s
)
throws
CertificateException
{
}
@Override
public
X509Certificate
[]
getAcceptedIssuers
()
{
return
null
;
}
}
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