diff --git a/win-module-wms/win-module-wms-api/src/main/java/com/win/module/wms/enums/ErrorCodeConstants.java b/win-module-wms/win-module-wms-api/src/main/java/com/win/module/wms/enums/ErrorCodeConstants.java index 53fa1b36..4bf3ceaa 100644 --- a/win-module-wms/win-module-wms-api/src/main/java/com/win/module/wms/enums/ErrorCodeConstants.java +++ b/win-module-wms/win-module-wms-api/src/main/java/com/win/module/wms/enums/ErrorCodeConstants.java @@ -1086,6 +1086,10 @@ public interface ErrorCodeConstants { ErrorCode CONTAINER_BIND_RECORD_DETAIL_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_000_168_004, "器具绑定子列表不存在"); ErrorCode CONTAINER_BIND_RECORD_MAIN_NOT_EXISTS = new ErrorCode(1_000_168_004, "器具绑定主不存在"); ErrorCode CONTAINER_BIND_RECORD_MAIN_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_000_168_004, "器具绑定子列表不存在"); + ErrorCode CONTAINER_UNBIND_RECORD_MAIN_NOT_EXISTS = new ErrorCode(1_000_168_004, "器具解绑主不存在"); + ErrorCode CONTAINER_UNBIND_RECORD_MAIN_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_000_168_004, "器具解绑主列表不存在"); + ErrorCode CONTAINER_UNBIND_RECORD_DETAIL_NOT_EXISTS = new ErrorCode(1_000_168_004, "器具解绑子表不存在"); + ErrorCode CONTAINER_UNBIND_RECORD_DETAIL_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_000_168_004, "器具解绑子列表不存在"); // 合包记录主 ErrorCode PACKAGEMERGE_MAIN_NOT_EXISTS = new ErrorCode(1_000_169_001, "合包记录主不存在"); diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/ContainerUnbindRecordDetailController.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/ContainerUnbindRecordDetailController.java new file mode 100644 index 00000000..2d12ec2a --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/ContainerUnbindRecordDetailController.java @@ -0,0 +1,135 @@ +package com.win.module.wms.controller.containerUnbind; + +import com.win.framework.common.pojo.CommonResult; +import com.win.framework.common.pojo.PageResult; +import com.win.framework.excel.core.util.ExcelUtils; +import com.win.framework.operatelog.core.annotations.OperateLog; +import com.win.module.wms.controller.containerUnbind.vo.*; +import com.win.module.wms.convert.containerUnbind.ContainerUnbindRecordDetailConvert; +import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordDetailDO; +import com.win.module.wms.service.containerUnbind.ContainerUnbindRecordDetailService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.*; + +import static com.win.framework.common.pojo.CommonResult.success; +import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Tag(name = "管理后台 - 器具解绑记录子") +@RestController +@RequestMapping("/wms/container-unbind-record-detail") +@Validated +public class ContainerUnbindRecordDetailController { + + @Resource + private ContainerUnbindRecordDetailService containerUnbindRecordDetailService; + + @PostMapping("/create") + @Operation(summary = "创建器具解绑记录子") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-detail:create')") + public CommonResult createContainerUnbindRecordDetail(@Valid @RequestBody ContainerUnbindRecordDetailCreateReqVO createReqVO) { + return success(containerUnbindRecordDetailService.createContainerUnbindRecordDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新器具解绑记录子") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-detail:update')") + public CommonResult updateContainerUnbindRecordDetail(@Valid @RequestBody ContainerUnbindRecordDetailUpdateReqVO updateReqVO) { + int result = containerUnbindRecordDetailService.updateContainerUnbindRecordDetail(updateReqVO); + return success(result > 0); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除器具解绑记录子") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-detail:delete')") + public CommonResult deleteContainerUnbindRecordDetail(@RequestParam("id") Long id) { + int result = containerUnbindRecordDetailService.deleteContainerUnbindRecordDetail(id); + return success(result > 0); + } + + @GetMapping("/get") + @Operation(summary = "获得器具解绑记录子") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-detail:query')") + public CommonResult getContainerUnbindRecordDetail(@RequestParam("id") Long id) { + ContainerUnbindRecordDetailDO containerUnbindRecordDetail = containerUnbindRecordDetailService.getContainerUnbindRecordDetail(id); + return success(ContainerUnbindRecordDetailConvert.INSTANCE.convert(containerUnbindRecordDetail)); + } + + @GetMapping("/list") + @Operation(summary = "获得器具解绑记录子列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-detail:query')") + public CommonResult> getContainerUnbindRecordDetailList(@RequestParam("ids") Collection ids) { + List list = containerUnbindRecordDetailService.getContainerUnbindRecordDetailList(ids); + return success(ContainerUnbindRecordDetailConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得器具解绑记录子分页") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-detail:query')") + public CommonResult> getContainerUnbindRecordDetailPage(@Valid ContainerUnbindRecordDetailPageReqVO pageVO) { + PageResult pageResult = containerUnbindRecordDetailService.getContainerUnbindRecordDetailPage(pageVO); + return success(ContainerUnbindRecordDetailConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出器具解绑记录子 Excel") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-detail:export')") + @OperateLog(type = EXPORT) + public void exportContainerUnbindRecordDetailExcel(@Valid ContainerUnbindRecordDetailExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = containerUnbindRecordDetailService.getContainerUnbindRecordDetailList(exportReqVO); + // 导出 Excel + List datas = ContainerUnbindRecordDetailConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "器具解绑记录子.xls", "数据", ContainerUnbindRecordDetailExcelVO.class, datas); + } + + @GetMapping("/get-import-template") + @Operation(summary = "获得导入器具解绑记录子模板") + public void importTemplate(HttpServletResponse response) throws IOException { + List list = Arrays.asList(); + // 输出 + ExcelUtils.write(response, "器具解绑记录子基本信息导入模板.xls", "器具解绑记录子基本信息列表", ContainerUnbindRecordDetailExcelVO.class, list); + } + + @PostMapping("/import") + @Operation(summary = "导入器具解绑记录子基本信息") + @Parameters({ + @Parameter(name = "file", description = "Excel 文件", required = true), + @Parameter(name = "mode", description = "导入模式1更新2追加3覆盖", example = "1"), + @Parameter(name = "updatePart", description = "部分更新,默认为 true", example = "true") + }) + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-detail:import')") + public CommonResult> importExcel(HttpServletResponse response, + @RequestParam("file") MultipartFile file, + @RequestParam(value = "mode") Integer mode, + @RequestParam(value = "updatePart", required = false, defaultValue = "false") Boolean updatePart) throws Exception { + + List list = ExcelUtils.read(file, ContainerUnbindRecordDetailExcelVO.class); + List errorList = containerUnbindRecordDetailService.importContainerUnbindRecordDetailList(list, mode, updatePart); + + Map returnMap = new HashMap<>(); + returnMap.put("errorCount", errorList.size()); + if(!errorList.isEmpty()) { + String url = ExcelUtils.writeLocalFile("器具解绑记录子基本信息导入错误数据" + LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")) + ".xlsx", "错误列表", errorList); + returnMap.put("errorFile", url); + } + + return success(returnMap); + } +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/ContainerUnbindRecordMainController.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/ContainerUnbindRecordMainController.java new file mode 100644 index 00000000..24f89f83 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/ContainerUnbindRecordMainController.java @@ -0,0 +1,135 @@ +package com.win.module.wms.controller.containerUnbind; + +import com.win.framework.common.pojo.CommonResult; +import com.win.framework.common.pojo.PageResult; +import com.win.framework.excel.core.util.ExcelUtils; +import com.win.framework.operatelog.core.annotations.OperateLog; +import com.win.module.wms.controller.containerUnbind.vo.*; +import com.win.module.wms.convert.containerUnbind.ContainerUnbindRecordMainConvert; +import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordMainDO; +import com.win.module.wms.service.containerUnbind.ContainerUnbindRecordMainService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.*; + +import static com.win.framework.common.pojo.CommonResult.success; +import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Tag(name = "管理后台 - 器具解绑记录主") +@RestController +@RequestMapping("/wms/container-unbind-record-main") +@Validated +public class ContainerUnbindRecordMainController { + + @Resource + private ContainerUnbindRecordMainService containerUnbindRecordMainService; + + @PostMapping("/create") + @Operation(summary = "创建器具解绑记录主") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-main:create')") + public CommonResult createContainerUnbindRecordMain(@Valid @RequestBody ContainerUnbindRecordMainCreateReqVO createReqVO) { + return success(containerUnbindRecordMainService.createContainerUnbindRecordMain(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新器具解绑记录主") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-main:update')") + public CommonResult updateContainerUnbindRecordMain(@Valid @RequestBody ContainerUnbindRecordMainUpdateReqVO updateReqVO) { + int result = containerUnbindRecordMainService.updateContainerUnbindRecordMain(updateReqVO); + return success(result > 0); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除器具解绑记录主") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-main:delete')") + public CommonResult deleteContainerUnbindRecordMain(@RequestParam("id") Long id) { + int result = containerUnbindRecordMainService.deleteContainerUnbindRecordMain(id); + return success(result > 0); + } + + @GetMapping("/get") + @Operation(summary = "获得器具解绑记录主") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-main:query')") + public CommonResult getContainerUnbindRecordMain(@RequestParam("id") Long id) { + ContainerUnbindRecordMainDO containerUnbindRecordMain = containerUnbindRecordMainService.getContainerUnbindRecordMain(id); + return success(ContainerUnbindRecordMainConvert.INSTANCE.convert(containerUnbindRecordMain)); + } + + @GetMapping("/list") + @Operation(summary = "获得器具解绑记录主列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-main:query')") + public CommonResult> getContainerUnbindRecordMainList(@RequestParam("ids") Collection ids) { + List list = containerUnbindRecordMainService.getContainerUnbindRecordMainList(ids); + return success(ContainerUnbindRecordMainConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得器具解绑记录主分页") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-main:query')") + public CommonResult> getContainerUnbindRecordMainPage(@Valid ContainerUnbindRecordMainPageReqVO pageVO) { + PageResult pageResult = containerUnbindRecordMainService.getContainerUnbindRecordMainPage(pageVO); + return success(ContainerUnbindRecordMainConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出器具解绑记录主 Excel") + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-main:export')") + @OperateLog(type = EXPORT) + public void exportContainerUnbindRecordMainExcel(@Valid ContainerUnbindRecordMainExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = containerUnbindRecordMainService.getContainerUnbindRecordMainList(exportReqVO); + // 导出 Excel + List datas = ContainerUnbindRecordMainConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "器具解绑记录主.xls", "数据", ContainerUnbindRecordMainExcelVO.class, datas); + } + + @GetMapping("/get-import-template") + @Operation(summary = "获得导入器具解绑记录主模板") + public void importTemplate(HttpServletResponse response) throws IOException { + List list = Arrays.asList(); + // 输出 + ExcelUtils.write(response, "器具解绑记录主基本信息导入模板.xls", "器具解绑记录主基本信息列表", ContainerUnbindRecordMainExcelVO.class, list); + } + + @PostMapping("/import") + @Operation(summary = "导入器具解绑记录主基本信息") + @Parameters({ + @Parameter(name = "file", description = "Excel 文件", required = true), + @Parameter(name = "mode", description = "导入模式1更新2追加3覆盖", example = "1"), + @Parameter(name = "updatePart", description = "部分更新,默认为 true", example = "true") + }) + @PreAuthorize("@ss.hasPermission('wms:container-unbind-record-main:import')") + public CommonResult> importExcel(HttpServletResponse response, + @RequestParam("file") MultipartFile file, + @RequestParam(value = "mode") Integer mode, + @RequestParam(value = "updatePart", required = false, defaultValue = "false") Boolean updatePart) throws Exception { + + List list = ExcelUtils.read(file, ContainerUnbindRecordMainExcelVO.class); + List errorList = containerUnbindRecordMainService.importContainerUnbindRecordMainList(list, mode, updatePart); + + Map returnMap = new HashMap<>(); + returnMap.put("errorCount", errorList.size()); + if(!errorList.isEmpty()) { + String url = ExcelUtils.writeLocalFile("器具解绑记录主基本信息导入错误数据" + LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")) + ".xlsx", "错误列表", errorList); + returnMap.put("errorFile", url); + } + + return success(returnMap); + } +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailBaseVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailBaseVO.java new file mode 100644 index 00000000..c0dae2d5 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailBaseVO.java @@ -0,0 +1,52 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +/** + * 器具解绑记录子 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class ContainerUnbindRecordDetailBaseVO { + + @Schema(description = "内容物类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "内容物类型不能为空") + private String containerContentType; + + @Schema(description = "内容物号") + private String contentNumber; + + @Schema(description = "物料代码") + private String itemCode; + + @Schema(description = "批次") + private String batch; + + @Schema(description = "库存状态", example = "1") + private String inventoryStatus; + + @Schema(description = "计量单位") + private String uom; + + @Schema(description = "数量") + private BigDecimal qty; + + @Schema(description = "主表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6555") + @NotNull(message = "主表ID不能为空") + private Long masterId; + + @Schema(description = "单据号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "单据号不能为空") + private String number; + + @Schema(description = "地点ID", example = "3546") + private String siteId; + + @Schema(description = "备注", example = "你猜") + private String remark; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailCreateReqVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailCreateReqVO.java new file mode 100644 index 00000000..b3b3f3d6 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailCreateReqVO.java @@ -0,0 +1,14 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Schema(description = "管理后台 - 器具解绑记录子创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ContainerUnbindRecordDetailCreateReqVO extends ContainerUnbindRecordDetailBaseVO { + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailExcelVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailExcelVO.java new file mode 100644 index 00000000..44f30feb --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailExcelVO.java @@ -0,0 +1,56 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 器具解绑记录子 Excel VO + * + * @author 超级管理员 + */ +@Data +public class ContainerUnbindRecordDetailExcelVO { + + @ExcelProperty("id") + private Long id; + + @ExcelProperty("内容物类型") + private String containerContentType; + + @ExcelProperty("内容物号") + private String contentNumber; + + @ExcelProperty("物料代码") + private String itemCode; + + @ExcelProperty("批次") + private String batch; + + @ExcelProperty("库存状态") + private String inventoryStatus; + + @ExcelProperty("计量单位") + private String uom; + + @ExcelProperty("数量") + private BigDecimal qty; + + @ExcelProperty("主表ID") + private Long masterId; + + @ExcelProperty("单据号") + private String number; + + @ExcelProperty("地点ID") + private String siteId; + + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @ExcelProperty("备注") + private String remark; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailExportReqVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailExportReqVO.java new file mode 100644 index 00000000..727acb08 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailExportReqVO.java @@ -0,0 +1,53 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 器具解绑记录子 Excel 导出 Request VO,参数和 ContainerUnbindRecordDetailPageReqVO 是一致的") +@Data +public class ContainerUnbindRecordDetailExportReqVO { + + @Schema(description = "内容物类型", example = "1") + private String containerContentType; + + @Schema(description = "内容物号") + private String contentNumber; + + @Schema(description = "物料代码") + private String itemCode; + + @Schema(description = "批次") + private String batch; + + @Schema(description = "库存状态", example = "1") + private String inventoryStatus; + + @Schema(description = "计量单位") + private String uom; + + @Schema(description = "数量") + private BigDecimal qty; + + @Schema(description = "主表ID", example = "6555") + private Long masterId; + + @Schema(description = "单据号") + private String number; + + @Schema(description = "地点ID", example = "3546") + private String siteId; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注", example = "你猜") + private String remark; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailPageReqVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailPageReqVO.java new file mode 100644 index 00000000..f87c6503 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailPageReqVO.java @@ -0,0 +1,58 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import com.win.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 器具解绑记录子分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ContainerUnbindRecordDetailPageReqVO extends PageParam { + + @Schema(description = "内容物类型", example = "1") + private String containerContentType; + + @Schema(description = "内容物号") + private String contentNumber; + + @Schema(description = "物料代码") + private String itemCode; + + @Schema(description = "批次") + private String batch; + + @Schema(description = "库存状态", example = "1") + private String inventoryStatus; + + @Schema(description = "计量单位") + private String uom; + + @Schema(description = "数量") + private BigDecimal qty; + + @Schema(description = "主表ID", example = "6555") + private Long masterId; + + @Schema(description = "单据号") + private String number; + + @Schema(description = "地点ID", example = "3546") + private String siteId; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注", example = "你猜") + private String remark; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailRespVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailRespVO.java new file mode 100644 index 00000000..f7816e0d --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailRespVO.java @@ -0,0 +1,22 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 器具解绑记录子 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ContainerUnbindRecordDetailRespVO extends ContainerUnbindRecordDetailBaseVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21310") + private Long id; + + @Schema(description = "创建时间") + private LocalDateTime createTime; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailUpdateReqVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailUpdateReqVO.java new file mode 100644 index 00000000..02df2fe3 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordDetailUpdateReqVO.java @@ -0,0 +1,20 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import javax.validation.constraints.NotNull; + +@Schema(description = "管理后台 - 器具解绑记录子更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ContainerUnbindRecordDetailUpdateReqVO extends ContainerUnbindRecordDetailBaseVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21310") + @NotNull(message = "id不能为空") + private Long id; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainBaseVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainBaseVO.java new file mode 100644 index 00000000..75116872 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainBaseVO.java @@ -0,0 +1,91 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +/** + * 器具解绑记录主 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class ContainerUnbindRecordMainBaseVO { + + @Schema(description = "单据号") + private String number; + + @Schema(description = "器具号") + private String containerNumber; + + @Schema(description = "从仓库代码") + private String fromWarehouseCode; + + @Schema(description = "到仓库代码") + private String toWarehouseCode; + + @Schema(description = "出库事务类型", example = "2") + private String outTransactionType; + + @Schema(description = "入库事务类型", example = "1") + private String inTransactionType; + + @Schema(description = "执行时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime executeTime; + + @Schema(description = "生效日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime activeDate; + + @Schema(description = "是否可用") + private String available; + + @Schema(description = "申请时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime requestTime; + + @Schema(description = "截止时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime dueTime; + + @Schema(description = "部门") + private String departmentCode; + + @Schema(description = "用户组") + private String userGroupCode; + + @Schema(description = "接口类型", example = "2") + private String interfaceType; + + @Schema(description = "业务类型", example = "1") + private String businessType; + + @Schema(description = "备注", example = "你说的对") + private String remark; + + @Schema(description = "扩展属性") + private String extraProperties; + + @Schema(description = "地点ID", example = "11950") + private String siteId; + + @Schema(description = "代码") + private String code; + + @Schema(description = "从库位类型范围") + private String fromLocationTypes; + + @Schema(description = "到库位类型范围") + private String toLocationTypes; + + @Schema(description = "从库区代码范围") + private String fromAreaCodes; + + @Schema(description = "到库区代码范围") + private String toAreaCodes; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainCreateReqVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainCreateReqVO.java new file mode 100644 index 00000000..a22aeb04 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainCreateReqVO.java @@ -0,0 +1,14 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Schema(description = "管理后台 - 器具解绑记录主创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ContainerUnbindRecordMainCreateReqVO extends ContainerUnbindRecordMainBaseVO { + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainExcelVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainExcelVO.java new file mode 100644 index 00000000..f4dec678 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainExcelVO.java @@ -0,0 +1,91 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 器具解绑记录主 Excel VO + * + * @author 超级管理员 + */ +@Data +public class ContainerUnbindRecordMainExcelVO { + + @ExcelProperty("id") + private Long id; + + @ExcelProperty("单据号") + private String number; + + @ExcelProperty("器具号") + private String containerNumber; + + @ExcelProperty("从仓库代码") + private String fromWarehouseCode; + + @ExcelProperty("到仓库代码") + private String toWarehouseCode; + + @ExcelProperty("出库事务类型") + private String outTransactionType; + + @ExcelProperty("入库事务类型") + private String inTransactionType; + + @ExcelProperty("执行时间") + private LocalDateTime executeTime; + + @ExcelProperty("生效日期") + private LocalDateTime activeDate; + + @ExcelProperty("是否可用") + private String available; + + @ExcelProperty("申请时间") + private LocalDateTime requestTime; + + @ExcelProperty("截止时间") + private LocalDateTime dueTime; + + @ExcelProperty("部门") + private String departmentCode; + + @ExcelProperty("用户组") + private String userGroupCode; + + @ExcelProperty("接口类型") + private String interfaceType; + + @ExcelProperty("业务类型") + private String businessType; + + @ExcelProperty("备注") + private String remark; + + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @ExcelProperty("扩展属性") + private String extraProperties; + + @ExcelProperty("地点ID") + private String siteId; + + @ExcelProperty("代码") + private String code; + + @ExcelProperty("从库位类型范围") + private String fromLocationTypes; + + @ExcelProperty("到库位类型范围") + private String toLocationTypes; + + @ExcelProperty("从库区代码范围") + private String fromAreaCodes; + + @ExcelProperty("到库区代码范围") + private String toAreaCodes; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainExportReqVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainExportReqVO.java new file mode 100644 index 00000000..83accb18 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainExportReqVO.java @@ -0,0 +1,92 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 器具解绑记录主 Excel 导出 Request VO,参数和 ContainerUnbindRecordMainPageReqVO 是一致的") +@Data +public class ContainerUnbindRecordMainExportReqVO { + + @Schema(description = "单据号") + private String number; + + @Schema(description = "器具号") + private String containerNumber; + + @Schema(description = "从仓库代码") + private String fromWarehouseCode; + + @Schema(description = "到仓库代码") + private String toWarehouseCode; + + @Schema(description = "出库事务类型", example = "2") + private String outTransactionType; + + @Schema(description = "入库事务类型", example = "1") + private String inTransactionType; + + @Schema(description = "执行时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] executeTime; + + @Schema(description = "生效日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] activeDate; + + @Schema(description = "是否可用") + private String available; + + @Schema(description = "申请时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] requestTime; + + @Schema(description = "截止时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] dueTime; + + @Schema(description = "部门") + private String departmentCode; + + @Schema(description = "用户组") + private String userGroupCode; + + @Schema(description = "接口类型", example = "2") + private String interfaceType; + + @Schema(description = "业务类型", example = "1") + private String businessType; + + @Schema(description = "备注", example = "你说的对") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "扩展属性") + private String extraProperties; + + @Schema(description = "地点ID", example = "11950") + private String siteId; + + @Schema(description = "代码") + private String code; + + @Schema(description = "从库位类型范围") + private String fromLocationTypes; + + @Schema(description = "到库位类型范围") + private String toLocationTypes; + + @Schema(description = "从库区代码范围") + private String fromAreaCodes; + + @Schema(description = "到库区代码范围") + private String toAreaCodes; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainPageReqVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainPageReqVO.java new file mode 100644 index 00000000..d7ade1d1 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainPageReqVO.java @@ -0,0 +1,97 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import com.win.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 器具解绑记录主分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ContainerUnbindRecordMainPageReqVO extends PageParam { + + @Schema(description = "单据号") + private String number; + + @Schema(description = "器具号") + private String containerNumber; + + @Schema(description = "从仓库代码") + private String fromWarehouseCode; + + @Schema(description = "到仓库代码") + private String toWarehouseCode; + + @Schema(description = "出库事务类型", example = "2") + private String outTransactionType; + + @Schema(description = "入库事务类型", example = "1") + private String inTransactionType; + + @Schema(description = "执行时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] executeTime; + + @Schema(description = "生效日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] activeDate; + + @Schema(description = "是否可用") + private String available; + + @Schema(description = "申请时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] requestTime; + + @Schema(description = "截止时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] dueTime; + + @Schema(description = "部门") + private String departmentCode; + + @Schema(description = "用户组") + private String userGroupCode; + + @Schema(description = "接口类型", example = "2") + private String interfaceType; + + @Schema(description = "业务类型", example = "1") + private String businessType; + + @Schema(description = "备注", example = "你说的对") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "扩展属性") + private String extraProperties; + + @Schema(description = "地点ID", example = "11950") + private String siteId; + + @Schema(description = "代码") + private String code; + + @Schema(description = "从库位类型范围") + private String fromLocationTypes; + + @Schema(description = "到库位类型范围") + private String toLocationTypes; + + @Schema(description = "从库区代码范围") + private String fromAreaCodes; + + @Schema(description = "到库区代码范围") + private String toAreaCodes; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainRespVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainRespVO.java new file mode 100644 index 00000000..8caf7017 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainRespVO.java @@ -0,0 +1,22 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 器具解绑记录主 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ContainerUnbindRecordMainRespVO extends ContainerUnbindRecordMainBaseVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28627") + private Long id; + + @Schema(description = "创建时间") + private LocalDateTime createTime; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainUpdateReqVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainUpdateReqVO.java new file mode 100644 index 00000000..b269f5ce --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainUpdateReqVO.java @@ -0,0 +1,20 @@ +package com.win.module.wms.controller.containerUnbind.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import javax.validation.constraints.NotNull; + +@Schema(description = "管理后台 - 器具解绑记录主更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ContainerUnbindRecordMainUpdateReqVO extends ContainerUnbindRecordMainBaseVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28627") + @NotNull(message = "id不能为空") + private Long id; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/containerUnbind/ContainerUnbindRecordDetailConvert.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/containerUnbind/ContainerUnbindRecordDetailConvert.java new file mode 100644 index 00000000..f1d61050 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/containerUnbind/ContainerUnbindRecordDetailConvert.java @@ -0,0 +1,36 @@ +package com.win.module.wms.convert.containerUnbind; + +import com.win.framework.common.pojo.PageResult; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordDetailCreateReqVO; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordDetailExcelVO; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordDetailRespVO; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordDetailUpdateReqVO; +import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordDetailDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * 器具解绑记录子 Convert + * + * @author 超级管理员 + */ +@Mapper +public interface ContainerUnbindRecordDetailConvert { + + ContainerUnbindRecordDetailConvert INSTANCE = Mappers.getMapper(ContainerUnbindRecordDetailConvert.class); + + ContainerUnbindRecordDetailDO convert(ContainerUnbindRecordDetailCreateReqVO bean); + + ContainerUnbindRecordDetailDO convert(ContainerUnbindRecordDetailUpdateReqVO bean); + + ContainerUnbindRecordDetailRespVO convert(ContainerUnbindRecordDetailDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/containerUnbind/ContainerUnbindRecordMainConvert.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/containerUnbind/ContainerUnbindRecordMainConvert.java new file mode 100644 index 00000000..d1bd3c7b --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/convert/containerUnbind/ContainerUnbindRecordMainConvert.java @@ -0,0 +1,36 @@ +package com.win.module.wms.convert.containerUnbind; + +import com.win.framework.common.pojo.PageResult; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordMainCreateReqVO; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordMainExcelVO; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordMainRespVO; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordMainUpdateReqVO; +import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordMainDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * 器具解绑记录主 Convert + * + * @author 超级管理员 + */ +@Mapper +public interface ContainerUnbindRecordMainConvert { + + ContainerUnbindRecordMainConvert INSTANCE = Mappers.getMapper(ContainerUnbindRecordMainConvert.class); + + ContainerUnbindRecordMainDO convert(ContainerUnbindRecordMainCreateReqVO bean); + + ContainerUnbindRecordMainDO convert(ContainerUnbindRecordMainUpdateReqVO bean); + + ContainerUnbindRecordMainRespVO convert(ContainerUnbindRecordMainDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/containerUnbind/ContainerUnbindRecordDetailDO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/containerUnbind/ContainerUnbindRecordDetailDO.java new file mode 100644 index 00000000..adb6b98d --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/containerUnbind/ContainerUnbindRecordDetailDO.java @@ -0,0 +1,75 @@ +package com.win.module.wms.dal.dataobject.containerUnbind; + +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.win.framework.mybatis.core.dataobject.BaseDO; + +/** + * 器具解绑记录子 DO + * + * @author 超级管理员 + */ +@TableName("record_container_unbind_detail") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ContainerUnbindRecordDetailDO extends BaseDO { + + /** + * id + */ + @TableId + private Long id; + /** + * 内容物类型 + */ + private String containerContentType; + /** + * 内容物号 + */ + private String contentNumber; + /** + * 物料代码 + */ + private String itemCode; + /** + * 批次 + */ + private String batch; + /** + * 库存状态 + */ + private String inventoryStatus; + /** + * 计量单位 + */ + private String uom; + /** + * 数量 + */ + private BigDecimal qty; + /** + * 主表ID + */ + private Long masterId; + /** + * 单据号 + */ + private String number; + /** + * 地点ID + */ + private String siteId; + /** + * 备注 + */ + private String remark; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/containerUnbind/ContainerUnbindRecordMainDO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/containerUnbind/ContainerUnbindRecordMainDO.java new file mode 100644 index 00000000..303443cd --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/dataobject/containerUnbind/ContainerUnbindRecordMainDO.java @@ -0,0 +1,126 @@ +package com.win.module.wms.dal.dataobject.containerUnbind; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.win.framework.mybatis.core.dataobject.BaseDO; + +/** + * 器具解绑记录主 DO + * + * @author 超级管理员 + */ +@TableName("record_container_unbind_main") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ContainerUnbindRecordMainDO extends BaseDO { + + /** + * id + */ + @TableId + private Long id; + /** + * 单据号 + */ + private String number; + /** + * 器具号 + */ + private String containerNumber; + /** + * 从仓库代码 + */ + private String fromWarehouseCode; + /** + * 到仓库代码 + */ + private String toWarehouseCode; + /** + * 出库事务类型 + */ + private String outTransactionType; + /** + * 入库事务类型 + */ + private String inTransactionType; + /** + * 执行时间 + */ + private LocalDateTime executeTime; + /** + * 生效日期 + */ + private LocalDateTime activeDate; + /** + * 是否可用 + */ + private String available; + /** + * 申请时间 + */ + private LocalDateTime requestTime; + /** + * 截止时间 + */ + private LocalDateTime dueTime; + /** + * 部门 + */ + private String departmentCode; + /** + * 用户组 + */ + private String userGroupCode; + /** + * 接口类型 + */ + private String interfaceType; + /** + * 业务类型 + */ + private String businessType; + /** + * 备注 + */ + private String remark; + /** + * 扩展属性 + */ + private String extraProperties; + /** + * 地点ID + */ + private String siteId; + /** + * 代码 + */ + private String code; + /** + * 从库位类型范围 + */ + private String fromLocationTypes; + /** + * 到库位类型范围 + */ + private String toLocationTypes; + /** + * 从库区代码范围 + */ + private String fromAreaCodes; + /** + * 到库区代码范围 + */ + private String toAreaCodes; + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/containerUnbind/ContainerUnbindRecordDetailMapper.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/containerUnbind/ContainerUnbindRecordDetailMapper.java new file mode 100644 index 00000000..8b5b28fc --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/containerUnbind/ContainerUnbindRecordDetailMapper.java @@ -0,0 +1,55 @@ +package com.win.module.wms.dal.mysql.containerUnbind; + +import com.win.framework.common.pojo.PageResult; +import com.win.framework.mybatis.core.mapper.BaseMapperX; +import com.win.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordDetailExportReqVO; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordDetailPageReqVO; +import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordDetailDO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 器具解绑记录子 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface ContainerUnbindRecordDetailMapper extends BaseMapperX { + + default PageResult selectPage(ContainerUnbindRecordDetailPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ContainerUnbindRecordDetailDO::getContainerContentType, reqVO.getContainerContentType()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getContentNumber, reqVO.getContentNumber()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getItemCode, reqVO.getItemCode()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getBatch, reqVO.getBatch()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getInventoryStatus, reqVO.getInventoryStatus()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getUom, reqVO.getUom()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getQty, reqVO.getQty()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getMasterId, reqVO.getMasterId()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getNumber, reqVO.getNumber()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getSiteId, reqVO.getSiteId()) + .betweenIfPresent(ContainerUnbindRecordDetailDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getRemark, reqVO.getRemark()) + .orderByDesc(ContainerUnbindRecordDetailDO::getId)); + } + + default List selectList(ContainerUnbindRecordDetailExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(ContainerUnbindRecordDetailDO::getContainerContentType, reqVO.getContainerContentType()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getContentNumber, reqVO.getContentNumber()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getItemCode, reqVO.getItemCode()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getBatch, reqVO.getBatch()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getInventoryStatus, reqVO.getInventoryStatus()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getUom, reqVO.getUom()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getQty, reqVO.getQty()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getMasterId, reqVO.getMasterId()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getNumber, reqVO.getNumber()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getSiteId, reqVO.getSiteId()) + .betweenIfPresent(ContainerUnbindRecordDetailDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ContainerUnbindRecordDetailDO::getRemark, reqVO.getRemark()) + .orderByDesc(ContainerUnbindRecordDetailDO::getId)); + } + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/containerUnbind/ContainerUnbindRecordMainMapper.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/containerUnbind/ContainerUnbindRecordMainMapper.java new file mode 100644 index 00000000..700c84ef --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/containerUnbind/ContainerUnbindRecordMainMapper.java @@ -0,0 +1,79 @@ +package com.win.module.wms.dal.mysql.containerUnbind; + +import com.win.framework.common.pojo.PageResult; +import com.win.framework.mybatis.core.mapper.BaseMapperX; +import com.win.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordMainExportReqVO; +import com.win.module.wms.controller.containerUnbind.vo.ContainerUnbindRecordMainPageReqVO; +import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordMainDO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 器具解绑记录主 Mapper + * + * @author 超级管理员 + */ +@Mapper +public interface ContainerUnbindRecordMainMapper extends BaseMapperX { + + default PageResult selectPage(ContainerUnbindRecordMainPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ContainerUnbindRecordMainDO::getNumber, reqVO.getNumber()) + .eqIfPresent(ContainerUnbindRecordMainDO::getContainerNumber, reqVO.getContainerNumber()) + .eqIfPresent(ContainerUnbindRecordMainDO::getFromWarehouseCode, reqVO.getFromWarehouseCode()) + .eqIfPresent(ContainerUnbindRecordMainDO::getToWarehouseCode, reqVO.getToWarehouseCode()) + .eqIfPresent(ContainerUnbindRecordMainDO::getOutTransactionType, reqVO.getOutTransactionType()) + .eqIfPresent(ContainerUnbindRecordMainDO::getInTransactionType, reqVO.getInTransactionType()) + .betweenIfPresent(ContainerUnbindRecordMainDO::getExecuteTime, reqVO.getExecuteTime()) + .betweenIfPresent(ContainerUnbindRecordMainDO::getActiveDate, reqVO.getActiveDate()) + .eqIfPresent(ContainerUnbindRecordMainDO::getAvailable, reqVO.getAvailable()) + .betweenIfPresent(ContainerUnbindRecordMainDO::getRequestTime, reqVO.getRequestTime()) + .betweenIfPresent(ContainerUnbindRecordMainDO::getDueTime, reqVO.getDueTime()) + .eqIfPresent(ContainerUnbindRecordMainDO::getDepartmentCode, reqVO.getDepartmentCode()) + .eqIfPresent(ContainerUnbindRecordMainDO::getUserGroupCode, reqVO.getUserGroupCode()) + .eqIfPresent(ContainerUnbindRecordMainDO::getInterfaceType, reqVO.getInterfaceType()) + .eqIfPresent(ContainerUnbindRecordMainDO::getBusinessType, reqVO.getBusinessType()) + .eqIfPresent(ContainerUnbindRecordMainDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(ContainerUnbindRecordMainDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ContainerUnbindRecordMainDO::getExtraProperties, reqVO.getExtraProperties()) + .eqIfPresent(ContainerUnbindRecordMainDO::getSiteId, reqVO.getSiteId()) + .eqIfPresent(ContainerUnbindRecordMainDO::getCode, reqVO.getCode()) + .eqIfPresent(ContainerUnbindRecordMainDO::getFromLocationTypes, reqVO.getFromLocationTypes()) + .eqIfPresent(ContainerUnbindRecordMainDO::getToLocationTypes, reqVO.getToLocationTypes()) + .eqIfPresent(ContainerUnbindRecordMainDO::getFromAreaCodes, reqVO.getFromAreaCodes()) + .eqIfPresent(ContainerUnbindRecordMainDO::getToAreaCodes, reqVO.getToAreaCodes()) + .orderByDesc(ContainerUnbindRecordMainDO::getId)); + } + + default List selectList(ContainerUnbindRecordMainExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(ContainerUnbindRecordMainDO::getNumber, reqVO.getNumber()) + .eqIfPresent(ContainerUnbindRecordMainDO::getContainerNumber, reqVO.getContainerNumber()) + .eqIfPresent(ContainerUnbindRecordMainDO::getFromWarehouseCode, reqVO.getFromWarehouseCode()) + .eqIfPresent(ContainerUnbindRecordMainDO::getToWarehouseCode, reqVO.getToWarehouseCode()) + .eqIfPresent(ContainerUnbindRecordMainDO::getOutTransactionType, reqVO.getOutTransactionType()) + .eqIfPresent(ContainerUnbindRecordMainDO::getInTransactionType, reqVO.getInTransactionType()) + .betweenIfPresent(ContainerUnbindRecordMainDO::getExecuteTime, reqVO.getExecuteTime()) + .betweenIfPresent(ContainerUnbindRecordMainDO::getActiveDate, reqVO.getActiveDate()) + .eqIfPresent(ContainerUnbindRecordMainDO::getAvailable, reqVO.getAvailable()) + .betweenIfPresent(ContainerUnbindRecordMainDO::getRequestTime, reqVO.getRequestTime()) + .betweenIfPresent(ContainerUnbindRecordMainDO::getDueTime, reqVO.getDueTime()) + .eqIfPresent(ContainerUnbindRecordMainDO::getDepartmentCode, reqVO.getDepartmentCode()) + .eqIfPresent(ContainerUnbindRecordMainDO::getUserGroupCode, reqVO.getUserGroupCode()) + .eqIfPresent(ContainerUnbindRecordMainDO::getInterfaceType, reqVO.getInterfaceType()) + .eqIfPresent(ContainerUnbindRecordMainDO::getBusinessType, reqVO.getBusinessType()) + .eqIfPresent(ContainerUnbindRecordMainDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(ContainerUnbindRecordMainDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ContainerUnbindRecordMainDO::getExtraProperties, reqVO.getExtraProperties()) + .eqIfPresent(ContainerUnbindRecordMainDO::getSiteId, reqVO.getSiteId()) + .eqIfPresent(ContainerUnbindRecordMainDO::getCode, reqVO.getCode()) + .eqIfPresent(ContainerUnbindRecordMainDO::getFromLocationTypes, reqVO.getFromLocationTypes()) + .eqIfPresent(ContainerUnbindRecordMainDO::getToLocationTypes, reqVO.getToLocationTypes()) + .eqIfPresent(ContainerUnbindRecordMainDO::getFromAreaCodes, reqVO.getFromAreaCodes()) + .eqIfPresent(ContainerUnbindRecordMainDO::getToAreaCodes, reqVO.getToAreaCodes()) + .orderByDesc(ContainerUnbindRecordMainDO::getId)); + } + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordDetailService.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordDetailService.java new file mode 100644 index 00000000..5b07bfee --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordDetailService.java @@ -0,0 +1,81 @@ +package com.win.module.wms.service.containerUnbind; + +import com.win.framework.common.pojo.PageResult; +import com.win.module.wms.controller.containerUnbind.vo.*; +import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordDetailDO; + +import javax.validation.Valid; +import java.util.Collection; +import java.util.List; + +/** + * 器具解绑记录子 Service 接口 + * + * @author 超级管理员 + */ +public interface ContainerUnbindRecordDetailService { + + /** + * 创建器具解绑记录子 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createContainerUnbindRecordDetail(@Valid ContainerUnbindRecordDetailCreateReqVO createReqVO); + + /** + * 更新器具解绑记录子 + * + * @param updateReqVO 更新信息 + */ + Integer updateContainerUnbindRecordDetail(@Valid ContainerUnbindRecordDetailUpdateReqVO updateReqVO); + + /** + * 删除器具解绑记录子 + * + * @param id 编号 + */ + Integer deleteContainerUnbindRecordDetail(Long id); + + /** + * 获得器具解绑记录子 + * + * @param id 编号 + * @return 器具解绑记录子 + */ + ContainerUnbindRecordDetailDO getContainerUnbindRecordDetail(Long id); + + /** + * 获得器具解绑记录子列表 + * + * @param ids 编号 + * @return 器具解绑记录子列表 + */ + List getContainerUnbindRecordDetailList(Collection ids); + + /** + * 获得器具解绑记录子分页 + * + * @param pageReqVO 分页查询 + * @return 器具解绑记录子分页 + */ + PageResult getContainerUnbindRecordDetailPage(ContainerUnbindRecordDetailPageReqVO pageReqVO); + + /** + * 获得器具解绑记录子列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 器具解绑记录子列表 + */ + List getContainerUnbindRecordDetailList(ContainerUnbindRecordDetailExportReqVO exportReqVO); + + /** + * 导入器具解绑记录子主信息 + * + * @param datas 导入器具解绑记录子主信息列表 + * @param mode 导入模式1更新2追加3覆盖 + * @param updatePart 是否支持更新 + * @return 导入结果 + */ + public List importContainerUnbindRecordDetailList(List datas, Integer mode, boolean updatePart); +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordDetailServiceImpl.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordDetailServiceImpl.java new file mode 100644 index 00000000..4d0eae8f --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordDetailServiceImpl.java @@ -0,0 +1,109 @@ +package com.win.module.wms.service.containerUnbind; + +import cn.hutool.core.collection.CollUtil; +import com.win.framework.common.pojo.PageResult; +import com.win.module.wms.controller.containerUnbind.vo.*; +import com.win.module.wms.convert.containerUnbind.ContainerUnbindRecordDetailConvert; +import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordDetailDO; +import com.win.module.wms.dal.mysql.containerUnbind.ContainerUnbindRecordDetailMapper; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.win.module.wms.enums.ErrorCodeConstants.CONTAINER_UNBIND_RECORD_DETAIL_IMPORT_LIST_IS_EMPTY; +import static com.win.module.wms.enums.ErrorCodeConstants.CONTAINER_UNBIND_RECORD_DETAIL_NOT_EXISTS; + +/** + * 器具解绑记录子 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class ContainerUnbindRecordDetailServiceImpl implements ContainerUnbindRecordDetailService { + + @Resource + private ContainerUnbindRecordDetailMapper containerUnbindRecordDetailMapper; + + @Override + public Long createContainerUnbindRecordDetail(ContainerUnbindRecordDetailCreateReqVO createReqVO) { + // 插入 + ContainerUnbindRecordDetailDO containerUnbindRecordDetail = ContainerUnbindRecordDetailConvert.INSTANCE.convert(createReqVO); + containerUnbindRecordDetailMapper.insert(containerUnbindRecordDetail); + // 返回 + return containerUnbindRecordDetail.getId(); + } + + @Override + public Integer updateContainerUnbindRecordDetail(ContainerUnbindRecordDetailUpdateReqVO updateReqVO) { + // 校验存在 + validateContainerUnbindRecordDetailExists(updateReqVO.getId()); + // 更新 + ContainerUnbindRecordDetailDO updateObj = ContainerUnbindRecordDetailConvert.INSTANCE.convert(updateReqVO); + return containerUnbindRecordDetailMapper.updateById(updateObj); + } + + @Override + public Integer deleteContainerUnbindRecordDetail(Long id) { + // 校验存在 + validateContainerUnbindRecordDetailExists(id); + // 删除 + return containerUnbindRecordDetailMapper.deleteById(id); + } + + private void validateContainerUnbindRecordDetailExists(Long id) { + if (containerUnbindRecordDetailMapper.selectById(id) == null) { + throw exception(CONTAINER_UNBIND_RECORD_DETAIL_NOT_EXISTS); + } + } + + @Override + public ContainerUnbindRecordDetailDO getContainerUnbindRecordDetail(Long id) { + return containerUnbindRecordDetailMapper.selectById(id); + } + + @Override + public List getContainerUnbindRecordDetailList(Collection ids) { + return containerUnbindRecordDetailMapper.selectBatchIds(ids); + } + + @Override + public PageResult getContainerUnbindRecordDetailPage(ContainerUnbindRecordDetailPageReqVO pageReqVO) { + return containerUnbindRecordDetailMapper.selectPage(pageReqVO); + } + + @Override + public List getContainerUnbindRecordDetailList(ContainerUnbindRecordDetailExportReqVO exportReqVO) { + return containerUnbindRecordDetailMapper.selectList(exportReqVO); + } + + @Override + public List importContainerUnbindRecordDetailList(List datas, Integer mode, boolean updatePart) { + if (CollUtil.isEmpty(datas)) { + throw exception(CONTAINER_UNBIND_RECORD_DETAIL_IMPORT_LIST_IS_EMPTY); + } + + List errorList = new ArrayList<>(); +// datas.forEach(item -> { +// if(errorList == null){ +// // 判断如果不存在,在进行插入 +// ContainerUnbindRecordDetailDO obj = containerUnbindRecordDetailMapper.selectByCode(item.getCode()); +// if (obj == null&& mode != 3) { +// containerUnbindRecordDetailMapper.insert(ContainerUnbindRecordDetailConvert.INSTANCE.convert(item)); +// } +// else if (obj != null && mode != 2) {// 如果存在,判断是否允许更新 +// ContainerUnbindRecordDetailDO containerUnbindRecordDetailDO = ContainerUnbindRecordDetailConvert.INSTANCE.convert(item); +// containerUnbindRecordDetailDO.setId(obj.getId()); +// containerUnbindRecordDetailMapper.updateById(obj); +// } +// } +// }); + + return errorList; + } +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordMainService.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordMainService.java new file mode 100644 index 00000000..86100245 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordMainService.java @@ -0,0 +1,81 @@ +package com.win.module.wms.service.containerUnbind; + +import com.win.framework.common.pojo.PageResult; +import com.win.module.wms.controller.containerUnbind.vo.*; +import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordMainDO; + +import javax.validation.Valid; +import java.util.Collection; +import java.util.List; + +/** + * 器具解绑记录主 Service 接口 + * + * @author 超级管理员 + */ +public interface ContainerUnbindRecordMainService { + + /** + * 创建器具解绑记录主 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createContainerUnbindRecordMain(@Valid ContainerUnbindRecordMainCreateReqVO createReqVO); + + /** + * 更新器具解绑记录主 + * + * @param updateReqVO 更新信息 + */ + Integer updateContainerUnbindRecordMain(@Valid ContainerUnbindRecordMainUpdateReqVO updateReqVO); + + /** + * 删除器具解绑记录主 + * + * @param id 编号 + */ + Integer deleteContainerUnbindRecordMain(Long id); + + /** + * 获得器具解绑记录主 + * + * @param id 编号 + * @return 器具解绑记录主 + */ + ContainerUnbindRecordMainDO getContainerUnbindRecordMain(Long id); + + /** + * 获得器具解绑记录主列表 + * + * @param ids 编号 + * @return 器具解绑记录主列表 + */ + List getContainerUnbindRecordMainList(Collection ids); + + /** + * 获得器具解绑记录主分页 + * + * @param pageReqVO 分页查询 + * @return 器具解绑记录主分页 + */ + PageResult getContainerUnbindRecordMainPage(ContainerUnbindRecordMainPageReqVO pageReqVO); + + /** + * 获得器具解绑记录主列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 器具解绑记录主列表 + */ + List getContainerUnbindRecordMainList(ContainerUnbindRecordMainExportReqVO exportReqVO); + + /** + * 导入器具解绑记录主主信息 + * + * @param datas 导入器具解绑记录主主信息列表 + * @param mode 导入模式1更新2追加3覆盖 + * @param updatePart 是否支持更新 + * @return 导入结果 + */ + public List importContainerUnbindRecordMainList(List datas, Integer mode, boolean updatePart); +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordMainServiceImpl.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordMainServiceImpl.java new file mode 100644 index 00000000..5737f393 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordMainServiceImpl.java @@ -0,0 +1,109 @@ +package com.win.module.wms.service.containerUnbind; + +import cn.hutool.core.collection.CollUtil; +import com.win.framework.common.pojo.PageResult; +import com.win.module.wms.controller.containerUnbind.vo.*; +import com.win.module.wms.convert.containerUnbind.ContainerUnbindRecordMainConvert; +import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordMainDO; +import com.win.module.wms.dal.mysql.containerUnbind.ContainerUnbindRecordMainMapper; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.win.module.wms.enums.ErrorCodeConstants.CONTAINER_UNBIND_RECORD_MAIN_IMPORT_LIST_IS_EMPTY; +import static com.win.module.wms.enums.ErrorCodeConstants.CONTAINER_UNBIND_RECORD_MAIN_NOT_EXISTS; + +/** + * 器具解绑记录主 Service 实现类 + * + * @author 超级管理员 + */ +@Service +@Validated +public class ContainerUnbindRecordMainServiceImpl implements ContainerUnbindRecordMainService { + + @Resource + private ContainerUnbindRecordMainMapper containerUnbindRecordMainMapper; + + @Override + public Long createContainerUnbindRecordMain(ContainerUnbindRecordMainCreateReqVO createReqVO) { + // 插入 + ContainerUnbindRecordMainDO containerUnbindRecordMain = ContainerUnbindRecordMainConvert.INSTANCE.convert(createReqVO); + containerUnbindRecordMainMapper.insert(containerUnbindRecordMain); + // 返回 + return containerUnbindRecordMain.getId(); + } + + @Override + public Integer updateContainerUnbindRecordMain(ContainerUnbindRecordMainUpdateReqVO updateReqVO) { + // 校验存在 + validateContainerUnbindRecordMainExists(updateReqVO.getId()); + // 更新 + ContainerUnbindRecordMainDO updateObj = ContainerUnbindRecordMainConvert.INSTANCE.convert(updateReqVO); + return containerUnbindRecordMainMapper.updateById(updateObj); + } + + @Override + public Integer deleteContainerUnbindRecordMain(Long id) { + // 校验存在 + validateContainerUnbindRecordMainExists(id); + // 删除 + return containerUnbindRecordMainMapper.deleteById(id); + } + + private void validateContainerUnbindRecordMainExists(Long id) { + if (containerUnbindRecordMainMapper.selectById(id) == null) { + throw exception(CONTAINER_UNBIND_RECORD_MAIN_NOT_EXISTS); + } + } + + @Override + public ContainerUnbindRecordMainDO getContainerUnbindRecordMain(Long id) { + return containerUnbindRecordMainMapper.selectById(id); + } + + @Override + public List getContainerUnbindRecordMainList(Collection ids) { + return containerUnbindRecordMainMapper.selectBatchIds(ids); + } + + @Override + public PageResult getContainerUnbindRecordMainPage(ContainerUnbindRecordMainPageReqVO pageReqVO) { + return containerUnbindRecordMainMapper.selectPage(pageReqVO); + } + + @Override + public List getContainerUnbindRecordMainList(ContainerUnbindRecordMainExportReqVO exportReqVO) { + return containerUnbindRecordMainMapper.selectList(exportReqVO); + } + + @Override + public List importContainerUnbindRecordMainList(List datas, Integer mode, boolean updatePart) { + if (CollUtil.isEmpty(datas)) { + throw exception(CONTAINER_UNBIND_RECORD_MAIN_IMPORT_LIST_IS_EMPTY); + } + + List errorList = new ArrayList<>(); +// datas.forEach(item -> { +// if(errorList == null){ +// // 判断如果不存在,在进行插入 +// ContainerUnbindRecordMainDO obj = containerUnbindRecordMainMapper.selectByCode(item.getCode()); +// if (obj == null&& mode != 3) { +// containerUnbindRecordMainMapper.insert(ContainerUnbindRecordMainConvert.INSTANCE.convert(item)); +// } +// else if (obj != null && mode != 2) {// 如果存在,判断是否允许更新 +// ContainerUnbindRecordMainDO containerUnbindRecordMainDO = ContainerUnbindRecordMainConvert.INSTANCE.convert(item); +// containerUnbindRecordMainDO.setId(obj.getId()); +// containerUnbindRecordMainMapper.updateById(obj); +// } +// } +// }); + + return errorList; + } +} diff --git a/win-module-wms/win-module-wms-biz/src/main/resources/mapper/containerUnbind/ContainerUnbindRecordDetailMapper.xml b/win-module-wms/win-module-wms-biz/src/main/resources/mapper/containerUnbind/ContainerUnbindRecordDetailMapper.xml new file mode 100644 index 00000000..eb0885df --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/resources/mapper/containerUnbind/ContainerUnbindRecordDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/win-module-wms/win-module-wms-biz/src/main/resources/mapper/containerUnbind/ContainerUnbindRecordMainMapper.xml b/win-module-wms/win-module-wms-biz/src/main/resources/mapper/containerUnbind/ContainerUnbindRecordMainMapper.xml new file mode 100644 index 00000000..b1f01d99 --- /dev/null +++ b/win-module-wms/win-module-wms-biz/src/main/resources/mapper/containerUnbind/ContainerUnbindRecordMainMapper.xml @@ -0,0 +1,12 @@ + + + + + + +