From 2bac7d1648c1873d7485e893869c8974a011bc12 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Wed, 22 Jul 2026 09:31:40 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat=EF=BC=9A=E8=BD=BD=E5=85=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/wms/enums/ErrorCodeConstants.java | 3 + .../StorageVehicleInfoController.java | 104 +++++ .../vo/StorageVehicleInfoPageReqVO.java | 60 +++ .../vo/StorageVehicleInfoRespVO.java | 90 +++++ .../vo/StorageVehicleInfoSaveReqVO.java | 60 +++ .../StorageVehicleInfoDO.java | 89 +++++ .../StorageVehicleInfoMapper.java | 39 ++ .../StorageVehicleInfoService.java | 62 +++ .../StorageVehicleInfoServiceImpl.java | 85 ++++ .../mapper/groupplate/GroupPlateMapper.xml | 12 + .../StorageVehicleInfoMapper.xml | 12 + .../apps/web-antdv-next/.env.production | 4 +- .../src/api/wms/storagevehicleinfo/index.ts | 67 ++++ .../src/views/wms/storagevehicleinfo/data.ts | 374 ++++++++++++++++++ .../views/wms/storagevehicleinfo/index.vue | 186 +++++++++ .../wms/storagevehicleinfo/modules/form.vue | 82 ++++ 前端Jenkins部署指南.md | 347 ++++++++++++++++ 17 files changed, 1674 insertions(+), 2 deletions(-) create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/StorageVehicleInfoController.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoPageReqVO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoRespVO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoSaveReqVO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/storagevehicleinfo/StorageVehicleInfoDO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/storagevehicleinfo/StorageVehicleInfoMapper.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoService.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoServiceImpl.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/resources/mapper/groupplate/GroupPlateMapper.xml create mode 100644 nl-module-wms/nl-module-wms-server/src/main/resources/mapper/storagevehicleinfo/StorageVehicleInfoMapper.xml create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/index.vue create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/modules/form.vue create mode 100644 前端Jenkins部署指南.md 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 d0d40c5e..51876fd8 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 @@ -19,4 +19,7 @@ public interface ErrorCodeConstants { // ================ 组盘记录相关错误码 ================= ErrorCode GROUP_PLATE_NOT_EXISTS = new ErrorCode(9, "组盘记录不存在"); + + // ========== 载具信息相关错误码 ========== + ErrorCode STORAGE_VEHICLE_INFO_NOT_EXISTS = new ErrorCode(11, "载具信息不存在"); } diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/StorageVehicleInfoController.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/StorageVehicleInfoController.java new file mode 100644 index 00000000..e252e130 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/StorageVehicleInfoController.java @@ -0,0 +1,104 @@ +package cn.code.nl.module.wms.controller.admin.storagevehicleinfo; + +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.storagevehicleinfo.vo.*; +import cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo.StorageVehicleInfoDO; +import cn.code.nl.module.wms.service.storagevehicleinfo.StorageVehicleInfoService; + +@Tag(name = "管理后台 - 载具信息") +@RestController +@RequestMapping("/wms/storage-vehicle-info") +@Validated +public class StorageVehicleInfoController { + + @Resource + private StorageVehicleInfoService storageVehicleInfoService; + + @PostMapping("/create") + @Operation(summary = "创建载具信息") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:create')") + public CommonResult createStorageVehicleInfo(@Valid @RequestBody StorageVehicleInfoSaveReqVO createReqVO) { + return success(storageVehicleInfoService.createStorageVehicleInfo(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新载具信息") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:update')") + public CommonResult updateStorageVehicleInfo(@Valid @RequestBody StorageVehicleInfoSaveReqVO updateReqVO) { + storageVehicleInfoService.updateStorageVehicleInfo(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除载具信息") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:delete')") + public CommonResult deleteStorageVehicleInfo(@RequestParam("id") Long id) { + storageVehicleInfoService.deleteStorageVehicleInfo(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除载具信息") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:delete')") + public CommonResult deleteStorageVehicleInfoList(@RequestParam("ids") List ids) { + storageVehicleInfoService.deleteStorageVehicleInfoListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得载具信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:query')") + public CommonResult getStorageVehicleInfo(@RequestParam("id") Long id) { + StorageVehicleInfoDO storageVehicleInfo = storageVehicleInfoService.getStorageVehicleInfo(id); + return success(BeanUtils.toBean(storageVehicleInfo, StorageVehicleInfoRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得载具信息分页") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:query')") + public CommonResult> getStorageVehicleInfoPage(@Valid StorageVehicleInfoPageReqVO pageReqVO) { + PageResult pageResult = storageVehicleInfoService.getStorageVehicleInfoPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, StorageVehicleInfoRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出载具信息 Excel") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportStorageVehicleInfoExcel(@Valid StorageVehicleInfoPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = storageVehicleInfoService.getStorageVehicleInfoPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "载具信息.xls", "数据", StorageVehicleInfoRespVO.class, + BeanUtils.toBean(list, StorageVehicleInfoRespVO.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/storagevehicleinfo/vo/StorageVehicleInfoPageReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoPageReqVO.java new file mode 100644 index 00000000..6e2dfa21 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoPageReqVO.java @@ -0,0 +1,60 @@ +package cn.code.nl.module.wms.controller.admin.storagevehicleinfo.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 StorageVehicleInfoPageReqVO extends PageParam { + + @Schema(description = "载具编码") + private String storageVehicleCode; + + @Schema(description = "载具名称") + private String storageVehicleName; + + @Schema(description = "一维码") + private String oneCode; + + @Schema(description = "二维码") + private String twoCode; + + @Schema(description = "是否启用") + private Boolean isUsed; + + @Schema(description = "载具类型") + private String storageVehicleType; + + @Schema(description = "载具宽度") + private Integer vehicleWidth; + + @Schema(description = "载具长度") + private Integer vehicleLong; + + @Schema(description = "载具高度") + private Integer vehicleHeight; + + @Schema(description = "托盘重量") + private BigDecimal weigth; + + @Schema(description = "载具是否超仓位") + private String overStructType; + + @Schema(description = "占仓位数") + private Integer occupyStructQty; + + @Schema(description = "木箱号") + private String boxNo; + + @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/storagevehicleinfo/vo/StorageVehicleInfoRespVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoRespVO.java new file mode 100644 index 00000000..e2bbf772 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoRespVO.java @@ -0,0 +1,90 @@ +package cn.code.nl.module.wms.controller.admin.storagevehicleinfo.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 StorageVehicleInfoRespVO { + + private Long storageVehicleId; + + @Schema(description = "载具编码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("载具编码") + private String storageVehicleCode; + + @Schema(description = "载具名称") + @ExcelProperty("载具名称") + private String storageVehicleName; + + @Schema(description = "一维码") + @ExcelProperty("一维码") + private String oneCode; + + @Schema(description = "二维码") + @ExcelProperty("二维码") + private String twoCode; + + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否启用") + private Boolean isUsed; + + @Schema(description = "载具类型", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("载具类型") + private String storageVehicleType; + + @Schema(description = "载具宽度") + @ExcelProperty("载具宽度") + private Integer vehicleWidth; + + @Schema(description = "载具长度") + @ExcelProperty("载具长度") + private Integer vehicleLong; + + @Schema(description = "载具高度") + @ExcelProperty("载具高度") + private Integer vehicleHeight; + + @Schema(description = "托盘重量") + @ExcelProperty("托盘重量") + private BigDecimal weigth; + + @Schema(description = "载具是否超仓位", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("载具是否超仓位") + private String overStructType; + + @Schema(description = "占仓位数", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("占仓位数") + private Integer occupyStructQty; + + @Schema(description = "木箱号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("木箱号") + private String boxNo; + + @Schema(description = "外部标识") + @ExcelProperty("外部标识") + private String extId; + + @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; + +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoSaveReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoSaveReqVO.java new file mode 100644 index 00000000..3a18f05f --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoSaveReqVO.java @@ -0,0 +1,60 @@ +package cn.code.nl.module.wms.controller.admin.storagevehicleinfo.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 StorageVehicleInfoSaveReqVO { + + private Long storageVehicleId; + + @Schema(description = "载具编码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "载具编码不能为空") + private String storageVehicleCode; + + @Schema(description = "载具名称") + private String storageVehicleName; + + @Schema(description = "一维码") + private String oneCode; + + @Schema(description = "二维码") + private String twoCode; + + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否启用不能为空") + private Boolean isUsed; + + @Schema(description = "载具类型", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "载具类型不能为空") + private String storageVehicleType; + + @Schema(description = "载具宽度") + private Integer vehicleWidth; + + @Schema(description = "载具长度") + private Integer vehicleLong; + + @Schema(description = "载具高度") + private Integer vehicleHeight; + + @Schema(description = "托盘重量") + private BigDecimal weigth; + + @Schema(description = "载具是否超仓位", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "载具是否超仓位不能为空") + private String overStructType; + + @Schema(description = "占仓位数", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "占仓位数不能为空") + private Integer occupyStructQty; + + @Schema(description = "木箱号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "木箱号不能为空") + private String boxNo; + +} \ 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/storagevehicleinfo/StorageVehicleInfoDO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/storagevehicleinfo/StorageVehicleInfoDO.java new file mode 100644 index 00000000..db7f6606 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/storagevehicleinfo/StorageVehicleInfoDO.java @@ -0,0 +1,89 @@ +package cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo; + +import lombok.*; +import java.util.*; +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_storage_vehicle_info") +@KeySequence("wms_storage_vehicle_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class StorageVehicleInfoDO extends BaseDO { + + /** + * 载具标识 + */ + @TableId + private Long storageVehicleId; + /** + * 载具编码 + */ + private String storageVehicleCode; + /** + * 载具名称 + */ + private String storageVehicleName; + /** + * 一维码 + */ + private String oneCode; + /** + * 二维码 + */ + private String twoCode; + /** + * 是否启用 + */ + private Boolean isUsed; + /** + * 载具类型 + */ + private String storageVehicleType; + /** + * 载具宽度 + */ + private Integer vehicleWidth; + /** + * 载具长度 + */ + private Integer vehicleLong; + /** + * 载具高度 + */ + private Integer vehicleHeight; + /** + * 托盘重量 + */ + private BigDecimal weigth; + /** + * 载具是否超仓位 + */ + private String overStructType; + /** + * 占仓位数 + */ + private Integer occupyStructQty; + /** + * 木箱号 + */ + private String boxNo; + /** + * 外部标识 + */ + 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/mysql/storagevehicleinfo/StorageVehicleInfoMapper.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/storagevehicleinfo/StorageVehicleInfoMapper.java new file mode 100644 index 00000000..4a29fa40 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/storagevehicleinfo/StorageVehicleInfoMapper.java @@ -0,0 +1,39 @@ +package cn.code.nl.module.wms.dal.mysql.storagevehicleinfo; + +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.storagevehicleinfo.StorageVehicleInfoDO; +import org.apache.ibatis.annotations.Mapper; +import cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo.*; + +/** + * 载具信息 Mapper + * + * @author 诺力管理员 + */ +@Mapper +public interface StorageVehicleInfoMapper extends BaseMapperX { + + default PageResult selectPage(StorageVehicleInfoPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(StorageVehicleInfoDO::getStorageVehicleCode, reqVO.getStorageVehicleCode()) + .likeIfPresent(StorageVehicleInfoDO::getStorageVehicleName, reqVO.getStorageVehicleName()) + .eqIfPresent(StorageVehicleInfoDO::getOneCode, reqVO.getOneCode()) + .eqIfPresent(StorageVehicleInfoDO::getTwoCode, reqVO.getTwoCode()) + .eqIfPresent(StorageVehicleInfoDO::getIsUsed, reqVO.getIsUsed()) + .eqIfPresent(StorageVehicleInfoDO::getStorageVehicleType, reqVO.getStorageVehicleType()) + .eqIfPresent(StorageVehicleInfoDO::getVehicleWidth, reqVO.getVehicleWidth()) + .eqIfPresent(StorageVehicleInfoDO::getVehicleLong, reqVO.getVehicleLong()) + .eqIfPresent(StorageVehicleInfoDO::getVehicleHeight, reqVO.getVehicleHeight()) + .eqIfPresent(StorageVehicleInfoDO::getWeigth, reqVO.getWeigth()) + .eqIfPresent(StorageVehicleInfoDO::getOverStructType, reqVO.getOverStructType()) + .eqIfPresent(StorageVehicleInfoDO::getOccupyStructQty, reqVO.getOccupyStructQty()) + .eqIfPresent(StorageVehicleInfoDO::getBoxNo, reqVO.getBoxNo()) + .betweenIfPresent(StorageVehicleInfoDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(StorageVehicleInfoDO::getStorageVehicleId)); + } + +} \ 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/storagevehicleinfo/StorageVehicleInfoService.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoService.java new file mode 100644 index 00000000..23aefcbc --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoService.java @@ -0,0 +1,62 @@ +package cn.code.nl.module.wms.service.storagevehicleinfo; + +import java.util.*; +import jakarta.validation.*; +import cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo.*; +import cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo.StorageVehicleInfoDO; +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.common.pojo.PageParam; + +/** + * 载具信息 Service 接口 + * + * @author 诺力管理员 + */ +public interface StorageVehicleInfoService { + + /** + * 创建载具信息 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createStorageVehicleInfo(@Valid StorageVehicleInfoSaveReqVO createReqVO); + + /** + * 更新载具信息 + * + * @param updateReqVO 更新信息 + */ + void updateStorageVehicleInfo(@Valid StorageVehicleInfoSaveReqVO updateReqVO); + + /** + * 删除载具信息 + * + * @param id 编号 + */ + void deleteStorageVehicleInfo(Long id); + + /** + * 批量删除载具信息 + * + * @param ids 编号 + */ + void deleteStorageVehicleInfoListByIds(List ids); + + /** + * 获得载具信息 + * + * @param id 编号 + * @return 载具信息 + */ + StorageVehicleInfoDO getStorageVehicleInfo(Long id); + + /** + * 获得载具信息分页 + * + * @param pageReqVO 分页查询 + * @return 载具信息分页 + */ + PageResult getStorageVehicleInfoPage(StorageVehicleInfoPageReqVO 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/storagevehicleinfo/StorageVehicleInfoServiceImpl.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoServiceImpl.java new file mode 100644 index 00000000..4b2581fb --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoServiceImpl.java @@ -0,0 +1,85 @@ +package cn.code.nl.module.wms.service.storagevehicleinfo; + +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.storagevehicleinfo.vo.*; +import cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo.StorageVehicleInfoDO; +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.storagevehicleinfo.StorageVehicleInfoMapper; + +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 StorageVehicleInfoServiceImpl implements StorageVehicleInfoService { + + @Resource + private StorageVehicleInfoMapper storageVehicleInfoMapper; + + @Override + public Long createStorageVehicleInfo(StorageVehicleInfoSaveReqVO createReqVO) { + // 插入 + StorageVehicleInfoDO storageVehicleInfo = BeanUtils.toBean(createReqVO, StorageVehicleInfoDO.class); + storageVehicleInfoMapper.insert(storageVehicleInfo); + + // 返回 + return storageVehicleInfo.getStorageVehicleId(); + } + + @Override + public void updateStorageVehicleInfo(StorageVehicleInfoSaveReqVO updateReqVO) { + // 校验存在 + validateStorageVehicleInfoExists(updateReqVO.getStorageVehicleId()); + // 更新 + StorageVehicleInfoDO updateObj = BeanUtils.toBean(updateReqVO, StorageVehicleInfoDO.class); + storageVehicleInfoMapper.updateById(updateObj); + } + + @Override + public void deleteStorageVehicleInfo(Long id) { + // 校验存在 + validateStorageVehicleInfoExists(id); + // 删除 + storageVehicleInfoMapper.deleteById(id); + } + + @Override + public void deleteStorageVehicleInfoListByIds(List ids) { + // 删除 + storageVehicleInfoMapper.deleteByIds(ids); + } + + + private void validateStorageVehicleInfoExists(Long id) { + if (storageVehicleInfoMapper.selectById(id) == null) { + throw exception(STORAGE_VEHICLE_INFO_NOT_EXISTS); + } + } + + @Override + public StorageVehicleInfoDO getStorageVehicleInfo(Long id) { + return storageVehicleInfoMapper.selectById(id); + } + + @Override + public PageResult getStorageVehicleInfoPage(StorageVehicleInfoPageReqVO pageReqVO) { + return storageVehicleInfoMapper.selectPage(pageReqVO); + } + +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/groupplate/GroupPlateMapper.xml b/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/groupplate/GroupPlateMapper.xml new file mode 100644 index 00000000..21bd592d --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/groupplate/GroupPlateMapper.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/storagevehicleinfo/StorageVehicleInfoMapper.xml b/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/storagevehicleinfo/StorageVehicleInfoMapper.xml new file mode 100644 index 00000000..104b0180 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/storagevehicleinfo/StorageVehicleInfoMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/.env.production b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/.env.production index a8f3d29a..28a7c86c 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/.env.production +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/.env.production @@ -3,7 +3,7 @@ VITE_BASE=/ # 请求路径 VITE_BASE_URL=http://127.0.0.1:48080 # 接口地址 -VITE_GLOB_API_URL=http://127.0.0.1:48080/admin-api +VITE_GLOB_API_URL=/admin-api # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server @@ -23,4 +23,4 @@ VITE_INJECT_APP_LOADING=true VITE_ARCHIVER=true # 验证码的开关 -VITE_APP_CAPTCHA_ENABLE=true \ No newline at end of file +VITE_APP_CAPTCHA_ENABLE=true diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts new file mode 100644 index 00000000..dbf9f062 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts @@ -0,0 +1,67 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace WmsStorageVehicleInfoApi { + /** 载具信息信息 */ + export interface StorageVehicleInfo { + storageVehicleId?: string; + storageVehicleCode?: string; // 载具编码 + storageVehicleName: string; // 载具名称 + oneCode: string; // 一维码 + twoCode: string; // 二维码 + isUsed?: boolean; // 是否启用 + storageVehicleType?: string; // 载具类型 + vehicleWidth: number; // 载具宽度 + vehicleLong: number; // 载具长度 + vehicleHeight: number; // 载具高度 + weigth: number; // 托盘重量 + overStructType?: string; // 载具是否超仓位 + occupyStructQty?: number; // 占仓位数 + boxNo?: string; // 木箱号 + } +} + +/** 查询载具信息分页 */ +export function getStorageVehicleInfoPage(params: PageParam) { + return requestClient.get>( + '/wms/storage-vehicle-info/page', + { params }, + ); +} + +/** 查询载具信息详情 */ +export function getStorageVehicleInfo(id: number) { + return requestClient.get( + `/wms/storage-vehicle-info/get?id=${id}`, + ); +} + +/** 新增载具信息 */ +export function createStorageVehicleInfo(data: WmsStorageVehicleInfoApi.StorageVehicleInfo) { + return requestClient.post('/wms/storage-vehicle-info/create', data); +} + +/** 修改载具信息 */ +export function updateStorageVehicleInfo(data: WmsStorageVehicleInfoApi.StorageVehicleInfo) { + return requestClient.put('/wms/storage-vehicle-info/update', data); +} + +/** 删除载具信息 */ +export function deleteStorageVehicleInfo(id: number) { + return requestClient.delete(`/wms/storage-vehicle-info/delete?id=${id}`); +} + +/** 批量删除载具信息 */ +export function deleteStorageVehicleInfoList(ids: number[]) { + return requestClient.delete( + `/wms/storage-vehicle-info/delete-list?ids=${ids.join(',')}`, + ); +} + +/** 导出载具信息 */ +export function exportStorageVehicleInfo(params: any) { + return requestClient.download('/wms/storage-vehicle-info/export-excel', { params }); +} + + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts new file mode 100644 index 00000000..f7493ae3 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts @@ -0,0 +1,374 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { WmsStorageVehicleInfoApi } from '#/api/wms/storagevehicleinfo'; + +import { getRangePickerDefaultProps } from '#/utils'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'storageVehicleId', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'storageVehicleCode', + label: '载具编码', + component: 'Input', + componentProps: { + disabled: true, + placeholder: '后台自动生成', + }, + }, + { + fieldName: 'storageVehicleName', + label: '载具名称', + component: 'Input', + componentProps: { + placeholder: '请输入载具名称', + }, + }, + { + fieldName: 'oneCode', + label: '一维码', + component: 'Input', + componentProps: { + placeholder: '请输入一维码', + }, + }, + { + fieldName: 'twoCode', + label: '二维码', + component: 'Input', + componentProps: { + placeholder: '请输入二维码', + }, + }, + { + fieldName: 'isUsed', + label: '是否启用', + rules: 'required', + component: 'RadioGroup', + componentProps: { + options: [], + buttonStyle: 'solid', + optionType: 'button', + }, + }, + { + fieldName: 'storageVehicleType', + label: '载具类型', + rules: 'required', + component: 'Select', + componentProps: { + options: [], + placeholder: '请选择载具类型', + }, + }, + { + fieldName: 'vehicleWidth', + label: '载具宽度', + component: 'Input', + componentProps: { + placeholder: '请输入载具宽度', + }, + }, + { + fieldName: 'vehicleLong', + label: '载具长度', + component: 'Input', + componentProps: { + placeholder: '请输入载具长度', + }, + }, + { + fieldName: 'vehicleHeight', + label: '载具高度', + component: 'Input', + componentProps: { + placeholder: '请输入载具高度', + }, + }, + { + fieldName: 'weigth', + label: '托盘重量', + component: 'Input', + componentProps: { + placeholder: '请输入托盘重量', + }, + }, + { + fieldName: 'overStructType', + label: '载具是否超仓位', + rules: 'required', + component: 'Select', + componentProps: { + options: [], + placeholder: '请选择载具是否超仓位', + }, + }, + { + fieldName: 'occupyStructQty', + label: '占仓位数', + rules: 'required', + component: 'Input', + componentProps: { + placeholder: '请输入占仓位数', + }, + }, + { + fieldName: 'boxNo', + label: '木箱号', + rules: 'required', + component: 'Input', + componentProps: { + placeholder: '请输入木箱号', + }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'storageVehicleCode', + label: '载具编码', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入载具编码', + }, + }, + { + fieldName: 'storageVehicleName', + label: '载具名称', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入载具名称', + }, + }, + { + fieldName: 'oneCode', + label: '一维码', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入一维码', + }, + }, + { + fieldName: 'twoCode', + label: '二维码', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入二维码', + }, + }, + { + fieldName: 'isUsed', + label: '是否启用', + component: 'Select', + componentProps: { + allowClear: true, + options: [], + placeholder: '请选择是否启用', + }, + }, + { + fieldName: 'storageVehicleType', + label: '载具类型', + component: 'Select', + componentProps: { + allowClear: true, + options: [], + placeholder: '请选择载具类型', + }, + }, + { + fieldName: 'vehicleWidth', + label: '载具宽度', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入载具宽度', + }, + }, + { + fieldName: 'vehicleLong', + label: '载具长度', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入载具长度', + }, + }, + { + fieldName: 'vehicleHeight', + label: '载具高度', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入载具高度', + }, + }, + { + fieldName: 'weigth', + label: '托盘重量', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入托盘重量', + }, + }, + { + fieldName: 'overStructType', + label: '载具是否超仓位', + component: 'Select', + componentProps: { + allowClear: true, + options: [], + placeholder: '请选择载具是否超仓位', + }, + }, + { + fieldName: 'occupyStructQty', + label: '占仓位数', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入占仓位数', + }, + }, + { + fieldName: 'boxNo', + label: '木箱号', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入木箱号', + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'checkbox', width: 40 }, + { + field: 'storageVehicleCode', + title: '载具编码', + minWidth: 120, + }, + { + field: 'storageVehicleName', + title: '载具名称', + minWidth: 120, + }, + { + field: 'oneCode', + title: '一维码', + minWidth: 120, + }, + { + field: 'twoCode', + title: '二维码', + minWidth: 120, + }, + { + field: 'isUsed', + title: '是否启用', + minWidth: 120, + }, + { + field: 'storageVehicleType', + title: '载具类型', + minWidth: 120, + }, + { + field: 'vehicleWidth', + title: '载具宽度', + minWidth: 120, + }, + { + field: 'vehicleLong', + title: '载具长度', + minWidth: 120, + }, + { + field: 'vehicleHeight', + title: '载具高度', + minWidth: 120, + }, + { + field: 'weigth', + title: '托盘重量', + minWidth: 120, + }, + { + field: 'overStructType', + title: '载具是否超仓位', + minWidth: 120, + }, + { + field: 'occupyStructQty', + title: '占仓位数', + minWidth: 120, + }, + { + field: 'boxNo', + title: '木箱号', + minWidth: 120, + }, + { + field: 'extId', + 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/storagevehicleinfo/index.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/index.vue new file mode 100644 index 00000000..fa5db193 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/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/storagevehicleinfo/modules/form.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/modules/form.vue new file mode 100644 index 00000000..e165c5a4 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/modules/form.vue @@ -0,0 +1,82 @@ + + + diff --git a/前端Jenkins部署指南.md b/前端Jenkins部署指南.md new file mode 100644 index 00000000..6016897f --- /dev/null +++ b/前端Jenkins部署指南.md @@ -0,0 +1,347 @@ +# 前端 Jenkins 部署指南 + +## 一、项目概况 + +| 项目 | 说明 | +|------|------| +| 源码路径 | `nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/` | +| 框架 | Vue 3 + Vite + Ant Design Vue 4(基于 vue-vben-admin 5.7.0) | +| 包管理器 | pnpm 11.7.0(强制,不可用 npm/yarn) | +| Node 版本 | >= 22.18.0(`.node-version` 指定 24.16.0) | +| 构建工具 | Turbo(monorepo 编排)+ Vite(打包) | +| 构建产物 | `apps/web-antdv-next/dist/` | +| 路由模式 | hash 模式(`VITE_ROUTER_HISTORY=hash`) | + +--- + +## 二、环境变量说明 + +构建时通过 `.env.production` 控制关键配置,可按环境覆盖。 + +**文件位置:** `apps/web-antdv-next/.env.production` + +| 变量 | 默认值 | 说明 | +|------|--------|------| +| `VITE_BASE` | `/` | 部署路径前缀,部署在子路径时改为 `/admin/` | +| `VITE_GLOB_API_URL` | `http://127.0.0.1:48080/admin-api` | 后端 API 地址(完整 URL) | +| `VITE_ROUTER_HISTORY` | `hash` | 路由模式,hash 模式无需 nginx 特殊配置 | +| `VITE_COMPRESS` | `none` | 压缩方式(none / gzip / brotli) | +| `VITE_ARCHIVER` | `true` | 是否生成 `dist.zip` | +| `VITE_PWA` | `false` | 是否启用 PWA | + +**多环境覆盖方式**:在 Jenkins 构建步骤中创建 `.env.production.local` 文件覆盖 `VITE_GLOB_API_URL` 等变量,Vite 会优先读取 local 文件。 + +--- + +## 三、Jenkins 流水线(Pipeline) + +### 3.1 声明式流水线(推荐,使用 Docker 镜像自带 Node 环境) + +```groovy +pipeline { + // 使用 Docker 镜像,自带 Node 24 + pnpm,不需要 Jenkins 宿主机装 Node + agent { + docker { + image 'node:24-slim' + args '-u root --memory=4g' + } + } + + // 构建参数,支持按环境选择 + parameters { + choice(name: 'DEPLOY_ENV', choices: ['dev', 'staging', 'prod'], description: '部署环境') + string(name: 'API_BASE_URL', defaultValue: 'http://127.0.0.1:48080/admin-api', description: '后端 API 地址') + } + + environment { + // 源码子目录(仓库根目录下的相对路径) + SOURCE_DIR = 'nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben' + // pnpm 缓存目录,挂到宿主机避免重复下载 + PNPM_HOME = '/root/.local/share/pnpm' + } + + stages { + + // ==================== 第一步:拉取代码 ==================== + stage('Checkout') { + steps { + checkout scm + } + } + + // ==================== 第二步:安装依赖 ==================== + stage('Setup') { + steps { + dir(env.SOURCE_DIR) { + sh 'corepack enable' + sh 'corepack prepare pnpm@11.7.0 --activate' + // 安装依赖(锁定版本) + sh 'pnpm install --frozen-lockfile' + } + } + } + + // ==================== 第三步:代码检查(可选) ==================== + stage('Lint') { + steps { + dir(env.SOURCE_DIR) { + sh 'pnpm run lint || true' + } + } + } + + // ==================== 第四步:构建 ==================== + stage('Build') { + steps { + dir(env.SOURCE_DIR) { + script { + // 根据部署环境覆盖 API 地址 + def apiUrl = params.API_BASE_URL + if (params.DEPLOY_ENV == 'prod') { + apiUrl = 'https://api.your-domain.com/admin-api' + } else if (params.DEPLOY_ENV == 'staging') { + apiUrl = 'https://staging-api.your-domain.com/admin-api' + } + + // 写入环境变量(Vite 构建时读取) + writeFile file: 'apps/web-antdv-next/.env.production.local', text: """ + VITE_GLOB_API_URL=${apiUrl} + """.stripIndent().trim() + + // 执行构建 + sh '''#!/bin/bash + export NODE_OPTIONS="--max-old-space-size=8192" + pnpm run build --filter=@vben/web-antdv-next + ''' + } + } + } + } + + // ==================== 第五步:打包产物 ==================== + stage('Archive') { + steps { + dir(env.SOURCE_DIR) { + script { + def distPath = 'apps/web-antdv-next/dist' + sh "tar -czf dist-${params.DEPLOY_ENV}.tar.gz -C ${distPath} ." + archiveArtifacts artifacts: "dist-${params.DEPLOY_ENV}.tar.gz", fingerprint: true + } + } + } + } + + // ==================== 第六步:部署 ==================== + stage('Deploy') { + when { + expression { params.DEPLOY_ENV == 'dev' || params.DEPLOY_ENV == 'staging' || params.DEPLOY_ENV == 'prod' } + } + steps { + dir(env.SOURCE_DIR) { + script { + def serverIp = '' + def deployPath = '/usr/share/nginx/html/admin' + + if (params.DEPLOY_ENV == 'dev') { serverIp = '192.168.1.10' } + else if (params.DEPLOY_ENV == 'staging') { serverIp = '192.168.1.20' } + else if (params.DEPLOY_ENV == 'prod') { serverIp = '192.168.1.30' } + + sshagent(['deploy-ssh-key']) { + sh """ + ssh root@${serverIp} 'mkdir -p ${deployPath}' + scp dist-${params.DEPLOY_ENV}.tar.gz root@${serverIp}:/tmp/ + ssh root@${serverIp} ' + rm -rf ${deployPath}/* + tar -xzf /tmp/dist-${params.DEPLOY_ENV}.tar.gz -C ${deployPath} + rm -f /tmp/dist-${params.DEPLOY_ENV}.tar.gz + nginx -t && nginx -s reload + ' + """ + } + } + } + } + } + } + + post { + success { echo "构建成功!环境:${params.DEPLOY_ENV}" } + failure { echo "构建失败!请检查日志。" } + always { cleanWs() } + } +} +``` + +### 3.2 简化版流水线(仅构建 + 归档,手动部署) + +```groovy +pipeline { + agent { + docker { + image 'node:24-slim' + args '-u root --memory=4g' + } + } + + parameters { + string(name: 'API_BASE_URL', defaultValue: 'http://127.0.0.1:48080/admin-api', description: '后端 API 地址') + string(name: 'VITE_BASE', defaultValue: '/', description: '部署子路径') + } + + environment { + SOURCE_DIR = 'nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben' + } + + stages { + stage('Checkout') { steps { checkout scm } } + + stage('Install & Build') { + steps { + dir(env.SOURCE_DIR) { + sh 'corepack enable && corepack prepare pnpm@11.7.0 --activate' + sh 'pnpm install --frozen-lockfile' + + writeFile file: 'apps/web-antdv-next/.env.production.local', text: """ + VITE_GLOB_API_URL=${params.API_BASE_URL} + VITE_BASE=${params.VITE_BASE} + """.stripIndent().trim() + + sh ''' + export NODE_OPTIONS="--max-old-space-size=8192" + pnpm run build --filter=@vben/web-antdv-next + ''' + } + } + } + + stage('Package') { + steps { + dir("${env.SOURCE_DIR}/apps/web-antdv-next") { + sh 'tar -czf dist.tar.gz -C dist .' + archiveArtifacts artifacts: 'dist.tar.gz', fingerprint: true + } + } + } + } + + post { + always { cleanWs() } + } +} +``` + +--- + +## 四、Nginx 部署配置 + +项目使用 hash 路由,nginx 配置很简单: + +```nginx +server { + listen 80; + server_name admin.your-domain.com; + + # 前端静态文件 + root /usr/share/nginx/html/admin; + index index.html; + + # hash 路由模式,单页应用标准配置 + location / { + try_files $uri $uri/ /index.html; + } + + # API 反向代理到后端网关 + location /admin-api/ { + proxy_pass http://backend-gateway:48080/admin-api/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + # 静态资源缓存 + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } +} +``` + +--- + +## 五、Docker 部署(可选) + +项目自带 Dockerfile 但默认构建的是 playground 应用,需要调整。推荐新建一个: + +```dockerfile +# Dockerfile 放在 yudao-ui-admin-vben/ 目录下 +# ============ 构建阶段 ============ +FROM node:24-slim AS builder + +RUN npm install -g pnpm@11.7.0 + +WORKDIR /app +COPY pnpm-lock.yaml pnpm-workspace.yaml package.json turbo.json .npmrc ./ +COPY internal/ internal/ +COPY packages/ packages/ +COPY apps/web-antdv-next/ apps/web-antdv-next/ + +RUN pnpm install --frozen-lockfile + +ARG VITE_GLOB_API_URL=http://127.0.0.1:48080/admin-api +ENV VITE_GLOB_API_URL=${VITE_GLOB_API_URL} + +RUN NODE_OPTIONS="--max-old-space-size=8192" pnpm run build --filter=@vben/web-antdv-next + +# ============ 运行阶段 ============ +FROM nginx:stable-alpine + +COPY --from=builder /app/apps/web-antdv-next/dist /usr/share/nginx/html + +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] +``` + +构建镜像: + +```bash +docker build \ + --build-arg VITE_GLOB_API_URL=https://api.your-domain.com/admin-api \ + -t nl-admin-ui:latest \ + . +``` + +--- + +## 六、Jenkins 配置清单 + +在 Jenkins 上配置前需要准备: + +| 配置项 | 说明 | +|--------|------| +| **Node.js 插件** | 安装 Jenkins NodeJS Plugin,添加 Node.js 24.x 安装 | +| **SSH 凭据** | 添加目标服务器的 SSH 私钥(ID 为 `deploy-ssh-key`) | +| **Git 仓库** | 确保 Jenkins 能访问代码仓库 | +| **构建机资源** | 内存 >= 4GB(`NODE_OPTIONS=--max-old-space-size=8192`) | +| **网络** | 构建机能访问 `registry.npmmirror.com`(或换内网 npm 镜像) | + +--- + +## 七、常见问题 + +### Q1:构建报 `pnpm: command not found` + +Jenkins 环境中 `corepack enable` 可能不生效,改用 `npm install -g pnpm@11.7.0`。 + +### Q2:构建 OOM(内存溢出) + +调大 Node 内存限制:`NODE_OPTIONS="--max-old-space-size=8192"`,流水线中已默认设置。 + +### Q3:API 地址不对 + +检查 `.env.production.local` 是否在构建前正确写入,且 `VITE_GLOB_API_URL` 为完整 URL(如 `https://api.your-domain.com/admin-api`)。 + +### Q4:页面 404 白屏 + +确认 nginx 配置了 `try_files $uri $uri/ /index.html`,以及 `VITE_BASE` 与部署路径匹配。 From 73c401477c1f240bfed3ccf93ea0ea3cac0256e6 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Wed, 22 Jul 2026 13:24:30 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat=EF=BC=9A=E8=BD=BD=E5=85=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=A1=A81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yaml | 4 +- .../src/api/wms/groupplate/index.ts | 2 +- .../src/api/wms/storagevehicleinfo/index.ts | 2 +- .../src/views/wms/groupplate/index.vue | 372 +++++++++--------- .../src/views/wms/groupplate/modules/form.vue | 6 +- .../src/views/wms/storagevehicleinfo/data.ts | 85 ++-- .../views/wms/storagevehicleinfo/index.vue | 372 +++++++++--------- .../wms/storagevehicleinfo/modules/form.vue | 6 +- .../src/views/wms/warehousestrategy/data.ts | 2 +- .../packages/constants/src/dict-enum.ts | 2 + 10 files changed, 436 insertions(+), 417 deletions(-) diff --git a/nl-server/src/main/resources/application-dev.yaml b/nl-server/src/main/resources/application-dev.yaml index d852c77d..4d76d57a 100644 --- a/nl-server/src/main/resources/application-dev.yaml +++ b/nl-server/src/main/resources/application-dev.yaml @@ -47,12 +47,12 @@ spring: primary: master datasource: master: - url: jdbc:mysql://127.0.0.1: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.10.41:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root password: root slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 lazy: true # 开启懒加载,保证启动速度 - url: jdbc:mysql://127.0.0.1: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.10.41:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 username: root password: root 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 index 9efd9a02..bf258969 100644 --- 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 @@ -5,7 +5,7 @@ import { requestClient } from '#/api/request'; export namespace WmsGroupPlateApi { /** 组盘记录信息 */ export interface GroupPlate { - groupId: string; + groupId?: number; vehicleCode: string; // 载具编码 status?: string; // 状态 materialId: string; // 物料id diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts index dbf9f062..4ca45508 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts @@ -5,7 +5,7 @@ import { requestClient } from '#/api/request'; export namespace WmsStorageVehicleInfoApi { /** 载具信息信息 */ export interface StorageVehicleInfo { - storageVehicleId?: string; + storageVehicleId?: number; storageVehicleCode?: string; // 载具编码 storageVehicleName: string; // 载具名称 oneCode: string; // 一维码 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 index f9f194be..ffb22cfa 100644 --- 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 @@ -1,186 +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 index 652f767d..b580376d 100644 --- 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 @@ -115,7 +115,7 @@ const [Modal, modalApi] = useVbenModal({ // 提交表单 const data = (await formApi.getValues()) as WmsGroupPlateApi.GroupPlate; try { - await (formData.value?.id ? updateGroupPlate(data) : createGroupPlate(data)); + await (formData.value?.groupId ? updateGroupPlate(data) : createGroupPlate(data)); // 关闭并提示 await modalApi.close(); emit('success'); @@ -131,12 +131,12 @@ const [Modal, modalApi] = useVbenModal({ } // 加载数据 const data = modalApi.getData(); - if (!data || !data.id) { + if (!data || !data.groupId) { return; } modalApi.lock(); try { - formData.value = await getGroupPlate(data.id); + formData.value = await getGroupPlate(data.groupId); // 设置到 values await formApi.setValues(formData.value); } finally { diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts index f7493ae3..8af8fd65 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts @@ -3,6 +3,8 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { WmsStorageVehicleInfoApi } from '#/api/wms/storagevehicleinfo'; import { getRangePickerDefaultProps } from '#/utils'; +import {getDictOptions} from "@vben/hooks"; +import {DICT_TYPE} from "@vben/constants"; /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { @@ -54,10 +56,11 @@ export function useFormSchema(): VbenFormSchema[] { rules: 'required', component: 'RadioGroup', componentProps: { - options: [], + options: getDictOptions(DICT_TYPE.COMMON_TRUE_FALSE, 'boolean'), buttonStyle: 'solid', optionType: 'button', }, + defaultValue: true, }, { fieldName: 'storageVehicleType', @@ -65,39 +68,47 @@ export function useFormSchema(): VbenFormSchema[] { rules: 'required', component: 'Select', componentProps: { - options: [], + options: getDictOptions(DICT_TYPE.WMS_VEHICLE_TYPE), placeholder: '请选择载具类型', }, }, { fieldName: 'vehicleWidth', label: '载具宽度', - component: 'Input', + component: 'InputNumber', componentProps: { + class: '!w-full', + min: 0, placeholder: '请输入载具宽度', }, }, { fieldName: 'vehicleLong', label: '载具长度', - component: 'Input', + component: 'InputNumber', componentProps: { + class: '!w-full', + min: 0, placeholder: '请输入载具长度', }, }, { fieldName: 'vehicleHeight', label: '载具高度', - component: 'Input', + component: 'InputNumber', componentProps: { + class: '!w-full', + min: 0, placeholder: '请输入载具高度', }, }, { fieldName: 'weigth', label: '托盘重量', - component: 'Input', + component: 'InputNumber', componentProps: { + class: '!w-full', + min: 0, placeholder: '请输入托盘重量', }, }, @@ -107,23 +118,25 @@ export function useFormSchema(): VbenFormSchema[] { rules: 'required', component: 'Select', componentProps: { - options: [], + options: getDictOptions(DICT_TYPE.WMS_OVER_STRUCT_TYPE), placeholder: '请选择载具是否超仓位', }, + defaultValue: '00' }, { fieldName: 'occupyStructQty', label: '占仓位数', rules: 'required', - component: 'Input', + component: 'InputNumber', componentProps: { + class: '!w-full', + min: 0, placeholder: '请输入占仓位数', }, }, { fieldName: 'boxNo', label: '木箱号', - rules: 'required', component: 'Input', componentProps: { placeholder: '请输入木箱号', @@ -153,24 +166,6 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请输入载具名称', }, }, - { - fieldName: 'oneCode', - label: '一维码', - component: 'Input', - componentProps: { - allowClear: true, - placeholder: '请输入一维码', - }, - }, - { - fieldName: 'twoCode', - label: '二维码', - component: 'Input', - componentProps: { - allowClear: true, - placeholder: '请输入二维码', - }, - }, { fieldName: 'isUsed', label: '是否启用', @@ -187,15 +182,17 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'Select', componentProps: { allowClear: true, - options: [], + options: getDictOptions(DICT_TYPE.WMS_VEHICLE_TYPE), placeholder: '请选择载具类型', }, }, { fieldName: 'vehicleWidth', label: '载具宽度', - component: 'Input', + component: 'InputNumber', componentProps: { + class: '!w-full', + min: 0, allowClear: true, placeholder: '请输入载具宽度', }, @@ -203,8 +200,10 @@ export function useGridFormSchema(): VbenFormSchema[] { { fieldName: 'vehicleLong', label: '载具长度', - component: 'Input', + component: 'InputNumber', componentProps: { + class: '!w-full', + min: 0, allowClear: true, placeholder: '请输入载具长度', }, @@ -212,8 +211,10 @@ export function useGridFormSchema(): VbenFormSchema[] { { fieldName: 'vehicleHeight', label: '载具高度', - component: 'Input', + component: 'InputNumber', componentProps: { + class: '!w-full', + min: 0, allowClear: true, placeholder: '请输入载具高度', }, @@ -221,8 +222,10 @@ export function useGridFormSchema(): VbenFormSchema[] { { fieldName: 'weigth', label: '托盘重量', - component: 'Input', + component: 'InputNumber', componentProps: { + class: '!w-full', + min: 0, allowClear: true, placeholder: '请输入托盘重量', }, @@ -233,15 +236,17 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'Select', componentProps: { allowClear: true, - options: [], + options: getDictOptions(DICT_TYPE.WMS_OVER_STRUCT_TYPE, 'boolean'), placeholder: '请选择载具是否超仓位', }, }, { fieldName: 'occupyStructQty', label: '占仓位数', - component: 'Input', + component: 'InputNumber', componentProps: { + class: '!w-full', + min: 0, allowClear: true, placeholder: '请输入占仓位数', }, @@ -295,11 +300,19 @@ export function useGridColumns(): VxeTableGridOptions -import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { WmsStorageVehicleInfoApi } from '#/api/wms/storagevehicleinfo'; - -import { ref } from 'vue'; - -import { confirm, Page, useVbenModal } from '@vben/common-ui'; -import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; - -import { message } from 'antdv-next'; - -import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; -import { - deleteStorageVehicleInfo, - deleteStorageVehicleInfoList, - exportStorageVehicleInfo, - getStorageVehicleInfoPage, -} from '#/api/wms/storagevehicleinfo'; -import { $t } from '#/locales'; - -import { useGridColumns, useGridFormSchema } from './data'; -import Form from './modules/form.vue'; - -const [FormModal, formModalApi] = useVbenModal({ - connectedComponent: Form, - destroyOnClose: true, -}); - -/** 刷新表格 */ -function handleRefresh() { - gridApi.query(); -} - -/** 创建载具信息 */ -function handleCreate() { - formModalApi.setData(null).open(); -} - -/** 编辑载具信息 */ -function handleEdit(row: WmsStorageVehicleInfoApi.StorageVehicleInfo) { - formModalApi.setData(row).open(); -} - -/** 删除载具信息 */ -async function handleDelete(row: WmsStorageVehicleInfoApi.StorageVehicleInfo) { - const hideLoading = message.loading({ - content: $t('ui.actionMessage.deleting', [row.id]), - duration: 0, - }); - try { - await deleteStorageVehicleInfo(row.id!); - message.success($t('ui.actionMessage.deleteSuccess', [row.id])); - handleRefresh(); - } finally { - hideLoading(); - } -} - -/** 批量删除载具信息 */ -async function handleDeleteBatch() { - await confirm($t('ui.actionMessage.deleteBatchConfirm')); - const hideLoading = message.loading({ - content: $t('ui.actionMessage.deletingBatch'), - duration: 0, - }); - try { - await deleteStorageVehicleInfoList(checkedIds.value); - checkedIds.value = []; - message.success($t('ui.actionMessage.deleteSuccess')); - handleRefresh(); - } finally { - hideLoading(); - } -} - -const checkedIds = ref([]); -function handleRowCheckboxChange({ - records, -}: { - records: WmsStorageVehicleInfoApi.StorageVehicleInfo[]; -}) { - checkedIds.value = records.map((item) => item.id!); -} - -/** 导出表格 */ -async function handleExport() { - const data = await exportStorageVehicleInfo(await gridApi.formApi.getValues()); - downloadFileFromBlobPart({ fileName: '载具信息.xls', source: data }); -} - - -const [Grid, gridApi] = useVbenVxeGrid({ - formOptions: { - schema: useGridFormSchema(), - }, - gridOptions: { - columns: useGridColumns(), - height: 'auto', - keepSource: true, - proxyConfig: { - ajax: { - query: async ({ page }, formValues) => { - return await getStorageVehicleInfoPage({ - pageNo: page.currentPage, - pageSize: page.pageSize, - ...formValues, - }); - }, - }, - }, - rowConfig: { - keyField: 'id', - isHover: true, - }, - toolbarConfig: { - refresh: true, - search: true, - }, - } as VxeTableGridOptions, - gridEvents: { - checkboxAll: handleRowCheckboxChange, - checkboxChange: handleRowCheckboxChange, - }, -}); - - - \ 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/storagevehicleinfo/modules/form.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/modules/form.vue index e165c5a4..610bf122 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/modules/form.vue +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/modules/form.vue @@ -44,7 +44,7 @@ const [Modal, modalApi] = useVbenModal({ // 提交表单 const data = (await formApi.getValues()) as WmsStorageVehicleInfoApi.StorageVehicleInfo; try { - await (formData.value?.id ? updateStorageVehicleInfo(data) : createStorageVehicleInfo(data)); + await (formData.value?.storageVehicleId ? updateStorageVehicleInfo(data) : createStorageVehicleInfo(data)); // 关闭并提示 await modalApi.close(); emit('success'); @@ -60,12 +60,12 @@ const [Modal, modalApi] = useVbenModal({ } // 加载数据 const data = modalApi.getData(); - if (!data || !data.id) { + if (!data || !data.storageVehicleId) { return; } modalApi.lock(); try { - formData.value = await getStorageVehicleInfo(data.id); + formData.value = await getStorageVehicleInfo(data.storageVehicleId); // 设置到 values await formApi.setValues(formData.value); } finally { 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 cafef695..d8ec9549 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 @@ -21,7 +21,7 @@ function getClassTypeLabel(classType?: string): string { if (!classTypeLabelMap[classType]) { const dictOptions = getDictOptions(DICT_TYPE.WMS_STRATEGY_CLASS_TYPE); for (const opt of dictOptions) { - classTypeLabelMap[opt.value] = opt.label; + classTypeLabelMap[String(opt.value)] = opt.label; } } return classTypeLabelMap[classType] || classType; 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 d5e726d7..14f2124e 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 @@ -285,6 +285,8 @@ const WMS_DICT = { WMS_LOCK_TYPE: 'wms_lock_type', // WMS 锁定类型 WMS_STRATEGY_CLASS_TYPE: 'wms_strategy_class_type', // WMS 处理类类型 WMS_GROUP_PLATE_STATUS: 'wms_group_plate_status', // 组盘记录 + WMS_VEHICLE_TYPE: 'wms_vehicle_type', // 载具类型 + WMS_OVER_STRUCT_TYPE: 'wms_over_struct_type', // 是否超限 } as const; /** ========== TASK - 任务管理模块 ========== */ From d9e76de03903c3624f9848c23277cdcbfd0d05ae Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Wed, 22 Jul 2026 14:27:30 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat=EF=BC=9A=E8=BD=BD=E5=85=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/CodeGenController.java | 8 +- .../dal/mysql/codegen/CodeSequenceMapper.java | 2 + nl-module-wms/nl-module-wms-server/pom.xml | 5 + .../vo/StorageVehicleInfoSaveReqVO.java | 5 - .../StorageVehicleInfoDO.java | 174 +++++++++--------- .../StorageVehicleInfoMapper.java | 1 - .../rpc/config/RpcConfiguration.java | 15 ++ .../StorageVehicleInfoServiceImpl.java | 12 +- .../src/api/wms/storagevehicleinfo/index.ts | 2 +- .../src/views/wms/storagevehicleinfo/data.ts | 22 --- 10 files changed, 124 insertions(+), 122 deletions(-) rename nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/{controller => }/api/CodeGenController.java (90%) create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/framework/rpc/config/RpcConfiguration.java diff --git a/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/controller/api/CodeGenController.java b/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/api/CodeGenController.java similarity index 90% rename from nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/controller/api/CodeGenController.java rename to nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/api/CodeGenController.java index 8cb27cb1..5da28e09 100644 --- a/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/controller/api/CodeGenController.java +++ b/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/api/CodeGenController.java @@ -1,6 +1,7 @@ -package cn.code.nl.module.base.controller.api; +package cn.code.nl.module.base.api; import cn.code.nl.framework.common.pojo.CommonResult; +import cn.code.nl.module.base.api.codegen.CodeGenApi; import cn.code.nl.module.base.api.codegen.dto.CodeGenerateReqDTO; import cn.code.nl.module.base.service.codegen.CodeGenService; import io.swagger.v3.oas.annotations.Operation; @@ -26,7 +27,7 @@ import static cn.code.nl.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/rpc-api/base/code-gen") @Validated -public class CodeGenController { +public class CodeGenController implements CodeGenApi { @Resource private CodeGenService codeGenService; @@ -36,6 +37,7 @@ public class CodeGenController { */ @PostMapping("/generate") @Operation(summary = "生成编码") + @Override public CommonResult generate(@Valid @RequestBody CodeGenerateReqDTO reqDTO) { String code = codeGenService.generate(reqDTO.getRuleCode()); return success(code); @@ -43,9 +45,9 @@ public class CodeGenController { @GetMapping("/preview") @Operation(summary = "预览下一个编码(不消耗序号)") + @Override public CommonResult preview(@RequestParam("ruleCode") String ruleCode) { String code = codeGenService.preview(ruleCode); return success(code); } - } diff --git a/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/mysql/codegen/CodeSequenceMapper.java b/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/mysql/codegen/CodeSequenceMapper.java index 9a8a82b3..4682cd9d 100644 --- a/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/mysql/codegen/CodeSequenceMapper.java +++ b/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/mysql/codegen/CodeSequenceMapper.java @@ -2,6 +2,7 @@ package cn.code.nl.module.base.dal.mysql.codegen; import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX; import cn.code.nl.module.base.dal.dataobject.codegen.CodeSequenceDO; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -35,6 +36,7 @@ public interface CodeSequenceMapper extends BaseMapperX { * @param maxValue 最大值上限 * @return 更新行数 */ + @InterceptorIgnore(dataPermission = "true") int updateCurrentValueBySegment(@Param("ruleId") Long ruleId, @Param("resetKey") String resetKey, @Param("step") int step, diff --git a/nl-module-wms/nl-module-wms-server/pom.xml b/nl-module-wms/nl-module-wms-server/pom.xml index ef12b750..be10ce4c 100644 --- a/nl-module-wms/nl-module-wms-server/pom.xml +++ b/nl-module-wms/nl-module-wms-server/pom.xml @@ -42,6 +42,11 @@ nl-module-task-api ${revision} + + cn.nl.cloud + nl-module-base-api + ${revision} + diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoSaveReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoSaveReqVO.java index 3a18f05f..bcdc1f0b 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoSaveReqVO.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoSaveReqVO.java @@ -13,7 +13,6 @@ public class StorageVehicleInfoSaveReqVO { private Long storageVehicleId; @Schema(description = "载具编码", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "载具编码不能为空") private String storageVehicleCode; @Schema(description = "载具名称") @@ -53,8 +52,4 @@ public class StorageVehicleInfoSaveReqVO { @NotNull(message = "占仓位数不能为空") private Integer occupyStructQty; - @Schema(description = "木箱号", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "木箱号不能为空") - private String boxNo; - } \ 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/storagevehicleinfo/StorageVehicleInfoDO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/storagevehicleinfo/StorageVehicleInfoDO.java index db7f6606..267d7d63 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/storagevehicleinfo/StorageVehicleInfoDO.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/storagevehicleinfo/StorageVehicleInfoDO.java @@ -1,89 +1,85 @@ -package cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo; - -import lombok.*; -import java.util.*; -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_storage_vehicle_info") -@KeySequence("wms_storage_vehicle_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class StorageVehicleInfoDO extends BaseDO { - - /** - * 载具标识 - */ - @TableId - private Long storageVehicleId; - /** - * 载具编码 - */ - private String storageVehicleCode; - /** - * 载具名称 - */ - private String storageVehicleName; - /** - * 一维码 - */ - private String oneCode; - /** - * 二维码 - */ - private String twoCode; - /** - * 是否启用 - */ - private Boolean isUsed; - /** - * 载具类型 - */ - private String storageVehicleType; - /** - * 载具宽度 - */ - private Integer vehicleWidth; - /** - * 载具长度 - */ - private Integer vehicleLong; - /** - * 载具高度 - */ - private Integer vehicleHeight; - /** - * 托盘重量 - */ - private BigDecimal weigth; - /** - * 载具是否超仓位 - */ - private String overStructType; - /** - * 占仓位数 - */ - private Integer occupyStructQty; - /** - * 木箱号 - */ - private String boxNo; - /** - * 外部标识 - */ - private String extId; - - -} \ No newline at end of file +package cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo; + +import lombok.*; +import java.util.*; +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_storage_vehicle_info") +@KeySequence("wms_storage_vehicle_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class StorageVehicleInfoDO extends BaseDO { + + /** + * 载具标识 + */ + @TableId + private Long storageVehicleId; + /** + * 载具编码 + */ + private String storageVehicleCode; + /** + * 载具名称 + */ + private String storageVehicleName; + /** + * 一维码 + */ + private String oneCode; + /** + * 二维码 + */ + private String twoCode; + /** + * 是否启用 + */ + private Boolean isUsed; + /** + * 载具类型 + */ + private String storageVehicleType; + /** + * 载具宽度 + */ + private Integer vehicleWidth; + /** + * 载具长度 + */ + private Integer vehicleLong; + /** + * 载具高度 + */ + private Integer vehicleHeight; + /** + * 托盘重量 + */ + private BigDecimal weigth; + /** + * 载具是否超仓位 + */ + private String overStructType; + /** + * 占仓位数 + */ + private Integer occupyStructQty; + /** + * 外部标识 + */ + private String extId; + + +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/storagevehicleinfo/StorageVehicleInfoMapper.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/storagevehicleinfo/StorageVehicleInfoMapper.java index 4a29fa40..c9621c15 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/storagevehicleinfo/StorageVehicleInfoMapper.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/storagevehicleinfo/StorageVehicleInfoMapper.java @@ -31,7 +31,6 @@ public interface StorageVehicleInfoMapper extends BaseMapperX generate = codeGenApi.generate(codeGenerateReqDTO); + storageVehicleInfo.setStorageVehicleCode(generate.getData()); storageVehicleInfoMapper.insert(storageVehicleInfo); - // 返回 return storageVehicleInfo.getStorageVehicleId(); } diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts index 4ca45508..86e0db08 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts @@ -18,7 +18,7 @@ export namespace WmsStorageVehicleInfoApi { weigth: number; // 托盘重量 overStructType?: string; // 载具是否超仓位 occupyStructQty?: number; // 占仓位数 - boxNo?: string; // 木箱号 + } } diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts index 8af8fd65..062790e5 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts @@ -134,14 +134,6 @@ export function useFormSchema(): VbenFormSchema[] { placeholder: '请输入占仓位数', }, }, - { - fieldName: 'boxNo', - label: '木箱号', - component: 'Input', - componentProps: { - placeholder: '请输入木箱号', - }, - }, ]; } @@ -251,15 +243,6 @@ export function useGridFormSchema(): VbenFormSchema[] { placeholder: '请输入占仓位数', }, }, - { - fieldName: 'boxNo', - label: '木箱号', - component: 'Input', - componentProps: { - allowClear: true, - placeholder: '请输入木箱号', - }, - }, { fieldName: 'createTime', label: '创建时间', @@ -348,11 +331,6 @@ export function useGridColumns(): VxeTableGridOptions Date: Wed, 22 Jul 2026 16:36:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat=EF=BC=9A=E8=BD=BD=E5=85=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=89=B9=E9=87=8F=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/enums/LogRecordConstants.java | 4 + .../StorageVehicleInfoController.java | 7 ++ .../StorageVehicleInfoBatchCreateReqVO.java | 26 ++++++ .../groupplate/GroupPlateServiceImpl.java | 8 ++ .../StorageVehicleInfoService.java | 9 ++ .../StorageVehicleInfoServiceImpl.java | 28 ++++++ .../src/api/wms/storagevehicleinfo/index.ts | 12 +++ .../src/views/wms/storagevehicleinfo/data.ts | 30 +++---- .../views/wms/storagevehicleinfo/index.vue | 19 ++++ .../storagevehicleinfo/modules/batch-form.vue | 90 +++++++++++++++++++ 10 files changed, 213 insertions(+), 20 deletions(-) create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoBatchCreateReqVO.java create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/modules/batch-form.vue diff --git a/nl-module-system/nl-module-system-api/src/main/java/cn/code/nl/module/system/enums/LogRecordConstants.java b/nl-module-system/nl-module-system-api/src/main/java/cn/code/nl/module/system/enums/LogRecordConstants.java index d2cc6d94..92daa953 100644 --- a/nl-module-system/nl-module-system-api/src/main/java/cn/code/nl/module/system/enums/LogRecordConstants.java +++ b/nl-module-system/nl-module-system-api/src/main/java/cn/code/nl/module/system/enums/LogRecordConstants.java @@ -30,4 +30,8 @@ public interface LogRecordConstants { String SYSTEM_ROLE_DELETE_SUB_TYPE = "删除角色"; String SYSTEM_ROLE_DELETE_SUCCESS = "删除了角色【{{#role.name}}】"; + // ======================= WMS_GROUP 组盘信息 ======================= + String WMS_GROUP_PLATE = "组盘信息"; + String WMS_GROUP_PLATE_UPDATE = "修改组盘信息"; + String WMS_GROUP_PLATE_SUCCESS = "{{#loginUserNickname}} 更新了组盘信息: {{#group.vehicleCode}}"; } diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/StorageVehicleInfoController.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/StorageVehicleInfoController.java index e252e130..cd8536dd 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/StorageVehicleInfoController.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/StorageVehicleInfoController.java @@ -45,6 +45,13 @@ public class StorageVehicleInfoController { return success(storageVehicleInfoService.createStorageVehicleInfo(createReqVO)); } + @PostMapping("/batch-create") + @Operation(summary = "批量生成载具信息") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:create')") + public CommonResult> batchCreateStorageVehicleInfo(@Valid @RequestBody StorageVehicleInfoBatchCreateReqVO reqVO) { + return success(storageVehicleInfoService.batchCreateStorageVehicleInfo(reqVO)); + } + @PutMapping("/update") @Operation(summary = "更新载具信息") @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:update')") diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoBatchCreateReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoBatchCreateReqVO.java new file mode 100644 index 00000000..58bcf6b3 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleinfo/vo/StorageVehicleInfoBatchCreateReqVO.java @@ -0,0 +1,26 @@ +package cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import lombok.Data; + +@Schema(description = "管理后台 - 载具信息批量生成 Request VO") +@Data +public class StorageVehicleInfoBatchCreateReqVO { + + @Schema(description = "载具类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "MTP") + @NotEmpty(message = "载具类型不能为空") + private String storageVehicleType; + + @Schema(description = "载具类型中文名", requiredMode = Schema.RequiredMode.REQUIRED, example = "木托盘") + @NotEmpty(message = "载具类型中文名不能为空") + private String storageVehicleTypeLabel; + + @Schema(description = "生成数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "5") + @NotNull(message = "生成数量不能为空") + @Min(value = 1, message = "生成数量至少为1") + private Integer count; + +} 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 index 1342c681..88fa1077 100644 --- 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 @@ -2,10 +2,13 @@ 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.framework.security.core.util.SecurityFrameworkUtils; 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 com.mzt.logapi.context.LogRecordContext; +import com.mzt.logapi.starter.annotation.LogRecord; import jakarta.annotation.Resource; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -13,6 +16,7 @@ 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.system.enums.LogRecordConstants.*; import static cn.code.nl.module.wms.enums.ErrorCodeConstants.GROUP_PLATE_NOT_EXISTS; /** @@ -38,12 +42,16 @@ public class GroupPlateServiceImpl implements GroupPlateService { } @Override + @LogRecord(type = WMS_GROUP_PLATE, subType = WMS_GROUP_PLATE_UPDATE, bizNo = "{{#updateReqVO.groupId}}", + success = WMS_GROUP_PLATE_SUCCESS) public void updateGroupPlate(GroupPlateSaveReqVO updateReqVO) { // 校验存在 validateGroupPlateExists(updateReqVO.getGroupId()); // 更新 GroupPlateDO updateObj = BeanUtils.toBean(updateReqVO, GroupPlateDO.class); groupPlateMapper.updateById(updateObj); + LogRecordContext.putVariable("loginUserNickname", SecurityFrameworkUtils.getLoginUserNickname()); + LogRecordContext.putVariable("group", updateObj); } @Override diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoService.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoService.java index 23aefcbc..6912abaa 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoService.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoService.java @@ -6,6 +6,7 @@ import cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo.*; import cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo.StorageVehicleInfoDO; import cn.code.nl.framework.common.pojo.PageResult; import cn.code.nl.framework.common.pojo.PageParam; +import cn.code.nl.framework.common.pojo.CommonResult; /** * 载具信息 Service 接口 @@ -59,4 +60,12 @@ public interface StorageVehicleInfoService { */ PageResult getStorageVehicleInfoPage(StorageVehicleInfoPageReqVO pageReqVO); + /** + * 批量生成载具信息 + * + * @param reqVO 批量生成请求 + * @return 生成的载具ID列表 + */ + List batchCreateStorageVehicleInfo(StorageVehicleInfoBatchCreateReqVO reqVO); + } \ 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/storagevehicleinfo/StorageVehicleInfoServiceImpl.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoServiceImpl.java index 3f3b7d26..b7bbac83 100644 --- a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoServiceImpl.java +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleinfo/StorageVehicleInfoServiceImpl.java @@ -10,6 +10,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.regex.*; import cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo.*; import cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo.StorageVehicleInfoDO; import cn.code.nl.framework.common.pojo.PageResult; @@ -52,6 +53,33 @@ public class StorageVehicleInfoServiceImpl implements StorageVehicleInfoService return storageVehicleInfo.getStorageVehicleId(); } + @Override + @Transactional(rollbackFor = Exception.class) + public List batchCreateStorageVehicleInfo(StorageVehicleInfoBatchCreateReqVO reqVO) { + List ids = new ArrayList<>(); + // 提取编码中数字部分的正则 + Pattern numPattern = Pattern.compile("\\d+"); + for (int i = 0; i < reqVO.getCount(); i++) { + CodeGenerateReqDTO genReq = new CodeGenerateReqDTO(); + genReq.setRuleCode(reqVO.getStorageVehicleType() + "_CODE"); + CommonResult result = codeGenApi.generate(genReq); + String code = result.getData(); + // 提取编码中的数字部分 + String numSuffix = ""; + Matcher matcher = numPattern.matcher(code); + if (matcher.find()) { + numSuffix = matcher.group(); + } + StorageVehicleInfoDO info = new StorageVehicleInfoDO(); + info.setStorageVehicleCode(code); + info.setStorageVehicleName(reqVO.getStorageVehicleTypeLabel() + numSuffix); + info.setStorageVehicleType(reqVO.getStorageVehicleType()); + storageVehicleInfoMapper.insert(info); + ids.add(info.getStorageVehicleId()); + } + return ids; + } + @Override public void updateStorageVehicleInfo(StorageVehicleInfoSaveReqVO updateReqVO) { // 校验存在 diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts index 86e0db08..4203b3e7 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleinfo/index.ts @@ -59,6 +59,18 @@ export function deleteStorageVehicleInfoList(ids: number[]) { ); } +/** 批量生成载具信息 */ +export interface BatchCreateStorageVehicleInfoReqVO { + storageVehicleType: string; + storageVehicleTypeLabel: string; + count: number; +} + +/** 批量生成载具信息 */ +export function batchCreateStorageVehicleInfo(data: BatchCreateStorageVehicleInfoReqVO) { + return requestClient.post('/wms/storage-vehicle-info/batch-create', data); +} + /** 导出载具信息 */ export function exportStorageVehicleInfo(params: any) { return requestClient.download('/wms/storage-vehicle-info/export-excel', { params }); diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts index 062790e5..4669b6d9 100644 --- a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleinfo/data.ts @@ -269,16 +269,16 @@ export function useGridColumns(): VxeTableGridOptions +