From efe6e3b0d5fc2c572dc5c64ab65ae3792dde3d44 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Thu, 23 Jul 2026 09:28:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BD=BD=E5=85=B7=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/wms/enums/ErrorCodeConstants.java | 3 + .../StorageVehicleExtController.java | 104 ++++++ .../vo/StorageVehicleExtPageReqVO.java | 36 +++ .../vo/StorageVehicleExtRespVO.java | 72 +++++ .../vo/StorageVehicleExtSaveReqVO.java | 58 ++++ .../StorageVehicleExtDO.java | 90 ++++++ .../StorageVehicleExtMapper.java | 31 ++ .../StorageVehicleExtService.java | 62 ++++ .../StorageVehicleExtServiceImpl.java | 85 +++++ .../StorageVehicleExtMapper.xml | 12 + .../src/api/wms/storagevehicleext/index.ts | 67 ++++ .../src/views/wms/storagevehicleext/data.ts | 295 ++++++++++++++++++ .../src/views/wms/storagevehicleext/index.vue | 186 +++++++++++ .../wms/storagevehicleext/modules/form.vue | 119 +++++++ 14 files changed, 1220 insertions(+) create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/StorageVehicleExtController.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/vo/StorageVehicleExtPageReqVO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/vo/StorageVehicleExtRespVO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/vo/StorageVehicleExtSaveReqVO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/storagevehicleext/StorageVehicleExtDO.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/storagevehicleext/StorageVehicleExtMapper.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleext/StorageVehicleExtService.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleext/StorageVehicleExtServiceImpl.java create mode 100644 nl-module-wms/nl-module-wms-server/src/main/resources/mapper/storagevehicleext/StorageVehicleExtMapper.xml create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleext/index.ts create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/data.ts create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/index.vue create mode 100644 nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/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 9dc5a584..f95fc137 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 @@ -28,4 +28,7 @@ public interface ErrorCodeConstants { // ========== 载具信息相关错误码 ========== ErrorCode STORAGE_VEHICLE_INFO_NOT_EXISTS = new ErrorCode(11, "载具信息不存在"); + + // ========== 载具扩展属性信息 ========== + ErrorCode STORAGE_VEHICLE_EXT_NOT_EXISTS = new ErrorCode(12, "载具扩展属性信息不存在"); } diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/StorageVehicleExtController.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/StorageVehicleExtController.java new file mode 100644 index 00000000..42dcb612 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/StorageVehicleExtController.java @@ -0,0 +1,104 @@ +package cn.code.nl.module.wms.controller.admin.storagevehicleext; + +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.storagevehicleext.vo.*; +import cn.code.nl.module.wms.dal.dataobject.storagevehicleext.StorageVehicleExtDO; +import cn.code.nl.module.wms.service.storagevehicleext.StorageVehicleExtService; + +@Tag(name = "管理后台 - 载具扩展属性信息") +@RestController +@RequestMapping("/wms/storage-vehicle-ext") +@Validated +public class StorageVehicleExtController { + + @Resource + private StorageVehicleExtService storageVehicleExtService; + + @PostMapping("/create") + @Operation(summary = "创建载具扩展属性信息") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-ext:create')") + public CommonResult createStorageVehicleExt(@Valid @RequestBody StorageVehicleExtSaveReqVO createReqVO) { + return success(storageVehicleExtService.createStorageVehicleExt(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新载具扩展属性信息") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-ext:update')") + public CommonResult updateStorageVehicleExt(@Valid @RequestBody StorageVehicleExtSaveReqVO updateReqVO) { + storageVehicleExtService.updateStorageVehicleExt(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除载具扩展属性信息") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-ext:delete')") + public CommonResult deleteStorageVehicleExt(@RequestParam("id") Long id) { + storageVehicleExtService.deleteStorageVehicleExt(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除载具扩展属性信息") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-ext:delete')") + public CommonResult deleteStorageVehicleExtList(@RequestParam("ids") List ids) { + storageVehicleExtService.deleteStorageVehicleExtListByIds(ids); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得载具扩展属性信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-ext:query')") + public CommonResult getStorageVehicleExt(@RequestParam("id") Long id) { + StorageVehicleExtDO storageVehicleExt = storageVehicleExtService.getStorageVehicleExt(id); + return success(BeanUtils.toBean(storageVehicleExt, StorageVehicleExtRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得载具扩展属性信息分页") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-ext:query')") + public CommonResult> getStorageVehicleExtPage(@Valid StorageVehicleExtPageReqVO pageReqVO) { + PageResult pageResult = storageVehicleExtService.getStorageVehicleExtPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, StorageVehicleExtRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出载具扩展属性信息 Excel") + @PreAuthorize("@ss.hasPermission('wms:storage-vehicle-ext:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportStorageVehicleExtExcel(@Valid StorageVehicleExtPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = storageVehicleExtService.getStorageVehicleExtPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "载具扩展属性信息.xls", "数据", StorageVehicleExtRespVO.class, + BeanUtils.toBean(list, StorageVehicleExtRespVO.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/storagevehicleext/vo/StorageVehicleExtPageReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/vo/StorageVehicleExtPageReqVO.java new file mode 100644 index 00000000..17811021 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/vo/StorageVehicleExtPageReqVO.java @@ -0,0 +1,36 @@ +package cn.code.nl.module.wms.controller.admin.storagevehicleext.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 StorageVehicleExtPageReqVO extends PageParam { + + @Schema(description = "载具编码") + private String storageVehicleCode; + + @Schema(description = "载具类型", example = "1") + private String storageVehicleType; + + @Schema(description = "物料标识", example = "9871") + private Long materialId; + + @Schema(description = "批次") + private String pcsn; + + @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/storagevehicleext/vo/StorageVehicleExtRespVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/vo/StorageVehicleExtRespVO.java new file mode 100644 index 00000000..2ecb2e01 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/vo/StorageVehicleExtRespVO.java @@ -0,0 +1,72 @@ +package cn.code.nl.module.wms.controller.admin.storagevehicleext.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 StorageVehicleExtRespVO { + + @Schema(description = "载具编码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("载具编码") + private String storageVehicleCode; + + @Schema(description = "载具类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("载具类型") + private String storageVehicleType; + + @Schema(description = "物料标识", example = "9871") + @ExcelProperty("物料标识") + private Long materialId; + + @Schema(description = "批次") + @ExcelProperty("批次") + private String pcsn; + + @Schema(description = "木箱号") + @ExcelProperty("木箱号") + private String boxNo; + + @Schema(description = "数量计量单位标识", example = "5443") + @ExcelProperty("数量计量单位标识") + private Long qtyUnitId; + + @Schema(description = "数量计量单位名称", example = "赵六") + @ExcelProperty("数量计量单位名称") + private String qtyUnitName; + + @Schema(description = "物料数量") + @ExcelProperty("物料数量") + private BigDecimal qty; + + @Schema(description = "托盘重量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("托盘重量") + private BigDecimal vehicleWeight; + + @Schema(description = "重量计量单位标识", example = "4653") + @ExcelProperty("重量计量单位标识") + private Long weightUnitId; + + @Schema(description = "重量计量单位名称", example = "王五") + @ExcelProperty("重量计量单位名称") + private String weightUnitName; + + @Schema(description = "备注", example = "随便") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @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/storagevehicleext/vo/StorageVehicleExtSaveReqVO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/vo/StorageVehicleExtSaveReqVO.java new file mode 100644 index 00000000..98662113 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/controller/admin/storagevehicleext/vo/StorageVehicleExtSaveReqVO.java @@ -0,0 +1,58 @@ +package cn.code.nl.module.wms.controller.admin.storagevehicleext.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 StorageVehicleExtSaveReqVO { + + private Long storageVehicleExtId; + + @Schema(description = "载具标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "7198") + @NotNull(message = "载具标识不能为空") + private Long storageVehicleId; + + @Schema(description = "载具编码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "载具编码不能为空") + private String storageVehicleCode; + + @Schema(description = "载具类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "载具类型不能为空") + private String storageVehicleType; + + @Schema(description = "物料标识", example = "9871") + private Long materialId; + + @Schema(description = "批次") + private String pcsn; + + @Schema(description = "木箱号") + private String boxNo; + + @Schema(description = "数量计量单位标识", example = "5443") + private Long qtyUnitId; + + @Schema(description = "数量计量单位名称", example = "赵六") + private String qtyUnitName; + + @Schema(description = "物料数量") + private BigDecimal qty; + + @Schema(description = "托盘重量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "托盘重量不能为空") + private BigDecimal vehicleWeight; + + @Schema(description = "重量计量单位标识", example = "4653") + private Long weightUnitId; + + @Schema(description = "重量计量单位名称", example = "王五") + private String weightUnitName; + + @Schema(description = "备注", example = "随便") + private String remark; + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/storagevehicleext/StorageVehicleExtDO.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/storagevehicleext/StorageVehicleExtDO.java new file mode 100644 index 00000000..62f1421b --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/dataobject/storagevehicleext/StorageVehicleExtDO.java @@ -0,0 +1,90 @@ +package cn.code.nl.module.wms.dal.dataobject.storagevehicleext; + +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_storage_vehicle_ext") +@KeySequence("wms_storage_vehicle_ext_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class StorageVehicleExtDO extends BaseDO { + + /** + * 载具扩展标识 + */ + @TableId + private Long storageVehicleExtId; + /** + * 载具标识 + */ + private Long storageVehicleId; + /** + * 载具编码 + */ + private String storageVehicleCode; + /** + * 载具类型 + */ + private String storageVehicleType; + /** + * 物料标识 + */ + private Long materialId; + /** + * 批次 + */ + private String pcsn; + /** + * 木箱号 + */ + private String boxNo; + /** + * 数量计量单位标识 + */ + private Long qtyUnitId; + /** + * 数量计量单位名称 + */ + private String qtyUnitName; + /** + * 物料数量 + */ + private BigDecimal qty; + /** + * 设备标识 + */ + private Long deviceUuid; + /** + * 托盘重量 + */ + private BigDecimal vehicleWeight; + /** + * 重量计量单位标识 + */ + private Long weightUnitId; + /** + * 重量计量单位名称 + */ + private String weightUnitName; + /** + * 备注 + */ + private String remark; + + +} \ No newline at end of file diff --git a/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/storagevehicleext/StorageVehicleExtMapper.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/storagevehicleext/StorageVehicleExtMapper.java new file mode 100644 index 00000000..7824a198 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/dal/mysql/storagevehicleext/StorageVehicleExtMapper.java @@ -0,0 +1,31 @@ +package cn.code.nl.module.wms.dal.mysql.storagevehicleext; + +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.storagevehicleext.StorageVehicleExtDO; +import org.apache.ibatis.annotations.Mapper; +import cn.code.nl.module.wms.controller.admin.storagevehicleext.vo.*; + +/** + * 载具扩展属性信息 Mapper + * + * @author 诺力管理员 + */ +@Mapper +public interface StorageVehicleExtMapper extends BaseMapperX { + + default PageResult selectPage(StorageVehicleExtPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(StorageVehicleExtDO::getStorageVehicleCode, reqVO.getStorageVehicleCode()) + .eqIfPresent(StorageVehicleExtDO::getStorageVehicleType, reqVO.getStorageVehicleType()) + .eqIfPresent(StorageVehicleExtDO::getMaterialId, reqVO.getMaterialId()) + .eqIfPresent(StorageVehicleExtDO::getPcsn, reqVO.getPcsn()) + .eqIfPresent(StorageVehicleExtDO::getBoxNo, reqVO.getBoxNo()) + .betweenIfPresent(StorageVehicleExtDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(StorageVehicleExtDO::getStorageVehicleExtId)); + } + +} \ 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/storagevehicleext/StorageVehicleExtService.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleext/StorageVehicleExtService.java new file mode 100644 index 00000000..9fe2986c --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleext/StorageVehicleExtService.java @@ -0,0 +1,62 @@ +package cn.code.nl.module.wms.service.storagevehicleext; + +import java.util.*; +import jakarta.validation.*; +import cn.code.nl.module.wms.controller.admin.storagevehicleext.vo.*; +import cn.code.nl.module.wms.dal.dataobject.storagevehicleext.StorageVehicleExtDO; +import cn.code.nl.framework.common.pojo.PageResult; +import cn.code.nl.framework.common.pojo.PageParam; + +/** + * 载具扩展属性信息 Service 接口 + * + * @author 诺力管理员 + */ +public interface StorageVehicleExtService { + + /** + * 创建载具扩展属性信息 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createStorageVehicleExt(@Valid StorageVehicleExtSaveReqVO createReqVO); + + /** + * 更新载具扩展属性信息 + * + * @param updateReqVO 更新信息 + */ + void updateStorageVehicleExt(@Valid StorageVehicleExtSaveReqVO updateReqVO); + + /** + * 删除载具扩展属性信息 + * + * @param id 编号 + */ + void deleteStorageVehicleExt(Long id); + + /** + * 批量删除载具扩展属性信息 + * + * @param ids 编号 + */ + void deleteStorageVehicleExtListByIds(List ids); + + /** + * 获得载具扩展属性信息 + * + * @param id 编号 + * @return 载具扩展属性信息 + */ + StorageVehicleExtDO getStorageVehicleExt(Long id); + + /** + * 获得载具扩展属性信息分页 + * + * @param pageReqVO 分页查询 + * @return 载具扩展属性信息分页 + */ + PageResult getStorageVehicleExtPage(StorageVehicleExtPageReqVO 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/storagevehicleext/StorageVehicleExtServiceImpl.java b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleext/StorageVehicleExtServiceImpl.java new file mode 100644 index 00000000..38f28153 --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/java/cn/code/nl/module/wms/service/storagevehicleext/StorageVehicleExtServiceImpl.java @@ -0,0 +1,85 @@ +package cn.code.nl.module.wms.service.storagevehicleext; + +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.storagevehicleext.vo.*; +import cn.code.nl.module.wms.dal.dataobject.storagevehicleext.StorageVehicleExtDO; +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.storagevehicleext.StorageVehicleExtMapper; + +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 StorageVehicleExtServiceImpl implements StorageVehicleExtService { + + @Resource + private StorageVehicleExtMapper storageVehicleExtMapper; + + @Override + public Long createStorageVehicleExt(StorageVehicleExtSaveReqVO createReqVO) { + // 插入 + StorageVehicleExtDO storageVehicleExt = BeanUtils.toBean(createReqVO, StorageVehicleExtDO.class); + storageVehicleExtMapper.insert(storageVehicleExt); + + // 返回 + return storageVehicleExt.getStorageVehicleExtId(); + } + + @Override + public void updateStorageVehicleExt(StorageVehicleExtSaveReqVO updateReqVO) { + // 校验存在 + validateStorageVehicleExtExists(updateReqVO.getStorageVehicleExtId()); + // 更新 + StorageVehicleExtDO updateObj = BeanUtils.toBean(updateReqVO, StorageVehicleExtDO.class); + storageVehicleExtMapper.updateById(updateObj); + } + + @Override + public void deleteStorageVehicleExt(Long id) { + // 校验存在 + validateStorageVehicleExtExists(id); + // 删除 + storageVehicleExtMapper.deleteById(id); + } + + @Override + public void deleteStorageVehicleExtListByIds(List ids) { + // 删除 + storageVehicleExtMapper.deleteByIds(ids); + } + + + private void validateStorageVehicleExtExists(Long id) { + if (storageVehicleExtMapper.selectById(id) == null) { + throw exception(STORAGE_VEHICLE_EXT_NOT_EXISTS); + } + } + + @Override + public StorageVehicleExtDO getStorageVehicleExt(Long id) { + return storageVehicleExtMapper.selectById(id); + } + + @Override + public PageResult getStorageVehicleExtPage(StorageVehicleExtPageReqVO pageReqVO) { + return storageVehicleExtMapper.selectPage(pageReqVO); + } + +} diff --git a/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/storagevehicleext/StorageVehicleExtMapper.xml b/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/storagevehicleext/StorageVehicleExtMapper.xml new file mode 100644 index 00000000..0580c32b --- /dev/null +++ b/nl-module-wms/nl-module-wms-server/src/main/resources/mapper/storagevehicleext/StorageVehicleExtMapper.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/src/api/wms/storagevehicleext/index.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleext/index.ts new file mode 100644 index 00000000..a8fe113f --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/api/wms/storagevehicleext/index.ts @@ -0,0 +1,67 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace WmsStorageVehicleExtApi { + /** 载具扩展属性信息信息 */ + export interface StorageVehicleExt { + storageVehicleExtId?: number; + storageVehicleId?: number; // 载具标识 + storageVehicleCode?: string; // 载具编码 + storageVehicleType?: string; // 载具类型 + materialId: number; // 物料标识 + pcsn: string; // 批次 + boxNo: string; // 木箱号 + qtyUnitId: number; // 数量计量单位标识 + qtyUnitName: string; // 数量计量单位名称 + qty: number; // 物料数量 + vehicleWeight?: number; // 托盘重量 + weightUnitId: number; // 重量计量单位标识 + weightUnitName: string; // 重量计量单位名称 + remark: string; // 备注 + } +} + +/** 查询载具扩展属性信息分页 */ +export function getStorageVehicleExtPage(params: PageParam) { + return requestClient.get>( + '/wms/storage-vehicle-ext/page', + { params }, + ); +} + +/** 查询载具扩展属性信息详情 */ +export function getStorageVehicleExt(id: number) { + return requestClient.get( + `/wms/storage-vehicle-ext/get?id=${id}`, + ); +} + +/** 新增载具扩展属性信息 */ +export function createStorageVehicleExt(data: WmsStorageVehicleExtApi.StorageVehicleExt) { + return requestClient.post('/wms/storage-vehicle-ext/create', data); +} + +/** 修改载具扩展属性信息 */ +export function updateStorageVehicleExt(data: WmsStorageVehicleExtApi.StorageVehicleExt) { + return requestClient.put('/wms/storage-vehicle-ext/update', data); +} + +/** 删除载具扩展属性信息 */ +export function deleteStorageVehicleExt(id: number) { + return requestClient.delete(`/wms/storage-vehicle-ext/delete?id=${id}`); +} + +/** 批量删除载具扩展属性信息 */ +export function deleteStorageVehicleExtList(ids: number[]) { + return requestClient.delete( + `/wms/storage-vehicle-ext/delete-list?ids=${ids.join(',')}`, + ); +} + +/** 导出载具扩展属性信息 */ +export function exportStorageVehicleExt(params: any) { + return requestClient.download('/wms/storage-vehicle-ext/export-excel', { params }); +} + + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/data.ts b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/data.ts new file mode 100644 index 00000000..f16c409e --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/data.ts @@ -0,0 +1,295 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { WmsStorageVehicleExtApi } from '#/api/wms/storagevehicleext'; + +import { getRangePickerDefaultProps } from '#/utils'; +import {getDictOptions} from "@vben/hooks"; +import {DICT_TYPE} from "@vben/constants"; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'storageVehicleExtId', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'storageVehicleId', + label: '载具标识', + rules: 'required', + component: 'Input', + componentProps: { + placeholder: '请输入载具标识', + }, + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'storageVehicleCode', + label: '载具编码', + rules: 'required', + component: 'Input', + componentProps: { + placeholder: '请输入载具编码', + }, + }, + { + fieldName: 'storageVehicleType', + label: '载具类型', + rules: 'required', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.WMS_VEHICLE_TYPE), + placeholder: '请选择载具类型', + }, + }, + { + fieldName: 'materialId', + label: '物料标识', + component: 'Input', + componentProps: { + placeholder: '请输入物料标识', + }, + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'materialName', + label: '物料名称', + component: 'Input', + componentProps: { + placeholder: '请选择物料', + readonly: true, + style: 'cursor: pointer', + }, + }, + { + fieldName: 'pcsn', + label: '批次', + component: 'Input', + componentProps: { + placeholder: '请输入批次', + }, + }, + { + fieldName: 'boxNo', + label: '木箱号', + component: 'Input', + componentProps: { + placeholder: '请输入木箱号', + }, + }, + { + fieldName: 'qtyUnitId', + label: '数量单位', + component: 'Input', + componentProps: { + placeholder: '请输入数量计量单位标识', + }, + }, + { + fieldName: 'qtyUnitName', + label: '数量单位', + component: 'Input', + componentProps: { + placeholder: '请输入数量计量单位名称', + }, + }, + { + fieldName: 'qty', + label: '物料数量', + component: 'Input', + componentProps: { + placeholder: '请输入物料数量', + }, + }, + { + fieldName: 'vehicleWeight', + label: '托盘重量', + rules: 'required', + component: 'Input', + componentProps: { + placeholder: '请输入托盘重量', + }, + }, + { + fieldName: 'weightUnitId', + label: '重量单位', + component: 'Input', + componentProps: { + placeholder: '请输入重量计量单位标识', + }, + }, + { + fieldName: 'weightUnitName', + label: '重量单位', + component: 'Input', + componentProps: { + placeholder: '请输入重量计量单位名称', + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + componentProps: { + placeholder: '请输入备注', + }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'storageVehicleCode', + label: '载具编码', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入载具编码', + }, + }, + { + fieldName: 'storageVehicleType', + label: '载具类型', + component: 'Select', + componentProps: { + allowClear: true, + options: [], + placeholder: '请选择载具类型', + }, + }, + { + fieldName: 'materialId', + label: '物料标识', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入物料标识', + }, + }, + { + fieldName: 'pcsn', + 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: 'storageVehicleType', + title: '载具类型', + minWidth: 120, + }, + { + field: 'materialId', + title: '物料标识', + minWidth: 120, + }, + { + field: 'pcsn', + title: '批次', + minWidth: 120, + }, + { + field: 'boxNo', + title: '木箱号', + minWidth: 120, + }, + { + field: 'qtyUnitId', + title: '数量计量单位标识', + minWidth: 120, + }, + { + field: 'qtyUnitName', + title: '数量计量单位名称', + minWidth: 120, + }, + { + field: 'qty', + title: '物料数量', + minWidth: 120, + }, + { + field: 'vehicleWeight', + title: '托盘重量', + minWidth: 120, + }, + { + field: 'weightUnitId', + title: '重量计量单位标识', + minWidth: 120, + }, + { + field: 'weightUnitName', + title: '重量计量单位名称', + minWidth: 120, + }, + { + field: 'remark', + title: '备注', + minWidth: 120, + }, + { + field: 'createTime', + title: '创建时间', + minWidth: 120, + formatter: 'formatDateTime', + }, + { + 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/storagevehicleext/index.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/index.vue new file mode 100644 index 00000000..4d4e91cf --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/index.vue @@ -0,0 +1,186 @@ + + + diff --git a/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/modules/form.vue b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/modules/form.vue new file mode 100644 index 00000000..11755020 --- /dev/null +++ b/nl-ui/nl-ui-admin-vben/yudao-ui-admin-vben/apps/web-antdv-next/src/views/wms/storagevehicleext/modules/form.vue @@ -0,0 +1,119 @@ + + +