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 b4959be6
authored
Sep 26, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
所有pea对外接口定义
1 parent
dc896386
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
674 additions
and
11 deletions
project-order/pom.xml
project-order/src/main/java/com/dituhui/pea/order/controller/PeaApiController.java
project-order/src/main/java/com/dituhui/pea/order/dto/param/BaseDistance.java
project-order/src/main/java/com/dituhui/pea/order/dto/param/CapacityQueryDTO.java
project-order/src/main/java/com/dituhui/pea/order/dto/param/EngineerBaseInfo.java
project-order/src/main/java/com/dituhui/pea/order/dto/param/EngineerCalendar.java
project-order/src/main/java/com/dituhui/pea/order/dto/param/EngineerCalendarResultDTO.java
project-order/src/main/java/com/dituhui/pea/order/dto/param/EngineerCode.java
project-order/src/main/java/com/dituhui/pea/order/dto/param/EngineerParamDTO.java
project-order/src/main/java/com/dituhui/pea/order/dto/param/EstimateDTO.java
project-order/src/main/java/com/dituhui/pea/order/dto/param/OrderConfirmBaseParam.java
project-order/src/main/java/com/dituhui/pea/order/dto/param/OrderDTO.java
project-order/pom.xml
View file @
b4959be
...
...
@@ -114,6 +114,12 @@
<artifactId>
sentry-spring-boot-starter
</artifactId>
<version>
6.22.0
</version>
</dependency>
<dependency>
<groupId>
org.optaplanner
</groupId>
<artifactId>
optaplanner-core-impl
</artifactId>
<version>
9.38.0.Final
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
<build>
...
...
project-order/src/main/java/com/dituhui/pea/order/controller/PeaApiController.java
View file @
b4959be
...
...
@@ -2,12 +2,16 @@ package com.dituhui.pea.order.controller;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.dto.OrganizationTreeDTO
;
import
com.dituhui.pea.order.dto.param.BaseDistance
;
import
com.dituhui.pea.order.dto.param.CapacityQueryDTO
;
import
com.dituhui.pea.order.dto.param.EngineerCalendarResultDTO
;
import
com.dituhui.pea.order.dto.param.EngineerOrderParam
;
import
com.dituhui.pea.order.dto.param.EngineerParamDTO
;
import
com.dituhui.pea.order.dto.param.EstimateDTO
;
import
com.dituhui.pea.order.dto.param.Order
;
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.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -22,9 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
/**
* PEA 调用API
...
...
@@ -76,6 +78,26 @@ public class PeaApiController {
return
Result
.
success
(
null
);
}
/**
* 3.1GET 查询技术员日历
*
* @param engineerCode 工程师编码
* @param beginDate 开始日期, 格式:yyyy-MM-dd
* @param endDate 结束日期, 格式:yyyy-MM-dd
* @return 日期内工程师工作日历信息
* @apiNote 查询工程师日期范围内的日历事件安排, 返回的内容包括:(多条)开始时间,结束时间,事件代码,事件名称,事件说明等
*/
@GetMapping
(
"/engineer/calendar"
)
public
Result
<
EngineerCalendarResultDTO
>
engineerCalendar
(
@RequestParam
(
value
=
"engineerCode"
)
String
engineerCode
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@RequestParam
(
value
=
"beginDate"
)
Date
beginDate
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@RequestParam
(
value
=
"beginDate"
)
Date
endDate
)
{
return
Result
.
success
(
new
EngineerCalendarResultDTO
());
}
/**
* 4.1 创单可用容量查询
...
...
@@ -114,17 +136,73 @@ public class PeaApiController {
return
Result
.
success
(
new
CapacityQueryDTO
.
PersonalResult
());
}
/**
* 5.1POST 技术员上门里程预估
*
* @param request Body请求参数
* @return ..
* @apiNote 根据客户地点及技能需求,查询对应的服务站点,计算出站点到客户地点间路程公里数
*/
@PostMapping
(
"/estimate/visit"
)
public
Result
<
EstimateDTO
.
VisitResult
>
estimateVisit
(
@Validated
@RequestBody
EstimateDTO
.
VisitRequest
request
)
{
return
Result
.
success
(
new
EstimateDTO
.
VisitResult
());
}
/**
* 6.1POST 创建预约工单
*
* @param request 工单创建请求参数
* @return 创建成功与否
* @apiNote 接收工单请求,一个工单可能会有多次预约,有多个预约单号;
*/
@PostMapping
(
" /order/create"
)
public
Result
<?>
orderCreate
(
@Validated
@RequestBody
OrderDTO
.
OrderCreateRequest
request
)
{
return
Result
.
success
(
null
);
}
/**
* 6.2GET 预约单服务进度查询
*
* @param orderId 工单号码
* @return 工单进度信息
* @apiNote 查询预约单状态,返回指定技术员(主,副)信息、推荐上门时间。如果查询为服务当日,增加对应技术员准实时位置,距离公里数,预计到达时间等
*/
@GetMapping
(
"/order/stage/query"
)
public
Result
<
OrderDTO
.
StageResult
>
orderStage
(
@NotBlank
@RequestParam
(
"orderId"
)
String
orderId
)
{
return
Result
.
success
(
new
OrderDTO
.
StageResult
());
}
/**
* 6.3POST 工单变更
*
* @param request Body请求参数
* @return 变更信息处理成功与否
* @apiNote BEAN端在工单信息或者状态变更的时候,通知PEA系统
*/
@PostMapping
(
"/order/stage/change"
)
public
Result
<?>
orderStageChanged
(
@Validated
@RequestBody
OrderDTO
.
StageChangeRequest
request
)
{
return
Result
.
success
(
null
);
}
/**
* 7.1POST 申请加单
* 2023/09/26 通知更改为返回单条数据
*
* @param requestParam 申请加单请求参数
* @return 订单列表
* @apiNote 技术员发起申请,根据技术员当前位置和空闲时间段,返回附近的n张尚未分配,且不需要备件的工单,技术员逐条顺序联系客户确认
*/
@PostMapping
(
"/order/increase/query"
)
public
Result
<
List
<
Order
>
>
orderIncrease
(
@Validated
@RequestBody
EngineerOrderParam
requestParam
)
{
public
Result
<
Order
>
orderIncrease
(
@Validated
@RequestBody
EngineerOrderParam
requestParam
)
{
return
Result
.
success
(
Collections
.
emptyList
());
return
Result
.
success
(
new
Order
());
}
/**
...
...
@@ -141,4 +219,42 @@ public class PeaApiController {
}
/**
* 8.1GET 预约单统计数据
*
* @param engineerCode 工程师工号
* @param date 查询日期 yyyy-MM-dd
* @return 预约单统计数据
* @apiNote 已完单统计技术员实际里程,提交到BEAN,(预约已完成且已上门算在里面),两个值,一个在当日排班后计算,一个结束后算实际的。
*/
@GetMapping
(
"/engineer/daystatis"
)
public
Result
<
OrderDTO
.
AppointResult
>
engineerDayStatics
(
@NotBlank
@RequestParam
(
"engineerCode"
)
String
engineerCode
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@NotNull
@RequestParam
(
"date"
)
Date
date
)
{
return
Result
.
success
(
new
OrderDTO
.
AppointResult
());
}
/**
* 9.1GET 两点间里程和耗时查询
*
* @param origin 出发点经纬度
* @param destination 目的地
* @param vehicle 交通工具:1汽车;2电动车;3自行车;4步行;默认是汽车
* @return 两点间里程和耗时
* @apiNote 根据交通工具查询两个坐标点之间的里程和耗时
*/
@GetMapping
(
"/base/distance"
)
public
Result
<
BaseDistance
>
baseDistance
(
@NotBlank
@RequestParam
(
"origin"
)
String
origin
,
@NotBlank
@RequestParam
(
"destination"
)
String
destination
,
Integer
vehicle
)
{
return
Result
.
success
(
new
BaseDistance
());
}
}
project-order/src/main/java/com/dituhui/pea/order/dto/param/BaseDistance.java
0 → 100644
View file @
b4959be
package
com
.
dituhui
.
pea
.
order
.
dto
.
param
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
* 两点间里程和耗时 结果返回参数
*/
@Setter
@Getter
public
class
BaseDistance
{
/**
* 出发点 经度,纬度
*/
private
String
origin
;
/**
* 目的地 经度,纬度
*/
private
String
destination
;
/**
* 交通工具,1汽车;2电动车;3骑车;4步行
*/
private
Integer
vehicle
;
/**
* 路程距离,单位: 米
*/
private
Integer
distance
;
/**
* 耗时 单位: 秒
*/
private
Long
duration
;
}
project-order/src/main/java/com/dituhui/pea/order/dto/param/CapacityQueryDTO.java
View file @
b4959be
...
...
@@ -17,6 +17,8 @@ import java.util.List;
* 创单可用容量
*/
@Validated
@Setter
@Getter
public
class
CapacityQueryDTO
{
/**
...
...
project-order/src/main/java/com/dituhui/pea/order/dto/param/EngineerBaseInfo.java
0 → 100644
View file @
b4959be
package
com
.
dituhui
.
pea
.
order
.
dto
.
param
;
import
lombok.EqualsAndHashCode
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
* 工程师基础信息
*/
@Setter
@Getter
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
EngineerBaseInfo
extends
EngineerCode
{
/**
* 工程师名称
*/
private
String
engineerName
;
}
project-order/src/main/java/com/dituhui/pea/order/dto/param/EngineerCalendar.java
0 → 100644
View file @
b4959be
package
com
.
dituhui
.
pea
.
order
.
dto
.
param
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.EqualsAndHashCode
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
/**
* 工程师日历
*/
@Setter
@Getter
@EqualsAndHashCode
public
class
EngineerCalendar
{
/**
* 日期
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
date
;
/**
* 事件类型
*/
private
String
type
;
/**
* 开始时间
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
beginTime
;
/**
* 结束时间
*/
private
Date
endTime
;
/**
* 备注
*/
private
String
memo
;
}
project-order/src/main/java/com/dituhui/pea/order/dto/param/EngineerCalendarResultDTO.java
0 → 100644
View file @
b4959be
package
com
.
dituhui
.
pea
.
order
.
dto
.
param
;
import
lombok.EqualsAndHashCode
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.util.List
;
/**
* 技术员日历返回参数
*/
@Setter
@Getter
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
EngineerCalendarResultDTO
extends
EngineerBaseInfo
{
/**
* 日历内容
*/
private
List
<
EngineerCalendar
>
calendar
;
}
project-order/src/main/java/com/dituhui/pea/order/dto/param/EngineerCode.java
0 → 100644
View file @
b4959be
package
com
.
dituhui
.
pea
.
order
.
dto
.
param
;
import
lombok.EqualsAndHashCode
;
import
lombok.Getter
;
import
lombok.Setter
;
import
javax.validation.constraints.NotBlank
;
/**
* 工程师编号
*/
@Setter
@Getter
@EqualsAndHashCode
public
class
EngineerCode
{
/**
* 工程师工号
*/
@NotBlank
protected
String
engineerCode
;
}
project-order/src/main/java/com/dituhui/pea/order/dto/param/EngineerParamDTO.java
View file @
b4959be
...
...
@@ -14,6 +14,9 @@ import java.util.List;
/**
* 技术员信息
*/
@Setter
@Getter
@Validated
public
class
EngineerParamDTO
{
/**
...
...
project-order/src/main/java/com/dituhui/pea/order/dto/param/EstimateDTO.java
0 → 100644
View file @
b4959be
package
com
.
dituhui
.
pea
.
order
.
dto
.
param
;
import
lombok.Getter
;
import
lombok.Setter
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
@Setter
@Getter
public
class
EstimateDTO
{
/**
* 技术员上门里程预估请求参数
*/
@Setter
@Getter
public
static
class
VisitRequest
{
/**
* 品牌
*/
@NotBlank
private
String
brand
;
/**
* 类型
*/
@NotBlank
private
String
productType
;
/**
* 技能
*/
@NotBlank
private
String
serviceType
;
/**
* 地址坐标信息
*/
@NotNull
private
Location
location
;
}
/**
* 技术员上门里程预估返回结果参数结构
*/
@Setter
@Getter
public
static
class
VisitResult
{
/**
* 服务站点ID
*/
private
String
groupId
;
/**
* 服务站点名称
*/
private
String
groupName
;
/**
* 服务站点距离客户路程里程 ,单位: 米
*/
private
Integer
distance
;
/**
* 地址坐标信息
*/
private
Location
groupLocation
;
/**
* 地址坐标信息
*/
private
Location
destination
;
}
}
project-order/src/main/java/com/dituhui/pea/order/dto/param/OrderConfirmBaseParam.java
View file @
b4959be
package
com
.
dituhui
.
pea
.
order
.
dto
.
param
;
import
lombok.EqualsAndHashCode
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
@@ -10,16 +11,12 @@ import javax.validation.constraints.NotBlank;
*/
@Setter
@Getter
public
class
OrderConfirmBaseParam
{
/**
* 工程师工号
*/
@NotBlank
private
String
engineerCode
;
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
OrderConfirmBaseParam
extends
EngineerCode
{
/**
* 工单号
*/
@NotBlank
pr
ivate
String
orderId
;
pr
otected
String
orderId
;
}
project-order/src/main/java/com/dituhui/pea/order/dto/param/OrderDTO.java
0 → 100644
View file @
b4959be
package
com
.
dituhui
.
pea
.
order
.
dto
.
param
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.EqualsAndHashCode
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
import
java.util.List
;
/**
* 工单数据传输对象
*/
@Setter
@Getter
public
class
OrderDTO
{
/**
* 工单创建请求参数
*/
@Setter
@Getter
@EqualsAndHashCode
public
static
class
OrderCreateRequest
{
/**
* 工单来源,填写:JD、400等
*/
@NotBlank
private
String
source
;
/**
* BEAN工单号码
*/
@NotBlank
private
String
orderId
;
/**
* BEAN系统子工单号码
*/
private
String
subId
;
/**
* 客户姓名
*/
@NotBlank
private
String
name
;
/**
* 客户联系电话
*/
@NotBlank
private
String
phone
;
/**
* 地址坐标信息
*/
@NotNull
@Valid
private
Location
location
;
/**
* 设备品牌(博世/西门子)
*/
@NotBlank
private
String
brand
;
/**
* 产品类别
*/
@NotBlank
private
String
product_type
;
/**
* 服务类型
*/
@NotBlank
private
String
service_type
;
/**
* 故障描述
*/
@NotBlank
private
String
faultDescribe
;
/**
* 预约时间段开始
*/
@NotNull
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
expectBegin
;
/**
* 预约时间段结束
*/
@NotNull
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
expectEnd
;
/**
* 预约描述时间(全天/上午/下午)
*/
@NotBlank
private
String
expectDesc
;
/**
* 优先级
*/
@NotBlank
private
String
priority
;
/**
* 服务单标签列表
*/
@NotNull
private
List
<
String
>
orderTags
;
/**
* 备注(周末安装/到小区打电话)
*/
@NotBlank
private
String
description
;
/**
* 其他详细信息, 预留的其他详细信息,具体等BEAN提供
*/
private
Object
extraInfo
;
}
/**
* 工单变更请求参数
*/
@Setter
@Getter
public
static
class
StageChangeRequest
{
/**
* 工单号码
*/
@NotBlank
private
String
orderId
;
/**
* 工单状态,取消/改约/挂起等
*/
@NotBlank
private
String
orderStatus
;
/**
* 发生时间,yyyy-MM-dd HH:mm:ss
*/
@NotNull
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
happen
;
/**
* 过程节点 已联系/准备服务/开始服务/结束服务等
*/
@NotBlank
private
String
stage
;
/**
* 新预约时间, 特殊状态的时候填写:orderStatus为改约的时候填写
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
newReservationTime
;
/**
* 描述信息
*/
private
String
description
;
/**
* 地址坐标信息
*/
private
Location
happenLocation
;
}
/**
* 服务单进度
*/
@Setter
@Getter
public
static
class
StageResult
{
/**
* 工单号
*/
private
String
orderId
;
/**
* 工程师工号
*/
private
String
engineerCode
;
/**
* 工程师姓名
*/
private
String
engineerName
;
/**
* 辅助工程师工号
*/
private
String
engineerCodeAssist
;
/**
* 辅助工程师姓名
*/
private
String
engineerNameAssist
;
/**
* 推荐上门时间
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
planVisitTime
;
/**
* 工程师实时信息,服务当天返回;非当天不返回;
*/
private
RealtimeInfo
realtimeInfo
;
}
@Setter
@Getter
public
static
class
RealtimeInfo
{
/**
* 地址坐标信息
*/
private
Location
engineerLocation
;
/**
* 上门预估信息
*/
private
Estimate
estimate
;
}
@Setter
@Getter
public
static
class
Estimate
{
/**
* 距离
*/
private
Double
distance
;
/**
* 预计到达时间 格式: yyyy-MM-dd HH:mm:ss
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
arriveTime
;
}
/**
* 工程师统计订单结果
*/
@Setter
@Getter
public
static
class
AppointResult
extends
EngineerCode
{
/**
* 查询日期
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
date
;
/**
* 查询统计订单列表
*/
private
List
<
AppointmentOrderResult
>
orders
;
}
/**
* 预约单
*/
@Setter
@Getter
public
static
class
AppointmentOrderResult
{
/**
* 工单号
*/
private
String
orderId
;
/**
* 服务状态
*/
private
String
orderStatus
;
/**
* 计划服务开始时间
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
planBeginTime
;
/**
* 计划在途里程
*/
private
Integer
planDistance
;
/**
* 计划在途时间
*/
private
Integer
planDuration
;
/**
* 实际在途时间 实际服务后返回,单位:秒
*/
private
Integer
actualDuration
;
/**
* 实际服务开始时间
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
actualBeginTime
;
/**
* 实际在途里程 实际服务后返回
*/
private
Integer
actualDistance
;
}
}
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