Merge branch 'dev' of http://10.10.11.66:3000/mes/mom-wms into dev
This commit is contained in:
commit
0cf0b30873
@ -67,7 +67,16 @@ public interface RemoteWmsInventoryService {
|
||||
*/
|
||||
@PostMapping("/wms-inventory/api/lotSplitAddAndUpdateInventory")
|
||||
R lotSplitAddAndUpdateInventory(@RequestBody InventoryDto dto);
|
||||
|
||||
|
||||
/**
|
||||
* 通过批次号获取库存
|
||||
* @param site
|
||||
* @param batchNo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/wms-inventory/api/readInventoryByBatchNo/{site}/{batchNo}")
|
||||
R<List<Inventory>> readInventoryByBatchNo(@PathVariable("site") String site,@PathVariable("batchNo") String batchNo);
|
||||
|
||||
/**
|
||||
* 创建或更新库存,并记录日志
|
||||
* @param inventoryList
|
||||
|
||||
@ -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;
|
||||
|
||||
}
|
||||
@ -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<String> 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;
|
||||
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class WipShopOrderDto {
|
||||
private String site;
|
||||
private String shopOrderBo;
|
||||
private String shopOrder;
|
||||
private String salesOrder;
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
package com.foreverwin.mom.wms.dto;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 盘点差异
|
||||
*/
|
||||
@Data
|
||||
public class ZCheckNoDto {
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ExcelProperty(value="工厂")
|
||||
private String site;
|
||||
|
||||
/**
|
||||
* 盘点单号
|
||||
*/
|
||||
@ExcelProperty(value="盘点单号")
|
||||
private String checkNo;
|
||||
|
||||
/**
|
||||
* 库存标识
|
||||
*/
|
||||
@ExcelProperty(value="库存标识")
|
||||
private String inventoryId;
|
||||
/**
|
||||
* 物料
|
||||
*/
|
||||
@ExcelProperty(value="物料")
|
||||
private String item;
|
||||
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
@ExcelProperty(value="物料描述")
|
||||
private String itemDescription;
|
||||
|
||||
/**
|
||||
* 实盘货格
|
||||
*/
|
||||
@ExcelProperty(value="快照货格")
|
||||
private String wmsStorageBinSnapShot;
|
||||
|
||||
/**
|
||||
* 实盘数量
|
||||
*/
|
||||
@ExcelProperty(value="快照数量")
|
||||
private BigDecimal qtyOnHandSnapShot;
|
||||
|
||||
/**
|
||||
* 实盘货格
|
||||
*/
|
||||
@ExcelProperty(value="实盘货格")
|
||||
private String wmsStorageBinActual;
|
||||
|
||||
/**
|
||||
* 实盘数量
|
||||
*/
|
||||
@ExcelProperty(value="实盘数量")
|
||||
private BigDecimal qtyOnHandActual;
|
||||
|
||||
/**
|
||||
* 实盘数量
|
||||
*/
|
||||
@ExcelProperty(value="差异类型")
|
||||
private String differenceType;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -118,4 +118,11 @@ public class ZWmsInventoryCheck extends Model<ZWmsInventoryCheck> {
|
||||
@TableField(exist = false)
|
||||
private String itemDescription;
|
||||
|
||||
/**
|
||||
* 盘点差异
|
||||
*/
|
||||
@ApiModelProperty(value="盘点差异")
|
||||
@TableField(exist = false)
|
||||
private String differenceType;
|
||||
|
||||
}
|
||||
|
||||
@ -1138,6 +1138,7 @@ public class DocumentController {
|
||||
@ApiOperation(value = "分页查询订单信息", notes = "分页查询订单信息")
|
||||
@GetMapping("/selectShopOrderInfo/page")
|
||||
public R selectShopOrderInfo(FrontPage page, WipShopOrderDto wipShopOrderDto) {
|
||||
wipShopOrderDto.setSite(TenantContextHolder.getTenantId());
|
||||
return R.ok(documentMapper.selectShopOrderInfo(page, wipShopOrderDto));
|
||||
}
|
||||
|
||||
|
||||
@ -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<DocumentSummaryReportDto> 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<DocumentDetailReportDto> 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<WareHouse> frontPage) {
|
||||
return R.ok(documentReportService.getAllSourceWarehouse(frontPage, TenantContextHolder.getTenantId(), frontPage.getSearchText()));
|
||||
}
|
||||
|
||||
//获取目标仓数据
|
||||
@ResponseBody
|
||||
@GetMapping("/targetWarehouse/page")
|
||||
public R pages(FrontPage<WareHouse> frontPage) {
|
||||
return R.ok(documentReportService.getAllTargetWarehouse(frontPage, TenantContextHolder.getTenantId(), frontPage.getSearchText()));
|
||||
}
|
||||
|
||||
}
|
||||
@ -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<DocumentSummaryReportDto> page, @RequestBody DocumentSummaryReportDto documentSummaryReportDto) {
|
||||
return R.ok(documentSummaryReportService.doRetrieve(page,documentSummaryReportDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping("/tablePageExport")
|
||||
public void tablePageExport(@RequestBody DocumentSummaryReportDto documentSummaryReportDto) throws Exception{
|
||||
List<DocumentSummaryReportDto> 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<DocumentSummaryReportDto> frontPage, String searchText) {
|
||||
IPage<DocumentSummaryReportDto> sourceWarehouseIPage = documentSummaryReportService.getAllSourceWarehouse(frontPage, searchText);
|
||||
return R.ok(sourceWarehouseIPage);
|
||||
}
|
||||
//获取目标仓数据
|
||||
@ResponseBody
|
||||
@GetMapping("/targetWarehouse/page")
|
||||
public R pages(Page<DocumentSummaryReportDto> frontPage, String searchText) {
|
||||
IPage<DocumentSummaryReportDto> targetWarehouseIPage = documentSummaryReportService.getAllTargetWarehouse(frontPage, searchText);
|
||||
return R.ok(targetWarehouseIPage);
|
||||
}
|
||||
//单据明细报表
|
||||
@ResponseBody
|
||||
@PostMapping("/selectDocumentDetailedPage")
|
||||
public R retrieveDocumentDetailed(FrontPage<DocumentSummaryReportDto> 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<DocumentSummaryReportDto> 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);
|
||||
}
|
||||
}
|
||||
@ -1,21 +1,37 @@
|
||||
package com.foreverwin.mom.wms.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
import com.foreverwin.mom.wms.dto.CheckNoSummaryDto;
|
||||
import com.foreverwin.mom.wms.dto.ZCheckNoDto;
|
||||
import com.foreverwin.mom.wms.entity.ZWmsInventoryCheck;
|
||||
import com.foreverwin.mom.wms.entity.ZWmsInventoryCheckSnapshot;
|
||||
import com.foreverwin.mom.wms.service.ZWmsInventoryCheckService;
|
||||
import com.foreverwin.mom.common.excel.annotation.ResponseExcel;
|
||||
import com.foreverwin.mom.wms.service.ZWmsInventoryCheckSnapshotService;
|
||||
import com.foreverwin.mom.wms.util.ExcelCellWidthStyleStrategy;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 盘点单表
|
||||
@ -30,6 +46,7 @@ import java.util.List;
|
||||
public class ZWmsInventoryCheckController {
|
||||
|
||||
private final ZWmsInventoryCheckService zWmsInventoryCheckService;
|
||||
private final ZWmsInventoryCheckSnapshotService zWmsInventoryCheckSnapshotService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@ -116,4 +133,43 @@ public class ZWmsInventoryCheckController {
|
||||
public List<ZWmsInventoryCheck> export(ZWmsInventoryCheck zWmsInventoryCheck) {
|
||||
return zWmsInventoryCheckService.list(Wrappers.query(zWmsInventoryCheck));
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@GetMapping("/checkNoExport")
|
||||
public void checkNoExport(ZWmsInventoryCheck zWmsInventoryCheck) throws Exception {
|
||||
String checkNo = zWmsInventoryCheck.getCheckNo();
|
||||
String storageLocation = zWmsInventoryCheck.getStorageLocation();
|
||||
String item = zWmsInventoryCheck.getItem();
|
||||
String differenceType = zWmsInventoryCheck.getDifferenceType();
|
||||
ZWmsInventoryCheckSnapshot zWmsInventoryCheckSnapshot = new ZWmsInventoryCheckSnapshot();
|
||||
zWmsInventoryCheckSnapshot.setCheckNo(checkNo);
|
||||
List<ZWmsInventoryCheckSnapshot> zWmsInventoryCheckSnapshotList = zWmsInventoryCheckSnapshotService.getzWmsInventoryCheckSnapshots(zWmsInventoryCheckSnapshot);
|
||||
// 根据storageLocation、item、differenceType这几个值是否有值,有值则进行过滤,无值则不过滤
|
||||
if (storageLocation != null && !storageLocation.isEmpty()) {
|
||||
zWmsInventoryCheckSnapshotList = zWmsInventoryCheckSnapshotList.stream().filter(item1 -> storageLocation.equals(item1.getErpStorageLocation())).collect(Collectors.toList());
|
||||
}
|
||||
if (item != null && !item.isEmpty()) {
|
||||
zWmsInventoryCheckSnapshotList = zWmsInventoryCheckSnapshotList.stream().filter(item1 -> item.equals(item1.getItem())).collect(Collectors.toList());
|
||||
}
|
||||
if (differenceType != null && !differenceType.isEmpty()) {
|
||||
zWmsInventoryCheckSnapshotList = zWmsInventoryCheckSnapshotList.stream().filter(item1 -> differenceType.equals(item1.getDifferenceType())).collect(Collectors.toList());
|
||||
}
|
||||
String fileName = "盘点差异";
|
||||
String encodedFileName = URLEncoder.encode(fileName, "UTF-8");
|
||||
List<ZCheckNoDto> zCheckNoDtos = zWmsInventoryCheckSnapshotList.stream().map(zWmsInventoryCheckSnapshot1 -> {
|
||||
ZCheckNoDto zCheckNoDto = new ZCheckNoDto();
|
||||
BeanUtil.copyProperties(zWmsInventoryCheckSnapshot1, zCheckNoDto);
|
||||
return zCheckNoDto;
|
||||
}).collect(Collectors.toList());
|
||||
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''" + encodedFileName + ".xlsx");
|
||||
// 这里需要设置不关闭流
|
||||
EasyExcel.write(response.getOutputStream(), ZCheckNoDto.class).autoCloseStream(Boolean.FALSE).sheet(fileName).doWrite(zCheckNoDtos);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package com.foreverwin.mom.wms.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.foreverwin.iep.common.base.FrontPage;
|
||||
import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
@ -524,5 +524,12 @@ public class ZWmsInventoryController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过批次号获取库存", notes = "通过批次号获取库存")
|
||||
@SysLog("通过批次号获取库存")
|
||||
@GetMapping("/api/readInventoryByBatchNo/{site}/{batchNo}")
|
||||
public R<List<Inventory>> readInventoryByBatchNo(@PathVariable("site") String site, @PathVariable("batchNo") String batchNo) {
|
||||
return R.ok(inventoryService.list(Wrappers.<Inventory>lambdaQuery().eq(Inventory::getSite, site).eq(Inventory::getBatchNo,batchNo)));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@ -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<DocumentDetailed> {
|
||||
|
||||
//单据汇总查询
|
||||
IPage<DocumentSummaryReportDto> pageDocumentSummary(IPage iPage, DocumentSummaryReportDto documentSummaryReportDto);
|
||||
|
||||
//导出
|
||||
List<DocumentSummaryReportDto> selectDocumentSummary(DocumentSummaryReportDto documentSummaryReportDto);
|
||||
|
||||
//单据明细查询
|
||||
IPage<DocumentDetailReportDto> pageDocumentDetailed(IPage iPage, DocumentDetailReportDto documentDetailReportDto);
|
||||
|
||||
//单据明细表导出
|
||||
List<DocumentDetailReportDto> selectDocumentDetailed(DocumentDetailReportDto documentDetailReportDto);
|
||||
|
||||
//获取来源仓
|
||||
IPage<WareHouse> getAllSourceWarehouse(IPage<WareHouse> iPage, String site, String searchText);
|
||||
|
||||
//获取目标仓
|
||||
IPage<WareHouse> getAllTargetWarehouse(IPage<WareHouse> iPage, String site, String searchText);
|
||||
|
||||
}
|
||||
@ -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<DocumentDetailed> {
|
||||
|
||||
//单据汇总查询
|
||||
IPage<DocumentSummaryReportDto> doRetrieve(IPage<DocumentSummaryReportDto> iPage, DocumentSummaryReportDto documentSummaryReportDto);
|
||||
|
||||
//导出
|
||||
List<DocumentSummaryReportDto> doSelect(DocumentSummaryReportDto documentSummaryReportDto);
|
||||
//获取来源仓
|
||||
IPage<DocumentSummaryReportDto> getAllSourceWarehouse(IPage<DocumentSummaryReportDto> iPage,String searchText);
|
||||
//获取目标仓
|
||||
IPage<DocumentSummaryReportDto> getAllTargetWarehouse(IPage<DocumentSummaryReportDto> iPage,String searchText);
|
||||
//单据明细查询
|
||||
IPage<DocumentSummaryReportDto> doRetrieveDocumentDetailed(IPage<DocumentSummaryReportDto> iPage, DocumentSummaryReportDto documentSummaryReportDto);
|
||||
//单据明细表导出
|
||||
List<DocumentSummaryReportDto> doDetailedSelect(DocumentSummaryReportDto documentSummaryReportDto);
|
||||
}
|
||||
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.mom.wms.entity.ZWmsInventoryCheckSnapshot;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 盘点库存快照表
|
||||
*
|
||||
@ -11,6 +13,8 @@ import com.foreverwin.mom.wms.entity.ZWmsInventoryCheckSnapshot;
|
||||
* @date 2024-11-25 11:22:08
|
||||
*/
|
||||
public interface ZWmsInventoryCheckSnapshotService extends IService<ZWmsInventoryCheckSnapshot> {
|
||||
List<ZWmsInventoryCheckSnapshot> getzWmsInventoryCheckSnapshots(
|
||||
ZWmsInventoryCheckSnapshot zWmsInventoryCheckSnapshot);
|
||||
|
||||
Page<ZWmsInventoryCheckSnapshot> selectSnapshotInfoDifference(Page<ZWmsInventoryCheckSnapshot> page, ZWmsInventoryCheckSnapshot zWmsInventoryCheckSnapshot);
|
||||
}
|
||||
|
||||
@ -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<DocumentReportMapper, DocumentDetailed> implements DocumentReportService {
|
||||
|
||||
private final RemoteDictService remoteDictService;
|
||||
|
||||
private List<String> splitSearchField(String field) {
|
||||
return StrUtil.isNotBlank(field) ? Arrays.asList(field.split(" ")) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<DocumentSummaryReportDto> pageDocumentSummary(IPage iPage, DocumentSummaryReportDto dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
List<String> documentNoList = splitSearchField(dto.getDocumentNo());
|
||||
List<String> externalDocumentNoList = splitSearchField(dto.getExternalDocumentNo());
|
||||
List<String> documentTypeList = splitSearchField(dto.getDocumentType());
|
||||
List<String> stateList = splitSearchField(dto.getState());
|
||||
List<String> createUserList = splitSearchField(dto.getCreateUser());
|
||||
List<String> updateUserList = splitSearchField(dto.getUpdateUser());
|
||||
List<String> itemList = splitSearchField(dto.getItem());
|
||||
List<String> sourceWarehouseList = splitSearchField(dto.getSourceWarehouse());
|
||||
List<String> targetWarehouseList = splitSearchField(dto.getTargetWarehouse());
|
||||
List<String> salesBatchList = splitSearchField(dto.getSalesBatch());
|
||||
List<String> 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<DocumentSummaryReportDto> selectDocumentSummary(DocumentSummaryReportDto dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
List<String> documentNoList = splitSearchField(dto.getDocumentNo());
|
||||
List<String> externalDocumentNoList = splitSearchField(dto.getExternalDocumentNo());
|
||||
List<String> documentTypeList = splitSearchField(dto.getDocumentType());
|
||||
List<String> stateList = splitSearchField(dto.getState());
|
||||
List<String> createUserList = splitSearchField(dto.getCreateUser());
|
||||
List<String> updateUserList = splitSearchField(dto.getUpdateUser());
|
||||
List<String> itemList = splitSearchField(dto.getItem());
|
||||
List<String> sourceWarehouseList = splitSearchField(dto.getSourceWarehouse());
|
||||
List<String> targetWarehouseList = splitSearchField(dto.getTargetWarehouse());
|
||||
List<String> salesBatchList = splitSearchField(dto.getSalesBatch());
|
||||
List<String> iqcResultsList = splitSearchField(dto.getIqcResults());
|
||||
LocalDateTime createDateTime1 = dto.getCreateDateTime1();
|
||||
LocalDateTime createDateTime2 = dto.getCreateDateTime2();
|
||||
LocalDateTime modifyDateTime1 = dto.getModifyDateTime1();
|
||||
LocalDateTime modifyDateTime2 = dto.getModifyDateTime2();
|
||||
List<DocumentSummaryReportDto> data = baseMapper.selectDocumentSummary(site, documentNoList, externalDocumentNoList, documentTypeList, stateList, createUserList, updateUserList, itemList, sourceWarehouseList, targetWarehouseList, salesBatchList, iqcResultsList, createDateTime1, createDateTime2, modifyDateTime1, modifyDateTime2);
|
||||
if (CollectionUtil.isNotEmpty(data)) {
|
||||
Map<String, String> documentTypeFormatter = remoteDictService.getDictByType("DOCUMENT_TYPE", SecurityConstants.FROM_IN).getData().stream().collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getDescription));
|
||||
Map<String, String> 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<WareHouse> getAllSourceWarehouse(IPage<WareHouse> iPage, String site, String searchText) {
|
||||
return baseMapper.findAllSourceWarehouse(iPage, site, searchText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WareHouse> getAllTargetWarehouse(IPage<WareHouse> iPage, String site, String searchText) {
|
||||
return baseMapper.findAllTargetWarehouse(iPage, site, searchText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<DocumentDetailReportDto> pageDocumentDetailed(IPage iPage, DocumentDetailReportDto dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
List<String> documentNoList = splitSearchField(dto.getDocumentNo());
|
||||
List<String> externalDocumentNoList = splitSearchField(dto.getExternalDocumentNo());
|
||||
List<String> documentTypeList = splitSearchField(dto.getDocumentType());
|
||||
List<String> stateList = splitSearchField(dto.getState());
|
||||
List<String> palletList = splitSearchField(dto.getPallet());
|
||||
List<String> inventoryIdList = splitSearchField(dto.getInventoryId());
|
||||
List<String> salesBatchList = splitSearchField(dto.getSalesBatch());
|
||||
List<String> itemList = splitSearchField(dto.getItem());
|
||||
List<String> inspectionOrderNoList = splitSearchField(dto.getInspectionOrderNo());
|
||||
List<String> qualityInspectionStatusList = splitSearchField(dto.getQualityInspectionStatus());
|
||||
List<String> batchNumberList = splitSearchField(dto.getBatchNumber());
|
||||
List<String> vendorBatchList = splitSearchField(dto.getVendorBatch());
|
||||
List<String> sourceWarehouseList = splitSearchField(dto.getSourceWarehouse());
|
||||
List<String> sourceLocationList = splitSearchField(dto.getSourceLocation());
|
||||
List<String> storageBinList = splitSearchField(dto.getStorageBin());
|
||||
List<String> targetWarehouseList = splitSearchField(dto.getTargetWarehouse());
|
||||
List<String> targetLocationList = splitSearchField(dto.getTargetLocation());
|
||||
List<String> targetBinList = splitSearchField(dto.getTargetBin());
|
||||
List<String> createUserList = splitSearchField(dto.getCreateUser());
|
||||
LocalDateTime createDateTime1 = dto.getCreateDateTime1();
|
||||
LocalDateTime createDateTime2 = dto.getCreateDateTime2();
|
||||
LocalDateTime modifyDateTime1 = dto.getModifyDateTime1();
|
||||
LocalDateTime modifyDateTime2 = dto.getModifyDateTime2();
|
||||
List<String> updateUserList = splitSearchField(dto.getUpdateUser());
|
||||
List<String> 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<DocumentDetailReportDto> selectDocumentDetailed(DocumentDetailReportDto dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
List<String> documentNoList = splitSearchField(dto.getDocumentNo());
|
||||
List<String> externalDocumentNoList = splitSearchField(dto.getExternalDocumentNo());
|
||||
List<String> documentTypeList = splitSearchField(dto.getDocumentType());
|
||||
List<String> stateList = splitSearchField(dto.getState());
|
||||
List<String> palletList = splitSearchField(dto.getPallet());
|
||||
List<String> inventoryIdList = splitSearchField(dto.getInventoryId());
|
||||
List<String> salesBatchList = splitSearchField(dto.getSalesBatch());
|
||||
List<String> itemList = splitSearchField(dto.getItem());
|
||||
List<String> inspectionOrderNoList = splitSearchField(dto.getInspectionOrderNo());
|
||||
List<String> qualityInspectionStatusList = splitSearchField(dto.getQualityInspectionStatus());
|
||||
List<String> batchNumberList = splitSearchField(dto.getBatchNumber());
|
||||
List<String> vendorBatchList = splitSearchField(dto.getVendorBatch());
|
||||
List<String> sourceWarehouseList = splitSearchField(dto.getSourceWarehouse());
|
||||
List<String> sourceLocationList = splitSearchField(dto.getSourceLocation());
|
||||
List<String> storageBinList = splitSearchField(dto.getStorageBin());
|
||||
List<String> targetWarehouseList = splitSearchField(dto.getTargetWarehouse());
|
||||
List<String> targetLocationList = splitSearchField(dto.getTargetLocation());
|
||||
List<String> targetBinList = splitSearchField(dto.getTargetBin());
|
||||
List<String> createUserList = splitSearchField(dto.getCreateUser());
|
||||
LocalDateTime createDateTime1 = dto.getCreateDateTime1();
|
||||
LocalDateTime createDateTime2 = dto.getCreateDateTime2();
|
||||
LocalDateTime modifyDateTime1 = dto.getModifyDateTime1();
|
||||
LocalDateTime modifyDateTime2 = dto.getModifyDateTime2();
|
||||
List<String> updateUserList = splitSearchField(dto.getUpdateUser());
|
||||
List<String> iqcResultsList = splitSearchField(dto.getIqcResults());
|
||||
List<DocumentDetailReportDto> 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<String, String> documentTypeFormatter = remoteDictService.getDictByType("DOCUMENT_TYPE", SecurityConstants.FROM_IN).getData().stream().collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getDescription));
|
||||
Map<String, String> documentStateFormatter = remoteDictService.getDictByType("DOCUMENT_STATE", SecurityConstants.FROM_IN).getData().stream().collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getDescription));
|
||||
Map<String, String> 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;
|
||||
}
|
||||
}
|
||||
@ -6462,16 +6462,18 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
|
||||
if (Constant.DOCUMENT_STATUS_SUBMIT.equals(document.getState())) {
|
||||
updateDocumentAndDetailStatus(user, documentBo, now, Constant.DOCUMENT_STATUS_PICKING);
|
||||
//FSMM007-MES B
|
||||
if (StringUtil.isEmpty(document.getExternalDocumentNo())) {
|
||||
throw BusinessException.build("交货单号不可为空");
|
||||
}
|
||||
JSONObject sapJsonBody = new JSONObject();
|
||||
sapJsonBody.put("Z_LVSTK", "B"); // WMS的拣配状态
|
||||
sapJsonBody.put("VBELN", document.getExternalDocumentNo()); // 销售和分销凭证号
|
||||
Map<String, String> resultMap = remoteFssm007Service.doExecute(sapJsonBody).getData();
|
||||
if ("E".equals(resultMap.get("RESULT"))) {
|
||||
throw BusinessException.build(resultMap.get("MSG"));
|
||||
if(!"PURCHASE_RETURN".equals(document.getDocumentType())){
|
||||
//FSMM007-MES B
|
||||
if (StringUtil.isEmpty(document.getExternalDocumentNo())) {
|
||||
throw BusinessException.build("交货单号不可为空");
|
||||
}
|
||||
JSONObject sapJsonBody = new JSONObject();
|
||||
sapJsonBody.put("Z_LVSTK", "B"); // WMS的拣配状态
|
||||
sapJsonBody.put("VBELN", document.getExternalDocumentNo()); // 销售和分销凭证号
|
||||
Map<String, String> resultMap = remoteFssm007Service.doExecute(sapJsonBody).getData();
|
||||
if ("E".equals(resultMap.get("RESULT"))) {
|
||||
throw BusinessException.build(resultMap.get("MSG"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6485,16 +6487,18 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
if (Constant.DOCUMENT_STATUS_PICKING.equals(document.getState()) || Constant.DOCUMENT_STATUS_TBC.equals(document.getState())) {
|
||||
pickingService.lambdaUpdate().eq(Picking::getSite, site).eq(Picking::getDocumentNo, documentNo).in(CollectionUtil.isNotEmpty(seqList), Picking::getSeq, seqList).remove();
|
||||
updateDocumentAndDetailStatus(user, documentBo, null, Constant.DOCUMENT_STATUS_SUBMIT);
|
||||
//FSMM007-MES 空
|
||||
if (StringUtil.isEmpty(document.getExternalDocumentNo())) {
|
||||
throw BusinessException.build("交货单号不可为空");
|
||||
}
|
||||
JSONObject sapJsonBody = new JSONObject();
|
||||
sapJsonBody.put("Z_LVSTK", ""); // WMS的拣配状态
|
||||
sapJsonBody.put("VBELN", document.getExternalDocumentNo()); // 销售和分销凭证号
|
||||
Map<String, String> resultMap = remoteFssm007Service.doExecute(sapJsonBody).getData();
|
||||
if ("E".equals(resultMap.get("RESULT"))) {
|
||||
throw BusinessException.build(resultMap.get("MSG"));
|
||||
if(!"PURCHASE_RETURN".equals(document.getDocumentType())){
|
||||
//FSMM007-MES 空
|
||||
if (StringUtil.isEmpty(document.getExternalDocumentNo())) {
|
||||
throw BusinessException.build("交货单号不可为空");
|
||||
}
|
||||
JSONObject sapJsonBody = new JSONObject();
|
||||
sapJsonBody.put("Z_LVSTK", ""); // WMS的拣配状态
|
||||
sapJsonBody.put("VBELN", document.getExternalDocumentNo()); // 销售和分销凭证号
|
||||
Map<String, String> resultMap = remoteFssm007Service.doExecute(sapJsonBody).getData();
|
||||
if ("E".equals(resultMap.get("RESULT"))) {
|
||||
throw BusinessException.build(resultMap.get("MSG"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw BusinessException.build("单据状态无法清除记录");
|
||||
@ -6520,16 +6524,18 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
if (Constant.DOCUMENT_STATUS_PICKING.equals(document.getState())) {
|
||||
updatePickingStatus(site, user, documentNo, now, Constant.PICKING_STATUS_TBC);
|
||||
updateDocumentAndDetailStatus(user, documentBo, now, Constant.DOCUMENT_STATUS_TBC);
|
||||
//FSMM007-MES C
|
||||
if (StringUtil.isEmpty(document.getExternalDocumentNo())) {
|
||||
throw BusinessException.build("交货单号不可为空");
|
||||
}
|
||||
JSONObject sapJsonBody = new JSONObject();
|
||||
sapJsonBody.put("Z_LVSTK", "C"); // WMS的拣配状态
|
||||
sapJsonBody.put("VBELN", document.getExternalDocumentNo()); // 销售和分销凭证号
|
||||
Map<String, String> resultMap = remoteFssm007Service.doExecute(sapJsonBody).getData();
|
||||
if ("E".equals(resultMap.get("RESULT"))) {
|
||||
throw BusinessException.build(resultMap.get("MSG"));
|
||||
if(!"PURCHASE_RETURN".equals(document.getDocumentType())){
|
||||
//FSMM007-MES C
|
||||
if (StringUtil.isEmpty(document.getExternalDocumentNo())) {
|
||||
throw BusinessException.build("交货单号不可为空");
|
||||
}
|
||||
JSONObject sapJsonBody = new JSONObject();
|
||||
sapJsonBody.put("Z_LVSTK", "C"); // WMS的拣配状态
|
||||
sapJsonBody.put("VBELN", document.getExternalDocumentNo()); // 销售和分销凭证号
|
||||
Map<String, String> resultMap = remoteFssm007Service.doExecute(sapJsonBody).getData();
|
||||
if ("E".equals(resultMap.get("RESULT"))) {
|
||||
throw BusinessException.build(resultMap.get("MSG"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw BusinessException.build("单据状态不允许提交");
|
||||
@ -6620,10 +6626,15 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
if (StringUtil.isEmpty(document.getExternalDocumentNo())) {
|
||||
throw BusinessException.build("交货单号不可为空");
|
||||
}
|
||||
JSONObject sapJsonBody = assembleRequestBody(document, user, documentSfcs, types);
|
||||
Map<String, String> resultMap = remoteFssm0081Service.doExecute(sapJsonBody).getData();
|
||||
if ("E".equals(resultMap.get("RESULT"))) {
|
||||
throw BusinessException.build(resultMap.get("MSG"));
|
||||
if("PURCHASE_RETURN".equals(document.getDocumentType())){
|
||||
// 用008-2接口传送 @TODO 接口里面的明细字段传值映射待定
|
||||
|
||||
}else{
|
||||
JSONObject sapJsonBody = assembleRequestBody(document, user, documentSfcs, types);
|
||||
Map<String, String> resultMap = remoteFssm0081Service.doExecute(sapJsonBody).getData();
|
||||
if ("E".equals(resultMap.get("RESULT"))) {
|
||||
throw BusinessException.build(resultMap.get("MSG"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6960,6 +6971,9 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
throw BusinessException.build("原采购订单" + po + "和行" + seq + "数据不存在");
|
||||
}
|
||||
poOrderDetail.setRegisteredQty(poOrderDetail.getRegisteredQty().subtract(sumQty));
|
||||
if(poOrderDetail.getCompletedQty() == null){
|
||||
throw BusinessException.build("原采购订单" + po + "和行" + seq + "的完成数量为空");
|
||||
}
|
||||
poOrderDetail.setCompletedQty(poOrderDetail.getCompletedQty().subtract(sumQty));
|
||||
poOrderDetail.setUpdateUser(SecurityUtils.getUserName());
|
||||
poOrderDetail.setUpdateDate(LocalDateTime.now());
|
||||
@ -7036,6 +7050,9 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
||||
throw BusinessException.build("原采购订单" + po + "和行" + seq + "数据不存在");
|
||||
}
|
||||
poOrderDetail.setRegisteredQty(poOrderDetail.getRegisteredQty().subtract(detailed.getApplicationsQuantity()));
|
||||
if(poOrderDetail.getCompletedQty() == null){
|
||||
throw BusinessException.build("原采购订单" + po + "和行" + seq + "的完成数量为空");
|
||||
}
|
||||
poOrderDetail.setCompletedQty(poOrderDetail.getCompletedQty().subtract(detailed.getApplicationsQuantity()));
|
||||
poOrderDetail.setUpdateUser(SecurityUtils.getUserName());
|
||||
poOrderDetail.setUpdateDate(LocalDateTime.now());
|
||||
|
||||
@ -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<DocumentSummaryReportMapper, DocumentDetailed> implements DocumentSummaryReportService {
|
||||
private final DocumentSummaryReportMapper documentSummaryReportMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<DocumentSummaryReportDto> doRetrieve(IPage<DocumentSummaryReportDto> iPage, DocumentSummaryReportDto documentSummaryReportDto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
// 单据号
|
||||
String documentNo = documentSummaryReportDto.getDocumentNo();
|
||||
List<String> documentNoList = null;
|
||||
if (StrUtil.isNotBlank(documentNo)) {
|
||||
documentNoList = Arrays.asList(documentNo.split(" "));
|
||||
}
|
||||
|
||||
//外部单据号
|
||||
String externalDocumentNo = documentSummaryReportDto.getExternalDocumentNo();
|
||||
List<String> externalDocumentNoList = null;
|
||||
if (StrUtil.isNotBlank(externalDocumentNo)) {
|
||||
externalDocumentNoList = Arrays.asList(externalDocumentNo.split(" "));
|
||||
}
|
||||
|
||||
//单据类型
|
||||
List<String> documentTypeList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getDocumentType())) {
|
||||
documentTypeList = Arrays.asList(documentSummaryReportDto.getDocumentType().split(" "));
|
||||
}
|
||||
|
||||
//单据行状态
|
||||
List<String> seqStateList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getSeqState())) {
|
||||
seqStateList = Arrays.asList(documentSummaryReportDto.getSeqState().split(" "));
|
||||
}
|
||||
|
||||
//创建人
|
||||
String createUser = documentSummaryReportDto.getCreateUser();
|
||||
List<String> createUserList = null;
|
||||
if (StrUtil.isNotBlank(createUser)) {
|
||||
createUserList = Arrays.asList(createUser.split(" "));
|
||||
}
|
||||
|
||||
//更新人
|
||||
String modifyUser = documentSummaryReportDto.getModifyUser();
|
||||
List<String> modifyUserList = null;
|
||||
if (StrUtil.isNotBlank(modifyUser)) {
|
||||
modifyUserList = Arrays.asList(modifyUser.split(" "));
|
||||
}
|
||||
|
||||
//物料
|
||||
String item = documentSummaryReportDto.getItem();
|
||||
List<String> itemList = null;
|
||||
if (StrUtil.isNotBlank(item)) {
|
||||
itemList = Arrays.asList(item.split(" "));
|
||||
}
|
||||
|
||||
//物料组
|
||||
String itemGroup = documentSummaryReportDto.getItemGroup();
|
||||
List<String> itemGroupList = null;
|
||||
if (StrUtil.isNotBlank(itemGroup)) {
|
||||
itemGroupList = Arrays.asList(itemGroup.split(" "));
|
||||
}
|
||||
|
||||
//来源仓
|
||||
List<String> sourceWarehouseList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getSourceWarehouse())) {
|
||||
sourceWarehouseList = Arrays.asList(documentSummaryReportDto.getSourceWarehouse().split(" "));
|
||||
}
|
||||
|
||||
//目标仓
|
||||
List<String> targetWarehouseList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getTargetWarehouse())) {
|
||||
targetWarehouseList = Arrays.asList(documentSummaryReportDto.getTargetWarehouse().split(" "));
|
||||
}
|
||||
|
||||
//项目编号
|
||||
String oaProjectCode = documentSummaryReportDto.getOaProjectCode();
|
||||
List<String> oaProjectCodeList = null;
|
||||
if (StrUtil.isNotBlank(oaProjectCode)) {
|
||||
oaProjectCodeList = Arrays.asList(oaProjectCode.split(" "));
|
||||
}
|
||||
|
||||
//出货批次
|
||||
String salesBatch = documentSummaryReportDto.getSalesBatch();
|
||||
List<String> salesBatchList = null;
|
||||
if (StrUtil.isNotBlank(salesBatch)) {
|
||||
salesBatchList = Arrays.asList(salesBatch.split(" "));
|
||||
}
|
||||
|
||||
//IQC
|
||||
List<String> iqcResultsList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getIqcResults())) {
|
||||
iqcResultsList = Arrays.asList(documentSummaryReportDto.getIqcResults().split(" "));
|
||||
}
|
||||
//OQC
|
||||
List<String> 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<DocumentSummaryReportDto> doSelect(DocumentSummaryReportDto documentSummaryReportDto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
// 单据号
|
||||
String documentNo = documentSummaryReportDto.getDocumentNo();
|
||||
List<String> documentNoList = null;
|
||||
if (StrUtil.isNotBlank(documentNo)) {
|
||||
documentNoList = Arrays.asList(documentNo.split(" "));
|
||||
}
|
||||
|
||||
//外部单据号
|
||||
String externalDocumentNo = documentSummaryReportDto.getExternalDocumentNo();
|
||||
List<String> externalDocumentNoList = null;
|
||||
if (StrUtil.isNotBlank(externalDocumentNo)) {
|
||||
externalDocumentNoList = Arrays.asList(externalDocumentNo.split(" "));
|
||||
}
|
||||
|
||||
//单据类型
|
||||
List<String> documentTypeList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getDocumentType())) {
|
||||
documentTypeList = Arrays.asList(documentSummaryReportDto.getDocumentType().split(" "));
|
||||
}
|
||||
|
||||
//单据行状态
|
||||
List<String> seqStateList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getSeqState())) {
|
||||
seqStateList = Arrays.asList(documentSummaryReportDto.getSeqState().split(" "));
|
||||
}
|
||||
|
||||
//创建人
|
||||
String createUser = documentSummaryReportDto.getCreateUser();
|
||||
List<String> createUserList = null;
|
||||
if (StrUtil.isNotBlank(createUser)) {
|
||||
createUserList = Arrays.asList(createUser.split(" "));
|
||||
}
|
||||
|
||||
//更新人
|
||||
String modifyUser = documentSummaryReportDto.getModifyUser();
|
||||
List<String> modifyUserList = null;
|
||||
if (StrUtil.isNotBlank(modifyUser)) {
|
||||
modifyUserList = Arrays.asList(modifyUser.split(" "));
|
||||
}
|
||||
|
||||
//物料
|
||||
String item = documentSummaryReportDto.getItem();
|
||||
List<String> itemList = null;
|
||||
if (StrUtil.isNotBlank(item)) {
|
||||
itemList = Arrays.asList(item.split(" "));
|
||||
}
|
||||
|
||||
//物料组
|
||||
String itemGroup = documentSummaryReportDto.getItemGroup();
|
||||
List<String> itemGroupList = null;
|
||||
if (StrUtil.isNotBlank(itemGroup)) {
|
||||
itemGroupList = Arrays.asList(itemGroup.split(" "));
|
||||
}
|
||||
|
||||
//来源仓
|
||||
String sourceWarehouse = documentSummaryReportDto.getSourceWarehouse();
|
||||
List<String> sourceWarehouseList = null;
|
||||
if (StrUtil.isNotBlank(sourceWarehouse)) {
|
||||
sourceWarehouseList = Arrays.asList(documentSummaryReportDto.getSourceWarehouse().split(" "));
|
||||
}
|
||||
|
||||
//目标仓
|
||||
String targetWarehouse = documentSummaryReportDto.getTargetWarehouse();
|
||||
List<String> targetWarehouseList = null;
|
||||
if (StrUtil.isNotBlank(targetWarehouse)) {
|
||||
targetWarehouseList = Arrays.asList(documentSummaryReportDto.getTargetWarehouse().split(" "));
|
||||
}
|
||||
|
||||
//项目编号
|
||||
String oaProjectCode = documentSummaryReportDto.getOaProjectCode();
|
||||
List<String> oaProjectCodeList = null;
|
||||
if (StrUtil.isNotBlank(oaProjectCode)) {
|
||||
oaProjectCodeList = Arrays.asList(oaProjectCode.split(" "));
|
||||
}
|
||||
|
||||
//出货批次
|
||||
String salesBatch = documentSummaryReportDto.getSalesBatch();
|
||||
List<String> salesBatchList = null;
|
||||
if (StrUtil.isNotBlank(salesBatch)) {
|
||||
salesBatchList = Arrays.asList(salesBatch.split(" "));
|
||||
}
|
||||
|
||||
//IQC
|
||||
List<String> iqcResultsList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getIqcResults())) {
|
||||
iqcResultsList = Arrays.asList(documentSummaryReportDto.getIqcResults().split(" "));
|
||||
}
|
||||
//OQC
|
||||
List<String> 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<DocumentSummaryReportDto> 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<DocumentSummaryReportDto> getAllSourceWarehouse(IPage<DocumentSummaryReportDto> iPage, String searchText) {
|
||||
return documentSummaryReportMapper.findAllSourceWarehouse(iPage, searchText);
|
||||
}
|
||||
|
||||
public IPage<DocumentSummaryReportDto> getAllTargetWarehouse(IPage<DocumentSummaryReportDto> iPage, String searchText) {
|
||||
return documentSummaryReportMapper.findAllTargetWarehouse(iPage, searchText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<DocumentSummaryReportDto> doRetrieveDocumentDetailed(IPage<DocumentSummaryReportDto> iPage, DocumentSummaryReportDto documentSummaryReportDto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
// 单据号
|
||||
String documentNo = documentSummaryReportDto.getDocumentNo();
|
||||
List<String> documentNoList = null;
|
||||
if (StrUtil.isNotBlank(documentNo)) {
|
||||
documentNoList = Arrays.asList(documentNo.split(" "));
|
||||
}
|
||||
|
||||
//外部单据号
|
||||
String externalDocumentNo = documentSummaryReportDto.getExternalDocumentNo();
|
||||
List<String> externalDocumentNoList = null;
|
||||
if (StrUtil.isNotBlank(externalDocumentNo)) {
|
||||
externalDocumentNoList = Arrays.asList(externalDocumentNo.split(" "));
|
||||
}
|
||||
|
||||
//单据类型
|
||||
List<String> documentTypeList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getDocumentType())) {
|
||||
documentTypeList = Arrays.asList(documentSummaryReportDto.getDocumentType().split(" "));
|
||||
}
|
||||
|
||||
//单据行状态
|
||||
List<String> seqStateList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getSeqState())) {
|
||||
seqStateList = Arrays.asList(documentSummaryReportDto.getSeqState().split(" "));
|
||||
}
|
||||
|
||||
// 托条码
|
||||
String pallet = documentSummaryReportDto.getPallet();
|
||||
List<String> palletList = null;
|
||||
if (StrUtil.isNotBlank(pallet)) {
|
||||
palletList = Arrays.asList(pallet.split(" "));
|
||||
}
|
||||
|
||||
// 箱条码
|
||||
String box = documentSummaryReportDto.getBox();
|
||||
List<String> boxList = null;
|
||||
if (StrUtil.isNotBlank(box)) {
|
||||
boxList = Arrays.asList(box.split(" "));
|
||||
}
|
||||
|
||||
// 库存条码
|
||||
String inventoryId = documentSummaryReportDto.getInventoryId();
|
||||
List<String> inventoryIdList = null;
|
||||
if (StrUtil.isNotBlank(inventoryId)) {
|
||||
inventoryIdList = Arrays.asList(inventoryId.split(" "));
|
||||
}
|
||||
|
||||
//项目编号
|
||||
String oaProjectCode = documentSummaryReportDto.getOaProjectCode();
|
||||
List<String> oaProjectCodeList = null;
|
||||
if (StrUtil.isNotBlank(oaProjectCode)) {
|
||||
oaProjectCodeList = Arrays.asList(oaProjectCode.split(" "));
|
||||
}
|
||||
|
||||
//出货批次
|
||||
String salesBatch = documentSummaryReportDto.getSalesBatch();
|
||||
List<String> salesBatchList = null;
|
||||
if (StrUtil.isNotBlank(salesBatch)) {
|
||||
salesBatchList = Arrays.asList(salesBatch.split(" "));
|
||||
}
|
||||
|
||||
//IQC
|
||||
List<String> iqcResultsList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getIqcResults())) {
|
||||
iqcResultsList = Arrays.asList(documentSummaryReportDto.getIqcResults().split(" "));
|
||||
}
|
||||
|
||||
//OQC
|
||||
List<String> oqcResultsList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getOqcResults())) {
|
||||
oqcResultsList = Arrays.asList(documentSummaryReportDto.getOqcResults().split(" "));
|
||||
}
|
||||
|
||||
//检验单号
|
||||
String inspectionOrderNo = documentSummaryReportDto.getInspectionOrderNo();
|
||||
List<String> inspectionOrderNoList = null;
|
||||
if (StrUtil.isNotBlank(inspectionOrderNo)) {
|
||||
inspectionOrderNoList = Arrays.asList(inspectionOrderNo.split(" "));
|
||||
}
|
||||
|
||||
//物料
|
||||
String item = documentSummaryReportDto.getItem();
|
||||
List<String> itemList = null;
|
||||
if (StrUtil.isNotBlank(item)) {
|
||||
itemList = Arrays.asList(item.split(" "));
|
||||
}
|
||||
|
||||
//物料组
|
||||
String itemGroup = documentSummaryReportDto.getItemGroup();
|
||||
List<String> itemGroupList = null;
|
||||
if (StrUtil.isNotBlank(itemGroup)) {
|
||||
itemGroupList = Arrays.asList(itemGroup.split(" "));
|
||||
}
|
||||
|
||||
//质量等级
|
||||
String qualityInspectionStatus = documentSummaryReportDto.getQualityInspectionStatus();
|
||||
List<String> qualityInspectionStatusList = null;
|
||||
if (StrUtil.isNotBlank(qualityInspectionStatus)) {
|
||||
qualityInspectionStatusList = Arrays.asList(qualityInspectionStatus.split(" "));
|
||||
}
|
||||
|
||||
//采购到货批
|
||||
String batchNumber = documentSummaryReportDto.getBatchNumber();
|
||||
List<String> batchNumberList = null;
|
||||
if (StrUtil.isNotBlank(batchNumber)) {
|
||||
batchNumberList = Arrays.asList(batchNumber.split(" "));
|
||||
}
|
||||
|
||||
//供应商批
|
||||
String vendorBatch = documentSummaryReportDto.getVendorBatch();
|
||||
List<String> vendorBatchList = null;
|
||||
if (StrUtil.isNotBlank(vendorBatch)) {
|
||||
vendorBatchList = Arrays.asList(vendorBatch.split(" "));
|
||||
}
|
||||
|
||||
//来源仓库
|
||||
List<String> sourceWarehouseList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getSourceWarehouse())) {
|
||||
sourceWarehouseList = Arrays.asList(documentSummaryReportDto.getSourceWarehouse().split(" "));
|
||||
}
|
||||
|
||||
//来源区域
|
||||
String sourceLocation = documentSummaryReportDto.getSourceLocation();
|
||||
List<String> sourceLocationList = null;
|
||||
if (StrUtil.isNotBlank(sourceLocation)) {
|
||||
sourceLocationList = Arrays.asList(sourceLocation.split(" "));
|
||||
}
|
||||
|
||||
//来源货格
|
||||
String storageBin = documentSummaryReportDto.getStorageBin();
|
||||
List<String> storageBinList = null;
|
||||
if (StrUtil.isNotBlank(storageBin)) {
|
||||
storageBinList = Arrays.asList(storageBin.split(" "));
|
||||
}
|
||||
|
||||
//目标仓库
|
||||
List<String> targetWarehouseList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getTargetWarehouse())) {
|
||||
targetWarehouseList = Arrays.asList(documentSummaryReportDto.getTargetWarehouse().split(" "));
|
||||
}
|
||||
|
||||
//目标区域
|
||||
String targetLocation = documentSummaryReportDto.getTargetLocation();
|
||||
List<String> targetLocationList = null;
|
||||
if (StrUtil.isNotBlank(targetLocation)) {
|
||||
targetLocationList = Arrays.asList(targetLocation.split(" "));
|
||||
}
|
||||
|
||||
//目标货格
|
||||
String targetBin = documentSummaryReportDto.getTargetBin();
|
||||
List<String> targetBinList = null;
|
||||
if (StrUtil.isNotBlank(targetBin)) {
|
||||
targetBinList = Arrays.asList(targetBin.split(" "));
|
||||
}
|
||||
|
||||
//创建人
|
||||
String createUser = documentSummaryReportDto.getCreateUser();
|
||||
List<String> createUserList = null;
|
||||
if (StrUtil.isNotBlank(createUser)) {
|
||||
createUserList = Arrays.asList(createUser.split(" "));
|
||||
}
|
||||
|
||||
//更新人
|
||||
String modifyUser = documentSummaryReportDto.getModifyUser();
|
||||
List<String> 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<DocumentSummaryReportDto> doDetailedSelect(DocumentSummaryReportDto documentSummaryReportDto) {
|
||||
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
// 单据号
|
||||
String documentNo = documentSummaryReportDto.getDocumentNo();
|
||||
List<String> documentNoList = null;
|
||||
if (StrUtil.isNotBlank(documentNo)) {
|
||||
documentNoList = Arrays.asList(documentNo.split(" "));
|
||||
}
|
||||
|
||||
//外部单据号
|
||||
String externalDocumentNo = documentSummaryReportDto.getExternalDocumentNo();
|
||||
List<String> externalDocumentNoList = null;
|
||||
if (StrUtil.isNotBlank(externalDocumentNo)) {
|
||||
externalDocumentNoList = Arrays.asList(externalDocumentNo.split(" "));
|
||||
}
|
||||
|
||||
//单据类型
|
||||
List<String> documentTypeList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getDocumentType())) {
|
||||
documentTypeList = Arrays.asList(documentSummaryReportDto.getDocumentType().split(" "));
|
||||
}
|
||||
|
||||
//单据行状态
|
||||
List<String> seqStateList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getSeqState())) {
|
||||
seqStateList = Arrays.asList(documentSummaryReportDto.getSeqState().split(" "));
|
||||
}
|
||||
|
||||
// 托条码
|
||||
String pallet = documentSummaryReportDto.getPallet();
|
||||
List<String> palletList = null;
|
||||
if (StrUtil.isNotBlank(pallet)) {
|
||||
palletList = Arrays.asList(pallet.split(" "));
|
||||
}
|
||||
|
||||
// 箱条码
|
||||
String box = documentSummaryReportDto.getBox();
|
||||
List<String> boxList = null;
|
||||
if (StrUtil.isNotBlank(box)) {
|
||||
boxList = Arrays.asList(box.split(" "));
|
||||
}
|
||||
|
||||
// 库存条码
|
||||
String inventoryId = documentSummaryReportDto.getInventoryId();
|
||||
List<String> inventoryIdList = null;
|
||||
if (StrUtil.isNotBlank(inventoryId)) {
|
||||
inventoryIdList = Arrays.asList(inventoryId.split(" "));
|
||||
}
|
||||
|
||||
//项目编号
|
||||
String oaProjectCode = documentSummaryReportDto.getOaProjectCode();
|
||||
List<String> oaProjectCodeList = null;
|
||||
if (StrUtil.isNotBlank(oaProjectCode)) {
|
||||
oaProjectCodeList = Arrays.asList(oaProjectCode.split(" "));
|
||||
}
|
||||
|
||||
//出货批次
|
||||
String salesBatch = documentSummaryReportDto.getSalesBatch();
|
||||
List<String> salesBatchList = null;
|
||||
if (StrUtil.isNotBlank(salesBatch)) {
|
||||
salesBatchList = Arrays.asList(salesBatch.split(" "));
|
||||
}
|
||||
|
||||
//IQC
|
||||
List<String> iqcResultsList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getIqcResults())) {
|
||||
iqcResultsList = Arrays.asList(documentSummaryReportDto.getIqcResults().split(" "));
|
||||
}
|
||||
//OQC
|
||||
List<String> oqcResultsList = null;
|
||||
if (StrUtil.isNotBlank(documentSummaryReportDto.getOqcResults())) {
|
||||
oqcResultsList = Arrays.asList(documentSummaryReportDto.getOqcResults().split(" "));
|
||||
}
|
||||
//检验单号
|
||||
String inspectionOrderNo = documentSummaryReportDto.getInspectionOrderNo();
|
||||
List<String> inspectionOrderNoList = null;
|
||||
if (StrUtil.isNotBlank(inspectionOrderNo)) {
|
||||
inspectionOrderNoList = Arrays.asList(inspectionOrderNo.split(" "));
|
||||
}
|
||||
|
||||
//物料
|
||||
String item = documentSummaryReportDto.getItem();
|
||||
List<String> itemList = null;
|
||||
if (StrUtil.isNotBlank(item)) {
|
||||
itemList = Arrays.asList(item.split(" "));
|
||||
}
|
||||
|
||||
//物料组
|
||||
String itemGroup = documentSummaryReportDto.getItemGroup();
|
||||
List<String> itemGroupList = null;
|
||||
if (StrUtil.isNotBlank(itemGroup)) {
|
||||
itemGroupList = Arrays.asList(itemGroup.split(" "));
|
||||
}
|
||||
|
||||
//质量等级
|
||||
String qualityInspectionStatus = documentSummaryReportDto.getQualityInspectionStatus();
|
||||
List<String> qualityInspectionStatusList = null;
|
||||
if (StrUtil.isNotBlank(qualityInspectionStatus)) {
|
||||
qualityInspectionStatusList = Arrays.asList(qualityInspectionStatus.split(" "));
|
||||
}
|
||||
|
||||
//采购到货批
|
||||
String batchNumber = documentSummaryReportDto.getBatchNumber();
|
||||
List<String> batchNumberList = null;
|
||||
if (StrUtil.isNotBlank(batchNumber)) {
|
||||
batchNumberList = Arrays.asList(batchNumber.split(" "));
|
||||
}
|
||||
|
||||
//供应商批
|
||||
String vendorBatch = documentSummaryReportDto.getVendorBatch();
|
||||
List<String> vendorBatchList = null;
|
||||
if (StrUtil.isNotBlank(vendorBatch)) {
|
||||
vendorBatchList = Arrays.asList(vendorBatch.split(" "));
|
||||
}
|
||||
|
||||
//来源仓库
|
||||
String sourceWarehouse = documentSummaryReportDto.getSourceWarehouse();
|
||||
List<String> sourceWarehouseList = null;
|
||||
if (StrUtil.isNotBlank(sourceWarehouse)) {
|
||||
sourceWarehouseList = Arrays.asList(sourceWarehouse.split(" "));
|
||||
}
|
||||
|
||||
//来源区域
|
||||
String sourceLocation = documentSummaryReportDto.getSourceLocation();
|
||||
List<String> sourceLocationList = null;
|
||||
if (StrUtil.isNotBlank(sourceLocation)) {
|
||||
sourceLocationList = Arrays.asList(sourceLocation.split(" "));
|
||||
}
|
||||
|
||||
//来源货格
|
||||
String storageBin = documentSummaryReportDto.getStorageBin();
|
||||
List<String> storageBinList = null;
|
||||
if (StrUtil.isNotBlank(storageBin)) {
|
||||
storageBinList = Arrays.asList(storageBin.split(" "));
|
||||
}
|
||||
|
||||
//目标仓库
|
||||
String targetWarehouse = documentSummaryReportDto.getTargetWarehouse();
|
||||
List<String> targetWarehouseList = null;
|
||||
if (StrUtil.isNotBlank(targetWarehouse)) {
|
||||
targetWarehouseList = Arrays.asList(targetWarehouse.split(" "));
|
||||
}
|
||||
|
||||
//目标区域
|
||||
String targetLocation = documentSummaryReportDto.getTargetLocation();
|
||||
List<String> targetLocationList = null;
|
||||
if (StrUtil.isNotBlank(targetLocation)) {
|
||||
targetLocationList = Arrays.asList(targetLocation.split(" "));
|
||||
}
|
||||
|
||||
//目标货格
|
||||
String targetBin = documentSummaryReportDto.getTargetBin();
|
||||
List<String> targetBinList = null;
|
||||
if (StrUtil.isNotBlank(targetBin)) {
|
||||
targetBinList = Arrays.asList(targetBin.split(" "));
|
||||
}
|
||||
|
||||
//创建人
|
||||
String createUser = documentSummaryReportDto.getCreateUser();
|
||||
List<String> createUserList = null;
|
||||
if (StrUtil.isNotBlank(createUser)) {
|
||||
createUserList = Arrays.asList(createUser.split(" "));
|
||||
}
|
||||
|
||||
//更新人
|
||||
String modifyUser = documentSummaryReportDto.getModifyUser();
|
||||
List<String> 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<DocumentSummaryReportDto> 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;
|
||||
}
|
||||
}
|
||||
@ -15,6 +15,7 @@ import com.foreverwin.mom.wms.service.WmsItemService;
|
||||
import com.foreverwin.mom.wms.service.ZWmsInventoryCheckCountService;
|
||||
import com.foreverwin.mom.wms.service.ZWmsInventoryCheckSnapshotService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -42,6 +43,33 @@ public class ZWmsInventoryCheckSnapshotServiceImpl extends ServiceImpl<ZWmsInven
|
||||
@Override
|
||||
public Page<ZWmsInventoryCheckSnapshot> selectSnapshotInfoDifference(Page<ZWmsInventoryCheckSnapshot> page,
|
||||
ZWmsInventoryCheckSnapshot zWmsInventoryCheckSnapshot) {
|
||||
List<ZWmsInventoryCheckSnapshot> result = getzWmsInventoryCheckSnapshots(zWmsInventoryCheckSnapshot);
|
||||
// 根据传入进来的 page,对 result 进行分页数据处理
|
||||
long current = page.getCurrent();
|
||||
long size = page.getSize();
|
||||
page.setTotal(result.size());
|
||||
if (current > 1) {
|
||||
int fromIndex = (int) ((current - 1) * size);
|
||||
int toIndex = (int) (current * size);
|
||||
if (toIndex > result.size()) {
|
||||
toIndex = result.size();
|
||||
}
|
||||
result = result.subList(fromIndex, toIndex);
|
||||
} else {
|
||||
int toIndex = (int) size;
|
||||
if (toIndex > result.size()) {
|
||||
toIndex = result.size();
|
||||
}
|
||||
result = result.subList(0, toIndex);
|
||||
}
|
||||
page.setRecords(result);
|
||||
return page;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<ZWmsInventoryCheckSnapshot> getzWmsInventoryCheckSnapshots(
|
||||
ZWmsInventoryCheckSnapshot zWmsInventoryCheckSnapshot) {
|
||||
// 库存快照中不存在,实际盘点存在 2
|
||||
// 库存快照中存在,实际盘点不存在 3
|
||||
// 库存快照中存在,无差异 5
|
||||
@ -63,7 +91,7 @@ public class ZWmsInventoryCheckSnapshotServiceImpl extends ServiceImpl<ZWmsInven
|
||||
.eq(ZWmsInventoryCheckCount::getCheckNo, checkNo));
|
||||
|
||||
List<ZWmsInventoryCheckSnapshot> result = new ArrayList<>();
|
||||
// 1、有快照数据
|
||||
// 1、有快照数据
|
||||
if (CollectionUtils.isNotEmpty(zWmsInventoryCheckSnapshotList)) {
|
||||
List<ZWmsInventoryCheckSnapshot> notifySnapshotList = new ArrayList<>();
|
||||
// 判断是否有盘点数据
|
||||
@ -130,25 +158,6 @@ public class ZWmsInventoryCheckSnapshotServiceImpl extends ServiceImpl<ZWmsInven
|
||||
|
||||
// result根据inventoryId排序
|
||||
result.sort(Comparator.comparing(ZWmsInventoryCheckSnapshot::getInventoryId));
|
||||
// 根据传入进来的 page,对 result 进行分页数据处理
|
||||
long current = page.getCurrent();
|
||||
long size = page.getSize();
|
||||
page.setTotal(result.size());
|
||||
if (current > 1) {
|
||||
int fromIndex = (int) ((current - 1) * size);
|
||||
int toIndex = (int) (current * size);
|
||||
if (toIndex > result.size()) {
|
||||
toIndex = result.size();
|
||||
}
|
||||
result = result.subList(fromIndex, toIndex);
|
||||
} else {
|
||||
int toIndex = (int) size;
|
||||
if (toIndex > result.size()) {
|
||||
toIndex = result.size();
|
||||
}
|
||||
result = result.subList(0, toIndex);
|
||||
}
|
||||
page.setRecords(result);
|
||||
return page;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,28 +124,30 @@ public class ZWmsInventoryLogServiceImpl extends ServiceImpl<ZWmsInventoryLogMap
|
||||
inventoryLog.setPreviousStatus(previousStatus);
|
||||
inventoryLog.setChangeType(changeType);
|
||||
inventoryLog.setPreviousErpLocation(previousWarehouse);
|
||||
if (!StringUtil.notEmpty(previousStorageBinBo)) {
|
||||
if (StringUtil.notEmpty(previousStorageBinBo)) {
|
||||
StorageBin storageBinGetById = storageBinService.getById(previousStorageBinBo);
|
||||
if (!StrUtil.isBlank(inventoryLog.getErpLocation())) {
|
||||
if (storageBinGetById != null ) {
|
||||
StorageLocation storageLocation = storageLocationService.getById(storageBinGetById.getStorageLocationBo());
|
||||
if (!StrUtil.isBlank(inventoryLog.getErpLocation())){
|
||||
if (storageLocation != null) {
|
||||
inventoryLog.setPreviousErpLocation(HandleBoProcessor.trimHandle(storageLocation.getWarehouseBo()));
|
||||
inventoryLog.setPreviousStorageLocationBo(storageLocation.getHandle());
|
||||
|
||||
inventoryLog.setPreviousStorageBinBo(previousStorageBinBo);
|
||||
}
|
||||
}
|
||||
inventoryLog.setPreviousStorageBinBo(previousStorageBinBo);
|
||||
}
|
||||
inventoryLog.setErpLocation(inventory.getErpStorageLocation());
|
||||
if (!StringUtil.notEmpty(currentStorageBinBo)) {
|
||||
if (StringUtil.notEmpty(currentStorageBinBo)) {
|
||||
StorageBin storageBinGetById = storageBinService.getById(currentStorageBinBo);
|
||||
if (!StrUtil.isBlank(inventoryLog.getErpLocation())) {
|
||||
if (storageBinGetById != null) {
|
||||
StorageLocation storageLocation = storageLocationService.getById(storageBinGetById.getStorageLocationBo());
|
||||
inventoryLog.setErpLocation(HandleBoProcessor.trimHandle(storageLocation.getWarehouseBo()));
|
||||
inventoryLog.setStorageLocationBo(storageLocation.getHandle());
|
||||
if (storageLocation != null) {
|
||||
inventoryLog.setErpLocation(HandleBoProcessor.trimHandle(storageLocation.getWarehouseBo()));
|
||||
inventoryLog.setStorageLocationBo(storageLocation.getHandle());
|
||||
}
|
||||
}
|
||||
inventoryLog.setStorageBinBo(currentStorageBinBo);
|
||||
}
|
||||
|
||||
inventoryLog.setPreviousQty(previousQty);
|
||||
inventoryLog.setStatus(inventory.getStatus());
|
||||
inventoryLog.setBatchNo(inventory.getBatchNo() == null ? null : inventory.getBatchNo());
|
||||
|
||||
@ -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<DocumentDetailed> {
|
||||
IPage<DocumentSummaryReportDto> selectDocumentSummary(IPage iPage, @Param("site") String site, @Param("documentNoList") List<String> documentNoList, @Param("externalDocumentNoList") List<String> externalDocumentNoList, @Param("documentTypeList") List<String> documentTypeList, @Param("stateList") List<String> stateList, @Param("createUserList") List<String> createUserList, @Param("updateUserList") List<String> updateUserList, @Param("itemList") List<String> itemList, @Param("sourceWarehouseList") List<String> sourceWarehouseList, @Param("targetWarehouseList") List<String> targetWarehouseList, @Param("salesBatchList") List<String> salesBatchList, @Param("iqcResultsList") List<String> iqcResultsList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime3, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2);
|
||||
|
||||
List<DocumentSummaryReportDto> selectDocumentSummary(@Param("site") String site, @Param("documentNoList") List<String> documentNoList, @Param("externalDocumentNoList") List<String> externalDocumentNoList, @Param("documentTypeList") List<String> documentTypeList, @Param("stateList") List<String> stateList, @Param("createUserList") List<String> createUserList, @Param("updateUserList") List<String> updateUserList, @Param("itemList") List<String> itemList, @Param("sourceWarehouseList") List<String> sourceWarehouseList, @Param("targetWarehouseList") List<String> targetWarehouseList, @Param("salesBatchList") List<String> salesBatchList, @Param("iqcResultsList") List<String> iqcResultsList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime3, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2);
|
||||
|
||||
IPage<WareHouse> findAllSourceWarehouse(IPage<WareHouse> iPage, @Param("site") String site, @Param("searchText") String searchText);
|
||||
|
||||
IPage<WareHouse> findAllTargetWarehouse(IPage<WareHouse> iPage, @Param("site") String site, @Param("searchText") String searchText);
|
||||
|
||||
IPage<DocumentDetailReportDto> selectDocumentDetail(IPage iPage
|
||||
, @Param("site") String site
|
||||
, @Param("documentNoList") List<String> documentNoList
|
||||
, @Param("externalDocumentNoList") List<String> externalDocumentNoList
|
||||
, @Param("documentTypeList") List<String> documentTypeList
|
||||
, @Param("stateList") List<String> stateList
|
||||
, @Param("palletList") List<String> palletList
|
||||
, @Param("inventoryIdList") List<String> inventoryIdList
|
||||
, @Param("salesBatchList") List<String> salesBatchList
|
||||
, @Param("itemList") List<String> itemList
|
||||
, @Param("inspectionOrderNoList") List<String> inspectionOrderNoList
|
||||
, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList
|
||||
, @Param("batchNumberList") List<String> batchNumberList
|
||||
, @Param("vendorBatchList") List<String> vendorBatchList
|
||||
, @Param("sourceWarehouseList") List<String> sourceWarehouseList
|
||||
, @Param("sourceLocationList") List<String> sourceLocationList
|
||||
, @Param("storageBinList") List<String> storageBinList
|
||||
, @Param("targetWarehouseList") List<String> targetWarehouseList
|
||||
, @Param("targetLocationList") List<String> targetLocationList
|
||||
, @Param("targetBinList") List<String> targetBinList
|
||||
, @Param("createUserList") List<String> createUserList
|
||||
, @Param("createDateTimeFrom") LocalDateTime createDateTimeFrom
|
||||
, @Param("createDateTimeTo") LocalDateTime createDateTimeTo
|
||||
, @Param("updateUserList") List<String> updateUserList
|
||||
, @Param("modifyDateTimeFrom") LocalDateTime modifyDateTimeFrom
|
||||
, @Param("modifyDateTimeTo") LocalDateTime modifyDateTimeTo
|
||||
, @Param("iqcResultsList") List<String> iqcResultsList);
|
||||
|
||||
List<DocumentDetailReportDto> selectDocumentDetail(
|
||||
@Param("site") String site
|
||||
, @Param("documentNoList") List<String> documentNoList
|
||||
, @Param("externalDocumentNoList") List<String> externalDocumentNoList
|
||||
, @Param("documentTypeList") List<String> documentTypeList
|
||||
, @Param("stateList") List<String> stateList
|
||||
, @Param("palletList") List<String> palletList
|
||||
, @Param("inventoryIdList") List<String> inventoryIdList
|
||||
, @Param("salesBatchList") List<String> salesBatchList
|
||||
, @Param("itemList") List<String> itemList
|
||||
, @Param("inspectionOrderNoList") List<String> inspectionOrderNoList
|
||||
, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList
|
||||
, @Param("batchNumberList") List<String> batchNumberList
|
||||
, @Param("vendorBatchList") List<String> vendorBatchList
|
||||
, @Param("sourceWarehouseList") List<String> sourceWarehouseList
|
||||
, @Param("sourceLocationList") List<String> sourceLocationList
|
||||
, @Param("storageBinList") List<String> storageBinList
|
||||
, @Param("targetWarehouseList") List<String> targetWarehouseList
|
||||
, @Param("targetLocationList") List<String> targetLocationList
|
||||
, @Param("targetBinList") List<String> targetBinList
|
||||
, @Param("createUserList") List<String> createUserList
|
||||
, @Param("createDateTimeFrom") LocalDateTime createDateTimeFrom
|
||||
, @Param("createDateTimeTo") LocalDateTime createDateTimeTo
|
||||
, @Param("updateUserList") List<String> updateUserList
|
||||
, @Param("modifyDateTimeFrom") LocalDateTime modifyDateTimeFrom
|
||||
, @Param("modifyDateTimeTo") LocalDateTime modifyDateTimeTo
|
||||
, @Param("iqcResultsList") List<String> iqcResultsList);
|
||||
}
|
||||
@ -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<DocumentDetailed> {
|
||||
IPage<DocumentSummaryReportDto> retrieve(IPage<DocumentSummaryReportDto> iPage, @Param("site") String site, @Param("documentNoList") List<String> documentNoList, @Param("externalDocumentNoList") List<String> externalDocumentNoList, @Param("documentTypeList") List<String> documentTypeList, @Param("seqStateList") List<String> seqStateList, @Param("createUserList") List<String> createUserList, @Param("modifyUserList") List<String> modifyUserList, @Param("itemList") List<String> itemList, @Param("sourceWarehouseList") List<String> sourceWarehouseList, @Param("targetWarehouseList") List<String> targetWarehouseList, @Param("oaProjectCodeList") List<String> oaProjectCodeList, @Param("salesBatchList") List<String> salesBatchList, @Param("iqcResultsList") List<String> iqcResultsList, @Param("oqcResultsList") List<String> oqcResultsList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime3, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2, @Param("itemGroupList") List<String> itemGroupList);
|
||||
|
||||
List<DocumentSummaryReportDto> retrieve(@Param("site") String site, @Param("documentNoList") List<String> documentNoList, @Param("externalDocumentNoList") List<String> externalDocumentNoList, @Param("documentTypeList") List<String> documentTypeList, @Param("seqStateList") List<String> seqStateList, @Param("createUserList") List<String> createUserList, @Param("modifyUserList") List<String> modifyUserList, @Param("itemList") List<String> itemList, @Param("sourceWarehouseList") List<String> sourceWarehouseList, @Param("targetWarehouseList") List<String> targetWarehouseList, @Param("oaProjectCodeList") List<String> oaProjectCodeList, @Param("salesBatchList") List<String> salesBatchList, @Param("iqcResultsList") List<String> iqcResultsList, @Param("oqcResultsList") List<String> oqcResultsList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime2, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2, @Param("itemGroupList") List<String> itemGroupList);
|
||||
|
||||
IPage<DocumentSummaryReportDto> findAllSourceWarehouse(IPage<DocumentSummaryReportDto> iPage, @Param("searchText") String searchText);
|
||||
|
||||
IPage<DocumentSummaryReportDto> findAllTargetWarehouse(IPage<DocumentSummaryReportDto> iPage, @Param("searchText") String searchText);
|
||||
|
||||
IPage<DocumentSummaryReportDto> doDocumentRetrieve(IPage<DocumentSummaryReportDto> iPage, @Param("site") String site, @Param("documentNoList") List<String> documentNoList, @Param("externalDocumentNoList") List<String> externalDocumentNoList, @Param("documentTypeList") List<String> documentTypeList, @Param("seqStateList") List<String> seqStateList, @Param("palletList") List<String> palletList, @Param("boxList") List<String> boxList, @Param("inventoryIdList") List<String> inventoryIdList, @Param("oaProjectCodeList") List<String> oaProjectCodeList, @Param("salesBatchList") List<String> salesBatchList, @Param("iqcResultsList") List<String> iqcResultsList, @Param("oqcResultsList") List<String> oqcResultsList, @Param("inspectionOrderNoList") List<String> inspectionOrderNoList, @Param("itemList") List<String> itemList, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList, @Param("batchNumberList") List<String> batchNumberList, @Param("vendorBatchList") List<String> vendorBatchList, @Param("sourceWarehouseList") List<String> sourceWarehouseList, @Param("sourceLocationList") List<String> sourceLocationList, @Param("storageBinList") List<String> storageBinList, @Param("targetWarehouseList") List<String> targetWarehouseList, @Param("targetLocationList") List<String> targetLocationList, @Param("targetBinList") List<String> targetBinList, @Param("createUserList") List<String> createUserList, @Param("modifyUserList") List<String> modifyUserList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime2, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2, @Param("mesInventory") String mesInventory, @Param("itemGroupList") List<String> itemGroupList);
|
||||
|
||||
List<DocumentSummaryReportDto> doDocumentRetrieve(@Param("site") String site, @Param("documentNoList") List<String> documentNoList, @Param("externalDocumentNoList") List<String> externalDocumentNoList, @Param("documentTypeList") List<String> documentTypeList, @Param("seqStateList") List<String> seqStateList, @Param("palletList") List<String> palletList, @Param("boxList") List<String> boxList, @Param("inventoryIdList") List<String> inventoryIdList, @Param("oaProjectCodeList") List<String> oaProjectCodeList, @Param("salesBatchList") List<String> salesBatchList, @Param("iqcResultsList") List<String> iqcResultsList, @Param("oqcResultsList") List<String> oqcResultsList, @Param("inspectionOrderNoList") List<String> inspectionOrderNoList, @Param("itemList") List<String> itemList, @Param("qualityInspectionStatusList") List<String> qualityInspectionStatusList, @Param("batchNumberList") List<String> batchNumberList, @Param("vendorBatchList") List<String> vendorBatchList, @Param("sourceWarehouseList") List<String> sourceWarehouseList, @Param("sourceLocationList") List<String> sourceLocationList, @Param("storageBinList") List<String> storageBinList, @Param("targetWarehouseList") List<String> targetWarehouseList, @Param("targetLocationList") List<String> targetLocationList, @Param("targetBinList") List<String> targetBinList, @Param("createUserList") List<String> createUserList, @Param("modifyUserList") List<String> modifyUserList, @Param("createDateTime1") LocalDateTime createDateTime1, @Param("createDateTime2") LocalDateTime createDateTime2, @Param("modifyDateTime1") LocalDateTime modifyDateTime1, @Param("modifyDateTime2") LocalDateTime modifyDateTime2, @Param("mesInventory") String mesInventory, @Param("itemGroupList") List<String> itemGroupList);
|
||||
|
||||
}
|
||||
@ -211,7 +211,7 @@
|
||||
from wip.shop_order so
|
||||
left join wip.custom_fields cf on cf.HANDLE = so.HANDLE and cf.FIELD_NAME = 'SALE_ORDER'
|
||||
left join wip.custom_fields cf2 on cf2.HANDLE = so.HANDLE and cf2.FIELD_NAME = 'SALE_ORDER_LINE'
|
||||
where 1 = 1
|
||||
where so.SITE = #{wipShopOrderDto.site}
|
||||
<if test="wipShopOrderDto.shopOrderBo != null and wipShopOrderDto.shopOrderBo != ''">
|
||||
and so.HANDLE like concat('%', #{wipShopOrderDto.shopOrderBo}, '%');
|
||||
</if>
|
||||
|
||||
422
mom-wms-db/src/main/resources/mapper/DocumentReportMapper.xml
Normal file
422
mom-wms-db/src/main/resources/mapper/DocumentReportMapper.xml
Normal file
@ -0,0 +1,422 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.foreverwin.mom.wms.mapper.DocumentReportMapper">
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="DocumentSummaryReportResultMap" type="com.foreverwin.mom.wms.dto.DocumentSummaryReportDto">
|
||||
<result column="DOCUMENT_NO" property="documentNo"/>
|
||||
<result column="EXTERNAL_DOCUMENT_NO" property="externalDocumentNo"/>
|
||||
<result column="DOCUMENT_TYPE" property="documentType"/>
|
||||
<result column="STATE" property="state"/>
|
||||
<result column="SEQ" property="seq"/>
|
||||
<result column="ITEM" property="item"/>
|
||||
<result column="ITEM_DESCRIPTION" property="itemDescription"/>
|
||||
<result column="BATCH" property="batch"/>
|
||||
<result column="UNIT_OF_MEASURE" property="unitOfMeasure"/>
|
||||
<result column="APPLICATIONS_QUANTITY" property="applicationsQuantity"/>
|
||||
<result column="ACTUAL_QUANTITY" property="actualQuantity"/>
|
||||
<result column="SOURCE_WAREHOUSE" property="sourceWarehouse"/>
|
||||
<result column="TARGET_WAREHOUSE" property="targetWarehouse"/>
|
||||
<result column="REMARKS" property="remarks"/>
|
||||
<result column="SALES_BATCH" property="salesBatch"/>
|
||||
<result column="IQC_RESULTS" property="iqcResults"/>
|
||||
<result column="CREATE_USER" property="createUser"/>
|
||||
<result column="CREATE_USER_NAME" property="createUserName"/>
|
||||
<result column="CREATE_DATE" property="createDate"/>
|
||||
<result column="UPDATE_DATE" property="updateDate"/>
|
||||
<result column="UPDATE_USER" property="updateUser"/>
|
||||
<result column="UPDATE_USER_NAME" property="updateUserName"/>
|
||||
<result column="PALLET_NUM" property="palletNum"/>
|
||||
</resultMap>
|
||||
<select id="selectDocumentSummary" resultMap="DocumentSummaryReportResultMap">
|
||||
WITH A AS (
|
||||
SELECT
|
||||
ZD.SITE ,-- 站点
|
||||
ZD.DOCUMENT_NO ,-- 单据号
|
||||
ZD.EXTERNAL_DOCUMENT_NO ,-- 外部单据号
|
||||
ZD.DOCUMENT_TYPE ,-- 单据类型
|
||||
ZD.STATE ,-- 单据状态
|
||||
ZD.CREATE_USER ,-- 创建人
|
||||
ZD.CREATE_DATE, -- 创建时间
|
||||
ZDD.SEQ ,-- 单据行号
|
||||
ZDD.STATE AS SEQ_STATE,-- 单据行状态
|
||||
ZDD.ITEM ,-- 物料
|
||||
I.DESCRIPTION AS ITEM_DESCRIPTION , -- 物料描述
|
||||
ZDD.BATCH ,-- 需求批次
|
||||
ZDD.UNIT_OF_MEASURE ,-- 单位
|
||||
ZDD.APPLICATIONS_QUANTITY ,-- 需求数量
|
||||
ZDD.ACTUAL_QUANTITY ,-- 实际数量
|
||||
ZDD.SOURCE_WAREHOUSE ,-- 来源仓
|
||||
ZDD.TARGET_WAREHOUSE ,-- 目标仓
|
||||
ZDD.SALES_BATCH ,-- 出货批次
|
||||
ZDD.REMARKS ,-- 备注
|
||||
ZDD.IQC_RESULTS ,-- IQC
|
||||
ZDD.OQC_RESULTS ,-- OQC
|
||||
ZDD.UPDATE_USER ,-- 更新人
|
||||
ZDD.UPDATE_DATE, -- 更新时间
|
||||
IFNULL(USR.NAME, ZD.CREATE_USER) AS CREATE_USER_NAME, -- 创建人名称
|
||||
IFNULL(USR2.NAME, ZD.UPDATE_USER) AS UPDATE_USER_NAME -- 更新人名称
|
||||
ZDD.SALES_ORDER, -- 更新时间
|
||||
ZDD.SALES_ORDER_SEQ, -- 更新时间
|
||||
ZDD.TARGET_SALES_ORDER, -- 更新时间
|
||||
ZDD.TARGET_SALES_ORDER_SEQ, -- 更新时间
|
||||
ZDD.EXTERNAL_SEQ, -- 更新时间
|
||||
SUBSTRING_INDEX(ZDD.SHOP_ORDER_BO, ',', -1) AS SHOP_ORDER, -- 生产订单
|
||||
ZDD.INVENTORY_SPECIAL_MARKING -- 特殊库存标识
|
||||
FROM Z_DOCUMENT ZD
|
||||
INNER JOIN Z_DOCUMENT_DETAILED ZDD ON ZDD.DOCUMENT_BO = ZD.HANDLE
|
||||
INNER JOIN WIP.ITEM I ON I.SITE = ZDD.SITE AND I.ITEM = ZDD.ITEM AND I.CURRENT_REVISION = 'Y'
|
||||
LEFT JOIN MOMX.SYS_USER USR ON USR.USERNAME = ZD.CREATE_USER and USR.TENANT_ID = ZD.SITE
|
||||
LEFT JOIN MOMX.SYS_USER USR2 ON USR2.USERNAME = ZDD.UPDATE_USER and USR2.TENANT_ID = ZDD.SITE
|
||||
WHERE ZD.SITE = #{site}
|
||||
<if test="documentNoList != null and documentNoList.size > 0">
|
||||
AND zd.DOCUMENT_NO IN
|
||||
<foreach collection="documentNoList" item="documentNo" open="(" separator="," close=")">
|
||||
#{documentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="externalDocumentNoList != null and externalDocumentNoList.size > 0">
|
||||
AND zd.EXTERNAL_DOCUMENT_NO IN
|
||||
<foreach collection="externalDocumentNoList" item="externalDocumentNo" open="(" separator="," close=")">
|
||||
#{externalDocumentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="documentTypeList != null and documentTypeList.size > 0">
|
||||
AND zd.DOCUMENT_TYPE IN
|
||||
<foreach collection="documentTypeList" item="documentType" open="(" separator="," close=")">
|
||||
#{documentType}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="stateList != null and stateList.size > 0">
|
||||
AND zd.STATE IN
|
||||
<foreach collection="stateList" item="state" open="(" separator="," close=")">
|
||||
#{state}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createUserList != null and createUserList.size > 0">
|
||||
AND zd.CREATE_USER IN
|
||||
<foreach collection="createUserList" item="createUser" open="(" separator="," close=")">
|
||||
#{createUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="updateUserList != null and updateUserList.size > 0">
|
||||
AND zdd.UPDATE_USER IN
|
||||
<foreach collection="updateUserList" item="updateUser" open="(" separator="," close=")">
|
||||
#{updateUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="itemList != null and itemList.size > 0">
|
||||
AND zdd.ITEM IN
|
||||
<foreach collection="itemList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sourceWarehouseList != null and sourceWarehouseList.size > 0">
|
||||
AND zdd.SOURCE_WAREHOUSE IN
|
||||
<foreach collection="sourceWarehouseList" item="sourceWarehouse" open="(" separator="," close=")">
|
||||
#{sourceWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetWarehouseList != null and targetWarehouseList.size > 0">
|
||||
AND zdd.TARGET_WAREHOUSE IN
|
||||
<foreach collection="targetWarehouseList" item="targetWarehouse" open="(" separator="," close=")">
|
||||
#{targetWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="salesBatchList != null and salesBatchList.size > 0">
|
||||
AND zdd.SALES_BATCH IN
|
||||
<foreach collection="salesBatchList" item="salesBatch" open="(" separator="," close=")">
|
||||
#{salesBatch}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="iqcResultsList != null and iqcResultsList.size > 0">
|
||||
AND ZDD.IQC_RESULTS IN
|
||||
<foreach collection="iqcResultsList" item="iqcResults" open="(" separator="," close=")">
|
||||
#{iqcResults}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createDateTime1!= null">
|
||||
AND zd.CREATE_DATE >= #{createDateTime1}
|
||||
</if>
|
||||
<if test="createDateTime2!= null">
|
||||
AND zd.CREATE_DATE <= #{createDateTime2}
|
||||
</if>
|
||||
<if test="modifyDateTime1!= null">
|
||||
AND zdd.UPDATE_DATE >= #{modifyDateTime1}
|
||||
</if>
|
||||
<if test="modifyDateTime2!= null">
|
||||
AND zdd.UPDATE_DATE <= #{modifyDateTime2}
|
||||
</if>
|
||||
),
|
||||
B AS (
|
||||
SELECT ZDS.SITE, ZDS.DOCUMENT_NO, COUNT(DISTINCT GRADE_ONE_CARRIER) AS PALLET_NUM
|
||||
FROM Z_DOCUMENT_SFC ZDS
|
||||
INNER JOIN A A ON A.SITE = ZDS.SITE AND A.DOCUMENT_NO = ZDS.DOCUMENT_NO AND A.SEQ = ZDS.SEQ
|
||||
GROUP BY ZDS.SITE, ZDS.DOCUMENT_NO
|
||||
)
|
||||
SELECT A.*
|
||||
, IFNULL(B.BOX_NUM, 0) AS BOX_NUM -- 箱数
|
||||
FROM A
|
||||
LEFT JOIN B B ON B.SITE = A.SITE AND B.DOCUMENT_NO = A.DOCUMENT_NO
|
||||
ORDER BY A.DOCUMENT_NO DESC
|
||||
</select>
|
||||
|
||||
<resultMap id="DocumentDetailReportResultMap" type="com.foreverwin.mom.wms.dto.DocumentDetailReportDto">
|
||||
<result column="DOCUMENT_NO" property="documentNo"/>
|
||||
<result column="EXTERNAL_DOCUMENT_NO" property="externalDocumentNo"/>
|
||||
<result column="DOCUMENT_TYPE" property="documentType"/>
|
||||
<result column="STATE" property="state"/>
|
||||
<result column="SEQ" property="seq"/>
|
||||
<result column="APPLICATIONS_QUANTITY" property="applicationsQuantity"/>
|
||||
<result column="ACTUAL_QUANTITY" property="actualQuantity"/>
|
||||
<result column="REMARKS" property="remarks"/>
|
||||
<result column="IQC_RESULTS" property="iqcResults"/>
|
||||
<result column="INSPECTION_ORDER_NO" property="inspectionOrderNo"/>
|
||||
<result column="PALLET" property="pallet"/>
|
||||
<result column="INVENTORY_ID" property="inventoryId"/>
|
||||
<result column="ITEM" property="item"/>
|
||||
<result column="ITEM_DESCRIPTION" property="itemDescription"/>
|
||||
<result column="QTY" property="qty"/>
|
||||
<result column="UNIT_OF_MEASURE" property="unitOfMeasure"/>
|
||||
<result column="QUALITY_INSPECTION_STATUS" property="qualityInspectionStatus"/>
|
||||
<result column="BATCH" property="batch"/>
|
||||
<result column="SALES_BATCH" property="salesBatch"/>
|
||||
<result column="DELIVERY_PARTY" property="deliveryParty"/>
|
||||
<result column="VENDOR_BATCH" property="vendorBatch"/>
|
||||
<result column="BATCH_NUMBER" property="batchNumber"/>
|
||||
<result column="STANDARD_LENGTH" property="standardLength"/>
|
||||
<result column="LENGTH" property="length"/>
|
||||
<result column="WIDTH" property="width"/>
|
||||
<result column="BISMT" property="bismt"/>
|
||||
<result column="SOURCE_WAREHOUSE" property="sourceWarehouse"/>
|
||||
<result column="SOURCE_LOCATION" property="sourceLocation"/>
|
||||
<result column="STORAGE_BIN" property="storageBin"/>
|
||||
<result column="TARGET_WAREHOUSE" property="targetWarehouse"/>
|
||||
<result column="TARGET_LOCATION" property="targetLocation"/>
|
||||
<result column="TARGET_BIN" property="targetBin"/>
|
||||
<result column="CREATE_USER" property="createUser"/>
|
||||
<result column="CREATE_USER_NAME" property="createUserName"/>
|
||||
<result column="CREATE_DATE" property="createDate"/>
|
||||
<result column="UPDATE_DATE" property="updateDate"/>
|
||||
<result column="UPDATE_USER" property="updateUser"/>
|
||||
<result column="UPDATE_USER_NAME" property="updateUserName"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectDocumentDetail" resultMap="DocumentDetailReportResultMap">
|
||||
SELECT ZD.DOCUMENT_NO
|
||||
, ZD.EXTERNAL_DOCUMENT_NO
|
||||
, ZD.DOCUMENT_TYPE
|
||||
, ZD.STATE
|
||||
, ZDD.SEQ
|
||||
, ZDD.APPLICATIONS_QUANTITY
|
||||
, ZDD.ACTUAL_QUANTITY
|
||||
, ZDD.REMARKS
|
||||
, ZDD.IQC_RESULTS
|
||||
, ZDD.INSPECTION_ORDER_NO
|
||||
, ZDS.GRADE_ONE_CARRIER AS PALLET
|
||||
, ZDS.SFC INVENTORY_ID
|
||||
, ZDS.ITEM
|
||||
, I.DESCRIPTION AS ITEM_DESCRIPTION
|
||||
, ZDS.QTY
|
||||
, ZDD.UNIT_OF_MEASURE
|
||||
, ZDS.QUALITY_INSPECTION_STATUS
|
||||
, ZDD.BATCH
|
||||
, ZDD.SALES_BATCH
|
||||
, WDO.DELIVERY_PARTY
|
||||
, ZDS.BATCH_NUMBER
|
||||
, ZDS.VENDOR_BATCH
|
||||
, WI.STANDARD_LENGTH
|
||||
, WI.`LENGTH`
|
||||
, WI.WIDTH
|
||||
, WI.BISMT
|
||||
, ZDS.SOURCE_WAREHOUSE
|
||||
, ZDS.SOURCE_LOCATION
|
||||
, ZDS.STORAGE_BIN
|
||||
, ZDS.TARGET_WAREHOUSE
|
||||
, ZDS.TARGET_LOCATION
|
||||
, ZDS.TARGET_BIN
|
||||
, ZD.CREATE_USER
|
||||
, IFNULL(USR.NAME, ZD.CREATE_USER) AS CREATE_USER_NAME
|
||||
, ZD.CREATE_DATE
|
||||
, ZDD.UPDATE_USER
|
||||
, IFNULL(USR2.NAME, ZD.UPDATE_USER) AS UPDATE_USER_NAME
|
||||
, ZDD.UPDATE_DATE
|
||||
FROM Z_DOCUMENT ZD
|
||||
LEFT JOIN WMS_DN_ORDER WDO ON WDO.SITE =ZD.SITE AND WDO.DN_NUMBER = ZD.EXTERNAL_DOCUMENT_NO
|
||||
LEFT JOIN Z_DOCUMENT_DETAILED ZDD ON ZD.DOCUMENT_NO = ZDD.DOCUMENT_NO AND ZDD.SITE = ZD.SITE
|
||||
LEFT JOIN Z_DOCUMENT_SFC ZDS ON ZDD.DOCUMENT_NO = ZDS.DOCUMENT_NO AND ZDD.SEQ = ZDS.SEQ AND ZDS.SITE = ZDD.SITE
|
||||
LEFT JOIN MOMX.SYS_USER USR ON USR.USERNAME = ZD.CREATE_USER and USR.TENANT_ID = ZD.SITE
|
||||
LEFT JOIN MOMX.SYS_USER USR2 ON USR2.USERNAME = ZDD.UPDATE_USER and USR2.TENANT_ID = ZDD.SITE
|
||||
LEFT JOIN WMS_INVENTORY WI ON WI.SITE = ZDS.SITE AND WI.INVENTORY_ID = ZDS.SFC
|
||||
LEFT JOIN WIP.ITEM I ON I.SITE = ZDS.SITE AND I.ITEM = ZDS.ITEM AND I.CURRENT_REVISION = 'Y'
|
||||
WHERE ZD.SITE = #{site}
|
||||
<if test="documentNoList != null and documentNoList.size > 0">
|
||||
AND ZD.DOCUMENT_NO IN
|
||||
<foreach collection="documentNoList" item="documentNo" open="(" separator="," close=")">
|
||||
#{documentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="externalDocumentNoList != null and externalDocumentNoList.size > 0">
|
||||
AND ZD.EXTERNAL_DOCUMENT_NO IN
|
||||
<foreach collection="externalDocumentNoList" item="externalDocumentNo" open="(" separator="," close=")">
|
||||
#{externalDocumentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="documentTypeList != null and documentTypeList.size > 0">
|
||||
AND ZD.DOCUMENT_TYPE IN
|
||||
<foreach collection="documentTypeList" item="documentType" open="(" separator="," close=")">
|
||||
#{documentType}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="stateList != null and stateList.size > 0">
|
||||
AND ZD.STATE IN
|
||||
<foreach collection="stateList" item="state" open="(" separator="," close=")">
|
||||
#{state}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="palletList != null and palletList.size > 0">
|
||||
AND ZDS.GRADE_ONE_CARRIER IN
|
||||
<foreach collection="palletList" item="pallet" open="(" separator="," close=")">
|
||||
#{pallet}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="inventoryIdList != null and inventoryIdList.size > 0">
|
||||
AND ZDS.SFC IN
|
||||
<foreach collection="inventoryIdList" item="inventoryId" open="(" separator="," close=")">
|
||||
#{inventoryId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="salesBatchList != null and salesBatchList.size > 0">
|
||||
AND ZDD.SALES_BATCH IN
|
||||
<foreach collection="salesBatchList" item="salesBatch" open="(" separator="," close=")">
|
||||
#{salesBatch}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="itemList != null and itemList.size > 0">
|
||||
AND ZDS.ITEM IN
|
||||
<foreach collection="itemList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="inspectionOrderNoList != null and inspectionOrderNoList.size > 0">
|
||||
AND ZDD.INSPECTION_ORDER_NO IN
|
||||
<foreach collection="inspectionOrderNoList" item="inspectionOrderNo" open="(" separator="," close=")">
|
||||
#{inspectionOrderNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="qualityInspectionStatusList != null and qualityInspectionStatusList.size > 0">
|
||||
AND ZDS.QUALITY_INSPECTION_STATUS IN
|
||||
<foreach collection="qualityInspectionStatusList" item="qualityInspectionStatus" open="(" separator=","
|
||||
close=")">
|
||||
#{qualityInspectionStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="batchNumberList != null and batchNumberList.size > 0">
|
||||
AND ZDS.BATCH_NUMBER IN
|
||||
<foreach collection="batchNumberList" item="batchNumber" open="(" separator="," close=")">
|
||||
#{batchNumber}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="vendorBatchList != null and vendorBatchList.size > 0">
|
||||
AND ZDS.VENDOR_BATCH IN
|
||||
<foreach collection="vendorBatchList" item="vendorBatch" open="(" separator="," close=")">
|
||||
#{vendorBatch}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sourceWarehouseList != null and sourceWarehouseList.size > 0">
|
||||
AND ZDS.SOURCE_WAREHOUSE IN
|
||||
<foreach collection="sourceWarehouseList" item="sourceWarehouse" open="(" separator="," close=")">
|
||||
#{sourceWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sourceLocationList != null and sourceLocationList.size > 0">
|
||||
AND ZDS.SOURCE_LOCATION IN
|
||||
<foreach collection="sourceLocationList" item="sourceLocation" open="(" separator="," close=")">
|
||||
#{sourceLocation}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="storageBinList != null and storageBinList.size > 0">
|
||||
AND ZDS.STORAGE_BIN IN
|
||||
<foreach collection="storageBinList" item="storageBin" open="(" separator="," close=")">
|
||||
#{storageBin}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetWarehouseList != null and targetWarehouseList.size > 0">
|
||||
AND ZDS.TARGET_WAREHOUSE IN
|
||||
<foreach collection="targetWarehouseList" item="targetWarehouse" open="(" separator="," close=")">
|
||||
#{targetWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetLocationList != null and targetLocationList.size > 0">
|
||||
AND ZDS.TARGET_LOCATION IN
|
||||
<foreach collection="targetLocationList" item="targetLocation" open="(" separator="," close=")">
|
||||
#{targetLocation}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetBinList != null and targetBinList.size > 0">
|
||||
AND ZDS.TARGET_BIN IN
|
||||
<foreach collection="targetBinList" item="targetBin" open="(" separator="," close=")">
|
||||
#{targetBin}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createUserList != null and createUserList.size > 0">
|
||||
AND ZD.CREATE_USER IN
|
||||
<foreach collection="createUserList" item="createUser" open="(" separator="," close=")">
|
||||
#{createUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="updateUserList != null and updateUserList.size > 0">
|
||||
AND ZDD.UPDATE_USER IN
|
||||
<foreach collection="updateUserList" item="updateUser" open="(" separator="," close=")">
|
||||
#{updateUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createDateTimeFrom!= null">
|
||||
AND ZD.CREATE_DATE >= #{createDateTimeFrom}
|
||||
</if>
|
||||
<if test="createDateTimeTo!= null">
|
||||
AND ZD.CREATE_DATE <= #{createDateTimeTo}
|
||||
</if>
|
||||
<if test="modifyDateTimeFrom!= null">
|
||||
AND ZDD.UPDATE_DATE >= #{modifyDateTimeFrom}
|
||||
</if>
|
||||
<if test="modifyDateTimeTo!= null">
|
||||
AND ZDD.UPDATE_DATE <= #{modifyDateTimeTo}
|
||||
</if>
|
||||
<if test="iqcResultsList != null and iqcResultsList.size > 0">
|
||||
AND ZDD.IQC_RESULTS IN
|
||||
<foreach collection="iqcResultsList" item="iqcResults" open="(" separator="," close=")">
|
||||
#{iqcResults}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY ZD.DOCUMENT_NO DESC, ZDS.GRADE_ONE_CARRIER ASC,ZDS.GRADE_TWO_CARRIER ASC;
|
||||
</select>
|
||||
|
||||
<select id="findAllSourceWarehouse" resultMap="com.foreverwin.mom.wms.mapper.WareHouseMapper.wmsWarehouseMap">
|
||||
SELECT DISTINCT WW.WAREHOUSE, WW.DESCRIPTION
|
||||
FROM Z_DOCUMENT_DETAILED ZDD
|
||||
INNER JOIN WMS_WAREHOUSE WW ON ZDD.SOURCE_WAREHOUSE = WW.STORAGE_LOCATION AND ZDD.SITE = WW.SITE
|
||||
<where>
|
||||
ZDD.SITE = #{SITE} AND ZDD.SOURCE_WAREHOUSE IS NOT NULL
|
||||
<if test="searchText!= '' and searchText != null">
|
||||
AND ZDD.SOURCE_WAREHOUSE LIKE CONCAT('%',#{searchText},'%') OR WW.DESCRIPTION LIKE
|
||||
CONCAT('%',#{searchText},'%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ZDD.SOURCE_WAREHOUSE ASC
|
||||
</select>
|
||||
<select id="findAllTargetWarehouse" resultMap="com.foreverwin.mom.wms.mapper.WareHouseMapper.wmsWarehouseMap">
|
||||
SELECT DISTINCT WW.WAREHOUSE, WW.DESCRIPTION
|
||||
FROM Z_DOCUMENT_DETAILED ZDD
|
||||
INNER JOIN WMS_WAREHOUSE WW ON ZDD.TARGET_WAREHOUSE = WW.STORAGE_LOCATION AND ZDD.SITE = WW.SITE
|
||||
<where>
|
||||
ZDD.SITE = #{SITE} AND ZDD.TARGET_WAREHOUSE IS NOT NULL
|
||||
<if test="searchText!= '' and searchText != null">
|
||||
AND ZDD.TARGET_WAREHOUSE LIKE CONCAT('%',#{searchText},'%') OR WW.DESCRIPTION LIKE
|
||||
CONCAT('%',#{searchText},'%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ZDD.TARGET_WAREHOUSE ASC
|
||||
</select>
|
||||
</mapper>
|
||||
@ -1,469 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.foreverwin.mom.wms.mapper.DocumentSummaryReportMapper">
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mom.wms.dto.DocumentSummaryReportDto">
|
||||
<result column="DOCUMENT_NO" property="documentNo" />
|
||||
<result column="EXTERNAL_DOCUMENT_NO" property="externalDocumentNo" />
|
||||
<result column="DOCUMENT_TYPE" property="documentType" />
|
||||
<result column="STATE" property="state" />
|
||||
<result column="CREATE_USER" property="createUser" />
|
||||
<result column="CREATE_DATE_TIME" property="createDateTime" />
|
||||
<result column="SEQ" property="seq" />
|
||||
<result column="SEQ_STATE" property="seqState" />
|
||||
<result column="ITEM" property="item" />
|
||||
<result column="ITEM_DESCRIPTION" property="itemDescription" />
|
||||
<result column="BATCH" property="batch" />
|
||||
<result column="UNIT_OF_MEASURE" property="unitOfMeasure" />
|
||||
<result column="APPLICATIONS_QUANTITY" property="applicationsQuantity" />
|
||||
<result column="ACTUAL_QUANTITY" property="actualQuantity" />
|
||||
<result column="SOURCE_WAREHOUSE" property="sourceWarehouse" />
|
||||
<result column="TARGET_WAREHOUSE" property="targetWarehouse" />
|
||||
<result column="OA_PROJECT_CODE" property="oaProjectCode" />
|
||||
<result column="OA_PROJECT_DESC" property="oaProjectDesc" />
|
||||
<result column="SALES_BATCH" property="salesBatch" />
|
||||
<result column="REMARKS" property="remarks" />
|
||||
<result column="IQC_RESULTS" property="iqcResults" />
|
||||
<result column="OQC_RESULTS" property="oqcResults" />
|
||||
<result column="MODIFY_DATE_TIME" property="modifyDateTime" />
|
||||
<result column="MODIFY_USER" property="modifyUser" />
|
||||
<result column="INVENTORY_ID" property="inventoryId" />
|
||||
<result column="CARRIER" property="carrier" />
|
||||
<result column="PALLET" property="pallet" />
|
||||
<result column="BOX" property="box" />
|
||||
<result column="INSPECTION_ORDER_NO" property="inspectionOrderNo" />
|
||||
<result column="MES_INVENTORY" property="mesInventory" />
|
||||
<result column="DESCRIPTION" property="description" />
|
||||
<result column="MODIFY_USER_NAME" property="modifyUserName" />
|
||||
<result column="CREATE_USER_NAME" property="createUserName" />
|
||||
<result column="GROES" property="groes" />
|
||||
<result column="BISMT" property="bismt" />
|
||||
<result column="WIDTH" property="width" />
|
||||
<result column="LENGTH" property="length" />
|
||||
<result column="STANDARD_LENGTH" property="standardLength" />
|
||||
<result column="PALLET_NUM" property="palletNum" />
|
||||
<result column="BOX_NUM" property="boxNum" />
|
||||
<result column="ITEM_GROUP" property="itemGroup" />
|
||||
<result column="DELIVERY_PARTY" property="deliveryParty" />
|
||||
</resultMap>
|
||||
<select id="retrieve" resultMap="BaseResultMap">
|
||||
WITH A AS (
|
||||
SELECT
|
||||
ZD.SITE ,-- 站点
|
||||
ZD.DOCUMENT_NO ,-- 单据号
|
||||
ZD.EXTERNAL_DOCUMENT_NO ,-- 外部单据号
|
||||
ZD.DOCUMENT_TYPE ,-- 单据类型
|
||||
ZD.STATE ,-- 单据状态
|
||||
ZD.CREATE_USER ,-- 创建人
|
||||
ZD.CREATE_DATE_TIME, -- 创建时间
|
||||
ZDD.SEQ ,-- 单据行号
|
||||
ZDD.STATE AS SEQ_STATE,-- 单据行状态
|
||||
ZDD.ITEM ,-- 物料
|
||||
I.DESCRIPTION AS ITEM_DESCRIPTION , -- 物料描述
|
||||
IG.DESCRIPTION AS ITEM_GROUP, -- 物料组
|
||||
ZDD.BATCH ,-- 需求批次
|
||||
ZDD.UNIT_OF_MEASURE ,-- 单位
|
||||
ZDD.APPLICATIONS_QUANTITY ,-- 需求数量
|
||||
ZDD.ACTUAL_QUANTITY ,-- 实际数量
|
||||
ZDD.SOURCE_WAREHOUSE ,-- 来源仓
|
||||
ZDD.TARGET_WAREHOUSE ,-- 目标仓
|
||||
ZDD.OA_PROJECT_CODE ,-- 项目编号
|
||||
ZDD.OA_PROJECT_DESC ,-- 项目名称
|
||||
ZDD.SALES_BATCH ,-- 出货批次
|
||||
ZDD.REMARKS ,-- 备注
|
||||
ZDD.IQC_RESULTS ,-- IQC
|
||||
ZDD.OQC_RESULTS ,-- OQC
|
||||
ZDD.MODIFY_USER ,-- 更新人
|
||||
ZDD.MODIFY_DATE_TIME, -- 更新时间
|
||||
IFNULL(USR.NAME, ZD.CREATE_USER) AS CREATE_USER_NAME, -- 创建人名称
|
||||
IFNULL(USR2.NAME, ZD.MODIFY_USER) AS MODIFY_USER_NAME, -- 更新人名称
|
||||
CF.FIELD_VALUE AS GROES, -- 规格型号
|
||||
CF2.FIELD_VALUE AS BISMT -- 厚度
|
||||
FROM Z_DOCUMENT ZD
|
||||
INNER JOIN Z_DOCUMENT_DETAILED ZDD ON ZD.DOCUMENT_NO = ZDD.DOCUMENT_NO
|
||||
INNER JOIN ITEM I ON I.SITE = ZDD.SITE AND I.ITEM = ZDD.ITEM AND I.CURRENT_REVISION = 'Y'
|
||||
INNER JOIN ITEM_GROUP_MEMBER IGM ON IGM.ITEM_BO = I.HANDLE
|
||||
INNER JOIN ITEM_GROUP IG ON IG.HANDLE = IGM.ITEM_GROUP_BO
|
||||
LEFT JOIN USR USR ON USR.SITE = ZD.SITE AND USR.USERNAME = ZD.CREATE_USER
|
||||
LEFT JOIN USR USR2 ON USR2.SITE = ZDD.SITE AND USR2.USERNAME = ZDD.MODIFY_USER
|
||||
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = I.HANDLE AND CF.FIELD_NAME = 'GROES'
|
||||
LEFT JOIN CUSTOM_FIELDS CF2 ON CF2.HANDLE = I.HANDLE AND CF2.FIELD_NAME = 'BISMT'
|
||||
WHERE ZD.SITE = #{site}
|
||||
<if test="documentNoList != null">
|
||||
AND zd.DOCUMENT_NO IN
|
||||
<foreach collection="documentNoList" item="documentNo" open="(" separator="," close=")">
|
||||
#{documentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="externalDocumentNoList != null">
|
||||
AND zd.EXTERNAL_DOCUMENT_NO IN
|
||||
<foreach collection="externalDocumentNoList" item="externalDocumentNo" open="(" separator="," close=")">
|
||||
#{externalDocumentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="documentTypeList != null">
|
||||
AND zd.DOCUMENT_TYPE IN
|
||||
<foreach collection="documentTypeList" item="documentType" open="(" separator="," close=")">
|
||||
#{documentType}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="seqStateList != null">
|
||||
AND zdd.STATE IN
|
||||
<foreach collection="seqStateList" item="seqState" open="(" separator="," close=")">
|
||||
#{seqState}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createUserList != null ">
|
||||
AND zd.CREATE_USER IN
|
||||
<foreach collection="createUserList" item="createUser" open="(" separator="," close=")">
|
||||
#{createUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="modifyUserList != null ">
|
||||
AND zdd.MODIFY_USER IN
|
||||
<foreach collection="modifyUserList" item="modifyUser" open="(" separator="," close=")">
|
||||
#{modifyUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="itemList != null">
|
||||
AND zdd.ITEM IN
|
||||
<foreach collection="itemList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="itemGroupList != null">
|
||||
AND IG.ITEM_GROUP IN
|
||||
<foreach collection="itemGroupList" item="itemGroup" open="(" separator="," close=")">
|
||||
#{itemGroup}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sourceWarehouseList != null">
|
||||
AND zdd.SOURCE_WAREHOUSE IN
|
||||
<foreach collection="sourceWarehouseList" item="sourceWarehouse" open="(" separator="," close=")">
|
||||
#{sourceWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetWarehouseList != null">
|
||||
AND zdd.TARGET_WAREHOUSE IN
|
||||
<foreach collection="targetWarehouseList" item="targetWarehouse" open="(" separator="," close=")">
|
||||
#{targetWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="oaProjectCodeList != null">
|
||||
AND ZDD.OA_PROJECT_CODE IN
|
||||
<foreach collection="oaProjectCodeList" item="oaProjectCode" open="(" separator="," close=")">
|
||||
#{oaProjectCode}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="salesBatchList != null">
|
||||
AND zdd.SALES_BATCH IN
|
||||
<foreach collection="salesBatchList" item="salesBatch" open="(" separator="," close=")">
|
||||
#{salesBatch}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="iqcResultsList != null">
|
||||
AND ZDD.IQC_RESULTS IN
|
||||
<foreach collection="iqcResultsList" item="iqcResults" open="(" separator="," close=")">
|
||||
#{iqcResults}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="oqcResultsList != null">
|
||||
AND ZDD.OQC_RESULTS IN
|
||||
<foreach collection="oqcResultsList" item="oqcResults" open="(" separator="," close=")">
|
||||
#{oqcResults}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createDateTime1!= null">
|
||||
AND zd.CREATE_DATE_TIME >= #{createDateTime1}
|
||||
</if>
|
||||
<if test="createDateTime2!= null">
|
||||
AND zd.CREATE_DATE_TIME <= #{createDateTime2}
|
||||
</if>
|
||||
<if test="modifyDateTime1!= null">
|
||||
AND zdd.MODIFY_DATE_TIME >= #{modifyDateTime1}
|
||||
</if>
|
||||
<if test="modifyDateTime2!= null">
|
||||
AND zdd.MODIFY_DATE_TIME <= #{modifyDateTime2}
|
||||
</if>
|
||||
),
|
||||
B AS (
|
||||
SELECT ZDS.SITE, ZDS.DOCUMENT_NO, COUNT(DISTINCT ZDS.GRADE_ONE_CARRIER) AS PALLET_NUM, COUNT(DISTINCT GRADE_TWO_CARRIER) AS BOX_NUM
|
||||
FROM Z_DOCUMENT_SFC ZDS
|
||||
INNER JOIN A A ON A.SITE = ZDS.SITE AND A.DOCUMENT_NO = ZDS.DOCUMENT_NO AND A.SEQ = ZDS.SEQ
|
||||
GROUP BY ZDS.SITE, ZDS.DOCUMENT_NO
|
||||
)
|
||||
SELECT A.*
|
||||
, IFNULL(B.PALLET_NUM, 0) AS PALLET_NUM -- 托数
|
||||
, IFNULL(B.BOX_NUM, 0) AS BOX_NUM -- 箱数
|
||||
FROM A
|
||||
LEFT JOIN B B ON B.SITE = A.SITE AND B.DOCUMENT_NO = A.DOCUMENT_NO
|
||||
ORDER BY A.DOCUMENT_NO DESC
|
||||
</select>
|
||||
<select id="findAllSourceWarehouse" resultMap="BaseResultMap">
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT DISTINCT zdd.SOURCE_WAREHOUSE,sl.DESCRIPTION
|
||||
from z_document_detailed zdd
|
||||
inner join storage_location sl on zdd.SOURCE_WAREHOUSE = sl.STORAGE_LOCATION
|
||||
WHERE zdd.SOURCE_WAREHOUSE IS NOT NULL
|
||||
union all
|
||||
select DISTINCT zdd.SOURCE_WAREHOUSE ,cc.DESCRIPTION
|
||||
from z_document_detailed zdd
|
||||
inner join cost_center cc on zdd.SOURCE_WAREHOUSE = cc.COST_CENTER
|
||||
WHERE zdd.SOURCE_WAREHOUSE IS NOT NULL
|
||||
) AS X
|
||||
<where>
|
||||
<if test="searchText!= '' and searchText != null">
|
||||
X.SOURCE_WAREHOUSE LIKE CONCAT('%',#{searchText},'%') OR X.DESCRIPTION LIKE CONCAT('%',#{searchText},'%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY X.SOURCE_WAREHOUSE ASC
|
||||
</select>
|
||||
<select id="findAllTargetWarehouse" resultMap="BaseResultMap">
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT DISTINCT zdd.TARGET_WAREHOUSE,sl.DESCRIPTION
|
||||
from z_document_detailed zdd
|
||||
inner join storage_location sl on zdd.TARGET_WAREHOUSE = sl.STORAGE_LOCATION
|
||||
WHERE zdd.TARGET_WAREHOUSE IS NOT NULL
|
||||
union all
|
||||
select DISTINCT zdd.TARGET_WAREHOUSE ,cc.DESCRIPTION
|
||||
from z_document_detailed zdd
|
||||
inner join cost_center cc on zdd.TARGET_WAREHOUSE = cc.COST_CENTER
|
||||
WHERE zdd.TARGET_WAREHOUSE IS NOT NULL
|
||||
) AS X
|
||||
<where>
|
||||
<if test="searchText!= '' and searchText != null">
|
||||
X.TARGET_WAREHOUSE LIKE CONCAT('%',#{searchText},'%') OR X.DESCRIPTION LIKE CONCAT('%',#{searchText},'%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY X.TARGET_WAREHOUSE ASC
|
||||
</select>
|
||||
<select id="doDocumentRetrieve" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
ZDS.ITEM ,-- 1物料
|
||||
ZDS.SOURCE_WAREHOUSE , -- 3来源仓库
|
||||
ZDS.SOURCE_LOCATION , -- 4来源区域
|
||||
ZDS.STORAGE_BIN , -- 5来源货格
|
||||
ZDS.TARGET_WAREHOUSE , -- 6目标仓库
|
||||
ZDS.TARGET_LOCATION , -- 7目标区域
|
||||
ZDS.VENDOR_BATCH ,-- 8供应商批
|
||||
ZDS.BATCH_NUMBER ,-- 9采购到货批
|
||||
ZDS.TARGET_BIN ,-- 10目标货格
|
||||
ZDS.QTY,-- 11数量
|
||||
ZDS.QUALITY_INSPECTION_STATUS , -- 12质量等级
|
||||
ZDD.SEQ ,-- 13单据行号
|
||||
ZDD.STATE SEQ_STATE ,-- 14单据行状态
|
||||
ZDD.UNIT_OF_MEASURE ,-- 15单位
|
||||
ZDD.APPLICATIONS_QUANTITY ,-- 16需求数量
|
||||
ZDD.ACTUAL_QUANTITY ,-- 17实际数量
|
||||
ZDD.OA_PROJECT_CODE ,-- 18项目编号
|
||||
ZDD.OA_PROJECT_DESC ,-- 19项目名称
|
||||
ZDD.SALES_BATCH ,-- 20出货批次
|
||||
ZDD.REMARKS ,-- 21备注
|
||||
ZDD.IQC_RESULTS ,-- 22IQC
|
||||
ZDD.OQC_RESULTS ,-- 23OQC
|
||||
ZDD.INSPECTION_ORDER_NO ,-- 24检验单号
|
||||
ZDD.MODIFY_DATE_TIME, -- 更新时间
|
||||
ZDD.MODIFY_USER,-- 更新人
|
||||
ZD.DOCUMENT_NO ,-- 25单据号
|
||||
ZD.EXTERNAL_DOCUMENT_NO ,-- 26外部单据号
|
||||
ZD.DOCUMENT_TYPE ,-- 27单据类型
|
||||
ZD.STATE ,-- 28单据状态
|
||||
ZD.CREATE_USER, -- 29创建人
|
||||
ZD.CREATE_DATE_TIME, -- 创建时间
|
||||
ZDS.GRADE_ONE_CARRIER AS PALLET , -- 30托条码
|
||||
ZDS.GRADE_TWO_CARRIER AS BOX ,-- 31箱条码
|
||||
ZDS.SFC INVENTORY_ID, -- 32库存条码
|
||||
ZDS.MES_INVENTORY, -- 33二次入库
|
||||
IFNULL(USR.NAME, ZD.CREATE_USER) AS CREATE_USER_NAME, -- 创建人名称
|
||||
IFNULL(USR2.NAME, ZD.MODIFY_USER) AS MODIFY_USER_NAME, -- 更新人名称
|
||||
WI.GROES, -- 规格型号
|
||||
WI.STANDARD_LENGTH, -- 标准长度
|
||||
WI.`LENGTH`, -- 实际长度
|
||||
WI.WIDTH, -- 宽度
|
||||
WI.BISMT, -- 厚度
|
||||
I.DESCRIPTION AS ITEM_DESCRIPTION, -- 物料描述
|
||||
IG.DESCRIPTION AS ITEM_GROUP, -- 物料组
|
||||
WDO.DELIVERY_PARTY -- 客户代码
|
||||
FROM Z_DOCUMENT ZD
|
||||
LEFT JOIN WMS_DN_ORDER WDO ON WDO.SITE =ZD.SITE AND WDO.DN_NUMBER = ZD.EXTERNAL_DOCUMENT_NO
|
||||
LEFT JOIN Z_DOCUMENT_DETAILED ZDD ON ZD.DOCUMENT_NO = ZDD.DOCUMENT_NO AND ZDD.SITE = ZD.SITE
|
||||
LEFT JOIN Z_DOCUMENT_SFC ZDS ON ZDD.DOCUMENT_NO = ZDS.DOCUMENT_NO AND ZDD.SEQ = ZDS.SEQ AND ZDS.SITE = ZDD.SITE
|
||||
LEFT JOIN USR USR ON USR.SITE =ZD.SITE AND USR.USERNAME = ZD.CREATE_USER
|
||||
LEFT JOIN USR USR2 ON USR2.SITE =ZDD.SITE AND USR2.USERNAME = ZDD.MODIFY_USER
|
||||
LEFT JOIN WMS_INVENTORY WI ON WI.SITE = ZDS.SITE AND WI.INVENTORY_ID = ZDS.SFC
|
||||
LEFT JOIN ITEM I ON I.SITE = ZDS.SITE AND I.ITEM = ZDS.ITEM AND I.CURRENT_REVISION = 'Y'
|
||||
LEFT JOIN ITEM_GROUP_MEMBER IGM ON IGM.ITEM_BO = I.HANDLE
|
||||
LEFT JOIN ITEM_GROUP IG ON IG.HANDLE = IGM.ITEM_GROUP_BO
|
||||
WHERE ZD.SITE = #{site}
|
||||
<if test="documentNoList != null">
|
||||
AND ZD.DOCUMENT_NO IN
|
||||
<foreach collection="documentNoList" item="documentNo" open="(" separator="," close=")">
|
||||
#{documentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="externalDocumentNoList != null">
|
||||
AND ZD.EXTERNAL_DOCUMENT_NO IN
|
||||
<foreach collection="externalDocumentNoList" item="externalDocumentNo" open="(" separator="," close=")">
|
||||
#{externalDocumentNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="documentTypeList != null">
|
||||
AND ZD.DOCUMENT_TYPE IN
|
||||
<foreach collection="documentTypeList" item="documentType" open="(" separator="," close=")">
|
||||
#{documentType}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="seqStateList != null">
|
||||
AND ZDD.STATE IN
|
||||
<foreach collection="seqStateList" item="seqState" open="(" separator="," close=")">
|
||||
#{seqState}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="palletList != null">
|
||||
AND ZDS.GRADE_ONE_CARRIER IN
|
||||
<foreach collection="palletList" item="pallet" open="(" separator="," close=")">
|
||||
#{pallet}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="boxList != null">
|
||||
AND ZDS.GRADE_TWO_CARRIER IN
|
||||
<foreach collection="boxList" item="box" open="(" separator="," close=")">
|
||||
#{box}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="inventoryIdList != null">
|
||||
AND ZDS.SFC IN
|
||||
<foreach collection="inventoryIdList" item="inventoryId" open="(" separator="," close=")">
|
||||
#{inventoryId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="oaProjectCodeList != null">
|
||||
AND ZDD.OA_PROJECT_CODE IN
|
||||
<foreach collection="oaProjectCodeList" item="oaProjectCode" open="(" separator="," close=")">
|
||||
#{oaProjectCode}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="salesBatchList != null">
|
||||
AND ZDD.SALES_BATCH IN
|
||||
<foreach collection="salesBatchList" item="salesBatch" open="(" separator="," close=")">
|
||||
#{salesBatch}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="iqcResultsList != null">
|
||||
AND ZDD.IQC_RESULTS IN
|
||||
<foreach collection="iqcResultsList" item="iqcResults" open="(" separator="," close=")">
|
||||
#{iqcResults}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="oqcResultsList != null">
|
||||
AND ZDD.OQC_RESULTS IN
|
||||
<foreach collection="oqcResultsList" item="oqcResults" open="(" separator="," close=")">
|
||||
#{oqcResults}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="inspectionOrderNoList != null ">
|
||||
AND ZDD.INSPECTION_ORDER_NO IN
|
||||
<foreach collection="inspectionOrderNoList" item="inspectionOrderNo" open="(" separator="," close=")">
|
||||
#{inspectionOrderNo}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="itemList != null">
|
||||
AND ZDS.ITEM IN
|
||||
<foreach collection="itemList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="itemGroupList != null">
|
||||
AND IG.ITEM_GROUP IN
|
||||
<foreach collection="itemGroupList" item="itemGroup" open="(" separator="," close=")">
|
||||
#{itemGroup}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="qualityInspectionStatusList != null">
|
||||
AND ZDS.QUALITY_INSPECTION_STATUS IN
|
||||
<foreach collection="qualityInspectionStatusList" item="qualityInspectionStatus" open="(" separator="," close=")">
|
||||
#{qualityInspectionStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="batchNumberList != null">
|
||||
AND ZDS.BATCH_NUMBER IN
|
||||
<foreach collection="batchNumberList" item="batchNumber" open="(" separator="," close=")">
|
||||
#{batchNumber}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="vendorBatchList != null">
|
||||
AND ZDS.VENDOR_BATCH IN
|
||||
<foreach collection="vendorBatchList" item="vendorBatch" open="(" separator="," close=")">
|
||||
#{vendorBatch}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sourceWarehouseList != null">
|
||||
AND ZDS.SOURCE_WAREHOUSE IN
|
||||
<foreach collection="sourceWarehouseList" item="sourceWarehouse" open="(" separator="," close=")">
|
||||
#{sourceWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sourceLocationList != null">
|
||||
AND ZDS.SOURCE_LOCATION IN
|
||||
<foreach collection="sourceLocationList" item="sourceLocation" open="(" separator="," close=")">
|
||||
#{sourceLocation}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="storageBinList != null">
|
||||
AND ZDS.STORAGE_BIN IN
|
||||
<foreach collection="storageBinList" item="storageBin" open="(" separator="," close=")">
|
||||
#{storageBin}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetWarehouseList != null">
|
||||
AND ZDS.TARGET_WAREHOUSE IN
|
||||
<foreach collection="targetWarehouseList" item="targetWarehouse" open="(" separator="," close=")">
|
||||
#{targetWarehouse}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetLocationList != null">
|
||||
AND ZDS.TARGET_LOCATION IN
|
||||
<foreach collection="targetLocationList" item="targetLocation" open="(" separator="," close=")">
|
||||
#{targetLocation}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="targetBinList != null">
|
||||
AND ZDS.TARGET_BIN IN
|
||||
<foreach collection="targetBinList" item="targetBin" open="(" separator="," close=")">
|
||||
#{targetBin}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createUserList != null ">
|
||||
AND ZD.CREATE_USER IN
|
||||
<foreach collection="createUserList" item="createUser" open="(" separator="," close=")">
|
||||
#{createUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="modifyUserList != null ">
|
||||
AND ZDD.MODIFY_USER IN
|
||||
<foreach collection="modifyUserList" item="modifyUser" open="(" separator="," close=")">
|
||||
#{modifyUser}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createDateTime1!= null">
|
||||
AND ZD.CREATE_DATE_TIME >= #{createDateTime1}
|
||||
</if>
|
||||
<if test="createDateTime2!= null">
|
||||
AND ZD.CREATE_DATE_TIME <= #{createDateTime2}
|
||||
</if>
|
||||
<if test="modifyDateTime1!= null">
|
||||
AND ZDD.MODIFY_DATE_TIME >= #{modifyDateTime1}
|
||||
</if>
|
||||
<if test="modifyDateTime2!= null">
|
||||
AND ZDD.MODIFY_DATE_TIME <= #{modifyDateTime2}
|
||||
</if>
|
||||
<if test="mesInventory != null and mesInventory != ''">
|
||||
AND ZDS.MES_INVENTORY = #{mesInventory}
|
||||
</if>
|
||||
ORDER BY ZD.DOCUMENT_NO DESC, ZDS.GRADE_ONE_CARRIER ASC,ZDS.GRADE_TWO_CARRIER ASC;
|
||||
</select>
|
||||
</mapper>
|
||||
@ -89,13 +89,12 @@
|
||||
wi.AUXILIARY_UNIT,
|
||||
wi.AUXILIARY_OTY,
|
||||
wi.WMS_STORAGE_BIN_BO,
|
||||
i.item, i.DESCRIPTION ITEM_DESCRIPTION, wsb.STORAGE_BIN WMS_STORAGE_BIN, zwicc.WMS_STORAGE_BIN WMS_STORAGE_BIN_ACTUAL, zwicc.QTY_ON_HAND QTY_ON_HAND_ACTUAL
|
||||
i.item, i.DESCRIPTION ITEM_DESCRIPTION, wsb.STORAGE_BIN WMS_STORAGE_BIN
|
||||
from wms.wms_inventory wi
|
||||
left join wip.item i on i.SITE = wi.SITE and i.HANDLE = wi.ITEM_BO
|
||||
left join wms.wms_storage_bin wsb on wsb.SITE = wi.SITE and wsb.HANDLE = wi.WMS_STORAGE_BIN_BO
|
||||
left join wms.wms_storage_location wsl on wsl.SITE = wi.SITE and wsb.STORAGE_LOCATION_BO = wsl.HANDLE
|
||||
left join wms.wms_warehouse ww on ww.SITE = wi.SITE and ww.WAREHOUSE = wi.ERP_STORAGE_LOCATION
|
||||
left join wms.z_wms_inventory_check_count zwicc on zwicc.SITE = wi.SITE
|
||||
where wi.SITE = #{zWmsInventoryCheck.site}
|
||||
<if test="zWmsInventoryCheck.warehouse != '' and zWmsInventoryCheck.warehouse != null">
|
||||
and ww.WAREHOUSE = #{zWmsInventoryCheck.warehouse}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user