From 736618cefac74ed23f68d46a52213a531e534e36 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Tue, 21 Jul 2026 14:21:34 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E7=BB=84=E7=9B=98PC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/wms/enums/ErrorCodeConstants.java | 5 + .../groupplate/GroupPlateController.java | 104 +++++ .../groupplate/vo/GroupPlatePageReqVO.java | 63 ++++ .../admin/groupplate/vo/GroupPlateRespVO.java | 88 +++++ .../groupplate/vo/GroupPlateSaveReqVO.java | 61 +++ .../WarehouseStrategyConfigSimpleRespVO.java | 3 + .../dataobject/groupplate/GroupPlateDO.java | 90 +++++ .../WarehouseStrategyConfigDO.java | 2 +- .../mysql/groupplate/GroupPlateMapper.java | 40 ++ .../wms/manage/dto/AlleyAveHandleDTO.java | 200 ++++++++++ .../wms/manage/dto/StrategyStructParam.java | 75 ++++ .../handle/base/AlleyAveRuleHandler.java | 40 +- .../handle/base/ClusterRuleHandler.java | 22 ++ .../manage/handle/base/FIFORuleHandler.java | 25 ++ .../service/groupplate/GroupPlateService.java | 62 +++ .../groupplate/GroupPlateServiceImpl.java | 80 ++++ .../main/resources/application-mq-dev.yaml | 2 +- .../src/main/resources/application.yaml | 4 +- .../src/main/resources/application-dev.yaml | 3 - .../main/resources/application-mq-dev.yaml | 8 + nl-server/src/main/resources/application.yaml | 7 +- .../src/api/wms/groupplate/index.ts | 68 ++++ .../api/wms/warehousestrategyconfig/index.ts | 1 + .../components/MaterialSelectModal.vue | 136 +++++++ .../components/MeasureUnitSelectModal.vue | 113 ++++++ .../src/views/wms/groupplate/data.ts | 356 ++++++++++++++++++ .../src/views/wms/groupplate/index.vue | 186 +++++++++ .../src/views/wms/groupplate/modules/form.vue | 155 ++++++++ .../src/views/wms/warehousestrategy/data.ts | 36 +- .../src/views/wms/warehousestrategy/index.vue | 5 +- .../wms/warehousestrategy/modules/form.vue | 5 +- .../views/wms/warehousestrategyconfig/data.ts | 9 +- .../packages/constants/src/dict-enum.ts | 2 + 33 files changed, 2030 insertions(+), 26 deletions(-) create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/GroupPlateController.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/vo/GroupPlatePageReqVO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/vo/GroupPlateRespVO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/vo/GroupPlateSaveReqVO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/groupplate/GroupPlateDO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/groupplate/GroupPlateMapper.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/dto/StrategyStructParam.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/ClusterRuleHandler.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/FIFORuleHandler.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/groupplate/GroupPlateService.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/groupplate/GroupPlateServiceImpl.java create mode 100644 nl-server/src/main/resources/application-mq-dev.yaml create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/groupplate/index.ts create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/materialbase/components/MaterialSelectModal.vue create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/measureunit/components/MeasureUnitSelectModal.vue create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/groupplate/data.ts create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/groupplate/index.vue create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/groupplate/modules/form.vue 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 39163471..d0d40c5e 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 @@ -14,4 +14,9 @@ public interface ErrorCodeConstants { ErrorCode WAREHOUSE_STRATEGY_CONFIG_NOT_EXISTS = new ErrorCode(6_000_1, "仓储策略配置不存在"); ErrorCode WAREHOUSE_STRATEGY_NOT_EXISTS = new ErrorCode(6_000_2, "出入库策略不存在"); + + ErrorCode ALLEY_AVE_NO_AVAILABLE_LOCATION = new ErrorCode(6_000_3, "均衡策略结果:载具号:{},当前分配策略无可用货位"); + + // ================ 组盘记录相关错误码 ================= + ErrorCode GROUP_PLATE_NOT_EXISTS = new ErrorCode(9, "组盘记录不存在"); } diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/GroupPlateController.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/GroupPlateController.java new file mode 100644 index 00000000..b784b931 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/GroupPlateController.java @@ -0,0 +1,104 @@ +package cn.code.nl.module.wms.controller.admin.groupplate; + +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.groupplate.vo.*; +import cn.code.nl.module.wms.dal.dataobject.groupplate.GroupPlateDO; +import cn.code.nl.module.wms.service.groupplate.GroupPlateService; + +@Tag(name = "管理后台 - 组盘记录") +@RestController +@RequestMapping("/wms/group-plate") +@Validated +public class GroupPlateController { + + @Resource + private GroupPlateService groupPlateService; + + @PostMapping("/create") + @Operation(summary = "创建组盘记录") + @PreAuthorize("@ss.hasPermission('wms:group-plate:create')") + public CommonResult createGroupPlate(@Valid @RequestBody GroupPlateSaveReqVO createReqVO) { + return success(groupPlateService.createGroupPlate(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新组盘记录") + @PreAuthorize("@ss.hasPermission('wms:group-plate:update')") + public CommonResult updateGroupPlate(@Valid @RequestBody GroupPlateSaveReqVO updateReqVO) { + groupPlateService.updateGroupPlate(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除组盘记录") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('wms:group-plate:delete')") + public CommonResult deleteGroupPlate(@RequestParam("id") String id) { + groupPlateService.deleteGroupPlate(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除组盘记录") + @PreAuthorize("@ss.hasPermission('wms:group-plate:delete')") + public CommonResult deleteGroupPlateList(@RequestParam("ids") List ids) { + groupPlateService.deleteGroupPlateListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得组盘记录") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('wms:group-plate:query')") + public CommonResult getGroupPlate(@RequestParam("id") String id) { + GroupPlateDO groupPlate = groupPlateService.getGroupPlate(id); + return success(BeanUtils.toBean(groupPlate, GroupPlateRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得组盘记录分页") + @PreAuthorize("@ss.hasPermission('wms:group-plate:query')") + public CommonResult> getGroupPlatePage(@Valid GroupPlatePageReqVO pageReqVO) { + PageResult pageResult = groupPlateService.getGroupPlatePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, GroupPlateRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出组盘记录 Excel") + @PreAuthorize("@ss.hasPermission('wms:group-plate:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportGroupPlateExcel(@Valid GroupPlatePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = groupPlateService.getGroupPlatePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "组盘记录.xls", "数据", GroupPlateRespVO.class, + BeanUtils.toBean(list, GroupPlateRespVO.class)); + } + +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/vo/GroupPlatePageReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/vo/GroupPlatePageReqVO.java new file mode 100644 index 00000000..bbc68857 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/vo/GroupPlatePageReqVO.java @@ -0,0 +1,63 @@ +package cn.code.nl.module.wms.controller.admin.groupplate.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.code.nl.framework.common.pojo.PageParam; +import java.math.BigDecimal; +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 GroupPlatePageReqVO extends PageParam { + + @Schema(description = "载具编码") + private String vehicleCode; + + @Schema(description = "状态", example = "1") + private String status; + + @Schema(description = "物料id", example = "1670") + private String materialId; + + @Schema(description = "批次") + private String pcsn; + + @Schema(description = "组盘数量") + private BigDecimal qty; + + @Schema(description = "冻结数量") + private BigDecimal frozenQty; + + @Schema(description = "计量单位标识", example = "21005") + private String qtyUnitId; + + @Schema(description = "计量单位名称", example = "王五") + private String qtyUnitName; + + @Schema(description = "备注", example = "随便") + private String remark; + + @Schema(description = "来源单据号") + private String extCode; + + @Schema(description = "来源单据类型", example = "1") + private String extType; + + @Schema(description = "来源单据明细号") + private String extDtlCode; + + @Schema(description = "md5") + private String md5; + + @Schema(description = "物料编码") + private String materialCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ 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/groupplate/vo/GroupPlateRespVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/vo/GroupPlateRespVO.java new file mode 100644 index 00000000..48096916 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/vo/GroupPlateRespVO.java @@ -0,0 +1,88 @@ +package cn.code.nl.module.wms.controller.admin.groupplate.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import cn.idev.excel.annotation.*; + +@Schema(description = "管理后台 - 组盘记录 Response VO") +@Data +@ExcelIgnoreUnannotated +public class GroupPlateRespVO { + + @Schema(description = "载具编码") + @ExcelProperty("载具编码") + private String vehicleCode; + + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("状态") + private String status; + + @Schema(description = "物料id", example = "1670") + @ExcelProperty("物料id") + private String materialId; + + @Schema(description = "批次", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("批次") + private String pcsn; + + @Schema(description = "组盘数量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("组盘数量") + private BigDecimal qty; + + @Schema(description = "冻结数量") + @ExcelProperty("冻结数量") + private BigDecimal frozenQty; + + @Schema(description = "计量单位标识", example = "21005") + @ExcelProperty("计量单位标识") + private String qtyUnitId; + + @Schema(description = "计量单位名称", example = "王五") + @ExcelProperty("计量单位名称") + private String qtyUnitName; + + @Schema(description = "备注", example = "随便") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "来源单据号") + @ExcelProperty("来源单据号") + private String extCode; + + @Schema(description = "来源单据类型", example = "1") + @ExcelProperty("来源单据类型") + private String extType; + + @Schema(description = "来源单据明细号") + @ExcelProperty("来源单据明细号") + private String extDtlCode; + + @Schema(description = "md5") + @ExcelProperty("md5") + private String md5; + + @Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("物料编码") + private String materialCode; + + @Schema(description = "创建者") + @ExcelProperty("创建者") + private String creator; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "更新者") + @ExcelProperty("更新者") + private String updater; + + @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("更新时间") + private LocalDateTime updateTime; + +} \ 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/groupplate/vo/GroupPlateSaveReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/vo/GroupPlateSaveReqVO.java new file mode 100644 index 00000000..cc9512a3 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/groupplate/vo/GroupPlateSaveReqVO.java @@ -0,0 +1,61 @@ +package cn.code.nl.module.wms.controller.admin.groupplate.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; + +@Schema(description = "管理后台 - 组盘记录新增/修改 Request VO") +@Data +public class GroupPlateSaveReqVO { + + private String groupId; + + @Schema(description = "载具编码") + private String vehicleCode; + + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "状态不能为空") + private String status; + + @Schema(description = "物料id", example = "1670") + private String materialId; + + @Schema(description = "批次", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "批次不能为空") + private String pcsn; + + @Schema(description = "组盘数量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "组盘数量不能为空") + private BigDecimal qty; + + @Schema(description = "冻结数量") + private BigDecimal frozenQty; + + @Schema(description = "计量单位标识", example = "21005") + private String qtyUnitId; + + @Schema(description = "计量单位名称", example = "王五") + private String qtyUnitName; + + @Schema(description = "备注", example = "随便") + private String remark; + + @Schema(description = "来源单据号") + private String extCode; + + @Schema(description = "来源单据类型", example = "1") + private String extType; + + @Schema(description = "来源单据明细号") + private String extDtlCode; + + @Schema(description = "md5") + private String md5; + + @Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "物料编码不能为空") + private String materialCode; + +} \ 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/warehousestrategyconfig/vo/WarehouseStrategyConfigSimpleRespVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/warehousestrategyconfig/vo/WarehouseStrategyConfigSimpleRespVO.java index b119205b..e4402367 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/warehousestrategyconfig/vo/WarehouseStrategyConfigSimpleRespVO.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/warehousestrategyconfig/vo/WarehouseStrategyConfigSimpleRespVO.java @@ -13,4 +13,7 @@ public class WarehouseStrategyConfigSimpleRespVO { @Schema(description = "策略名称", requiredMode = Schema.RequiredMode.REQUIRED) private String strategyName; + @Schema(description = "类处理类型", requiredMode = Schema.RequiredMode.REQUIRED) + private String classType; + } diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/groupplate/GroupPlateDO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/groupplate/GroupPlateDO.java new file mode 100644 index 00000000..0a510abe --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/groupplate/GroupPlateDO.java @@ -0,0 +1,90 @@ +package cn.code.nl.module.wms.dal.dataobject.groupplate; + +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import java.math.BigDecimal; +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_group_plate") +@KeySequence("wms_group_plate_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class GroupPlateDO extends BaseDO { + + /** + * 组盘标识 + */ + @TableId + private Long groupId; + /** + * 载具编码 + */ + private String vehicleCode; + /** + * 状态 + */ + private String status; + /** + * 物料id + */ + private String materialId; + /** + * 批次 + */ + private String pcsn; + /** + * 数量 + */ + private BigDecimal qty; + /** + * 冻结数量 + */ + private BigDecimal frozenQty; + /** + * 计量单位标识 + */ + private String qtyUnitId; + /** + * 计量单位名称 + */ + private String qtyUnitName; + /** + * 备注 + */ + private String remark; + /** + * 来源单据号 + */ + private String extCode; + /** + * 来源单据类型 + */ + private String extType; + /** + * 来源单据明细号 + */ + private String extDtlCode; + /** + * md5 + */ + private String md5; + /** + * 物料编码 + */ + private String materialCode; + + +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/warehousestrategyconfig/WarehouseStrategyConfigDO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/warehousestrategyconfig/WarehouseStrategyConfigDO.java index 057619ec..a360572c 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/warehousestrategyconfig/WarehouseStrategyConfigDO.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/warehousestrategyconfig/WarehouseStrategyConfigDO.java @@ -43,7 +43,7 @@ public class WarehouseStrategyConfigDO extends BaseDO { */ private String classType; /** - * 处理类 + * 参数 */ private String param; /** diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/groupplate/GroupPlateMapper.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/groupplate/GroupPlateMapper.java new file mode 100644 index 00000000..d2501627 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/groupplate/GroupPlateMapper.java @@ -0,0 +1,40 @@ +package cn.code.nl.module.wms.dal.mysql.groupplate; + +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.groupplate.GroupPlateDO; +import org.apache.ibatis.annotations.Mapper; +import cn.code.nl.module.wms.controller.admin.groupplate.vo.*; + +/** + * 组盘记录 Mapper + * + * @author 诺力管理员 + */ +@Mapper +public interface GroupPlateMapper extends BaseMapperX { + + default PageResult selectPage(GroupPlatePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(GroupPlateDO::getVehicleCode, reqVO.getVehicleCode()) + .eqIfPresent(GroupPlateDO::getStatus, reqVO.getStatus()) + .eqIfPresent(GroupPlateDO::getMaterialId, reqVO.getMaterialId()) + .eqIfPresent(GroupPlateDO::getPcsn, reqVO.getPcsn()) + .eqIfPresent(GroupPlateDO::getQty, reqVO.getQty()) + .eqIfPresent(GroupPlateDO::getFrozenQty, reqVO.getFrozenQty()) + .eqIfPresent(GroupPlateDO::getQtyUnitId, reqVO.getQtyUnitId()) + .likeIfPresent(GroupPlateDO::getQtyUnitName, reqVO.getQtyUnitName()) + .eqIfPresent(GroupPlateDO::getRemark, reqVO.getRemark()) + .eqIfPresent(GroupPlateDO::getExtCode, reqVO.getExtCode()) + .eqIfPresent(GroupPlateDO::getExtType, reqVO.getExtType()) + .eqIfPresent(GroupPlateDO::getExtDtlCode, reqVO.getExtDtlCode()) + .eqIfPresent(GroupPlateDO::getMd5, reqVO.getMd5()) + .eqIfPresent(GroupPlateDO::getMaterialCode, reqVO.getMaterialCode()) + .betweenIfPresent(GroupPlateDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(GroupPlateDO::getGroupId)); + } + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/dto/AlleyAveHandleDTO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/dto/AlleyAveHandleDTO.java index 889f4bd3..0b1b3354 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/dto/AlleyAveHandleDTO.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/dto/AlleyAveHandleDTO.java @@ -13,4 +13,204 @@ public class AlleyAveHandleDTO { /** 仓位编码 */ 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 createId; + + /** + * 创建人姓名 + */ + private String createName; + + /** + * 创建时间 + */ + private String createTime; + + /** + * 修改人 + */ + private String updateId; + + /** + * 修改人姓名 + */ + private String updateName; + + /** + * 修改时间 + */ + private String updateTime; + + /** + * 是否启用 + */ + 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; } diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/dto/StrategyStructParam.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/dto/StrategyStructParam.java new file mode 100644 index 00000000..b8d1962f --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/dto/StrategyStructParam.java @@ -0,0 +1,75 @@ +package cn.code.nl.module.wms.manage.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 先入先出参数 + * @Author: liyongde + * @Date: 2026/7/20 16:38 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class StrategyStructParam { + /* + *库区,暂时不用 + */ + private String sectCode; + /** + * 同步单号 + */ + private String extCode; + /** + * 分配的单号 + */ + private String invCode; + /** + * 来源单据类型 + */ + private String extType; + + /** + * 出入库类型 + */ + private String ioType; + /** + * 载具编码 + */ + private String storageVehicleCode; + + /** + * 载具明细:混料的话则是数组 + */ + private List strategyMaters; + + @Data + public static class StrategyMater { + /** + * 物料标识 + */ + private String materialCode; + /** + * id + */ + private String materialId; + /** + * 批次 + */ + private String pcsn; + /** + * 计量单位标识 + */ + private String qtyUnitId; + /** + * 组盘数量 + */ + private BigDecimal qty; + } +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/AlleyAveRuleHandler.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/AlleyAveRuleHandler.java index 4d2cd7d7..38797ccd 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/AlleyAveRuleHandler.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/AlleyAveRuleHandler.java @@ -1,14 +1,18 @@ package cn.code.nl.module.wms.manage.handle.base; -import cn.code.nl.framework.common.exception.ServiceException; +import cn.code.nl.framework.common.exception.util.ServiceExceptionUtil; +import cn.code.nl.module.wms.dal.dataobject.structAttr.StrucAttrDO; +import cn.code.nl.module.wms.enums.ErrorCodeConstants; import cn.code.nl.module.wms.manage.DecisionManage; -import cn.code.nl.module.wms.manage.dto.AlleyAveHandleDTO; import cn.code.nl.module.wms.manage.dto.AlleyAveHandleParam; +import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * @@ -17,13 +21,37 @@ import java.util.List; */ @Slf4j @Service("alleyAve") -public class AlleyAveRuleHandler extends DecisionManage { +public class AlleyAveRuleHandler extends DecisionManage { @Override - public List handler(List list, AlleyAveHandleParam param) { + public List handler(List list, AlleyAveHandleParam param) { // 判断仓位是否为空 if (CollectionUtils.isEmpty(list)) { - throw new ServiceException(600003, "均衡策略结果:载具号:" + param.getVehicleCode() + "当前分配策略无可用货位"); + throw ServiceExceptionUtil.exception(ErrorCodeConstants.ALLEY_AVE_NO_AVAILABLE_LOCATION, param.getVehicleCode()); } - return List.of(); + /** + * 根据XYZ进行均衡排序:排层列 + */ + String configParam = this.strategyConfig.getParam(); + List configList = JSONObject.parseArray(configParam, String.class); + list.sort((o1, o2) -> { + Integer rowNum1 = o1.getRowNum(); + Integer colNum1 = o1.getColNum(); + Integer layerNum1 = o1.getLayerNum(); + Integer rowNum2 = o2.getRowNum(); + Integer colNum2 = o2.getColNum(); + Integer layerNum2 = o2.getLayerNum(); + HashMap of1 = new HashMap<>(Map.of("x", rowNum1, "y", colNum1, "z", layerNum1)); + HashMap of2 = new HashMap<>(Map.of("x", rowNum2, "y", colNum2, "z", layerNum2)); + for (String sort : configList) { + if (of1.get(sort) > of2.get(sort)) { + return 1; + } + if (of1.get(sort) < of2.get(sort)) { + return -1; + } + } + return 0; + }); + return list.subList(0, Math.min(list.size(), 10)); } } diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/ClusterRuleHandler.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/ClusterRuleHandler.java new file mode 100644 index 00000000..23c8e111 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/ClusterRuleHandler.java @@ -0,0 +1,22 @@ +package cn.code.nl.module.wms.manage.handle.base; + +import cn.code.nl.module.wms.dal.dataobject.structAttr.StrucAttrDO; +import cn.code.nl.module.wms.manage.DecisionManage; +import com.alibaba.fastjson.JSONObject; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * @Author: liyongde + * @Date: 2026/7/20 16:44 + */ +@Service("cluster") +public class ClusterRuleHandler extends DecisionManage { + + @Override + public List handler(List list, JSONObject param) { + return List.of(); + } +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/FIFORuleHandler.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/FIFORuleHandler.java new file mode 100644 index 00000000..a0652be1 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/manage/handle/base/FIFORuleHandler.java @@ -0,0 +1,25 @@ +package cn.code.nl.module.wms.manage.handle.base; + +import cn.code.nl.module.wms.dal.dataobject.structAttr.StrucAttrDO; +import cn.code.nl.module.wms.manage.DecisionManage; +import cn.code.nl.module.wms.manage.dto.StrategyStructParam; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 先进先出策略 + * @Author: liyongde + * @Date: 2026/7/20 16:23 + */ +@Service("fifo") +@Slf4j +public class FIFORuleHandler extends DecisionManage { + + @Override + public List handler(List list, StrategyStructParam param) { + return list; + } + +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/groupplate/GroupPlateService.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/groupplate/GroupPlateService.java new file mode 100644 index 00000000..83a9918b --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/groupplate/GroupPlateService.java @@ -0,0 +1,62 @@ +package cn.code.nl.module.wms.service.groupplate; + +import java.util.*; +import jakarta.validation.*; +import cn.code.nl.module.wms.controller.admin.groupplate.vo.*; +import cn.code.nl.module.wms.dal.dataobject.groupplate.GroupPlateDO; +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.common.pojo.PageParam; + +/** + * 组盘记录 Service 接口 + * + * @author 诺力管理员 + */ +public interface GroupPlateService { + + /** + * 创建组盘记录 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createGroupPlate(@Valid GroupPlateSaveReqVO createReqVO); + + /** + * 更新组盘记录 + * + * @param updateReqVO 更新信息 + */ + void updateGroupPlate(@Valid GroupPlateSaveReqVO updateReqVO); + + /** + * 删除组盘记录 + * + * @param id 编号 + */ + void deleteGroupPlate(String id); + + /** + * 批量删除组盘记录 + * + * @param ids 编号 + */ + void deleteGroupPlateListByIds(List ids); + + /** + * 获得组盘记录 + * + * @param id 编号 + * @return 组盘记录 + */ + GroupPlateDO getGroupPlate(String id); + + /** + * 获得组盘记录分页 + * + * @param pageReqVO 分页查询 + * @return 组盘记录分页 + */ + PageResult getGroupPlatePage(GroupPlatePageReqVO pageReqVO); + +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/groupplate/GroupPlateServiceImpl.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/groupplate/GroupPlateServiceImpl.java new file mode 100644 index 00000000..1342c681 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/groupplate/GroupPlateServiceImpl.java @@ -0,0 +1,80 @@ +package cn.code.nl.module.wms.service.groupplate; + +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.common.util.object.BeanUtils; +import cn.code.nl.module.wms.controller.admin.groupplate.vo.GroupPlatePageReqVO; +import cn.code.nl.module.wms.controller.admin.groupplate.vo.GroupPlateSaveReqVO; +import cn.code.nl.module.wms.dal.dataobject.groupplate.GroupPlateDO; +import cn.code.nl.module.wms.dal.mysql.groupplate.GroupPlateMapper; +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.GROUP_PLATE_NOT_EXISTS; + +/** + * 组盘记录 Service 实现类 + * + * @author 诺力管理员 + */ +@Service +@Validated +public class GroupPlateServiceImpl implements GroupPlateService { + + @Resource + private GroupPlateMapper groupPlateMapper; + + @Override + public Long createGroupPlate(GroupPlateSaveReqVO createReqVO) { + // 插入 + GroupPlateDO groupPlate = BeanUtils.toBean(createReqVO, GroupPlateDO.class); + groupPlateMapper.insert(groupPlate); + + // 返回 + return groupPlate.getGroupId(); + } + + @Override + public void updateGroupPlate(GroupPlateSaveReqVO updateReqVO) { + // 校验存在 + validateGroupPlateExists(updateReqVO.getGroupId()); + // 更新 + GroupPlateDO updateObj = BeanUtils.toBean(updateReqVO, GroupPlateDO.class); + groupPlateMapper.updateById(updateObj); + } + + @Override + public void deleteGroupPlate(String id) { + // 校验存在 + validateGroupPlateExists(id); + // 删除 + groupPlateMapper.deleteById(id); + } + + @Override + public void deleteGroupPlateListByIds(List ids) { + // 删除 + groupPlateMapper.deleteByIds(ids); + } + + + private void validateGroupPlateExists(String id) { + if (groupPlateMapper.selectById(id) == null) { + throw exception(GROUP_PLATE_NOT_EXISTS); + } + } + + @Override + public GroupPlateDO getGroupPlate(String id) { + return groupPlateMapper.selectById(id); + } + + @Override + public PageResult getGroupPlatePage(GroupPlatePageReqVO pageReqVO) { + return groupPlateMapper.selectPage(pageReqVO); + } + +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/resources/application-mq-dev.yaml b/nl-module-wms/nl-module-wms-server/src/main/resources/application-mq-dev.yaml index 1c2b8847..b0a11c37 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/resources/application-mq-dev.yaml +++ b/nl-module-wms/nl-module-wms-server/src/main/resources/application-mq-dev.yaml @@ -1,7 +1,7 @@ --- #################### MQ 消息队列相关配置 #################### # rocketmq 配置项,对应 RocketMQProperties 配置类 rocketmq: - name-server: 127.0.0.1:9876 + name-server: 192.168.81.193:9876 consumer: wms-task-operate: group: wms-task-status-change-dev-group diff --git a/nl-module-wms/nl-module-wms-server/src/main/resources/application.yaml b/nl-module-wms/nl-module-wms-server/src/main/resources/application.yaml index a3e0c8e7..e715a703 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/resources/application.yaml +++ b/nl-module-wms/nl-module-wms-server/src/main/resources/application.yaml @@ -65,10 +65,10 @@ mybatis-plus: map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。 global-config: db-config: - #id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。 + id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。 # id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库 # id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库 - id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解 +# id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解 logic-delete-value: 1 # 逻辑已删除值(默认为 1) logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) banner: false # 关闭控制台的 Banner 打印 diff --git a/nl-server/src/main/resources/application-dev.yaml b/nl-server/src/main/resources/application-dev.yaml index 655920a7..76d75842 100644 --- a/nl-server/src/main/resources/application-dev.yaml +++ b/nl-server/src/main/resources/application-dev.yaml @@ -78,9 +78,6 @@ xxl: --- #################### 消息队列相关 #################### -# rocketmq 配置项,对应 RocketMQProperties 配置类 -rocketmq: - name-server: 127.0.0.1:9876 # RocketMQ Namesrv spring: # RabbitMQ 配置项,对应 RabbitProperties 配置类 diff --git a/nl-server/src/main/resources/application-mq-dev.yaml b/nl-server/src/main/resources/application-mq-dev.yaml new file mode 100644 index 00000000..b0a11c37 --- /dev/null +++ b/nl-server/src/main/resources/application-mq-dev.yaml @@ -0,0 +1,8 @@ +--- #################### MQ 消息队列相关配置 #################### +# rocketmq 配置项,对应 RocketMQProperties 配置类 +rocketmq: + name-server: 192.168.81.193:9876 + consumer: + wms-task-operate: + group: wms-task-status-change-dev-group + topic: wms-task-status-change-dev-topic \ No newline at end of file diff --git a/nl-server/src/main/resources/application.yaml b/nl-server/src/main/resources/application.yaml index 22ed0606..ec408e0f 100644 --- a/nl-server/src/main/resources/application.yaml +++ b/nl-server/src/main/resources/application.yaml @@ -5,6 +5,9 @@ spring: profiles: active: dev + config: + import: + - optional:classpath:application-mq-${spring.profiles.active}.yaml # 加载 MQ 配置 main: allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 @@ -85,10 +88,10 @@ mybatis-plus: map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。 global-config: db-config: - id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。 +# id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。 # id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库 # id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库 -# id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解 + id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解 logic-delete-value: 1 # 逻辑已删除值(默认为 1) logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) banner: false # 关闭控制台的 Banner 打印 diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/groupplate/index.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/groupplate/index.ts new file mode 100644 index 00000000..a9b90241 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/groupplate/index.ts @@ -0,0 +1,68 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace WmsGroupPlateApi { + /** 组盘记录信息 */ + export interface GroupPlate { + groupId: string; + vehicleCode: string; // 载具编码 + status?: string; // 状态 + materialId: string; // 物料id + pcsn?: string; // 批次 + qty?: number; // 组盘数量 + frozenQty: number; // 冻结数量 + qtyUnitId: string; // 计量单位标识 + qtyUnitName: string; // 计量单位名称 + remark: string; // 备注 + extCode: string; // 来源单据号 + extType: string; // 来源单据类型 + extDtlCode: string; // 来源单据明细号 + md5: string; // md5 + materialCode?: string; // 物料编码 + } +} + +/** 查询组盘记录分页 */ +export function getGroupPlatePage(params: PageParam) { + return requestClient.get>( + '/wms/group-plate/page', + { params }, + ); +} + +/** 查询组盘记录详情 */ +export function getGroupPlate(id: number) { + return requestClient.get( + `/wms/group-plate/get?id=${id}`, + ); +} + +/** 新增组盘记录 */ +export function createGroupPlate(data: WmsGroupPlateApi.GroupPlate) { + return requestClient.post('/wms/group-plate/create', data); +} + +/** 修改组盘记录 */ +export function updateGroupPlate(data: WmsGroupPlateApi.GroupPlate) { + return requestClient.put('/wms/group-plate/update', data); +} + +/** 删除组盘记录 */ +export function deleteGroupPlate(id: number) { + return requestClient.delete(`/wms/group-plate/delete?id=${id}`); +} + +/** 批量删除组盘记录 */ +export function deleteGroupPlateList(ids: number[]) { + return requestClient.delete( + `/wms/group-plate/delete-list?ids=${ids.join(',')}`, + ); +} + +/** 导出组盘记录 */ +export function exportGroupPlate(params: any) { + return requestClient.download('/wms/group-plate/export-excel', { params }); +} + + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/warehousestrategyconfig/index.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/warehousestrategyconfig/index.ts index b278044a..a4292f72 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/warehousestrategyconfig/index.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/warehousestrategyconfig/index.ts @@ -21,6 +21,7 @@ export namespace WmsWarehouseStrategyConfigApi { export interface WarehouseStrategyConfigSimple { strategyCode: string; // 策略编码 strategyName: string; // 策略名称 + classType?: string; // 类处理类型 } } diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/materialbase/components/MaterialSelectModal.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/materialbase/components/MaterialSelectModal.vue new file mode 100644 index 00000000..f9a86181 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/materialbase/components/MaterialSelectModal.vue @@ -0,0 +1,136 @@ + + + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/measureunit/components/MeasureUnitSelectModal.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/measureunit/components/MeasureUnitSelectModal.vue new file mode 100644 index 00000000..965c347f --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/base/measureunit/components/MeasureUnitSelectModal.vue @@ -0,0 +1,113 @@ + + + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/groupplate/data.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/groupplate/data.ts new file mode 100644 index 00000000..0e2778b4 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/groupplate/data.ts @@ -0,0 +1,356 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { WmsGroupPlateApi } from '#/api/wms/groupplate'; + +import dayjs from 'dayjs'; + +import { getRangePickerDefaultProps } from '#/utils'; +import {getDictOptions} from "@vben/hooks"; +import {DICT_TYPE} from "@vben/constants"; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'groupId', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'vehicleCode', + label: '载具编码', + component: 'Input', + componentProps: { + placeholder: '请输入载具编码', + }, + }, + { + fieldName: 'status', + label: '状态', + rules: 'required', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.WMS_GROUP_PLATE_STATUS), + placeholder: '请选择状态', + }, + defaultValue: '00' + }, + { + fieldName: 'materialId', + label: '物料id', + component: 'Input', + componentProps: { + placeholder: '请输入物料id', + }, + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + + { + fieldName: 'materialCode', + label: '物料编码', + rules: 'required', + component: 'Input', + componentProps: { + placeholder: '请输入物料编码', + }, + }, + { + fieldName: 'pcsn', + label: '批次', + rules: 'required', + component: 'Input', + componentProps: { + placeholder: '请输入批次', + }, + }, + { + fieldName: 'qty', + label: '组盘数量', + rules: 'required', + component: 'Input', + componentProps: { + placeholder: '请输入组盘数量', + }, + }, + { + fieldName: 'frozenQty', + label: '冻结数量', + component: 'Input', + componentProps: { + placeholder: '请输入冻结数量', + }, + }, + { + fieldName: 'qtyUnitId', + label: '计量单位标识', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'qtyUnitName', + label: '计量单位', + component: 'Input', + componentProps: { + placeholder: '请输入计量单位名称', + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + componentProps: { + placeholder: '请输入备注', + }, + }, + { + fieldName: 'extCode', + label: '来源单据号', + component: 'Input', + componentProps: { + placeholder: '请输入来源单据号', + }, + }, + { + fieldName: 'extType', + label: '来源单据类型', + component: 'Select', + componentProps: { + options: [], + placeholder: '请选择来源单据类型', + }, + }, + { + fieldName: 'extDtlCode', + label: '来源单据明细号', + component: 'Input', + componentProps: { + placeholder: '请输入来源单据明细号', + }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'vehicleCode', + label: '载具编码', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入载具编码', + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.WMS_GROUP_PLATE_STATUS), + placeholder: '请选择状态', + }, + }, + { + fieldName: 'materialId', + label: '物料id', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入物料id', + }, + }, + { + fieldName: 'materialCode', + label: '物料编码', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入物料编码', + }, + }, + { + fieldName: 'pcsn', + label: '批次', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入批次', + }, + }, + { + fieldName: 'qty', + label: '组盘数量', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入组盘数量', + }, + }, + { + fieldName: 'frozenQty', + label: '冻结数量', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入冻结数量', + }, + }, + { + fieldName: 'qtyUnitName', + label: '计量单位', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入计量单位', + }, + }, + { + fieldName: 'extCode', + label: '来源单据号', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入来源单据号', + }, + }, + { + fieldName: 'extType', + label: '来源单据类型', + component: 'Select', + componentProps: { + allowClear: true, + options: [], + placeholder: '请选择来源单据类型', + }, + }, + { + fieldName: 'extDtlCode', + label: '来源单据明细号', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入来源单据明细号', + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + defaultValue: [ + dayjs().subtract(30, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'), + dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'), + ], + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'checkbox', width: 40 }, + { + field: 'vehicleCode', + title: '载具编码', + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 120, + }, + { + field: 'materialId', + title: '物料id', + minWidth: 120, + }, + { + field: 'pcsn', + title: '批次', + minWidth: 120, + }, + { + field: 'qty', + title: '组盘数量', + minWidth: 120, + }, + { + field: 'frozenQty', + title: '冻结数量', + minWidth: 120, + }, + { + field: 'qtyUnitName', + title: '计量单位名称', + minWidth: 120, + }, + { + field: 'remark', + title: '备注', + minWidth: 120, + }, + { + field: 'extCode', + title: '来源单据号', + minWidth: 120, + }, + { + field: 'extType', + title: '来源单据类型', + minWidth: 120, + }, + { + field: 'extDtlCode', + title: '来源单据明细号', + minWidth: 120, + }, + { + field: 'materialCode', + title: '物料编码', + minWidth: 120, + }, + { + field: 'creator', + title: '创建者', + minWidth: 120, + }, + { + field: 'createTime', + title: '创建时间', + minWidth: 120, + formatter: 'formatDateTime', + }, + { + field: 'updater', + title: '更新者', + minWidth: 120, + }, + { + field: 'updateTime', + title: '更新时间', + minWidth: 120, + formatter: 'formatDateTime', + }, + { + 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/groupplate/index.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/groupplate/index.vue new file mode 100644 index 00000000..f9f194be --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/groupplate/index.vue @@ -0,0 +1,186 @@ + + + \ No newline at end of file diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/groupplate/modules/form.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/groupplate/modules/form.vue new file mode 100644 index 00000000..652f767d --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/groupplate/modules/form.vue @@ -0,0 +1,155 @@ + + + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/data.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/data.ts index 72d38c84..cafef695 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/data.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/data.ts @@ -9,11 +9,30 @@ import {getDictOptions} from "@vben/hooks"; import {DICT_TYPE} from "@vben/constants"; /** 策略配置选项(供表单多选和列表显示使用) */ -export const strategyConfigOptions = ref<{ label: string; value: string }[]>([]); +export const strategyConfigOptions = ref<{ label: string; value: string; classType?: string; disabled?: boolean }[]>([]); /** 策略编码 -> 名称的映射 */ export const strategyNameMap = ref>({}); +/** classType 值 -> 显示文本的映射 */ +const classTypeLabelMap: Record = {}; +function getClassTypeLabel(classType?: string): string { + if (!classType) return ''; + if (!classTypeLabelMap[classType]) { + const dictOptions = getDictOptions(DICT_TYPE.WMS_STRATEGY_CLASS_TYPE); + for (const opt of dictOptions) { + classTypeLabelMap[opt.value] = opt.label; + } + } + return classTypeLabelMap[classType] || classType; +} + +/** 构建规则选项的显示标签:名称(编码)-classTypeLabel */ +export function buildStrategyLabel(item: { strategyCode: string; strategyName: string; classType?: string }): string { + const ctLabel = getClassTypeLabel(item.classType); + return ctLabel ? `${item.strategyName}(${item.strategyCode})-${ctLabel}` : `${item.strategyName}(${item.strategyCode})`; +} + /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ @@ -48,10 +67,17 @@ export function useFormSchema(): VbenFormSchema[] { label: '规则', rules: 'required', component: 'Select', - componentProps: { - mode: 'multiple', - options: strategyConfigOptions, - placeholder: '请选择规则', + componentProps: (values) => { + const selected = values.strategy; + const noSelection = !selected || (Array.isArray(selected) && selected.length === 0); + return { + mode: 'multiple', + options: strategyConfigOptions.value.map((opt) => ({ + ...opt, + disabled: noSelection && opt.classType === '2', + })), + placeholder: '请选择规则', + }; }, }, { diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/index.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/index.vue index 86cc0c26..16c1ae03 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/index.vue +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/index.vue @@ -19,7 +19,7 @@ import { import { getWarehouseStrategyConfigSimpleList } from '#/api/wms/warehousestrategyconfig'; import { $t } from '#/locales'; -import { strategyConfigOptions, strategyNameMap, useGridColumns, useGridFormSchema } from './data'; +import { buildStrategyLabel, strategyConfigOptions, strategyNameMap, useGridColumns, useGridFormSchema } from './data'; import Form from './modules/form.vue'; const [FormModal, formModalApi] = useVbenModal({ @@ -44,8 +44,9 @@ onMounted(async () => { try { const configList = await getWarehouseStrategyConfigSimpleList(); strategyConfigOptions.value = configList.map((item) => ({ - label: `${item.strategyName}(${item.strategyCode})`, + label: buildStrategyLabel(item), value: item.strategyCode, + classType: item.classType, })); const map: Record = {}; configList.forEach((item) => { diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/modules/form.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/modules/form.vue index eb9e0ff1..1f114c18 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/modules/form.vue +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategy/modules/form.vue @@ -12,7 +12,7 @@ import { createWarehouseStrategy, getWarehouseStrategy, updateWarehouseStrategy import { getWarehouseStrategyConfigSimpleList } from '#/api/wms/warehousestrategyconfig'; import { $t } from '#/locales'; -import { strategyConfigOptions, strategyNameMap, useFormSchema } from '../data'; +import { buildStrategyLabel, strategyConfigOptions, strategyNameMap, useFormSchema } from '../data'; const emit = defineEmits(['success']); const formData = ref(); @@ -83,8 +83,9 @@ const [Modal, modalApi] = useVbenModal({ try { const configList = await getWarehouseStrategyConfigSimpleList(); strategyConfigOptions.value = configList.map((item) => ({ - label: `${item.strategyName}(${item.strategyCode})`, + label: buildStrategyLabel(item), value: item.strategyCode, + classType: item.classType, })); // 构建编码 -> 名称映射 const map: Record = {}; diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategyconfig/data.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategyconfig/data.ts index 5246a55c..070c0e9d 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategyconfig/data.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/warehousestrategyconfig/data.ts @@ -53,8 +53,9 @@ export function useFormSchema(): VbenFormSchema[] { fieldName: 'classType', label: '类处理类型', rules: 'required', - component: 'Input', + component: 'Select', componentProps: { + options: getDictOptions(DICT_TYPE.WMS_STRATEGY_CLASS_TYPE), placeholder: '请选择类处理类型', }, }, @@ -144,7 +145,7 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'Select', componentProps: { allowClear: true, - options: [], + options: getDictOptions(DICT_TYPE.WMS_STRATEGY_CLASS_TYPE), placeholder: '请选择类处理类型', }, }, @@ -215,6 +216,10 @@ export function useGridColumns(): VxeTableGridOptions