This commit is contained in:
zc
2026-03-20 16:25:09 +08:00
parent 2d3d4e3f56
commit 1937049b0e
19 changed files with 256 additions and 160 deletions

View File

@@ -1,6 +1,8 @@
package top.wms.admin.controller.meterial;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotNull;
@@ -29,6 +31,8 @@ import top.wms.admin.material.model.resp.MaterialInfoResp;
import top.wms.admin.material.service.MaterialInfoService;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
/**
* 物料信息管理 API
@@ -44,10 +48,15 @@ import java.io.IOException;
public class MaterialInfoController extends BaseController<MaterialInfoService, MaterialInfoResp, MaterialInfoResp, MaterialInfoQuery, MaterialInfoReq> {
@GetMapping("/code/{code}")
public MaterialInfoDO getMaterialInfoByCode(@PathVariable String code) {
MaterialInfoDO materialInfoDO = baseService.getMaterialInfoByCode(code);
CheckUtils.throwIfEmpty(materialInfoDO, "未查询到相关物料信息");
return materialInfoDO;
public MaterialInfoResp getMaterialInfoByCode(@PathVariable String code) {
List<String> list = Arrays.asList(code.split(","));
if (CollUtil.isNotEmpty(list) && list.size() > 1) {
code = list.get(1);
}
MaterialInfoResp materialInfoResp = baseService.getMaterialInfoByCode(code);
CheckUtils.throwIfEmpty(materialInfoResp, "未查询到相关物料信息");
return materialInfoResp;
}
@Operation(summary = "下载导入模板", description = "下载导入模板")

View File

@@ -21,6 +21,7 @@ import top.wms.admin.weighManage.model.resp.WorkOrderResp;
import top.wms.admin.weighManage.service.WorkOrderService;
import java.util.List;
import java.util.Map;
/**
* 任务工单信息管理 API
@@ -71,12 +72,12 @@ public class WorkOrderController extends BaseController<WorkOrderService, WorkOr
if (StrUtil.isBlank(req.getAhDeviceWeight())) {
return R.fail("400", "电子称重量不能为空");
}
int validateResult = baseService.validateWeighing(req);
if (validateResult != 200) {
return R.fail("500", "重量不匹配!");
if (req.getMaterialId() == null) {
return R.fail("400", "物料主键id不能为空");
}
return R.ok();
Map<String, String> validateResult = baseService.validateWeighing(req);
return R.ok(validateResult);
}
}

View File

@@ -18,7 +18,7 @@ spring:
spring.datasource:
type: com.zaxxer.hikari.HikariDataSource
# 请务必提前创建好名为 wms_admin 的数据库,如果使用其他数据库名请注意同步修改 DB_NAME 配置
url: jdbc:p6spy:mysql://127.0.0.1:3306/wms?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
url: jdbc:p6spy:mysql://127.0.0.1:3306/wms?serverTimezone=Asia/Shanghai&useSSL=false&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&allowMultiQueries=true
username: root
password: root
# PostgreSQL 配置
@@ -54,12 +54,12 @@ spring.data:
## Redis 配置(单机模式)
redis:
# 地址
# host: ${REDIS_HOST:192.168.2.30}
host: ${REDIS_HOST:127.0.0.1}
host: ${REDIS_HOST:192.168.2.30}
# host: ${REDIS_HOST:127.0.0.1}
# 端口(默认 6379
port: ${REDIS_PORT:6379}
# 密码(未设置密码时请注释掉)
# password: ${REDIS_PWD:redis2025}
password: ${REDIS_PWD:redis2025}
# 数据库索引
database: ${REDIS_DB:0}
# 连接超时时间
@@ -138,11 +138,13 @@ captcha:
continew-starter.log:
# 是否打印日志,开启后可打印访问日志(类似于 Nginx access log
is-print: true
# 忽略的路径,多个路径用逗号分隔
exclude-patterns: ["/file/**", "/sdk/**"]
## 项目日志配置(配置重叠部分,优先级高于 logback-spring.xml 中的配置)
logging:
level:
top.continew.admin: DEBUG
top.continew.starter: DEBUG
top.continew.admin: WARN
top.continew.starter: WARN
file:
path: ./logs

View File

@@ -14,7 +14,7 @@ server:
spring.datasource:
type: com.zaxxer.hikari.HikariDataSource
# 请务必提前创建好名为 wms_admin 的数据库,如果使用其他数据库名请注意同步修改 DB_NAME 配置
url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:wms_admin}?serverTimezone=Asia/Shanghai&useSSL=true&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:wms_admin}?serverTimezone=Asia/Shanghai&useSSL=true&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&autoReconnect=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&allowMultiQueries=true
username: ${DB_USER:root}
password: ${DB_PWD:123456}
driver-class-name: com.mysql.cj.jdbc.Driver