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 dff89591
authored
Oct 08, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: 容量查询接口限制日期范围在一个月内
1 parent
33803aab
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
project-interface/src/main/java/com/dituhui/pea/util/DateUtil.java
project-order/src/main/java/com/dituhui/pea/order/controller/PeaApiController.java
project-interface/src/main/java/com/dituhui/pea/util/DateUtil.java
0 → 100644
View file @
dff8959
This diff is collapsed.
Click to expand it.
project-order/src/main/java/com/dituhui/pea/order/controller/PeaApiController.java
View file @
dff8959
package
com
.
dituhui
.
pea
.
order
.
controller
;
import
com.dituhui.pea.common.BusinessException
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.dto.OrganizationTreeDTO
;
import
com.dituhui.pea.order.dto.param.BaseDistance
;
...
...
@@ -13,6 +14,7 @@ import com.dituhui.pea.order.dto.param.OrderConfirmParam;
import
com.dituhui.pea.order.dto.param.OrderConfirmResult
;
import
com.dituhui.pea.order.dto.param.OrderDTO
;
import
com.dituhui.pea.order.dto.param.ValidGroup
;
import
com.dituhui.pea.util.DateUtil
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
...
...
@@ -26,10 +28,11 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.time.Period
;
import
java.util.Date
;
/**
* PEA
调用API
* PEA
对外接口
*/
@RestController
@RequestMapping
(
"/pea-order/pea"
)
...
...
@@ -108,7 +111,12 @@ public class PeaApiController {
*/
@PostMapping
(
"/capacity/query"
)
public
Result
<
CapacityQueryDTO
.
Result
>
capacityQuery
(
@Validated
@RequestBody
CapacityQueryDTO
.
Request
reqDTO
)
{
//TODO 查询日期起止参数限制为一月
//查询日期起止参数限制为一月
Period
between
=
Period
.
between
(
DateUtil
.
fromDate
(
reqDTO
.
getBeginDate
()).
toLocalDate
(),
DateUtil
.
fromDate
(
reqDTO
.
getEndDate
()).
toLocalDate
());
if
(
between
.
getMonths
()
>
1
)
{
throw
new
BusinessException
(
"查询日期起止参数限制为一月"
);
}
CapacityQueryDTO
.
Result
result
=
new
CapacityQueryDTO
.
Result
();
return
Result
.
success
(
result
);
...
...
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