Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
szpt
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
以墨为白
szpt
Commits
92a11966
Commit
92a11966
authored
Jan 10, 2025
by
夏敏伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编写测试 解决bug
parent
744dd937
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
824 additions
and
33 deletions
+824
-33
src/main/java/com/zksy/szpt/controller/SzptClockInController.java
.../java/com/zksy/szpt/controller/SzptClockInController.java
+3
-2
src/main/java/com/zksy/szpt/controller/SzptClockInRulesController.java
.../com/zksy/szpt/controller/SzptClockInRulesController.java
+3
-2
src/main/java/com/zksy/szpt/controller/SzptXyzhXyxxController.java
...java/com/zksy/szpt/controller/SzptXyzhXyxxController.java
+3
-2
src/main/java/com/zksy/szpt/domain/dto/CommonDelIntDTO.java
src/main/java/com/zksy/szpt/domain/dto/CommonDelIntDTO.java
+37
-0
src/main/java/com/zksy/szpt/domain/dto/SzptGdYjDTO.java
src/main/java/com/zksy/szpt/domain/dto/SzptGdYjDTO.java
+16
-0
src/main/java/com/zksy/szpt/service/IndexService.java
src/main/java/com/zksy/szpt/service/IndexService.java
+1
-1
src/main/java/com/zksy/szpt/service/SzptClockInRulesService.java
...n/java/com/zksy/szpt/service/SzptClockInRulesService.java
+3
-2
src/main/java/com/zksy/szpt/service/SzptClockInService.java
src/main/java/com/zksy/szpt/service/SzptClockInService.java
+3
-2
src/main/java/com/zksy/szpt/service/SzptFwxxService.java
src/main/java/com/zksy/szpt/service/SzptFwxxService.java
+2
-1
src/main/java/com/zksy/szpt/service/SzptGdCsyjhldxService.java
...ain/java/com/zksy/szpt/service/SzptGdCsyjhldxService.java
+1
-1
src/main/java/com/zksy/szpt/service/SzptGdRyxxService.java
src/main/java/com/zksy/szpt/service/SzptGdRyxxService.java
+1
-1
src/main/java/com/zksy/szpt/service/SzptGdSbxxService.java
src/main/java/com/zksy/szpt/service/SzptGdSbxxService.java
+3
-2
src/main/java/com/zksy/szpt/service/SzptGdXxService.java
src/main/java/com/zksy/szpt/service/SzptGdXxService.java
+2
-1
src/main/java/com/zksy/szpt/service/SzptGdYjService.java
src/main/java/com/zksy/szpt/service/SzptGdYjService.java
+1
-1
src/main/java/com/zksy/szpt/service/SzptQyxxService.java
src/main/java/com/zksy/szpt/service/SzptQyxxService.java
+1
-1
src/main/java/com/zksy/szpt/service/SzptXyzhDkxxService.java
src/main/java/com/zksy/szpt/service/SzptXyzhDkxxService.java
+1
-1
src/main/java/com/zksy/szpt/service/SzptXyzhKqmbService.java
src/main/java/com/zksy/szpt/service/SzptXyzhKqmbService.java
+1
-1
src/main/java/com/zksy/szpt/service/SzptXyzhMbdhService.java
src/main/java/com/zksy/szpt/service/SzptXyzhMbdhService.java
+1
-1
src/main/java/com/zksy/szpt/service/SzptXyzhXyxxService.java
src/main/java/com/zksy/szpt/service/SzptXyzhXyxxService.java
+3
-2
src/test/java/com/zksy/szpt/MainTestX.java
src/test/java/com/zksy/szpt/MainTestX.java
+738
-9
No files found.
src/main/java/com/zksy/szpt/controller/SzptClockInController.java
View file @
92a11966
package
com
.
zksy
.
szpt
.
controller
;
import
com.zksy.szpt.domain.dto.CommonDelDTO
;
import
com.zksy.szpt.domain.dto.CommonDelIntDTO
;
import
com.zksy.szpt.domain.dto.SzptClockInDTO
;
import
com.zksy.szpt.service.SzptClockInService
;
import
io.swagger.annotations.Api
;
...
...
@@ -33,8 +34,8 @@ public class SzptClockInController {
@ApiOperation
(
value
=
"删除szpt_clock_in数据"
)
@PostMapping
(
"/deleteSzptClockIn"
)
public
Integer
deleteSzptClockIn
(
@RequestBody
CommonDel
DTO
commonDel
DTO
)
{
return
szptClockInService
.
deleteSzptClockIn
(
commonDelDTO
);
public
Integer
deleteSzptClockIn
(
@RequestBody
CommonDel
IntDTO
commonDelInt
DTO
)
{
return
szptClockInService
.
deleteSzptClockIn
(
commonDel
Int
DTO
);
}
...
...
src/main/java/com/zksy/szpt/controller/SzptClockInRulesController.java
View file @
92a11966
package
com
.
zksy
.
szpt
.
controller
;
import
com.zksy.szpt.domain.dto.CommonDelDTO
;
import
com.zksy.szpt.domain.dto.CommonDelIntDTO
;
import
com.zksy.szpt.domain.dto.SzptClockInRulesDTO
;
import
com.zksy.szpt.service.SzptClockInRulesService
;
import
io.swagger.annotations.Api
;
...
...
@@ -33,7 +34,7 @@ public class SzptClockInRulesController {
@ApiOperation
(
value
=
"删除SzptClockInRules数据"
)
@PostMapping
(
"/deleteSzptClockInRules"
)
public
Integer
deleteSzptClockInRules
(
@RequestBody
@Validated
CommonDel
DTO
commonDel
DTO
)
{
return
szptClockInRulesService
.
deleteSzptClockInRules
(
commonDelDTO
);
public
Integer
deleteSzptClockInRules
(
@RequestBody
@Validated
CommonDel
IntDTO
commonDelInt
DTO
)
{
return
szptClockInRulesService
.
deleteSzptClockInRules
(
commonDel
Int
DTO
);
}
}
src/main/java/com/zksy/szpt/controller/SzptXyzhXyxxController.java
View file @
92a11966
package
com
.
zksy
.
szpt
.
controller
;
import
com.zksy.szpt.domain.dto.CommonDelDTO
;
import
com.zksy.szpt.domain.dto.CommonDelIntDTO
;
import
com.zksy.szpt.domain.dto.SzptXyzhXyxxDTO
;
import
com.zksy.szpt.service.SzptXyzhXyxxService
;
import
io.swagger.annotations.Api
;
...
...
@@ -35,7 +36,7 @@ public class SzptXyzhXyxxController {
@ApiOperation
(
value
=
"删除校园信息"
)
@PostMapping
(
"/deleteSzptXyzhXyxx"
)
public
Integer
deleteSzptXyzhXyxx
(
@RequestBody
@Validated
CommonDel
DTO
commonDel
DTO
)
{
return
szptXyzhXyxxService
.
deleteSzptXyzhXyxx
(
commonDelDTO
);
public
Integer
deleteSzptXyzhXyxx
(
@RequestBody
@Validated
CommonDel
IntDTO
commonDelInt
DTO
)
{
return
szptXyzhXyxxService
.
deleteSzptXyzhXyxx
(
commonDel
Int
DTO
);
}
}
src/main/java/com/zksy/szpt/domain/dto/CommonDelIntDTO.java
0 → 100644
View file @
92a11966
package
com
.
zksy
.
szpt
.
domain
.
dto
;
import
javax.validation.constraints.NotEmpty
;
import
java.util.List
;
public
class
CommonDelIntDTO
{
/**
* 账户ID
*/
@NotEmpty
(
message
=
"账户ID不能为空"
)
private
List
<
Integer
>
ids
;
/**
* 数据所属单位
*/
@NotEmpty
(
message
=
"数据归属单位不能为空"
)
private
String
sjgsdwdm
;
public
List
<
Integer
>
getIds
()
{
return
ids
;
}
public
void
setIds
(
List
<
Integer
>
ids
)
{
this
.
ids
=
ids
;
}
public
String
getSjgsdwdm
()
{
return
sjgsdwdm
;
}
public
void
setSjgsdwdm
(
String
sjgsdwdm
)
{
this
.
sjgsdwdm
=
sjgsdwdm
;
}
}
src/main/java/com/zksy/szpt/domain/dto/SzptGdYjDTO.java
View file @
92a11966
package
com
.
zksy
.
szpt
.
domain
.
dto
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
javax.validation.constraints.NotBlank
;
...
...
@@ -7,6 +9,12 @@ import javax.validation.constraints.NotEmpty;
import
java.util.Date
;
public
class
SzptGdYjDTO
{
/**
* 预警ID
*/
@NotBlank
(
message
=
"预警ID不能为空"
)
private
String
id
;
/**
* 工地ID
*/
...
...
@@ -73,6 +81,14 @@ public class SzptGdYjDTO {
private
String
clrxm
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getCsid
()
{
return
csid
;
}
...
...
src/main/java/com/zksy/szpt/service/IndexService.java
View file @
92a11966
...
...
@@ -30,7 +30,7 @@ public class IndexService {
public
Integer
deleteXxRwwcqk
(
CommonDelDTO
commonDelDTO
)
{
LambdaQueryWrapper
<
XxRwwcqk
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
XxRwwcqk:
:
getRwid
,
commonDelDTO
);
wrapper
.
in
(
XxRwwcqk:
:
getRwid
,
commonDelDTO
.
getIds
()
);
return
xxRwwcqkMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptClockInRulesService.java
View file @
92a11966
...
...
@@ -3,6 +3,7 @@ package com.zksy.szpt.service;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.zksy.szpt.domain.dto.CommonDelDTO
;
import
com.zksy.szpt.domain.dto.CommonDelIntDTO
;
import
com.zksy.szpt.domain.dto.SzptClockInRulesDTO
;
import
com.zksy.szpt.domain.po.SzptClockInRules
;
import
com.zksy.szpt.mapper.SzptClockInRulesMapper
;
...
...
@@ -28,9 +29,9 @@ public class SzptClockInRulesService {
return
szptClockInRulesMapper
.
update
(
szptClockInRules
,
wrapper
);
}
public
Integer
deleteSzptClockInRules
(
CommonDel
DTO
commonDel
DTO
)
{
public
Integer
deleteSzptClockInRules
(
CommonDel
IntDTO
commonDelInt
DTO
)
{
LambdaQueryWrapper
<
SzptClockInRules
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptClockInRules:
:
getId
,
commonDel
DTO
);
wrapper
.
in
(
SzptClockInRules:
:
getId
,
commonDel
IntDTO
.
getIds
()
);
return
szptClockInRulesMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptClockInService.java
View file @
92a11966
...
...
@@ -3,6 +3,7 @@ package com.zksy.szpt.service;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.zksy.szpt.domain.dto.CommonDelDTO
;
import
com.zksy.szpt.domain.dto.CommonDelIntDTO
;
import
com.zksy.szpt.domain.dto.SzptClockInDTO
;
import
com.zksy.szpt.domain.po.SzptClockIn
;
import
com.zksy.szpt.mapper.SzptClockInMapper
;
...
...
@@ -28,9 +29,9 @@ public class SzptClockInService {
return
szptClockInMapper
.
update
(
szptClockIn
,
wrapper
);
}
public
Integer
deleteSzptClockIn
(
CommonDel
DTO
commonDel
DTO
)
{
public
Integer
deleteSzptClockIn
(
CommonDel
IntDTO
commonDelInt
DTO
)
{
LambdaQueryWrapper
<
SzptClockIn
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptClockIn:
:
getId
,
commonDel
DTO
);
wrapper
.
in
(
SzptClockIn:
:
getId
,
commonDel
IntDTO
.
getIds
()
);
return
szptClockInMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptFwxxService.java
View file @
92a11966
...
...
@@ -32,7 +32,8 @@ public class SzptFwxxService {
public
Integer
deleteSzptFwxx
(
CommonDelDTO
commonDelDTO
)
{
LambdaQueryWrapper
<
SzptFwxx
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptFwxx:
:
getQyid
,
commonDelDTO
);
wrapper
.
in
(
SzptFwxx:
:
getQyid
,
commonDelDTO
.
getIds
());
wrapper
.
eq
(
SzptFwxx:
:
getSjgsdwdm
,
commonDelDTO
.
getSjgsdwdm
());
return
szptFwxxMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptGdCsyjhldxService.java
View file @
92a11966
...
...
@@ -30,7 +30,7 @@ public class SzptGdCsyjhldxService {
public
Integer
deleteSzptGdCsyjhldx
(
CommonDelDTO
commonDelDTO
)
{
LambdaQueryWrapper
<
SzptGdCsyjhldx
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptGdCsyjhldx:
:
getId
,
commonDelDTO
);
wrapper
.
in
(
SzptGdCsyjhldx:
:
getId
,
commonDelDTO
.
getIds
()
);
return
szptGdCsyjhldxMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptGdRyxxService.java
View file @
92a11966
...
...
@@ -30,7 +30,7 @@ public class SzptGdRyxxService {
public
Integer
deleteSzptGdRyxx
(
CommonDelDTO
commonDelDTO
)
{
LambdaQueryWrapper
<
SzptGdRyxx
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptGdRyxx:
:
getRkbm
,
commonDelDTO
);
wrapper
.
in
(
SzptGdRyxx:
:
getRkbm
,
commonDelDTO
.
getIds
()
);
return
szptGdRyxxMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptGdSbxxService.java
View file @
92a11966
...
...
@@ -24,14 +24,15 @@ public class SzptGdSbxxService {
public
Integer
updateSzptGdSbxx
(
SzptGdSbxxDTO
szptGdSbxxDTO
)
{
SzptGdSbxx
szptGdSbxx
=
BeanMapperUtil
.
map
(
szptGdSbxxDTO
,
SzptGdSbxx
.
class
);
LambdaUpdateWrapper
<
SzptGdSbxx
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
eq
(
SzptGdSbxx:
:
get
Id
,
szptGdSbxx
.
getId
());
wrapper
.
eq
(
SzptGdSbxx:
:
get
Sbbh
,
szptGdSbxx
.
getSbbh
());
wrapper
.
eq
(
SzptGdSbxx:
:
getSjgsdwdm
,
szptGdSbxx
.
getSjgsdwdm
());
return
szptGdSbxxMapper
.
update
(
szptGdSbxx
,
wrapper
);
}
public
Integer
deleteSzptGdSbxx
(
CommonDelDTO
commonDelDTO
)
{
LambdaQueryWrapper
<
SzptGdSbxx
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptGdSbxx:
:
getId
,
commonDelDTO
);
wrapper
.
in
(
SzptGdSbxx:
:
getSbbh
,
commonDelDTO
.
getIds
());
wrapper
.
eq
(
SzptGdSbxx:
:
getSjgsdwdm
,
commonDelDTO
.
getSjgsdwdm
());
return
szptGdSbxxMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptGdXxService.java
View file @
92a11966
...
...
@@ -31,7 +31,8 @@ public class SzptGdXxService {
public
Integer
deleteSzptGdXx
(
CommonDelDTO
commonDelDTO
)
{
LambdaQueryWrapper
<
SzptGdXx
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptGdXx:
:
getId
,
commonDelDTO
);
wrapper
.
in
(
SzptGdXx:
:
getId
,
commonDelDTO
.
getIds
());
wrapper
.
eq
(
SzptGdXx:
:
getSjgsdwdm
,
commonDelDTO
.
getSjgsdwdm
());
return
szptGdXxMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptGdYjService.java
View file @
92a11966
...
...
@@ -29,7 +29,7 @@ public class SzptGdYjService {
public
Integer
deleteSzptGdYj
(
CommonDelDTO
commonDelDTO
)
{
LambdaQueryWrapper
<
SzptGdYj
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptGdYj:
:
getId
,
commonDelDTO
);
wrapper
.
in
(
SzptGdYj:
:
getId
,
commonDelDTO
.
getIds
()
);
return
szptGdYjMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptQyxxService.java
View file @
92a11966
...
...
@@ -30,7 +30,7 @@ public class SzptQyxxService {
public
Integer
deleteSzptQyxx
(
CommonDelDTO
commonDelDTO
)
{
LambdaQueryWrapper
<
SzptQyxx
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptQyxx:
:
getId
,
commonDelDTO
);
wrapper
.
in
(
SzptQyxx:
:
getId
,
commonDelDTO
.
getIds
()
);
return
szptQyxxMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptXyzhDkxxService.java
View file @
92a11966
...
...
@@ -30,7 +30,7 @@ public class SzptXyzhDkxxService {
public
Integer
deleteSzptXyzhDkxx
(
CommonDelDTO
commonDelDTO
)
{
LambdaQueryWrapper
<
SzptXyzhDkxx
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptXyzhDkxx:
:
getDklsid
,
commonDelDTO
);
wrapper
.
in
(
SzptXyzhDkxx:
:
getDklsid
,
commonDelDTO
.
getIds
()
);
return
szptXyzhDkxxMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptXyzhKqmbService.java
View file @
92a11966
...
...
@@ -32,7 +32,7 @@ public class SzptXyzhKqmbService {
public
Integer
deleteSzptXyzhKqmb
(
CommonDelDTO
commonDelDTO
)
{
LambdaQueryWrapper
<
SzptXyzhKqmb
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptXyzhKqmb:
:
getId
,
commonDelDTO
);
wrapper
.
in
(
SzptXyzhKqmb:
:
getId
,
commonDelDTO
.
getIds
()
);
return
szptXyzhKqmbMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptXyzhMbdhService.java
View file @
92a11966
...
...
@@ -32,7 +32,7 @@ public class SzptXyzhMbdhService {
public
Integer
deleteSzptXyzhMbdh
(
CommonDelDTO
commonDelDTO
)
{
LambdaQueryWrapper
<
SzptXyzhMbdh
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptXyzhMbdh:
:
getId
,
commonDelDTO
);
wrapper
.
in
(
SzptXyzhMbdh:
:
getId
,
commonDelDTO
.
getIds
()
);
return
szptXyzhMbdhMapper
.
delete
(
wrapper
);
}
}
src/main/java/com/zksy/szpt/service/SzptXyzhXyxxService.java
View file @
92a11966
...
...
@@ -3,6 +3,7 @@ package com.zksy.szpt.service;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.zksy.szpt.domain.dto.CommonDelDTO
;
import
com.zksy.szpt.domain.dto.CommonDelIntDTO
;
import
com.zksy.szpt.domain.dto.SzptXyzhMbdhDTO
;
import
com.zksy.szpt.domain.dto.SzptXyzhXyxxDTO
;
import
com.zksy.szpt.domain.po.SzptXyzhMbdh
;
...
...
@@ -30,9 +31,9 @@ public class SzptXyzhXyxxService {
return
szptXyzhXyxxMapper
.
update
(
szptXyzhXyxx
,
wrapper
);
}
public
Integer
deleteSzptXyzhXyxx
(
CommonDel
DTO
commonDel
DTO
)
{
public
Integer
deleteSzptXyzhXyxx
(
CommonDel
IntDTO
commonDelInt
DTO
)
{
LambdaQueryWrapper
<
SzptXyzhXyxx
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
SzptXyzhXyxx:
:
getId
,
commonDel
DTO
);
wrapper
.
in
(
SzptXyzhXyxx:
:
getId
,
commonDel
IntDTO
.
getIds
()
);
return
szptXyzhXyxxMapper
.
delete
(
wrapper
);
}
}
src/test/java/com/zksy/szpt/MainTestX.java
View file @
92a11966
...
...
@@ -3,8 +3,7 @@ package com.zksy.szpt;
import
cn.hutool.crypto.digest.DigestUtil
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.zksy.szpt.domain.dto.SzptClockInDTO
;
import
com.zksy.szpt.domain.dto.SzptFwxxDTO
;
import
com.zksy.szpt.domain.dto.*
;
import
com.zksy.szpt.service.AppStoreService
;
import
com.zksy.szpt.util.EncryptUtil
;
import
com.zksy.szpt.util.SignatureUtil
;
...
...
@@ -16,7 +15,9 @@ import org.springframework.web.reactive.function.client.WebClient;
import
reactor.core.publisher.Mono
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
@SpringBootTest
()
public
class
MainTestX
{
...
...
@@ -32,10 +33,10 @@ public class MainTestX {
private
AppStoreService
appStoreService
;
/**
*
任务完成情况
*
===================================================考勤===================================================
*/
@Test
@DisplayName
(
"考勤"
)
@DisplayName
(
"考勤
--新增、更新
"
)
public
void
szptClockInTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
...
...
@@ -49,13 +50,11 @@ public class MainTestX {
szptClockInDTO
.
setXbqt
(
"123456"
);
szptClockInDTO
.
setXcqk
(
"1"
);
szptClockInDTO
.
setSbsj
(
"1"
);
szptClockInDTO
.
setSbr
(
"123456"
);
szptClockInDTO
.
setQdr
(
"123456"
);
szptClockInDTO
.
setQdrlxdh
(
"123456"
);
szptClockInDTO
.
setQddkdd
(
"1"
);
szptClockInDTO
.
setQddkzp
(
"1"
);
szptClockInDTO
.
setQtdkdd
(
"1"
);
szptClockInDTO
.
setQtdkzp
(
"1"
);
szptClockInDTO
.
setGkdj
(
"1"
);
...
...
@@ -87,9 +86,144 @@ public class MainTestX {
System
.
out
.
println
(
response
);
}
@Test
@DisplayName
(
"考勤--删除"
)
public
void
deleteClockInTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
List
<
Integer
>
ids
=
new
ArrayList
<>();
ids
.
add
(
14
);
ids
.
add
(
15
);
CommonDelIntDTO
commonDelIntDTO
=
new
CommonDelIntDTO
();
commonDelIntDTO
.
setIds
(
ids
);
commonDelIntDTO
.
setSjgsdwdm
(
"330102"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
commonDelIntDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
json
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
String
response
=
webClient
.
post
().
uri
(
"/rest/index/deleteSzptClockIn"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
commonDelIntDTO
),
CommonDelIntDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
/**
* ===================================================考勤规则===================================================
*/
@Test
@DisplayName
(
"考勤规则--新增、更新"
)
public
void
szptClockInRulesTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
SzptClockInRulesDTO
szptClockInRulesDTO
=
new
SzptClockInRulesDTO
();
szptClockInRulesDTO
.
setId
(
100
);
szptClockInRulesDTO
.
setName
(
"123456"
);
szptClockInRulesDTO
.
setCsid
(
"123456"
);
szptClockInRulesDTO
.
setChockInTime
(
"123456"
);
szptClockInRulesDTO
.
setClockInScope
(
"1"
);
szptClockInRulesDTO
.
setQrCode
(
"1"
);
szptClockInRulesDTO
.
setCslx
(
"123456"
);
szptClockInRulesDTO
.
setBz
(
"123456"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
szptClockInRulesDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
json
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
// String response = webClient.post().uri("/rest/index/addSzptClockInRules")
String
response
=
webClient
.
post
().
uri
(
"/rest/index/updateSzptClockInRules"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
szptClockInRulesDTO
),
SzptClockInRulesDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
@Test
@DisplayName
(
"考勤规则--删除"
)
public
void
deleteClockInRulesTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
List
<
Integer
>
ids
=
new
ArrayList
<>();
ids
.
add
(
4
);
ids
.
add
(
100
);
CommonDelIntDTO
commonDelIntDTO
=
new
CommonDelIntDTO
();
commonDelIntDTO
.
setIds
(
ids
);
commonDelIntDTO
.
setSjgsdwdm
(
"330102"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
commonDelIntDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
json
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
String
response
=
webClient
.
post
().
uri
(
"/rest/index/deleteSzptClockInRules"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
commonDelIntDTO
),
CommonDelIntDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
/**
* ===================================================房屋信息===================================================
*/
@Test
@DisplayName
(
"房屋信息"
)
@DisplayName
(
"房屋信息
--新增、更新
"
)
public
void
szptFwxxTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
...
...
@@ -97,7 +231,7 @@ public class MainTestX {
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
SzptFwxxDTO
szptFwxxDTO
=
new
SzptFwxxDTO
();
szptFwxxDTO
.
setQyid
(
"
2
"
);
szptFwxxDTO
.
setQyid
(
"
5
"
);
szptFwxxDTO
.
setCsid
(
"123456"
);
szptFwxxDTO
.
setFwjc
(
"123456"
);
szptFwxxDTO
.
setJzqk
(
"1"
);
...
...
@@ -132,7 +266,7 @@ public class MainTestX {
szptFwxxDTO
.
setFkdjzdsh
(
"1"
);
szptFwxxDTO
.
setQtfwyt
(
"1"
);
szptFwxxDTO
.
setJkmhysj
(
new
Date
());
szptFwxxDTO
.
setSjgsdwdm
(
"3
4
0102"
);
szptFwxxDTO
.
setSjgsdwdm
(
"3
3
0102"
);
szptFwxxDTO
.
setSjgsdwmc
(
"1"
);
szptFwxxDTO
.
setFzzjzp
(
"1"
);
String
json
=
null
;
...
...
@@ -162,4 +296,599 @@ public class MainTestX {
.
block
();
System
.
out
.
println
(
response
);
}
@Test
@DisplayName
(
"房屋信息--删除"
)
public
void
deleteSzptFwxxTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
"5"
);
CommonDelDTO
commonDelDTO
=
new
CommonDelDTO
();
commonDelDTO
.
setIds
(
ids
);
commonDelDTO
.
setSjgsdwdm
(
"330102"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
commonDelDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
String
json1
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json1
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
String
response
=
webClient
.
post
().
uri
(
"/rest/index/deleteSzptFwxx"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
commonDelDTO
),
CommonDelDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
/**
* ===================================================场所预警忽略对象===================================================
*/
@Test
@DisplayName
(
"场所预警忽略对象--新增、更新"
)
public
void
szptGdCsyjhldxTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
SzptGdCsyjhldxDTO
szptGdCsyjhldxDTO
=
new
SzptGdCsyjhldxDTO
();
szptGdCsyjhldxDTO
.
setId
(
"5"
);
szptGdCsyjhldxDTO
.
setCsid
(
"123456123456"
);
szptGdCsyjhldxDTO
.
setYjlx
(
"1"
);
szptGdCsyjhldxDTO
.
setYjzlx
(
"1"
);
szptGdCsyjhldxDTO
.
setYwid
(
"1"
);
szptGdCsyjhldxDTO
.
setYwms
(
"1"
);
szptGdCsyjhldxDTO
.
setBz
(
"123456"
);
szptGdCsyjhldxDTO
.
setZt
(
"1"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
szptGdCsyjhldxDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
json
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
// String response = webClient.post().uri("/rest/index/addSzptGdCsyjhldx")
String
response
=
webClient
.
post
().
uri
(
"/rest/index/updateSzptGdCsyjhldx"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
szptGdCsyjhldxDTO
),
SzptGdCsyjhldxDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
@Test
@DisplayName
(
"场所预警忽略对象--删除"
)
public
void
deleteSzptGdCsyjhldxTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
"5"
);
CommonDelDTO
commonDelDTO
=
new
CommonDelDTO
();
commonDelDTO
.
setIds
(
ids
);
commonDelDTO
.
setSjgsdwdm
(
"330102"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
commonDelDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
String
json1
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json1
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
String
response
=
webClient
.
post
().
uri
(
"/rest/index/deleteSzptGdCsyjhldx"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
commonDelDTO
),
CommonDelDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
/**
* ===================================================工地人员信息===================================================
*/
@Test
@DisplayName
(
"工地人员信息--新增、更新"
)
public
void
szptGdRyxxTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
SzptGdRyxxDTO
szptGdRyxxDTO
=
new
SzptGdRyxxDTO
();
szptGdRyxxDTO
.
setId
(
"7"
);
szptGdRyxxDTO
.
setRkbm
(
"1234561234561"
);
szptGdRyxxDTO
.
setCsid
(
"1123111111111111"
);
szptGdRyxxDTO
.
setCjrlid
(
"1"
);
szptGdRyxxDTO
.
setXm
(
"1"
);
szptGdRyxxDTO
.
setXb
(
"1"
);
szptGdRyxxDTO
.
setLxdh
(
"123456"
);
szptGdRyxxDTO
.
setCyzjdm
(
"1"
);
szptGdRyxxDTO
.
setZjhm
(
"5"
);
szptGdRyxxDTO
.
setNl
(
"1"
);
szptGdRyxxDTO
.
setUrl
(
"1"
);
szptGdRyxxDTO
.
setMd5
(
"1"
);
szptGdRyxxDTO
.
setZjcxts
(
1
);
szptGdRyxxDTO
.
setZcxts
(
1
);
szptGdRyxxDTO
.
setYsrczjts
(
1
);
szptGdRyxxDTO
.
setYsrcbz
(
"1"
);
szptGdRyxxDTO
.
setYsrczts
(
5
);
szptGdRyxxDTO
.
setCkbz
(
"1"
);
szptGdRyxxDTO
.
setLkbz
(
"1"
);
szptGdRyxxDTO
.
setHjdzDzmc
(
"1"
);
szptGdRyxxDTO
.
setHjdzXzqhdm
(
"1"
);
szptGdRyxxDTO
.
setHjdzPcsmc
(
"1"
);
szptGdRyxxDTO
.
setHjdzPcsdm
(
"123456"
);
szptGdRyxxDTO
.
setXzdDzmc
(
"1"
);
szptGdRyxxDTO
.
setXzdXzqhdm
(
"5"
);
szptGdRyxxDTO
.
setXzdPcsmc
(
"123456123456"
);
szptGdRyxxDTO
.
setXzdPcsdm
(
"1"
);
szptGdRyxxDTO
.
setZt
(
"1"
);
szptGdRyxxDTO
.
setJcsj
(
new
Date
());
szptGdRyxxDTO
.
setTcsj
(
new
Date
());
szptGdRyxxDTO
.
setYjtcsj
(
new
Date
());
szptGdRyxxDTO
.
setZjzpsj
(
new
Date
());
szptGdRyxxDTO
.
setSfglry
(
"5"
);
szptGdRyxxDTO
.
setDjzt
(
1
);
szptGdRyxxDTO
.
setQyid
(
"1"
);
szptGdRyxxDTO
.
setQymc
(
"1"
);
szptGdRyxxDTO
.
setRylb
(
"1"
);
szptGdRyxxDTO
.
setRylx
(
"1"
);
szptGdRyxxDTO
.
setLkbdsj
(
new
Date
());
szptGdRyxxDTO
.
setCkbdsj
(
new
Date
());
szptGdRyxxDTO
.
setDatasource
(
"1"
);
szptGdRyxxDTO
.
setOrderid
(
"1"
);
szptGdRyxxDTO
.
setSjrzrs
(
"123456"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
szptGdRyxxDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
json
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
// String response = webClient.post().uri("/rest/index/addSzptGdRyxx")
String
response
=
webClient
.
post
().
uri
(
"/rest/index/updateSzptGdRyxx"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
szptGdRyxxDTO
),
SzptGdRyxxDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
@Test
@DisplayName
(
"工地人员信息--删除"
)
public
void
deleteSzptGdRyxxTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
"1234561234561"
);
CommonDelDTO
commonDelDTO
=
new
CommonDelDTO
();
commonDelDTO
.
setIds
(
ids
);
commonDelDTO
.
setSjgsdwdm
(
"330102"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
commonDelDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
String
json1
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json1
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
String
response
=
webClient
.
post
().
uri
(
"/rest/index/deleteSzptGdRyxx"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
commonDelDTO
),
CommonDelDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
/**
* ===================================================设备信息===================================================
*/
@Test
@DisplayName
(
"设备信息--新增、更新"
)
public
void
szptGdSbxxTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
SzptGdSbxxDTO
szptGdSbxxDTO
=
new
SzptGdSbxxDTO
();
szptGdSbxxDTO
.
setId
(
"7"
);
szptGdSbxxDTO
.
setSbsn
(
"1"
);
szptGdSbxxDTO
.
setSbmc
(
"1"
);
szptGdSbxxDTO
.
setSbbh
(
"1"
);
szptGdSbxxDTO
.
setSbms
(
"1"
);
szptGdSbxxDTO
.
setMac
(
"1"
);
szptGdSbxxDTO
.
setIp
(
"123456"
);
szptGdSbxxDTO
.
setNetmask
(
"1"
);
szptGdSbxxDTO
.
setGw
(
"5"
);
szptGdSbxxDTO
.
setCsid
(
"1"
);
szptGdSbxxDTO
.
setYxzt
(
"1"
);
szptGdSbxxDTO
.
setZtgxsj
(
new
Date
());
szptGdSbxxDTO
.
setCj
(
"1"
);
szptGdSbxxDTO
.
setXh
(
"1"
);
szptGdSbxxDTO
.
setQyid
(
"1"
);
szptGdSbxxDTO
.
setQymc
(
"1"
);
szptGdSbxxDTO
.
setSbcs
(
"1"
);
szptGdSbxxDTO
.
setSblb
(
"1"
);
szptGdSbxxDTO
.
setZt
(
"1"
);
szptGdSbxxDTO
.
setSjgsdwdm
(
"330102"
);
szptGdSbxxDTO
.
setSjgsdwmc
(
"1"
);
szptGdSbxxDTO
.
setCreateGajgjgdm
(
"123"
);
szptGdSbxxDTO
.
setCreateGajgmc
(
"123"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
szptGdSbxxDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
json
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
// String response = webClient.post().uri("/rest/index/addSzptGdSbxx")
String
response
=
webClient
.
post
().
uri
(
"/rest/index/updateSzptGdSbxx"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
szptGdSbxxDTO
),
SzptGdSbxxDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
@Test
@DisplayName
(
"设备信息--删除"
)
public
void
deleteSzptGdSbxxTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
"4"
);
ids
.
add
(
"5"
);
ids
.
add
(
"6"
);
CommonDelDTO
commonDelDTO
=
new
CommonDelDTO
();
commonDelDTO
.
setIds
(
ids
);
commonDelDTO
.
setSjgsdwdm
(
"330102"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
commonDelDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
String
json1
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json1
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
String
response
=
webClient
.
post
().
uri
(
"/rest/index/deleteSzptGdSbxx"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
commonDelDTO
),
CommonDelDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
/**
* ===================================================工地信息===================================================
*/
@Test
@DisplayName
(
"工地信息--新增、更新"
)
public
void
szptGdXxTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
SzptGdXxDTO
szptGdXxDTO
=
new
SzptGdXxDTO
();
szptGdXxDTO
.
setId
(
"7"
);
szptGdXxDTO
.
setCslx
(
"1"
);
szptGdXxDTO
.
setCsmc
(
"1111111111111111111"
);
szptGdXxDTO
.
setCsms
(
"1"
);
szptGdXxDTO
.
setLxdz
(
"1"
);
szptGdXxDTO
.
setLxr
(
"1"
);
szptGdXxDTO
.
setLxdh
(
"123456"
);
szptGdXxDTO
.
setSgdw
(
"1"
);
szptGdXxDTO
.
setSgxkz
(
"5"
);
szptGdXxDTO
.
setKgrq
(
new
Date
());
szptGdXxDTO
.
setYjjgrq
(
new
Date
());
szptGdXxDTO
.
setLng
(
"120.3"
);
szptGdXxDTO
.
setLat
(
"30"
);
szptGdXxDTO
.
setCustomlng
(
"1"
);
szptGdXxDTO
.
setCustomlat
(
"1"
);
szptGdXxDTO
.
setZrrxm
(
"1"
);
szptGdXxDTO
.
setZrrlxdh
(
"1"
);
szptGdXxDTO
.
setFrxm
(
"1"
);
szptGdXxDTO
.
setFrlxdh
(
"1"
);
szptGdXxDTO
.
setShxydm
(
"330102"
);
szptGdXxDTO
.
setZcdz
(
"1"
);
szptGdXxDTO
.
setAdminzh
(
"123"
);
szptGdXxDTO
.
setSfzcs
(
"1"
);
szptGdXxDTO
.
setFcsid
(
"1"
);
szptGdXxDTO
.
setBz
(
"1"
);
szptGdXxDTO
.
setCjsj
(
new
Date
());
szptGdXxDTO
.
setZt
(
"1"
);
szptGdXxDTO
.
setJhsj
(
new
Date
());
szptGdXxDTO
.
setLocation
(
"1"
);
szptGdXxDTO
.
setSjlyXtmc
(
"340102"
);
szptGdXxDTO
.
setZxsj
(
new
Date
());
szptGdXxDTO
.
setSqdm
(
"123"
);
szptGdXxDTO
.
setSqmc
(
"123"
);
szptGdXxDTO
.
setMdlx
(
"1"
);
szptGdXxDTO
.
setMdjyzt
(
"1"
);
szptGdXxDTO
.
setSjgsdwdm
(
"330102"
);
szptGdXxDTO
.
setSjgsdwmc
(
"1"
);
szptGdXxDTO
.
setCreateGajgjgdm
(
"1"
);
szptGdXxDTO
.
setCreateGajgmc
(
"1"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
szptGdXxDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
json
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
// String response = webClient.post().uri("/rest/index/addSzptGdXx")
String
response
=
webClient
.
post
().
uri
(
"/rest/index/updateSzptGdXx"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
szptGdXxDTO
),
SzptGdXxDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
@Test
@DisplayName
(
"工地信息--删除"
)
public
void
deleteSzptGdXxTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
"1872956891413839873"
);
ids
.
add
(
"1872957357501657089"
);
ids
.
add
(
"1874652891924905986"
);
CommonDelDTO
commonDelDTO
=
new
CommonDelDTO
();
commonDelDTO
.
setIds
(
ids
);
commonDelDTO
.
setSjgsdwdm
(
"330102"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
commonDelDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
String
json1
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json1
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
String
response
=
webClient
.
post
().
uri
(
"/rest/index/deleteSzptGdXx"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
commonDelDTO
),
CommonDelDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
/**
* ===================================================工地预警流水表===================================================
*/
@Test
@DisplayName
(
"工地预警流水表--新增、更新"
)
public
void
szptGdYjTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
SzptGdYjDTO
szptGdYjDTO
=
new
SzptGdYjDTO
();
szptGdYjDTO
.
setId
(
"1"
);
szptGdYjDTO
.
setCsid
(
"1"
);
szptGdYjDTO
.
setYjrq
(
"1"
);
szptGdYjDTO
.
setYjlx
(
"1"
);
szptGdYjDTO
.
setYjzlx
(
"1"
);
szptGdYjDTO
.
setYjnr
(
"1"
);
szptGdYjDTO
.
setYwid
(
"123456"
);
szptGdYjDTO
.
setYwcs
(
"1"
);
szptGdYjDTO
.
setYjzt
(
"5"
);
szptGdYjDTO
.
setClsj
(
new
Date
());
szptGdYjDTO
.
setCljg
(
"123"
);
szptGdYjDTO
.
setClrid
(
"120.3"
);
szptGdYjDTO
.
setClrxm
(
"30"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
szptGdYjDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
json
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
// String response = webClient.post().uri("/rest/index/addSzptGdYj")
String
response
=
webClient
.
post
().
uri
(
"/rest/index/updateSzptGdYj"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
szptGdYjDTO
),
SzptGdYjDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
@Test
@DisplayName
(
"工地预警流水表--删除"
)
public
void
deleteSzptGdYjTest
()
{
timestampStr
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
nonce
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
secretKey
=
this
.
appStoreService
.
getAppSecretByAppKey
(
appId
);
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
List
<
String
>
ids
=
new
ArrayList
<>();
ids
.
add
(
"1874653022954954754"
);
ids
.
add
(
"1876882297523142657"
);
ids
.
add
(
"1876882403576119297"
);
ids
.
add
(
"1876882723429670913"
);
ids
.
add
(
"1876883035569774594"
);
ids
.
add
(
"1876887147652833281"
);
CommonDelDTO
commonDelDTO
=
new
CommonDelDTO
();
commonDelDTO
.
setIds
(
ids
);
commonDelDTO
.
setSjgsdwdm
(
"330102"
);
String
json
=
null
;
try
{
json
=
objectMapper
.
writeValueAsString
(
commonDelDTO
);
}
catch
(
JsonProcessingException
e
)
{
Assertions
.
fail
(
"json序列化失败"
);
}
//请求体加密
String
json1
=
EncryptUtil
.
getInstance
().
AESEncode
(
json
,
secretKey
);
//签名appId+nonce+timestampStr+aes(body)
String
data
=
String
.
format
(
"%s%s%s%s"
,
appId
,
nonce
,
timestampStr
,
json1
);
String
generatedSignature
=
DigestUtil
.
md5Hex
(
data
);
//请求
WebClient
webClient
=
WebClient
.
builder
()
.
baseUrl
(
"http://localhost:8086"
)
.
defaultHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
String
response
=
webClient
.
post
().
uri
(
"/rest/index/deleteSzptGdYj"
)
.
header
(
SignatureUtil
.
APPID
,
appId
)
.
header
(
SignatureUtil
.
NONCE
,
nonce
)
.
header
(
SignatureUtil
.
TIMESTAMP
,
timestampStr
)
.
header
(
SignatureUtil
.
SIGNATURE
,
generatedSignature
)
.
body
(
Mono
.
just
(
commonDelDTO
),
CommonDelDTO
.
class
)
.
retrieve
()
.
bodyToMono
(
String
.
class
)
.
block
();
System
.
out
.
println
(
response
);
}
}
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