diff --git a/nl-framework/nl-spring-boot-starter-mybatis/src/main/java/cn/code/nl/framework/mybatis/core/query/LambdaQueryWrapperX.java b/nl-framework/nl-spring-boot-starter-mybatis/src/main/java/cn/code/nl/framework/mybatis/core/query/LambdaQueryWrapperX.java index daf258e0..94dfface 100644 --- a/nl-framework/nl-spring-boot-starter-mybatis/src/main/java/cn/code/nl/framework/mybatis/core/query/LambdaQueryWrapperX.java +++ b/nl-framework/nl-spring-boot-starter-mybatis/src/main/java/cn/code/nl/framework/mybatis/core/query/LambdaQueryWrapperX.java @@ -126,6 +126,12 @@ public class LambdaQueryWrapperX extends LambdaQueryWrapper { return this; } + @Override + public LambdaQueryWrapperX orderByAsc(SFunction column) { + super.orderByAsc(true, column); + return this; + } + @Override public LambdaQueryWrapperX last(String lastSql) { super.last(lastSql); diff --git a/nl-gateway/src/main/resources/application-dev.yaml b/nl-gateway/src/main/resources/application-dev.yaml index 02342c5d..1c16ab0b 100644 --- a/nl-gateway/src/main/resources/application-dev.yaml +++ b/nl-gateway/src/main/resources/application-dev.yaml @@ -7,10 +7,10 @@ spring: username: nacos password: nacos discovery: # 【配置中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP config: # 【注册中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP --- #################### 监控相关配置 #################### diff --git a/nl-module-base/nl-module-base-server/src/main/resources/application-dev.yaml b/nl-module-base/nl-module-base-server/src/main/resources/application-dev.yaml index e08ede1d..05d7e4d3 100644 --- a/nl-module-base/nl-module-base-server/src/main/resources/application-dev.yaml +++ b/nl-module-base/nl-module-base-server/src/main/resources/application-dev.yaml @@ -3,16 +3,16 @@ spring: cloud: nacos: - server-addr: http://192.168.81.193:8848 # Nacos 服务器地址 + server-addr: 192.168.81.193:8848 # Nacos 服务器地址 username: nacos password: nacos discovery: # 【配置中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP metadata: version: 1.0.0 # 服务实例的版本号,可用于灰度发布 config: # 【注册中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP --- #################### 数据库相关配置 #################### @@ -95,11 +95,11 @@ spring: xxl: job: admin: - addresses: http://localhost:8080/xxl-job-admin # 调度中心部署跟地址 - accessToken: 123456 # 执行器通讯TOKEN + addresses: http://192.168.81.193:8080/xxl-job-admin # 调度中心部署跟地址 + accessToken: default_token # 执行器通讯TOKEN executor: - ip: localhost - port: 9993 + ip: 192.168.81.193 + port: 8993 --- #################### 服务保障相关配置 #################### diff --git a/nl-module-base/nl-module-base-server/src/main/resources/application-local.yaml b/nl-module-base/nl-module-base-server/src/main/resources/application-local.yaml index b7116579..aa7ecc1d 100644 --- a/nl-module-base/nl-module-base-server/src/main/resources/application-local.yaml +++ b/nl-module-base/nl-module-base-server/src/main/resources/application-local.yaml @@ -64,7 +64,7 @@ spring: lazy: true # 开启懒加载,保证启动速度 url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root - password: root + password: root123 # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 data: diff --git a/nl-module-infra/nl-module-infra-server/src/main/resources/application-dev.yaml b/nl-module-infra/nl-module-infra-server/src/main/resources/application-dev.yaml index 9ccd9bc1..d9bf0503 100644 --- a/nl-module-infra/nl-module-infra-server/src/main/resources/application-dev.yaml +++ b/nl-module-infra/nl-module-infra-server/src/main/resources/application-dev.yaml @@ -7,12 +7,12 @@ spring: username: nacos password: nacos discovery: # 【配置中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP metadata: version: 1.0.0 # 服务实例的版本号,可用于灰度发布 config: # 【注册中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP --- #################### 数据库相关配置 #################### @@ -57,12 +57,12 @@ spring: primary: master datasource: master: - url: jdbc:mysql://192.168.81.193:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://192.168.81.193:3307/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root password: root123 slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 lazy: true # 开启懒加载,保证启动速度 - url: jdbc:mysql://192.168.81.193:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://192.168.81.193:3307/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root password: root123 @@ -96,10 +96,10 @@ xxl: job: admin: addresses: http://192.168.81.193:8080/xxl-job-admin # 调度中心部署跟地址 - accessToken: 123456 # 执行器通讯TOKEN + accessToken: default_token # 执行器通讯TOKEN executor: ip: 192.168.81.193 - port: 9991 + port: 8991 --- #################### 服务保障相关配置 #################### diff --git a/nl-module-infra/nl-module-infra-server/src/main/resources/application-local.yaml b/nl-module-infra/nl-module-infra-server/src/main/resources/application-local.yaml index b3d2e8a5..82eca54b 100644 --- a/nl-module-infra/nl-module-infra-server/src/main/resources/application-local.yaml +++ b/nl-module-infra/nl-module-infra-server/src/main/resources/application-local.yaml @@ -66,7 +66,7 @@ spring: # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro # SQLServer 连接的示例 # url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例 username: root - password: root + password: root123 # username: sa # SQL Server 连接的示例 # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例 # username: SYSDBA # DM 连接的示例 @@ -77,7 +77,7 @@ spring: lazy: true # 开启懒加载,保证启动速度 url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true username: root - password: root + password: root123 # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 data: diff --git a/nl-module-system/nl-module-system-server/src/main/resources/application-dev.yaml b/nl-module-system/nl-module-system-server/src/main/resources/application-dev.yaml index 4acc8c8e..519d180f 100644 --- a/nl-module-system/nl-module-system-server/src/main/resources/application-dev.yaml +++ b/nl-module-system/nl-module-system-server/src/main/resources/application-dev.yaml @@ -4,15 +4,15 @@ spring: cloud: nacos: server-addr: 192.168.81.193:8848 # Nacos 服务器地址 - username: # Nacos 账号 - password: # Nacos 密码 + username: nacos + password: nacos discovery: # 【配置中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP metadata: version: 1.0.0 # 服务实例的版本号,可用于灰度发布 config: # 【注册中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP --- #################### 数据库相关配置 #################### @@ -57,12 +57,12 @@ spring: primary: master datasource: master: - url: jdbc:mysql://192.168.81.193:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://192.168.81.193:3307/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root password: root123 slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 lazy: true # 开启懒加载,保证启动速度 - url: jdbc:mysql://192.168.81.193:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://192.168.81.193:3307/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root password: root123 @@ -99,7 +99,7 @@ xxl: accessToken: 123456 # 执行器通讯TOKEN executor: ip: 192.168.81.193 - port: 9992 + port: 8992 --- #################### 服务保障相关配置 #################### diff --git a/nl-module-system/nl-module-system-server/src/main/resources/application-local.yaml b/nl-module-system/nl-module-system-server/src/main/resources/application-local.yaml index 1f7b5893..35f9597c 100644 --- a/nl-module-system/nl-module-system-server/src/main/resources/application-local.yaml +++ b/nl-module-system/nl-module-system-server/src/main/resources/application-local.yaml @@ -65,7 +65,7 @@ spring: # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro # SQLServer 连接的示例 # url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例 username: root - password: root + password: root123 # username: sa # SQL Server 连接的示例 # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例 # username: SYSDBA # DM 连接的示例 @@ -76,7 +76,7 @@ spring: lazy: true # 开启懒加载,保证启动速度 url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true username: root - password: root + password: root123 # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 data: diff --git a/nl-module-wms/nl-module-wms-api/src/main/java/cn/code/nl/module/wms/enums/ErrorCodeConstants.java b/nl-module-wms/nl-module-wms-api/src/main/java/cn/code/nl/module/wms/enums/ErrorCodeConstants.java index 625654a9..e39fe317 100644 --- a/nl-module-wms/nl-module-wms-api/src/main/java/cn/code/nl/module/wms/enums/ErrorCodeConstants.java +++ b/nl-module-wms/nl-module-wms-api/src/main/java/cn/code/nl/module/wms/enums/ErrorCodeConstants.java @@ -4,4 +4,8 @@ import cn.code.nl.framework.common.exception.ErrorCode; public interface ErrorCodeConstants { ErrorCode BSREAL_STOR_ATTR_NOT_EXISTS = new ErrorCode(1, "实物库属性不存在"); + + ErrorCode SECT_ATTR_NOT_EXISTS = new ErrorCode(2, "库区属性不存在"); + + ErrorCode STRUC_ATTR_NOT_EXISTS = new ErrorCode(3, "仓位属性不存在"); } diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/bsrealstorattr/BsrealStorAttrController.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/bsrealstorattr/BsrealStorAttrController.java index 13058b05..86ef65d1 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/bsrealstorattr/BsrealStorAttrController.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/bsrealstorattr/BsrealStorAttrController.java @@ -101,4 +101,11 @@ public class BsrealStorAttrController { BeanUtils.toBean(list, BsrealStorAttrRespVO.class)); } + @GetMapping("/simple-list") + @Operation(summary = "获得启用的实物库属性精简列表") + public CommonResult> getBsrealStorAttrSimpleList() { + List list = bsrealStorAttrService.getBsrealStorAttrSimpleList(); + return success(BeanUtils.toBean(list, BsrealStorAttrSimpleRespVO.class)); + } + } \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/bsrealstorattr/vo/BsrealStorAttrRespVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/bsrealstorattr/vo/BsrealStorAttrRespVO.java index f0f086ce..ca361a9e 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/bsrealstorattr/vo/BsrealStorAttrRespVO.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/bsrealstorattr/vo/BsrealStorAttrRespVO.java @@ -121,11 +121,11 @@ public class BsrealStorAttrRespVO { @ExcelProperty("拥有者ID") private String sysownerid; - @Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26732") + @Schema(description = "部门ID") @ExcelProperty("部门ID") private String sysdeptid; - @Schema(description = "公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21831") + @Schema(description = "公司ID") @ExcelProperty("公司ID") private String syscompanyid; diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/bsrealstorattr/vo/BsrealStorAttrSimpleRespVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/bsrealstorattr/vo/BsrealStorAttrSimpleRespVO.java new file mode 100644 index 00000000..3126f0b7 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/bsrealstorattr/vo/BsrealStorAttrSimpleRespVO.java @@ -0,0 +1,19 @@ +package cn.code.nl.module.wms.controller.admin.bsrealstorattr.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 实物库属性精简 Response VO") +@Data +public class BsrealStorAttrSimpleRespVO { + + @Schema(description = "仓库标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + private String storId; + + @Schema(description = "仓库编码", example = "CK001") + private String storCode; + + @Schema(description = "仓库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "一号仓库") + private String storName; + +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/SectAttrController.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/SectAttrController.java new file mode 100644 index 00000000..90cc954b --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/SectAttrController.java @@ -0,0 +1,113 @@ +package cn.code.nl.module.wms.controller.admin.sectattr; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.code.nl.framework.common.pojo.PageParam; +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.common.pojo.CommonResult; +import cn.code.nl.framework.common.util.object.BeanUtils; +import static cn.code.nl.framework.common.pojo.CommonResult.success; + +import cn.code.nl.framework.excel.core.util.ExcelUtils; + +import cn.code.nl.framework.apilog.core.annotation.ApiAccessLog; +import static cn.code.nl.framework.apilog.core.enums.OperateTypeEnum.*; + +import cn.code.nl.module.wms.controller.admin.sectattr.vo.*; +import cn.code.nl.module.wms.dal.dataobject.sectattr.SectAttrDO; +import cn.code.nl.module.wms.service.sectattr.SectAttrService; + +@Tag(name = "管理后台 - 库区属性") +@RestController +@RequestMapping("/wms/sect-attr") +@Validated +public class SectAttrController { + + @Resource + private SectAttrService sectAttrService; + + @PostMapping("/create") + @Operation(summary = "创建库区属性") + @PreAuthorize("@ss.hasPermission('wms:sect-attr:create')") + public CommonResult createSectAttr(@Valid @RequestBody SectAttrSaveReqVO createReqVO) { + return success(sectAttrService.createSectAttr(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新库区属性") + @PreAuthorize("@ss.hasPermission('wms:sect-attr:update')") + public CommonResult updateSectAttr(@Valid @RequestBody SectAttrSaveReqVO updateReqVO) { + sectAttrService.updateSectAttr(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除库区属性") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('wms:sect-attr:delete')") + public CommonResult deleteSectAttr(@RequestParam("id") String id) { + sectAttrService.deleteSectAttr(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除库区属性") + @PreAuthorize("@ss.hasPermission('wms:sect-attr:delete')") + public CommonResult deleteSectAttrList(@RequestParam("ids") List ids) { + sectAttrService.deleteSectAttrListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得库区属性") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('wms:sect-attr:query')") + public CommonResult getSectAttr(@RequestParam("id") String id) { + SectAttrDO sectAttr = sectAttrService.getSectAttr(id); + return success(BeanUtils.toBean(sectAttr, SectAttrRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得库区属性分页") + @PreAuthorize("@ss.hasPermission('wms:sect-attr:query')") + public CommonResult> getSectAttrPage(@Valid SectAttrPageReqVO pageReqVO) { + PageResult pageResult = sectAttrService.getSectAttrPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, SectAttrRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出库区属性 Excel") + @PreAuthorize("@ss.hasPermission('wms:sect-attr:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportSectAttrExcel(@Valid SectAttrPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = sectAttrService.getSectAttrPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "库区属性.xls", "数据", SectAttrRespVO.class, + BeanUtils.toBean(list, SectAttrRespVO.class)); + } + + @GetMapping("/simple-list") + @Operation(summary = "获得启用的库区属性精简列表") + @Parameter(name = "storId", description = "仓库标识,可选") + public CommonResult> getSectAttrSimpleList( + @RequestParam(value = "storId", required = false) String storId) { + List list = sectAttrService.getSectAttrSimpleList(storId); + return success(BeanUtils.toBean(list, SectAttrSimpleRespVO.class)); + } + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrPageReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrPageReqVO.java new file mode 100644 index 00000000..3f79faad --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrPageReqVO.java @@ -0,0 +1,35 @@ +package cn.code.nl.module.wms.controller.admin.sectattr.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.code.nl.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.code.nl.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 库区属性分页 Request VO") +@Data +public class SectAttrPageReqVO extends PageParam { + + @Schema(description = "库区编码") + private String sectCode; + + @Schema(description = "库区名称", example = "芋艿") + private String sectName; + + @Schema(description = "库区类型") + private String sectTypeAttr; + + @Schema(description = "仓库标识", example = "24614") + private String storId; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "是否启用") + private String isUsed; + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrRespVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrRespVO.java new file mode 100644 index 00000000..b63bab72 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrRespVO.java @@ -0,0 +1,79 @@ +package cn.code.nl.module.wms.controller.admin.sectattr.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 库区属性 Response VO") +@Data +@ExcelIgnoreUnannotated +public class SectAttrRespVO { + + @Schema(description = "库区标识", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("库区标识") + private String sectId; + + @Schema(description = "库区编码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("库区编码") + private String sectCode; + + @Schema(description = "库区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("库区名称") + private String sectName; + + @Schema(description = "库区简称", example = "张三") + @ExcelProperty("库区简称") + private String simpleName; + + @Schema(description = "库区类型", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("库区类型") + private String sectTypeAttr; + + @Schema(description = "仓库标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "24614") + @ExcelProperty("仓库标识") + private String storId; + + @Schema(description = "仓库类型", example = "1") + @ExcelProperty("仓库类型") + private String storType; + + @Schema(description = "备注", example = "随便") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "背景色") + @ExcelProperty("背景色") + private String backGroundColor; + + @Schema(description = "前景色") + @ExcelProperty("前景色") + private String frontGroundColor; + + @Schema(description = "背景图片") + @ExcelProperty("背景图片") + private String backGroundPic; + + @Schema(description = "字体显示方向") + @ExcelProperty("字体显示方向") + private String fontDirectionScode; + + @Schema(description = "所在楼层") + @ExcelProperty("所在楼层") + private Integer floorNo; + + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否启用") + private String isUsed; + + @Schema(description = "外部标识", example = "16459") + @ExcelProperty("外部标识") + private String extId; + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrSaveReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrSaveReqVO.java new file mode 100644 index 00000000..c2d21746 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrSaveReqVO.java @@ -0,0 +1,89 @@ +package cn.code.nl.module.wms.controller.admin.sectattr.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 库区属性新增/修改 Request VO") +@Data +public class SectAttrSaveReqVO { + + @Schema(description = "库区标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "23215") + private String sectId; + + @Schema(description = "库区编码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "库区编码不能为空") + private String sectCode; + + @Schema(description = "库区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "库区名称不能为空") + private String sectName; + + @Schema(description = "库区简称", example = "张三") + private String simpleName; + + @Schema(description = "库区类型", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "库区类型不能为空") + private String sectTypeAttr; + + @Schema(description = "仓库标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "24614") + @NotEmpty(message = "仓库标识不能为空") + private String storId; + + @Schema(description = "仓库类型", example = "1") + private String storType; + + @Schema(description = "容量") + private Integer capacity; + + @Schema(description = "宽度") + private Integer width; + + @Schema(description = "高度") + private Integer height; + + @Schema(description = "深度") + private Integer zdepth; + + @Schema(description = "起始X坐标") + private Integer xqty; + + @Schema(description = "起始Y坐标") + private Integer yqty; + + @Schema(description = "起始Z坐标") + private Integer zqty; + + @Schema(description = "负责人", example = "张三") + private String sectManagerName; + + @Schema(description = "负责人电话") + private String mobileNo; + + @Schema(description = "备注", example = "随便") + private String remark; + + @Schema(description = "背景色") + private String backGroundColor; + + @Schema(description = "前景色") + private String frontGroundColor; + + @Schema(description = "背景图片") + private String backGroundPic; + + @Schema(description = "字体显示方向") + private String fontDirectionScode; + + @Schema(description = "所在楼层") + private Integer floorNo; + + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "是否启用不能为空") + private String isUsed; + + @Schema(description = "外部标识", example = "16459") + private String extId; + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrSimpleRespVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrSimpleRespVO.java new file mode 100644 index 00000000..797b3b3b --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/sectattr/vo/SectAttrSimpleRespVO.java @@ -0,0 +1,22 @@ +package cn.code.nl.module.wms.controller.admin.sectattr.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 库区属性精简 Response VO") +@Data +public class SectAttrSimpleRespVO { + + @Schema(description = "库区标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + private String sectId; + + @Schema(description = "库区编码", example = "KQ001") + private String sectCode; + + @Schema(description = "库区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "A区") + private String sectName; + + @Schema(description = "仓库标识", example = "2048") + private String storId; + +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/StrucAttrController.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/StrucAttrController.java new file mode 100644 index 00000000..02de1a05 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/StrucAttrController.java @@ -0,0 +1,104 @@ +package cn.code.nl.module.wms.controller.admin.structAttr; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.code.nl.framework.common.pojo.PageParam; +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.common.pojo.CommonResult; +import cn.code.nl.framework.common.util.object.BeanUtils; +import static cn.code.nl.framework.common.pojo.CommonResult.success; + +import cn.code.nl.framework.excel.core.util.ExcelUtils; + +import cn.code.nl.framework.apilog.core.annotation.ApiAccessLog; +import static cn.code.nl.framework.apilog.core.enums.OperateTypeEnum.*; + +import cn.code.nl.module.wms.controller.admin.structAttr.vo.*; +import cn.code.nl.module.wms.dal.dataobject.structAttr.StrucAttrDO; +import cn.code.nl.module.wms.service.structAttr.StrucAttrService; + +@Tag(name = "管理后台 - 仓位属性") +@RestController +@RequestMapping("/wms/struc-attr") +@Validated +public class StrucAttrController { + + @Resource + private StrucAttrService strucAttrService; + + @PostMapping("/create") + @Operation(summary = "创建仓位属性") + @PreAuthorize("@ss.hasPermission('wms:struc-attr:create')") + public CommonResult createStrucAttr(@Valid @RequestBody StrucAttrSaveReqVO createReqVO) { + return success(strucAttrService.createStrucAttr(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新仓位属性") + @PreAuthorize("@ss.hasPermission('wms:struc-attr:update')") + public CommonResult updateStrucAttr(@Valid @RequestBody StrucAttrSaveReqVO updateReqVO) { + strucAttrService.updateStrucAttr(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除仓位属性") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('wms:struc-attr:delete')") + public CommonResult deleteStrucAttr(@RequestParam("id") String id) { + strucAttrService.deleteStrucAttr(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除仓位属性") + @PreAuthorize("@ss.hasPermission('wms:struc-attr:delete')") + public CommonResult deleteStrucAttrList(@RequestParam("ids") List ids) { + strucAttrService.deleteStrucAttrListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得仓位属性") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('wms:struc-attr:query')") + public CommonResult getStrucAttr(@RequestParam("id") String id) { + StrucAttrDO strucAttr = strucAttrService.getStrucAttr(id); + return success(BeanUtils.toBean(strucAttr, StrucAttrRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得仓位属性分页") + @PreAuthorize("@ss.hasPermission('wms:struc-attr:query')") + public CommonResult> getStrucAttrPage(@Valid StrucAttrPageReqVO pageReqVO) { + PageResult pageResult = strucAttrService.getStrucAttrPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, StrucAttrRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出仓位属性 Excel") + @PreAuthorize("@ss.hasPermission('wms:struc-attr:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportStrucAttrExcel(@Valid StrucAttrPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = strucAttrService.getStrucAttrPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "仓位属性.xls", "数据", StrucAttrRespVO.class, + BeanUtils.toBean(list, StrucAttrRespVO.class)); + } + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/vo/StrucAttrPageReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/vo/StrucAttrPageReqVO.java new file mode 100644 index 00000000..0206e9c1 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/vo/StrucAttrPageReqVO.java @@ -0,0 +1,128 @@ +package cn.code.nl.module.wms.controller.admin.structAttr.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.code.nl.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.code.nl.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 仓位属性分页 Request VO") +@Data +public class StrucAttrPageReqVO extends PageParam { + + @Schema(description = "仓位编码") + private String structCode; + + @Schema(description = "仓位名称", example = "芋艿") + private String structName; + + @Schema(description = "仓位简称", example = "赵六") + private String simpleName; + + @Schema(description = "库区标识", example = "29259") + private String sectId; + + @Schema(description = "库区编码") + private String sectCode; + + @Schema(description = "库区名称", example = "李四") + private String sectName; + + @Schema(description = "仓库标识", example = "9143") + private String storId; + + @Schema(description = "仓库编码") + private String storCode; + + @Schema(description = "仓库名称", example = "王五") + private String storName; + + @Schema(description = "仓库类型", example = "1") + private String storType; + + @Schema(description = "容量") + private Integer capacity; + + @Schema(description = "宽度") + private Integer width; + + @Schema(description = "高度") + private Integer height; + + @Schema(description = "深度") + private Integer zdepth; + + @Schema(description = "承受重量") + private Integer weight; + + @Schema(description = "起始X坐标") + private Integer xqty; + + @Schema(description = "起始Y坐标") + private Integer yqty; + + @Schema(description = "起始Z坐标") + private Integer zqty; + + @Schema(description = "是否临时仓位") + private String isTempstruct; + + @Schema(description = "排") + private Integer rowNum; + + @Schema(description = "列") + private Integer colNum; + + @Schema(description = "层") + private Integer layerNum; + + @Schema(description = "块") + private Integer blockNum; + + @Schema(description = "放置类型", example = "1") + private String placementType; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "是否启用") + private Boolean isUsed; + + @Schema(description = "是否判断高度") + private String isZdepth; + + @Schema(description = "存储载具号") + private String storagevehicleCode; + + @Schema(description = "载具类型", example = "2") + private String storagevehicleType; + + @Schema(description = "载具数量") + private Integer storagevehicleQty; + + @Schema(description = "锁定类型", example = "2") + private String lockType; + + @Schema(description = "锁定任务编码") + private String taskCode; + + @Schema(description = "锁定单据类型", example = "2") + private String invType; + + @Schema(description = "锁定单据标识", example = "20840") + private String invId; + + @Schema(description = "锁定单据编码") + private String invCode; + + @Schema(description = "外部标识", example = "1926") + private String extId; + + @Schema(description = "备注", example = "你猜") + private String remark; + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/vo/StrucAttrRespVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/vo/StrucAttrRespVO.java new file mode 100644 index 00000000..c2247d39 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/vo/StrucAttrRespVO.java @@ -0,0 +1,135 @@ +package cn.code.nl.module.wms.controller.admin.structAttr.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 仓位属性 Response VO") +@Data +@ExcelIgnoreUnannotated +public class StrucAttrRespVO { + + @Schema(description = "仓位标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "22093") + @ExcelProperty("仓位标识") + private String structId; + + @Schema(description = "仓位编码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("仓位编码") + private String structCode; + + @Schema(description = "仓位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("仓位名称") + private String structName; + + @Schema(description = "仓位简称", example = "赵六") + @ExcelProperty("仓位简称") + private String simpleName; + + @Schema(description = "库区标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "29259") + @ExcelProperty("库区标识") + private String sectId; + + @Schema(description = "库区编码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("库区编码") + private String sectCode; + + @Schema(description = "库区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("库区名称") + private String sectName; + + @Schema(description = "仓库标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "9143") + @ExcelProperty("仓库标识") + private String storId; + + @Schema(description = "仓库编码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("仓库编码") + private String storCode; + + @Schema(description = "仓库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("仓库名称") + private String storName; + + @Schema(description = "仓库类型", example = "1") + @ExcelProperty("仓库类型") + private String storType; + + @Schema(description = "高度") + @ExcelProperty("高度") + private Integer height; + + @Schema(description = "排") + @ExcelProperty("排") + private Integer rowNum; + + @Schema(description = "列") + @ExcelProperty("列") + private Integer colNum; + + @Schema(description = "层") + @ExcelProperty("层") + private Integer layerNum; + + @Schema(description = "块") + @ExcelProperty("块") + private Integer blockNum; + + @Schema(description = "放置类型", example = "1") + @ExcelProperty("放置类型") + private String placementType; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否启用") + private Boolean isUsed; + + @Schema(description = "是否判断高度") + @ExcelProperty("是否判断高度") + private String isZdepth; + + @Schema(description = "存储载具号") + @ExcelProperty("存储载具号") + private String storagevehicleCode; + + @Schema(description = "载具类型", example = "2") + @ExcelProperty("载具类型") + private String storagevehicleType; + + @Schema(description = "载具数量") + @ExcelProperty("载具数量") + private Integer storagevehicleQty; + + @Schema(description = "锁定类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("锁定类型") + private String lockType; + + @Schema(description = "锁定任务编码") + @ExcelProperty("锁定任务编码") + private String taskCode; + + @Schema(description = "锁定单据类型", example = "2") + @ExcelProperty("锁定单据类型") + private String invType; + + @Schema(description = "锁定单据标识", example = "20840") + @ExcelProperty("锁定单据标识") + private String invId; + + @Schema(description = "锁定单据编码") + @ExcelProperty("锁定单据编码") + private String invCode; + + @Schema(description = "外部标识", example = "1926") + @ExcelProperty("外部标识") + private String extId; + + @Schema(description = "备注", example = "你猜") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/vo/StrucAttrSaveReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/vo/StrucAttrSaveReqVO.java new file mode 100644 index 00000000..a4f16926 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/structAttr/vo/StrucAttrSaveReqVO.java @@ -0,0 +1,134 @@ +package cn.code.nl.module.wms.controller.admin.structAttr.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 仓位属性新增/修改 Request VO") +@Data +public class StrucAttrSaveReqVO { + + @Schema(description = "仓位标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "22093") + private String structId; + + @Schema(description = "仓位编码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "仓位编码不能为空") + private String structCode; + + @Schema(description = "仓位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "仓位名称不能为空") + private String structName; + + @Schema(description = "仓位简称", example = "赵六") + private String simpleName; + + @Schema(description = "库区标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "29259") + @NotEmpty(message = "库区标识不能为空") + private String sectId; + + @Schema(description = "库区编码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "库区编码不能为空") + private String sectCode; + + @Schema(description = "库区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "库区名称不能为空") + private String sectName; + + @Schema(description = "仓库标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "9143") + @NotEmpty(message = "仓库标识不能为空") + private String storId; + + @Schema(description = "仓库编码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "仓库编码不能为空") + private String storCode; + + @Schema(description = "仓库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "仓库名称不能为空") + private String storName; + + @Schema(description = "仓库类型", example = "1") + private String storType; + + @Schema(description = "容量") + private Integer capacity; + + @Schema(description = "宽度") + private Integer width; + + @Schema(description = "高度") + private Integer height; + + @Schema(description = "深度") + private Integer zdepth; + + @Schema(description = "承受重量") + private Integer weight; + + @Schema(description = "起始X坐标") + private Integer xqty; + + @Schema(description = "起始Y坐标") + private Integer yqty; + + @Schema(description = "起始Z坐标") + private Integer zqty; + + @Schema(description = "是否临时仓位", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "是否临时仓位不能为空") + private String isTempstruct; + + @Schema(description = "排") + private Integer rowNum; + + @Schema(description = "列") + private Integer colNum; + + @Schema(description = "层") + private Integer layerNum; + + @Schema(description = "块") + private Integer blockNum; + + @Schema(description = "放置类型", example = "1") + private String placementType; + + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否启用不能为空") + private Boolean isUsed; + + @Schema(description = "是否判断高度") + private String isZdepth; + + @Schema(description = "存储载具号") + private String storagevehicleCode; + + @Schema(description = "载具类型", example = "2") + private String storagevehicleType; + + @Schema(description = "载具数量") + private Integer storagevehicleQty; + + @Schema(description = "锁定类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "锁定类型不能为空") + private String lockType; + + @Schema(description = "锁定任务编码") + private String taskCode; + + @Schema(description = "锁定单据类型", example = "2") + private String invType; + + @Schema(description = "锁定单据标识", example = "20840") + private String invId; + + @Schema(description = "锁定单据编码") + private String invCode; + + @Schema(description = "外部标识", example = "1926") + private String extId; + + @Schema(description = "备注", example = "你猜") + private String remark; + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/sectattr/SectAttrDO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/sectattr/SectAttrDO.java new file mode 100644 index 00000000..42f338d8 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/sectattr/SectAttrDO.java @@ -0,0 +1,124 @@ +package cn.code.nl.module.wms.dal.dataobject.sectattr; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.code.nl.framework.mybatis.core.dataobject.BaseDO; + +/** + * 库区属性 DO + * + * @author 诺力管理员 + */ +@TableName("wms_sectattr") +@KeySequence("wms_sectattr_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SectAttrDO extends BaseDO { + + /** + * 库区标识 + */ + @TableId + private String sectId; + /** + * 库区编码 + */ + private String sectCode; + /** + * 库区名称 + */ + private String sectName; + /** + * 库区简称 + */ + private String simpleName; + /** + * 库区类型 + */ + private String sectTypeAttr; + /** + * 仓库标识 + */ + private String storId; + /** + * 仓库类型 + */ + private String storType; + /** + * 容量 + */ + private Integer capacity; + /** + * 宽度 + */ + private Integer width; + /** + * 高度 + */ + private Integer height; + /** + * 深度 + */ + private Integer zdepth; + /** + * 起始X坐标 + */ + private Integer xqty; + /** + * 起始Y坐标 + */ + private Integer yqty; + /** + * 起始Z坐标 + */ + private Integer zqty; + /** + * 负责人 + */ + private String sectManagerName; + /** + * 负责人电话 + */ + private String mobileNo; + /** + * 备注 + */ + private String remark; + /** + * 背景色 + */ + private String backGroundColor; + /** + * 前景色 + */ + private String frontGroundColor; + /** + * 背景图片 + */ + private String backGroundPic; + /** + * 字体显示方向 + */ + private String fontDirectionScode; + /** + * 所在楼层 + */ + private Integer floorNo; + /** + * 是否启用 + */ + private String isUsed; + /** + * 外部标识 + */ + private String extId; + + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/structAttr/StrucAttrDO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/structAttr/StrucAttrDO.java new file mode 100644 index 00000000..6d21b914 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/structAttr/StrucAttrDO.java @@ -0,0 +1,176 @@ +package cn.code.nl.module.wms.dal.dataobject.structAttr; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.code.nl.framework.mybatis.core.dataobject.BaseDO; + +/** + * 仓位属性 DO + * + * @author 诺力管理员 + */ +@TableName("wms_structattr") +@KeySequence("wms_structattr_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class StrucAttrDO extends BaseDO { + + /** + * 仓位标识 + */ + @TableId + private String structId; + /** + * 仓位编码 + */ + private String structCode; + /** + * 仓位名称 + */ + private String structName; + /** + * 仓位简称 + */ + private String simpleName; + /** + * 库区标识 + */ + private String sectId; + /** + * 库区编码 + */ + private String sectCode; + /** + * 库区名称 + */ + private String sectName; + /** + * 仓库标识 + */ + private String storId; + /** + * 仓库编码 + */ + private String storCode; + /** + * 仓库名称 + */ + private String storName; + /** + * 仓库类型 + */ + private String storType; + /** + * 容量 + */ + private Integer capacity; + /** + * 宽度 + */ + private Integer width; + /** + * 高度 + */ + private Integer height; + /** + * 深度 + */ + private Integer zdepth; + /** + * 承受重量 + */ + private Integer weight; + /** + * 起始X坐标 + */ + private Integer xqty; + /** + * 起始Y坐标 + */ + private Integer yqty; + /** + * 起始Z坐标 + */ + private Integer zqty; + /** + * 是否临时仓位 + */ + private String isTempstruct; + /** + * 排 + */ + private Integer rowNum; + /** + * 列 + */ + private Integer colNum; + /** + * 层 + */ + private Integer layerNum; + /** + * 块 + */ + private Integer blockNum; + /** + * 放置类型 + */ + private String placementType; + /** + * 是否启用 + */ + private Boolean isUsed; + /** + * 是否判断高度 + */ + private String isZdepth; + /** + * 存储载具号 + */ + private String storagevehicleCode; + /** + * 载具类型 + */ + private String storagevehicleType; + /** + * 载具数量 + */ + private Integer storagevehicleQty; + /** + * 锁定类型 + */ + private String lockType; + /** + * 锁定任务编码 + */ + private String taskCode; + /** + * 锁定单据类型 + */ + private String invType; + /** + * 锁定单据标识 + */ + private String invId; + /** + * 锁定单据编码 + */ + private String invCode; + /** + * 外部标识 + */ + private String extId; + /** + * 备注 + */ + private String remark; + + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/sectattr/SectAttrMapper.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/sectattr/SectAttrMapper.java new file mode 100644 index 00000000..5e4487a1 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/sectattr/SectAttrMapper.java @@ -0,0 +1,31 @@ +package cn.code.nl.module.wms.dal.mysql.sectattr; + +import java.util.*; + +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX; +import cn.code.nl.module.wms.dal.dataobject.sectattr.SectAttrDO; +import org.apache.ibatis.annotations.Mapper; +import cn.code.nl.module.wms.controller.admin.sectattr.vo.*; + +/** + * 库区属性 Mapper + * + * @author 诺力管理员 + */ +@Mapper +public interface SectAttrMapper extends BaseMapperX { + + default PageResult selectPage(SectAttrPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(SectAttrDO::getSectCode, reqVO.getSectCode()) + .likeIfPresent(SectAttrDO::getSectName, reqVO.getSectName()) + .eqIfPresent(SectAttrDO::getSectTypeAttr, reqVO.getSectTypeAttr()) + .eqIfPresent(SectAttrDO::getStorId, reqVO.getStorId()) + .betweenIfPresent(SectAttrDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(SectAttrDO::getIsUsed, reqVO.getIsUsed()) + .orderByDesc(SectAttrDO::getSectId)); + } + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/structAttr/StrucAttrMapper.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/structAttr/StrucAttrMapper.java new file mode 100644 index 00000000..f6078029 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/structAttr/StrucAttrMapper.java @@ -0,0 +1,62 @@ +package cn.code.nl.module.wms.dal.mysql.structAttr; + +import java.util.*; + +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX; +import cn.code.nl.module.wms.dal.dataobject.structAttr.StrucAttrDO; +import org.apache.ibatis.annotations.Mapper; +import cn.code.nl.module.wms.controller.admin.structAttr.vo.*; + +/** + * 仓位属性 Mapper + * + * @author 诺力管理员 + */ +@Mapper +public interface StrucAttrMapper extends BaseMapperX { + + default PageResult selectPage(StrucAttrPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(StrucAttrDO::getStructCode, reqVO.getStructCode()) + .likeIfPresent(StrucAttrDO::getStructName, reqVO.getStructName()) + .likeIfPresent(StrucAttrDO::getSimpleName, reqVO.getSimpleName()) + .eqIfPresent(StrucAttrDO::getSectId, reqVO.getSectId()) + .eqIfPresent(StrucAttrDO::getSectCode, reqVO.getSectCode()) + .likeIfPresent(StrucAttrDO::getSectName, reqVO.getSectName()) + .eqIfPresent(StrucAttrDO::getStorId, reqVO.getStorId()) + .eqIfPresent(StrucAttrDO::getStorCode, reqVO.getStorCode()) + .likeIfPresent(StrucAttrDO::getStorName, reqVO.getStorName()) + .eqIfPresent(StrucAttrDO::getStorType, reqVO.getStorType()) + .eqIfPresent(StrucAttrDO::getCapacity, reqVO.getCapacity()) + .eqIfPresent(StrucAttrDO::getWidth, reqVO.getWidth()) + .eqIfPresent(StrucAttrDO::getHeight, reqVO.getHeight()) + .eqIfPresent(StrucAttrDO::getZdepth, reqVO.getZdepth()) + .eqIfPresent(StrucAttrDO::getWeight, reqVO.getWeight()) + .eqIfPresent(StrucAttrDO::getXqty, reqVO.getXqty()) + .eqIfPresent(StrucAttrDO::getYqty, reqVO.getYqty()) + .eqIfPresent(StrucAttrDO::getZqty, reqVO.getZqty()) + .eqIfPresent(StrucAttrDO::getIsTempstruct, reqVO.getIsTempstruct()) + .eqIfPresent(StrucAttrDO::getRowNum, reqVO.getRowNum()) + .eqIfPresent(StrucAttrDO::getColNum, reqVO.getColNum()) + .eqIfPresent(StrucAttrDO::getLayerNum, reqVO.getLayerNum()) + .eqIfPresent(StrucAttrDO::getBlockNum, reqVO.getBlockNum()) + .eqIfPresent(StrucAttrDO::getPlacementType, reqVO.getPlacementType()) + .betweenIfPresent(StrucAttrDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(StrucAttrDO::getIsUsed, reqVO.getIsUsed()) + .eqIfPresent(StrucAttrDO::getIsZdepth, reqVO.getIsZdepth()) + .eqIfPresent(StrucAttrDO::getStoragevehicleCode, reqVO.getStoragevehicleCode()) + .eqIfPresent(StrucAttrDO::getStoragevehicleType, reqVO.getStoragevehicleType()) + .eqIfPresent(StrucAttrDO::getStoragevehicleQty, reqVO.getStoragevehicleQty()) + .eqIfPresent(StrucAttrDO::getLockType, reqVO.getLockType()) + .eqIfPresent(StrucAttrDO::getTaskCode, reqVO.getTaskCode()) + .eqIfPresent(StrucAttrDO::getInvType, reqVO.getInvType()) + .eqIfPresent(StrucAttrDO::getInvId, reqVO.getInvId()) + .eqIfPresent(StrucAttrDO::getInvCode, reqVO.getInvCode()) + .eqIfPresent(StrucAttrDO::getExtId, reqVO.getExtId()) + .eqIfPresent(StrucAttrDO::getRemark, reqVO.getRemark()) + .orderByDesc(StrucAttrDO::getStructId)); + } + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/bsrealstorattr/BsrealStorAttrService.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/bsrealstorattr/BsrealStorAttrService.java index 43023e4d..dabf2073 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/bsrealstorattr/BsrealStorAttrService.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/bsrealstorattr/BsrealStorAttrService.java @@ -59,4 +59,11 @@ public interface BsrealStorAttrService { */ PageResult getBsrealStorAttrPage(BsrealStorAttrPageReqVO pageReqVO); + /** + * 获得启用的实物库属性精简列表 + * + * @return 实物库属性列表 + */ + List getBsrealStorAttrSimpleList(); + } \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/bsrealstorattr/BsrealStorAttrServiceImpl.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/bsrealstorattr/BsrealStorAttrServiceImpl.java index 13b92577..ca858077 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/bsrealstorattr/BsrealStorAttrServiceImpl.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/bsrealstorattr/BsrealStorAttrServiceImpl.java @@ -14,6 +14,7 @@ import cn.code.nl.framework.common.pojo.PageParam; import cn.code.nl.framework.common.util.object.BeanUtils; import cn.code.nl.module.wms.dal.mysql.bsrealstorattr.BsrealStorAttrMapper; +import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX; import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.code.nl.framework.common.util.collection.CollectionUtils.convertList; @@ -82,4 +83,11 @@ public class BsrealStorAttrServiceImpl implements BsrealStorAttrService { return bsrealStorAttrMapper.selectPage(pageReqVO); } + @Override + public List getBsrealStorAttrSimpleList() { + return bsrealStorAttrMapper.selectList(new LambdaQueryWrapperX() + .eq(BsrealStorAttrDO::getIsUsed, "1") + .orderByAsc(BsrealStorAttrDO::getStorId)); + } + } \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/sectattr/SectAttrService.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/sectattr/SectAttrService.java new file mode 100644 index 00000000..77c042e5 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/sectattr/SectAttrService.java @@ -0,0 +1,70 @@ +package cn.code.nl.module.wms.service.sectattr; + +import java.util.*; +import jakarta.validation.*; +import cn.code.nl.module.wms.controller.admin.sectattr.vo.*; +import cn.code.nl.module.wms.dal.dataobject.sectattr.SectAttrDO; +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.common.pojo.PageParam; + +/** + * 库区属性 Service 接口 + * + * @author 诺力管理员 + */ +public interface SectAttrService { + + /** + * 创建库区属性 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createSectAttr(@Valid SectAttrSaveReqVO createReqVO); + + /** + * 更新库区属性 + * + * @param updateReqVO 更新信息 + */ + void updateSectAttr(@Valid SectAttrSaveReqVO updateReqVO); + + /** + * 删除库区属性 + * + * @param id 编号 + */ + void deleteSectAttr(String id); + + /** + * 批量删除库区属性 + * + * @param ids 编号 + */ + void deleteSectAttrListByIds(List ids); + + /** + * 获得库区属性 + * + * @param id 编号 + * @return 库区属性 + */ + SectAttrDO getSectAttr(String id); + + /** + * 获得库区属性分页 + * + * @param pageReqVO 分页查询 + * @return 库区属性分页 + */ + PageResult getSectAttrPage(SectAttrPageReqVO pageReqVO); + + /** + * 获得启用的库区属性精简列表 + * + * @param storId 仓库标识,可选 + * @return 库区属性列表 + */ + List getSectAttrSimpleList(String storId); + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/sectattr/SectAttrServiceImpl.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/sectattr/SectAttrServiceImpl.java new file mode 100644 index 00000000..871eab89 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/sectattr/SectAttrServiceImpl.java @@ -0,0 +1,92 @@ +package cn.code.nl.module.wms.service.sectattr; + +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.common.util.object.BeanUtils; +import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.code.nl.module.wms.controller.admin.sectattr.vo.SectAttrPageReqVO; +import cn.code.nl.module.wms.controller.admin.sectattr.vo.SectAttrSaveReqVO; +import cn.code.nl.module.wms.dal.dataobject.sectattr.SectAttrDO; +import cn.code.nl.module.wms.dal.mysql.sectattr.SectAttrMapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.List; + +import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.code.nl.module.wms.enums.ErrorCodeConstants.SECT_ATTR_NOT_EXISTS; + +/** + * 库区属性 Service 实现类 + * + * @author 诺力管理员 + */ +@Service +@Validated +public class SectAttrServiceImpl implements SectAttrService { + + @Resource + private SectAttrMapper sectAttrMapper; + + @Override + public String createSectAttr(SectAttrSaveReqVO createReqVO) { + // 插入 + SectAttrDO sectAttr = BeanUtils.toBean(createReqVO, SectAttrDO.class); + sectAttrMapper.insert(sectAttr); + + // 返回 + return sectAttr.getSectId(); + } + + @Override + public void updateSectAttr(SectAttrSaveReqVO updateReqVO) { + // 校验存在 + validateSectAttrExists(updateReqVO.getSectId()); + // 更新 + SectAttrDO updateObj = BeanUtils.toBean(updateReqVO, SectAttrDO.class); + sectAttrMapper.updateById(updateObj); + } + + @Override + public void deleteSectAttr(String id) { + // 校验存在 + validateSectAttrExists(id); + // 删除 + sectAttrMapper.deleteById(id); + } + + @Override + public void deleteSectAttrListByIds(List ids) { + // 删除 + sectAttrMapper.deleteByIds(ids); + } + + + private void validateSectAttrExists(String id) { + if (sectAttrMapper.selectById(id) == null) { + throw exception(SECT_ATTR_NOT_EXISTS); + } + } + + @Override + public SectAttrDO getSectAttr(String id) { + return sectAttrMapper.selectById(id); + } + + @Override + public PageResult getSectAttrPage(SectAttrPageReqVO pageReqVO) { + return sectAttrMapper.selectPage(pageReqVO); + } + + @Override + public List getSectAttrSimpleList(String storId) { + LambdaQueryWrapperX wrapper = new LambdaQueryWrapperX() + .eq(SectAttrDO::getIsUsed, "1") + .orderByAsc(SectAttrDO::getSectId); + if (storId != null && !storId.isEmpty()) { + wrapper.eq(SectAttrDO::getStorId, storId); + } + return sectAttrMapper.selectList(wrapper); + } + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/structAttr/StrucAttrService.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/structAttr/StrucAttrService.java new file mode 100644 index 00000000..ae6a1163 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/structAttr/StrucAttrService.java @@ -0,0 +1,62 @@ +package cn.code.nl.module.wms.service.structAttr; + +import java.util.*; +import jakarta.validation.*; +import cn.code.nl.module.wms.controller.admin.structAttr.vo.*; +import cn.code.nl.module.wms.dal.dataobject.structAttr.StrucAttrDO; +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.common.pojo.PageParam; + +/** + * 仓位属性 Service 接口 + * + * @author 诺力管理员 + */ +public interface StrucAttrService { + + /** + * 创建仓位属性 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createStrucAttr(@Valid StrucAttrSaveReqVO createReqVO); + + /** + * 更新仓位属性 + * + * @param updateReqVO 更新信息 + */ + void updateStrucAttr(@Valid StrucAttrSaveReqVO updateReqVO); + + /** + * 删除仓位属性 + * + * @param id 编号 + */ + void deleteStrucAttr(String id); + + /** + * 批量删除仓位属性 + * + * @param ids 编号 + */ + void deleteStrucAttrListByIds(List ids); + + /** + * 获得仓位属性 + * + * @param id 编号 + * @return 仓位属性 + */ + StrucAttrDO getStrucAttr(String id); + + /** + * 获得仓位属性分页 + * + * @param pageReqVO 分页查询 + * @return 仓位属性分页 + */ + PageResult getStrucAttrPage(StrucAttrPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/structAttr/StrucAttrServiceImpl.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/structAttr/StrucAttrServiceImpl.java new file mode 100644 index 00000000..a24a3bae --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/structAttr/StrucAttrServiceImpl.java @@ -0,0 +1,85 @@ +package cn.code.nl.module.wms.service.structAttr; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import cn.code.nl.module.wms.controller.admin.structAttr.vo.*; +import cn.code.nl.module.wms.dal.dataobject.structAttr.StrucAttrDO; +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.common.pojo.PageParam; +import cn.code.nl.framework.common.util.object.BeanUtils; + +import cn.code.nl.module.wms.dal.mysql.structAttr.StrucAttrMapper; + +import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.code.nl.framework.common.util.collection.CollectionUtils.convertList; +import static cn.code.nl.framework.common.util.collection.CollectionUtils.diffList; +import static cn.code.nl.module.wms.enums.ErrorCodeConstants.*; + +/** + * 仓位属性 Service 实现类 + * + * @author 诺力管理员 + */ +@Service +@Validated +public class StrucAttrServiceImpl implements StrucAttrService { + + @Resource + private StrucAttrMapper strucAttrMapper; + + @Override + public String createStrucAttr(StrucAttrSaveReqVO createReqVO) { + // 插入 + StrucAttrDO strucAttr = BeanUtils.toBean(createReqVO, StrucAttrDO.class); + strucAttrMapper.insert(strucAttr); + + // 返回 + return strucAttr.getStructId(); + } + + @Override + public void updateStrucAttr(StrucAttrSaveReqVO updateReqVO) { + // 校验存在 + validateStrucAttrExists(updateReqVO.getStructId()); + // 更新 + StrucAttrDO updateObj = BeanUtils.toBean(updateReqVO, StrucAttrDO.class); + strucAttrMapper.updateById(updateObj); + } + + @Override + public void deleteStrucAttr(String id) { + // 校验存在 + validateStrucAttrExists(id); + // 删除 + strucAttrMapper.deleteById(id); + } + + @Override + public void deleteStrucAttrListByIds(List ids) { + // 删除 + strucAttrMapper.deleteByIds(ids); + } + + + private void validateStrucAttrExists(String id) { + if (strucAttrMapper.selectById(id) == null) { + throw exception(STRUC_ATTR_NOT_EXISTS); + } + } + + @Override + public StrucAttrDO getStrucAttr(String id) { + return strucAttrMapper.selectById(id); + } + + @Override + public PageResult getStrucAttrPage(StrucAttrPageReqVO pageReqVO) { + return strucAttrMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/resources/application-dev.yaml b/nl-module-wms/nl-module-wms-server/src/main/resources/application-dev.yaml index 4f34ac9c..2de3c2e3 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/resources/application-dev.yaml +++ b/nl-module-wms/nl-module-wms-server/src/main/resources/application-dev.yaml @@ -3,16 +3,16 @@ spring: cloud: nacos: - server-addr: http://192.168.81.193:8848 # Nacos 服务器地址 + server-addr: 192.168.81.193:8848 # Nacos 服务器地址 username: nacos password: nacos discovery: # 【配置中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP metadata: version: 1.0.0 # 服务实例的版本号,可用于灰度发布 config: # 【注册中心】配置项 - namespace: dev # 命名空间。这里使用 dev 开发环境 + namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP --- #################### 数据库相关配置 #################### @@ -57,12 +57,12 @@ spring: primary: master datasource: master: - url: jdbc:mysql://192.168.81.193:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://192.168.81.193:3307/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root password: root123 slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 lazy: true # 开启懒加载,保证启动速度 - url: jdbc:mysql://192.168.81.193:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://192.168.81.193:3307/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root password: root123 @@ -95,11 +95,11 @@ spring: xxl: job: admin: - addresses: http://localhost:8080/xxl-job-admin # 调度中心部署跟地址 - accessToken: 123456 # 执行器通讯TOKEN + addresses: http://192.168.81.193:8080/xxl-job-admin # 调度中心部署跟地址 + accessToken: default_token # 执行器通讯TOKEN executor: ip: localhost - port: 9995 + port: 8995 --- #################### 服务保障相关配置 #################### diff --git a/nl-module-wms/nl-module-wms-server/src/main/resources/application-local.yaml b/nl-module-wms/nl-module-wms-server/src/main/resources/application-local.yaml index b7116579..aa7ecc1d 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/resources/application-local.yaml +++ b/nl-module-wms/nl-module-wms-server/src/main/resources/application-local.yaml @@ -64,7 +64,7 @@ spring: lazy: true # 开启懒加载,保证启动速度 url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root - password: root + password: root123 # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 data: diff --git a/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/sectattr/SectAttrMapper.xml b/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/sectattr/SectAttrMapper.xml new file mode 100644 index 00000000..cd03eb18 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/sectattr/SectAttrMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/structAttr/StrucAttrMapper.xml b/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/structAttr/StrucAttrMapper.xml new file mode 100644 index 00000000..cc1b886b --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/structAttr/StrucAttrMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/nl-server/src/main/resources/application-local.yaml b/nl-server/src/main/resources/application-local.yaml index 452a45ed..13148cc8 100644 --- a/nl-server/src/main/resources/application-local.yaml +++ b/nl-server/src/main/resources/application-local.yaml @@ -56,7 +56,7 @@ spring: # url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例 username: root - password: root + password: root123 # username: sa # SQL Server 连接的示例 # password: Nl@2024 # SQL Server 连接的示例 # username: SYSDBA # DM 连接的示例 @@ -69,7 +69,7 @@ spring: lazy: true # 开启懒加载,保证启动速度 url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true username: root - password: root + password: root123 # tdengine: # IoT 数据库(需要 IoT 物联网再开启噢!) # url: jdbc:TAOS-WS://127.0.0.1:6041/ruoyi_vue_pro?enableAutoReconnect=true # 参见:https://t.zsxq.com/qaX9c,开启 TDengine WebSocket 自动重连 # driver-class-name: com.taosdata.jdbc.ws.WebSocketDriver diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/bsrealstorattr/index.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/bsrealstorattr/index.ts index acbcde88..d95ab1f2 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/bsrealstorattr/index.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/bsrealstorattr/index.ts @@ -80,3 +80,10 @@ export function deleteBsrealStorAttrList(ids: string[]) { export function exportBsrealStorAttr(params: any) { return requestClient.download('/wms/bsreal-stor-attr/export-excel', { params }); } + +/** 获得启用的实物库属性精简列表 */ +export function getBsrealStorAttrSimpleList() { + return requestClient.get<{ storId: string; storName: string }[]>( + '/wms/bsreal-stor-attr/simple-list', + ); +} diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/sectattr/index.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/sectattr/index.ts new file mode 100644 index 00000000..241830b4 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/sectattr/index.ts @@ -0,0 +1,83 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace WmsSectAttrApi { + /** 库区属性信息 */ + export interface SectAttr { + sectId: string; // 库区标识 + sectCode?: string; // 库区编码 + sectName?: string; // 库区名称 + simpleName: string; // 库区简称 + sectTypeAttr?: string; // 库区类型 + storId?: string; // 仓库标识 + storType: string; // 仓库类型 + capacity: number; // 容量 + width: number; // 宽度 + height: number; // 高度 + zdepth: number; // 深度 + xqty: number; // 起始X坐标 + yqty: number; // 起始Y坐标 + zqty: number; // 起始Z坐标 + sectManagerName: string; // 负责人 + mobileNo: string; // 负责人电话 + remark: string; // 备注 + backGroundColor: string; // 背景色 + frontGroundColor: string; // 前景色 + backGroundPic: string; // 背景图片 + fontDirectionScode: string; // 字体显示方向 + floorNo: number; // 所在楼层 + isUsed?: string; // 是否启用 + extId: string; // 外部标识 + } +} + +/** 查询库区属性分页 */ +export function getSectAttrPage(params: PageParam) { + return requestClient.get>( + '/wms/sect-attr/page', + { params }, + ); +} + +/** 查询库区属性详情 */ +export function getSectAttr(id: string) { + return requestClient.get( + `/wms/sect-attr/get?id=${id}`, + ); +} + +/** 新增库区属性 */ +export function createSectAttr(data: WmsSectAttrApi.SectAttr) { + return requestClient.post('/wms/sect-attr/create', data); +} + +/** 修改库区属性 */ +export function updateSectAttr(data: WmsSectAttrApi.SectAttr) { + return requestClient.put('/wms/sect-attr/update', data); +} + +/** 删除库区属性 */ +export function deleteSectAttr(id: string) { + return requestClient.delete(`/wms/sect-attr/delete?id=${id}`); +} + +/** 批量删除库区属性 */ +export function deleteSectAttrList(ids: string[]) { + return requestClient.delete( + `/wms/sect-attr/delete-list?ids=${ids.join(',')}`, + ); +} + +/** 导出库区属性 */ +export function exportSectAttr(params: any) { + return requestClient.download('/wms/sect-attr/export-excel', { params }); +} + +/** 获得启用的库区属性精简列表(可按仓库筛选) */ +export function getSectAttrSimpleList(storId?: string) { + return requestClient.get<{ sectId: string; sectName: string; storId: string }[]>( + '/wms/sect-attr/simple-list', + { params: storId ? { storId } : {} }, + ); +} diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/structAttr/index.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/structAttr/index.ts new file mode 100644 index 00000000..346db433 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/structAttr/index.ts @@ -0,0 +1,88 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace WmsStrucAttrApi { + /** 仓位属性信息 */ + export interface StrucAttr { + structId: string; // 仓位标识 + structCode?: string; // 仓位编码 + structName?: string; // 仓位名称 + simpleName: string; // 仓位简称 + sectId?: string; // 库区标识 + sectCode?: string; // 库区编码 + sectName?: string; // 库区名称 + storId?: string; // 仓库标识 + storCode?: string; // 仓库编码 + storName?: string; // 仓库名称 + storType: string; // 仓库类型 + capacity: number; // 容量 + width: number; // 宽度 + height: number; // 高度 + zdepth: number; // 深度 + weight: number; // 承受重量 + xqty: number; // 起始X坐标 + yqty: number; // 起始Y坐标 + zqty: number; // 起始Z坐标 + isTempstruct?: string; // 是否临时仓位 + rowNum: number; // 排 + colNum: number; // 列 + layerNum: number; // 层 + blockNum: number; // 块 + placementType: string; // 放置类型 + isUsed?: boolean; // 是否启用 + isZdepth: string; // 是否判断高度 + storagevehicleCode: string; // 存储载具号 + storagevehicleType: string; // 载具类型 + storagevehicleQty: number; // 载具数量 + lockType?: string; // 锁定类型 + taskCode: string; // 锁定任务编码 + invType: string; // 锁定单据类型 + invId: string; // 锁定单据标识 + invCode: string; // 锁定单据编码 + extId: string; // 外部标识 + remark: string; // 备注 + } +} + +/** 查询仓位属性分页 */ +export function getStrucAttrPage(params: PageParam) { + return requestClient.get>( + '/wms/struc-attr/page', + { params }, + ); +} + +/** 查询仓位属性详情 */ +export function getStrucAttr(id: number) { + return requestClient.get( + `/wms/struc-attr/get?id=${id}`, + ); +} + +/** 新增仓位属性 */ +export function createStrucAttr(data: WmsStrucAttrApi.StrucAttr) { + return requestClient.post('/wms/struc-attr/create', data); +} + +/** 修改仓位属性 */ +export function updateStrucAttr(data: WmsStrucAttrApi.StrucAttr) { + return requestClient.put('/wms/struc-attr/update', data); +} + +/** 删除仓位属性 */ +export function deleteStrucAttr(id: number) { + return requestClient.delete(`/wms/struc-attr/delete?id=${id}`); +} + +/** 批量删除仓位属性 */ +export function deleteStrucAttrList(ids: number[]) { + return requestClient.delete( + `/wms/struc-attr/delete-list?ids=${ids.join(',')}`, + ); +} + +/** 导出仓位属性 */ +export function exportStrucAttr(params: any) { + return requestClient.download('/wms/struc-attr/export-excel', { params }); +} diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/sectattr/data.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/sectattr/data.ts new file mode 100644 index 00000000..5a08ef0b --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/sectattr/data.ts @@ -0,0 +1,377 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { WmsSectAttrApi } from '#/api/wms/sectattr'; + +import { getBsrealStorAttrSimpleList } from '#/api/wms/bsrealstorattr'; +import { getRangePickerDefaultProps } from '#/utils'; + +/** 是/否 选项 */ +const BOOLEAN_OPTIONS = [ + { label: '是', value: '1' }, + { label: '否', value: '0' }, +]; + +// ========== 仓库名称映射表(storId → storName) ========== +const warehouseNameMap: Record = {}; + +// ========== 启用的仓库下拉 ========== +async function loadWarehouseList() { + const data = await getBsrealStorAttrSimpleList(); + // 填充映射表 + if (data) { + data.forEach((item) => { + warehouseNameMap[item.storId] = item.storName; + }); + } + return data || []; +} + +/** 仓库标识 → 仓库名称 格式化 */ +function warehouseFormatter({ cellValue }: { cellValue: string }) { + return warehouseNameMap[cellValue] || cellValue; +} + +/** 是/否 格式化('1' → '是','0' → '否') */ +function boolFormatter({ cellValue }: { cellValue: string }) { + return cellValue === '1' ? '是' : '否'; +} + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'sectId', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'sectCode', + label: '库区编码', + rules: 'required', + component: 'Input', + componentProps: { + placeholder: '请输入库区编码', + }, + }, + { + fieldName: 'sectName', + label: '库区名称', + rules: 'required', + component: 'Input', + componentProps: { + placeholder: '请输入库区名称', + }, + }, + { + fieldName: 'simpleName', + label: '库区简称', + component: 'Input', + componentProps: { + placeholder: '请输入库区简称', + }, + }, + { + fieldName: 'sectTypeAttr', + label: '库区类型', + rules: 'required', + component: 'Input', + componentProps: { + placeholder: '请输入库区类型', + }, + }, + { + fieldName: 'storId', + label: '仓库标识', + rules: 'required', + component: 'ApiSelect', + componentProps: { + api: loadWarehouseList, + labelField: 'storName', + valueField: 'storId', + placeholder: '请选择仓库', + allowClear: true, + }, + }, + { + fieldName: 'storType', + label: '仓库类型', + component: 'Select', + componentProps: { + options: [], + placeholder: '请选择仓库类型', + }, + }, + { + fieldName: 'capacity', + label: '容量', + component: 'Input', + componentProps: { + placeholder: '请输入容量', + }, + }, + { + fieldName: 'width', + label: '宽度', + component: 'Input', + componentProps: { + placeholder: '请输入宽度', + }, + }, + { + fieldName: 'height', + label: '高度', + component: 'Input', + componentProps: { + placeholder: '请输入高度', + }, + }, + { + fieldName: 'zdepth', + label: '深度', + component: 'Input', + componentProps: { + placeholder: '请输入深度', + }, + }, + { + fieldName: 'xqty', + label: '起始X坐标', + component: 'Input', + componentProps: { + placeholder: '请输入起始X坐标', + }, + }, + { + fieldName: 'yqty', + label: '起始Y坐标', + component: 'Input', + componentProps: { + placeholder: '请输入起始Y坐标', + }, + }, + { + fieldName: 'zqty', + label: '起始Z坐标', + component: 'Input', + componentProps: { + placeholder: '请输入起始Z坐标', + }, + }, + { + fieldName: 'sectManagerName', + label: '负责人', + component: 'Input', + componentProps: { + placeholder: '请输入负责人', + }, + }, + { + fieldName: 'mobileNo', + label: '负责人电话', + component: 'Input', + componentProps: { + placeholder: '请输入负责人电话', + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + componentProps: { + placeholder: '请输入备注', + }, + }, + { + fieldName: 'backGroundColor', + label: '背景色', + component: 'Input', + componentProps: { + placeholder: '请输入背景色', + }, + }, + { + fieldName: 'frontGroundColor', + label: '前景色', + component: 'Input', + componentProps: { + placeholder: '请输入前景色', + }, + }, + { + fieldName: 'backGroundPic', + label: '背景图片', + component: 'Input', + componentProps: { + placeholder: '请输入背景图片', + }, + }, + { + fieldName: 'fontDirectionScode', + label: '字体显示方向', + component: 'Input', + componentProps: { + placeholder: '请输入字体显示方向', + }, + }, + { + fieldName: 'floorNo', + label: '所在楼层', + component: 'Input', + componentProps: { + placeholder: '请输入所在楼层', + }, + }, + { + fieldName: 'isUsed', + label: '是否启用', + rules: 'required', + component: 'RadioGroup', + componentProps: { + options: BOOLEAN_OPTIONS, + buttonStyle: 'solid', + optionType: 'button', + }, + }, + { + fieldName: 'extId', + label: '外部标识', + component: 'Input', + componentProps: { + placeholder: '请输入外部标识', + }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'sectCode', + label: '库区编码', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入库区编码', + }, + }, + { + fieldName: 'sectName', + label: '库区名称', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入库区名称', + }, + }, + { + fieldName: 'sectTypeAttr', + label: '库区类型', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入库区类型', + }, + }, + { + fieldName: 'storId', + label: '仓库标识', + component: 'ApiSelect', + componentProps: { + api: loadWarehouseList, + labelField: 'storName', + valueField: 'storId', + placeholder: '请选择仓库', + allowClear: true, + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + { + fieldName: 'isUsed', + label: '是否启用', + component: 'Select', + componentProps: { + allowClear: true, + options: BOOLEAN_OPTIONS, + placeholder: '请选择是否启用', + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'checkbox', width: 40 }, + { + field: 'sectId', + title: '库区标识', + visible: false, + }, + { + field: 'sectCode', + title: '库区编码', + minWidth: 120, + }, + { + field: 'sectName', + title: '库区名称', + minWidth: 120, + }, + { + field: 'simpleName', + title: '库区简称', + minWidth: 120, + }, + { + field: 'sectTypeAttr', + title: '库区类型', + minWidth: 120, + }, + { + field: 'storId', + title: '仓库名称', + minWidth: 120, + formatter: warehouseFormatter, + }, + { + field: 'remark', + title: '备注', + minWidth: 120, + }, + { + field: 'createTime', + title: '创建时间', + minWidth: 120, + formatter: 'formatDateTime', + }, + { + field: 'isUsed', + title: '是否启用', + minWidth: 120, + formatter: boolFormatter, + }, + { + field: 'extId', + title: '外部标识', + minWidth: 120, + }, + { + title: '操作', + width: 200, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/sectattr/index.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/sectattr/index.vue new file mode 100644 index 00000000..6a47c36d --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/sectattr/index.vue @@ -0,0 +1,186 @@ + + + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/sectattr/modules/form.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/sectattr/modules/form.vue new file mode 100644 index 00000000..736f5ea4 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/sectattr/modules/form.vue @@ -0,0 +1,82 @@ + + + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/structAttr/data.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/structAttr/data.ts new file mode 100644 index 00000000..7b820cf2 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/structAttr/data.ts @@ -0,0 +1,401 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { WmsStrucAttrApi } from '#/api/wms/structAttr'; + +import { ref } from 'vue'; + +import { DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; + +import { getBsrealStorAttrSimpleList } from '#/api/wms/bsrealstorattr'; +import { getSectAttrSimpleList } from '#/api/wms/sectattr'; +import { getRangePickerDefaultProps } from '#/utils'; + +/** 是/否 选项 */ +const BOOLEAN_OPTIONS = [ + { label: '是', value: '1' }, + { label: '否', value: '0' }, +]; +const BOOLEAN_TRUE_FALSE_OPTIONS = [ + { label: '是', value: true }, + { label: '否', value: false }, +]; +function boolFormatter({ cellValue }: { cellValue: boolean | string }) { + if (cellValue === true || cellValue === 'true' || cellValue === '1') return '是'; + return '否'; +} + +// ========== 名称映射表 ========== +const warehouseNameMap: Record = {}; +const warehouseCodeMap: Record = {}; +const sectNameMap: Record = {}; +const sectCodeMap: Record = {}; + +function warehouseFormatter({ cellValue }: { cellValue: string }) { + return warehouseNameMap[cellValue] || cellValue; +} +function sectFormatter({ cellValue }: { cellValue: string }) { + return sectNameMap[cellValue] || cellValue; +} + +// ========== 仓库-库区级联树 ========== +const warehouseSectTree = ref([]); + +export async function loadWarehouseSectTree() { + if (warehouseSectTree.value.length > 0) return; + const warehouses = await getBsrealStorAttrSimpleList(); + if (!warehouses) return; + + const tree = await Promise.all( + warehouses.map(async (w: any) => { + warehouseNameMap[w.storId] = w.storName; + warehouseCodeMap[w.storId] = w.storCode || ''; + const sects = await getSectAttrSimpleList(w.storId); + return { + label: w.storName, + value: w.storId, + children: (sects || []).map((s: any) => { + sectNameMap[s.sectId] = s.sectName; + sectCodeMap[s.sectId] = s.sectCode || ''; + return { label: s.sectName, value: s.sectId }; + }), + }; + }), + ); + warehouseSectTree.value = tree; +} + +/** 导出映射,供 form.vue 使用 */ +export function getWarehouseCode(id: string) { return warehouseCodeMap[id] || ''; } +export function getWarehouseName(id: string) { return warehouseNameMap[id] || ''; } +export function getSectCode(id: string) { return sectCodeMap[id] || ''; } +export function getSectName(id: string) { return sectNameMap[id] || ''; } + +// 立即预加载 +loadWarehouseSectTree(); + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'structId', + component: 'Input', + dependencies: { triggerFields: [''], show: () => false }, + }, + { + fieldName: 'structCode', + label: '仓位编码', + rules: 'required', + component: 'Input', + componentProps: { placeholder: '请输入仓位编码' }, + }, + { + fieldName: 'structName', + label: '仓位名称', + rules: 'required', + component: 'Input', + componentProps: { placeholder: '请输入仓位名称' }, + }, + { + fieldName: 'simpleName', + label: '仓位简称', + component: 'Input', + componentProps: { placeholder: '请输入仓位简称' }, + }, + { + fieldName: 'warehouseSect', + label: '仓库 / 库区', + rules: 'required', + component: 'Cascader', + componentProps: { + options: warehouseSectTree, + placeholder: '请选择仓库和库区', + allowClear: true, + changeOnSelect: true, + }, + }, + { + fieldName: 'storType', + label: '仓库类型', + component: 'Select', + componentProps: { options: [], placeholder: '请选择仓库类型' }, + }, + { + fieldName: 'capacity', + label: '容量', + component: 'Input', + componentProps: { placeholder: '请输入容量' }, + }, + { + fieldName: 'width', + label: '宽度', + component: 'Input', + componentProps: { placeholder: '请输入宽度' }, + }, + { + fieldName: 'height', + label: '高度', + component: 'Input', + componentProps: { placeholder: '请输入高度' }, + }, + { + fieldName: 'zdepth', + label: '深度', + component: 'Input', + componentProps: { placeholder: '请输入深度' }, + }, + { + fieldName: 'weight', + label: '承受重量', + component: 'Input', + componentProps: { placeholder: '请输入承受重量' }, + }, + { + fieldName: 'xqty', + label: '起始X坐标', + component: 'Input', + componentProps: { placeholder: '请输入起始X坐标' }, + }, + { + fieldName: 'yqty', + label: '起始Y坐标', + component: 'Input', + componentProps: { placeholder: '请输入起始Y坐标' }, + }, + { + fieldName: 'zqty', + label: '起始Z坐标', + component: 'Input', + componentProps: { placeholder: '请输入起始Z坐标' }, + }, + { + fieldName: 'isTempstruct', + label: '是否临时仓位', + rules: 'required', + component: 'RadioGroup', + componentProps: { + options: BOOLEAN_OPTIONS, + buttonStyle: 'solid', + optionType: 'button', + }, + }, + { + fieldName: 'rowNum', + label: '排', + component: 'Input', + componentProps: { placeholder: '请输入排' }, + }, + { + fieldName: 'colNum', + label: '列', + component: 'Input', + componentProps: { placeholder: '请输入列' }, + }, + { + fieldName: 'layerNum', + label: '层', + component: 'Input', + componentProps: { placeholder: '请输入层' }, + }, + { + fieldName: 'blockNum', + label: '块', + component: 'Input', + componentProps: { placeholder: '请输入块' }, + }, + { + fieldName: 'placementType', + label: '放置类型', + component: 'Select', + componentProps: { options: [], placeholder: '请选择放置类型' }, + }, + { + fieldName: 'isUsed', + label: '是否启用', + rules: 'required', + component: 'RadioGroup', + componentProps: { + options: BOOLEAN_TRUE_FALSE_OPTIONS, + buttonStyle: 'solid', + optionType: 'button', + }, + }, + { + fieldName: 'isZdepth', + label: '是否判断高度', + component: 'RadioGroup', + componentProps: { + options: BOOLEAN_OPTIONS, + buttonStyle: 'solid', + optionType: 'button', + }, + }, + { + fieldName: 'storagevehicleCode', + label: '存储载具号', + component: 'Input', + componentProps: { placeholder: '请输入存储载具号' }, + }, + { + fieldName: 'storagevehicleType', + label: '载具类型', + component: 'Select', + componentProps: { options: [], placeholder: '请选择载具类型' }, + }, + { + fieldName: 'storagevehicleQty', + label: '载具数量', + component: 'Input', + componentProps: { placeholder: '请输入载具数量' }, + }, + { + fieldName: 'lockType', + label: '锁定类型', + rules: 'required', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.WMS_LOCK_TYPE, 'string'), + placeholder: '请选择锁定类型', + }, + }, + { + fieldName: 'taskCode', + label: '锁定任务编码', + component: 'Input', + componentProps: { placeholder: '请输入锁定任务编码' }, + }, + { + fieldName: 'invType', + label: '锁定单据类型', + component: 'Select', + componentProps: { options: [], placeholder: '请选择锁定单据类型' }, + }, + { + fieldName: 'invId', + label: '锁定单据标识', + component: 'Input', + componentProps: { placeholder: '请输入锁定单据标识' }, + }, + { + fieldName: 'invCode', + label: '锁定单据编码', + component: 'Input', + componentProps: { placeholder: '请输入锁定单据编码' }, + }, + { + fieldName: 'extId', + label: '外部标识', + component: 'Input', + componentProps: { placeholder: '请输入外部标识' }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + componentProps: { placeholder: '请输入备注' }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'structCode', + label: '仓位编码', + component: 'Input', + componentProps: { allowClear: true, placeholder: '请输入仓位编码' }, + }, + { + fieldName: 'structName', + label: '仓位名称', + component: 'Input', + componentProps: { allowClear: true, placeholder: '请输入仓位名称' }, + }, + { + fieldName: 'warehouseSect', + label: '仓库 / 库区', + component: 'Cascader', + componentProps: { + options: warehouseSectTree, + placeholder: '请选择仓库和库区', + allowClear: true, + changeOnSelect: true, + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { ...getRangePickerDefaultProps(), allowClear: true }, + }, + { + fieldName: 'isUsed', + label: '是否启用', + component: 'Select', + componentProps: { + allowClear: true, + options: BOOLEAN_TRUE_FALSE_OPTIONS, + placeholder: '请选择是否启用', + }, + }, + { + fieldName: 'storagevehicleCode', + label: '存储载具号', + component: 'Input', + componentProps: { allowClear: true, placeholder: '请输入存储载具号' }, + }, + { + fieldName: 'lockType', + label: '锁定类型', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.WMS_LOCK_TYPE, 'string'), + placeholder: '请选择锁定类型', + }, + }, + { + fieldName: 'taskCode', + label: '锁定任务编码', + component: 'Input', + componentProps: { allowClear: true, placeholder: '请输入锁定任务编码' }, + }, + { + fieldName: 'invCode', + label: '锁定单据编码', + component: 'Input', + componentProps: { allowClear: true, placeholder: '请输入锁定单据编码' }, + }, + { + fieldName: 'extId', + label: '外部标识', + component: 'Input', + componentProps: { allowClear: true, placeholder: '请输入外部标识' }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'checkbox', width: 40 }, + { field: 'structId', title: '仓位标识', minWidth: 120 }, + { field: 'structCode', title: '仓位编码', minWidth: 120 }, + { field: 'structName', title: '仓位名称', minWidth: 120 }, + { field: 'simpleName', title: '仓位简称', minWidth: 120 }, + { field: 'storId', title: '仓库名称', minWidth: 120, formatter: warehouseFormatter }, + { field: 'sectId', title: '库区名称', minWidth: 120, formatter: sectFormatter }, + { field: 'height', title: '高度', minWidth: 120 }, + { field: 'rowNum', title: '排', minWidth: 120 }, + { field: 'colNum', title: '列', minWidth: 120 }, + { field: 'layerNum', title: '层', minWidth: 120 }, + { field: 'blockNum', title: '块', minWidth: 120 }, + { field: 'isTempstruct', title: '是否临时仓位', minWidth: 120, formatter: boolFormatter }, + { field: 'isUsed', title: '是否启用', minWidth: 120, formatter: boolFormatter }, + { field: 'isZdepth', title: '是否判断高度', minWidth: 120, formatter: boolFormatter }, + { field: 'createTime', title: '创建时间', minWidth: 120, formatter: 'formatDateTime' }, + { field: 'remark', title: '备注', minWidth: 120 }, + { title: '操作', width: 200, fixed: 'right', slots: { default: 'actions' } }, + ]; +} diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/structAttr/index.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/structAttr/index.vue new file mode 100644 index 00000000..cbdde85b --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/structAttr/index.vue @@ -0,0 +1,190 @@ + + + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/structAttr/modules/form.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/structAttr/modules/form.vue new file mode 100644 index 00000000..083a80ae --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/structAttr/modules/form.vue @@ -0,0 +1,108 @@ + + + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/packages/constants/src/dict-enum.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/packages/constants/src/dict-enum.ts index 3453ce8c..5a190779 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/packages/constants/src/dict-enum.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/packages/constants/src/dict-enum.ts @@ -279,6 +279,7 @@ const WMS_DICT = { WMS_ORDER_STATUS: 'wms_order_status', // WMS 单据状态 WMS_RECEIPT_ORDER_TYPE: 'wms_receipt_order_type', // WMS 入库单类型 WMS_SHIPMENT_ORDER_TYPE: 'wms_shipment_order_type', // WMS 出库单类型 + WMS_LOCK_TYPE: 'wms_lock_type', // WMS 锁定类型 } as const; /** ========== TASK - 任务管理模块 ========== */