1. 手动合并存在重复被合并的文件,并统一包名
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?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>
|
||||
<artifactId>zt-module-backend-logistics</artifactId>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>zt-module-backend-logistics-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-common</artifactId>
|
||||
</dependency>
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId> <!-- 接口文档:使用最新版本的 Swagger 模型 -->
|
||||
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.zt.plat.module.backendlogistics.enums;
|
||||
|
||||
import com.zt.plat.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* backend-logistics 错误码枚举类
|
||||
*
|
||||
* backend-logistics 系统,使用 1-xxx-xxx-xxx 段
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
/**
|
||||
* 业务异常的错误码区间,解决:解决各模块错误码定义,避免重复,在此只声明不做实际使用
|
||||
* <p>
|
||||
* 一共 10 位,分成四段
|
||||
* <p>
|
||||
* 第一段,1 位,类型
|
||||
* 1 - 业务级别异常
|
||||
* x - 预留
|
||||
* 第二段,3 位,系统类型
|
||||
* 001 - 用户系统
|
||||
* 002 - 商品系统
|
||||
* 003 - 订单系统
|
||||
* 004 - 支付系统
|
||||
* 005 - 优惠劵系统
|
||||
* ... - ...
|
||||
* 第三段,3 位,模块
|
||||
* 不限制规则。
|
||||
* 一般建议,每个系统里面,可能有多个模块,可以再去做分段。以用户系统为例子:
|
||||
* 001 - OAuth2 模块
|
||||
* 002 - User 模块
|
||||
* 003 - MobileCode 模块
|
||||
* 第四段,3 位,错误码
|
||||
* 不限制规则。
|
||||
* 一般建议,每个模块自增。
|
||||
*
|
||||
* @author Rayson
|
||||
*/
|
||||
// ========== 示例模块 1-001-000-000 ==========
|
||||
ErrorCode EXAMPLE_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
||||
ErrorCode VISIT_COMPANY_ID_NOT_EXISTS = new ErrorCode(1_100_000_002, "headers缺少visit-company-id参数");
|
||||
ErrorCode VISIT_COMPANY_ID_NOT_TOP_COMPANY = new ErrorCode(1_100_000_002, "visit-company-id传入的不是顶级账套id");
|
||||
|
||||
// 模块 infra 错误码区间 [1-001-000-000 ~ 1-002-000-000)
|
||||
// 模块 system 错误码区间 [1-002-000-000 ~ 1-003-000-000)
|
||||
// 模块 report 错误码区间 [1-003-000-000 ~ 1-004-000-000)
|
||||
// 模块 member 错误码区间 [1-004-000-000 ~ 1-005-000-000)
|
||||
// 模块 mp 错误码区间 [1-006-000-000 ~ 1-007-000-000)
|
||||
// 模块 pay 错误码区间 [1-007-000-000 ~ 1-008-000-000)
|
||||
// 模块 bpm 错误码区间 [1-009-000-000 ~ 1-010-000-000)
|
||||
// 模块 product 错误码区间 [1-008-000-000 ~ 1-009-000-000)
|
||||
// 模块 trade 错误码区间 [1-011-000-000 ~ 1-012-000-000)
|
||||
// 模块 promotion 错误码区间 [1-013-000-000 ~ 1-014-000-000)
|
||||
// 模块 crm 错误码区间 [1-020-000-000 ~ 1-021-000-000)
|
||||
|
||||
// 模块 bseMngt.plceAchi [1_100_001_000 ~ 1_100_001_999]
|
||||
ErrorCode WAREHOUSE_NOT_EXISTS = new ErrorCode(1_100_001_001, "仓库信息不存在");
|
||||
ErrorCode FACTORY_NOT_EXISTS = new ErrorCode(1_100_001_002, "生产厂区信息不存在");
|
||||
ErrorCode RAILWAY_STATION_NOT_EXISTS = new ErrorCode(1_100_001_003, "铁路站点维护不存在");
|
||||
ErrorCode PORT_NOT_EXISTS = new ErrorCode(1_100_001_004, "港口信息不存在");
|
||||
ErrorCode AUNCEL_CONFIG_NOT_EXISTS = new ErrorCode(1_100_001_005, "计量点配置不存在");
|
||||
ErrorCode GATE_CONFIG_NOT_EXISTS = new ErrorCode(1_100_001_006, "门岗信息不存在");
|
||||
ErrorCode CONSIGNEE_ADDRESS_NOT_EXISTS = new ErrorCode(1_100_001_007, "客户收货地址不存在");
|
||||
ErrorCode PLACE_ARCHIVE_MATERIAL_NOT_EXISTS = new ErrorCode(1_100_001_008, "地点档案物料信息不存在");
|
||||
ErrorCode CORR_FACT_NOT_EXISTS = new ErrorCode(1_100_001_009, "关联工厂信息不存在");
|
||||
ErrorCode NAME_OR_CODE_EXISTS = new ErrorCode(1_100_001_010, "名称或编码已被使用");
|
||||
ErrorCode GEOFENCE_NOT_EXISTS = new ErrorCode(1_100_001_011, "电子围栏不存在");
|
||||
ErrorCode GEOFENCE_EXISTS_NEEDDEL = new ErrorCode(1_100_001_012, "电子围栏已存在,需删除后才能新增");
|
||||
ErrorCode FOREIGN_AREA_NOT_EXISTS = new ErrorCode(1_100_001_013, "境外区域不存在");
|
||||
ErrorCode MY_WRH_NOT_EXISTS = new ErrorCode(1_100_001_014, "协同我的仓库不存在");
|
||||
ErrorCode MY_WRH_EXISTS = new ErrorCode(1_100_001_015, "已有关联关系");
|
||||
ErrorCode MY_DRIVER_NOT_EXISTS = new ErrorCode(1_100_001_016, "协同我的司机不存在");
|
||||
ErrorCode MY_DRIVER_EXISTS = new ErrorCode(1_100_001_017, "已有关联关系");
|
||||
|
||||
|
||||
// 模块 bseMngt.plceAchi [1_100_002_000 ~ 1_100_002_999]
|
||||
ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode(1_100_002_001, "客商协同账号不存在");
|
||||
|
||||
ErrorCode CARRIER_ACCOUNT_NOT_EXISTS = new ErrorCode(1_100_002_002, "物流服务商协同账号不存在");
|
||||
ErrorCode DRIVING_ACCOUNT_NOT_EXISTS = new ErrorCode(1_100_002_003, "司机协同账号不存在");
|
||||
|
||||
ErrorCode ACCOUNT_ENABLE_STATUS = new ErrorCode(1_100_002_004, "只有禁用状态下才能启用");
|
||||
|
||||
ErrorCode ACCOUNT_NOT_ENABLE_STATUS = new ErrorCode(1_100_002_005, "只有启用状态下才能禁用");
|
||||
ErrorCode USER_ERROR = new ErrorCode(1_100_002_007, "只有启用状态下才能禁用");
|
||||
ErrorCode FILE_NOT_EXISTS = new ErrorCode(1_100_002_006, "附件保存失败");
|
||||
// 模块 bseMngt.mtrl [1_100_003_000 ~ 1_100_003_999]
|
||||
ErrorCode MTRL_XPD_NOT_EXISTS = new ErrorCode(1_100_003_001, "物资信息扩展不存在");
|
||||
ErrorCode RLWY_MTRL_MAIN_NOT_EXISTS = new ErrorCode(1_100_003_002, "铁路物资对照主不存在");
|
||||
ErrorCode RLWY_MTRL_MAIN_NAME_CODE_EXISTS = new ErrorCode(1_100_003_003, "铁路物资对照品名代码已存在");
|
||||
ErrorCode RLWY_MTRL_SUBITEM_NOT_EXISTS = new ErrorCode(1_100_003_004, "铁路物资对照子不存在");
|
||||
ErrorCode RLWY_MTRL_SUBITEM_MATERIAL_EXISTS = new ErrorCode(1_100_003_005, "铁路物资对照已经存在");
|
||||
ErrorCode RLWY_MTRL_MAIN_DRAFT_STATUS = new ErrorCode(1_100_003_006, "铁路品名对照草稿状态才能操作");
|
||||
ErrorCode RLWY_MTRL_MAIN_ENABLED_STATUS = new ErrorCode(1_100_003_007, "铁路品名对照启用状态才能操作");
|
||||
|
||||
// 模块 bseMngt.env [1_100_004_000 ~ 1_100_004_999]
|
||||
ErrorCode ENVIRONMENTAL_INTO_MAIN_NOT_EXISTS = new ErrorCode(1_100_004_001, "环保进场管理主不存在");
|
||||
ErrorCode ENVIRONMENTAL_INTO_SUBITEM_NOT_EXISTS = new ErrorCode(1_100_004_002, "环保进场管理子不存在");
|
||||
ErrorCode ENVIRONMENTAL_INTO_MAIN_EXISTS = new ErrorCode(1_100_004_003, "环保进场主项已经存在");
|
||||
ErrorCode ENVIRONMENTAL_INTO_SUBITEM_MATERIAL_EXISTS = new ErrorCode(1_100_004_004, "环保进场物资已经存在");
|
||||
ErrorCode ENVIRONMENTAL_INTO_MAIN_DRAFT_STATUS = new ErrorCode(1_100_004_005, "环保进场草稿状态才能操作");
|
||||
ErrorCode ENVIRONMENTAL_INTO_MAIN_ENABLED_STATUS = new ErrorCode(1_100_003_006, "环保进场启用状态才能操作");
|
||||
|
||||
|
||||
// 模块 bseMngt.vhc [1_100_005_000 ~ 1_100_005_999]
|
||||
ErrorCode SHIP_ARCHIVE_NOT_EXISTS = new ErrorCode(1_100_005_001, "船舶档案不存在");
|
||||
ErrorCode SHIP_ARCHIVE_IMO_EXISTS = new ErrorCode(1_100_005_002, "船舶IMO码已经存在");
|
||||
ErrorCode SHIP_ARCHIVE_DATA_CONVERSION_ERROR = new ErrorCode(1_100_005_003, "船舶数据转换错误");
|
||||
|
||||
|
||||
// 模块 bseMngt.car [1_100_006_000 ~ 1_100_006_999]
|
||||
ErrorCode CAR_ARCHIVE_NOT_EXISTS = new ErrorCode(1_100_006_001, "车辆档案不存在");
|
||||
ErrorCode CAR_ARCHIVE_EXISTS = new ErrorCode(1_100_006_002, "车辆档案已经存在");
|
||||
ErrorCode CAR_ARCHIVE_DATA_CONVERSION_ERROR = new ErrorCode(1_100_005_003, "车辆数据转换错误");
|
||||
|
||||
ErrorCode CAR_BLACKLIST_NOT_EXISTS = new ErrorCode(1_100_006_004, "车辆黑名单不存在");
|
||||
|
||||
|
||||
ErrorCode SEQUENCE_ERROR = new ErrorCode(1_100_007_001, "流水号异常");
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zt.plat.module.backendlogistics.enums;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "是否,数据字典infra_boolean_string")
|
||||
public enum YesOrNoEnum {
|
||||
|
||||
TRUE("true", "是"),
|
||||
FALSE("false", "否");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
YesOrNoEnum() {
|
||||
|
||||
}
|
||||
|
||||
YesOrNoEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
YesOrNoEnum[] values = values();
|
||||
for (YesOrNoEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
YesOrNoEnum[] values = values();
|
||||
for (YesOrNoEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.zt.plat.module.backendlogistics.enums.bseMngt.plceAchi;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "仓库类型,数据字典warehouse_type")
|
||||
public enum PlceTpEnum {
|
||||
|
||||
WAREHOUSE("warehouse", "仓库"),
|
||||
FACTORY("factory", "生产厂区"),
|
||||
RAILWAY_STATION("railway-station", "铁路站点"),
|
||||
PORT("port", "港口"),
|
||||
AUNCEL("auncel", "计量点"),
|
||||
GATE("gate", "门岗"),
|
||||
CONSIGNEE_ADDRESS("consignee-address", "客户收货地址");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
PlceTpEnum() {
|
||||
|
||||
}
|
||||
|
||||
PlceTpEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
PlceTpEnum[] values = values();
|
||||
for (PlceTpEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
PlceTpEnum[] values = values();
|
||||
for (PlceTpEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Boolean isNoCompany(String code) {
|
||||
List<String> noCompanys = Arrays.asList(PlceTpEnum.WAREHOUSE.getCode(), PlceTpEnum.RAILWAY_STATION.getCode(), PlceTpEnum.CONSIGNEE_ADDRESS.getCode());
|
||||
if (noCompanys.contains(code)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zt.plat.module.backendlogistics.enums.bseMngt.plceAchi;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "排队方式,数据字典queue_way")
|
||||
public enum QueWyEnum {
|
||||
|
||||
RQ("rq", "远程排队"),
|
||||
AQ("aq", "到厂排队");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
QueWyEnum() {
|
||||
|
||||
}
|
||||
|
||||
QueWyEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
QueWyEnum[] values = values();
|
||||
for (QueWyEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
QueWyEnum[] values = values();
|
||||
for (QueWyEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.zt.plat.module.backendlogistics.enums.bseMngt.plceAchi;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "仓库性质,数据字典warehouse_nature")
|
||||
public enum WrhNtrEnum {
|
||||
|
||||
SW("sw", "现货仓"),
|
||||
FW("fw", "期货仓"),
|
||||
TDW("tdw", "报税仓");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
WrhNtrEnum() {
|
||||
|
||||
}
|
||||
|
||||
WrhNtrEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
WrhNtrEnum[] values = values();
|
||||
for (WrhNtrEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
WrhNtrEnum[] values = values();
|
||||
for (WrhNtrEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zt.plat.module.backendlogistics.enums.bseMngt.plceAchi;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "仓库类型,数据字典warehouse_type")
|
||||
public enum WrhTpEnum {
|
||||
|
||||
FAW("faw", "厂区库"),
|
||||
TPL("tpl", "三方库");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
WrhTpEnum() {
|
||||
|
||||
}
|
||||
|
||||
WrhTpEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
WrhTpEnum[] values = values();
|
||||
for (WrhTpEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
WrhTpEnum[] values = values();
|
||||
for (WrhTpEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zt.plat.module.backendlogistics.enums.bseMngt.xtAcct;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "协同账号状态,数据字典account_status")
|
||||
public enum AcctStatisEnum {
|
||||
EDIT("0", "编辑"),
|
||||
AWAIT_AUTH("1", "待审核"),
|
||||
REVIEWED("2","已审核"),
|
||||
CONFIRM("3","确认"),
|
||||
CAENCEL("-1","注销");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
AcctStatisEnum() {
|
||||
|
||||
}
|
||||
|
||||
AcctStatisEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
AcctStatisEnum[] values = values();
|
||||
for (AcctStatisEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
AcctStatisEnum[] values = values();
|
||||
for (AcctStatisEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zt.plat.module.backendlogistics.enums.bseMngt.xtAcct;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "协同账号来源,数据字典driver_source")
|
||||
public enum DriverSourceEnum {
|
||||
DRIVER("DRIVER", "司机"),
|
||||
COLLABORATION("COLLABORATION", "协同平台"),
|
||||
SYSTEM("SYSTEM","管理系统");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
DriverSourceEnum() {
|
||||
|
||||
}
|
||||
|
||||
DriverSourceEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
DriverSourceEnum[] values = values();
|
||||
for (DriverSourceEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
DriverSourceEnum[] values = values();
|
||||
for (DriverSourceEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.zt.plat.module.backendlogistics.enums.bseMngt.xtAcct;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "司机协同账号认证状态,数据字典driver_status")
|
||||
public enum DriverStatusEnum {
|
||||
AWAIT_AUTH("1", "未认证"),
|
||||
REVIEWED("2","已认证");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
DriverStatusEnum() {
|
||||
|
||||
}
|
||||
|
||||
DriverStatusEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
DriverStatusEnum[] values = values();
|
||||
for (DriverStatusEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
DriverStatusEnum[] values = values();
|
||||
for (DriverStatusEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zt.plat.module.backendlogistics.enums.bseMngt.xtAcct;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "客商类型,数据字典user_tp")
|
||||
public enum UserTypeEnum {
|
||||
LGST_CSTM("LGST_CSTM", "客户"),
|
||||
LGST_CRR_ACCT("LGST_CRR_ACCT", "承运商"),
|
||||
LGST_DRVG_ACCT("LGST_DRVG_ACCT","司机");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
UserTypeEnum() {
|
||||
|
||||
}
|
||||
|
||||
UserTypeEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
UserTypeEnum[] values = values();
|
||||
for (UserTypeEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
UserTypeEnum[] values = values();
|
||||
for (UserTypeEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.zt.plat.module.backendlogistics.enums.common;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "附件业务类型")
|
||||
public enum FileBuinessCodeEnum {
|
||||
|
||||
DRIVING_FRONT("drivingFrontImage","驾驶证正面"),
|
||||
DRIVING_BACK("drivingBackImage","驾驶证反面"),
|
||||
IDENTITY_FRONT("identityFrontImage","身份证正面"),
|
||||
IDENTITY_BACK("identityBackImage","身份证反面"),
|
||||
BUSINESS_LICENSE("businessLicenseImage","营业执照"),
|
||||
EDIT("editImage","修改说明"),
|
||||
OTHER("otherImage","其他附件"),
|
||||
CAR_LICENSE_FRONT("carLicenseFrontImage","行驶证正页"),
|
||||
CAR_LICENSE_BACK("carLicenseBackImage","行驶证副页"),
|
||||
CAR_CHECKLIST("carChecklistImage","随车清单"),
|
||||
CAR_PHOTOS("carPhotosImage","车辆照片"),
|
||||
CAR_INSURANCE("carInsuranceImage","车辆保险信息"),
|
||||
SHIP_NATIONALITY("nationalityImage","国籍证书"),
|
||||
SHIP_OWNERSHIP("shipOwnershipImage","船舶所有权登记证书/租赁证书"),
|
||||
SHIP_OTHER("shipOtherImage","船舶营运证等其他证书"),
|
||||
SHIP_PHOTOS("shipPhotosImage","船舶照片");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
FileBuinessCodeEnum() {
|
||||
|
||||
}
|
||||
|
||||
FileBuinessCodeEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
FileBuinessCodeEnum[] values = values();
|
||||
for (FileBuinessCodeEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
FileBuinessCodeEnum[] values = values();
|
||||
for (FileBuinessCodeEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.zt.plat.module.backendlogistics.enums.common;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description="公共管理附件来源")
|
||||
public enum FileSourceEnum {
|
||||
DRIVING_ACCOUNT("lgst.drivingaccount","司机协同账号"),
|
||||
CARRIER_ACCOUNT("lgst.carrieraccount","物流服务商协同账号"),
|
||||
CUSTOMER_ACCOUNT("lgst.customer","客商协同账号"),
|
||||
CAR_ARCHIVE("lgst.bseMngt.crAchi","车辆档案"),
|
||||
SHIP_ARCHIVE("lgst.bseMngt.shp","船舶档案");
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
FileSourceEnum() {
|
||||
|
||||
}
|
||||
|
||||
FileSourceEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
FileSourceEnum[] values = values();
|
||||
for (FileSourceEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
FileSourceEnum[] values = values();
|
||||
for (FileSourceEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.zt.plat.module.backendlogistics.enums.common;
|
||||
|
||||
public enum SequenceEnum {
|
||||
XT_ACCOUNT_NO("CHILD_ACCOUNT_NO", "协同登录账号");
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
SequenceEnum() {
|
||||
|
||||
}
|
||||
|
||||
SequenceEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
SequenceEnum[] values = values();
|
||||
for (SequenceEnum dto : values) {
|
||||
if (dto.getCode().equals(code)) {
|
||||
return dto.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCodeByMsg(String msg) {
|
||||
SequenceEnum[] values = values();
|
||||
for (SequenceEnum dto : values) {
|
||||
if (dto.getMsg().equals(msg)) {
|
||||
return dto.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.zt.plat.module.backendlogistics.utils;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
|
||||
public class PasswordGeneratorUtils {
|
||||
private static final String LOWER_CASE = "abcdefghijklmnopqrstuvwxyz";
|
||||
private static final String UPPER_CASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
private static final String DIGITS = "0123456789";
|
||||
private static final String SPECIAL_CHARS = "@#$%&*";
|
||||
private static final String ALL_CHARS = LOWER_CASE + UPPER_CASE + DIGITS + SPECIAL_CHARS;
|
||||
|
||||
private static final SecureRandom random = new SecureRandom();
|
||||
|
||||
/**
|
||||
* 生成随机密码
|
||||
* 规则:长度为8,包含数字、大小写字母、特殊符号
|
||||
*
|
||||
* @return 生成的随机密码
|
||||
*/
|
||||
public static String generateRandomPassword() {
|
||||
StringBuilder password = new StringBuilder();
|
||||
|
||||
// 确保至少包含每种类型的字符各一个
|
||||
password.append(LOWER_CASE.charAt(random.nextInt(LOWER_CASE.length())));
|
||||
password.append(UPPER_CASE.charAt(random.nextInt(UPPER_CASE.length())));
|
||||
password.append(DIGITS.charAt(random.nextInt(DIGITS.length())));
|
||||
password.append(SPECIAL_CHARS.charAt(random.nextInt(SPECIAL_CHARS.length())));
|
||||
|
||||
// 填充剩余的4个字符
|
||||
for (int i = 0; i < 4; i++) {
|
||||
password.append(ALL_CHARS.charAt(random.nextInt(ALL_CHARS.length())));
|
||||
}
|
||||
|
||||
// 打乱字符顺序
|
||||
return shuffleString(password.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 打乱字符串中字符的顺序
|
||||
*
|
||||
* @param input 输入字符串
|
||||
* @return 打乱后的字符串
|
||||
*/
|
||||
private static String shuffleString(String input) {
|
||||
char[] chars = input.toCharArray();
|
||||
for (int i = chars.length - 1; i > 0; i--) {
|
||||
int j = random.nextInt(i + 1);
|
||||
char temp = chars[i];
|
||||
chars[i] = chars[j];
|
||||
chars[j] = temp;
|
||||
}
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 测试生成密码
|
||||
for (int i = 0; i < 10; i++) {
|
||||
System.out.println("Generated password: " + generateRandomPassword());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user