From 14dc4f77cc17d0ff199c3706d5e6f75f0438a6c4 Mon Sep 17 00:00:00 2001 From: faramita <1246063744@qq.com> Date: Tue, 10 Dec 2024 17:53:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8D=95=E6=8D=AE=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8/=E5=8D=95=E6=8D=AE=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DocumentDetailReportDto.java} | 115 +-- .../mom/wms/dto/DocumentSummaryReportDto.java | 361 +++---- .../mom/wms/entity/DocumentSummaryReport.java | 200 ---- .../controller/DocumentReportController.java | 114 +++ .../DocumentSummaryReportController.java | 118 --- .../wms/service/DocumentReportService.java | 38 + .../service/DocumentSummaryReportService.java | 33 - .../impl/DocumentReportServiceImpl.java | 199 ++++ .../DocumentSummaryReportServiceImpl.java | 891 ------------------ .../mom/wms/mapper/DocumentReportMapper.java | 86 ++ .../mapper/DocumentSummaryReportMapper.java | 33 - .../resources/mapper/DocumentReportMapper.xml | 422 +++++++++ .../mapper/DocumentSummaryReportMapper.xml | 469 --------- 13 files changed, 1043 insertions(+), 2036 deletions(-) rename mom-wms-api/src/main/java/com/foreverwin/mom/wms/{entity/DocumentDetailedReport.java => dto/DocumentDetailReportDto.java} (73%) delete mode 100644 mom-wms-api/src/main/java/com/foreverwin/mom/wms/entity/DocumentSummaryReport.java create mode 100644 mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/DocumentReportController.java delete mode 100644 mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/DocumentSummaryReportController.java create mode 100644 mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/DocumentReportService.java delete mode 100644 mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/DocumentSummaryReportService.java create mode 100644 mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentReportServiceImpl.java delete mode 100644 mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentSummaryReportServiceImpl.java create mode 100644 mom-wms-db/src/main/java/com/foreverwin/mom/wms/mapper/DocumentReportMapper.java delete mode 100644 mom-wms-db/src/main/java/com/foreverwin/mom/wms/mapper/DocumentSummaryReportMapper.java create mode 100644 mom-wms-db/src/main/resources/mapper/DocumentReportMapper.xml delete mode 100644 mom-wms-db/src/main/resources/mapper/DocumentSummaryReportMapper.xml diff --git a/mom-wms-api/src/main/java/com/foreverwin/mom/wms/entity/DocumentDetailedReport.java b/mom-wms-api/src/main/java/com/foreverwin/mom/wms/dto/DocumentDetailReportDto.java similarity index 73% rename from mom-wms-api/src/main/java/com/foreverwin/mom/wms/entity/DocumentDetailedReport.java rename to mom-wms-api/src/main/java/com/foreverwin/mom/wms/dto/DocumentDetailReportDto.java index 6634b98..443a9aa 100644 --- a/mom-wms-api/src/main/java/com/foreverwin/mom/wms/entity/DocumentDetailedReport.java +++ b/mom-wms-api/src/main/java/com/foreverwin/mom/wms/dto/DocumentDetailReportDto.java @@ -1,21 +1,16 @@ -package com.foreverwin.mom.wms.entity; +package com.foreverwin.mom.wms.dto; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.time.LocalDateTime; @Data @ExcelIgnoreUnannotated -public class DocumentDetailedReport { - /** - * 站点 - */ - /*@ExcelProperty("站点") - private String site;*/ - +public class DocumentDetailReportDto { /** * 单据号 */ @@ -47,35 +42,17 @@ public class DocumentDetailedReport { private String seq; /** - * 单据行状态 - */ - @ExcelProperty("行状态") - private String seqState; - - /** - * 行需求数量 + * 需求数量 */ @ExcelProperty("需求数量") private BigDecimal applicationsQuantity; /** - * 行完成数量 + * 实际数量 */ - @ExcelProperty("完成数量") + @ExcelProperty("实际数量") private BigDecimal actualQuantity; - /** - * 项目编号 - */ - @ExcelProperty("项目编号") - private String oaProjectCode; - - /** - * 项目名称 - */ - @ExcelProperty("项目名称") - private String oaProjectDesc; - /** * 备注 */ @@ -88,12 +65,6 @@ public class DocumentDetailedReport { @ExcelProperty("IQC") private String iqcResults; - /** - * OQC - */ - @ExcelProperty("OQC") - private String oqcResults; - /** * 检验单号 */ @@ -106,12 +77,6 @@ public class DocumentDetailedReport { @ExcelProperty("托条码") private String pallet; - /** - * 箱条码 - */ - @ExcelProperty("箱条码") - private String box; - /** * 库存条码 */ @@ -124,12 +89,6 @@ public class DocumentDetailedReport { @ExcelProperty("物料") private String item; - /** - * 物料 - */ - @ExcelProperty("物料组") - private String itemGroup; - /** * 物料描述 */ @@ -148,12 +107,6 @@ public class DocumentDetailedReport { @ExcelProperty("单位") private String unitOfMeasure; - /** - * 规格型号 - */ - @ExcelProperty("规格型号") - private String groes; - /** * 质量等级 */ @@ -179,13 +132,13 @@ public class DocumentDetailedReport { private String deliveryParty; /** - * 采购到货批 + * 采购到货批次 */ @ExcelProperty("采购到货批次") private String batchNumber; /** - * 供应商批 + * 供应商批次 */ @ExcelProperty("供应商批次") private String vendorBatch; @@ -206,17 +159,18 @@ public class DocumentDetailedReport { * 宽度 */ @ExcelProperty("宽度") - private BigDecimal width; + private String width; /** * 厚度 */ @ExcelProperty("厚度") private String bismt; + /** - * 来源仓库 + * 来源仓 */ - @ExcelProperty("来源仓库") + @ExcelProperty("来源仓") private String sourceWarehouse; /** @@ -230,10 +184,11 @@ public class DocumentDetailedReport { */ @ExcelProperty("来源货格") private String storageBin; + /** - * 目标仓库 + * 目标仓 */ - @ExcelProperty("目标仓库") + @ExcelProperty("目标仓") private String targetWarehouse; /** @@ -248,12 +203,6 @@ public class DocumentDetailedReport { @ExcelProperty("目标货格") private String targetBin; - /** - * 二次入库 - */ - @ExcelProperty("二次入库") - private String mesInventory; - /** * 创建人 */ @@ -270,22 +219,48 @@ public class DocumentDetailedReport { * 创建时间 */ @ExcelProperty("创建时间") - private LocalDateTime createDateTime; + private LocalDateTime createDate; /** * 更新人 */ @ExcelProperty("更新人") - private String modifyUser; + private String updateUser; + /** * 更新人 */ @ExcelProperty("更新人名称") - private String modifyUserName; + private String updateUserName; + /** * 更新时间 */ @ExcelProperty("更新时间") - private LocalDateTime modifyDateTime; + private LocalDateTime updateDate; + + /** + * 创建日期自 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createDateTime1; + + /** + * 创建日期至 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createDateTime2; + + /** + * 更新日期自 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime modifyDateTime1; + + /** + * 更新日期至 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime modifyDateTime2; } diff --git a/mom-wms-api/src/main/java/com/foreverwin/mom/wms/dto/DocumentSummaryReportDto.java b/mom-wms-api/src/main/java/com/foreverwin/mom/wms/dto/DocumentSummaryReportDto.java index f77a248..7e8e123 100644 --- a/mom-wms-api/src/main/java/com/foreverwin/mom/wms/dto/DocumentSummaryReportDto.java +++ b/mom-wms-api/src/main/java/com/foreverwin/mom/wms/dto/DocumentSummaryReportDto.java @@ -1,260 +1,177 @@ package com.foreverwin.mom.wms.dto; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.time.LocalDateTime; @Data +@ExcelIgnoreUnannotated public class DocumentSummaryReportDto { - /** - * 站点 - */ - private String site; + /** + * 单据号 + */ + @ExcelProperty("单据号") + private String documentNo; - /** - * 单据行号 - */ - private String seq; + /** + * 外部单据号 + */ + @ExcelProperty("外部单据号") + private String externalDocumentNo; - /** - * 单据号 - */ - private String documentNo; + /** + * 单据类型 + */ + @ExcelProperty("单据类型") + private String documentType; - /** - * 外部单据号 - */ - private String externalDocumentNo; + /** + * 单据状态 + */ + @ExcelProperty("单据状态") + private String state; - /** - * 单据类型 - */ - private String documentType; + /** + * 单据行号 + */ + @ExcelProperty("单据行号") + private String seq; - /** - * 单据状态 - */ - //private List stateList; + /** + * 物料 + */ + @ExcelProperty("物料") + private String item; - private String state; + /** + * 物料描述 + */ + @ExcelProperty("物料描述") + private String itemDescription; - /** - * 创建人 - */ - private String createUser; + /** + * 需求批次 + */ + @ExcelProperty("需求批次") + private String batch; - /** - * 创建人名称 - */ - private String createUserName; + /** + * 单位 + */ + @ExcelProperty("单位") + private String unitOfMeasure; - /** - * 更新人 - */ - private String modifyUser; + /** + * 需求数量 + */ + @ExcelProperty("需求数量") + private BigDecimal applicationsQuantity; - /** - * 更新人名称 - */ - private String modifyUserName; + /** + * 实际数量 + */ + @ExcelProperty("实际数量") + private BigDecimal actualQuantity; - /** - * 创建日期 - */ - private LocalDateTime createDateTime; + /** + * 来源仓 + */ + @ExcelProperty("来源仓") + private String sourceWarehouse; - /** - * 创建日期自 - */ - private LocalDateTime createDateTime1; - - /** - * 创建日期至 - */ - private LocalDateTime createDateTime2; - - /** - * 更新日期 - */ - private LocalDateTime modifyDateTime; - - /** - * 更新日期自 - */ - private LocalDateTime modifyDateTime1; - - /** - * 更新日期至 - */ - private LocalDateTime modifyDateTime2; - - /** - * 单据行状态 - */ - private String seqState; - - /** - * 物料 - */ - private String item; - - /** - * 物料组 - */ - private String itemGroup; - - /** - * 物料描述 - */ - private String itemDescription; - - /** - * 规格型号 - */ - private String groes; - - /** - * 标准长度 - */ - private String standardLength; - - /** - * 实际长度 - */ - private String length; - - /** - * 宽度 - */ - private BigDecimal width; - - /** - * 厚度 - */ - private String bismt; - - /** - * 来源仓 - */ - private String sourceWarehouse; - - /** - * 目标仓 - */ - private String targetWarehouse; - - /** - * 项目编号 - */ - private String oaProjectCode; - - /** - * 出货批次 - */ - private String salesBatch; - - /** - * IQC - */ - private String iqcResults; - - /** - * OQC - */ - private String oqcResults; - - /** - * 托条码 - */ - private String pallet; - - /** - * 箱条码 - */ - private String box; - - /** - * 库存条码 - */ - private String inventoryId; - - /** - * 检验单号 - */ - private String inspectionOrderNo; - - /** - * 质量等级 - */ - private String qualityInspectionStatus; - - /** - * 采购到货批 - */ - private String batchNumber; - - /** - * 供应商批 - */ - private String vendorBatch; + /** + * 目标仓 + */ + @ExcelProperty("目标仓") + private String targetWarehouse; - /** - * 来源区域 - */ - private String sourceLocation; + /** + * 备注 + */ + @ExcelProperty("备注") + private String remarks; - /** - * 来源货格 - */ - private String storageBin; + /** + * 出货批次 + */ + @ExcelProperty("出货批次") + private String salesBatch; + /** + * IQC + */ + @ExcelProperty("IQC") + private String iqcResults; - /** - * 目标区域 - */ - private String targetLocation; + /** + * 托数 + */ + @ExcelProperty("托数") + private String palletNum; - /** - * 目标货格 - */ - private String targetBin; + /** + * 创建人 + */ + @ExcelProperty("创建人") + private String createUser; - /** - * 托数 - */ - private String palletNum; + /** + * 创建人名称 + */ + @ExcelProperty("创建人名称") + private String createUserName; - /** - * 箱数 - */ - private String boxNum; + /** + * 创建时间 + */ + @ExcelProperty("创建时间") + private LocalDateTime createDate; - /** - * 客户代码 - */ - private String deliveryParty; + /** + * 更新人 + */ + @ExcelProperty("更新人") + private String updateUser; - private String batch; + /** + * 更新人 + */ + @ExcelProperty("更新人名称") + private String updateUserName; - private String unitOfMeasure; + /** + * 更新时间 + */ + @ExcelProperty("更新时间") + private LocalDateTime updateDate; - private String remarks; + /** + * 创建日期自 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createDateTime1; - private String oaProjectDesc; + /** + * 创建日期至 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createDateTime2; - private BigDecimal actualQuantity; - - private BigDecimal applicationsQuantity; - - private String carrier; - - private String mesInventory; - - private BigDecimal qty; - - private String description; + /** + * 更新日期自 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime modifyDateTime1; + /** + * 更新日期至 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime modifyDateTime2; } diff --git a/mom-wms-api/src/main/java/com/foreverwin/mom/wms/entity/DocumentSummaryReport.java b/mom-wms-api/src/main/java/com/foreverwin/mom/wms/entity/DocumentSummaryReport.java deleted file mode 100644 index 9b69a0b..0000000 --- a/mom-wms-api/src/main/java/com/foreverwin/mom/wms/entity/DocumentSummaryReport.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.foreverwin.mom.wms.entity; - -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -@Data -@ExcelIgnoreUnannotated -public class DocumentSummaryReport { - - /** - * 单据号 - */ - @ExcelProperty("单据号") - private String documentNo; - - /** - * 外部单据号 - */ - @ExcelProperty("外部单据号") - private String externalDocumentNo; - - /** - * 单据类型 - */ - @ExcelProperty("单据类型") - private String documentType; - - /** - * 单据状态 - */ - @ExcelProperty("单据状态") - private String state; - - /** - * 单据行号 - */ - @ExcelProperty("单据行号") - private String seq; - - /** - * 单据行状态 - */ - @ExcelProperty("行状态") - private String seqState; - - /** - * 物料 - */ - @ExcelProperty("物料") - private String item; - - /** - * 物料 - */ - @ExcelProperty("物料组") - private String itemGroup; - - /** - * 物料描述 - */ - @ExcelProperty("物料描述") - private String itemDescription; - - /** - * 厚度 - */ - @ExcelProperty("厚度") - private String bismt; - - /** - * 规格型号 - */ - @ExcelProperty("规格型号") - private String groes; - - /** - * 供应商批次号 - */ - @ExcelProperty("需求批次") - private String batch; - - /** - * 父库存 - */ - @ExcelProperty("单位") - private String unitOfMeasure; - - /** - * 需求数量 - */ - @ExcelProperty("需求数量") - private BigDecimal applicationsQuantity; - - /** - * 实际数量 - */ - @ExcelProperty("实际数量") - private BigDecimal actualQuantity; - - /** - * 来源仓 - */ - @ExcelProperty("来源仓") - private String sourceWarehouse; - - /** - * 目标仓 - */ - @ExcelProperty("目标仓") - private String targetWarehouse; - - /** - * 项目编号 - */ - @ExcelProperty("项目编号") - private String oaProjectCode; - - /** - * 项目名称 - */ - @ExcelProperty("项目名称") - private String oaProjectDesc; - - /** - * 备注 - */ - @ExcelProperty("备注") - private String remarks; - - /** - * 出货批次 - */ - @ExcelProperty("出货批次") - private String salesBatch; - - /** - * IQC - */ - @ExcelProperty("IQC") - private String iqcResults; - - /** - * OQC - */ - @ExcelProperty("OQC") - private String oqcResults; - - /** - * 托数 - */ - @ExcelProperty("托数") - private String palletNum; - - /** - * 箱数 - */ - @ExcelProperty("箱数") - private String boxNum; - - /** - * 创建人 - */ - - @ExcelProperty("创建人") - private String createUser; - - /** - * 创建人名称 - */ - @ExcelProperty("创建人名称") - private String createUserName; - - /** - * 创建时间 - */ - @ExcelProperty("创建时间") - private LocalDateTime createDateTime; - - /** - * 更新人 - */ - @ExcelProperty("更新人") - private String modifyUser; - - /** - * 更新人 - */ - @ExcelProperty("更新人名称") - private String modifyUserName; - - /** - * 更新时间 - */ - @ExcelProperty("更新时间") - private LocalDateTime modifyDateTime; -} diff --git a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/DocumentReportController.java b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/DocumentReportController.java new file mode 100644 index 0000000..422dcf2 --- /dev/null +++ b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/DocumentReportController.java @@ -0,0 +1,114 @@ +package com.foreverwin.mom.wms.controller; + + +import com.alibaba.excel.EasyExcel; +import com.foreverwin.iep.common.base.FrontPage; +import com.foreverwin.mom.common.core.util.R; +import com.foreverwin.mom.common.data.tenant.TenantContextHolder; +import com.foreverwin.mom.wms.dto.DocumentDetailReportDto; +import com.foreverwin.mom.wms.dto.DocumentSummaryReportDto; +import com.foreverwin.mom.wms.entity.WareHouse; +import com.foreverwin.mom.wms.service.DocumentReportService; +import com.foreverwin.mom.wms.util.ExcelCellWidthStyleStrategy; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 单据汇总报表 + * + * @author xnn + * @since 2024-04-03 + */ + +@RestController +@AllArgsConstructor +@RequestMapping("/document-report") +@Api(value = "DocumentReport", tags = "单据报表") +public class DocumentReportController { + + private final DocumentReportService documentReportService; + + /** + * 分页查询 + * + * @return R + */ + @ResponseBody + @GetMapping("/pageDocumentSummary") + public R pageDocumentSummary(FrontPage page, DocumentSummaryReportDto documentSummaryReportDto) { + return R.ok(documentReportService.pageDocumentSummary(page, documentSummaryReportDto)); + } + + /** + * 导出 + * + * @return + */ + @ResponseBody + @GetMapping("/documentSummaryExport") + public void documentSummaryExport(DocumentSummaryReportDto documentSummaryReportDto) throws Exception { + List documentSummaryReportDtoList = documentReportService.selectDocumentSummary(documentSummaryReportDto); + String fileName = "单据汇总报表"; + ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = attributes.getResponse(); + response.setCharacterEncoding("utf-8"); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + // 这里需要设置不关闭流 + ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy(); + EasyExcel.write(response.getOutputStream(), DocumentSummaryReportDto.class).registerWriteHandler(widthStyleStrategy).autoCloseStream(Boolean.FALSE).sheet(fileName) + .doWrite(documentSummaryReportDtoList); + } + + //单据明细报表 + @ResponseBody + @GetMapping("/pageDocumentDetailed") + public R pageDocumentDetailed(FrontPage page, DocumentDetailReportDto documentDetailReportDto) { + return R.ok(documentReportService.pageDocumentDetailed(page, documentDetailReportDto)); + } + + /** + * 单据明细表导出 + * + * @return + */ + @ResponseBody + @GetMapping("/documentDetailedExport") + public void tableDetailedPageExport(DocumentDetailReportDto documentDetailReportDto) throws Exception { + List documentDetailReportDtoList = documentReportService.selectDocumentDetailed(documentDetailReportDto); + String fileName = "单据明细报表"; + ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = attributes.getResponse(); + response.setCharacterEncoding("utf-8"); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + // 这里需要设置不关闭流 + ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy(); + EasyExcel.write(response.getOutputStream(), DocumentDetailReportDto.class) + .registerWriteHandler(widthStyleStrategy) + .autoCloseStream(Boolean.FALSE) + .sheet(fileName) + .doWrite(documentDetailReportDtoList); + } + + //获取来源仓数据 + @ResponseBody + @GetMapping("/sourceWarehouse/page") + public R page(FrontPage frontPage) { + return R.ok(documentReportService.getAllSourceWarehouse(frontPage, TenantContextHolder.getTenantId(), frontPage.getSearchText())); + } + + //获取目标仓数据 + @ResponseBody + @GetMapping("/targetWarehouse/page") + public R pages(FrontPage frontPage) { + return R.ok(documentReportService.getAllTargetWarehouse(frontPage, TenantContextHolder.getTenantId(), frontPage.getSearchText())); + } + +} diff --git a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/DocumentSummaryReportController.java b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/DocumentSummaryReportController.java deleted file mode 100644 index 8009b73..0000000 --- a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/DocumentSummaryReportController.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.foreverwin.mom.wms.controller; - - -import com.alibaba.excel.EasyExcel; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.foreverwin.iep.common.base.FrontPage; -import com.foreverwin.mom.common.core.util.R; -import com.foreverwin.mom.wms.dto.DocumentSummaryReportDto; -import com.foreverwin.mom.wms.entity.DocumentDetailedReport; -import com.foreverwin.mom.wms.entity.DocumentSummaryReport; -import com.foreverwin.mom.wms.service.DocumentSummaryReportService; -import com.foreverwin.mom.wms.util.ExcelCellWidthStyleStrategy; -import io.swagger.annotations.Api; -import lombok.AllArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * 单据汇总报表 - * - * @author xnn - * @since 2024-04-03 - */ - -@RestController -@AllArgsConstructor -@RequestMapping("/document-summary-report") -@Api(value = "DocumentSummaryReport", tags = "单据汇总报表") -public class DocumentSummaryReportController { - - private final DocumentSummaryReportService documentSummaryReportService; - - /** - * 分页查询 - * - * @return R - */ - @ResponseBody - @PostMapping("/selectPage") - public R retrieve(Page page, @RequestBody DocumentSummaryReportDto documentSummaryReportDto) { - return R.ok(documentSummaryReportService.doRetrieve(page,documentSummaryReportDto)); - } - - /** - * 导出 - * - * @return - */ - @ResponseBody - @PostMapping("/tablePageExport") - public void tablePageExport(@RequestBody DocumentSummaryReportDto documentSummaryReportDto) throws Exception{ - List documentSummaryReportDtoList = documentSummaryReportService.doSelect(documentSummaryReportDto); - String fileName = "单据汇总报表"; - ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); - HttpServletResponse response = attributes.getResponse(); - response.setCharacterEncoding("utf-8"); - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); - // 这里需要设置不关闭流 - ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy(); - EasyExcel.write(response.getOutputStream(), DocumentSummaryReport.class).registerWriteHandler(widthStyleStrategy).autoCloseStream(Boolean.FALSE).sheet(fileName) - .doWrite(documentSummaryReportDtoList); - } - //获取来源仓数据 - @ResponseBody - @GetMapping("/sourceWarehouse/page") - public R page(Page frontPage, String searchText) { - IPage sourceWarehouseIPage = documentSummaryReportService.getAllSourceWarehouse(frontPage, searchText); - return R.ok(sourceWarehouseIPage); - } - //获取目标仓数据 - @ResponseBody - @GetMapping("/targetWarehouse/page") - public R pages(Page frontPage, String searchText) { - IPage targetWarehouseIPage = documentSummaryReportService.getAllTargetWarehouse(frontPage, searchText); - return R.ok(targetWarehouseIPage); - } - //单据明细报表 - @ResponseBody - @PostMapping("/selectDocumentDetailedPage") - public R retrieveDocumentDetailed(FrontPage page, @RequestBody DocumentSummaryReportDto documentSummaryReportDto) { - page.setOptimizeCountSql(false); - return R.ok(documentSummaryReportService.doRetrieveDocumentDetailed(page,documentSummaryReportDto)); - } - /** - * 单据明细表导出 - * - * @return - */ - @ResponseBody - @PostMapping("/tableDetailedPageExport") - public void tableDetailedPageExport(@RequestBody DocumentSummaryReportDto documentSummaryReportDto) throws Exception { - List documentDetailReportDtoList = documentSummaryReportService.doDetailedSelect(documentSummaryReportDto); - String fileName = "单据明细报表"; - ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); - HttpServletResponse response = attributes.getResponse(); - response.setCharacterEncoding("utf-8"); - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); - // 这里需要设置不关闭流 - ExcelCellWidthStyleStrategy widthStyleStrategy = new ExcelCellWidthStyleStrategy(); - EasyExcel.write(response.getOutputStream(), DocumentDetailedReport.class) - .registerWriteHandler(widthStyleStrategy) - .autoCloseStream(Boolean.FALSE) - .sheet(fileName) - .doWrite(documentDetailReportDtoList); - } -} diff --git a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/DocumentReportService.java b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/DocumentReportService.java new file mode 100644 index 0000000..d5d634b --- /dev/null +++ b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/DocumentReportService.java @@ -0,0 +1,38 @@ +package com.foreverwin.mom.wms.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.foreverwin.mom.wms.dto.DocumentDetailReportDto; +import com.foreverwin.mom.wms.dto.DocumentSummaryReportDto; +import com.foreverwin.mom.wms.entity.DocumentDetailed; +import com.foreverwin.mom.wms.entity.WareHouse; + +import java.util.List; + +/** + * 单据汇总报表 + * + * @author xnn + * @since 2024-04-03 + */ +public interface DocumentReportService extends IService { + + //单据汇总查询 + IPage pageDocumentSummary(IPage iPage, DocumentSummaryReportDto documentSummaryReportDto); + + //导出 + List selectDocumentSummary(DocumentSummaryReportDto documentSummaryReportDto); + + //单据明细查询 + IPage pageDocumentDetailed(IPage iPage, DocumentDetailReportDto documentDetailReportDto); + + //单据明细表导出 + List selectDocumentDetailed(DocumentDetailReportDto documentDetailReportDto); + + //获取来源仓 + IPage getAllSourceWarehouse(IPage iPage, String site, String searchText); + + //获取目标仓 + IPage getAllTargetWarehouse(IPage iPage, String site, String searchText); + +} diff --git a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/DocumentSummaryReportService.java b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/DocumentSummaryReportService.java deleted file mode 100644 index afc3380..0000000 --- a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/DocumentSummaryReportService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.foreverwin.mom.wms.service; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; - -import com.foreverwin.mom.wms.dto.DocumentSummaryReportDto; -import com.foreverwin.mom.wms.dto.InventoryQueryReportDto; -import com.foreverwin.mom.wms.entity.DocumentDetailed; - -import java.util.List; - -/** - * 单据汇总报表 - * - * @author xnn - * @since 2024-04-03 - */ -public interface DocumentSummaryReportService extends IService { - - //单据汇总查询 - IPage doRetrieve(IPage iPage, DocumentSummaryReportDto documentSummaryReportDto); - - //导出 - List doSelect(DocumentSummaryReportDto documentSummaryReportDto); - //获取来源仓 - IPage getAllSourceWarehouse(IPage iPage,String searchText); - //获取目标仓 - IPage getAllTargetWarehouse(IPage iPage,String searchText); - //单据明细查询 - IPage doRetrieveDocumentDetailed(IPage iPage, DocumentSummaryReportDto documentSummaryReportDto); - //单据明细表导出 - List doDetailedSelect(DocumentSummaryReportDto documentSummaryReportDto); -} diff --git a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentReportServiceImpl.java b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentReportServiceImpl.java new file mode 100644 index 0000000..87fcf7d --- /dev/null +++ b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentReportServiceImpl.java @@ -0,0 +1,199 @@ +package com.foreverwin.mom.wms.service.impl; + + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.foreverwin.mom.admin.api.entity.SysDictItem; +import com.foreverwin.mom.admin.api.feign.RemoteDictService; +import com.foreverwin.mom.common.core.constant.SecurityConstants; +import com.foreverwin.mom.common.core.exception.BusinessException; +import com.foreverwin.mom.common.data.tenant.TenantContextHolder; +import com.foreverwin.mom.wms.dto.DocumentDetailReportDto; +import com.foreverwin.mom.wms.dto.DocumentSummaryReportDto; +import com.foreverwin.mom.wms.entity.DocumentDetailed; +import com.foreverwin.mom.wms.entity.WareHouse; +import com.foreverwin.mom.wms.mapper.DocumentReportMapper; +import com.foreverwin.mom.wms.service.DocumentReportService; +import lombok.AllArgsConstructor; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + + +/** + * 单据汇总报表 + * + * @author xnn + * @since 2024-04-03 + */ +@Service +@RequiredArgsConstructor +public class DocumentReportServiceImpl extends ServiceImpl implements DocumentReportService { + + private final RemoteDictService remoteDictService; + + private List splitSearchField(String field) { + return StrUtil.isNotBlank(field) ? Arrays.asList(field.split(" ")) : null; + } + + @Override + public IPage pageDocumentSummary(IPage iPage, DocumentSummaryReportDto dto) { + String site = TenantContextHolder.getTenantId(); + + List documentNoList = splitSearchField(dto.getDocumentNo()); + List externalDocumentNoList = splitSearchField(dto.getExternalDocumentNo()); + List documentTypeList = splitSearchField(dto.getDocumentType()); + List stateList = splitSearchField(dto.getState()); + List createUserList = splitSearchField(dto.getCreateUser()); + List updateUserList = splitSearchField(dto.getUpdateUser()); + List itemList = splitSearchField(dto.getItem()); + List sourceWarehouseList = splitSearchField(dto.getSourceWarehouse()); + List targetWarehouseList = splitSearchField(dto.getTargetWarehouse()); + List salesBatchList = splitSearchField(dto.getSalesBatch()); + List iqcResultsList = splitSearchField(dto.getIqcResults()); + LocalDateTime createDateTime1 = dto.getCreateDateTime1(); + LocalDateTime createDateTime2 = dto.getCreateDateTime2(); + LocalDateTime modifyDateTime1 = dto.getModifyDateTime1(); + LocalDateTime modifyDateTime2 = dto.getModifyDateTime2(); + + return baseMapper.selectDocumentSummary(iPage, site, documentNoList, externalDocumentNoList, documentTypeList, stateList, createUserList, updateUserList, itemList, sourceWarehouseList, targetWarehouseList, salesBatchList, iqcResultsList, createDateTime1, createDateTime2, modifyDateTime1, modifyDateTime2); + } + + //导出 + @Override + public List selectDocumentSummary(DocumentSummaryReportDto dto) { + String site = TenantContextHolder.getTenantId(); + + List documentNoList = splitSearchField(dto.getDocumentNo()); + List externalDocumentNoList = splitSearchField(dto.getExternalDocumentNo()); + List documentTypeList = splitSearchField(dto.getDocumentType()); + List stateList = splitSearchField(dto.getState()); + List createUserList = splitSearchField(dto.getCreateUser()); + List updateUserList = splitSearchField(dto.getUpdateUser()); + List itemList = splitSearchField(dto.getItem()); + List sourceWarehouseList = splitSearchField(dto.getSourceWarehouse()); + List targetWarehouseList = splitSearchField(dto.getTargetWarehouse()); + List salesBatchList = splitSearchField(dto.getSalesBatch()); + List iqcResultsList = splitSearchField(dto.getIqcResults()); + LocalDateTime createDateTime1 = dto.getCreateDateTime1(); + LocalDateTime createDateTime2 = dto.getCreateDateTime2(); + LocalDateTime modifyDateTime1 = dto.getModifyDateTime1(); + LocalDateTime modifyDateTime2 = dto.getModifyDateTime2(); + List data = baseMapper.selectDocumentSummary(site, documentNoList, externalDocumentNoList, documentTypeList, stateList, createUserList, updateUserList, itemList, sourceWarehouseList, targetWarehouseList, salesBatchList, iqcResultsList, createDateTime1, createDateTime2, modifyDateTime1, modifyDateTime2); + if (CollectionUtil.isNotEmpty(data)) { + Map documentTypeFormatter = remoteDictService.getDictByType("DOCUMENT_TYPE", SecurityConstants.FROM_IN).getData().stream().collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getDescription)); + Map documentStateFormatter = remoteDictService.getDictByType("DOCUMENT_STATE", SecurityConstants.FROM_IN).getData().stream().collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getDescription)); + data.forEach(documentSummaryReportDto -> { + if (StrUtil.isNotBlank(documentSummaryReportDto.getDocumentType())) { + documentSummaryReportDto.setDocumentType(documentTypeFormatter.get(documentSummaryReportDto.getDocumentType())); + } + if (StrUtil.isNotBlank(documentSummaryReportDto.getState())) { + documentSummaryReportDto.setState(documentStateFormatter.get(documentSummaryReportDto.getState())); + } + }); + } + return data; + } + + + @Override + public IPage getAllSourceWarehouse(IPage iPage, String site, String searchText) { + return baseMapper.findAllSourceWarehouse(iPage, site, searchText); + } + + @Override + public IPage getAllTargetWarehouse(IPage iPage, String site, String searchText) { + return baseMapper.findAllTargetWarehouse(iPage, site, searchText); + } + + @Override + public IPage pageDocumentDetailed(IPage iPage, DocumentDetailReportDto dto) { + String site = TenantContextHolder.getTenantId(); + List documentNoList = splitSearchField(dto.getDocumentNo()); + List externalDocumentNoList = splitSearchField(dto.getExternalDocumentNo()); + List documentTypeList = splitSearchField(dto.getDocumentType()); + List stateList = splitSearchField(dto.getState()); + List palletList = splitSearchField(dto.getPallet()); + List inventoryIdList = splitSearchField(dto.getInventoryId()); + List salesBatchList = splitSearchField(dto.getSalesBatch()); + List itemList = splitSearchField(dto.getItem()); + List inspectionOrderNoList = splitSearchField(dto.getInspectionOrderNo()); + List qualityInspectionStatusList = splitSearchField(dto.getQualityInspectionStatus()); + List batchNumberList = splitSearchField(dto.getBatchNumber()); + List vendorBatchList = splitSearchField(dto.getVendorBatch()); + List sourceWarehouseList = splitSearchField(dto.getSourceWarehouse()); + List sourceLocationList = splitSearchField(dto.getSourceLocation()); + List storageBinList = splitSearchField(dto.getStorageBin()); + List targetWarehouseList = splitSearchField(dto.getTargetWarehouse()); + List targetLocationList = splitSearchField(dto.getTargetLocation()); + List targetBinList = splitSearchField(dto.getTargetBin()); + List createUserList = splitSearchField(dto.getCreateUser()); + LocalDateTime createDateTime1 = dto.getCreateDateTime1(); + LocalDateTime createDateTime2 = dto.getCreateDateTime2(); + LocalDateTime modifyDateTime1 = dto.getModifyDateTime1(); + LocalDateTime modifyDateTime2 = dto.getModifyDateTime2(); + List updateUserList = splitSearchField(dto.getUpdateUser()); + List iqcResultsList = splitSearchField(dto.getIqcResults()); + + return baseMapper.selectDocumentDetail(iPage,site,documentNoList,externalDocumentNoList,documentTypeList,stateList,palletList,inventoryIdList,salesBatchList,itemList,inspectionOrderNoList,qualityInspectionStatusList,batchNumberList,vendorBatchList,sourceWarehouseList,sourceLocationList,storageBinList,targetWarehouseList,targetLocationList,targetBinList,createUserList,createDateTime1,createDateTime2,updateUserList,modifyDateTime1,modifyDateTime2, iqcResultsList); + } + + @Override + public List selectDocumentDetailed(DocumentDetailReportDto dto) { + String site = TenantContextHolder.getTenantId(); + List documentNoList = splitSearchField(dto.getDocumentNo()); + List externalDocumentNoList = splitSearchField(dto.getExternalDocumentNo()); + List documentTypeList = splitSearchField(dto.getDocumentType()); + List stateList = splitSearchField(dto.getState()); + List palletList = splitSearchField(dto.getPallet()); + List inventoryIdList = splitSearchField(dto.getInventoryId()); + List salesBatchList = splitSearchField(dto.getSalesBatch()); + List itemList = splitSearchField(dto.getItem()); + List inspectionOrderNoList = splitSearchField(dto.getInspectionOrderNo()); + List qualityInspectionStatusList = splitSearchField(dto.getQualityInspectionStatus()); + List batchNumberList = splitSearchField(dto.getBatchNumber()); + List vendorBatchList = splitSearchField(dto.getVendorBatch()); + List sourceWarehouseList = splitSearchField(dto.getSourceWarehouse()); + List sourceLocationList = splitSearchField(dto.getSourceLocation()); + List storageBinList = splitSearchField(dto.getStorageBin()); + List targetWarehouseList = splitSearchField(dto.getTargetWarehouse()); + List targetLocationList = splitSearchField(dto.getTargetLocation()); + List targetBinList = splitSearchField(dto.getTargetBin()); + List createUserList = splitSearchField(dto.getCreateUser()); + LocalDateTime createDateTime1 = dto.getCreateDateTime1(); + LocalDateTime createDateTime2 = dto.getCreateDateTime2(); + LocalDateTime modifyDateTime1 = dto.getModifyDateTime1(); + LocalDateTime modifyDateTime2 = dto.getModifyDateTime2(); + List updateUserList = splitSearchField(dto.getUpdateUser()); + List iqcResultsList = splitSearchField(dto.getIqcResults()); + List data = baseMapper.selectDocumentDetail(site, documentNoList, externalDocumentNoList, documentTypeList, stateList, palletList, inventoryIdList, salesBatchList, itemList, inspectionOrderNoList, qualityInspectionStatusList, batchNumberList, vendorBatchList, sourceWarehouseList, sourceLocationList, storageBinList, targetWarehouseList, targetLocationList, targetBinList, createUserList, createDateTime1, createDateTime2, updateUserList, modifyDateTime1, modifyDateTime2, iqcResultsList); + if (CollectionUtil.isNotEmpty(data)) { + Map documentTypeFormatter = remoteDictService.getDictByType("DOCUMENT_TYPE", SecurityConstants.FROM_IN).getData().stream().collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getDescription)); + Map documentStateFormatter = remoteDictService.getDictByType("DOCUMENT_STATE", SecurityConstants.FROM_IN).getData().stream().collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getDescription)); + Map iqcFormatter = new HashMap<>(); + iqcFormatter.put("MJ","免检"); + iqcFormatter.put("BJ","报检"); + iqcFormatter.put("YJ","已检"); + data.forEach(documentDetailReportDto -> { + if (StrUtil.isNotBlank(documentDetailReportDto.getDocumentType())) { + documentDetailReportDto.setDocumentType(documentTypeFormatter.get(documentDetailReportDto.getDocumentType())); + } + if (StrUtil.isNotBlank(documentDetailReportDto.getState())) { + documentDetailReportDto.setState(documentStateFormatter.get(documentDetailReportDto.getState())); + } + if (StrUtil.isNotBlank(documentDetailReportDto.getIqcResults())) { + documentDetailReportDto.setIqcResults(iqcFormatter.get(documentDetailReportDto.getIqcResults())); + } + }); + } + return data; + } +} diff --git a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentSummaryReportServiceImpl.java b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentSummaryReportServiceImpl.java deleted file mode 100644 index e35b3a8..0000000 --- a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentSummaryReportServiceImpl.java +++ /dev/null @@ -1,891 +0,0 @@ -package com.foreverwin.mom.wms.service.impl; - - -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.foreverwin.mom.common.data.tenant.TenantContextHolder; -import com.foreverwin.mom.wms.dto.DocumentSummaryReportDto; -import com.foreverwin.mom.wms.entity.DocumentDetailed; -import com.foreverwin.mom.wms.mapper.DocumentSummaryReportMapper; -import com.foreverwin.mom.wms.service.DocumentSummaryReportService; -import lombok.AllArgsConstructor; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.List; - - -/** - * 单据汇总报表 - * - * @author xnn - * @since 2024-04-03 - */ -@Service -@AllArgsConstructor -public class DocumentSummaryReportServiceImpl extends ServiceImpl implements DocumentSummaryReportService { - private final DocumentSummaryReportMapper documentSummaryReportMapper; - - - @Override - public IPage doRetrieve(IPage iPage, DocumentSummaryReportDto documentSummaryReportDto) { - String site = TenantContextHolder.getTenantId(); - - // 单据号 - String documentNo = documentSummaryReportDto.getDocumentNo(); - List documentNoList = null; - if (StrUtil.isNotBlank(documentNo)) { - documentNoList = Arrays.asList(documentNo.split(" ")); - } - - //外部单据号 - String externalDocumentNo = documentSummaryReportDto.getExternalDocumentNo(); - List externalDocumentNoList = null; - if (StrUtil.isNotBlank(externalDocumentNo)) { - externalDocumentNoList = Arrays.asList(externalDocumentNo.split(" ")); - } - - //单据类型 - List documentTypeList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getDocumentType())) { - documentTypeList = Arrays.asList(documentSummaryReportDto.getDocumentType().split(" ")); - } - - //单据行状态 - List seqStateList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getSeqState())) { - seqStateList = Arrays.asList(documentSummaryReportDto.getSeqState().split(" ")); - } - - //创建人 - String createUser = documentSummaryReportDto.getCreateUser(); - List createUserList = null; - if (StrUtil.isNotBlank(createUser)) { - createUserList = Arrays.asList(createUser.split(" ")); - } - - //更新人 - String modifyUser = documentSummaryReportDto.getModifyUser(); - List modifyUserList = null; - if (StrUtil.isNotBlank(modifyUser)) { - modifyUserList = Arrays.asList(modifyUser.split(" ")); - } - - //物料 - String item = documentSummaryReportDto.getItem(); - List itemList = null; - if (StrUtil.isNotBlank(item)) { - itemList = Arrays.asList(item.split(" ")); - } - - //物料组 - String itemGroup = documentSummaryReportDto.getItemGroup(); - List itemGroupList = null; - if (StrUtil.isNotBlank(itemGroup)) { - itemGroupList = Arrays.asList(itemGroup.split(" ")); - } - - //来源仓 - List sourceWarehouseList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getSourceWarehouse())) { - sourceWarehouseList = Arrays.asList(documentSummaryReportDto.getSourceWarehouse().split(" ")); - } - - //目标仓 - List targetWarehouseList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getTargetWarehouse())) { - targetWarehouseList = Arrays.asList(documentSummaryReportDto.getTargetWarehouse().split(" ")); - } - - //项目编号 - String oaProjectCode = documentSummaryReportDto.getOaProjectCode(); - List oaProjectCodeList = null; - if (StrUtil.isNotBlank(oaProjectCode)) { - oaProjectCodeList = Arrays.asList(oaProjectCode.split(" ")); - } - - //出货批次 - String salesBatch = documentSummaryReportDto.getSalesBatch(); - List salesBatchList = null; - if (StrUtil.isNotBlank(salesBatch)) { - salesBatchList = Arrays.asList(salesBatch.split(" ")); - } - - //IQC - List iqcResultsList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getIqcResults())) { - iqcResultsList = Arrays.asList(documentSummaryReportDto.getIqcResults().split(" ")); - } - //OQC - List oqcResultsList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getOqcResults())) { - oqcResultsList = Arrays.asList(documentSummaryReportDto.getOqcResults().split(" ")); - } - - // 创建日期 - LocalDateTime createDateTime1 = documentSummaryReportDto.getCreateDateTime1(); - LocalDateTime createDateTime2 = documentSummaryReportDto.getCreateDateTime2(); - - //更新日期 - LocalDateTime modifyDateTime1 = documentSummaryReportDto.getModifyDateTime1(); - LocalDateTime modifyDateTime2 = documentSummaryReportDto.getModifyDateTime2(); - - return documentSummaryReportMapper.retrieve(iPage, site, documentNoList, externalDocumentNoList, documentTypeList, seqStateList, createUserList, modifyUserList, itemList, sourceWarehouseList, targetWarehouseList, oaProjectCodeList, salesBatchList, iqcResultsList, oqcResultsList, createDateTime1, createDateTime2, modifyDateTime1, modifyDateTime2, itemGroupList); - } - - //导出 - @Override - public List doSelect(DocumentSummaryReportDto documentSummaryReportDto) { - String site = TenantContextHolder.getTenantId(); - - // 单据号 - String documentNo = documentSummaryReportDto.getDocumentNo(); - List documentNoList = null; - if (StrUtil.isNotBlank(documentNo)) { - documentNoList = Arrays.asList(documentNo.split(" ")); - } - - //外部单据号 - String externalDocumentNo = documentSummaryReportDto.getExternalDocumentNo(); - List externalDocumentNoList = null; - if (StrUtil.isNotBlank(externalDocumentNo)) { - externalDocumentNoList = Arrays.asList(externalDocumentNo.split(" ")); - } - - //单据类型 - List documentTypeList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getDocumentType())) { - documentTypeList = Arrays.asList(documentSummaryReportDto.getDocumentType().split(" ")); - } - - //单据行状态 - List seqStateList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getSeqState())) { - seqStateList = Arrays.asList(documentSummaryReportDto.getSeqState().split(" ")); - } - - //创建人 - String createUser = documentSummaryReportDto.getCreateUser(); - List createUserList = null; - if (StrUtil.isNotBlank(createUser)) { - createUserList = Arrays.asList(createUser.split(" ")); - } - - //更新人 - String modifyUser = documentSummaryReportDto.getModifyUser(); - List modifyUserList = null; - if (StrUtil.isNotBlank(modifyUser)) { - modifyUserList = Arrays.asList(modifyUser.split(" ")); - } - - //物料 - String item = documentSummaryReportDto.getItem(); - List itemList = null; - if (StrUtil.isNotBlank(item)) { - itemList = Arrays.asList(item.split(" ")); - } - - //物料组 - String itemGroup = documentSummaryReportDto.getItemGroup(); - List itemGroupList = null; - if (StrUtil.isNotBlank(itemGroup)) { - itemGroupList = Arrays.asList(itemGroup.split(" ")); - } - - //来源仓 - String sourceWarehouse = documentSummaryReportDto.getSourceWarehouse(); - List sourceWarehouseList = null; - if (StrUtil.isNotBlank(sourceWarehouse)) { - sourceWarehouseList = Arrays.asList(documentSummaryReportDto.getSourceWarehouse().split(" ")); - } - - //目标仓 - String targetWarehouse = documentSummaryReportDto.getTargetWarehouse(); - List targetWarehouseList = null; - if (StrUtil.isNotBlank(targetWarehouse)) { - targetWarehouseList = Arrays.asList(documentSummaryReportDto.getTargetWarehouse().split(" ")); - } - - //项目编号 - String oaProjectCode = documentSummaryReportDto.getOaProjectCode(); - List oaProjectCodeList = null; - if (StrUtil.isNotBlank(oaProjectCode)) { - oaProjectCodeList = Arrays.asList(oaProjectCode.split(" ")); - } - - //出货批次 - String salesBatch = documentSummaryReportDto.getSalesBatch(); - List salesBatchList = null; - if (StrUtil.isNotBlank(salesBatch)) { - salesBatchList = Arrays.asList(salesBatch.split(" ")); - } - - //IQC - List iqcResultsList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getIqcResults())) { - iqcResultsList = Arrays.asList(documentSummaryReportDto.getIqcResults().split(" ")); - } - //OQC - List oqcResultsList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getOqcResults())) { - oqcResultsList = Arrays.asList(documentSummaryReportDto.getOqcResults().split(" ")); - } - - // 创建日期 - LocalDateTime createDateTime1 = documentSummaryReportDto.getCreateDateTime1(); - LocalDateTime createDateTime2 = documentSummaryReportDto.getCreateDateTime2(); - - //更新日期 - LocalDateTime modifyDateTime1 = documentSummaryReportDto.getModifyDateTime1(); - LocalDateTime modifyDateTime2 = documentSummaryReportDto.getModifyDateTime2(); - - List documentSummaryReportMappertList = documentSummaryReportMapper.retrieve(site, documentNoList, externalDocumentNoList, documentTypeList, seqStateList, createUserList, modifyUserList, itemList, sourceWarehouseList, targetWarehouseList, oaProjectCodeList, salesBatchList, iqcResultsList, oqcResultsList, createDateTime1, createDateTime2, modifyDateTime1, modifyDateTime2, itemGroupList); - for (DocumentSummaryReportDto record : documentSummaryReportMappertList) { - String seqStates = record.getSeqState(); - String stateS = record.getState(); - String documentTypes = record.getDocumentType(); - switch (stateS) { - case "SAVE": - stateS = "保存"; - break; - case "SUBMIT": - stateS = "提交"; - break; - case "CLOSE": - stateS = "关闭"; - break; - case "CANCEL": - stateS = "取消"; - break; - case "REJECT": - seqStates = "拒收"; - break; - case "POST": - stateS = "无实物过账"; - break; - case "TO_BE_AUDITING": - stateS = "待审核"; - break; - case "OA_REJECT": - stateS = "已驳回"; - break; - case "TO_BE_CONFIRMED": - stateS = "待确认"; - break; - } - switch (seqStates) { - case "SAVE": - seqStates = "保存"; - break; - case "SUBMIT": - seqStates = "提交"; - break; - case "CLOSE": - seqStates = "关闭"; - break; - case "CANCEL": - seqStates = "取消"; - break; - case "REJECT": - seqStates = "拒收"; - break; - case "POST": - seqStates = "无实物过账"; - break; - case "TO_BE_AUDITING": - seqStates = "待审核"; - break; - case "OA_REJECT": - seqStates = "已驳回"; - break; - case "TO_BE_CONFIRMED": - seqStates = "待确认"; - break; - } - switch (documentTypes) { - case "PURCHASE_RETURN": - documentTypes = "采购退货"; - break; - case "STORES_RETURNED": - documentTypes = "生产退料"; - break; - case "SALES_OUT": - documentTypes = "销售出货"; - break; - case "COST_CENTER_RECEIVE": - documentTypes = "成本中心领料"; - break; - case "COST_CENTER_RETURNED": - documentTypes = "成本中心退料"; - break; - case "PROCUREMENT_STORAGE": - documentTypes = "采购到货"; - break; - case "STORES_REQUISITION": - documentTypes = "生产领料"; - break; - case "STOR_REQUEST": - documentTypes = "入库申请单"; - break; - case "SALES_RETURN": - documentTypes = "销售退货"; - break; - case "LOCAL_TRANSFER": - documentTypes = "调拨单"; - break; - case "SCRAP_OUT": - documentTypes = "报废出库"; - break; - case "ME_RETURN_SLIP": - documentTypes = "成品生产退料"; - break; - case "OUTSOURCING": - documentTypes = "委外"; - break; - case "HIGH_VALUE": - documentTypes = "高价值入库"; - break; - case "ENGINEER_RECEIVE": - documentTypes = "在建工程领料"; - break; - case "ME_COST_CENTER_RECEIVE": - documentTypes = "线边成本中心领料"; - break; - case "ME_LOCAL_TRANSFER": - documentTypes = "线边调拨单"; - break; - case "RAW_MATERIALS_SCRAPPED": - documentTypes = "原材料报废"; - break; - case "SEMI_FINISHED_PRODUCTS_SCRAPPED": - documentTypes = "半成品报废"; - break; - } - record.setState(stateS); - record.setSeqState(seqStates); - record.setDocumentType(documentTypes); - } - return documentSummaryReportMappertList; - } - - - @Override - public IPage getAllSourceWarehouse(IPage iPage, String searchText) { - return documentSummaryReportMapper.findAllSourceWarehouse(iPage, searchText); - } - - public IPage getAllTargetWarehouse(IPage iPage, String searchText) { - return documentSummaryReportMapper.findAllTargetWarehouse(iPage, searchText); - } - - @Override - public IPage doRetrieveDocumentDetailed(IPage iPage, DocumentSummaryReportDto documentSummaryReportDto) { - String site = TenantContextHolder.getTenantId(); - - // 单据号 - String documentNo = documentSummaryReportDto.getDocumentNo(); - List documentNoList = null; - if (StrUtil.isNotBlank(documentNo)) { - documentNoList = Arrays.asList(documentNo.split(" ")); - } - - //外部单据号 - String externalDocumentNo = documentSummaryReportDto.getExternalDocumentNo(); - List externalDocumentNoList = null; - if (StrUtil.isNotBlank(externalDocumentNo)) { - externalDocumentNoList = Arrays.asList(externalDocumentNo.split(" ")); - } - - //单据类型 - List documentTypeList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getDocumentType())) { - documentTypeList = Arrays.asList(documentSummaryReportDto.getDocumentType().split(" ")); - } - - //单据行状态 - List seqStateList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getSeqState())) { - seqStateList = Arrays.asList(documentSummaryReportDto.getSeqState().split(" ")); - } - - // 托条码 - String pallet = documentSummaryReportDto.getPallet(); - List palletList = null; - if (StrUtil.isNotBlank(pallet)) { - palletList = Arrays.asList(pallet.split(" ")); - } - - // 箱条码 - String box = documentSummaryReportDto.getBox(); - List boxList = null; - if (StrUtil.isNotBlank(box)) { - boxList = Arrays.asList(box.split(" ")); - } - - // 库存条码 - String inventoryId = documentSummaryReportDto.getInventoryId(); - List inventoryIdList = null; - if (StrUtil.isNotBlank(inventoryId)) { - inventoryIdList = Arrays.asList(inventoryId.split(" ")); - } - - //项目编号 - String oaProjectCode = documentSummaryReportDto.getOaProjectCode(); - List oaProjectCodeList = null; - if (StrUtil.isNotBlank(oaProjectCode)) { - oaProjectCodeList = Arrays.asList(oaProjectCode.split(" ")); - } - - //出货批次 - String salesBatch = documentSummaryReportDto.getSalesBatch(); - List salesBatchList = null; - if (StrUtil.isNotBlank(salesBatch)) { - salesBatchList = Arrays.asList(salesBatch.split(" ")); - } - - //IQC - List iqcResultsList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getIqcResults())) { - iqcResultsList = Arrays.asList(documentSummaryReportDto.getIqcResults().split(" ")); - } - - //OQC - List oqcResultsList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getOqcResults())) { - oqcResultsList = Arrays.asList(documentSummaryReportDto.getOqcResults().split(" ")); - } - - //检验单号 - String inspectionOrderNo = documentSummaryReportDto.getInspectionOrderNo(); - List inspectionOrderNoList = null; - if (StrUtil.isNotBlank(inspectionOrderNo)) { - inspectionOrderNoList = Arrays.asList(inspectionOrderNo.split(" ")); - } - - //物料 - String item = documentSummaryReportDto.getItem(); - List itemList = null; - if (StrUtil.isNotBlank(item)) { - itemList = Arrays.asList(item.split(" ")); - } - - //物料组 - String itemGroup = documentSummaryReportDto.getItemGroup(); - List itemGroupList = null; - if (StrUtil.isNotBlank(itemGroup)) { - itemGroupList = Arrays.asList(itemGroup.split(" ")); - } - - //质量等级 - String qualityInspectionStatus = documentSummaryReportDto.getQualityInspectionStatus(); - List qualityInspectionStatusList = null; - if (StrUtil.isNotBlank(qualityInspectionStatus)) { - qualityInspectionStatusList = Arrays.asList(qualityInspectionStatus.split(" ")); - } - - //采购到货批 - String batchNumber = documentSummaryReportDto.getBatchNumber(); - List batchNumberList = null; - if (StrUtil.isNotBlank(batchNumber)) { - batchNumberList = Arrays.asList(batchNumber.split(" ")); - } - - //供应商批 - String vendorBatch = documentSummaryReportDto.getVendorBatch(); - List vendorBatchList = null; - if (StrUtil.isNotBlank(vendorBatch)) { - vendorBatchList = Arrays.asList(vendorBatch.split(" ")); - } - - //来源仓库 - List sourceWarehouseList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getSourceWarehouse())) { - sourceWarehouseList = Arrays.asList(documentSummaryReportDto.getSourceWarehouse().split(" ")); - } - - //来源区域 - String sourceLocation = documentSummaryReportDto.getSourceLocation(); - List sourceLocationList = null; - if (StrUtil.isNotBlank(sourceLocation)) { - sourceLocationList = Arrays.asList(sourceLocation.split(" ")); - } - - //来源货格 - String storageBin = documentSummaryReportDto.getStorageBin(); - List storageBinList = null; - if (StrUtil.isNotBlank(storageBin)) { - storageBinList = Arrays.asList(storageBin.split(" ")); - } - - //目标仓库 - List targetWarehouseList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getTargetWarehouse())) { - targetWarehouseList = Arrays.asList(documentSummaryReportDto.getTargetWarehouse().split(" ")); - } - - //目标区域 - String targetLocation = documentSummaryReportDto.getTargetLocation(); - List targetLocationList = null; - if (StrUtil.isNotBlank(targetLocation)) { - targetLocationList = Arrays.asList(targetLocation.split(" ")); - } - - //目标货格 - String targetBin = documentSummaryReportDto.getTargetBin(); - List targetBinList = null; - if (StrUtil.isNotBlank(targetBin)) { - targetBinList = Arrays.asList(targetBin.split(" ")); - } - - //创建人 - String createUser = documentSummaryReportDto.getCreateUser(); - List createUserList = null; - if (StrUtil.isNotBlank(createUser)) { - createUserList = Arrays.asList(createUser.split(" ")); - } - - //更新人 - String modifyUser = documentSummaryReportDto.getModifyUser(); - List modifyUserList = null; - if (StrUtil.isNotBlank(modifyUser)) { - modifyUserList = Arrays.asList(modifyUser.split(" ")); - } - - // 创建日期 - LocalDateTime createDateTime1 = documentSummaryReportDto.getCreateDateTime1(); - LocalDateTime createDateTime2 = documentSummaryReportDto.getCreateDateTime2(); - - //更新日期 - LocalDateTime modifyDateTime1 = documentSummaryReportDto.getModifyDateTime1(); - LocalDateTime modifyDateTime2 = documentSummaryReportDto.getModifyDateTime2(); - - //二次入库 - String mesInventory = documentSummaryReportDto.getMesInventory(); - - return documentSummaryReportMapper.doDocumentRetrieve(iPage, site, documentNoList, externalDocumentNoList, documentTypeList, seqStateList, palletList, boxList, inventoryIdList, oaProjectCodeList, salesBatchList, iqcResultsList, oqcResultsList, inspectionOrderNoList, itemList, qualityInspectionStatusList, batchNumberList, vendorBatchList, sourceWarehouseList, sourceLocationList, storageBinList, targetWarehouseList, targetLocationList, targetBinList, createUserList, modifyUserList, createDateTime1, createDateTime2, modifyDateTime1, modifyDateTime2, mesInventory, itemGroupList); - - } - - @Override - public List doDetailedSelect(DocumentSummaryReportDto documentSummaryReportDto) { - - String site = TenantContextHolder.getTenantId(); - - // 单据号 - String documentNo = documentSummaryReportDto.getDocumentNo(); - List documentNoList = null; - if (StrUtil.isNotBlank(documentNo)) { - documentNoList = Arrays.asList(documentNo.split(" ")); - } - - //外部单据号 - String externalDocumentNo = documentSummaryReportDto.getExternalDocumentNo(); - List externalDocumentNoList = null; - if (StrUtil.isNotBlank(externalDocumentNo)) { - externalDocumentNoList = Arrays.asList(externalDocumentNo.split(" ")); - } - - //单据类型 - List documentTypeList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getDocumentType())) { - documentTypeList = Arrays.asList(documentSummaryReportDto.getDocumentType().split(" ")); - } - - //单据行状态 - List seqStateList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getSeqState())) { - seqStateList = Arrays.asList(documentSummaryReportDto.getSeqState().split(" ")); - } - - // 托条码 - String pallet = documentSummaryReportDto.getPallet(); - List palletList = null; - if (StrUtil.isNotBlank(pallet)) { - palletList = Arrays.asList(pallet.split(" ")); - } - - // 箱条码 - String box = documentSummaryReportDto.getBox(); - List boxList = null; - if (StrUtil.isNotBlank(box)) { - boxList = Arrays.asList(box.split(" ")); - } - - // 库存条码 - String inventoryId = documentSummaryReportDto.getInventoryId(); - List inventoryIdList = null; - if (StrUtil.isNotBlank(inventoryId)) { - inventoryIdList = Arrays.asList(inventoryId.split(" ")); - } - - //项目编号 - String oaProjectCode = documentSummaryReportDto.getOaProjectCode(); - List oaProjectCodeList = null; - if (StrUtil.isNotBlank(oaProjectCode)) { - oaProjectCodeList = Arrays.asList(oaProjectCode.split(" ")); - } - - //出货批次 - String salesBatch = documentSummaryReportDto.getSalesBatch(); - List salesBatchList = null; - if (StrUtil.isNotBlank(salesBatch)) { - salesBatchList = Arrays.asList(salesBatch.split(" ")); - } - - //IQC - List iqcResultsList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getIqcResults())) { - iqcResultsList = Arrays.asList(documentSummaryReportDto.getIqcResults().split(" ")); - } - //OQC - List oqcResultsList = null; - if (StrUtil.isNotBlank(documentSummaryReportDto.getOqcResults())) { - oqcResultsList = Arrays.asList(documentSummaryReportDto.getOqcResults().split(" ")); - } - //检验单号 - String inspectionOrderNo = documentSummaryReportDto.getInspectionOrderNo(); - List inspectionOrderNoList = null; - if (StrUtil.isNotBlank(inspectionOrderNo)) { - inspectionOrderNoList = Arrays.asList(inspectionOrderNo.split(" ")); - } - - //物料 - String item = documentSummaryReportDto.getItem(); - List itemList = null; - if (StrUtil.isNotBlank(item)) { - itemList = Arrays.asList(item.split(" ")); - } - - //物料组 - String itemGroup = documentSummaryReportDto.getItemGroup(); - List itemGroupList = null; - if (StrUtil.isNotBlank(itemGroup)) { - itemGroupList = Arrays.asList(itemGroup.split(" ")); - } - - //质量等级 - String qualityInspectionStatus = documentSummaryReportDto.getQualityInspectionStatus(); - List qualityInspectionStatusList = null; - if (StrUtil.isNotBlank(qualityInspectionStatus)) { - qualityInspectionStatusList = Arrays.asList(qualityInspectionStatus.split(" ")); - } - - //采购到货批 - String batchNumber = documentSummaryReportDto.getBatchNumber(); - List batchNumberList = null; - if (StrUtil.isNotBlank(batchNumber)) { - batchNumberList = Arrays.asList(batchNumber.split(" ")); - } - - //供应商批 - String vendorBatch = documentSummaryReportDto.getVendorBatch(); - List vendorBatchList = null; - if (StrUtil.isNotBlank(vendorBatch)) { - vendorBatchList = Arrays.asList(vendorBatch.split(" ")); - } - - //来源仓库 - String sourceWarehouse = documentSummaryReportDto.getSourceWarehouse(); - List sourceWarehouseList = null; - if (StrUtil.isNotBlank(sourceWarehouse)) { - sourceWarehouseList = Arrays.asList(sourceWarehouse.split(" ")); - } - - //来源区域 - String sourceLocation = documentSummaryReportDto.getSourceLocation(); - List sourceLocationList = null; - if (StrUtil.isNotBlank(sourceLocation)) { - sourceLocationList = Arrays.asList(sourceLocation.split(" ")); - } - - //来源货格 - String storageBin = documentSummaryReportDto.getStorageBin(); - List storageBinList = null; - if (StrUtil.isNotBlank(storageBin)) { - storageBinList = Arrays.asList(storageBin.split(" ")); - } - - //目标仓库 - String targetWarehouse = documentSummaryReportDto.getTargetWarehouse(); - List targetWarehouseList = null; - if (StrUtil.isNotBlank(targetWarehouse)) { - targetWarehouseList = Arrays.asList(targetWarehouse.split(" ")); - } - - //目标区域 - String targetLocation = documentSummaryReportDto.getTargetLocation(); - List targetLocationList = null; - if (StrUtil.isNotBlank(targetLocation)) { - targetLocationList = Arrays.asList(targetLocation.split(" ")); - } - - //目标货格 - String targetBin = documentSummaryReportDto.getTargetBin(); - List targetBinList = null; - if (StrUtil.isNotBlank(targetBin)) { - targetBinList = Arrays.asList(targetBin.split(" ")); - } - - //创建人 - String createUser = documentSummaryReportDto.getCreateUser(); - List createUserList = null; - if (StrUtil.isNotBlank(createUser)) { - createUserList = Arrays.asList(createUser.split(" ")); - } - - //更新人 - String modifyUser = documentSummaryReportDto.getModifyUser(); - List modifyUserList = null; - if (StrUtil.isNotBlank(modifyUser)) { - modifyUserList = Arrays.asList(modifyUser.split(" ")); - } - - // 创建日期 - LocalDateTime createDateTime1 = documentSummaryReportDto.getCreateDateTime1(); - LocalDateTime createDateTime2 = documentSummaryReportDto.getCreateDateTime2(); - - //更新日期 - LocalDateTime modifyDateTime1 = documentSummaryReportDto.getModifyDateTime1(); - LocalDateTime modifyDateTime2 = documentSummaryReportDto.getModifyDateTime2(); - - //二次入库 - String mesInventory = documentSummaryReportDto.getMesInventory(); - - List documentDetailedReportMapperList = documentSummaryReportMapper.doDocumentRetrieve(site, documentNoList, externalDocumentNoList, documentTypeList, seqStateList, palletList, boxList, inventoryIdList, oaProjectCodeList, salesBatchList, iqcResultsList, oqcResultsList, inspectionOrderNoList, itemList, qualityInspectionStatusList, batchNumberList, vendorBatchList, sourceWarehouseList, sourceLocationList, storageBinList, targetWarehouseList, targetLocationList, targetBinList, createUserList, modifyUserList, createDateTime1, createDateTime2, modifyDateTime1, modifyDateTime2, mesInventory, itemGroupList); - for (DocumentSummaryReportDto record : documentDetailedReportMapperList) { - String seqStates = record.getSeqState(); - String stateS = record.getState(); - String documentTypes = record.getDocumentType(); - if (StrUtil.isNotBlank(stateS)) { - switch (stateS) { - case "SAVE": - stateS = "保存"; - break; - case "SUBMIT": - stateS = "提交"; - break; - case "CLOSE": - stateS = "关闭"; - break; - case "CANCEL": - stateS = "取消"; - break; - case "REJECT": - stateS = "拒收"; - break; - case "POST": - stateS = "无实物过账"; - break; - case "TO_BE_AUDITING": - stateS = "待审核"; - break; - case "OA_REJECT": - stateS = "已驳回"; - break; - case "TO_BE_CONFIRMED": - stateS = "待确认"; - break; - } - record.setState(stateS); - } - if (StrUtil.isNotBlank(seqStates)) { - switch (seqStates) { - case "SAVE": - seqStates = "保存"; - break; - case "SUBMIT": - seqStates = "提交"; - break; - case "CLOSE": - seqStates = "关闭"; - break; - case "CANCEL": - seqStates = "取消"; - break; - case "REJECT": - seqStates = "拒收"; - break; - case "POST": - seqStates = "无实物过账"; - break; - case "TO_BE_AUDITING": - seqStates = "待审核"; - break; - case "OA_REJECT": - seqStates = "已驳回"; - break; - case "TO_BE_CONFIRMED": - seqStates = "待确认"; - break; - } - record.setSeqState(seqStates); - } - - if (StrUtil.isNotBlank(documentTypes)) { - switch (documentTypes) { - case "PURCHASE_RETURN": - documentTypes = "采购退货"; - break; - case "STORES_RETURNED": - documentTypes = "生产退料"; - break; - case "SALES_OUT": - documentTypes = "销售出货"; - break; - case "COST_CENTER_RECEIVE": - documentTypes = "成本中心领料"; - break; - case "COST_CENTER_RETURNED": - documentTypes = "成本中心退料"; - break; - case "PROCUREMENT_STORAGE": - documentTypes = "采购到货"; - break; - case "STORES_REQUISITION": - documentTypes = "生产领料"; - break; - case "STOR_REQUEST": - documentTypes = "入库申请单"; - break; - case "SALES_RETURN": - documentTypes = "销售退货"; - break; - case "LOCAL_TRANSFER": - documentTypes = "调拨单"; - break; - case "SCRAP_OUT": - documentTypes = "报废出库"; - break; - case "ME_RETURN_SLIP": - documentTypes = "成品生产退料"; - break; - case "OUTSOURCING": - documentTypes = "委外"; - break; - case "HIGH_VALUE": - documentTypes = "高价值入库"; - break; - case "ENGINEER_RECEIVE": - documentTypes = "在建工程领料"; - break; - case "ME_COST_CENTER_RECEIVE": - documentTypes = "线边成本中心领料"; - break; - case "ME_LOCAL_TRANSFER": - documentTypes = "线边调拨单"; - break; - case "RAW_MATERIALS_SCRAPPED": - documentTypes = "原材料报废"; - break; - case "SEMI_FINISHED_PRODUCTS_SCRAPPED": - documentTypes = "半成品报废"; - break; - } - record.setDocumentType(documentTypes); - } - } - return documentDetailedReportMapperList; - } -} diff --git a/mom-wms-db/src/main/java/com/foreverwin/mom/wms/mapper/DocumentReportMapper.java b/mom-wms-db/src/main/java/com/foreverwin/mom/wms/mapper/DocumentReportMapper.java new file mode 100644 index 0000000..1ec0fb8 --- /dev/null +++ b/mom-wms-db/src/main/java/com/foreverwin/mom/wms/mapper/DocumentReportMapper.java @@ -0,0 +1,86 @@ +package com.foreverwin.mom.wms.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mom.wms.dto.DocumentDetailReportDto; +import com.foreverwin.mom.wms.dto.DocumentSummaryReportDto; +import com.foreverwin.mom.wms.entity.DocumentDetailed; +import com.foreverwin.mom.wms.entity.WareHouse; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 单据汇总报表 + * + * @author xnn + * @since 2024-04-03 + */ +@Mapper +public interface DocumentReportMapper extends BaseMapper { + IPage selectDocumentSummary(IPage iPage, @Param("site") String site, @Param("documentNoList") List documentNoList, @Param("externalDocumentNoList") List externalDocumentNoList, @Param("documentTypeList") List documentTypeList, @Param("stateList") List stateList, @Param("createUserList") List createUserList, @Param("updateUserList") List updateUserList, @Param("itemList") List itemList, @Param("sourceWarehouseList") List sourceWarehouseList, @Param("targetWarehouseList") List targetWarehouseList, @Param("salesBatchList") List salesBatchList, @Param("iqcResultsList") List iqcResultsList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime3, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2); + + List selectDocumentSummary(@Param("site") String site, @Param("documentNoList") List documentNoList, @Param("externalDocumentNoList") List externalDocumentNoList, @Param("documentTypeList") List documentTypeList, @Param("stateList") List stateList, @Param("createUserList") List createUserList, @Param("updateUserList") List updateUserList, @Param("itemList") List itemList, @Param("sourceWarehouseList") List sourceWarehouseList, @Param("targetWarehouseList") List targetWarehouseList, @Param("salesBatchList") List salesBatchList, @Param("iqcResultsList") List iqcResultsList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime3, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2); + + IPage findAllSourceWarehouse(IPage iPage, @Param("site") String site, @Param("searchText") String searchText); + + IPage findAllTargetWarehouse(IPage iPage, @Param("site") String site, @Param("searchText") String searchText); + + IPage selectDocumentDetail(IPage iPage + , @Param("site") String site + , @Param("documentNoList") List documentNoList + , @Param("externalDocumentNoList") List externalDocumentNoList + , @Param("documentTypeList") List documentTypeList + , @Param("stateList") List stateList + , @Param("palletList") List palletList + , @Param("inventoryIdList") List inventoryIdList + , @Param("salesBatchList") List salesBatchList + , @Param("itemList") List itemList + , @Param("inspectionOrderNoList") List inspectionOrderNoList + , @Param("qualityInspectionStatusList") List qualityInspectionStatusList + , @Param("batchNumberList") List batchNumberList + , @Param("vendorBatchList") List vendorBatchList + , @Param("sourceWarehouseList") List sourceWarehouseList + , @Param("sourceLocationList") List sourceLocationList + , @Param("storageBinList") List storageBinList + , @Param("targetWarehouseList") List targetWarehouseList + , @Param("targetLocationList") List targetLocationList + , @Param("targetBinList") List targetBinList + , @Param("createUserList") List createUserList + , @Param("createDateTimeFrom") LocalDateTime createDateTimeFrom + , @Param("createDateTimeTo") LocalDateTime createDateTimeTo + , @Param("updateUserList") List updateUserList + , @Param("modifyDateTimeFrom") LocalDateTime modifyDateTimeFrom + , @Param("modifyDateTimeTo") LocalDateTime modifyDateTimeTo + , @Param("iqcResultsList") List iqcResultsList); + + List selectDocumentDetail( + @Param("site") String site + , @Param("documentNoList") List documentNoList + , @Param("externalDocumentNoList") List externalDocumentNoList + , @Param("documentTypeList") List documentTypeList + , @Param("stateList") List stateList + , @Param("palletList") List palletList + , @Param("inventoryIdList") List inventoryIdList + , @Param("salesBatchList") List salesBatchList + , @Param("itemList") List itemList + , @Param("inspectionOrderNoList") List inspectionOrderNoList + , @Param("qualityInspectionStatusList") List qualityInspectionStatusList + , @Param("batchNumberList") List batchNumberList + , @Param("vendorBatchList") List vendorBatchList + , @Param("sourceWarehouseList") List sourceWarehouseList + , @Param("sourceLocationList") List sourceLocationList + , @Param("storageBinList") List storageBinList + , @Param("targetWarehouseList") List targetWarehouseList + , @Param("targetLocationList") List targetLocationList + , @Param("targetBinList") List targetBinList + , @Param("createUserList") List createUserList + , @Param("createDateTimeFrom") LocalDateTime createDateTimeFrom + , @Param("createDateTimeTo") LocalDateTime createDateTimeTo + , @Param("updateUserList") List updateUserList + , @Param("modifyDateTimeFrom") LocalDateTime modifyDateTimeFrom + , @Param("modifyDateTimeTo") LocalDateTime modifyDateTimeTo + , @Param("iqcResultsList") List iqcResultsList); +} diff --git a/mom-wms-db/src/main/java/com/foreverwin/mom/wms/mapper/DocumentSummaryReportMapper.java b/mom-wms-db/src/main/java/com/foreverwin/mom/wms/mapper/DocumentSummaryReportMapper.java deleted file mode 100644 index ed9377c..0000000 --- a/mom-wms-db/src/main/java/com/foreverwin/mom/wms/mapper/DocumentSummaryReportMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.foreverwin.mom.wms.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.foreverwin.mom.wms.dto.DocumentSummaryReportDto; -import com.foreverwin.mom.wms.entity.DocumentDetailed; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * 单据汇总报表 - * - * @author xnn - * @since 2024-04-03 - */ -@Mapper -public interface DocumentSummaryReportMapper extends BaseMapper { - IPage retrieve(IPage iPage, @Param("site") String site, @Param("documentNoList") List documentNoList, @Param("externalDocumentNoList") List externalDocumentNoList, @Param("documentTypeList") List documentTypeList, @Param("seqStateList") List seqStateList, @Param("createUserList") List createUserList, @Param("modifyUserList") List modifyUserList, @Param("itemList") List itemList, @Param("sourceWarehouseList") List sourceWarehouseList, @Param("targetWarehouseList") List targetWarehouseList, @Param("oaProjectCodeList") List oaProjectCodeList, @Param("salesBatchList") List salesBatchList, @Param("iqcResultsList") List iqcResultsList, @Param("oqcResultsList") List oqcResultsList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime3, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2, @Param("itemGroupList") List itemGroupList); - - List retrieve(@Param("site") String site, @Param("documentNoList") List documentNoList, @Param("externalDocumentNoList") List externalDocumentNoList, @Param("documentTypeList") List documentTypeList, @Param("seqStateList") List seqStateList, @Param("createUserList") List createUserList, @Param("modifyUserList") List modifyUserList, @Param("itemList") List itemList, @Param("sourceWarehouseList") List sourceWarehouseList, @Param("targetWarehouseList") List targetWarehouseList, @Param("oaProjectCodeList") List oaProjectCodeList, @Param("salesBatchList") List salesBatchList, @Param("iqcResultsList") List iqcResultsList, @Param("oqcResultsList") List oqcResultsList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime2, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2, @Param("itemGroupList") List itemGroupList); - - IPage findAllSourceWarehouse(IPage iPage, @Param("searchText") String searchText); - - IPage findAllTargetWarehouse(IPage iPage, @Param("searchText") String searchText); - - IPage doDocumentRetrieve(IPage iPage, @Param("site") String site, @Param("documentNoList") List documentNoList, @Param("externalDocumentNoList") List externalDocumentNoList, @Param("documentTypeList") List documentTypeList, @Param("seqStateList") List seqStateList, @Param("palletList") List palletList, @Param("boxList") List boxList, @Param("inventoryIdList") List inventoryIdList, @Param("oaProjectCodeList") List oaProjectCodeList, @Param("salesBatchList") List salesBatchList, @Param("iqcResultsList") List iqcResultsList, @Param("oqcResultsList") List oqcResultsList, @Param("inspectionOrderNoList") List inspectionOrderNoList, @Param("itemList") List itemList, @Param("qualityInspectionStatusList") List qualityInspectionStatusList, @Param("batchNumberList") List batchNumberList, @Param("vendorBatchList") List vendorBatchList, @Param("sourceWarehouseList") List sourceWarehouseList, @Param("sourceLocationList") List sourceLocationList, @Param("storageBinList") List storageBinList, @Param("targetWarehouseList") List targetWarehouseList, @Param("targetLocationList") List targetLocationList, @Param("targetBinList") List targetBinList, @Param("createUserList") List createUserList, @Param("modifyUserList") List modifyUserList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime2, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2, @Param("mesInventory") String mesInventory, @Param("itemGroupList") List itemGroupList); - - List doDocumentRetrieve(@Param("site") String site, @Param("documentNoList") List documentNoList, @Param("externalDocumentNoList") List externalDocumentNoList, @Param("documentTypeList") List documentTypeList, @Param("seqStateList") List seqStateList, @Param("palletList") List palletList, @Param("boxList") List boxList, @Param("inventoryIdList") List inventoryIdList, @Param("oaProjectCodeList") List oaProjectCodeList, @Param("salesBatchList") List salesBatchList, @Param("iqcResultsList") List iqcResultsList, @Param("oqcResultsList") List oqcResultsList, @Param("inspectionOrderNoList") List inspectionOrderNoList, @Param("itemList") List itemList, @Param("qualityInspectionStatusList") List qualityInspectionStatusList, @Param("batchNumberList") List batchNumberList, @Param("vendorBatchList") List vendorBatchList, @Param("sourceWarehouseList") List sourceWarehouseList, @Param("sourceLocationList") List sourceLocationList, @Param("storageBinList") List storageBinList, @Param("targetWarehouseList") List targetWarehouseList, @Param("targetLocationList") List targetLocationList, @Param("targetBinList") List targetBinList, @Param("createUserList") List createUserList, @Param("modifyUserList") List modifyUserList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime2, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2, @Param("mesInventory") String mesInventory, @Param("itemGroupList") List itemGroupList); - -} diff --git a/mom-wms-db/src/main/resources/mapper/DocumentReportMapper.xml b/mom-wms-db/src/main/resources/mapper/DocumentReportMapper.xml new file mode 100644 index 0000000..1ba2b6a --- /dev/null +++ b/mom-wms-db/src/main/resources/mapper/DocumentReportMapper.xml @@ -0,0 +1,422 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mom-wms-db/src/main/resources/mapper/DocumentSummaryReportMapper.xml b/mom-wms-db/src/main/resources/mapper/DocumentSummaryReportMapper.xml deleted file mode 100644 index 69ca661..0000000 --- a/mom-wms-db/src/main/resources/mapper/DocumentSummaryReportMapper.xml +++ /dev/null @@ -1,469 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -