Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c242d397
authored
Sep 21, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_16542_system_auth' into 'develop'
pref: 示例值 See merge request !339
2 parents
c0ddd255
8f2c7ea8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
6 deletions
project-order/src/main/java/com/dituhui/pea/order/controller/PeaApiController.java
project-order/src/main/java/com/dituhui/pea/order/dto/param/CapacityQueryDTO.java
project-order/src/main/java/com/dituhui/pea/order/controller/PeaApiController.java
View file @
c242d39
package
com
.
dituhui
.
pea
.
order
.
controller
;
import
cn.hutool.json.JSONUtil
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.dto.OrganizationTreeDTO
;
import
com.dituhui.pea.order.dto.param.CapacityQueryDTO
;
...
...
@@ -81,7 +82,57 @@ public class PeaApiController {
public
Result
<
CapacityQueryDTO
.
Result
>
capacityQuery
(
@Validated
@RequestBody
CapacityQueryDTO
.
Request
reqDTO
)
{
//TODO 查询日期起止参数限制为一月
return
Result
.
success
(
null
);
String
json
=
"{\n"
+
" \"groupId\": \"G100038\",\n"
+
" \"params\": {\n"
+
" \"beginDate\": \"2023-07-21\",\n"
+
" \"endDate\": \"2023-07-27\",\n"
+
" \"brand\": \"嘉格纳\",\n"
+
" \"product_type\": \"洗衣机\",\n"
+
" \"service_type\": \"商场样机安装\",\n"
+
" \"location\": {\n"
+
" \"latitude\": 120.608463,\n"
+
" \"longitude\": 31.318442,\n"
+
" \"name\": \"江苏省苏州市姑苏区蒋庙前\",\n"
+
" \"address\": \"江苏省苏州市姑苏区解放大街123号\"\n"
+
" }\n"
+
" },\n"
+
" \"takeTime\": 720,\n"
+
" \"datas\": [\n"
+
" {\n"
+
" \"date\": \"2023-07-21\",\n"
+
" \"segments\": [\n"
+
" {\n"
+
" \"maxDuration\": 90,\n"
+
" \"name\": \"全天\",\n"
+
" \"beginTime\": \"2023-07-21 08:00:00\",\n"
+
" \"endTime\": \"2023-07-21 17:59:59\",\n"
+
" \"status\": 1,\n"
+
" \"remain\": 3500\n"
+
" },\n"
+
" {\n"
+
" \"maxDuration\": 45,\n"
+
" \"name\": \"上午\",\n"
+
" \"beginTime\": \"2023-07-21 08:00:00\",\n"
+
" \"endTime\": \"2023-07-21 11:59:59\",\n"
+
" \"status\": 1,\n"
+
" \"remain\": 2500\n"
+
" },\n"
+
" {\n"
+
" \"maxDuration\": 60,\n"
+
" \"name\": \"下午\",\n"
+
" \"beginTime\": \"2023-07-21 13:00:00\",\n"
+
" \"endTime\": \"2023-07-21 17:59:59\",\n"
+
" \"status\": 0,\n"
+
" \"remain\": 1000\n"
+
" }\n"
+
" ]\n"
+
" }\n"
+
" ]\n"
+
" }"
;
CapacityQueryDTO
.
Result
result
=
JSONUtil
.
toBean
(
json
,
CapacityQueryDTO
.
Result
.
class
);
return
Result
.
success
(
result
);
}
...
...
@@ -104,7 +155,44 @@ public class PeaApiController {
@RequestParam
(
"endDate"
)
Date
endDate
)
{
return
Result
.
success
(
null
);
String
json
=
"{\n"
+
" \"engineerCode\": \"A124141214\",\n"
+
" \"engineerName\": \"祝枝山\",\n"
+
" \"datas\": [\n"
+
" {\n"
+
" \"date\": \"2023-07-21\",\n"
+
" \"segments\": [\n"
+
" {\n"
+
" \"maxDuration\": 90,\n"
+
" \"name\": \"全天\",\n"
+
" \"beginTime\": \"2023-07-21 08:00:00\",\n"
+
" \"endTime\": \"2023-07-21 17:59:59\",\n"
+
" \"status\": 1,\n"
+
" \"remain\": 3500\n"
+
" },\n"
+
" {\n"
+
" \"maxDuration\": 45,\n"
+
" \"name\": \"上午\",\n"
+
" \"beginTime\": \"2023-07-21 08:00:00\",\n"
+
" \"endTime\": \"2023-07-21 11:59:59\",\n"
+
" \"status\": 1,\n"
+
" \"remain\": 2500\n"
+
" },\n"
+
" {\n"
+
" \"maxDuration\": 60,\n"
+
" \"name\": \"下午\",\n"
+
" \"beginTime\": \"2023-07-21 13:00:00\",\n"
+
" \"endTime\": \"2023-07-21 17:59:59\",\n"
+
" \"status\": 0,\n"
+
" \"remain\": 1000\n"
+
" }\n"
+
" ]\n"
+
" }\n"
+
" ]\n"
+
" }"
;
CapacityQueryDTO
.
PersonalResult
result
=
JSONUtil
.
toBean
(
json
,
CapacityQueryDTO
.
PersonalResult
.
class
);
return
Result
.
success
(
result
);
}
}
project-order/src/main/java/com/dituhui/pea/order/dto/param/CapacityQueryDTO.java
View file @
c242d39
...
...
@@ -11,6 +11,7 @@ import javax.validation.constraints.NotBlank;
import
javax.validation.constraints.NotNull
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -41,13 +42,17 @@ public class CapacityQueryDTO {
/**
* 查询起始日期
*/
@NotBlank
private
String
beginDate
;
@NotNull
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
beginDate
;
/**
* 查询结束日期
*/
@NotBlank
private
String
endDate
;
@NotNull
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endDate
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment