Compare commits

..

13 Commits

Author SHA1 Message Date
454ca91760 完善客商模块 2026-08-01 01:22:46 +08:00
e03b554473 导出模板新增必填标识 2026-07-31 01:50:40 +08:00
887db5c8d0 fix bug 2026-07-31 01:30:54 +08:00
9419439668 1、新增常用货物
2、新增运输计划
3、新增项目管理
4、新增运单管理
5、新增常用线路
6、新增发货模板
7、新增合同管理
8、新增过程配置
9、新增临时额度管理
2026-07-28 23:14:18 +08:00
221825ebf9 1、调整货物类型模板 2026-07-27 15:01:17 +08:00
74416dabaf 1、调整导入失败,导出excel功能
2、调整规范
2026-07-27 14:53:28 +08:00
4b6908d3bf 1、调整导入失败,导出excel功能
2、调整规范
2026-07-27 14:36:45 +08:00
f0b515c2e0 1、新增货物类型模块
2、新增导入失败,导出excel功能
2026-07-27 11:50:23 +08:00
fd98744b46 1、调整基础配置模块
2、调整车船务模块
2026-07-24 14:33:50 +08:00
af8c9ac2e6 fix bug 2026-07-23 17:17:56 +08:00
35afec99f6 Merge remote-tracking branch 'websoft/master' 2026-07-21 13:18:39 +08:00
af06f725fa fix bug 2026-07-21 13:16:10 +08:00
be59acd0df fix(address): 强化行政区划及坐标字段非空校验
- 将region_name、longitude、latitude字段设为非空
- 在SQL映射中添加region_code字段支持
- 修改实体类及服务逻辑,新增region_code字段赋值
- 增加对region_name、longitude、latitude字段的非空校验
- 新增region_code长度校验,完善字段长度限制
- 更新数据库表定义,调整相关字段约束
2026-07-20 15:34:31 +08:00
244 changed files with 12995 additions and 615 deletions

View File

@@ -195,6 +195,7 @@ Entity 基类的选择**直接决定** Service 和 ServiceImpl 的继承方式
- 简单查询使用 `LambdaQueryWrapper`,复杂查询写在 Mapper XML 中
- Mapper XML 与接口**同包**放置(`src/main/java` 下)
- 分页统一使用 `Condition.getPage(query)` + `Condition.getQueryWrapper()`
- 表格的排序默认按照创建时间降序;后端分页 SQL 或 QueryWrapper 应默认使用 `create_time DESC` / `orderByDesc(Xxx::getCreateTime)`,除非用户明确要求业务字段优先排序。
- 禁止 JDBC 直连查询
### 6.9 审计字段展示
@@ -204,7 +205,26 @@ Entity 基类的选择**直接决定** Service 和 ServiceImpl 的继承方式
- Entity → VO 转换统一在 `XxxWrapper` 中完成;审计人姓名通过 `UserCache.getUserRealName(userId)` 获取,优先返回用户真实姓名,缓存未命中时兜底返回用户 ID。
- Controller 不应在列表、详情方法中重复编写审计人翻译逻辑,避免各模块显示规则不一致。
### 6.10 日志
### 6.10 导出数据格式
- 导出 Excel、CSV 等文件时,金额类字段必须保留 2 位小数;即使原始数据为整数,也应导出为 `0.00` 形式。
- 导出经度、纬度字段时必须保留 6 位小数;导出前仍需遵守经度 `-180 ~ 180`、纬度 `-90 ~ 90` 的有效范围约束。
- 精度格式化应在导出 DTO/Excel 模型、导出组装逻辑或专用格式化工具中完成,禁止只依赖前端展示格式。
### 6.11 导入失败明细导出
- 所有 Excel 批量导入功能如果存在部分数据无法导入、校验失败或处理异常,后端必须将导入失败的数据导出为 Excel 文件返回给前端下载。
- 导入失败 Excel 的字段顺序必须与原导入模板保持一致,并在最后一列追加“导入失败原因”;失败原因应包含明确行号和可读错误信息。
- 导入失败 Excel 中仅出错字段/列对应的单元格使用红色文字展示,最后一列“导入失败原因”的错误信息也必须使用红色文字展示;不得将整行失败数据全部标红,表头可保持默认样式。
- 失败原因应尽量包含原导入模板中的列名,便于通用导出工具准确定位并标红对应错误单元格;无法定位具体字段的业务错误,仅标红“导入失败原因”列。
- 导入失败 Excel 的表头列宽必须按表头和内容自适应,表头文字不得换行。
- 后端导入校验必须与前端新增、编辑表单校验保持一致,包括必填、长度、格式、枚举范围、父子级联关系和金额/日期等业务规则;前端校验调整时,必须同步更新对应导入校验。
- 导入模板本身不得包含失败原因列;如复用导入模型,应使用 `@ExcelIgnore` 忽略内部错误字段,或单独定义 `XxxImportFailureExcel` 模型。
- 导入逻辑应逐行处理:可成功导入的数据正常保存,失败行收集到失败明细;除非业务明确要求全量事务回滚,不得因部分失败回滚已成功行。
- Controller 在失败明细非空时应直接通过导入失败明细通用导出工具写入 `HttpServletResponse`,文件名统一包含业务名称、`导入失败明细` 和时间戳;全部成功时返回标准 `R.success`
- Service 层应返回失败明细列表或等效结构,禁止只抛出拼接后的错误字符串导致前端无法下载失败数据。
### 6.12 日志
- 使用 `@Slf4j`,占位符传参(禁止字符串拼接)
- 包含关键业务标识,异常必须携带堆栈,禁止打印敏感信息
@@ -344,3 +364,4 @@ id parent_id code name alias path source sort category action is_open component
2075431753298714626 2075431169720033282 airport_master_status 修改状态 airport_master_status 1 2 0 1 0
2075431820189474818 2075431169720033282 airport_master_add 新增 airport_master_add 1 2 0 1 0
```
2.生成的表、字段的排序规则要使用utf8mb4_general_ci

View File

@@ -22,6 +22,10 @@
<groupId>org.springblade</groupId>
<artifactId>blade-starter-loadbalancer</artifactId>
</dependency>
<dependency>
<groupId>cn.idev.excel</groupId>
<artifactId>fastexcel</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-auto</artifactId>

View File

@@ -0,0 +1,282 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.common.excel;
import cn.idev.excel.FastExcel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.metadata.data.WriteCellData;
import cn.idev.excel.write.handler.CellWriteHandler;
import cn.idev.excel.write.metadata.holder.WriteSheetHolder;
import cn.idev.excel.write.metadata.holder.WriteTableHolder;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 导入失败明细 Excel 导出工具类
*
* @author Chill
*/
public class ImportFailureExcelUtil {
private static final String FAILURE_REASON = "导入失败原因";
private static final String ERROR_MESSAGE_FIELD = "errorMessage";
private static final String FAILURE_REASON_FIELD = "failureReason";
private ImportFailureExcelUtil() {
}
/**
* 导出导入失败明细
*
* @param response 响应
* @param fileName 文件名
* @param sheetName 工作表名
* @param data 失败数据
* @param excelClass 原导入 Excel 类型
*/
public static void export(HttpServletResponse response, String fileName, String sheetName, List<?> data, Class<?> excelClass) {
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
String encodeFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8);
response.setHeader("Content-disposition", "attachment;filename=" + encodeFileName + ".xlsx");
List<Field> excelFields = excelFields(excelClass);
List<List<String>> head = buildHead(excelFields);
List<List<Object>> rows = buildRows(data, excelFields);
try {
FastExcel.write(response.getOutputStream())
.registerWriteHandler(new ImportFailureCellStyleHandler(excelFields, rows))
.head(head)
.sheet(sheetName)
.doWrite(rows);
} catch (IOException exception) {
throw new IllegalStateException("导出导入失败明细失败", exception);
}
}
private static List<Field> excelFields(Class<?> excelClass) {
return Arrays.stream(excelClass.getDeclaredFields())
.filter(field -> field.getAnnotation(ExcelProperty.class) != null)
.filter(field -> field.getAnnotation(ExcelIgnore.class) == null)
.filter(field -> !Objects.equals(field.getName(), ERROR_MESSAGE_FIELD))
.filter(field -> !Objects.equals(field.getName(), FAILURE_REASON_FIELD))
.toList();
}
private static List<List<String>> buildHead(List<Field> excelFields) {
List<List<String>> head = new ArrayList<>();
for (Field field : excelFields) {
ExcelProperty excelProperty = field.getAnnotation(ExcelProperty.class);
String[] value = excelProperty.value();
head.add(List.of(value.length == 0 ? field.getName() : value[0]));
}
head.add(List.of(FAILURE_REASON));
return head;
}
private static List<List<Object>> buildRows(List<?> data, List<Field> excelFields) {
List<List<Object>> rows = new ArrayList<>();
for (Object item : data) {
List<Object> row = new ArrayList<>();
for (Field field : excelFields) {
row.add(fieldValue(item, field));
}
row.add(errorMessage(item));
rows.add(row);
}
return rows;
}
private static Object fieldValue(Object item, Field field) {
try {
Field targetField = targetField(item.getClass(), field.getName());
targetField.setAccessible(true);
return targetField.get(item);
} catch (NoSuchFieldException | IllegalAccessException exception) {
return null;
}
}
private static Object errorMessage(Object item) {
try {
Field field = targetField(item.getClass(), ERROR_MESSAGE_FIELD, FAILURE_REASON_FIELD);
field.setAccessible(true);
Object value = field.get(item);
return value == null ? "" : String.valueOf(value);
} catch (NoSuchFieldException | IllegalAccessException exception) {
return "";
}
}
private static Field targetField(Class<?> itemClass, String... fieldNames) throws NoSuchFieldException {
Class<?> currentClass = itemClass;
while (currentClass != null) {
for (String fieldName : fieldNames) {
try {
return currentClass.getDeclaredField(fieldName);
} catch (NoSuchFieldException ignored) {
// 继续查找其他字段名或父类字段。
}
}
currentClass = currentClass.getSuperclass();
}
throw new NoSuchFieldException(String.join(",", fieldNames));
}
private static String columnName(Field field) {
ExcelProperty excelProperty = field.getAnnotation(ExcelProperty.class);
String[] value = excelProperty.value();
return value.length == 0 ? field.getName() : value[0];
}
private static String normalize(String value) {
return value == null ? "" : value.replaceAll("[\\s*_:,。;;()\\[\\]【】<>《》-]", "").toLowerCase();
}
private static List<String> columnKeywords(Field field) {
String columnName = columnName(field);
List<String> keywords = new ArrayList<>();
keywords.add(columnName);
keywords.add(field.getName());
keywords.addAll(Arrays.asList(columnName.replace("*", "").split("[//、()()\\s]+")));
return keywords.stream()
.map(ImportFailureExcelUtil::normalize)
.filter(keyword -> keyword.length() >= 2)
.distinct()
.toList();
}
private static class ImportFailureCellStyleHandler implements CellWriteHandler {
private final List<List<String>> columnKeywords;
private final List<List<Object>> rows;
private final int failureReasonColumnIndex;
private final Map<Short, CellStyle> redStyleCache = new HashMap<>();
private final Map<Short, CellStyle> noWrapStyleCache = new HashMap<>();
private final Map<Integer, Integer> columnWidthCache = new HashMap<>();
private ImportFailureCellStyleHandler(List<Field> excelFields, List<List<Object>> rows) {
this.columnKeywords = excelFields.stream()
.map(ImportFailureExcelUtil::columnKeywords)
.toList();
this.rows = rows;
this.failureReasonColumnIndex = excelFields.size();
}
@Override
public void afterCellDispose(
WriteSheetHolder writeSheetHolder,
WriteTableHolder writeTableHolder,
List<WriteCellData<?>> cellDataList,
Cell cell,
cn.idev.excel.metadata.Head head,
Integer relativeRowIndex,
Boolean isHead) {
if (Boolean.TRUE.equals(isHead)) {
adjustColumnWidth(cell);
markNoWrap(cell);
return;
}
adjustColumnWidth(cell);
if (relativeRowIndex == null || relativeRowIndex < 0 || relativeRowIndex >= rows.size()) {
return;
}
if (shouldMarkRed(relativeRowIndex, cell.getColumnIndex())) {
markRed(cell);
}
}
private boolean shouldMarkRed(int rowIndex, int columnIndex) {
if (columnIndex == failureReasonColumnIndex) {
return true;
}
if (columnIndex < 0 || columnIndex >= columnKeywords.size()) {
return false;
}
String failureReason = normalize(String.valueOf(rows.get(rowIndex).get(failureReasonColumnIndex)));
return columnKeywords.get(columnIndex).stream().anyMatch(failureReason::contains);
}
private void markRed(Cell cell) {
CellStyle currentStyle = cell.getCellStyle();
CellStyle redStyle = redStyleCache.computeIfAbsent(currentStyle.getIndex(), styleIndex -> {
Workbook workbook = cell.getSheet().getWorkbook();
CellStyle newStyle = workbook.createCellStyle();
newStyle.cloneStyleFrom(currentStyle);
Font font = workbook.createFont();
font.setColor(IndexedColors.RED.getIndex());
newStyle.setFont(font);
return newStyle;
});
cell.setCellStyle(redStyle);
}
private void markNoWrap(Cell cell) {
CellStyle currentStyle = cell.getCellStyle();
CellStyle noWrapStyle = noWrapStyleCache.computeIfAbsent(currentStyle.getIndex(), styleIndex -> {
CellStyle newStyle = cell.getSheet().getWorkbook().createCellStyle();
newStyle.cloneStyleFrom(currentStyle);
newStyle.setWrapText(false);
return newStyle;
});
cell.setCellStyle(noWrapStyle);
}
private void adjustColumnWidth(Cell cell) {
int columnIndex = cell.getColumnIndex();
int columnWidth = Math.min(Math.max(displayWidth(cell.toString()) + 4, 12), 80) * 256;
Integer currentWidth = columnWidthCache.get(columnIndex);
if (currentWidth == null || columnWidth > currentWidth) {
columnWidthCache.put(columnIndex, columnWidth);
cell.getSheet().setColumnWidth(columnIndex, columnWidth);
}
}
private int displayWidth(String value) {
int width = 0;
for (int index = 0; index < value.length(); index++) {
width += value.charAt(index) > 255 ? 2 : 1;
}
return width;
}
}
}

View File

@@ -39,7 +39,10 @@ import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
* @author Chill
*/
public class RegionCache {
public static final String MAIN_CODE = "00";
public static final String ROOT_PARENT_CODE = "0";
public static final String MAIN_CODE = "+86";
public static final String LEGACY_MAIN_CODE = "00";
public static final int COUNTRY_LEVEL = 0;
public static final int PROVINCE_LEVEL = 1;
public static final int CITY_LEVEL = 2;
public static final int DISTRICT_LEVEL = 3;

View File

@@ -25,6 +25,7 @@
*/
package org.springblade.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -93,6 +94,32 @@ public class AirportMaster extends BaseEntity {
*/
@Schema(description = "所属城市")
private String cityName;
/**
* 所属区县编码
*/
@Schema(description = "所属区县编码")
private String districtCode;
/**
* 所属区县
*/
@Schema(description = "所属区县")
private String districtName;
/**
* 行政区划编码
*/
@TableField(exist = false)
@Schema(description = "行政区划编码")
private String regionCode;
/**
* 行政区划
*/
@Schema(description = "行政区划")
private String regionName;
/**
* 详细地址
*/
@Schema(description = "详细地址")
private String detailAddress;
/**
* 经度
*/

View File

@@ -0,0 +1,93 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 货物类型实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_cargo_type")
@Schema(description = "货物类型")
public class CargoType extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 类型级别1一级货物类型2二级货物类型
*/
@Schema(description = "类型级别")
private Integer typeLevel;
/**
* 上级货物类型ID
*/
@JsonSerialize(using = ToStringSerializer.class)
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@Schema(description = "上级货物类型ID")
private Long parentId;
/**
* 上级货物类型编码
*/
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@Schema(description = "上级货物类型编码")
private String parentCargoCode;
/**
* 货物类型
*/
@Schema(description = "货物类型")
private String cargoName;
/**
* 货物类型编码
*/
@Schema(description = "货物类型编码")
private String cargoCode;
/**
* 数据来源
*/
@Schema(description = "数据来源")
private String dataSource;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
}

View File

@@ -95,6 +95,7 @@ public class Currency extends BaseEntity {
/**
* 是否本位币
*/
@TableField("is_base_currency")
@Schema(description = "是否本位币")
private Integer baseCurrency;
/**

View File

@@ -48,14 +48,19 @@ public class FeeItem extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 中文名称
* 费用类型
*/
@Schema(description = "中文名称")
@Schema(description = "费用类型")
private String feeCategory;
/**
* 费用项
*/
@Schema(description = "费用项")
private String name;
/**
* 英文名称
* 费用项代码
*/
@Schema(description = "英文名称")
@Schema(description = "费用项代码")
private String englishName;
}

View File

@@ -25,6 +25,7 @@
*/
package org.springblade.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -88,6 +89,27 @@ public class PortTerminal extends BaseEntity {
*/
@Schema(description = "城市")
private String city;
/**
* 区县编码
*/
@Schema(description = "区县编码")
private String districtCode;
/**
* 区县
*/
@Schema(description = "区县")
private String districtName;
/**
* 行政区划编码
*/
@TableField(exist = false)
@Schema(description = "行政区划编码")
private String regionCode;
/**
* 详细地址
*/
@Schema(description = "详细地址")
private String detailAddress;
/**
* 经度
*/

View File

@@ -25,6 +25,7 @@
*/
package org.springblade.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -93,6 +94,32 @@ public class RailwayStation extends BaseEntity {
*/
@Schema(description = "所属城市")
private String cityName;
/**
* 所属区县编码
*/
@Schema(description = "所属区县编码")
private String districtCode;
/**
* 所属区县
*/
@Schema(description = "所属区县")
private String districtName;
/**
* 行政区划编码
*/
@TableField(exist = false)
@Schema(description = "行政区划编码")
private String regionCode;
/**
* 行政区划
*/
@Schema(description = "行政区划")
private String regionName;
/**
* 详细地址
*/
@Schema(description = "详细地址")
private String detailAddress;
/**
* 经度
*/

View File

@@ -27,6 +27,7 @@ package org.springblade.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -134,5 +135,12 @@ public class Region implements Serializable {
@Schema(description = "备注")
private String remark;
/**
* 原区划编号
*/
@TableField(exist = false)
@Schema(description = "原区划编号")
private String originalCode;
}

View File

@@ -0,0 +1,68 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.system.pojo.entity.CargoType;
import java.io.Serial;
/**
* 货物类型视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "货物类型")
public class CargoTypeVO extends CargoType {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "类型名称")
private String typeLevelName;
@TableField(exist = false)
@Schema(description = "上级货物类型")
private String parentCargoName;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "导入错误信息")
private String errorMessage;
}

View File

@@ -60,6 +60,10 @@ public class CurrencyVO extends Currency {
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate businessDate;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "生效日期开始")
@DateTimeFormat(pattern = "yyyy-MM-dd")

View File

@@ -0,0 +1,111 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
/**
* 常用货物实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_common_cargo")
@Schema(description = "常用货物")
public class CommonCargo extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "一级货物类型ID")
private Long firstCargoTypeId;
@Schema(description = "一级货物类型")
private String firstCargoTypeName;
@Schema(description = "一级货物类型编码")
private String firstCargoTypeCode;
@Schema(description = "二级货物类型ID")
private Long secondCargoTypeId;
@Schema(description = "二级货物类型")
private String secondCargoTypeName;
@Schema(description = "二级货物类型编码")
private String secondCargoTypeCode;
@Schema(description = "货物名称")
private String cargoName;
@Schema(description = "货物编号")
private String cargoCode;
@Schema(description = "品牌")
private String brand;
@Schema(description = "包装")
private String packageType;
@Schema(description = "货值")
private BigDecimal cargoValue;
@Schema(description = "规格")
private String specification;
@Schema(description = "计价单位")
private String priceUnit;
@Schema(description = "型号")
private String model;
@Schema(description = "说明1")
private String descriptionOne;
@Schema(description = "尺寸")
private String sizeText;
@Schema(description = "说明2")
private String descriptionTwo;
@Schema(description = "数据来源")
private String dataSource;
@Schema(description = "所属组织ID")
private Long deptId;
@Schema(description = "所属组织")
private String deptName;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,105 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
/**
* 常用线路实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_common_route")
@Schema(description = "常用线路")
public class CommonRoute extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "线路编号")
private String routeCode;
@Schema(description = "线路名称")
private String routeName;
@Schema(description = "发货地址ID")
private Long departureAddressId;
@Schema(description = "发货地")
private String departureName;
@Schema(description = "发货地址")
private String departureAddress;
@Schema(description = "发货经度")
private BigDecimal departureLongitude;
@Schema(description = "发货纬度")
private BigDecimal departureLatitude;
@Schema(description = "发货联系人")
private String departureContact;
@Schema(description = "发货联系方式")
private String departurePhone;
@Schema(description = "收货地址ID")
private Long arrivalAddressId;
@Schema(description = "收货地")
private String arrivalName;
@Schema(description = "收货地址")
private String arrivalAddress;
@Schema(description = "收货经度")
private BigDecimal arrivalLongitude;
@Schema(description = "收货纬度")
private BigDecimal arrivalLatitude;
@Schema(description = "收货联系人")
private String arrivalContact;
@Schema(description = "收货联系方式")
private String arrivalPhone;
@Schema(description = "所属组织ID")
private Long deptId;
@Schema(description = "所属组织")
private String deptName;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,163 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 合同管理实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_contract_manage")
@Schema(description = "合同管理")
public class ContractManage extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "合同编号")
private String contractNo;
@Schema(description = "合同名称")
private String contractName;
@Schema(description = "所属项目ID")
private Long projectId;
@Schema(description = "所属项目")
private String projectName;
@Schema(description = "所属组织ID")
private Long organizationId;
@Schema(description = "所属组织")
private String organizationName;
@Schema(description = "合同类别")
private String contractCategory;
@Schema(description = "签约类型")
private String signType;
@Schema(description = "甲方")
private String partyA;
@Schema(description = "乙方")
private String partyB;
@Schema(description = "开始日期")
private LocalDate startDate;
@Schema(description = "结束日期")
private LocalDate endDate;
@Schema(description = "临时效力起")
private LocalDate temporaryStartDate;
@Schema(description = "临时效力止")
private LocalDate temporaryEndDate;
@Schema(description = "经办人ID")
private Long handlerUserId;
@Schema(description = "经办人")
private String handlerUserName;
@Schema(description = "签订日期")
private LocalDate signDate;
@Schema(description = "结算方式")
private String settlementMode;
@Schema(description = "合同格式")
private String contractFormat;
@Schema(description = "是否需要加盖法人章")
private Integer legalSealFlag;
@Schema(description = "一式份数")
private Integer copyCount;
@Schema(description = "回款账期(天)")
private Integer paymentDays;
@Schema(description = "合同阶段")
private String contractStage;
@Schema(description = "审核状态")
private String approvalStatus;
@Schema(description = "当前节点")
private String currentNode;
@Schema(description = "当前处理人")
private String currentProcessor;
@Schema(description = "审核通过时间")
private LocalDateTime approvedTime;
@Schema(description = "计费信息开关")
private Integer billingEnabled;
@Schema(description = "合同主文件JSON")
private String contractFileJson;
@Schema(description = "其它附件JSON")
private String attachmentsJson;
@Schema(description = "计费方案JSON")
private String billingPlanJson;
@Schema(description = "结算生成规则JSON")
private String settlementRuleJson;
@Schema(description = "对账配置JSON")
private String reconciliationJson;
@Schema(description = "变更记录JSON")
private String changeRecordJson;
@Schema(description = "变更内容")
private String changeContent;
@Schema(description = "变更原因")
private String changeReason;
@Schema(description = "终止原因")
private String terminateReason;
@Schema(description = "备注")
private String remark;
}

View File

@@ -71,6 +71,12 @@ public class CustomerArchive extends TenantEntity {
@Schema(description = "注册/实际经营地址")
private String registeredAddress;
@Schema(description = "注册地址行政区划")
private String registeredRegionName;
@Schema(description = "注册地址详细地址")
private String registeredDetailAddress;
@Schema(description = "法人/负责人")
private String legalPerson;
@@ -80,6 +86,9 @@ public class CustomerArchive extends TenantEntity {
@Schema(description = "所属组织ID")
private Long deptId;
@Schema(description = "所属组织ID集合")
private String deptIds;
@Schema(description = "所属组织")
private String deptName;
@@ -116,7 +125,7 @@ public class CustomerArchive extends TenantEntity {
@Schema(description = "备注")
private String remark;
@Schema(description = "资质附件JSON")
@Schema(description = "客商材料JSON")
private String qualificationAttachments;
@Schema(description = "准入类型temporary/formal")

View File

@@ -59,6 +59,18 @@ public class CustomerContact extends TenantEntity {
@Schema(description = "邮箱")
private String email;
@Schema(description = "行政区划")
private String regionName;
@Schema(description = "详细地址")
private String detailAddress;
@Schema(description = "联系地址")
private String contactAddress;
@Schema(description = "所属分公司/事业部")
private String branchName;
@Schema(description = "职务")
private String positionName;

View File

@@ -68,6 +68,9 @@ public class CustomerCreditScore extends TenantEntity {
@Schema(description = "最终得分")
private BigDecimal finalScore;
@Schema(description = "得分率")
private BigDecimal scoreRate;
@Schema(description = "信用等级")
private String creditLevel;
@@ -77,6 +80,15 @@ public class CustomerCreditScore extends TenantEntity {
@Schema(description = "拟申请总资金使用额度(万元)")
private BigDecimal applyCreditLimit;
@Schema(description = "临时申请额度(万元)")
private BigDecimal tempApplyCreditLimit;
@Schema(description = "临时额度开始日期")
private LocalDate tempCreditStartDate;
@Schema(description = "临时额度结束日期")
private LocalDate tempCreditEndDate;
@Schema(description = "自评状态")
private String selfStatus;

View File

@@ -80,6 +80,9 @@ public class CustomerCreditScoreDetail extends TenantEntity {
@Schema(description = "得分说明")
private String scoreDescription;
@Schema(description = "评分项目配置最高得分")
private BigDecimal score;
@Schema(description = "自评得分")
private BigDecimal selfScore;

View File

@@ -68,6 +68,12 @@ public class CustomerInvoiceInfo extends TenantEntity {
@Schema(description = "注册地址")
private String registeredAddress;
@Schema(description = "注册地址行政区划")
private String registeredRegionName;
@Schema(description = "注册地址详细地址")
private String registeredDetailAddress;
@Schema(description = "邮箱")
private String email;
@@ -80,6 +86,12 @@ public class CustomerInvoiceInfo extends TenantEntity {
@Schema(description = "收件人地址")
private String receiverAddress;
@Schema(description = "收件人地址行政区划")
private String receiverRegionName;
@Schema(description = "收件人详细地址")
private String receiverDetailAddress;
@Schema(description = "是否默认")
private Integer isDefault;

View File

@@ -53,6 +53,9 @@ public class CustomerReceiptAccount extends TenantEntity {
@Schema(description = "收款方名称")
private String accountName;
@Schema(description = "开户人姓名")
private String accountHolderName;
@Schema(description = "开户行名称")
private String bankName;
@@ -71,4 +74,7 @@ public class CustomerReceiptAccount extends TenantEntity {
@Schema(description = "是否默认")
private Integer isDefault;
@Schema(description = "备注")
private String remark;
}

View File

@@ -48,7 +48,10 @@ public class MileageRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "牌号")
@Schema(description = "船类型")
private String vehicleType;
@Schema(description = "车牌号/船号")
private String vehicleNo;
@Schema(description = "上月统计里程")
@@ -63,6 +66,9 @@ public class MileageRecord extends TenantEntity {
@Schema(description = "累计行驶里程")
private BigDecimal totalMileage;
@Schema(description = "里程单位")
private String mileageUnit;
@Schema(description = "附件")
private String attachments;

View File

@@ -0,0 +1,78 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
/**
* 过程配置实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_process_config")
@Schema(description = "过程配置")
public class ProcessConfig extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "配置编号")
private String configCode;
@Schema(description = "配置名称")
private String configName;
@Schema(description = "项目ID集合")
private String projectIds;
@Schema(description = "项目")
private String projectNames;
@Schema(description = "包含过程节点")
private String includedNodes;
@Schema(description = "默认后台完成运输天数")
private Integer defaultFinishDays;
@Schema(description = "过程节点配置")
private String nodeConfigJson;
@Schema(description = "所属组织ID")
private Long deptId;
@Schema(description = "所属组织")
private String deptName;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,182 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 项目立项实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_project_apply")
@Schema(description = "项目立项")
public class ProjectApply extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "立项申请单号")
private String applyNo;
@Schema(description = "项目编号")
private String projectCode;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "项目简称")
private String projectShortName;
@Schema(description = "项目类型")
private String projectType;
@Schema(description = "业务部门ID")
private Long businessDeptId;
@Schema(description = "业务部门")
private String businessDeptName;
@Schema(description = "承办部门ID")
private Long undertakeDeptId;
@Schema(description = "承办部门")
private String undertakeDeptName;
@Schema(description = "项目由来")
private String projectSource;
@Schema(description = "项目由来说明")
private String sourceRemark;
@Schema(description = "项目资金使用额度(万元)")
private BigDecimal fundLimit;
@Schema(description = "项目应收账款额度(万元)")
private BigDecimal receivableLimit;
@Schema(description = "应收账款回款期限(天)")
private Integer receivableDays;
@Schema(description = "回款账期(天)")
private Integer paymentDays;
@Schema(description = "货物类型")
private String cargoType;
@Schema(description = "预估货物数量")
private String cargoQuantity;
@Schema(description = "业务周期开始日期")
private LocalDate businessStartDate;
@Schema(description = "业务周期结束日期")
private LocalDate businessEndDate;
@Schema(description = "运输线路")
private String transportRoute;
@Schema(description = "运输类型")
private String transportType;
@Schema(description = "业务类型")
private String businessType;
@Schema(description = "项目规模(万元)")
private BigDecimal projectScale;
@Schema(description = "预计利润(万元)")
private BigDecimal estimatedProfit;
@Schema(description = "资金需求(万元)")
private BigDecimal fundDemand;
@Schema(description = "结算方式")
private String settlementMode;
@Schema(description = "项目经办人ID")
private Long handlerUserId;
@Schema(description = "项目经办人")
private String handlerUserName;
@Schema(description = "项目负责人ID")
private Long principalUserId;
@Schema(description = "项目负责人")
private String principalUserName;
@Schema(description = "客户名称")
private String customerNames;
@Schema(description = "下游承运商")
private String carrierNames;
@Schema(description = "客户信息JSON")
private String customerJson;
@Schema(description = "承运商信息JSON")
private String carrierJson;
@Schema(description = "项目情况说明")
private String situationRemark;
@Schema(description = "项目附件JSON")
private String attachmentsJson;
@Schema(description = "审批状态")
private String approvalStatus;
@Schema(description = "当前节点")
private String currentNode;
@Schema(description = "当前处理人")
private String currentProcessor;
@Schema(description = "生效类型")
private String effectiveType;
@Schema(description = "审核通过时间")
private LocalDateTime approvedTime;
@Schema(description = "变更内容")
private String changeContent;
@Schema(description = "变更原因")
private String changeReason;
@Schema(description = "作废原因")
private String voidReason;
}

View File

@@ -0,0 +1,120 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
/**
* 发货模板实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_shipping_template")
@Schema(description = "发货模板")
public class ShippingTemplate extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "模板编号")
private String templateCode;
@Schema(description = "模板名称")
private String templateName;
@Schema(description = "模板类型")
private String templateType;
@Schema(description = "项目ID")
private Long projectId;
@Schema(description = "项目")
private String projectName;
@Schema(description = "客户合同ID")
private Long contractId;
@Schema(description = "客户合同")
private String contractName;
@Schema(description = "运输类型")
private String transportType;
@Schema(description = "发货地址ID")
private Long departureAddressId;
@Schema(description = "发货地")
private String departureName;
@Schema(description = "发货地址")
private String departureAddress;
@Schema(description = "发货联系人")
private String departureContact;
@Schema(description = "发货联系方式")
private String departurePhone;
@Schema(description = "收货地址ID")
private Long arrivalAddressId;
@Schema(description = "收货地")
private String arrivalName;
@Schema(description = "收货地址")
private String arrivalAddress;
@Schema(description = "收货联系人")
private String arrivalContact;
@Schema(description = "收货联系方式")
private String arrivalPhone;
@Schema(description = "货物信息")
private String goodsJson;
@Schema(description = "运费信息")
private String freightJson;
@Schema(description = "附件")
private String attachmentsJson;
@Schema(description = "所属组织ID")
private Long deptId;
@Schema(description = "所属组织")
private String deptName;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,113 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 临时额度申请实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_temporary_credit_limit")
@Schema(description = "临时额度申请")
public class TemporaryCreditLimit extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "申请单号")
private String applicationNo;
@Schema(description = "项目ID")
private Long projectId;
@Schema(description = "项目编号")
private String projectCode;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "承办部门ID")
private Long undertakeDeptId;
@Schema(description = "承办部门")
private String undertakeDeptName;
@Schema(description = "项目资金使用额度(万元)")
private BigDecimal projectFundLimit;
@Schema(description = "已使用项目资金额度(万元)")
private BigDecimal usedFundLimit;
@Schema(description = "剩余项目资金使用额度(万元)")
private BigDecimal remainingFundLimit;
@Schema(description = "申请临时额度(万元)")
private BigDecimal applyLimit;
@Schema(description = "申请有效期至")
private LocalDate validUntil;
@Schema(description = "申请部门ID")
private Long applyDeptId;
@Schema(description = "申请部门")
private String applyDeptName;
@Schema(description = "申请人ID")
private Long applicantId;
@Schema(description = "申请人")
private String applicantName;
@Schema(description = "审批状态")
private String approvalStatus;
@Schema(description = "当前节点")
private String currentNode;
@Schema(description = "当前处理人")
private String currentProcessor;
@Schema(description = "审核通过时间")
private LocalDateTime approvedTime;
@Schema(description = "附件JSON")
private String attachmentsJson;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,129 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.time.LocalDate;
/**
* 运输计划实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_transport_plan")
@Schema(description = "运输计划")
public class TransportPlan extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "计划单号")
private String planNo;
@Schema(description = "计划名称")
private String planName;
@Schema(description = "项目ID")
private Long projectId;
@Schema(description = "项目")
private String projectName;
@Schema(description = "客户合同ID")
private Long contractId;
@Schema(description = "客户合同")
private String contractName;
@Schema(description = "客户名称")
private String customerName;
@Schema(description = "运输类型")
private String transportType;
@Schema(description = "计划开始日期")
private LocalDate planStartDate;
@Schema(description = "计划结束日期")
private LocalDate planEndDate;
@Schema(description = "发货地址ID")
private Long departureAddressId;
@Schema(description = "发货地")
private String departureName;
@Schema(description = "发货地址")
private String departureAddress;
@Schema(description = "发货联系人")
private String departureContact;
@Schema(description = "发货联系方式")
private String departurePhone;
@Schema(description = "收货地址ID")
private Long arrivalAddressId;
@Schema(description = "收货地")
private String arrivalName;
@Schema(description = "收货地址")
private String arrivalAddress;
@Schema(description = "收货联系人")
private String arrivalContact;
@Schema(description = "收货联系方式")
private String arrivalPhone;
@Schema(description = "货物信息")
private String goodsJson;
@Schema(description = "附件")
private String attachmentsJson;
@Schema(description = "数据来源")
private String dataSource;
@Schema(description = "业务状态")
private String businessStatus;
@Schema(description = "所属组织ID")
private Long deptId;
@Schema(description = "所属组织")
private String deptName;
@Schema(description = "备注")
private String remark;
}

View File

@@ -32,6 +32,7 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
@@ -57,12 +58,66 @@ public class TransportShip extends TenantEntity {
@Schema(description = "所属组织")
private String organizationName;
@Schema(description = "安放龙骨日期")
private LocalDate keelLayingDate;
@Schema(description = "建造完工日期")
private LocalDate buildCompletionDate;
@Schema(description = "总长")
private BigDecimal totalLength;
@Schema(description = "船宽")
private BigDecimal shipWidth;
@Schema(description = "型深")
private BigDecimal moldedDepth;
@Schema(description = "最大船高")
private BigDecimal maxShipHeight;
@Schema(description = "空载吃水")
private BigDecimal lightDraft;
@Schema(description = "满载吃水")
private BigDecimal fullLoadDraft;
@Schema(description = "航区")
private String navigationArea;
@Schema(description = "所有权登记号码")
private String ownershipRegistrationNo;
@Schema(description = "初次登记号码")
private String initialRegistrationNo;
@Schema(description = "船舶所有人")
private String shipOwner;
@Schema(description = "取得所有权日期")
private LocalDate ownershipAcquisitionDate;
@Schema(description = "船检登记号")
private String shipInspectionNo;
@Schema(description = "船舶类型")
private String shipType;
@Schema(description = "总吨")
private BigDecimal grossTonnage;
@Schema(description = "净吨")
private BigDecimal netTonnage;
@Schema(description = "船舶所有权证书图片")
private String ownershipCertImage;
@Schema(description = "内河船舶安全与环保证书图片")
private String safetyCertImage;
@Schema(description = "国籍证有效期自")
private LocalDate nationalityCertStartDate;
@Schema(description = "国籍证有效期至")
private LocalDate nationalityCertEndDate;
@@ -72,6 +127,9 @@ public class TransportShip extends TenantEntity {
@Schema(description = "国籍证图片")
private String nationalityCertImage;
@Schema(description = "最低安全配员证书有效期自")
private LocalDate safeManningCertStartDate;
@Schema(description = "最低安全配员证书有效期至")
private LocalDate safeManningCertEndDate;
@@ -81,6 +139,12 @@ public class TransportShip extends TenantEntity {
@Schema(description = "最低安全配员证书图片")
private String safeManningCertImage;
@Schema(description = "营业运输证编号")
private String businessTransportCertNo;
@Schema(description = "营业运输证发证日期")
private LocalDate businessTransportCertIssueDate;
@Schema(description = "营业运输证有效期至")
private LocalDate businessTransportCertEndDate;
@@ -90,6 +154,9 @@ public class TransportShip extends TenantEntity {
@Schema(description = "营业运输证图片")
private String businessTransportCertImage;
@Schema(description = "起租日期")
private LocalDate leaseStartDate;
@Schema(description = "承租有效期至")
private LocalDate leaseEndDate;
@@ -99,6 +166,12 @@ public class TransportShip extends TenantEntity {
@Schema(description = "承租合同图片")
private String leaseContractImage;
@Schema(description = "船舶承租人")
private String shipLessee;
@Schema(description = "船舶经营人")
private String shipOperator;
@Schema(description = "备注")
private String remark;

View File

@@ -58,6 +58,11 @@ public class TransportVehicle extends TenantEntity {
*/
@Schema(description = "车牌号")
private String plateNo;
/**
* 车牌颜色
*/
@Schema(description = "车牌颜色")
private String plateColor;
/**
* 车辆类型
*/
@@ -134,10 +139,25 @@ public class TransportVehicle extends TenantEntity {
@Schema(description = "行驶证长期有效")
private Integer drivingLicenseLongTerm;
/**
* 行驶证图片
* 行驶证主页正面
*/
@Schema(description = "行驶证图片")
@Schema(description = "行驶证主页正面")
private String drivingLicenseImage;
/**
* 行驶证主页反面
*/
@Schema(description = "行驶证主页反面")
private String drivingLicenseMainBack;
/**
* 行驶证副页正面
*/
@Schema(description = "行驶证副页正面")
private String drivingLicenseViceFront;
/**
* 行驶证副页反面
*/
@Schema(description = "行驶证副页反面")
private String drivingLicenseViceBack;
/**
* 道路运输证号
*/

View File

@@ -0,0 +1,150 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
import java.time.LocalDate;
/**
* 运单管理实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_waybill")
@Schema(description = "运单管理")
public class Waybill extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "运单号")
private String waybillNo;
@Schema(description = "项目ID")
private Long projectId;
@Schema(description = "项目")
private String projectName;
@Schema(description = "客户合同ID")
private Long contractId;
@Schema(description = "客户合同")
private String contractName;
@Schema(description = "客户名称")
private String customerName;
@Schema(description = "运输类型")
private String transportType;
@Schema(description = "货物名称")
private String cargoName;
@Schema(description = "货物类型")
private String cargoType;
@Schema(description = "发货地址")
private String departureAddress;
@Schema(description = "收货地址")
private String arrivalAddress;
@Schema(description = "承运商名称")
private String carrierName;
@Schema(description = "司机姓名")
private String driverName;
@Schema(description = "车/船/航班/班列号")
private String vehicleNo;
@Schema(description = "原始单号")
private String originalNo;
@Schema(description = "业务状态")
private String businessStatus;
@Schema(description = "数据来源")
private String dataSource;
@Schema(description = "开始日期")
private LocalDate startDate;
@Schema(description = "结束日期")
private LocalDate endDate;
@Schema(description = "运输计划ID")
private Long planId;
@Schema(description = "计划名称")
private String planName;
@Schema(description = "多联总单")
private String masterNo;
@Schema(description = "配载单号")
private String loadingNo;
@Schema(description = "运单批次号")
private String batchNo;
@Schema(description = "关联单号")
private String relationNo;
@Schema(description = "当前过程节点")
private String currentProcessNode;
@Schema(description = "货物信息")
private String goodsJson;
@Schema(description = "承运信息")
private String carrierJson;
@Schema(description = "过程节点")
private String processJson;
@Schema(description = "费用信息")
private String freightJson;
@Schema(description = "附件")
private String attachmentsJson;
@Schema(description = "所属组织ID")
private Long deptId;
@Schema(description = "所属组织")
private String deptName;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,55 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 业务批量删除结果
*
* @author Chill
*/
@Data
@Schema(description = "业务批量删除结果")
public class BusinessRemoveResultVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "删除成功数量")
private Integer successCount = 0;
@Schema(description = "跳过数量")
private Integer skippedCount = 0;
@Schema(description = "跳过编号")
private List<String> skippedCodes = new ArrayList<>();
}

View File

@@ -0,0 +1,62 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.CommonCargo;
import java.io.Serial;
/**
* 常用货物视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "常用货物")
public class CommonCargoVO extends CommonCargo {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "是否查看全部组织")
private Integer allDept;
@TableField(exist = false)
@Schema(description = "是否只读")
private Boolean readonly;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -0,0 +1,62 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.CommonRoute;
import java.io.Serial;
/**
* 常用线路视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "常用线路")
public class CommonRouteVO extends CommonRoute {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "是否查看全部组织")
private Integer allDept;
@TableField(exist = false)
@Schema(description = "是否只读")
private Boolean readonly;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -0,0 +1,74 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.ContractManage;
import java.io.Serial;
/**
* 合同管理视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "合同管理")
public class ContractManageVO extends ContractManage {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "是否查看全部组织")
private Integer allDept;
@TableField(exist = false)
@Schema(description = "是否只读")
private Boolean readonly;
@TableField(exist = false)
@Schema(description = "到期快捷筛选")
private String expireScope;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "合同阶段名称")
private String contractStageName;
@TableField(exist = false)
@Schema(description = "审核状态名称")
private String approvalStatusName;
}

View File

@@ -49,4 +49,12 @@ public class CustomerCreditScoreVO extends CustomerCreditScore {
@Schema(description = "评分明细")
private List<CustomerCreditScoreDetailVO> details = new ArrayList<>();
@TableField(exist = false)
@Schema(description = "证明材料")
private Object attachments;
@TableField(exist = false)
@Schema(description = "评估标准")
private List<CreditRatingStandardVO> standards = new ArrayList<>();
}

View File

@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.ProcessConfig;
import java.io.Serial;
/**
* 过程配置视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "过程配置")
public class ProcessConfigVO extends ProcessConfig {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "是否查看全部组织")
private Integer allDept;
@TableField(exist = false)
@Schema(description = "是否只读")
private Boolean readonly;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "状态名称")
private String statusName;
}

View File

@@ -0,0 +1,70 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.ProjectApply;
import java.io.Serial;
/**
* 项目立项视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "项目立项")
public class ProjectApplyVO extends ProjectApply {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "是否查看全部组织")
private Integer allDept;
@TableField(exist = false)
@Schema(description = "是否只读")
private Boolean readonly;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "审批状态名称")
private String approvalStatusName;
@TableField(exist = false)
@Schema(description = "生效类型名称")
private String effectiveTypeName;
}

View File

@@ -0,0 +1,62 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.ShippingTemplate;
import java.io.Serial;
/**
* 发货模板视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "发货模板")
public class ShippingTemplateVO extends ShippingTemplate {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "是否查看全部组织")
private Integer allDept;
@TableField(exist = false)
@Schema(description = "是否只读")
private Boolean readonly;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}

View File

@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.TemporaryCreditLimit;
import java.io.Serial;
/**
* 临时额度申请视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "临时额度申请")
public class TemporaryCreditLimitVO extends TemporaryCreditLimit {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "是否查看全部组织")
private Integer allDept;
@TableField(exist = false)
@Schema(description = "是否只读")
private Boolean readonly;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "审批状态名称")
private String approvalStatusName;
}

View File

@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.TransportPlan;
import java.io.Serial;
/**
* 运输计划视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "运输计划")
public class TransportPlanVO extends TransportPlan {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "是否查看全部组织")
private Integer allDept;
@TableField(exist = false)
@Schema(description = "是否只读")
private Boolean readonly;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "业务状态名称")
private String businessStatusName;
}

View File

@@ -0,0 +1,66 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.transport.pojo.entity.Waybill;
import java.io.Serial;
/**
* 运单管理视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "运单管理")
public class WaybillVO extends Waybill {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "是否查看全部组织")
private Integer allDept;
@TableField(exist = false)
@Schema(description = "是否只读")
private Boolean readonly;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
@TableField(exist = false)
@Schema(description = "业务状态名称")
private String businessStatusName;
}

View File

@@ -148,7 +148,7 @@ public class AirportMasterController extends BladeController {
@PostMapping("/import-airport-master")
@ApiOperationSupport(order = 6)
@Operation(summary = "导入空港机场主数据", description = "传入excel")
public R importAirportMaster(MultipartFile file) {
public R importAirportMaster(MultipartFile file, HttpServletResponse response) {
if (file == null || file.isEmpty()) {
return R.fail("上传文件不能为空");
}
@@ -156,8 +156,11 @@ public class AirportMasterController extends BladeController {
if (!fileName.endsWith(".xls") && !fileName.endsWith(".xlsx")) {
return R.fail("请上传 .xls,.xlsx 标准格式文件");
}
AirportMasterImporter airportMasterImporter = new AirportMasterImporter(airportMasterService);
ExcelUtil.save(file, airportMasterImporter, AirportMasterExcel.class);
List<AirportMasterExcel> failureList = airportMasterService.importAirportMaster(ExcelUtil.read(file, AirportMasterExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "空港机场主数据导入失败明细" + DateUtil.time(), "导入失败明细", failureList, AirportMasterExcel.class);
return null;
}
return R.success("操作成功");
}
@@ -172,6 +175,7 @@ public class AirportMasterController extends BladeController {
airportMaster.remove("Blade-Auth");
airportMaster.remove("Authorization");
airportMaster.remove("access_token");
normalizeRegionCodeCondition(airportMaster);
QueryWrapper<AirportMaster> queryWrapper = Condition.getQueryWrapper(airportMaster, AirportMaster.class);
if (Func.isNotEmpty(ids)) {
queryWrapper.lambda().in(AirportMaster::getId, Func.toLongList(ids.toString()));
@@ -207,4 +211,11 @@ public class AirportMasterController extends BladeController {
return query;
}
private void normalizeRegionCodeCondition(Map<String, Object> params) {
Object regionCode = params.remove("regionCode");
if (Func.isNotEmpty(regionCode) && Func.isEmpty(params.get("districtCode"))) {
params.put("districtCode", regionCode);
}
}
}

View File

@@ -0,0 +1,225 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.common.excel.ImportFailureExcelUtil;
import org.springblade.system.excel.CargoTypeExcel;
import org.springblade.system.excel.CargoTypeExportExcel;
import org.springblade.system.excel.CargoTypeImportFailureExcel;
import org.springblade.system.pojo.entity.CargoType;
import org.springblade.system.pojo.vo.CargoTypeVO;
import org.springblade.system.service.ICargoTypeService;
import org.springblade.system.wrapper.CargoTypeWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
/**
* 货物类型 控制器
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@PreAuth(menu = "cargo_type")
@RequestMapping("/cargo-type")
@Tag(name = "货物类型", description = "货物类型")
public class CargoTypeController extends BladeController {
private final ICargoTypeService cargoTypeService;
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入cargoType")
public R<CargoTypeVO> detail(CargoType cargoType) {
CargoType detail = cargoTypeService.getOne(Condition.getQueryWrapper(cargoType));
if (detail == null) {
throw new ServiceException("数据不存在");
}
CargoTypeVO cargoTypeVO = CargoTypeWrapper.build().entityVO(detail);
if (Func.isNotEmpty(detail.getParentId())) {
CargoType parent = cargoTypeService.getById(detail.getParentId());
cargoTypeVO.setParentCargoName(parent == null ? "" : parent.getCargoName());
}
return R.data(cargoTypeVO);
}
/**
* 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入cargoType")
public R<IPage<CargoTypeVO>> list(CargoTypeVO cargoType, Query query) {
IPage<CargoTypeVO> pages = cargoTypeService.selectCargoTypePage(Condition.getPage(query), cargoType);
return R.data(pages);
}
/**
* 一级货物类型选项
*/
@GetMapping("/parent-options")
@ApiOperationSupport(order = 3)
@Operation(summary = "一级货物类型选项", description = "传入keyword")
public R<List<CargoTypeVO>> parentOptions(@RequestParam(required = false) String keyword) {
return R.data(cargoTypeService.parentOptions(keyword));
}
/**
* 二级货物类型建议编码
*/
@GetMapping("/next-code")
@ApiOperationSupport(order = 4)
@Operation(summary = "二级货物类型建议编码", description = "传入parentCargoCode")
public R<String> nextCode(@Parameter(description = "上级货物类型编码", required = true) @RequestParam String parentCargoCode) {
return R.data(cargoTypeService.nextChildCode(parentCargoCode));
}
/**
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 5)
@Operation(summary = "新增或修改", description = "传入cargoType")
public R submit(@Valid @RequestBody CargoType cargoType) {
return R.status(cargoTypeService.submit(cargoType));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 6)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(cargoTypeService.deleteCargoTypes(Func.toLongList(ids)));
}
/**
* 导入货物类型
*/
@PostMapping("/import-cargo-type")
@ApiOperationSupport(order = 7)
@Operation(summary = "导入货物类型", description = "传入excel")
public R importCargoType(MultipartFile file, HttpServletResponse response) {
List<CargoTypeExcel> data = ExcelUtil.read(file, CargoTypeExcel.class);
List<CargoTypeImportFailureExcel> failureList = cargoTypeService.importCargoType(data);
if (Func.isNotEmpty(failureList)) {
ImportFailureExcelUtil.export(response, "货物类型导入失败明细" + DateUtil.time(), "导入失败明细", failureList, CargoTypeExcel.class);
return null;
}
return R.success("导入数据成功");
}
/**
* 导出货物类型
*/
@GetMapping("/export-cargo-type")
@ApiOperationSupport(order = 8)
@Operation(summary = "导出货物类型")
public void exportCargoType(CargoTypeVO cargoType,
@RequestParam(required = false) String ids,
HttpServletResponse response) {
List<CargoTypeExportExcel> list = cargoTypeService.exportCargoType(buildExportQuery(cargoType, ids));
ExcelUtil.export(response, "货物类型" + DateUtil.time(), "货物类型表", list, CargoTypeExportExcel.class);
}
/**
* 导出模板
*/
@GetMapping("/export-template")
@ApiOperationSupport(order = 9)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
List<CargoTypeExcel> list = new ArrayList<>();
ExcelUtil.export(response, "货物类型模板", "货物类型导入模板", list, CargoTypeExcel.class);
}
private LambdaQueryWrapper<CargoType> buildExportQuery(CargoTypeVO cargoType, String ids) {
LambdaQueryWrapper<CargoType> queryWrapper = Wrappers.<CargoType>lambdaQuery()
.eq(CargoType::getIsDeleted, 0)
.orderByDesc(CargoType::getCreateTime);
if (Func.isNotEmpty(ids)) {
queryWrapper.in(CargoType::getId, Func.toLongList(ids));
}
if (Func.isNotEmpty(cargoType.getTypeLevel())) {
queryWrapper.eq(CargoType::getTypeLevel, cargoType.getTypeLevel());
}
if (Func.isNotEmpty(cargoType.getCargoName())) {
queryWrapper.like(CargoType::getCargoName, cargoType.getCargoName());
}
if (Func.isNotEmpty(cargoType.getCargoCode())) {
queryWrapper.like(CargoType::getCargoCode, cargoType.getCargoCode());
}
if (Func.isNotEmpty(cargoType.getParentCargoCode())) {
queryWrapper.like(CargoType::getParentCargoCode, cargoType.getParentCargoCode());
}
if (Func.isNotEmpty(cargoType.getParentCargoName())) {
List<String> parentCodes = cargoTypeService.parentOptions(cargoType.getParentCargoName())
.stream()
.map(CargoTypeVO::getCargoCode)
.toList();
if (Func.isEmpty(parentCodes)) {
queryWrapper.eq(CargoType::getParentCargoCode, "__none__");
} else {
queryWrapper.in(CargoType::getParentCargoCode, parentCodes);
}
}
return queryWrapper;
}
}

View File

@@ -148,9 +148,12 @@ public class CurrencyController extends BladeController {
@PostMapping("/import-currency")
@ApiOperationSupport(order = 7)
@Operation(summary = "导入币种汇率", description = "传入excel")
public R importCurrency(MultipartFile file) {
CurrencyImporter currencyImporter = new CurrencyImporter(currencyService);
ExcelUtil.save(file, currencyImporter, CurrencyExcel.class);
public R importCurrency(MultipartFile file, HttpServletResponse response) {
List<CurrencyExcel> failureList = currencyService.importCurrency(ExcelUtil.read(file, CurrencyExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "币种汇率导入失败明细" + DateUtil.time(), "导入失败明细", failureList, CurrencyExcel.class);
return null;
}
return R.success("操作成功");
}

View File

@@ -159,7 +159,7 @@ public class PortTerminalController extends BladeController {
@PostMapping("/import-port-terminal")
@ApiOperationSupport(order = 7)
@Operation(summary = "导入港口码头主数据", description = "传入excel")
public R importPortTerminal(MultipartFile file) {
public R importPortTerminal(MultipartFile file, HttpServletResponse response) {
if (file == null || file.isEmpty()) {
return R.fail("上传文件不能为空");
}
@@ -167,8 +167,11 @@ public class PortTerminalController extends BladeController {
if (!fileName.endsWith(".xls") && !fileName.endsWith(".xlsx")) {
return R.fail("请上传 .xls,.xlsx 标准格式文件");
}
PortTerminalImporter portTerminalImporter = new PortTerminalImporter(portTerminalService);
ExcelUtil.save(file, portTerminalImporter, PortTerminalExcel.class);
List<PortTerminalExcel> failureList = portTerminalService.importPortTerminal(ExcelUtil.read(file, PortTerminalExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "港口码头主数据导入失败明细" + DateUtil.time(), "导入失败明细", failureList, PortTerminalExcel.class);
return null;
}
return R.success("操作成功");
}
@@ -184,6 +187,7 @@ public class PortTerminalController extends BladeController {
portTerminal.remove("Blade-Auth");
portTerminal.remove("Authorization");
portTerminal.remove("access_token");
normalizeRegionCodeCondition(portTerminal);
QueryWrapper<PortTerminal> queryWrapper = Condition.getQueryWrapper(portTerminal, PortTerminal.class);
applyDataSourceCondition(queryWrapper, dataSource);
if (Func.isNotEmpty(ids)) {
@@ -220,6 +224,13 @@ public class PortTerminalController extends BladeController {
return query;
}
private void normalizeRegionCodeCondition(Map<String, Object> params) {
Object regionCode = params.remove("regionCode");
if (Func.isNotEmpty(regionCode) && Func.isEmpty(params.get("districtCode"))) {
params.put("districtCode", regionCode);
}
}
private void applyDataSourceCondition(QueryWrapper<PortTerminal> queryWrapper, Object dataSource) {
String value = Func.toStrWithEmpty(dataSource, "");
if (Func.isEmpty(value)) {

View File

@@ -151,7 +151,7 @@ public class RailwayStationController extends BladeController {
@PostMapping("/import-railway-station")
@ApiOperationSupport(order = 6)
@Operation(summary = "导入铁路车站主数据", description = "传入excel")
public R importRailwayStation(MultipartFile file) {
public R importRailwayStation(MultipartFile file, HttpServletResponse response) {
if (file == null || file.isEmpty()) {
return R.fail("上传文件不能为空");
}
@@ -159,8 +159,11 @@ public class RailwayStationController extends BladeController {
if (!fileName.endsWith(".xls") && !fileName.endsWith(".xlsx")) {
return R.fail("请上传 .xls,.xlsx 标准格式文件");
}
RailwayStationImporter railwayStationImporter = new RailwayStationImporter(railwayStationService);
ExcelUtil.save(file, railwayStationImporter, RailwayStationExcel.class);
List<RailwayStationExcel> failureList = railwayStationService.importRailwayStation(ExcelUtil.read(file, RailwayStationExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "铁路车站主数据导入失败明细" + DateUtil.time(), "导入失败明细", failureList, RailwayStationExcel.class);
return null;
}
return R.success("操作成功");
}
@@ -176,6 +179,7 @@ public class RailwayStationController extends BladeController {
railwayStation.remove("Blade-Auth");
railwayStation.remove("Authorization");
railwayStation.remove("access_token");
normalizeRegionCodeCondition(railwayStation);
QueryWrapper<RailwayStation> queryWrapper = Condition.getQueryWrapper(railwayStation, RailwayStation.class);
applyDataSourceCondition(queryWrapper, dataSource);
if (Func.isNotEmpty(ids)) {
@@ -212,6 +216,13 @@ public class RailwayStationController extends BladeController {
return query;
}
private void normalizeRegionCodeCondition(Map<String, Object> params) {
Object regionCode = params.remove("regionCode");
if (Func.isNotEmpty(regionCode) && Func.isEmpty(params.get("districtCode"))) {
params.put("districtCode", regionCode);
}
}
private void applyDataSourceCondition(QueryWrapper<RailwayStation> queryWrapper, Object dataSource) {
String value = Func.toStrWithEmpty(dataSource, "");
if (Func.isEmpty(value)) {

View File

@@ -58,6 +58,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 行政区划表 控制器
@@ -121,9 +122,9 @@ public class RegionController extends BladeController {
})
@ApiOperationSupport(order = 4)
@Operation(summary = "懒加载列表", description = "传入menu")
public R<List<RegionVO>> lazyTree(String parentCode, @Parameter(hidden = true) @RequestParam Map<String, Object> menu) {
List<RegionVO> list = regionService.lazyTree(parentCode, menu);
return R.data(RegionWrapper.build().listNodeLazyVO(list));
public R<List<Map<String, Object>>> lazyTree(String parentCode, @Parameter(hidden = true) @RequestParam Map<String, Object> menu) {
List<Map<String, Object>> list = regionService.lazyTree(parentCode, menu);
return R.data(list);
}
/**
@@ -133,7 +134,7 @@ public class RegionController extends BladeController {
@ApiOperationSupport(order = 5)
@Operation(summary = "新增", description = "传入region")
public R save(@Valid @RequestBody Region region) {
return R.status(regionService.save(region));
return R.status(regionService.submit(region));
}
/**
@@ -143,7 +144,8 @@ public class RegionController extends BladeController {
@ApiOperationSupport(order = 6)
@Operation(summary = "修改", description = "传入region")
public R update(@Valid @RequestBody Region region) {
return R.status(regionService.updateById(region));
region.setOriginalCode(region.getCode());
return R.status(regionService.submit(region));
}
/**
@@ -173,8 +175,11 @@ public class RegionController extends BladeController {
@GetMapping("/select")
@ApiOperationSupport(order = 9)
@Operation(summary = "下拉数据源", description = "传入tenant")
public R<List<Region>> select(@RequestParam(required = false, defaultValue = "00") String code) {
List<Region> list = regionService.list(Wrappers.<Region>query().lambda().eq(Region::getParentCode, code));
public R<List<Region>> select(@RequestParam(required = false, defaultValue = "+86") String code) {
List<Region> list = regionService.list(Wrappers.<Region>lambdaQuery()
.eq(Region::getParentCode, code)
.orderByAsc(Region::getSort)
.orderByAsc(Region::getCode));
return R.data(list);
}
@@ -184,9 +189,12 @@ public class RegionController extends BladeController {
@PostMapping("import-region")
@ApiOperationSupport(order = 10)
@Operation(summary = "导入行政区划", description = "传入excel")
public R importRegion(MultipartFile file, Integer isCovered) {
RegionImporter regionImporter = new RegionImporter(regionService, isCovered == 1);
ExcelUtil.save(file, regionImporter, RegionExcel.class);
public R importRegion(MultipartFile file, Integer isCovered, HttpServletResponse response) {
List<RegionExcel> failureList = regionService.importRegion(ExcelUtil.read(file, RegionExcel.class), Objects.equals(isCovered, 1));
if (!failureList.isEmpty()) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "行政区划导入失败明细" + DateUtil.time(), "导入失败明细", failureList, RegionExcel.class);
return null;
}
return R.success("操作成功");
}

View File

@@ -27,6 +27,7 @@ package org.springblade.system.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.format.NumberFormat;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
@@ -73,10 +74,21 @@ public class AirportMasterExcel implements Serializable {
@ExcelProperty("所属城市")
private String cityName;
@ExcelProperty("所属区县")
private String districtName;
@ExcelProperty("行政区划")
private String regionName;
@ExcelProperty("详细地址")
private String detailAddress;
@ExcelProperty("经度")
@NumberFormat("0.000000")
private BigDecimal longitude;
@ExcelProperty("纬度")
@NumberFormat("0.000000")
private BigDecimal latitude;
@ExcelProperty("数据来源")
@@ -88,7 +100,7 @@ public class AirportMasterExcel implements Serializable {
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
@ExcelProperty
private String errorMessage;
}

View File

@@ -0,0 +1,72 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 货物类型导入 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(24)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class CargoTypeExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelProperty("*类型")
private String typeLevelName;
@ExcelProperty("上级货物类型(如为一级则不需填写)")
private String parentCargoName;
@ExcelProperty("上级货物类型编码(如为一级则不需填写)")
private String parentCargoCode;
@ExcelProperty("*货物类型")
private String cargoName;
@ExcelProperty("*货物类型编码")
private String cargoCode;
@ExcelProperty("备注")
private String remark;
@ExcelIgnore
private String errorMessage;
}

View File

@@ -0,0 +1,78 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.excel;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* 货物类型导出 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(22)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class CargoTypeExportExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelProperty("类型")
private String typeLevelName;
@ExcelProperty("货物类型")
private String cargoName;
@ExcelProperty("货物类型编码")
private String cargoCode;
@ExcelProperty("上级货物类型")
private String parentCargoName;
@ExcelProperty("上级货物类型编码")
private String parentCargoCode;
@ExcelProperty("创建人")
private String createUserName;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("更新时间")
private Date updateTime;
@ExcelProperty("创建时间")
private Date createTime;
}

View File

@@ -0,0 +1,71 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.excel;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 货物类型导入失败 Excel
*
* @author Chill
*/
@Data
@ColumnWidth(24)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class CargoTypeImportFailureExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ExcelProperty("*类型")
private String typeLevelName;
@ExcelProperty("上级货物类型(如为一级则不需填写)")
private String parentCargoName;
@ExcelProperty("上级货物类型编码(如为一级则不需填写)")
private String parentCargoCode;
@ExcelProperty("*货物类型")
private String cargoName;
@ExcelProperty("*货物类型编码")
private String cargoCode;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("导入失败原因")
private String failureReason;
}

View File

@@ -0,0 +1,49 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.excel;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.system.service.ICargoTypeService;
import java.util.List;
/**
* 货物类型导入类
*
* @author Chill
*/
@RequiredArgsConstructor
public class CargoTypeImporter implements ExcelImporter<CargoTypeExcel> {
private final ICargoTypeService service;
@Override
public void save(List<CargoTypeExcel> data) {
service.importCargoType(data);
}
}

View File

@@ -77,7 +77,7 @@ public class CurrencyExcel implements Serializable {
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
@ExcelProperty
private String errorMessage;
}

View File

@@ -27,6 +27,7 @@ package org.springblade.system.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.format.NumberFormat;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
@@ -73,10 +74,21 @@ public class PortTerminalExcel implements Serializable {
@ExcelProperty("城市")
private String city;
@ExcelProperty("区县")
private String districtName;
@ExcelProperty("行政区划编码")
private String regionCode;
@ExcelProperty("详细地址")
private String detailAddress;
@ExcelProperty("经度")
@NumberFormat("0.000000")
private BigDecimal longitude;
@ExcelProperty("纬度")
@NumberFormat("0.000000")
private BigDecimal latitude;
@ExcelProperty("数据来源")
@@ -88,7 +100,7 @@ public class PortTerminalExcel implements Serializable {
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
@ExcelProperty
private String errorMessage;
}

View File

@@ -34,7 +34,6 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 铁路车站主数据 Excel
@@ -64,8 +63,8 @@ public class RailwayStationExcel implements Serializable {
@ExcelProperty("车站名称")
private String name;
@ExcelProperty("所属铁路线路")
private String railwayLine;
// @ExcelProperty("所属铁路线路")
// private String railwayLine;
@ExcelProperty("所属省份")
private String provinceName;
@@ -73,11 +72,20 @@ public class RailwayStationExcel implements Serializable {
@ExcelProperty("所属城市")
private String cityName;
@ExcelProperty("所属区县")
private String districtName;
@ExcelProperty("行政区划")
private String regionName;
@ExcelProperty("详细地址")
private String detailAddress;
@ExcelProperty("经度")
private BigDecimal longitude;
private String longitude;
@ExcelProperty("纬度")
private BigDecimal latitude;
private String latitude;
@ExcelProperty("数据来源")
private String dataSource;
@@ -88,7 +96,7 @@ public class RailwayStationExcel implements Serializable {
@ExcelProperty("备注")
private String remark;
@ExcelProperty("报错文案")
@ExcelProperty
private String errorMessage;
}

View File

@@ -25,6 +25,7 @@
*/
package org.springblade.system.excel;
import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
@@ -98,4 +99,7 @@ public class RegionExcel implements Serializable {
@ExcelProperty("备注")
private String remark;
@ExcelIgnore
private String errorMessage;
}

View File

@@ -8,6 +8,7 @@
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_user_name" property="updateUserName"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
@@ -20,6 +21,11 @@
<result column="province_name" property="provinceName"/>
<result column="city_code" property="cityCode"/>
<result column="city_name" property="cityName"/>
<result column="district_code" property="districtCode"/>
<result column="district_name" property="districtName"/>
<result column="district_code" property="regionCode"/>
<result column="region_name" property="regionName"/>
<result column="detail_address" property="detailAddress"/>
<result column="longitude" property="longitude"/>
<result column="latitude" property="latitude"/>
<result column="data_source" property="dataSource"/>
@@ -28,59 +34,83 @@
<select id="selectAirportMasterPage" resultMap="airportMasterResultMap">
SELECT
id,
create_user,
create_dept,
create_time,
update_user,
update_time,
status,
is_deleted,
code,
iata_code,
icao_code,
name,
short_name,
province_code,
province_name,
city_code,
city_name,
longitude,
latitude,
CASE WHEN data_source = '手工导入' THEN '手动录入' ELSE data_source END AS data_source,
remark
am.id,
am.create_user,
am.create_dept,
am.create_time,
am.update_user,
bu.real_name AS update_user_name,
am.update_time,
am.status,
am.is_deleted,
am.code,
am.iata_code,
am.icao_code,
am.name,
am.short_name,
am.province_code,
am.province_name,
am.city_code,
am.city_name,
am.district_code,
am.district_name,
am.region_name,
am.detail_address,
am.longitude,
am.latitude,
CASE WHEN am.data_source = '手工导入' THEN '手动录入' ELSE am.data_source END AS data_source,
am.remark
FROM
blade_airport_master
blade_airport_master am
LEFT JOIN blade_user bu ON bu.id = am.update_user
WHERE
is_deleted = 0
am.is_deleted = 0
<if test="airportMaster.code != null and airportMaster.code != ''">
<bind name="codeLike" value="'%' + airportMaster.code + '%'"/>
AND code LIKE #{codeLike}
AND am.code LIKE #{codeLike}
</if>
<if test="airportMaster.name != null and airportMaster.name != ''">
<bind name="nameLike" value="'%' + airportMaster.name + '%'"/>
AND name LIKE #{nameLike}
AND am.name LIKE #{nameLike}
</if>
<if test="airportMaster.iataCode != null and airportMaster.iataCode != ''">
AND iata_code = #{airportMaster.iataCode}
AND am.iata_code = #{airportMaster.iataCode}
</if>
<if test="airportMaster.icaoCode != null and airportMaster.icaoCode != ''">
AND icao_code = #{airportMaster.icaoCode}
AND am.icao_code = #{airportMaster.icaoCode}
</if>
<if test="airportMaster.regionCode != null and airportMaster.regionCode != ''">
AND am.district_code = #{airportMaster.regionCode}
</if>
<if test="airportMaster.districtCode != null and airportMaster.districtCode != ''">
AND am.district_code = #{airportMaster.districtCode}
</if>
<if test="airportMaster.districtName != null and airportMaster.districtName != ''">
<bind name="districtNameLike" value="'%' + airportMaster.districtName + '%'"/>
AND am.district_name LIKE #{districtNameLike}
</if>
<if test="airportMaster.regionName != null and airportMaster.regionName != ''">
<bind name="regionNameLike" value="'%' + airportMaster.regionName + '%'"/>
AND am.region_name LIKE #{regionNameLike}
</if>
<if test="airportMaster.detailAddress != null and airportMaster.detailAddress != ''">
<bind name="detailAddressLike" value="'%' + airportMaster.detailAddress + '%'"/>
AND am.detail_address LIKE #{detailAddressLike}
</if>
<if test="airportMaster.dataSource != null and airportMaster.dataSource != ''">
<choose>
<when test="airportMaster.dataSource == '手动录入'">
AND data_source IN ('手动录入', '手工导入')
AND am.data_source IN ('手动录入', '手工导入')
</when>
<otherwise>
AND data_source = #{airportMaster.dataSource}
AND am.data_source = #{airportMaster.dataSource}
</otherwise>
</choose>
</if>
<if test="airportMaster.status != null">
AND status = #{airportMaster.status}
AND am.status = #{airportMaster.status}
</if>
ORDER BY update_time DESC, create_time DESC
ORDER BY am.create_time DESC
</select>
</mapper>

View File

@@ -0,0 +1,52 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.system.pojo.entity.CargoType;
import org.springblade.system.pojo.vo.CargoTypeVO;
import java.util.List;
/**
* 货物类型 Mapper 接口
*
* @author Chill
*/
public interface CargoTypeMapper extends BaseMapper<CargoType> {
/**
* 自定义分页
*
* @param page 分页参数
* @param cargoType 查询参数
* @return 货物类型分页
*/
List<CargoTypeVO> selectCargoTypePage(IPage<CargoTypeVO> page, @Param("cargoType") CargoTypeVO cargoType);
}

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.system.mapper.CargoTypeMapper">
<resultMap id="cargoTypeResultMap" type="org.springblade.system.pojo.vo.CargoTypeVO">
<result column="id" property="id"/>
<result column="create_user" property="createUser"/>
<result column="create_user_name" property="createUserName"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_user_name" property="updateUserName"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="type_level" property="typeLevel"/>
<result column="type_level_name" property="typeLevelName"/>
<result column="parent_id" property="parentId"/>
<result column="parent_cargo_name" property="parentCargoName"/>
<result column="parent_cargo_code" property="parentCargoCode"/>
<result column="cargo_name" property="cargoName"/>
<result column="cargo_code" property="cargoCode"/>
<result column="data_source" property="dataSource"/>
<result column="remark" property="remark"/>
</resultMap>
<select id="selectCargoTypePage" resultMap="cargoTypeResultMap">
SELECT
ct.id,
ct.create_user,
cu.real_name AS create_user_name,
ct.create_dept,
ct.create_time,
ct.update_user,
uu.real_name AS update_user_name,
ct.update_time,
ct.status,
ct.is_deleted,
ct.type_level,
CASE ct.type_level WHEN 1 THEN '一级货物类型' WHEN 2 THEN '二级货物类型' ELSE '' END AS type_level_name,
ct.parent_id,
pct.cargo_name AS parent_cargo_name,
ct.parent_cargo_code,
ct.cargo_name,
ct.cargo_code,
ct.data_source,
ct.remark
FROM
blade_cargo_type ct
LEFT JOIN blade_cargo_type pct ON pct.id = ct.parent_id AND pct.is_deleted = 0
LEFT JOIN blade_user cu ON cu.id = ct.create_user
LEFT JOIN blade_user uu ON uu.id = ct.update_user
WHERE
ct.is_deleted = 0
<if test="cargoType.typeLevel != null">
AND ct.type_level = #{cargoType.typeLevel}
</if>
<if test="cargoType.cargoName != null and cargoType.cargoName != ''">
<bind name="cargoNameLike" value="'%' + cargoType.cargoName + '%'"/>
AND ct.cargo_name LIKE #{cargoNameLike}
</if>
<if test="cargoType.cargoCode != null and cargoType.cargoCode != ''">
<bind name="cargoCodeLike" value="'%' + cargoType.cargoCode + '%'"/>
AND ct.cargo_code LIKE #{cargoCodeLike}
</if>
<if test="cargoType.parentCargoName != null and cargoType.parentCargoName != ''">
<bind name="parentCargoNameLike" value="'%' + cargoType.parentCargoName + '%'"/>
AND pct.cargo_name LIKE #{parentCargoNameLike}
</if>
<if test="cargoType.parentCargoCode != null and cargoType.parentCargoCode != ''">
<bind name="parentCargoCodeLike" value="'%' + cargoType.parentCargoCode + '%'"/>
AND ct.parent_cargo_code LIKE #{parentCargoCodeLike}
</if>
ORDER BY ct.create_time DESC
</select>
</mapper>

View File

@@ -8,6 +8,7 @@
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_user_name" property="updateUserName"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
@@ -26,51 +27,71 @@
<select id="selectCurrencyPage" resultMap="currencyResultMap">
SELECT
*
bc.id,
bc.create_user,
bc.create_dept,
bc.create_time,
bc.update_user,
bu.real_name AS update_user_name,
bc.update_time,
bc.status,
bc.is_deleted,
bc.code,
bc.name,
bc.english_name,
bc.symbol,
bc.decimal_places,
bc.exchange_rate,
bc.effective_date,
bc.expiry_date,
bc.is_base_currency,
bc.data_source,
bc.remark
FROM
blade_currency
blade_currency bc
LEFT JOIN blade_user bu ON bu.id = bc.update_user
WHERE
is_deleted = 0
bc.is_deleted = 0
<if test="currency.code != null and currency.code != ''">
<bind name="codeLike" value="'%' + currency.code + '%'"/>
AND code LIKE #{codeLike}
AND bc.code LIKE #{codeLike}
</if>
<if test="currency.name != null and currency.name != ''">
<bind name="nameLike" value="'%' + currency.name + '%'"/>
AND name LIKE #{nameLike}
AND bc.name LIKE #{nameLike}
</if>
<if test="currency.englishName != null and currency.englishName != ''">
<bind name="englishNameLike" value="'%' + currency.englishName + '%'"/>
AND english_name LIKE #{englishNameLike}
AND bc.english_name LIKE #{englishNameLike}
</if>
<if test="currency.status != null">
AND status = #{currency.status}
AND bc.status = #{currency.status}
</if>
<if test="currency.exchangeRate != null">
AND exchange_rate = #{currency.exchangeRate}
AND bc.exchange_rate = #{currency.exchangeRate}
</if>
<if test="currency.dataSource != null and currency.dataSource != ''">
AND data_source = #{currency.dataSource}
AND bc.data_source = #{currency.dataSource}
</if>
<if test="currency.effectiveDateStart != null">
AND effective_date &gt;= #{currency.effectiveDateStart}
AND bc.effective_date &gt;= #{currency.effectiveDateStart}
</if>
<if test="currency.effectiveDateEnd != null">
AND effective_date &lt;= #{currency.effectiveDateEnd}
AND bc.effective_date &lt;= #{currency.effectiveDateEnd}
</if>
<if test="currency.expiryDateStart != null">
AND expiry_date &gt;= #{currency.expiryDateStart}
AND bc.expiry_date &gt;= #{currency.expiryDateStart}
</if>
<if test="currency.expiryDateEnd != null">
AND expiry_date &lt;= #{currency.expiryDateEnd}
AND bc.expiry_date &lt;= #{currency.expiryDateEnd}
</if>
<if test="currency.updateTimeStart != null">
AND update_time &gt;= #{currency.updateTimeStart}
AND bc.update_time &gt;= #{currency.updateTimeStart}
</if>
<if test="currency.updateTimeEnd != null">
AND update_time &lt;= #{currency.updateTimeEnd}
AND bc.update_time &lt;= #{currency.updateTimeEnd}
</if>
ORDER BY code ASC, effective_date DESC, create_time DESC
ORDER BY bc.create_time DESC
</select>
</mapper>

View File

@@ -33,7 +33,7 @@
<if test="customerType.status != null">
AND status = #{customerType.status}
</if>
ORDER BY update_time DESC, create_time DESC
ORDER BY create_time DESC
</select>
</mapper>

View File

@@ -11,6 +11,7 @@
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="fee_category" property="feeCategory"/>
<result column="name" property="name"/>
<result column="english_name" property="englishName"/>
</resultMap>
@@ -22,6 +23,9 @@
blade_fee_item
WHERE
is_deleted = 0
<if test="feeItem.feeCategory != null and feeItem.feeCategory != ''">
AND fee_category = #{feeItem.feeCategory}
</if>
<if test="feeItem.name != null and feeItem.name != ''">
<bind name="nameLike" value="'%' + feeItem.name + '%'"/>
AND name LIKE #{nameLike}
@@ -33,7 +37,7 @@
<if test="feeItem.status != null">
AND status = #{feeItem.status}
</if>
ORDER BY update_time DESC, create_time DESC
ORDER BY create_time DESC
</select>
</mapper>

View File

@@ -8,6 +8,7 @@
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_user_name" property="updateUserName"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
@@ -19,6 +20,10 @@
<result column="parent_name" property="parentName"/>
<result column="country" property="country"/>
<result column="city" property="city"/>
<result column="district_code" property="districtCode"/>
<result column="district_name" property="districtName"/>
<result column="district_code" property="regionCode"/>
<result column="detail_address" property="detailAddress"/>
<result column="longitude" property="longitude"/>
<result column="latitude" property="latitude"/>
<result column="data_source" property="dataSource"/>
@@ -27,61 +32,80 @@
<select id="selectPortTerminalPage" resultMap="portTerminalResultMap">
SELECT
id,
create_user,
create_dept,
create_time,
update_user,
update_time,
status,
is_deleted,
code,
name,
category,
parent_id,
parent_code,
parent_name,
country,
city,
CASE WHEN longitude BETWEEN -180 AND 180 THEN longitude ELSE NULL END AS longitude,
CASE WHEN latitude BETWEEN -90 AND 90 THEN latitude ELSE NULL END AS latitude,
CASE WHEN data_source = '初始导入' THEN '初始化导入' ELSE data_source END AS data_source,
remark
pt.id,
pt.create_user,
pt.create_dept,
pt.create_time,
pt.update_user,
bu.real_name AS update_user_name,
pt.update_time,
pt.status,
pt.is_deleted,
pt.code,
pt.name,
pt.category,
pt.parent_id,
pt.parent_code,
pt.parent_name,
pt.country,
pt.city,
pt.district_code,
pt.district_name,
pt.detail_address,
CASE WHEN pt.longitude BETWEEN -180 AND 180 THEN pt.longitude ELSE NULL END AS longitude,
CASE WHEN pt.latitude BETWEEN -90 AND 90 THEN pt.latitude ELSE NULL END AS latitude,
CASE WHEN pt.data_source = '初始导入' THEN '初始化导入' ELSE pt.data_source END AS data_source,
pt.remark
FROM
blade_port_terminal
blade_port_terminal pt
LEFT JOIN blade_user bu ON bu.id = pt.update_user
WHERE
is_deleted = 0
pt.is_deleted = 0
<if test="portTerminal.code != null and portTerminal.code != ''">
<bind name="codeLike" value="'%' + portTerminal.code + '%'"/>
AND code LIKE #{codeLike}
AND pt.code LIKE #{codeLike}
</if>
<if test="portTerminal.name != null and portTerminal.name != ''">
<bind name="nameLike" value="'%' + portTerminal.name + '%'"/>
AND name LIKE #{nameLike}
AND pt.name LIKE #{nameLike}
</if>
<if test="portTerminal.category != null and portTerminal.category != ''">
AND category = #{portTerminal.category}
AND pt.category = #{portTerminal.category}
</if>
<if test="portTerminal.dataSource != null and portTerminal.dataSource != ''">
<choose>
<when test="portTerminal.dataSource == '初始化导入'">
AND data_source IN ('初始化导入', '初始导入')
AND pt.data_source IN ('初始化导入', '初始导入')
</when>
<otherwise>
AND data_source = #{portTerminal.dataSource}
AND pt.data_source = #{portTerminal.dataSource}
</otherwise>
</choose>
</if>
<if test="portTerminal.city != null and portTerminal.city != ''">
AND city = #{portTerminal.city}
AND pt.city = #{portTerminal.city}
</if>
<if test="portTerminal.districtCode != null and portTerminal.districtCode != ''">
AND pt.district_code = #{portTerminal.districtCode}
</if>
<if test="portTerminal.districtName != null and portTerminal.districtName != ''">
<bind name="districtNameLike" value="'%' + portTerminal.districtName + '%'"/>
AND pt.district_name LIKE #{districtNameLike}
</if>
<if test="portTerminal.regionCode != null and portTerminal.regionCode != ''">
AND pt.district_code = #{portTerminal.regionCode}
</if>
<if test="portTerminal.detailAddress != null and portTerminal.detailAddress != ''">
<bind name="detailAddressLike" value="'%' + portTerminal.detailAddress + '%'"/>
AND pt.detail_address LIKE #{detailAddressLike}
</if>
<if test="portTerminal.country != null and portTerminal.country != ''">
AND country = #{portTerminal.country}
AND pt.country = #{portTerminal.country}
</if>
<if test="portTerminal.status != null">
AND status = #{portTerminal.status}
AND pt.status = #{portTerminal.status}
</if>
ORDER BY update_time DESC, create_time DESC
ORDER BY pt.create_time DESC
</select>
</mapper>

View File

@@ -8,6 +8,7 @@
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_user_name" property="updateUserName"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
@@ -20,6 +21,11 @@
<result column="province_name" property="provinceName"/>
<result column="city_code" property="cityCode"/>
<result column="city_name" property="cityName"/>
<result column="district_code" property="districtCode"/>
<result column="district_name" property="districtName"/>
<result column="district_code" property="regionCode"/>
<result column="region_name" property="regionName"/>
<result column="detail_address" property="detailAddress"/>
<result column="longitude" property="longitude"/>
<result column="latitude" property="latitude"/>
<result column="data_source" property="dataSource"/>
@@ -28,70 +34,94 @@
<select id="selectRailwayStationPage" resultMap="railwayStationResultMap">
SELECT
id,
create_user,
create_dept,
create_time,
update_user,
update_time,
status,
is_deleted,
code,
tmis_code,
telegraph_code,
name,
railway_line,
province_code,
province_name,
city_code,
city_name,
longitude,
latitude,
rs.id,
rs.create_user,
rs.create_dept,
rs.create_time,
rs.update_user,
bu.real_name AS update_user_name,
rs.update_time,
rs.status,
rs.is_deleted,
rs.code,
rs.tmis_code,
rs.telegraph_code,
rs.name,
rs.railway_line,
rs.province_code,
rs.province_name,
rs.city_code,
rs.city_name,
rs.district_code,
rs.district_name,
rs.region_name,
rs.detail_address,
rs.longitude,
rs.latitude,
CASE
WHEN data_source = '初始导入' THEN '初始化导入'
WHEN data_source = '批量导入' THEN '批量'
WHEN data_source IN ('手工导入', '手动录入') THEN '手动'
ELSE data_source
WHEN rs.data_source = '初始导入' THEN '初始化导入'
WHEN rs.data_source = '批量导入' THEN '批量'
WHEN rs.data_source IN ('手工导入', '手动录入') THEN '手动'
ELSE rs.data_source
END AS data_source,
remark
rs.remark
FROM
blade_railway_station
blade_railway_station rs
LEFT JOIN blade_user bu ON bu.id = rs.update_user
WHERE
is_deleted = 0
rs.is_deleted = 0
<if test="railwayStation.code != null and railwayStation.code != ''">
<bind name="codeLike" value="'%' + railwayStation.code + '%'"/>
AND code LIKE #{codeLike}
AND rs.code LIKE #{codeLike}
</if>
<if test="railwayStation.name != null and railwayStation.name != ''">
<bind name="nameLike" value="'%' + railwayStation.name + '%'"/>
AND name LIKE #{nameLike}
AND rs.name LIKE #{nameLike}
</if>
<if test="railwayStation.tmisCode != null and railwayStation.tmisCode != ''">
AND tmis_code = #{railwayStation.tmisCode}
AND rs.tmis_code = #{railwayStation.tmisCode}
</if>
<if test="railwayStation.telegraphCode != null and railwayStation.telegraphCode != ''">
AND telegraph_code = #{railwayStation.telegraphCode}
AND rs.telegraph_code = #{railwayStation.telegraphCode}
</if>
<if test="railwayStation.regionCode != null and railwayStation.regionCode != ''">
AND rs.district_code = #{railwayStation.regionCode}
</if>
<if test="railwayStation.districtCode != null and railwayStation.districtCode != ''">
AND rs.district_code = #{railwayStation.districtCode}
</if>
<if test="railwayStation.districtName != null and railwayStation.districtName != ''">
<bind name="districtNameLike" value="'%' + railwayStation.districtName + '%'"/>
AND rs.district_name LIKE #{districtNameLike}
</if>
<if test="railwayStation.regionName != null and railwayStation.regionName != ''">
<bind name="regionNameLike" value="'%' + railwayStation.regionName + '%'"/>
AND rs.region_name LIKE #{regionNameLike}
</if>
<if test="railwayStation.detailAddress != null and railwayStation.detailAddress != ''">
<bind name="detailAddressLike" value="'%' + railwayStation.detailAddress + '%'"/>
AND rs.detail_address LIKE #{detailAddressLike}
</if>
<if test="railwayStation.dataSource != null and railwayStation.dataSource != ''">
<choose>
<when test="railwayStation.dataSource == '初始化导入'">
AND data_source IN ('初始化导入', '初始导入')
AND rs.data_source IN ('初始化导入', '初始导入')
</when>
<when test="railwayStation.dataSource == '批量'">
AND data_source IN ('批量', '批量导入')
AND rs.data_source IN ('批量', '批量导入')
</when>
<when test="railwayStation.dataSource == '手动'">
AND data_source IN ('手动', '手动录入', '手工导入')
AND rs.data_source IN ('手动', '手动录入', '手工导入')
</when>
<otherwise>
AND data_source = #{railwayStation.dataSource}
AND rs.data_source = #{railwayStation.dataSource}
</otherwise>
</choose>
</if>
<if test="railwayStation.status != null">
AND status = #{railwayStation.status}
AND rs.status = #{railwayStation.status}
</if>
ORDER BY update_time DESC, create_time DESC
ORDER BY rs.create_time DESC
</select>
</mapper>

View File

@@ -58,7 +58,7 @@ public interface RegionMapper extends BaseMapper<Region> {
* @param param
* @return
*/
List<RegionVO> lazyTree(String parentCode, Map<String, Object> param);
List<Map<String, Object>> lazyTree(String parentCode, Map<String, Object> param);
/**
* 导出区划数据

View File

@@ -72,16 +72,17 @@
and region.name like concat(concat('%', #{param2.name}),'%')
</if>
</where>
ORDER BY region.sort ASC, region.code ASC
</select>
<select id="lazyTree" resultMap="treeNodeResultMap">
<select id="lazyTree" resultType="java.util.HashMap">
SELECT
region.code AS "id",
region.parent_code AS "parent_id",
region.name AS "title",
region.code AS "value",
region.code AS "key",
( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM blade_region WHERE parent_code = region.code ) AS "has_children"
region.code AS id,
region.parent_code AS parentId,
region.name AS title,
region.code AS value,
region.code AS `key`,
( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM blade_region WHERE parent_code = region.code ) AS hasChildren
FROM
blade_region region
<where>
@@ -95,7 +96,7 @@
and region.name like concat(concat('%', #{param2.name}),'%')
</if>
</where>
ORDER BY region.code
ORDER BY region.sort ASC, region.code ASC
</select>
<select id="exportRegion" resultType="org.springblade.system.excel.RegionExcel">

View File

@@ -72,7 +72,7 @@ public interface IAirportMasterService extends BaseService<AirportMaster> {
*
* @param data 导入数据
*/
void importAirportMaster(List<AirportMasterExcel> data);
List<AirportMasterExcel> importAirportMaster(List<AirportMasterExcel> data);
/**
* 导出空港机场

View File

@@ -0,0 +1,103 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.system.excel.CargoTypeExcel;
import org.springblade.system.excel.CargoTypeExportExcel;
import org.springblade.system.excel.CargoTypeImportFailureExcel;
import org.springblade.system.pojo.entity.CargoType;
import org.springblade.system.pojo.vo.CargoTypeVO;
import java.util.List;
/**
* 货物类型 服务类
*
* @author Chill
*/
public interface ICargoTypeService extends BaseService<CargoType> {
/**
* 自定义分页
*
* @param page 分页参数
* @param cargoType 查询参数
* @return 货物类型分页
*/
IPage<CargoTypeVO> selectCargoTypePage(IPage<CargoTypeVO> page, CargoTypeVO cargoType);
/**
* 新增或修改货物类型
*
* @param cargoType 货物类型
* @return 是否成功
*/
boolean submit(CargoType cargoType);
/**
* 删除货物类型
*
* @param ids 主键集合
* @return 是否成功
*/
boolean deleteCargoTypes(List<Long> ids);
/**
* 一级货物类型选项
*
* @param keyword 关键字
* @return 一级货物类型列表
*/
List<CargoTypeVO> parentOptions(String keyword);
/**
* 获取二级货物类型建议编码
*
* @param parentCargoCode 上级货物类型编码
* @return 建议编码
*/
String nextChildCode(String parentCargoCode);
/**
* 导入货物类型
*
* @param data 导入数据
* @return 导入失败数据
*/
List<CargoTypeImportFailureExcel> importCargoType(List<CargoTypeExcel> data);
/**
* 导出货物类型
*
* @param queryWrapper 查询条件
* @return 导出数据
*/
List<CargoTypeExportExcel> exportCargoType(Wrapper<CargoType> queryWrapper);
}

View File

@@ -73,7 +73,7 @@ public interface ICurrencyService extends BaseService<Currency> {
*
* @param data 导入数据
*/
void importCurrency(List<CurrencyExcel> data);
List<CurrencyExcel> importCurrency(List<CurrencyExcel> data);
/**
* 导出币种汇率

View File

@@ -79,7 +79,7 @@ public interface IPortTerminalService extends BaseService<PortTerminal> {
*
* @param data 导入数据
*/
void importPortTerminal(List<PortTerminalExcel> data);
List<PortTerminalExcel> importPortTerminal(List<PortTerminalExcel> data);
/**
* 导出港口码头

View File

@@ -72,7 +72,7 @@ public interface IRailwayStationService extends BaseService<RailwayStation> {
*
* @param data 导入数据
*/
void importRailwayStation(List<RailwayStationExcel> data);
List<RailwayStationExcel> importRailwayStation(List<RailwayStationExcel> data);
/**
* 导出铁路车站

View File

@@ -73,7 +73,7 @@ public interface IRegionService extends IService<Region> {
* @param param
* @return
*/
List<RegionVO> lazyTree(String parentCode, Map<String, Object> param);
List<Map<String, Object>> lazyTree(String parentCode, Map<String, Object> param);
/**
* 导入区划数据
@@ -82,7 +82,7 @@ public interface IRegionService extends IService<Region> {
* @param isCovered
* @return
*/
void importRegion(List<RegionExcel> data, Boolean isCovered);
List<RegionExcel> importRegion(List<RegionExcel> data, Boolean isCovered);
/**
* 导出区划数据

View File

@@ -45,6 +45,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@@ -65,12 +66,15 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
private static final String SOURCE_BATCH = "批量导入";
private static final String SOURCE_MANUAL = "手动录入";
private static final String SOURCE_MANUAL_OLD = "手工导入";
private static final String DEFAULT_COUNTRY_CODE = "+86";
private static final int STATUS_ENABLED = 1;
private static final int STATUS_DISABLED = 2;
private static final int CODE_MAX_LENGTH = 20;
private static final int NAME_MAX_LENGTH = 100;
private static final int SHORT_NAME_MAX_LENGTH = 100;
private static final int REGION_NAME_MAX_LENGTH = 128;
private static final int REGION_CODE_MAX_LENGTH = 32;
private static final int DETAIL_ADDRESS_MAX_LENGTH = 255;
private static final int REMARK_MAX_LENGTH = 200;
private static final Pattern IATA_CODE_PATTERN = Pattern.compile("^[A-Z]{3}$");
private static final Pattern ICAO_CODE_PATTERN = Pattern.compile("^[A-Z]{4}$");
@@ -115,11 +119,11 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
@Override
@Transactional(rollbackFor = Exception.class)
public void importAirportMaster(List<AirportMasterExcel> data) {
public List<AirportMasterExcel> importAirportMaster(List<AirportMasterExcel> data) {
if (Func.isEmpty(data)) {
throw new ServiceException("导入数据不能为空");
}
List<String> errorList = new ArrayList<>();
List<AirportMasterExcel> errorList = new ArrayList<>();
for (int index = 0; index < data.size(); index++) {
AirportMasterExcel excel = data.get(index);
try {
@@ -131,12 +135,11 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
save(airportMaster);
} catch (Exception exception) {
String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败";
errorList.add("" + (index + 2) + "行:" + message);
excel.setErrorMessage("" + (index + 2) + "行:" + message);
errorList.add(excel);
}
}
if (Func.isNotEmpty(errorList)) {
throw new ServiceException(String.join("", errorList));
}
return errorList;
}
@Override
@@ -144,12 +147,21 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
List<AirportMaster> airportMasterList = list(queryWrapper);
return airportMasterList.stream().map(airportMaster -> {
AirportMasterExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(airportMaster, AirportMasterExcel.class));
excel.setLongitude(scaleCoordinate(airportMaster.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE));
excel.setLatitude(scaleCoordinate(airportMaster.getLatitude(), MIN_LATITUDE, MAX_LATITUDE));
excel.setDataSource(normalizeDataSource(airportMaster.getDataSource()));
excel.setStatusName(Objects.equals(airportMaster.getStatus(), STATUS_ENABLED) ? "启用" : "停用");
return excel;
}).toList();
}
private BigDecimal scaleCoordinate(BigDecimal value, BigDecimal min, BigDecimal max) {
if (Func.isEmpty(value)) {
return null;
}
return validRange(value, min, max) ? value.setScale(6, RoundingMode.HALF_UP) : null;
}
private void prepare(AirportMaster airportMaster, String defaultDataSource) {
airportMaster.setIataCode(trimToEmpty(airportMaster.getIataCode()).toUpperCase(Locale.ROOT));
airportMaster.setCode(CODE_PREFIX + airportMaster.getIataCode());
@@ -160,6 +172,17 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
airportMaster.setProvinceName(trimToNull(airportMaster.getProvinceName()));
airportMaster.setCityCode(trimToNull(airportMaster.getCityCode()));
airportMaster.setCityName(trimToNull(airportMaster.getCityName()));
airportMaster.setDistrictCode(trimToNull(airportMaster.getDistrictCode()));
airportMaster.setDistrictName(trimToNull(airportMaster.getDistrictName()));
airportMaster.setRegionCode(trimToNull(airportMaster.getRegionCode()));
airportMaster.setRegionName(trimToNull(airportMaster.getRegionName()));
if (Func.isEmpty(airportMaster.getDistrictCode()) && Func.isNotEmpty(airportMaster.getRegionCode())) {
airportMaster.setDistrictCode(airportMaster.getRegionCode());
}
if (Func.isEmpty(airportMaster.getDistrictName()) && Func.isNotEmpty(airportMaster.getRegionName())) {
airportMaster.setDistrictName(airportMaster.getRegionName());
}
airportMaster.setDetailAddress(trimToNull(airportMaster.getDetailAddress()));
airportMaster.setRemark(trimToNull(airportMaster.getRemark()));
airportMaster.setDataSource(normalizeDataSource(Func.toStrWithEmpty(airportMaster.getDataSource(), defaultDataSource)));
if (Func.isEmpty(airportMaster.getStatus())) {
@@ -189,9 +212,13 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
validateLength(airportMaster.getShortName(), SHORT_NAME_MAX_LENGTH, "机场简称不能超过100字");
validateLength(airportMaster.getProvinceName(), REGION_NAME_MAX_LENGTH, "所属省份不能超过128字");
validateLength(airportMaster.getCityName(), REGION_NAME_MAX_LENGTH, "所属城市不能超过128字");
validateLength(airportMaster.getDistrictName(), REGION_NAME_MAX_LENGTH, "所属区县不能超过128字");
validateLength(airportMaster.getRegionCode(), REGION_CODE_MAX_LENGTH, "行政区划编码不能超过32字");
validateLength(airportMaster.getRegionName(), REGION_NAME_MAX_LENGTH, "行政区划不能超过128字");
validateLength(airportMaster.getDetailAddress(), DETAIL_ADDRESS_MAX_LENGTH, "详细地址不能超过255字");
validateLength(airportMaster.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字");
if (Func.isEmpty(airportMaster.getProvinceCode()) || Func.isEmpty(airportMaster.getCityCode())) {
throw new ServiceException("请选择省份城市");
if (Func.isEmpty(airportMaster.getProvinceCode()) || Func.isEmpty(airportMaster.getCityCode()) || Func.isEmpty(airportMaster.getDistrictCode())) {
throw new ServiceException("请选择省份城市和区县");
}
validateCoordinate(airportMaster.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE, "经度");
validateCoordinate(airportMaster.getLatitude(), MIN_LATITUDE, MAX_LATITUDE, "纬度");
@@ -209,7 +236,7 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
}
if (Func.isEmpty(province) && Func.isNotEmpty(airportMaster.getProvinceName())) {
province = regionService.getOne(Wrappers.<Region>lambdaQuery()
.eq(Region::getParentCode, "00")
.eq(Region::getParentCode, DEFAULT_COUNTRY_CODE)
.eq(Region::getName, airportMaster.getProvinceName()), false);
}
if (Func.isEmpty(province)) {
@@ -235,6 +262,26 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
airportMaster.setProvinceName(province.getName());
airportMaster.setCityCode(city.getCode());
airportMaster.setCityName(city.getName());
Region district = null;
if (Func.isNotEmpty(airportMaster.getDistrictCode())) {
district = regionService.getById(airportMaster.getDistrictCode());
}
if (Func.isEmpty(district) && Func.isNotEmpty(airportMaster.getDistrictName())) {
district = regionService.getOne(Wrappers.<Region>lambdaQuery()
.eq(Region::getParentCode, city.getCode())
.eq(Region::getName, airportMaster.getDistrictName()), false);
}
if (Func.isEmpty(district)) {
throw new ServiceException("请选择区县");
}
if (!Objects.equals(district.getParentCode(), city.getCode())) {
throw new ServiceException("所属区县与所属城市不匹配");
}
airportMaster.setDistrictCode(district.getCode());
airportMaster.setDistrictName(district.getName());
airportMaster.setRegionCode(district.getCode());
airportMaster.setRegionName(district.getName());
}
private void validateCoordinate(BigDecimal value, BigDecimal min, BigDecimal max, String name) {
@@ -246,6 +293,10 @@ public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMappe
}
}
private boolean validRange(BigDecimal value, BigDecimal min, BigDecimal max) {
return Func.isEmpty(value) || (value.compareTo(min) >= 0 && value.compareTo(max) <= 0);
}
private void validateDataSource(String dataSource) {
if (!SOURCE_INITIAL.equals(dataSource) && !SOURCE_BATCH.equals(dataSource) && !SOURCE_MANUAL.equals(dataSource)) {
throw new ServiceException("数据来源不正确");

View File

@@ -0,0 +1,384 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.UserCache;
import org.springblade.system.excel.CargoTypeExcel;
import org.springblade.system.excel.CargoTypeExportExcel;
import org.springblade.system.excel.CargoTypeImportFailureExcel;
import org.springblade.system.mapper.CargoTypeMapper;
import org.springblade.system.pojo.entity.CargoType;
import org.springblade.system.pojo.vo.CargoTypeVO;
import org.springblade.system.service.ICargoTypeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.regex.Pattern;
/**
* 货物类型 服务实现类
*
* @author Chill
*/
@Service
public class CargoTypeServiceImpl extends BaseServiceImpl<CargoTypeMapper, CargoType> implements ICargoTypeService {
private static final int TYPE_LEVEL_ONE = 1;
private static final int TYPE_LEVEL_TWO = 2;
private static final int STATUS_ENABLED = 1;
private static final int CARGO_NAME_MAX_LENGTH = 50;
private static final int REMARK_MAX_LENGTH = 200;
private static final String SOURCE_BATCH = "批量导入";
private static final String SOURCE_MANUAL = "手工录入";
private static final Pattern PARENT_CODE_PATTERN = Pattern.compile("^\\d{2}$");
private static final Pattern CHILD_CODE_PATTERN = Pattern.compile("^\\d{4}$");
@Override
public IPage<CargoTypeVO> selectCargoTypePage(IPage<CargoTypeVO> page, CargoTypeVO cargoType) {
return page.setRecords(baseMapper.selectCargoTypePage(page, cargoType));
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean submit(CargoType cargoType) {
prepare(cargoType, SOURCE_MANUAL);
validate(cargoType);
return saveOrUpdate(cargoType);
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean deleteCargoTypes(List<Long> ids) {
if (Func.isEmpty(ids)) {
throw new ServiceException("请选择至少一条数据");
}
long childCount = count(Wrappers.<CargoType>lambdaQuery()
.in(CargoType::getParentId, ids)
.eq(CargoType::getIsDeleted, 0));
if (childCount > 0L) {
throw new ServiceException("存在下级货物类型,不能删除");
}
return deleteLogic(ids);
}
@Override
public List<CargoTypeVO> parentOptions(String keyword) {
String trimKeyword = trimToEmpty(keyword);
LambdaQueryWrapper<CargoType> queryWrapper = Wrappers.<CargoType>lambdaQuery()
.eq(CargoType::getTypeLevel, TYPE_LEVEL_ONE)
.eq(CargoType::getIsDeleted, 0)
.orderByAsc(CargoType::getCargoCode);
if (Func.isNotEmpty(trimKeyword)) {
queryWrapper.and(wrapper -> wrapper.like(CargoType::getCargoName, trimKeyword)
.or()
.like(CargoType::getCargoCode, trimKeyword));
}
return list(queryWrapper).stream().map(this::toParentOption).toList();
}
@Override
public String nextChildCode(String parentCargoCode) {
CargoType parent = findParentByCode(trimToEmpty(parentCargoCode));
if (parent == null) {
throw new ServiceException("请选择上级货物类型");
}
String parentCode = parent.getCargoCode();
String maxCode = list(Wrappers.<CargoType>lambdaQuery()
.eq(CargoType::getTypeLevel, TYPE_LEVEL_TWO)
.eq(CargoType::getParentCargoCode, parentCode)
.eq(CargoType::getIsDeleted, 0)
.orderByDesc(CargoType::getCargoCode))
.stream()
.map(CargoType::getCargoCode)
.filter(code -> code != null && CHILD_CODE_PATTERN.matcher(code).matches())
.findFirst()
.orElse(null);
int nextSerial = maxCode == null ? 1 : Integer.parseInt(maxCode.substring(2)) + 1;
if (nextSerial > 99) {
throw new ServiceException("二级编码序号已超过99");
}
return parentCode + String.format("%02d", nextSerial);
}
@Override
public List<CargoTypeImportFailureExcel> importCargoType(List<CargoTypeExcel> data) {
if (Func.isEmpty(data)) {
throw new ServiceException("导入数据不能为空");
}
List<CargoTypeImportFailureExcel> failureList = new ArrayList<>();
for (int index = 0; index < data.size(); index++) {
CargoTypeExcel excel = data.get(index);
try {
CargoType cargoType = buildImportCargoType(excel);
prepare(cargoType, SOURCE_BATCH);
validate(cargoType);
save(cargoType);
} catch (Exception exception) {
String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败";
excel.setErrorMessage(message);
failureList.add(toImportFailureExcel(excel, "" + (index + 2) + "行:" + message));
}
}
return failureList;
}
@Override
public List<CargoTypeExportExcel> exportCargoType(Wrapper<CargoType> queryWrapper) {
return list(queryWrapper).stream().map(this::toExportExcel).toList();
}
private CargoType buildImportCargoType(CargoTypeExcel excel) {
CargoType cargoType = new CargoType();
cargoType.setTypeLevel(parseTypeLevel(excel.getTypeLevelName()));
cargoType.setParentCargoCode(trimToNull(excel.getParentCargoCode()));
cargoType.setCargoName(trimToEmpty(excel.getCargoName()));
cargoType.setCargoCode(trimToEmpty(excel.getCargoCode()));
cargoType.setRemark(trimToNull(excel.getRemark()));
if (Objects.equals(cargoType.getTypeLevel(), TYPE_LEVEL_TWO)) {
CargoType parent = resolveImportParent(excel);
cargoType.setParentId(parent.getId());
cargoType.setParentCargoCode(parent.getCargoCode());
}
return cargoType;
}
private Integer parseTypeLevel(String typeLevelName) {
String value = trimToEmpty(typeLevelName);
if ("一级货物类型".equals(value)) {
return TYPE_LEVEL_ONE;
}
if ("二级货物类型".equals(value)) {
return TYPE_LEVEL_TWO;
}
throw new ServiceException("请选择货物类型级别");
}
private CargoType resolveImportParent(CargoTypeExcel excel) {
String parentCode = trimToEmpty(excel.getParentCargoCode());
String parentName = trimToEmpty(excel.getParentCargoName());
if (Func.isEmpty(parentCode) && Func.isEmpty(parentName)) {
throw new ServiceException("请选择上级货物类型");
}
CargoType parent = Func.isNotEmpty(parentCode) ? findParentByCode(parentCode) : findParentByName(parentName);
if (parent == null) {
throw new ServiceException("请选择上级货物类型");
}
if (Func.isNotEmpty(parentName) && !Objects.equals(parent.getCargoName(), parentName)) {
throw new ServiceException("请选择上级货物类型");
}
return parent;
}
private void prepare(CargoType cargoType, String defaultDataSource) {
cargoType.setCargoName(trimToEmpty(cargoType.getCargoName()));
cargoType.setCargoCode(trimToEmpty(cargoType.getCargoCode()));
cargoType.setParentCargoCode(trimToNull(cargoType.getParentCargoCode()));
cargoType.setDataSource(Func.toStrWithEmpty(cargoType.getDataSource(), defaultDataSource));
cargoType.setRemark(trimToNull(cargoType.getRemark()));
if (Objects.equals(cargoType.getTypeLevel(), TYPE_LEVEL_ONE)) {
cargoType.setParentId(null);
cargoType.setParentCargoCode(null);
}
if (Func.isEmpty(cargoType.getStatus())) {
cargoType.setStatus(STATUS_ENABLED);
}
}
private void validate(CargoType cargoType) {
if (!Objects.equals(cargoType.getTypeLevel(), TYPE_LEVEL_ONE) && !Objects.equals(cargoType.getTypeLevel(), TYPE_LEVEL_TWO)) {
throw new ServiceException("请选择货物类型级别");
}
if (Func.isEmpty(cargoType.getCargoName())) {
throw new ServiceException("请输入货物类型名称");
}
if (cargoType.getCargoName().length() > CARGO_NAME_MAX_LENGTH) {
throw new ServiceException("货物类型名称不能超过50字符");
}
if (Func.isEmpty(cargoType.getCargoCode())) {
throw new ServiceException("货物类型编码格式不正确");
}
if (Objects.equals(cargoType.getTypeLevel(), TYPE_LEVEL_ONE)) {
validateParentCargoType(cargoType);
} else {
validateChildCargoType(cargoType);
}
if (Func.isNotEmpty(cargoType.getRemark()) && cargoType.getRemark().length() > REMARK_MAX_LENGTH) {
throw new ServiceException("备注不能超过200字");
}
validateUniqueCode(cargoType);
validateUniqueName(cargoType);
}
private void validateParentCargoType(CargoType cargoType) {
if (!PARENT_CODE_PATTERN.matcher(cargoType.getCargoCode()).matches()) {
throw new ServiceException("货物类型编码格式不正确");
}
}
private void validateChildCargoType(CargoType cargoType) {
CargoType parent = resolveParent(cargoType);
if (parent == null) {
throw new ServiceException("请选择上级货物类型");
}
if (!CHILD_CODE_PATTERN.matcher(cargoType.getCargoCode()).matches()) {
throw new ServiceException("货物类型编码格式不正确");
}
if (!cargoType.getCargoCode().startsWith(parent.getCargoCode())) {
throw new ServiceException("货物类型编码前2位必须与上级货物类型编码一致");
}
if (Objects.equals(cargoType.getId(), parent.getId())) {
throw new ServiceException("请选择上级货物类型");
}
cargoType.setParentId(parent.getId());
cargoType.setParentCargoCode(parent.getCargoCode());
}
private CargoType resolveParent(CargoType cargoType) {
if (Func.isNotEmpty(cargoType.getParentId())) {
CargoType parent = getById(cargoType.getParentId());
if (parent != null && Objects.equals(parent.getTypeLevel(), TYPE_LEVEL_ONE) && Objects.equals(parent.getIsDeleted(), 0)) {
return parent;
}
}
if (Func.isNotEmpty(cargoType.getParentCargoCode())) {
return findParentByCode(cargoType.getParentCargoCode());
}
return null;
}
private CargoType findParentByCode(String cargoCode) {
String code = trimToEmpty(cargoCode);
if (Func.isEmpty(code)) {
return null;
}
return getOne(Wrappers.<CargoType>lambdaQuery()
.eq(CargoType::getTypeLevel, TYPE_LEVEL_ONE)
.eq(CargoType::getCargoCode, code)
.eq(CargoType::getIsDeleted, 0)
.last("limit 1"));
}
private CargoType findParentByName(String cargoName) {
String name = trimToEmpty(cargoName);
if (Func.isEmpty(name)) {
return null;
}
return getOne(Wrappers.<CargoType>lambdaQuery()
.eq(CargoType::getTypeLevel, TYPE_LEVEL_ONE)
.eq(CargoType::getCargoName, name)
.eq(CargoType::getIsDeleted, 0)
.last("limit 1"));
}
private void validateUniqueCode(CargoType cargoType) {
LambdaQueryWrapper<CargoType> queryWrapper = Wrappers.<CargoType>lambdaQuery()
.eq(CargoType::getCargoCode, cargoType.getCargoCode())
.eq(CargoType::getIsDeleted, 0);
if (Func.isNotEmpty(cargoType.getId())) {
queryWrapper.ne(CargoType::getId, cargoType.getId());
}
if (count(queryWrapper) > 0L) {
throw new ServiceException("该货物类型编码已存在");
}
}
private void validateUniqueName(CargoType cargoType) {
LambdaQueryWrapper<CargoType> queryWrapper = Wrappers.<CargoType>lambdaQuery()
.eq(CargoType::getCargoName, cargoType.getCargoName())
.eq(CargoType::getTypeLevel, cargoType.getTypeLevel())
.eq(CargoType::getIsDeleted, 0);
if (Objects.equals(cargoType.getTypeLevel(), TYPE_LEVEL_TWO)) {
queryWrapper.eq(CargoType::getParentCargoCode, cargoType.getParentCargoCode());
}
if (Func.isNotEmpty(cargoType.getId())) {
queryWrapper.ne(CargoType::getId, cargoType.getId());
}
if (count(queryWrapper) > 0L) {
throw new ServiceException("该上级下已存在同名货物类型");
}
}
private CargoTypeVO toParentOption(CargoType cargoType) {
CargoTypeVO cargoTypeVO = new CargoTypeVO();
cargoTypeVO.setId(cargoType.getId());
cargoTypeVO.setCargoName(cargoType.getCargoName());
cargoTypeVO.setCargoCode(cargoType.getCargoCode());
cargoTypeVO.setTypeLevel(cargoType.getTypeLevel());
cargoTypeVO.setTypeLevelName("一级货物类型");
return cargoTypeVO;
}
private CargoTypeExportExcel toExportExcel(CargoType cargoType) {
CargoTypeExportExcel excel = new CargoTypeExportExcel();
excel.setTypeLevelName(Objects.equals(cargoType.getTypeLevel(), TYPE_LEVEL_ONE) ? "一级货物类型" : "二级货物类型");
excel.setCargoName(cargoType.getCargoName());
excel.setCargoCode(cargoType.getCargoCode());
excel.setParentCargoName("/");
excel.setParentCargoCode("/");
if (Objects.equals(cargoType.getTypeLevel(), TYPE_LEVEL_TWO)) {
CargoType parent = resolveParent(cargoType);
excel.setParentCargoName(parent == null ? "" : parent.getCargoName());
excel.setParentCargoCode(cargoType.getParentCargoCode());
}
excel.setCreateUserName(Func.isEmpty(cargoType.getCreateUser()) ? "" : UserCache.getUserRealName(cargoType.getCreateUser()));
excel.setRemark(cargoType.getRemark());
excel.setUpdateTime(cargoType.getUpdateTime());
excel.setCreateTime(cargoType.getCreateTime());
return excel;
}
private CargoTypeImportFailureExcel toImportFailureExcel(CargoTypeExcel excel, String failureReason) {
CargoTypeImportFailureExcel failureExcel = new CargoTypeImportFailureExcel();
failureExcel.setTypeLevelName(excel.getTypeLevelName());
failureExcel.setParentCargoName(excel.getParentCargoName());
failureExcel.setParentCargoCode(excel.getParentCargoCode());
failureExcel.setCargoName(excel.getCargoName());
failureExcel.setCargoCode(excel.getCargoCode());
failureExcel.setRemark(excel.getRemark());
failureExcel.setFailureReason(failureReason);
return failureExcel;
}
private String trimToEmpty(String value) {
return value == null ? "" : value.trim();
}
private String trimToNull(String value) {
String trimValue = trimToEmpty(value);
return trimValue.isEmpty() ? null : trimValue;
}
}

View File

@@ -81,6 +81,11 @@ public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currenc
prepare(currency, SOURCE_MANUAL);
validate(currency);
boolean result = saveOrUpdate(currency);
if (Func.isNotEmpty(currency.getId()) && Func.isEmpty(currency.getExchangeRate())) {
update(Wrappers.<Currency>lambdaUpdate()
.set(Currency::getExchangeRate, null)
.eq(Currency::getId, currency.getId()));
}
rebuildEnabledValidity(currency.getCode());
if (oldCurrency != null && !Objects.equals(oldCurrency.getCode(), currency.getCode())) {
rebuildEnabledValidity(oldCurrency.getCode());
@@ -110,11 +115,11 @@ public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currenc
}
@Override
public void importCurrency(List<CurrencyExcel> data) {
public List<CurrencyExcel> importCurrency(List<CurrencyExcel> data) {
if (Func.isEmpty(data)) {
throw new ServiceException("导入数据不能为空");
}
List<String> errorList = new ArrayList<>();
List<CurrencyExcel> errorList = new ArrayList<>();
int successCount = 0;
for (int index = 0; index < data.size(); index++) {
CurrencyExcel excel = data.get(index);
@@ -129,12 +134,11 @@ public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currenc
successCount++;
} catch (Exception exception) {
String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败";
errorList.add("" + (index + 2) + "行:" + message);
excel.setErrorMessage("" + (index + 2) + "行:" + message);
errorList.add(excel);
}
}
if (Func.isNotEmpty(errorList)) {
throw new ServiceException("导入成功" + successCount + "条,失败" + errorList.size() + "条:" + String.join("", errorList));
}
return errorList;
}
@Override
@@ -205,14 +209,13 @@ public class CurrencyServiceImpl extends BaseServiceImpl<CurrencyMapper, Currenc
if (currency.getDecimalPlaces() < MIN_DECIMAL_PLACES || currency.getDecimalPlaces() > MAX_DECIMAL_PLACES) {
throw new ServiceException("小数位数范围为0到8");
}
if (Func.isEmpty(currency.getExchangeRate())) {
throw new ServiceException("汇率不能为空");
}
if (currency.getExchangeRate().compareTo(BigDecimal.ZERO) <= 0) {
throw new ServiceException("汇率必须大于0");
}
if (currency.getExchangeRate().stripTrailingZeros().scale() > EXCHANGE_RATE_SCALE) {
throw new ServiceException("汇率最多保留6位小数");
if (Func.isNotEmpty(currency.getExchangeRate())) {
if (currency.getExchangeRate().compareTo(BigDecimal.ZERO) <= 0) {
throw new ServiceException("汇率必须大于0");
}
if (currency.getExchangeRate().stripTrailingZeros().scale() > EXCHANGE_RATE_SCALE) {
throw new ServiceException("汇率最多保留6位小数");
}
}
if (Func.isEmpty(currency.getEffectiveDate())) {
throw new ServiceException("生效日期不能为空");

View File

@@ -50,6 +50,7 @@ public class FeeItemServiceImpl extends BaseServiceImpl<FeeItemMapper, FeeItem>
private static final int STATUS_ENABLED = 1;
private static final int STATUS_DISABLED = 2;
private static final int FEE_CATEGORY_MAX_LENGTH = 50;
private static final int NAME_MAX_LENGTH = 50;
private static final int ENGLISH_NAME_MAX_LENGTH = 100;
@@ -86,6 +87,7 @@ public class FeeItemServiceImpl extends BaseServiceImpl<FeeItemMapper, FeeItem>
}
private void prepare(FeeItem feeItem) {
feeItem.setFeeCategory(trimToEmpty(feeItem.getFeeCategory()));
feeItem.setName(trimToEmpty(feeItem.getName()));
feeItem.setEnglishName(trimToNull(feeItem.getEnglishName()));
if (Func.isEmpty(feeItem.getStatus())) {
@@ -94,14 +96,20 @@ public class FeeItemServiceImpl extends BaseServiceImpl<FeeItemMapper, FeeItem>
}
private void validate(FeeItem feeItem) {
if (Func.isEmpty(feeItem.getFeeCategory())) {
throw new ServiceException("费用类型不能为空");
}
if (feeItem.getFeeCategory().length() > FEE_CATEGORY_MAX_LENGTH) {
throw new ServiceException("费用类型不能超过50字");
}
if (Func.isEmpty(feeItem.getName())) {
throw new ServiceException("中文名称不能为空");
throw new ServiceException("费用项不能为空");
}
if (feeItem.getName().length() > NAME_MAX_LENGTH) {
throw new ServiceException("中文名称不能超过50字");
throw new ServiceException("费用项不能超过50字");
}
if (Func.isNotEmpty(feeItem.getEnglishName()) && feeItem.getEnglishName().length() > ENGLISH_NAME_MAX_LENGTH) {
throw new ServiceException("英文名称不能超过100字");
throw new ServiceException("费用项代码不能超过100字");
}
validateUniqueName(feeItem);
}
@@ -114,7 +122,7 @@ public class FeeItemServiceImpl extends BaseServiceImpl<FeeItemMapper, FeeItem>
queryWrapper.ne(FeeItem::getId, feeItem.getId());
}
if (count(queryWrapper) > 0L) {
throw new ServiceException("中文名称已存在");
throw new ServiceException("费用项已存在");
}
}

View File

@@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.AllArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.BeanUtil;
@@ -36,12 +37,15 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.system.excel.PortTerminalExcel;
import org.springblade.system.mapper.PortTerminalMapper;
import org.springblade.system.pojo.entity.PortTerminal;
import org.springblade.system.pojo.entity.Region;
import org.springblade.system.pojo.vo.PortTerminalVO;
import org.springblade.system.service.IPortTerminalService;
import org.springblade.system.service.IRegionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@@ -54,6 +58,7 @@ import java.util.regex.Pattern;
* @author Chill
*/
@Service
@AllArgsConstructor
public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper, PortTerminal> implements IPortTerminalService {
private static final String CATEGORY_PORT = "港口";
@@ -67,6 +72,8 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
private static final int CODE_MAX_LENGTH = 30;
private static final int NAME_MAX_LENGTH = 100;
private static final int REGION_MAX_LENGTH = 50;
private static final int REGION_CODE_MAX_LENGTH = 32;
private static final int DETAIL_ADDRESS_MAX_LENGTH = 255;
private static final int REMARK_MAX_LENGTH = 200;
private static final BigDecimal MIN_LONGITUDE = new BigDecimal("-180");
private static final BigDecimal MAX_LONGITUDE = new BigDecimal("180");
@@ -75,6 +82,8 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
private static final Pattern PORT_CODE_PATTERN = Pattern.compile("^[A-Z]{5}$");
private static final Pattern TERMINAL_CODE_PATTERN = Pattern.compile("^[A-Z]{5}-[A-Z0-9]+$");
private final IRegionService regionService;
@Override
public IPage<PortTerminalVO> selectPortTerminalPage(IPage<PortTerminalVO> page, PortTerminalVO portTerminal) {
return page.setRecords(baseMapper.selectPortTerminalPage(page, portTerminal));
@@ -120,11 +129,11 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
@Override
@Transactional(rollbackFor = Exception.class)
public void importPortTerminal(List<PortTerminalExcel> data) {
public List<PortTerminalExcel> importPortTerminal(List<PortTerminalExcel> data) {
if (Func.isEmpty(data)) {
throw new ServiceException("导入数据不能为空");
}
List<String> errorList = new ArrayList<>();
List<PortTerminalExcel> errorList = new ArrayList<>();
for (int index = 0; index < data.size(); index++) {
PortTerminalExcel excel = data.get(index);
try {
@@ -136,12 +145,11 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
save(portTerminal);
} catch (Exception exception) {
String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败";
errorList.add("" + (index + 2) + "行:" + message);
excel.setErrorMessage("" + (index + 2) + "行:" + message);
errorList.add(excel);
}
}
if (Func.isNotEmpty(errorList)) {
throw new ServiceException(String.join("", errorList));
}
return errorList;
}
@Override
@@ -149,26 +157,42 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
List<PortTerminal> portTerminalList = list(queryWrapper);
return portTerminalList.stream().map(portTerminal -> {
PortTerminalExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(portTerminal, PortTerminalExcel.class));
excel.setLongitude(validRange(portTerminal.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE) ? portTerminal.getLongitude() : null);
excel.setLatitude(validRange(portTerminal.getLatitude(), MIN_LATITUDE, MAX_LATITUDE) ? portTerminal.getLatitude() : null);
excel.setRegionCode(portTerminal.getDistrictCode());
excel.setLongitude(scaleCoordinate(portTerminal.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE));
excel.setLatitude(scaleCoordinate(portTerminal.getLatitude(), MIN_LATITUDE, MAX_LATITUDE));
excel.setDataSource(normalizeDataSource(portTerminal.getDataSource()));
excel.setStatusName(Objects.equals(portTerminal.getStatus(), STATUS_ENABLED) ? "启用" : "停用");
return excel;
}).toList();
}
private BigDecimal scaleCoordinate(BigDecimal value, BigDecimal min, BigDecimal max) {
if (Func.isEmpty(value)) {
return null;
}
return validRange(value, min, max) ? value.setScale(6, RoundingMode.HALF_UP) : null;
}
private void prepare(PortTerminal portTerminal, String defaultDataSource) {
portTerminal.setCode(trimToEmpty(portTerminal.getCode()).toUpperCase(Locale.ROOT));
portTerminal.setCategory(trimToEmpty(portTerminal.getCategory()));
portTerminal.setName(trimToEmpty(portTerminal.getName()));
portTerminal.setCountry(trimToEmpty(portTerminal.getCountry()));
portTerminal.setCity(trimToEmpty(portTerminal.getCity()));
portTerminal.setDistrictCode(trimToNull(portTerminal.getDistrictCode()));
portTerminal.setDistrictName(trimToNull(portTerminal.getDistrictName()));
portTerminal.setRegionCode(trimToNull(portTerminal.getRegionCode()));
if (Func.isEmpty(portTerminal.getDistrictCode()) && Func.isNotEmpty(portTerminal.getRegionCode())) {
portTerminal.setDistrictCode(portTerminal.getRegionCode());
}
portTerminal.setDetailAddress(trimToNull(portTerminal.getDetailAddress()));
portTerminal.setRemark(trimToNull(portTerminal.getRemark()));
portTerminal.setDataSource(normalizeDataSource(Func.toStrWithEmpty(portTerminal.getDataSource(), defaultDataSource)));
if (Func.isEmpty(portTerminal.getStatus())) {
portTerminal.setStatus(STATUS_ENABLED);
}
if (CATEGORY_PORT.equals(portTerminal.getCategory())) {
fillRegion(portTerminal);
portTerminal.setParentId(null);
portTerminal.setParentCode(null);
portTerminal.setParentName(null);
@@ -199,6 +223,50 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
portTerminal.setParentName(parent.getName());
portTerminal.setCountry(parent.getCountry());
portTerminal.setCity(parent.getCity());
portTerminal.setDistrictCode(parent.getDistrictCode());
portTerminal.setDistrictName(parent.getDistrictName());
portTerminal.setRegionCode(parent.getDistrictCode());
}
private void fillRegion(PortTerminal portTerminal) {
Region district = null;
if (Func.isNotEmpty(portTerminal.getDistrictCode())) {
district = regionService.getById(portTerminal.getDistrictCode());
}
if (Func.isEmpty(district) && Func.isNotEmpty(portTerminal.getDistrictName())) {
if (Func.isNotEmpty(portTerminal.getCity())) {
List<Region> cityList = regionService.list(Wrappers.<Region>lambdaQuery()
.eq(Region::getName, portTerminal.getCity())
.eq(Region::getRegionLevel, 2));
for (Region city : cityList) {
district = regionService.getOne(Wrappers.<Region>lambdaQuery()
.eq(Region::getParentCode, city.getCode())
.eq(Region::getName, portTerminal.getDistrictName()), false);
if (Func.isNotEmpty(district)) {
break;
}
}
}
if (Func.isEmpty(district)) {
district = regionService.getOne(Wrappers.<Region>lambdaQuery()
.eq(Region::getName, portTerminal.getDistrictName())
.eq(Region::getRegionLevel, 3), false);
}
}
if (Func.isEmpty(district)) {
throw new ServiceException("请选择区县");
}
Region city = regionService.getById(district.getParentCode());
if (Func.isEmpty(city)) {
throw new ServiceException("区县所属城市不存在");
}
if (Func.isNotEmpty(portTerminal.getCity()) && !Objects.equals(portTerminal.getCity(), city.getName())) {
throw new ServiceException("区县与城市不匹配");
}
portTerminal.setCity(city.getName());
portTerminal.setDistrictCode(district.getCode());
portTerminal.setDistrictName(district.getName());
portTerminal.setRegionCode(district.getCode());
}
private void validate(PortTerminal portTerminal) {
@@ -215,6 +283,9 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
validateLength(portTerminal.getName(), NAME_MAX_LENGTH, "港口/码头名称不能超过100字");
validateLength(portTerminal.getCountry(), REGION_MAX_LENGTH, "国家不能超过50字");
validateLength(portTerminal.getCity(), REGION_MAX_LENGTH, "城市不能超过50字");
validateLength(portTerminal.getDistrictName(), REGION_MAX_LENGTH, "区县不能超过50字");
validateLength(portTerminal.getRegionCode(), REGION_CODE_MAX_LENGTH, "行政区划编码不能超过32字");
validateLength(portTerminal.getDetailAddress(), DETAIL_ADDRESS_MAX_LENGTH, "详细地址不能超过255字");
validateLength(portTerminal.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200个字");
if (CATEGORY_PORT.equals(portTerminal.getCategory()) && !PORT_CODE_PATTERN.matcher(portTerminal.getCode()).matches()) {
throw new ServiceException("港口编码为5位大写字母");
@@ -231,6 +302,9 @@ public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper,
if (Func.isEmpty(portTerminal.getCity())) {
throw new ServiceException("城市不能为空");
}
if (Func.isEmpty(portTerminal.getDistrictCode())) {
throw new ServiceException("区县不能为空");
}
validateDataSource(portTerminal.getDataSource());
validateStatus(portTerminal.getStatus());
validateRange(portTerminal.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE, "经度范围为 -180 到 180");

View File

@@ -45,6 +45,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@@ -68,12 +69,15 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
private static final String SOURCE_MANUAL = "手动";
private static final String SOURCE_MANUAL_RECORD = "手动录入";
private static final String SOURCE_MANUAL_OLD = "手工导入";
private static final String DEFAULT_COUNTRY_CODE = "+86";
private static final int STATUS_ENABLED = 1;
private static final int STATUS_DISABLED = 2;
private static final int CODE_MAX_LENGTH = 20;
private static final int NAME_MAX_LENGTH = 100;
private static final int NAME_MAX_LENGTH = 50;
private static final int RAILWAY_LINE_MAX_LENGTH = 100;
private static final int REGION_NAME_MAX_LENGTH = 128;
private static final int REGION_CODE_MAX_LENGTH = 32;
private static final int DETAIL_ADDRESS_MAX_LENGTH = 255;
private static final int REMARK_MAX_LENGTH = 200;
private static final Pattern TMIS_CODE_PATTERN = Pattern.compile("^\\d{5}$");
private static final Pattern TELEGRAPH_CODE_PATTERN = Pattern.compile("^[A-Z]{3}$");
@@ -118,15 +122,17 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
@Override
@Transactional(rollbackFor = Exception.class)
public void importRailwayStation(List<RailwayStationExcel> data) {
public List<RailwayStationExcel> importRailwayStation(List<RailwayStationExcel> data) {
if (Func.isEmpty(data)) {
throw new ServiceException("导入数据不能为空");
}
List<String> errorList = new ArrayList<>();
List<RailwayStationExcel> errorList = new ArrayList<>();
for (int index = 0; index < data.size(); index++) {
RailwayStationExcel excel = data.get(index);
try {
RailwayStation railwayStation = Objects.requireNonNull(BeanUtil.copyProperties(excel, RailwayStation.class));
railwayStation.setLongitude(parseCoordinate(excel.getLongitude(), "经度"));
railwayStation.setLatitude(parseCoordinate(excel.getLatitude(), "纬度"));
railwayStation.setDataSource(SOURCE_BATCH);
railwayStation.setStatus(STATUS_ENABLED);
prepare(railwayStation, SOURCE_BATCH);
@@ -134,12 +140,11 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
save(railwayStation);
} catch (Exception exception) {
String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败";
errorList.add("" + (index + 2) + "行:" + message);
excel.setErrorMessage("" + (index + 2) + "行:" + message);
errorList.add(excel);
}
}
if (Func.isNotEmpty(errorList)) {
throw new ServiceException(String.join("", errorList));
}
return errorList;
}
@Override
@@ -147,12 +152,33 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
List<RailwayStation> railwayStationList = list(queryWrapper);
return railwayStationList.stream().map(railwayStation -> {
RailwayStationExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(railwayStation, RailwayStationExcel.class));
excel.setLongitude(formatCoordinate(railwayStation.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE));
excel.setLatitude(formatCoordinate(railwayStation.getLatitude(), MIN_LATITUDE, MAX_LATITUDE));
excel.setDataSource(normalizeDataSource(railwayStation.getDataSource()));
excel.setStatusName(Objects.equals(railwayStation.getStatus(), STATUS_ENABLED) ? "启用" : "停用");
return excel;
}).toList();
}
private String formatCoordinate(BigDecimal value, BigDecimal min, BigDecimal max) {
if (Func.isEmpty(value)) {
return null;
}
return validRange(value, min, max) ? value.setScale(6, RoundingMode.HALF_UP).toPlainString() : null;
}
private BigDecimal parseCoordinate(String value, String name) {
String trimValue = trimToEmpty(value);
if (trimValue.isEmpty()) {
return null;
}
try {
return new BigDecimal(trimValue);
} catch (NumberFormatException exception) {
throw new ServiceException(name + "范围不正确");
}
}
private void prepare(RailwayStation railwayStation, String defaultDataSource) {
railwayStation.setTmisCode(trimToEmpty(railwayStation.getTmisCode()));
railwayStation.setCode(CODE_PREFIX + railwayStation.getTmisCode());
@@ -163,6 +189,17 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
railwayStation.setProvinceName(trimToNull(railwayStation.getProvinceName()));
railwayStation.setCityCode(trimToNull(railwayStation.getCityCode()));
railwayStation.setCityName(trimToNull(railwayStation.getCityName()));
railwayStation.setDistrictCode(trimToNull(railwayStation.getDistrictCode()));
railwayStation.setDistrictName(trimToNull(railwayStation.getDistrictName()));
railwayStation.setRegionCode(trimToNull(railwayStation.getRegionCode()));
railwayStation.setRegionName(trimToNull(railwayStation.getRegionName()));
if (Func.isEmpty(railwayStation.getDistrictCode()) && Func.isNotEmpty(railwayStation.getRegionCode())) {
railwayStation.setDistrictCode(railwayStation.getRegionCode());
}
if (Func.isEmpty(railwayStation.getDistrictName()) && Func.isNotEmpty(railwayStation.getRegionName())) {
railwayStation.setDistrictName(railwayStation.getRegionName());
}
railwayStation.setDetailAddress(trimToNull(railwayStation.getDetailAddress()));
railwayStation.setRemark(trimToNull(railwayStation.getRemark()));
railwayStation.setDataSource(normalizeDataSource(Func.toStrWithEmpty(railwayStation.getDataSource(), defaultDataSource)));
if (Func.isEmpty(railwayStation.getStatus())) {
@@ -179,29 +216,39 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
throw new ServiceException("TMIS国标编码为5位数字");
}
if (Func.isEmpty(railwayStation.getTelegraphCode())) {
throw new ServiceException("电报码不能为空");
throw new ServiceException("电报码格式不正确或已存在");
}
if (!TELEGRAPH_CODE_PATTERN.matcher(railwayStation.getTelegraphCode()).matches()) {
throw new ServiceException("电报码为3位大写字母");
throw new ServiceException("电报码格式不正确或已存在");
}
if (Func.isEmpty(railwayStation.getName())) {
throw new ServiceException("车站名称不能为空");
throw new ServiceException("请输入车站名称");
}
validateLength(railwayStation.getCode(), CODE_MAX_LENGTH, "编码不能超过20字");
validateLength(railwayStation.getName(), NAME_MAX_LENGTH, "车站名称不能超过100字");
validateLength(railwayStation.getRailwayLine(), RAILWAY_LINE_MAX_LENGTH, "所属铁路线路不能超过100字");
validateLength(railwayStation.getName(), NAME_MAX_LENGTH, "请输入车站名称");
// validateLength(railwayStation.getRailwayLine(), RAILWAY_LINE_MAX_LENGTH, "所属铁路线路不能超过100字");
validateLength(railwayStation.getProvinceName(), REGION_NAME_MAX_LENGTH, "所属省份不能超过128字");
validateLength(railwayStation.getCityName(), REGION_NAME_MAX_LENGTH, "所属城市不能超过128字");
validateLength(railwayStation.getDistrictName(), REGION_NAME_MAX_LENGTH, "所属区县不能超过128字");
validateLength(railwayStation.getRegionCode(), REGION_CODE_MAX_LENGTH, "行政区划编码不能超过32字");
validateLength(railwayStation.getRegionName(), REGION_NAME_MAX_LENGTH, "行政区划不能超过128字");
validateLength(railwayStation.getDetailAddress(), DETAIL_ADDRESS_MAX_LENGTH, "详细地址不能超过255字");
validateLength(railwayStation.getRemark(), REMARK_MAX_LENGTH, "备注不能超过200字");
if (Func.isEmpty(railwayStation.getProvinceCode()) || Func.isEmpty(railwayStation.getCityCode())) {
throw new ServiceException("请选择省份和城市");
if (Func.isEmpty(railwayStation.getProvinceCode())) {
throw new ServiceException("请选择所属省份");
}
if (Func.isEmpty(railwayStation.getCityCode())) {
throw new ServiceException("请选择所属城市");
}
if (Func.isEmpty(railwayStation.getDistrictCode())) {
throw new ServiceException("请选择所属区县");
}
validateCoordinate(railwayStation.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE, "经度");
validateCoordinate(railwayStation.getLatitude(), MIN_LATITUDE, MAX_LATITUDE, "纬度");
validateDataSource(railwayStation.getDataSource());
validateStatus(railwayStation.getStatus());
validateUnique(railwayStation, RailwayStation::getTmisCode, railwayStation.getTmisCode(), "该TMIS编码已存在");
validateUnique(railwayStation, RailwayStation::getTelegraphCode, railwayStation.getTelegraphCode(), "电报码已存在");
validateUnique(railwayStation, RailwayStation::getTelegraphCode, railwayStation.getTelegraphCode(), "电报码格式不正确或已存在");
validateUnique(railwayStation, RailwayStation::getCode, railwayStation.getCode(), "该编码已存在");
}
@@ -212,11 +259,11 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
}
if (Func.isEmpty(province) && Func.isNotEmpty(railwayStation.getProvinceName())) {
province = regionService.getOne(Wrappers.<Region>lambdaQuery()
.eq(Region::getParentCode, "00")
.eq(Region::getParentCode, DEFAULT_COUNTRY_CODE)
.eq(Region::getName, railwayStation.getProvinceName()), false);
}
if (Func.isEmpty(province)) {
throw new ServiceException("请选择省份");
throw new ServiceException("请选择所属省份");
}
Region city = null;
@@ -229,7 +276,7 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
.eq(Region::getName, railwayStation.getCityName()), false);
}
if (Func.isEmpty(city)) {
throw new ServiceException("请选择城市");
throw new ServiceException("请选择所属城市");
}
if (!Objects.equals(city.getParentCode(), province.getCode())) {
throw new ServiceException("所属城市与所属省份不匹配");
@@ -238,6 +285,26 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
railwayStation.setProvinceName(province.getName());
railwayStation.setCityCode(city.getCode());
railwayStation.setCityName(city.getName());
Region district = null;
if (Func.isNotEmpty(railwayStation.getDistrictCode())) {
district = regionService.getById(railwayStation.getDistrictCode());
}
if (Func.isEmpty(district) && Func.isNotEmpty(railwayStation.getDistrictName())) {
district = regionService.getOne(Wrappers.<Region>lambdaQuery()
.eq(Region::getParentCode, city.getCode())
.eq(Region::getName, railwayStation.getDistrictName()), false);
}
if (Func.isEmpty(district)) {
throw new ServiceException("请选择所属区县");
}
if (!Objects.equals(district.getParentCode(), city.getCode())) {
throw new ServiceException("所属区县与所属城市不匹配");
}
railwayStation.setDistrictCode(district.getCode());
railwayStation.setDistrictName(district.getName());
railwayStation.setRegionCode(district.getCode());
railwayStation.setRegionName(district.getName());
}
private void validateCoordinate(BigDecimal value, BigDecimal min, BigDecimal max, String name) {
@@ -245,10 +312,14 @@ public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMap
return;
}
if (value.compareTo(min) < 0 || value.compareTo(max) > 0) {
throw new ServiceException(name + ("经度".equals(name) ? "范围为 -180 到 180" : "范围为 -90 到 90"));
throw new ServiceException(name + "范围不正确");
}
}
private boolean validRange(BigDecimal value, BigDecimal min, BigDecimal max) {
return Func.isEmpty(value) || (value.compareTo(min) >= 0 && value.compareTo(max) <= 0);
}
private void validateDataSource(String dataSource) {
if (!SOURCE_INITIAL.equals(dataSource) && !SOURCE_BATCH.equals(dataSource) && !SOURCE_MANUAL.equals(dataSource)) {
throw new ServiceException("数据来源不正确");

View File

@@ -57,28 +57,37 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
@Override
public boolean submit(Region region) {
// 设置市级编号格式
String regionCode = region.getCode();
String regionParentCode = region.getParentCode();
if (regionCode.startsWith(MAIN_CODE)) {
region.setCode(StringUtil.removePrefix(regionCode, MAIN_CODE));
}
if (regionParentCode.startsWith(MAIN_CODE)) {
region.setParentCode(StringUtil.removePrefix(regionParentCode, MAIN_CODE));
}
// 查询是否已存在
Long cnt = baseMapper.selectCount(Wrappers.<Region>query().lambda().eq(Region::getCode, region.getCode()));
if (cnt > 0L) {
return this.updateById(region);
Integer level = region.getRegionLevel();
if (level != null && level == COUNTRY_LEVEL) {
region.setParentCode(ROOT_PARENT_CODE);
region.setAncestors(ROOT_PARENT_CODE);
} else {
if (LEGACY_MAIN_CODE.equals(regionParentCode)) {
region.setParentCode(MAIN_CODE);
}
if (StringUtil.isNotBlank(regionCode) && regionCode.startsWith(LEGACY_MAIN_CODE)) {
region.setCode(StringUtil.removePrefix(regionCode, LEGACY_MAIN_CODE));
}
if (MAIN_CODE.equals(region.getParentCode())
&& StringUtil.isNotBlank(region.getCode())
&& region.getCode().startsWith(MAIN_CODE)) {
region.setCode(StringUtil.removePrefix(region.getCode(), MAIN_CODE));
}
}
validateUniqueCode(region);
// 设置祖区划编号
Region parent = getByCode(region.getParentCode());
if (Func.isNotEmpty(parent) && Func.isNotEmpty(parent.getCode())) {
String ancestors = parent.getAncestors() + StringPool.COMMA + parent.getCode();
String ancestors = parent.getRegionLevel() != null && parent.getRegionLevel() == COUNTRY_LEVEL
? parent.getCode()
: parent.getAncestors() + StringPool.COMMA + parent.getCode();
region.setAncestors(ancestors);
} else if (MAIN_CODE.equals(region.getParentCode())) {
region.setAncestors(MAIN_CODE);
}
// 设置省、市、区、镇、村
Integer level = region.getRegionLevel();
String code = region.getCode();
String name = region.getName();
if (level == PROVINCE_LEVEL) {
@@ -97,7 +106,22 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
region.setVillageCode(code);
region.setVillageName(name);
}
return this.save(region);
return StringUtil.isNotBlank(region.getOriginalCode()) ? this.updateById(region) : this.save(region);
}
private void validateUniqueCode(Region region) {
String originalCode = region.getOriginalCode();
String code = region.getCode();
Region existRegion = this.getById(code);
if (Func.isEmpty(existRegion)) {
if (StringUtil.isNotBlank(originalCode) && !StringUtil.equals(code, originalCode)) {
throw new ServiceException("区划编号不允许修改");
}
return;
}
if (StringUtil.isBlank(originalCode) || !StringUtil.equals(code, originalCode)) {
throw new ServiceException("该区划编号已存在");
}
}
@Override
@@ -115,22 +139,31 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
}
@Override
public List<RegionVO> lazyTree(String parentCode, Map<String, Object> param) {
public List<Map<String, Object>> lazyTree(String parentCode, Map<String, Object> param) {
return baseMapper.lazyTree(parentCode, param);
}
@Override
public void importRegion(List<RegionExcel> data, Boolean isCovered) {
List<Region> list = new ArrayList<>();
data.forEach(regionExcel -> {
Region region = BeanUtil.copyProperties(regionExcel, Region.class);
list.add(region);
});
if (isCovered) {
this.saveOrUpdateBatch(list);
} else {
this.saveBatch(list);
public List<RegionExcel> importRegion(List<RegionExcel> data, Boolean isCovered) {
if (Func.isEmpty(data)) {
throw new ServiceException("导入数据不能为空");
}
List<RegionExcel> errorList = new ArrayList<>();
for (int index = 0; index < data.size(); index++) {
RegionExcel excel = data.get(index);
try {
Region region = BeanUtil.copyProperties(excel, Region.class);
if (Boolean.TRUE.equals(isCovered)) {
this.saveOrUpdate(region);
} else {
this.save(region);
}
} catch (Exception exception) {
excel.setErrorMessage("" + (index + 2) + "行:" + exception.getMessage());
errorList.add(excel);
}
}
return errorList;
}
@Override

View File

@@ -47,6 +47,7 @@ public class AirportMasterWrapper extends BaseEntityWrapper<AirportMaster, Airpo
@Override
public AirportMasterVO entityVO(AirportMaster airportMaster) {
AirportMasterVO airportMasterVO = Objects.requireNonNull(BeanUtil.copyProperties(airportMaster, AirportMasterVO.class));
airportMasterVO.setRegionCode(airportMaster.getDistrictCode());
airportMasterVO.setUpdateUserName(UserCache.getUserRealName(airportMaster.getUpdateUser()));
return airportMasterVO;
}

View File

@@ -0,0 +1,57 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.UserCache;
import org.springblade.system.pojo.entity.CargoType;
import org.springblade.system.pojo.vo.CargoTypeVO;
import java.util.Objects;
/**
* 货物类型包装类
*
* @author Chill
*/
public class CargoTypeWrapper extends BaseEntityWrapper<CargoType, CargoTypeVO> {
public static CargoTypeWrapper build() {
return new CargoTypeWrapper();
}
@Override
public CargoTypeVO entityVO(CargoType cargoType) {
CargoTypeVO cargoTypeVO = Objects.requireNonNull(BeanUtil.copyProperties(cargoType, CargoTypeVO.class));
cargoTypeVO.setTypeLevelName(Objects.equals(cargoType.getTypeLevel(), 1) ? "一级货物类型" : "二级货物类型");
cargoTypeVO.setCreateUserName(Func.isEmpty(cargoType.getCreateUser()) ? "" : UserCache.getUserRealName(cargoType.getCreateUser()));
cargoTypeVO.setUpdateUserName(Func.isEmpty(cargoType.getUpdateUser()) ? "" : UserCache.getUserRealName(cargoType.getUpdateUser()));
return cargoTypeVO;
}
}

View File

@@ -27,6 +27,7 @@ package org.springblade.system.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.UserCache;
import org.springblade.system.pojo.entity.Currency;
import org.springblade.system.pojo.vo.CurrencyVO;
@@ -45,7 +46,9 @@ public class CurrencyWrapper extends BaseEntityWrapper<Currency, CurrencyVO> {
@Override
public CurrencyVO entityVO(Currency currency) {
return Objects.requireNonNull(BeanUtil.copyProperties(currency, CurrencyVO.class));
CurrencyVO currencyVO = Objects.requireNonNull(BeanUtil.copyProperties(currency, CurrencyVO.class));
currencyVO.setUpdateUserName(UserCache.getUserRealName(currency.getUpdateUser()));
return currencyVO;
}
}

View File

@@ -47,6 +47,7 @@ public class PortTerminalWrapper extends BaseEntityWrapper<PortTerminal, PortTer
@Override
public PortTerminalVO entityVO(PortTerminal portTerminal) {
PortTerminalVO portTerminalVO = Objects.requireNonNull(BeanUtil.copyProperties(portTerminal, PortTerminalVO.class));
portTerminalVO.setRegionCode(portTerminal.getDistrictCode());
portTerminalVO.setUpdateUserName(UserCache.getUserRealName(portTerminal.getUpdateUser()));
return portTerminalVO;
}

View File

@@ -47,6 +47,7 @@ public class RailwayStationWrapper extends BaseEntityWrapper<RailwayStation, Rai
@Override
public RailwayStationVO entityVO(RailwayStation railwayStation) {
RailwayStationVO railwayStationVO = Objects.requireNonNull(BeanUtil.copyProperties(railwayStation, RailwayStationVO.class));
railwayStationVO.setRegionCode(railwayStation.getDistrictCode());
railwayStationVO.setUpdateUserName(UserCache.getUserRealName(railwayStation.getUpdateUser()));
return railwayStationVO;
}

View File

@@ -35,6 +35,8 @@ import org.springblade.system.pojo.vo.RegionVO;
import java.util.List;
import java.util.Objects;
import static org.springblade.system.cache.RegionCache.ROOT_PARENT_CODE;
/**
* 包装类,返回视图层所需的字段
*
@@ -50,7 +52,11 @@ public class RegionWrapper extends BaseEntityWrapper<Region, RegionVO> {
public RegionVO entityVO(Region region) {
RegionVO regionVO = Objects.requireNonNull(BeanUtil.copyProperties(region, RegionVO.class));
Region parentRegion = RegionCache.getByCode(region.getParentCode());
regionVO.setParentName(parentRegion.getName());
if (Objects.nonNull(parentRegion)) {
regionVO.setParentName(parentRegion.getName());
} else if (ROOT_PARENT_CODE.equals(region.getParentCode())) {
regionVO.setParentName("根节点");
}
return regionVO;
}

View File

@@ -126,9 +126,12 @@ public class AccidentRecordController extends BladeController {
@PostMapping("/import-accident-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入事故记录", description = "传入excel")
public R importAccidentRecord(MultipartFile file) {
AccidentRecordImporter accidentRecordImporter = new AccidentRecordImporter(accidentRecordService);
ExcelUtil.save(file, accidentRecordImporter, AccidentRecordExcel.class);
public R importAccidentRecord(MultipartFile file, HttpServletResponse response) {
List<AccidentRecordExcel> failureList = accidentRecordService.importAccidentRecord(ExcelUtil.read(file, AccidentRecordExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "事故记录导入失败明细" + DateUtil.time(), "导入失败明细", failureList, AccidentRecordExcel.class);
return null;
}
return R.success("操作成功");
}

View File

@@ -111,9 +111,12 @@ public class AnnualInspectionRecordController extends BladeController {
@PostMapping("/import-annual-inspection-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入年检记录", description = "传入excel")
public R importAnnualInspectionRecord(MultipartFile file) {
AnnualInspectionRecordImporter annualInspectionRecordImporter = new AnnualInspectionRecordImporter(annualInspectionRecordService);
ExcelUtil.save(file, annualInspectionRecordImporter, AnnualInspectionRecordExcel.class);
public R importAnnualInspectionRecord(MultipartFile file, HttpServletResponse response) {
List<AnnualInspectionRecordExcel> failureList = annualInspectionRecordService.importAnnualInspectionRecord(ExcelUtil.read(file, AnnualInspectionRecordExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "年检记录导入失败明细" + DateUtil.time(), "导入失败明细", failureList, AnnualInspectionRecordExcel.class);
return null;
}
return R.success("操作成功");
}

View File

@@ -0,0 +1,128 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.common.excel.ImportFailureExcelUtil;
import org.springblade.transport.excel.CommonCargoExcel;
import org.springblade.transport.excel.CommonCargoExportExcel;
import org.springblade.transport.excel.CommonCargoImportFailureExcel;
import org.springframework.web.multipart.MultipartFile;
import org.springblade.transport.pojo.entity.CommonCargo;
import org.springblade.transport.pojo.vo.BusinessRemoveResultVO;
import org.springblade.transport.pojo.vo.CommonCargoVO;
import org.springblade.transport.service.ICommonCargoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* 常用货物 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "common_cargo")
@RequestMapping("/common-cargo")
@Tag(name = "常用货物", description = "常用货物")
public class CommonCargoController extends BladeController {
private final ICommonCargoService commonCargoService;
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入id")
public R<CommonCargoVO> detail(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.data(commonCargoService.detail(id));
}
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入commonCargo")
public R<IPage<CommonCargoVO>> list(CommonCargoVO commonCargo, Query query) {
return R.data(commonCargoService.selectCommonCargoPage(Condition.getPage(query), commonCargo));
}
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入commonCargo")
public R submit(@RequestBody CommonCargo commonCargo) {
return R.status(commonCargoService.submit(commonCargo));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R<BusinessRemoveResultVO> remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.data(commonCargoService.removeCommonCargo(ids));
}
@GetMapping("/export-common-cargo")
@ApiOperationSupport(order = 5)
@Operation(summary = "导出常用货物")
public void exportCommonCargo(CommonCargoVO commonCargo, @RequestParam(required = false) String ids, HttpServletResponse response) {
List<CommonCargoExportExcel> list = commonCargoService.exportCommonCargo(commonCargo, ids);
ExcelUtil.export(response, "常用货物" + DateUtil.time(), "常用货物", list, CommonCargoExportExcel.class);
}
@PostMapping("/import-common-cargo")
@ApiOperationSupport(order = 6)
@Operation(summary = "导入常用货物", description = "传入excel")
public R importCommonCargo(MultipartFile file, HttpServletResponse response) {
List<CommonCargoImportFailureExcel> failureList = commonCargoService.importCommonCargo(ExcelUtil.read(file, CommonCargoExcel.class));
if (Func.isNotEmpty(failureList)) {
ImportFailureExcelUtil.export(response, "常用货物导入失败明细" + DateUtil.time(), "导入失败明细", failureList, CommonCargoExcel.class);
return null;
}
return R.success("导入数据成功");
}
@GetMapping("/export-template")
@ApiOperationSupport(order = 7)
@Operation(summary = "导出模板")
public void exportTemplate(HttpServletResponse response) {
ExcelUtil.export(response, "常用货物模板", "常用货物导入模板", new ArrayList<CommonCargoExcel>(), CommonCargoExcel.class);
}
}

View File

@@ -0,0 +1,105 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.transport.excel.CommonRouteExcel;
import org.springblade.transport.pojo.entity.CommonRoute;
import org.springblade.transport.pojo.vo.BusinessRemoveResultVO;
import org.springblade.transport.pojo.vo.CommonRouteVO;
import org.springblade.transport.service.ICommonRouteService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* 常用线路 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "common_route")
@RequestMapping("/common-route")
@Tag(name = "常用线路", description = "常用线路")
public class CommonRouteController extends BladeController {
private final ICommonRouteService commonRouteService;
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入id")
public R<CommonRouteVO> detail(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.data(commonRouteService.detail(id));
}
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入commonRoute")
public R<IPage<CommonRouteVO>> list(CommonRouteVO commonRoute, Query query) {
return R.data(commonRouteService.selectCommonRoutePage(Condition.getPage(query), commonRoute));
}
@PostMapping("/submit")
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入commonRoute")
public R submit(@RequestBody CommonRoute commonRoute) {
return R.status(commonRouteService.submit(commonRoute));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "逻辑删除", description = "传入ids")
public R<BusinessRemoveResultVO> remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.data(commonRouteService.removeCommonRoute(ids));
}
@GetMapping("/export-common-route")
@ApiOperationSupport(order = 5)
@Operation(summary = "导出常用线路")
public void exportCommonRoute(CommonRouteVO commonRoute, @RequestParam(required = false) String ids, HttpServletResponse response) {
List<CommonRouteExcel> list = commonRouteService.exportCommonRoute(commonRoute, ids);
ExcelUtil.export(response, "常用线路" + DateUtil.time(), "常用线路", list, CommonRouteExcel.class);
}
}

View File

@@ -0,0 +1,175 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.transport.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.transport.excel.ContractManageExcel;
import org.springblade.transport.pojo.entity.ContractManage;
import org.springblade.transport.pojo.vo.ContractManageVO;
import org.springblade.transport.service.IContractManageService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* 合同管理 控制器
*
* @author Chill
*/
@RestController
@AllArgsConstructor
@PreAuth(menu = "contract_manage")
@RequestMapping("/contract-manage")
@Tag(name = "合同管理", description = "合同管理")
public class ContractManageController extends BladeController {
private final IContractManageService contractManageService;
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入id")
public R<ContractManageVO> detail(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.data(contractManageService.detail(id));
}
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入contractManage")
public R<IPage<ContractManageVO>> list(ContractManageVO contractManage, Query query) {
return R.data(contractManageService.selectContractManagePage(Condition.getPage(query), contractManage));
}
@PostMapping("/save-draft")
@ApiOperationSupport(order = 3)
@Operation(summary = "保存草稿", description = "传入contractManage")
public R saveDraft(@RequestBody ContractManage contractManage) {
return R.status(contractManageService.saveDraft(contractManage));
}
@PostMapping("/submit")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增或修改", description = "传入contractManage")
public R submit(@RequestBody ContractManage contractManage) {
return R.status(contractManageService.submit(contractManage));
}
@PostMapping("/to-temporary")
@ApiOperationSupport(order = 5)
@Operation(summary = "转临时合同", description = "传入id")
public R toTemporary(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.status(contractManageService.toTemporary(id));
}
@PostMapping("/submit-formal")
@ApiOperationSupport(order = 6)
@Operation(summary = "提交正式合同", description = "传入id")
public R submitFormal(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.status(contractManageService.submitFormal(id));
}
@PostMapping("/approve")
@ApiOperationSupport(order = 7)
@Operation(summary = "审批通过", description = "传入id")
public R approve(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.status(contractManageService.approve(id));
}
@PostMapping("/reject")
@ApiOperationSupport(order = 8)
@Operation(summary = "审批驳回", description = "传入id")
public R reject(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.status(contractManageService.reject(id));
}
@PostMapping("/withdraw")
@ApiOperationSupport(order = 9)
@Operation(summary = "撤回审批", description = "传入id")
public R withdraw(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.status(contractManageService.withdraw(id));
}
@PostMapping("/start-change")
@ApiOperationSupport(order = 10)
@Operation(summary = "发起变更", description = "传入id、changeContent和changeReason")
public R startChange(@Parameter(description = "主键", required = true) @RequestParam Long id,
@RequestParam String changeContent,
@RequestParam String changeReason) {
return R.status(contractManageService.startChange(id, changeContent, changeReason));
}
@PostMapping("/terminate")
@ApiOperationSupport(order = 11)
@Operation(summary = "终止合同", description = "传入id和reason")
public R terminate(@Parameter(description = "主键", required = true) @RequestParam Long id, @RequestParam(required = false) String reason) {
return R.status(contractManageService.terminate(id, reason));
}
@PostMapping("/copy")
@ApiOperationSupport(order = 12)
@Operation(summary = "复制合同", description = "传入id")
public R<ContractManageVO> copy(@Parameter(description = "主键", required = true) @RequestParam Long id) {
return R.data(contractManageService.copy(id));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 13)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(contractManageService.removeDraft(ids));
}
@GetMapping("/expire-stats")
@ApiOperationSupport(order = 14)
@Operation(summary = "到期统计", description = "传入contractManage")
public R<Map<String, Long>> expireStats(ContractManageVO contractManage) {
return R.data(contractManageService.expireStats(contractManage));
}
@GetMapping("/export-contract-manage")
@ApiOperationSupport(order = 15)
@Operation(summary = "导出合同管理")
public void exportContractManage(ContractManageVO contractManage, @RequestParam(required = false) String ids, HttpServletResponse response) {
List<ContractManageExcel> list = contractManageService.exportContractManage(contractManage, ids);
ExcelUtil.export(response, "合同管理" + DateUtil.time(), "合同管理", list, ContractManageExcel.class);
}
}

View File

@@ -137,9 +137,12 @@ public class CreditScoreQuantificationController extends BladeController {
@PostMapping("/import-credit-score-quantification")
@ApiOperationSupport(order = 7)
@Operation(summary = "导入评分量化表", description = "传入excel")
public R importCreditScoreQuantification(MultipartFile file) {
CreditScoreQuantificationImporter importer = new CreditScoreQuantificationImporter(creditScoreQuantificationService);
ExcelUtil.save(file, importer, CreditScoreQuantificationExcel.class);
public R importCreditScoreQuantification(MultipartFile file, HttpServletResponse response) {
List<CreditScoreQuantificationExcel> failureList = creditScoreQuantificationService.importCreditScoreQuantification(ExcelUtil.read(file, CreditScoreQuantificationExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "评分量化表导入失败明细" + DateUtil.time(), "导入失败明细", failureList, CreditScoreQuantificationExcel.class);
return null;
}
return R.success("操作成功");
}

View File

@@ -95,7 +95,8 @@ public class CustomerArchiveController extends BladeController {
@ApiOperationSupport(order = 3)
@Operation(summary = "新增或修改", description = "传入customerArchive")
public R submit(@RequestBody CustomerArchiveVO customerArchive) {
return R.status(customerArchiveService.submit(customerArchive));
boolean result = customerArchiveService.submit(customerArchive);
return result ? R.data(customerArchive.getId()) : R.status(false);
}
/**

View File

@@ -75,6 +75,24 @@ public class DriverController extends BladeController {
private static final int DEFAULT_CURRENT = 1;
private static final int DEFAULT_SIZE = 10;
private static final int MAX_SIZE = 100;
private static final String EXPIRY_EXPIRED_SQL = """
(
((driving_license_long_term IS NULL OR driving_license_long_term != 1) AND driving_license_end_date < {0})
OR ((qualification_long_term IS NULL OR qualification_long_term != 1) AND qualification_end_date < {0})
)
""";
private static final String EXPIRY_WITHIN_30_SQL = """
(
NOT (
((driving_license_long_term IS NULL OR driving_license_long_term != 1) AND driving_license_end_date < {0})
OR ((qualification_long_term IS NULL OR qualification_long_term != 1) AND qualification_end_date < {0})
)
AND (
((driving_license_long_term IS NULL OR driving_license_long_term != 1) AND driving_license_end_date BETWEEN {0} AND {1})
OR ((qualification_long_term IS NULL OR qualification_long_term != 1) AND qualification_end_date BETWEEN {0} AND {1})
)
)
""";
private final IDriverService driverService;
@@ -222,18 +240,10 @@ public class DriverController extends BladeController {
queryWrapper.eq(Driver::getStatus, driver.getStatus());
}
if ("within30".equals(driver.getExpireStatus())) {
queryWrapper.and(wrapper -> wrapper
.and(item -> item.ne(Driver::getDrivingLicenseLongTerm, 1)
.between(Driver::getDrivingLicenseEndDate, driver.getToday(), driver.getWarningDate()))
.or(item -> item.ne(Driver::getQualificationLongTerm, 1)
.between(Driver::getQualificationEndDate, driver.getToday(), driver.getWarningDate())));
queryWrapper.apply(EXPIRY_WITHIN_30_SQL, driver.getToday(), driver.getWarningDate());
}
if ("expired".equals(driver.getExpireStatus())) {
queryWrapper.and(wrapper -> wrapper
.and(item -> item.ne(Driver::getDrivingLicenseLongTerm, 1)
.lt(Driver::getDrivingLicenseEndDate, driver.getToday()))
.or(item -> item.ne(Driver::getQualificationLongTerm, 1)
.lt(Driver::getQualificationEndDate, driver.getToday())));
queryWrapper.apply(EXPIRY_EXPIRED_SQL, driver.getToday());
}
return queryWrapper;
}

View File

@@ -92,9 +92,12 @@ public class EtcRecordController extends BladeController {
@PostMapping("/import-etc-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入ETC记录", description = "传入excel")
public R importEtcRecord(MultipartFile file) {
EtcRecordImporter etcRecordImporter = new EtcRecordImporter(etcRecordService);
ExcelUtil.save(file, etcRecordImporter, EtcRecordExcel.class);
public R importEtcRecord(MultipartFile file, HttpServletResponse response) {
List<EtcRecordExcel> failureList = etcRecordService.importEtcRecord(ExcelUtil.read(file, EtcRecordExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "ETC记录导入失败明细" + DateUtil.time(), "导入失败明细", failureList, EtcRecordExcel.class);
return null;
}
return R.success("操作成功");
}

View File

@@ -127,9 +127,12 @@ public class InsuranceRecordController extends BladeController {
@PostMapping("/import-insurance-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入保险记录", description = "传入excel")
public R importInsuranceRecord(MultipartFile file) {
InsuranceRecordImporter insuranceRecordImporter = new InsuranceRecordImporter(insuranceRecordService);
ExcelUtil.save(file, insuranceRecordImporter, InsuranceRecordExcel.class);
public R importInsuranceRecord(MultipartFile file, HttpServletResponse response) {
List<InsuranceRecordExcel> failureList = insuranceRecordService.importInsuranceRecord(ExcelUtil.read(file, InsuranceRecordExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "保险记录导入失败明细" + DateUtil.time(), "导入失败明细", failureList, InsuranceRecordExcel.class);
return null;
}
return R.success("操作成功");
}

View File

@@ -126,9 +126,12 @@ public class MaintenancePlanController extends BladeController {
@PostMapping("/import-maintenance-plan")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入保养记录", description = "传入excel")
public R importMaintenancePlan(MultipartFile file) {
MaintenancePlanImporter maintenancePlanImporter = new MaintenancePlanImporter(maintenancePlanService);
ExcelUtil.save(file, maintenancePlanImporter, MaintenancePlanExcel.class);
public R importMaintenancePlan(MultipartFile file, HttpServletResponse response) {
List<MaintenancePlanExcel> failureList = maintenancePlanService.importMaintenancePlan(ExcelUtil.read(file, MaintenancePlanExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "保养记录导入失败明细" + DateUtil.time(), "导入失败明细", failureList, MaintenancePlanExcel.class);
return null;
}
return R.success("操作成功");
}

View File

@@ -126,9 +126,12 @@ public class MaintenanceRecordController extends BladeController {
@PostMapping("/import-maintenance-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入维修记录", description = "传入excel")
public R importMaintenanceRecord(MultipartFile file) {
MaintenanceRecordImporter maintenanceRecordImporter = new MaintenanceRecordImporter(maintenanceRecordService);
ExcelUtil.save(file, maintenanceRecordImporter, MaintenanceRecordExcel.class);
public R importMaintenanceRecord(MultipartFile file, HttpServletResponse response) {
List<MaintenanceRecordExcel> failureList = maintenanceRecordService.importMaintenanceRecord(ExcelUtil.read(file, MaintenanceRecordExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "维修记录导入失败明细" + DateUtil.time(), "导入失败明细", failureList, MaintenanceRecordExcel.class);
return null;
}
return R.success("操作成功");
}

View File

@@ -111,9 +111,12 @@ public class MileageRecordController extends BladeController {
@PostMapping("/import-mileage-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入里程记录", description = "传入excel")
public R importMileageRecord(MultipartFile file) {
MileageRecordImporter mileageRecordImporter = new MileageRecordImporter(mileageRecordService);
ExcelUtil.save(file, mileageRecordImporter, MileageRecordExcel.class);
public R importMileageRecord(MultipartFile file, HttpServletResponse response) {
List<MileageRecordExcel> failureList = mileageRecordService.importMileageRecord(ExcelUtil.read(file, MileageRecordExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "里程记录导入失败明细" + DateUtil.time(), "导入失败明细", failureList, MileageRecordExcel.class);
return null;
}
return R.success("操作成功");
}
@@ -161,6 +164,9 @@ public class MileageRecordController extends BladeController {
if (Func.isNotEmpty(mileageRecord.getCreateDept())) {
queryWrapper.eq(MileageRecord::getCreateDept, mileageRecord.getCreateDept());
}
if (Func.isNotEmpty(mileageRecord.getVehicleType())) {
queryWrapper.eq(MileageRecord::getVehicleType, mileageRecord.getVehicleType());
}
if (Func.isNotEmpty(mileageRecord.getVehicleNo())) {
queryWrapper.like(MileageRecord::getVehicleNo, mileageRecord.getVehicleNo());
}

View File

@@ -92,9 +92,12 @@ public class OilElectricRecordController extends BladeController {
@PostMapping("/import-oil-electric-record")
@ApiOperationSupport(order = 5)
@Operation(summary = "导入油电记录", description = "传入excel")
public R importOilElectricRecord(MultipartFile file) {
OilElectricRecordImporter oilElectricRecordImporter = new OilElectricRecordImporter(oilElectricRecordService);
ExcelUtil.save(file, oilElectricRecordImporter, OilElectricRecordExcel.class);
public R importOilElectricRecord(MultipartFile file, HttpServletResponse response) {
List<OilElectricRecordExcel> failureList = oilElectricRecordService.importOilElectricRecord(ExcelUtil.read(file, OilElectricRecordExcel.class));
if (Func.isNotEmpty(failureList)) {
org.springblade.common.excel.ImportFailureExcelUtil.export(response, "油电记录导入失败明细" + DateUtil.time(), "导入失败明细", failureList, OilElectricRecordExcel.class);
return null;
}
return R.success("操作成功");
}

Some files were not shown because too many files have changed in this diff Show More