init
This commit is contained in:
3
sl-express-ms-transport-domain/.gitignore
vendored
Normal file
3
sl-express-ms-transport-domain/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.idea
|
||||
target/
|
||||
*.iml
|
35
sl-express-ms-transport-domain/pom.xml
Normal file
35
sl-express-ms-transport-domain/pom.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.sl-express</groupId>
|
||||
<artifactId>sl-express-parent</artifactId>
|
||||
<version>1.4</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.sl-express.ms.transport</groupId>
|
||||
<artifactId>sl-express-ms-transport-domain</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
<description>线路规划微服务 - domain</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<sl-express-common.version>1.2-SNAPSHOT</sl-express-common.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.sl-express.common</groupId>
|
||||
<artifactId>sl-express-common</artifactId>
|
||||
<version>${sl-express-common.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@@ -0,0 +1,32 @@
|
||||
package com.sl.transport.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel("成本配置")
|
||||
public class CostConfigurationDTO {
|
||||
@ApiModelProperty(value = "线路类型, TRUNK_LINE(1, \"干线\", \"一级转运中心到一级转运中心\"),\n" +
|
||||
" BRANCH_LINE(2, \"支线\", \"一级转运中心与二级转运中心之间线路\"),\n" +
|
||||
" CONNECT_LINE(3, \"接驳路线\", \"二级转运中心到网点\"),", required = true)
|
||||
@NotNull(message = "线路类型不能为空!")
|
||||
@Min(value = 1, message = "线路类型最小为1!")
|
||||
@Max(value = 3, message = "线路类型最大为3!")
|
||||
private Integer transportLineType;
|
||||
|
||||
@ApiModelProperty(value = "成本,只支持输入数字,小数点后2位,不能为空\n" +
|
||||
"默认值:干线0.8元、支线1.2元、接驳1.5", required = true)
|
||||
@NotNull(message = "成本不能为空!")
|
||||
private Double cost;
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
package com.sl.transport.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel("调度配置")
|
||||
public class DispatchConfigurationDTO {
|
||||
@ApiModelProperty(value = "调度时间,单位:小时。分配运输任务的提前量,限定1-48小时", required = true)
|
||||
@NotNull(message = "调度时间不能为空!")
|
||||
@Min(value = 1, message = "调度时间最小为1!")
|
||||
@Max(value = 48, message = "调度时间最大为48!")
|
||||
private Integer dispatchTime;
|
||||
|
||||
@ApiModelProperty(value = "调度方式,1转运次数最少,2成本最低;默认成本最低", required = true)
|
||||
@NotNull(message = "调度方式不能为空!")
|
||||
@Min(value = 1, message = "调度方式最小为1!")
|
||||
@Max(value = 2, message = "调度方式最大为2!")
|
||||
private Integer dispatchMethod;
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
package com.sl.transport.domain;
|
||||
|
||||
import cn.hutool.core.annotation.Alias;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 机构数据对象
|
||||
*
|
||||
* @author zzj
|
||||
* @version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class OrganDTO {
|
||||
|
||||
@ApiModelProperty(value = "机构id", required = true)
|
||||
@Alias("bid")
|
||||
@NotNull(message = "机构id不能为空")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "名称", required = true)
|
||||
private String name;
|
||||
@ApiModelProperty(value = "类型,1:一级转运,2:二级转运,3:网点", required = true)
|
||||
@Max(value = 3, message = "类型值必须是1、2、3")
|
||||
@Min(value = 1, message = "类型值必须是1、2、3")
|
||||
private Integer type;
|
||||
@ApiModelProperty(value = "电话", required = true)
|
||||
private String phone;
|
||||
@ApiModelProperty(value = "地址", required = true)
|
||||
private String address;
|
||||
@ApiModelProperty(value = "纬度", required = true)
|
||||
private Double latitude;
|
||||
@ApiModelProperty(value = "经度", required = true)
|
||||
private Double longitude;
|
||||
@ApiModelProperty(value = "父节点id", required = true)
|
||||
private Long parentId;
|
||||
@ApiModelProperty(value = "负责人", required = true)
|
||||
private String managerName;
|
||||
@ApiModelProperty(value = "扩展字段,以json格式存储")
|
||||
private String extra;
|
||||
@ApiModelProperty(value = "是否可用", required = true)
|
||||
private Boolean status;
|
||||
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
package com.sl.transport.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
|
||||
/**
|
||||
* 路线对象
|
||||
*
|
||||
* @author zzj
|
||||
* @version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class TransportLineDTO {
|
||||
|
||||
@ApiModelProperty(value = "名称", required = true)
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "编号")
|
||||
private String number;
|
||||
@ApiModelProperty(value = "成本")
|
||||
private Double cost;
|
||||
@ApiModelProperty(value = "类型,1:干线,2:支线,3:接驳路线", required = true)
|
||||
@Max(value = 3, message = "类型值必须是1、2、3")
|
||||
@Min(value = 1, message = "类型值必须是1、2、3")
|
||||
private Integer type;
|
||||
@ApiModelProperty(value = "路线名称")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "距离,单位:米")
|
||||
private Double distance;
|
||||
@ApiModelProperty(value = "时间,单位:秒")
|
||||
private Double time;
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Long created;
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Long updated;
|
||||
@ApiModelProperty(value = "扩展字段,以json格式存储")
|
||||
private String extra;
|
||||
@ApiModelProperty(value = "起点机构id")
|
||||
private Long startOrganId;
|
||||
@ApiModelProperty(value = "起点机构名称,只有在查询时返回")
|
||||
private String startOrganName;
|
||||
@ApiModelProperty(value = "终点机构id")
|
||||
private Long endOrganId;
|
||||
@ApiModelProperty(value = "终点机构名称,只有在查询时返回")
|
||||
private String endOrganName;
|
||||
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.sl.transport.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 运输路线对象
|
||||
*/
|
||||
@Data
|
||||
public class TransportLineNodeDTO {
|
||||
|
||||
@ApiModelProperty(value = "节点列表", required = true)
|
||||
private List<OrganDTO> nodeList = new ArrayList<>();
|
||||
@ApiModelProperty(value = "路线成本", required = true)
|
||||
private Double cost = 0d;
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package com.sl.transport.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zzj
|
||||
* @version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class TransportLineSearchDTO {
|
||||
|
||||
@ApiModelProperty(value = "路线名称")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "编号")
|
||||
private String number;
|
||||
@ApiModelProperty(value = "起点机构id")
|
||||
private Long startOrganId;
|
||||
@ApiModelProperty(value = "终点机构id")
|
||||
private Long endOrganId;
|
||||
@ApiModelProperty(value = "页数")
|
||||
private Integer page = 1;
|
||||
@ApiModelProperty(value = "页数大小")
|
||||
private Integer pageSize = 10;
|
||||
}
|
@@ -0,0 +1,53 @@
|
||||
package com.sl.transport.enums;
|
||||
|
||||
import cn.hutool.core.util.EnumUtil;
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.sl.transport.common.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* 调度方式,1转运次数最少,2成本最低
|
||||
*/
|
||||
public enum DispatchMethodEnum implements BaseEnum {
|
||||
|
||||
/**
|
||||
* 1转运次数最少
|
||||
*/
|
||||
SHORTEST_PATH(1, "转运次数最少"),
|
||||
|
||||
/**
|
||||
* 2成本最低
|
||||
*/
|
||||
LOWEST_PATH(2, "成本最低");
|
||||
|
||||
DispatchMethodEnum(Integer code, String value) {
|
||||
this.code = code;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
@EnumValue
|
||||
@JsonValue
|
||||
private final Integer code;
|
||||
|
||||
/**
|
||||
* 类型值
|
||||
*/
|
||||
private final String value;
|
||||
|
||||
@Override
|
||||
public Integer getCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static DispatchMethodEnum codeOf(Integer code) {
|
||||
return EnumUtil.getBy(DispatchMethodEnum::getCode, code);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user