Commit 8f2c7ea8 by 刘鑫

pref: 示例值

1 parent c0ddd255
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);
}
}
......@@ -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;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!