This commit is contained in:
shuhongfan
2023-09-04 16:40:17 +08:00
commit cf5ac25c14
8267 changed files with 1305066 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
.idea
target/
*.iml

View File

@@ -0,0 +1,34 @@
<?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">
<parent>
<groupId>com.sl-express</groupId>
<artifactId>sl-express-parent</artifactId>
<version>1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.sl-express.ms.carriage</groupId>
<artifactId>sl-express-ms-carriage-domain</artifactId>
<version>1.1-SNAPSHOT</version>
<description>运费微服务-实体</description>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,33 @@
package com.sl.ms.carriage.domain.constant;
/**
* 运费模板常量
*/
public class CarriageConstant {
/**
* 1-同城寄
*/
public static final Integer SAME_CITY = 1;
/**
* 2-省内寄
*/
public static final Integer SAME_PROVINCE = 2;
/**
* 3-经济区互寄
*/
public static final Integer ECONOMIC_ZONE = 3;
/**
* 4-跨省
*/
public static final Integer TRANS_PROVINCE = 4;
/**
* 1-普快
*/
public static final Integer REGULAR_FAST = 1;
/**
* 2-特快
*/
public static final Integer EXPRESS = 2;
}

View File

@@ -0,0 +1,92 @@
package com.sl.ms.carriage.domain.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
import java.time.LocalDateTime;
import java.util.List;
/**
* 运费模板对象
*/
@Data
public class CarriageDTO {
/**
* 运费模板id
*/
@ApiModelProperty(value = "运费模板id")
private Long id;
/**
* 模板类型1-同城寄2-省内寄3-经济区互寄4-跨省
*/
@ApiModelProperty(value = "模板类型1-同城寄2-省内寄3-经济区互寄4-跨省", required = true)
@Max(value = 4, message = "类型值必须是1、2、3、4")
@Min(value = 1, message = "类型值必须是1、2、3、4")
@NotNull(message = "模板类型不能为空")
private Integer templateType;
/**
* 运送类型1-普快2-特快
*/
@ApiModelProperty(value = "运送类型1-普快2-特快", required = true)
@Max(value = 2, message = "类型值必须是1、2")
@Min(value = 1, message = "类型值必须是1、2")
@NotNull(message = "运送类型不能为空")
private Integer transportType;
/**
* 关联城市1-全国2-京津冀3-江浙沪4-川渝5-黑吉辽
*/
@ApiModelProperty(value = "关联城市1-全国2-京津冀3-江浙沪4-川渝5-黑吉辽", required = true)
@NotNull(message = "关联城市不能为空")
private List<String> associatedCityList;
/**
* 首重价格
*/
@ApiModelProperty(value = "首重价格", required = true)
@DecimalMin(value = "1.0", message = "首重价格必须大于等于1")
@DecimalMax(value = "999.9", message = "首重价格必须小于等于999.9")
@NotNull(message = "首重价格不能为空")
private Double firstWeight;
/**
* 续重价格
*/
@ApiModelProperty(value = "续重价格", required = true)
@DecimalMin(value = "1.0", message = "续重价格必须大于等于1")
@DecimalMax(value = "999.9", message = "续重价格必须小于等于999.9")
@NotNull(message = "续重价格不能为空")
private Double continuousWeight;
/**
* 轻抛系数
*/
@ApiModelProperty(value = "轻抛系数", required = true)
@Min(value = 1, message = "轻抛系数必须大于等于1")
@Max(value = 99999, message = "轻抛系数必须小于等于99999")
@NotNull(message = "轻抛系数不能为空")
private Integer lightThrowingCoefficient;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private LocalDateTime created;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private LocalDateTime updated;
@ApiModelProperty(value = "运费")
private Double expense;
@ApiModelProperty(value = "计费重量单位kg")
private Double computeWeight;
}

View File

@@ -0,0 +1,53 @@
package com.sl.ms.carriage.domain.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.*;
/**
* 运费计算参数
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class WaybillDTO {
@ApiModelProperty(value = "单位cm")
@Min(value = 1, message = "长度最小为1")
@Max(value = 999, message = "长度最大为999")
private Integer measureLong;
@ApiModelProperty(value = "单位cm")
@Min(value = 1, message = "宽度最小为1")
@Max(value = 999, message = "宽度最大为999")
private Integer measureWidth;
@ApiModelProperty(value = "单位cm")
@Min(value = 1, message = "高度最小为1")
@Max(value = 999, message = "高度最大为999")
private Integer measureHigh;
@ApiModelProperty(value = "收件地址id市级", required = true)
@NotNull(message = "收件地址id不能为空")
private Long receiverCityId;
@ApiModelProperty(value = "寄件地址id市级", required = true)
@NotNull(message = "寄件地址id不能为空")
private Long senderCityId;
@ApiModelProperty(value = "重量单位kg", required = true)
@DecimalMin(value = "0.1", message = "重量必须大于等于0.1")
@DecimalMax(value = "9999", message = "重量必须小于等于9999")
@NotNull(message = "重量不能为空")
private Double weight;
@ApiModelProperty(value = "体积单位cm^3")
@Min(value = 1, message = "体积最小为1cm^3")
@Max(value = 99000000, message = "体积最大为99m^3")
private Integer volume;
}

View File

@@ -0,0 +1,55 @@
package com.sl.ms.carriage.domain.enums;
/**
* 经济区枚举
*/
public enum EconomicRegionEnum {
BTH("2", new Long[] {1L, 7362L, 13267L}),
JZS("3", new Long[] {167904L, 191019L, 161792L}),
SC("4", new Long[] {545532L, 533328L}),
HJL("5", new Long[] {145665L, 145665L, 115224L});
/**
* 类型编码
*/
private final String code;
/**
* 类型值
*/
private final Long[] value;
EconomicRegionEnum(String code, Long[] value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public Long[] getValue() {
return value;
}
public static EconomicRegionEnum codeOf(String code) {
switch (code) {
case "2": {
return BTH;
}
case "3": {
return JZS;
}
case "4": {
return SC;
}
case "5": {
return HJL;
}
default: {
return null;
}
}
}
}