diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java index f41b2ce..c661ba3 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java @@ -6,6 +6,7 @@ import com.hw.common.core.domain.R; import com.hw.mes.api.domain.*; import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo; import com.hw.mes.api.domain.vo.MesPdaProductPlanVo; +import com.hw.mes.api.domain.vo.MesPurchaseOrderVo; import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo; import com.hw.mes.api.factory.RemoteMesFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; @@ -212,4 +213,14 @@ public interface RemoteMesService { @GetMapping("/saleOrder/getRelateMaterialsBySaleOrderId/{saleOrderId}") public R> getRelateMaterialsBySaleOrderId(@PathVariable("saleOrderId") Long saleOrderId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + + /** + * 通过采购订单ID查询采购订单 + * + * @param purchaseOrderId 采购订单ID + * @param source 请求来源 + * @return 结果 + */ + @GetMapping("/purchaseOrder/selectPurchaseOrderJoinSupplierProjectByOrderId/{purchaseOrderId}") + public R selectPurchaseOrderJoinSupplierProjectByOrderId(@PathVariable("purchaseOrderId") Long purchaseOrderId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); } diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java index 0ccaa58..9f82aed 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java @@ -72,6 +72,9 @@ public class MesBaseBarcodeInfo extends BaseEntity @Excel(name = "物料ID") private Long materialId; + /**成品ID,在对内生产生成成品条码时保存对应五楼成品ID*/ + private Long productId; + /**条码规格*/ private String barcodeSpec; @@ -331,6 +334,14 @@ public class MesBaseBarcodeInfo extends BaseEntity return materialId; } + public Long getProductId() { + return productId; + } + + public void setProductId(Long productId) { + this.productId = productId; + } + public String getBarcodeSpec() { return barcodeSpec; } diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesPurchaseOrder.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesPurchaseOrder.java new file mode 100644 index 0000000..79fa79e --- /dev/null +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesPurchaseOrder.java @@ -0,0 +1,822 @@ +package com.hw.mes.api.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * 采购订单信息对象 mes_purchase_order + * + * @author Yinq + * @date 2024-02-19 + */ +public class MesPurchaseOrder extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long purchaseOrderId; + + /** + * ERP的主键信息;对应FID + */ + @Excel(name = "ERP的主键信息;对应FID") + private Long erpId; + + /** + * 对应金蝶ERP订单明细的ID;对应FPOOrderEntry.FEntryID + */ + @Excel(name = "对应金蝶ERP订单明细的ID;对应FPOOrderEntry.FEntryID") + private Long fentryId; + + /** + * 采购订单编号;对应FBillNo + */ + @Excel(name = "采购订单编号;对应FBillNo") + private String poNo; + + /** + * 单据状态;FDocumentStatus + */ + @Excel(name = "单据状态;FDocumentStatus") + private String documentStatus; + + /** + * 物料ID,关联物料信息主键 + */ + @Excel(name = "物料ID,关联物料信息主键") + private Long materialId; + + /** + * 物料编码;对应FMaterialId.FNumber + */ + @Excel(name = "物料编码;对应FMaterialId.FNumber") + private String materialCode; + + /** + * 物料名称;对应FMaterialId.FName + */ + @Excel(name = "物料名称;对应FMaterialId.FName") + private String materialName; + + /** + * 采购订单分类:1ERP同步,2虚拟采购订单 + */ + private String purchaseOrderClassfication; + + + /** + * 订单计划数量;对应FQty + */ + @Excel(name = "订单计划数量;对应FQty") + private BigDecimal orderAmount; + + /** + * 完成采购数量 + */ + @Excel(name = "完成采购数量") + private BigDecimal completeAmount; + + /** + * 审核日期;对应FApproveDate + */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @Excel(name = "审核日期;对应FApproveDate", width = 30, dateFormat = "yyyy-MM-dd") + private Date approveDate; + + /** + * ERP最后修改日期;对应FModifyDate + */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @Excel(name = "ERP最后修改日期;对应FModifyDate", width = 30, dateFormat = "yyyy-MM-dd") + private Date erpModifyDate; + + /** + * 计划交货日期;对应FDeliveryDate + */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @Excel(name = "计划交货日期;对应FDeliveryDate", width = 30, dateFormat = "yyyy-MM-dd") + private Date planDeliveryDate; + + /** + * 计划开始日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @Excel(name = "计划开始日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date beginDate; + + /** + * 计划结束日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @Excel(name = "计划结束日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date endDate; + + /** + * 订单状态(1待采购2采购中3采购完成) + */ + @Excel(name = "订单状态(1待采购2采购中3采购完成)") + private String orderStatus; + + /** + * 完成日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @Excel(name = "完成日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date completeDate; + + /** + * 是否标识:1-是;0-否 + */ + @Excel(name = "是否标识:1-是;0-否") + private String isFlag; + + /** + * 采购单位;FUnitId + */ + @Excel(name = "采购单位;FUnitId") + private Long unitId; + + /** + * 库存单位;FStockUnitID + */ + @Excel(name = "库存单位;FStockUnitID") + private Long stockUnitId; + + /** + * 计价单位;FPriceUnitID + */ + @Excel(name = "计价单位;FPriceUnitID") + private Long priceUnitId; + + /** + * 辅助属性;FAuxPropId + */ + @Excel(name = "辅助属性;FAuxPropId") + private Long auxPropId; + + /** + * 源单编号;FSrcBillNo + */ + @Excel(name = "源单编号;FSrcBillNo") + private String srcBillNo; + + /** + * 采购组织;FPurchaseOrgId + */ + @Excel(name = "采购组织;FPurchaseOrgId") + private Long purchaseOrgId; + + /** + * 京源项目;F_TOND_Base + */ + @Excel(name = "京源项目;F_TOND_Base") + private String tondBase; + + /** + * 供应商ID;FSupplierId + */ + @Excel(name = "供应商ID;FSupplierId") + private Long supplierId; + + /** + * 采购销售订单绑定信息信息 + */ + private List mesOrderBindList; + + /** + * 判断是否需要绑定 + */ + private String bindFlag; + + /** + * 规格参数 + */ + private String specificationParameter; + + /** + * 物料规格 + */ + private String materialSpec; + + /** + * 销售订单主键 + */ + private Long saleOrderId; + + /** + * 采购销售订单绑定主键 + */ + private Long orderBindId; + + /** + * 已绑定数 + */ + private BigDecimal boundAmount; + + /** + * 销售订单已绑定数 + */ + private BigDecimal saleBindAmount; + + /** + * 安全库存数 + */ + private BigDecimal safeAmount; + + /** + * 条码数 + */ + private BigDecimal barcodeAmount; + + /** + * 更新绑定数量 + */ + private BigDecimal updateAmount; + + /** + * 序号 + */ + private Long serialNumber; + + /** + * 订单绑定的数量和条码的数量,以-分割 + */ + private String orderBindBarcodeAmount; + + /** + * 安全库存绑定的数量和条码的数量,以-分割 + */ + private String safeBindBarcodeAmount; + + private String batchFlag; + + private BigDecimal batchAmount; + + private long mesMaterialId;//物料信息表的物料ID主键 + + private String alwaysFlag; + + private Long productId; + + private String productCode; + + private String productName; + + private String productSpec; + + private String safeFlag; + + private String saleOrderCode; + + private BigDecimal bindAmount; + + private BigDecimal saleOrderAmount; + + private String mergeFlag; + + private String singleFlag; + + private Long erpMaterialId; + + + /** + * 供应商code + */ + private String supplierCode; + + private String projectNo; + + + public Long getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(Long serialNumber) { + this.serialNumber = serialNumber; + } + + public BigDecimal getUpdateAmount() { + return updateAmount; + } + + public void setUpdateAmount(BigDecimal updateAmount) { + this.updateAmount = updateAmount; + } + + public BigDecimal getBoundAmount() { + return boundAmount; + } + + public void setBoundAmount(BigDecimal boundAmount) { + this.boundAmount = boundAmount; + } + + public BigDecimal getSaleBindAmount() { + return saleBindAmount; + } + + public void setSaleBindAmount(BigDecimal saleBindAmount) { + this.saleBindAmount = saleBindAmount; + } + + public BigDecimal getSafeAmount() { + return safeAmount; + } + + public void setSafeAmount(BigDecimal safeAmount) { + this.safeAmount = safeAmount; + } + + public BigDecimal getBarcodeAmount() { + return barcodeAmount; + } + + public void setBarcodeAmount(BigDecimal barcodeAmount) { + this.barcodeAmount = barcodeAmount; + } + + public Long getSaleOrderId() { + return saleOrderId; + } + + public void setSaleOrderId(Long saleOrderId) { + this.saleOrderId = saleOrderId; + } + + public Long getOrderBindId() { + return orderBindId; + } + + public void setOrderBindId(Long orderBindId) { + this.orderBindId = orderBindId; + } + + public String getMaterialSpec() { + return materialSpec; + } + + public void setMaterialSpec(String materialSpec) { + this.materialSpec = materialSpec; + } + + public String getSpecificationParameter() { + return specificationParameter; + } + + public void setSpecificationParameter(String specificationParameter) { + this.specificationParameter = specificationParameter; + } + + public void setPurchaseOrderId(Long purchaseOrderId) { + this.purchaseOrderId = purchaseOrderId; + } + + public Long getPurchaseOrderId() { + return purchaseOrderId; + } + + public void setErpId(Long erpId) { + this.erpId = erpId; + } + + public Long getErpId() { + return erpId; + } + + public void setFentryId(Long fentryId) { + this.fentryId = fentryId; + } + + public Long getFentryId() { + return fentryId; + } + + public void setPoNo(String poNo) { + this.poNo = poNo; + } + + public String getPoNo() { + return poNo; + } + + public void setDocumentStatus(String documentStatus) { + this.documentStatus = documentStatus; + } + + public String getDocumentStatus() { + return documentStatus; + } + + public void setMaterialId(Long materialId) { + this.materialId = materialId; + } + + public Long getMaterialId() { + return materialId; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialName() { + return materialName; + } + + public String getPurchaseOrderClassfication() { + return purchaseOrderClassfication; + } + + public void setPurchaseOrderClassfication(String purchaseOrderClassfication) { + this.purchaseOrderClassfication = purchaseOrderClassfication; + } + + public void setOrderAmount(BigDecimal orderAmount) { + this.orderAmount = orderAmount; + } + + public BigDecimal getOrderAmount() { + return orderAmount; + } + + public void setCompleteAmount(BigDecimal completeAmount) { + this.completeAmount = completeAmount; + } + + public BigDecimal getCompleteAmount() { + return completeAmount; + } + + public void setApproveDate(Date approveDate) { + this.approveDate = approveDate; + } + + public Date getApproveDate() { + return approveDate; + } + + public void setErpModifyDate(Date erpModifyDate) { + this.erpModifyDate = erpModifyDate; + } + + public Date getErpModifyDate() { + return erpModifyDate; + } + + public void setPlanDeliveryDate(Date planDeliveryDate) { + this.planDeliveryDate = planDeliveryDate; + } + + public Date getPlanDeliveryDate() { + return planDeliveryDate; + } + + public void setBeginDate(Date beginDate) { + this.beginDate = beginDate; + } + + public Date getBeginDate() { + return beginDate; + } + + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + + public Date getEndDate() { + return endDate; + } + + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } + + public String getOrderStatus() { + return orderStatus; + } + + public void setCompleteDate(Date completeDate) { + this.completeDate = completeDate; + } + + public Date getCompleteDate() { + return completeDate; + } + + public void setIsFlag(String isFlag) { + this.isFlag = isFlag; + } + + public String getIsFlag() { + return isFlag; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Long getUnitId() { + return unitId; + } + + public void setStockUnitId(Long stockUnitId) { + this.stockUnitId = stockUnitId; + } + + public Long getStockUnitId() { + return stockUnitId; + } + + public void setPriceUnitId(Long priceUnitId) { + this.priceUnitId = priceUnitId; + } + + public Long getPriceUnitId() { + return priceUnitId; + } + + public void setAuxPropId(Long auxPropId) { + this.auxPropId = auxPropId; + } + + public Long getAuxPropId() { + return auxPropId; + } + + public void setSrcBillNo(String srcBillNo) { + this.srcBillNo = srcBillNo; + } + + public String getSrcBillNo() { + return srcBillNo; + } + + public void setPurchaseOrgId(Long purchaseOrgId) { + this.purchaseOrgId = purchaseOrgId; + } + + public Long getPurchaseOrgId() { + return purchaseOrgId; + } + + public void setTondBase(String tondBase) { + this.tondBase = tondBase; + } + + public String getTondBase() { + return tondBase; + } + + public void setSupplierId(Long supplierId) { + this.supplierId = supplierId; + } + + public Long getSupplierId() { + return supplierId; + } + + public List getMesOrderBindList() { + return mesOrderBindList; + } + + public void setMesOrderBindList(List mesOrderBindList) { + this.mesOrderBindList = mesOrderBindList; + } + + public String getBindFlag() { + return bindFlag; + } + + public void setBindFlag(String bindFlag) { + this.bindFlag = bindFlag; + } + + public String getOrderBindBarcodeAmount() { + return orderBindBarcodeAmount; + } + + public void setOrderBindBarcodeAmount(String orderBindBarcodeAmount) { + this.orderBindBarcodeAmount = orderBindBarcodeAmount; + } + + public String getSafeBindBarcodeAmount() { + return safeBindBarcodeAmount; + } + + public void setSafeBindBarcodeAmount(String safeBindBarcodeAmount) { + this.safeBindBarcodeAmount = safeBindBarcodeAmount; + } + + public String getBatchFlag() { + return batchFlag; + } + + public void setBatchFlag(String batchFlag) { + this.batchFlag = batchFlag; + } + + public BigDecimal getBatchAmount() { + return batchAmount; + } + + public void setBatchAmount(BigDecimal batchAmount) { + this.batchAmount = batchAmount; + } + + public long getMesMaterialId() { + return mesMaterialId; + } + + public void setMesMaterialId(long mesMaterialId) { + this.mesMaterialId = mesMaterialId; + } + + public String getAlwaysFlag() { + return alwaysFlag; + } + + public void setAlwaysFlag(String alwaysFlag) { + this.alwaysFlag = alwaysFlag; + } + + public Long getProductId() { + return productId; + } + + public void setProductId(Long productId) { + this.productId = productId; + } + + public String getProductCode() { + return productCode; + } + + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductSpec() { + return productSpec; + } + + public void setProductSpec(String productSpec) { + this.productSpec = productSpec; + } + + public String getSafeFlag() { + return safeFlag; + } + + public void setSafeFlag(String safeFlag) { + this.safeFlag = safeFlag; + } + + public String getSaleOrderCode() { + return saleOrderCode; + } + + public void setSaleOrderCode(String saleOrderCode) { + this.saleOrderCode = saleOrderCode; + } + + public BigDecimal getBindAmount() { + return bindAmount; + } + + public void setBindAmount(BigDecimal bindAmount) { + this.bindAmount = bindAmount; + } + + public BigDecimal getSaleOrderAmount() { + return saleOrderAmount; + } + + public void setSaleOrderAmount(BigDecimal saleOrderAmount) { + this.saleOrderAmount = saleOrderAmount; + } + + public String getMergeFlag() { + return mergeFlag; + } + + public void setMergeFlag(String mergeFlag) { + this.mergeFlag = mergeFlag; + } + + public String getSingleFlag() { + return singleFlag; + } + + public void setSingleFlag(String singleFlag) { + this.singleFlag = singleFlag; + } + + public Long getErpMaterialId() { + return erpMaterialId; + } + + public void setErpMaterialId(Long erpMaterialId) { + this.erpMaterialId = erpMaterialId; + } + + public String getSupplierCode() { + return supplierCode; + } + + public void setSupplierCode(String supplierCode) { + this.supplierCode = supplierCode; + } + + public String getProjectNo() { + return projectNo; + } + + public void setProjectNo(String projectNo) { + this.projectNo = projectNo; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("purchaseOrderId", getPurchaseOrderId()) + .append("erpId", getErpId()) + .append("fentryId", getFentryId()) + .append("poNo", getPoNo()) + .append("documentStatus", getDocumentStatus()) + .append("materialId", getMaterialId()) + .append("materialCode", getMaterialCode()) + .append("materialName", getMaterialName()) + .append("orderAmount", getOrderAmount()) + .append("completeAmount", getCompleteAmount()) + .append("approveDate", getApproveDate()) + .append("erpModifyDate", getErpModifyDate()) + .append("planDeliveryDate", getPlanDeliveryDate()) + .append("beginDate", getBeginDate()) + .append("endDate", getEndDate()) + .append("orderStatus", getOrderStatus()) + .append("completeDate", getCompleteDate()) + .append("isFlag", getIsFlag()) + .append("unitId", getUnitId()) + .append("stockUnitId", getStockUnitId()) + .append("priceUnitId", getPriceUnitId()) + .append("auxPropId", getAuxPropId()) + .append("srcBillNo", getSrcBillNo()) + .append("purchaseOrgId", getPurchaseOrgId()) + .append("tondBase", getTondBase()) + .append("supplierId", getSupplierId()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("mesOrderBindList", getMesOrderBindList()) + .toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MesPurchaseOrder that = (MesPurchaseOrder) o; + boundAmount = boundAmount == null ? BigDecimal.ZERO : boundAmount; + safeAmount = safeAmount == null ? BigDecimal.ZERO : safeAmount; + that.boundAmount = that.boundAmount == null ? BigDecimal.ZERO : that.boundAmount; + that.safeAmount = that.safeAmount == null ? BigDecimal.ZERO : that.safeAmount; + return Objects.equals(purchaseOrderId, that.purchaseOrderId) + && orderAmount.compareTo(that.orderAmount) == 0 //订单数量 + && boundAmount.compareTo(that.boundAmount) == 0 //已绑定所有销售订单的总数量 + && safeAmount.compareTo(that.safeAmount) == 0 //安全库存数量 + && Objects.equals(orderBindBarcodeAmount, that.orderBindBarcodeAmount)//订单已绑定的数量-订单已生成的条码数量 + && Objects.equals(safeBindBarcodeAmount, that.safeBindBarcodeAmount); //安全库存的数量-安全库存已生成的条码数量 + } + + @Override + public int hashCode() { + return Objects.hash(purchaseOrderId, orderAmount, boundAmount, safeAmount, orderBindBarcodeAmount, safeBindBarcodeAmount); + } +} diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java index 0537260..61be6da 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java @@ -116,6 +116,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory> getRelateMaterialsBySaleOrderId(Long saleOrderId, String source) { return R.fail("根据销售订单ID获取关联原材料信息失败:" + throwable.getMessage()); } + + @Override + public R selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId, String source) { + return R.fail("根据采购订单ID获取采购订单信息失败:" + throwable.getMessage()); + } }; } } diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java index 4540518..0dd1aef 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/WmsConstants.java @@ -194,7 +194,7 @@ public class WmsConstants { public static final String WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_INSTALL = "3";//组装出库 - public static final String WMS_RAW_OUTSTOCK_TASK_TYPE_AUTO_OUTSTOCK = "4";//自动出库 + public static final String WMS_RAW_OUTSTOCK_TASK_TYPE_AUTO_OUTSTOCK = "4";//自动出库(对于物料自动出库标识是是的在下一个采购订单入库时上一个采购订单的物料自动出库,) public static final String WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK = "5";//退货出库 public static final String WMS_RAW_OUTSTOCK_TASK_TYPE_OTHER = "9";//其他 diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java index 1e43a36..818f8fa 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java @@ -9,7 +9,7 @@ import com.hw.common.security.annotation.InnerAuth; import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBindBarcode; -import com.hw.mes.domain.MesPurchaseOrder; +import com.hw.mes.api.domain.MesPurchaseOrder; import com.hw.mes.service.IMesBaseMaterialInfoService; import com.hw.mes.service.IMesPurchaseOrderService; import org.springframework.beans.factory.annotation.Autowired; diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java index acb76d4..9323a98 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java @@ -4,6 +4,7 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import com.hw.common.core.domain.R; +import com.hw.common.security.annotation.InnerAuth; import com.hw.mes.domain.MesSaleOrder; import com.hw.mes.service.IMesOrderBindService; import com.hw.mes.service.IMesSaleOrderService; @@ -19,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController; import com.hw.common.log.annotation.Log; import com.hw.common.log.enums.BusinessType; import com.hw.common.security.annotation.RequiresPermissions; -import com.hw.mes.domain.MesPurchaseOrder; +import com.hw.mes.api.domain.MesPurchaseOrder; import com.hw.mes.service.IMesPurchaseOrderService; import com.hw.common.core.web.controller.BaseController; import com.hw.common.core.web.domain.AjaxResult; @@ -247,4 +248,15 @@ public class MesPurchaseOrderController extends BaseController + /** + * 获取采购订单信息详细信息 + */ + @InnerAuth + @GetMapping(value = "/selectPurchaseOrderJoinSupplierProjectByOrderId/{purchaseOrderId}") + public R selectPurchaseOrderJoinSupplierProjectByOrderId(@PathVariable("purchaseOrderId") Long purchaseOrderId) + { + MesPurchaseOrder mesPurchaseOrder = mesPurchaseOrderService.selectPurchaseOrderJoinSupplierProjectByOrderId(purchaseOrderId); + return R.ok(mesPurchaseOrder); + } + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesSaleOrderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesSaleOrderController.java index 65f07c2..641b5da 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesSaleOrderController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesSaleOrderController.java @@ -119,7 +119,7 @@ public class MesSaleOrderController extends BaseController { /** - * 获取销售订单信息详细信息 + * 获取销售订单成品信息详细信息 */ @InnerAuth @GetMapping(value = "/getRelateProductsBySaleOrderId/{saleOrderId}") @@ -127,4 +127,14 @@ public class MesSaleOrderController extends BaseController { List list = mesSaleOrderService.getRelateProductsBySaleOrderId(saleOrderId); return R.ok(list); } + + /** + * 获取销售订单原材料信息详细信息 + */ + @InnerAuth + @GetMapping(value = "/getRelateMaterialsBySaleOrderId/{saleOrderId}") + public R> getRelateMaterialsBySaleOrderId(@PathVariable("saleOrderId") Long saleOrderId) { + List list = mesSaleOrderService.getRelateProductsBySaleOrderId(saleOrderId); + return R.ok(list); + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java index 3b3af17..b6592b6 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java @@ -198,6 +198,8 @@ public class MesProductPlan extends BaseEntity private String cabinetChannel; + private Long productId;//针对内部生产5楼的成品ID + public Long getSaleOrderId() { return saleOrderId; } @@ -587,6 +589,14 @@ public class MesProductPlan extends BaseEntity this.cabinetChannel = cabinetChannel; } + public Long getProductId() { + return productId; + } + + public void setProductId(Long productId) { + this.productId = productId; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPurchaseOrder.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPurchaseOrder.java index e9f660e..a4f7f2c 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPurchaseOrder.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesPurchaseOrder.java @@ -1,799 +1,799 @@ -package com.hw.mes.domain; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.hw.mes.api.domain.MesOrderBind; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.hw.common.core.annotation.Excel; -import com.hw.common.core.web.domain.BaseEntity; - -/** - * 采购订单信息对象 mes_purchase_order - * - * @author Yinq - * @date 2024-02-19 - */ -public class MesPurchaseOrder extends BaseEntity { - private static final long serialVersionUID = 1L; - - /** - * 主键标识 - */ - private Long purchaseOrderId; - - /** - * ERP的主键信息;对应FID - */ - @Excel(name = "ERP的主键信息;对应FID") - private Long erpId; - - /** - * 对应金蝶ERP订单明细的ID;对应FPOOrderEntry.FEntryID - */ - @Excel(name = "对应金蝶ERP订单明细的ID;对应FPOOrderEntry.FEntryID") - private Long fentryId; - - /** - * 采购订单编号;对应FBillNo - */ - @Excel(name = "采购订单编号;对应FBillNo") - private String poNo; - - /** - * 单据状态;FDocumentStatus - */ - @Excel(name = "单据状态;FDocumentStatus") - private String documentStatus; - - /** - * 物料ID,关联物料信息主键 - */ - @Excel(name = "物料ID,关联物料信息主键") - private Long materialId; - - /** - * 物料编码;对应FMaterialId.FNumber - */ - @Excel(name = "物料编码;对应FMaterialId.FNumber") - private String materialCode; - - /** - * 物料名称;对应FMaterialId.FName - */ - @Excel(name = "物料名称;对应FMaterialId.FName") - private String materialName; - - /** - * 采购订单分类:1ERP同步,2虚拟采购订单 - */ - private String purchaseOrderClassfication; - - - /** - * 订单计划数量;对应FQty - */ - @Excel(name = "订单计划数量;对应FQty") - private BigDecimal orderAmount; - - /** - * 完成采购数量 - */ - @Excel(name = "完成采购数量") - private BigDecimal completeAmount; - - /** - * 审核日期;对应FApproveDate - */ - @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") - @Excel(name = "审核日期;对应FApproveDate", width = 30, dateFormat = "yyyy-MM-dd") - private Date approveDate; - - /** - * ERP最后修改日期;对应FModifyDate - */ - @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") - @Excel(name = "ERP最后修改日期;对应FModifyDate", width = 30, dateFormat = "yyyy-MM-dd") - private Date erpModifyDate; - - /** - * 计划交货日期;对应FDeliveryDate - */ - @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") - @Excel(name = "计划交货日期;对应FDeliveryDate", width = 30, dateFormat = "yyyy-MM-dd") - private Date planDeliveryDate; - - /** - * 计划开始日期 - */ - @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") - @Excel(name = "计划开始日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date beginDate; - - /** - * 计划结束日期 - */ - @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") - @Excel(name = "计划结束日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date endDate; - - /** - * 订单状态(1待采购2采购中3采购完成) - */ - @Excel(name = "订单状态(1待采购2采购中3采购完成)") - private String orderStatus; - - /** - * 完成日期 - */ - @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") - @Excel(name = "完成日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date completeDate; - - /** - * 是否标识:1-是;0-否 - */ - @Excel(name = "是否标识:1-是;0-否") - private String isFlag; - - /** - * 采购单位;FUnitId - */ - @Excel(name = "采购单位;FUnitId") - private Long unitId; - - /** - * 库存单位;FStockUnitID - */ - @Excel(name = "库存单位;FStockUnitID") - private Long stockUnitId; - - /** - * 计价单位;FPriceUnitID - */ - @Excel(name = "计价单位;FPriceUnitID") - private Long priceUnitId; - - /** - * 辅助属性;FAuxPropId - */ - @Excel(name = "辅助属性;FAuxPropId") - private Long auxPropId; - - /** - * 源单编号;FSrcBillNo - */ - @Excel(name = "源单编号;FSrcBillNo") - private String srcBillNo; - - /** - * 采购组织;FPurchaseOrgId - */ - @Excel(name = "采购组织;FPurchaseOrgId") - private Long purchaseOrgId; - - /** - * 京源项目;F_TOND_Base - */ - @Excel(name = "京源项目;F_TOND_Base") - private String tondBase; - - /** - * 供应商ID;FSupplierId - */ - @Excel(name = "供应商ID;FSupplierId") - private Long supplierId; - - /** - * 采购销售订单绑定信息信息 - */ - private List mesOrderBindList; - - /** - * 判断是否需要绑定 - */ - private String bindFlag; - - /** - * 规格参数 - */ - private String specificationParameter; - - /** - * 物料规格 - */ - private String materialSpec; - - /** - * 销售订单主键 - */ - private Long saleOrderId; - - /** - * 采购销售订单绑定主键 - */ - private Long orderBindId; - - /** - * 已绑定数 - */ - private BigDecimal boundAmount; - - /** - * 销售订单已绑定数 - */ - private BigDecimal saleBindAmount; - - /** - * 安全库存数 - */ - private BigDecimal safeAmount; - - /** - * 条码数 - */ - private BigDecimal barcodeAmount; - - /** - * 更新绑定数量 - */ - private BigDecimal updateAmount; - - /** - * 序号 - */ - private Long serialNumber; - - /** - * 订单绑定的数量和条码的数量,以-分割 - */ - private String orderBindBarcodeAmount; - - /** - * 安全库存绑定的数量和条码的数量,以-分割 - */ - private String safeBindBarcodeAmount; - - private String batchFlag; - - private BigDecimal batchAmount; - - private long mesMaterialId;//物料信息表的物料ID主键 - - private String alwaysFlag; - - private Long productId; - - private String productCode; - - private String productName; - - private String productSpec; - - private String safeFlag; - - private String saleOrderCode; - - private BigDecimal bindAmount; - - private BigDecimal saleOrderAmount; - - private String mergeFlag; - - private String singleFlag; - - private Long erpMaterialId; - - - public Long getSerialNumber() { - return serialNumber; - } - - public void setSerialNumber(Long serialNumber) { - this.serialNumber = serialNumber; - } - - public BigDecimal getUpdateAmount() { - return updateAmount; - } - - public void setUpdateAmount(BigDecimal updateAmount) { - this.updateAmount = updateAmount; - } - - public BigDecimal getBoundAmount() { - return boundAmount; - } - - public void setBoundAmount(BigDecimal boundAmount) { - this.boundAmount = boundAmount; - } - - public BigDecimal getSaleBindAmount() { - return saleBindAmount; - } - - public void setSaleBindAmount(BigDecimal saleBindAmount) { - this.saleBindAmount = saleBindAmount; - } - - public BigDecimal getSafeAmount() { - return safeAmount; - } - - public void setSafeAmount(BigDecimal safeAmount) { - this.safeAmount = safeAmount; - } - - public BigDecimal getBarcodeAmount() { - return barcodeAmount; - } - - public void setBarcodeAmount(BigDecimal barcodeAmount) { - this.barcodeAmount = barcodeAmount; - } - - public Long getSaleOrderId() { - return saleOrderId; - } - - public void setSaleOrderId(Long saleOrderId) { - this.saleOrderId = saleOrderId; - } - - public Long getOrderBindId() { - return orderBindId; - } - - public void setOrderBindId(Long orderBindId) { - this.orderBindId = orderBindId; - } - - public String getMaterialSpec() { - return materialSpec; - } - - public void setMaterialSpec(String materialSpec) { - this.materialSpec = materialSpec; - } - - public String getSpecificationParameter() { - return specificationParameter; - } - - public void setSpecificationParameter(String specificationParameter) { - this.specificationParameter = specificationParameter; - } - - public void setPurchaseOrderId(Long purchaseOrderId) { - this.purchaseOrderId = purchaseOrderId; - } - - public Long getPurchaseOrderId() { - return purchaseOrderId; - } - - public void setErpId(Long erpId) { - this.erpId = erpId; - } - - public Long getErpId() { - return erpId; - } - - public void setFentryId(Long fentryId) { - this.fentryId = fentryId; - } - - public Long getFentryId() { - return fentryId; - } - - public void setPoNo(String poNo) { - this.poNo = poNo; - } - - public String getPoNo() { - return poNo; - } - - public void setDocumentStatus(String documentStatus) { - this.documentStatus = documentStatus; - } - - public String getDocumentStatus() { - return documentStatus; - } - - public void setMaterialId(Long materialId) { - this.materialId = materialId; - } - - public Long getMaterialId() { - return materialId; - } - - public void setMaterialCode(String materialCode) { - this.materialCode = materialCode; - } - - public String getMaterialCode() { - return materialCode; - } - - public void setMaterialName(String materialName) { - this.materialName = materialName; - } - - public String getMaterialName() { - return materialName; - } - - public String getPurchaseOrderClassfication() { - return purchaseOrderClassfication; - } - - public void setPurchaseOrderClassfication(String purchaseOrderClassfication) { - this.purchaseOrderClassfication = purchaseOrderClassfication; - } - - public void setOrderAmount(BigDecimal orderAmount) { - this.orderAmount = orderAmount; - } - - public BigDecimal getOrderAmount() { - return orderAmount; - } - - public void setCompleteAmount(BigDecimal completeAmount) { - this.completeAmount = completeAmount; - } - - public BigDecimal getCompleteAmount() { - return completeAmount; - } - - public void setApproveDate(Date approveDate) { - this.approveDate = approveDate; - } - - public Date getApproveDate() { - return approveDate; - } - - public void setErpModifyDate(Date erpModifyDate) { - this.erpModifyDate = erpModifyDate; - } - - public Date getErpModifyDate() { - return erpModifyDate; - } - - public void setPlanDeliveryDate(Date planDeliveryDate) { - this.planDeliveryDate = planDeliveryDate; - } - - public Date getPlanDeliveryDate() { - return planDeliveryDate; - } - - public void setBeginDate(Date beginDate) { - this.beginDate = beginDate; - } - - public Date getBeginDate() { - return beginDate; - } - - public void setEndDate(Date endDate) { - this.endDate = endDate; - } - - public Date getEndDate() { - return endDate; - } - - public void setOrderStatus(String orderStatus) { - this.orderStatus = orderStatus; - } - - public String getOrderStatus() { - return orderStatus; - } - - public void setCompleteDate(Date completeDate) { - this.completeDate = completeDate; - } - - public Date getCompleteDate() { - return completeDate; - } - - public void setIsFlag(String isFlag) { - this.isFlag = isFlag; - } - - public String getIsFlag() { - return isFlag; - } - - public void setUnitId(Long unitId) { - this.unitId = unitId; - } - - public Long getUnitId() { - return unitId; - } - - public void setStockUnitId(Long stockUnitId) { - this.stockUnitId = stockUnitId; - } - - public Long getStockUnitId() { - return stockUnitId; - } - - public void setPriceUnitId(Long priceUnitId) { - this.priceUnitId = priceUnitId; - } - - public Long getPriceUnitId() { - return priceUnitId; - } - - public void setAuxPropId(Long auxPropId) { - this.auxPropId = auxPropId; - } - - public Long getAuxPropId() { - return auxPropId; - } - - public void setSrcBillNo(String srcBillNo) { - this.srcBillNo = srcBillNo; - } - - public String getSrcBillNo() { - return srcBillNo; - } - - public void setPurchaseOrgId(Long purchaseOrgId) { - this.purchaseOrgId = purchaseOrgId; - } - - public Long getPurchaseOrgId() { - return purchaseOrgId; - } - - public void setTondBase(String tondBase) { - this.tondBase = tondBase; - } - - public String getTondBase() { - return tondBase; - } - - public void setSupplierId(Long supplierId) { - this.supplierId = supplierId; - } - - public Long getSupplierId() { - return supplierId; - } - - public List getMesOrderBindList() { - return mesOrderBindList; - } - - public void setMesOrderBindList(List mesOrderBindList) { - this.mesOrderBindList = mesOrderBindList; - } - - public String getBindFlag() { - return bindFlag; - } - - public void setBindFlag(String bindFlag) { - this.bindFlag = bindFlag; - } - - public String getOrderBindBarcodeAmount() { - return orderBindBarcodeAmount; - } - - public void setOrderBindBarcodeAmount(String orderBindBarcodeAmount) { - this.orderBindBarcodeAmount = orderBindBarcodeAmount; - } - - public String getSafeBindBarcodeAmount() { - return safeBindBarcodeAmount; - } - - public void setSafeBindBarcodeAmount(String safeBindBarcodeAmount) { - this.safeBindBarcodeAmount = safeBindBarcodeAmount; - } - - public String getBatchFlag() { - return batchFlag; - } - - public void setBatchFlag(String batchFlag) { - this.batchFlag = batchFlag; - } - - public BigDecimal getBatchAmount() { - return batchAmount; - } - - public void setBatchAmount(BigDecimal batchAmount) { - this.batchAmount = batchAmount; - } - - public long getMesMaterialId() { - return mesMaterialId; - } - - public void setMesMaterialId(long mesMaterialId) { - this.mesMaterialId = mesMaterialId; - } - - public String getAlwaysFlag() { - return alwaysFlag; - } - - public void setAlwaysFlag(String alwaysFlag) { - this.alwaysFlag = alwaysFlag; - } - - public Long getProductId() { - return productId; - } - - public void setProductId(Long productId) { - this.productId = productId; - } - - public String getProductCode() { - return productCode; - } - - public void setProductCode(String productCode) { - this.productCode = productCode; - } - - public String getProductName() { - return productName; - } - - public void setProductName(String productName) { - this.productName = productName; - } - - public String getProductSpec() { - return productSpec; - } - - public void setProductSpec(String productSpec) { - this.productSpec = productSpec; - } - - public String getSafeFlag() { - return safeFlag; - } - - public void setSafeFlag(String safeFlag) { - this.safeFlag = safeFlag; - } - - public String getSaleOrderCode() { - return saleOrderCode; - } - - public void setSaleOrderCode(String saleOrderCode) { - this.saleOrderCode = saleOrderCode; - } - - public BigDecimal getBindAmount() { - return bindAmount; - } - - public void setBindAmount(BigDecimal bindAmount) { - this.bindAmount = bindAmount; - } - - public BigDecimal getSaleOrderAmount() { - return saleOrderAmount; - } - - public void setSaleOrderAmount(BigDecimal saleOrderAmount) { - this.saleOrderAmount = saleOrderAmount; - } - - public String getMergeFlag() { - return mergeFlag; - } - - public void setMergeFlag(String mergeFlag) { - this.mergeFlag = mergeFlag; - } - - public String getSingleFlag() { - return singleFlag; - } - - public void setSingleFlag(String singleFlag) { - this.singleFlag = singleFlag; - } - - public Long getErpMaterialId() { - return erpMaterialId; - } - - public void setErpMaterialId(Long erpMaterialId) { - this.erpMaterialId = erpMaterialId; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("purchaseOrderId", getPurchaseOrderId()) - .append("erpId", getErpId()) - .append("fentryId", getFentryId()) - .append("poNo", getPoNo()) - .append("documentStatus", getDocumentStatus()) - .append("materialId", getMaterialId()) - .append("materialCode", getMaterialCode()) - .append("materialName", getMaterialName()) - .append("orderAmount", getOrderAmount()) - .append("completeAmount", getCompleteAmount()) - .append("approveDate", getApproveDate()) - .append("erpModifyDate", getErpModifyDate()) - .append("planDeliveryDate", getPlanDeliveryDate()) - .append("beginDate", getBeginDate()) - .append("endDate", getEndDate()) - .append("orderStatus", getOrderStatus()) - .append("completeDate", getCompleteDate()) - .append("isFlag", getIsFlag()) - .append("unitId", getUnitId()) - .append("stockUnitId", getStockUnitId()) - .append("priceUnitId", getPriceUnitId()) - .append("auxPropId", getAuxPropId()) - .append("srcBillNo", getSrcBillNo()) - .append("purchaseOrgId", getPurchaseOrgId()) - .append("tondBase", getTondBase()) - .append("supplierId", getSupplierId()) - .append("remark", getRemark()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("mesOrderBindList", getMesOrderBindList()) - .toString(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - MesPurchaseOrder that = (MesPurchaseOrder) o; - boundAmount = boundAmount == null ? BigDecimal.ZERO : boundAmount; - safeAmount = safeAmount == null ? BigDecimal.ZERO : safeAmount; - that.boundAmount = that.boundAmount == null ? BigDecimal.ZERO : that.boundAmount; - that.safeAmount = that.safeAmount == null ? BigDecimal.ZERO : that.safeAmount; - return Objects.equals(purchaseOrderId, that.purchaseOrderId) - && orderAmount.compareTo(that.orderAmount) == 0 //订单数量 - && boundAmount.compareTo(that.boundAmount) == 0 //已绑定所有销售订单的总数量 - && safeAmount.compareTo(that.safeAmount) == 0 //安全库存数量 - && Objects.equals(orderBindBarcodeAmount, that.orderBindBarcodeAmount)//订单已绑定的数量-订单已生成的条码数量 - && Objects.equals(safeBindBarcodeAmount, that.safeBindBarcodeAmount); //安全库存的数量-安全库存已生成的条码数量 - } - - @Override - public int hashCode() { - return Objects.hash(purchaseOrderId, orderAmount, boundAmount, safeAmount, orderBindBarcodeAmount, safeBindBarcodeAmount); - } -} +//package com.hw.mes.domain; +// +//import java.math.BigDecimal; +//import java.util.Date; +//import java.util.List; +//import java.util.Objects; +// +//import com.fasterxml.jackson.annotation.JsonFormat; +//import com.hw.mes.api.domain.MesOrderBind; +//import org.apache.commons.lang3.builder.ToStringBuilder; +//import org.apache.commons.lang3.builder.ToStringStyle; +//import com.hw.common.core.annotation.Excel; +//import com.hw.common.core.web.domain.BaseEntity; +// +///** +// * 采购订单信息对象 mes_purchase_order +// * +// * @author Yinq +// * @date 2024-02-19 +// */ +//public class MesPurchaseOrder extends BaseEntity { +// private static final long serialVersionUID = 1L; +// +// /** +// * 主键标识 +// */ +// private Long purchaseOrderId; +// +// /** +// * ERP的主键信息;对应FID +// */ +// @Excel(name = "ERP的主键信息;对应FID") +// private Long erpId; +// +// /** +// * 对应金蝶ERP订单明细的ID;对应FPOOrderEntry.FEntryID +// */ +// @Excel(name = "对应金蝶ERP订单明细的ID;对应FPOOrderEntry.FEntryID") +// private Long fentryId; +// +// /** +// * 采购订单编号;对应FBillNo +// */ +// @Excel(name = "采购订单编号;对应FBillNo") +// private String poNo; +// +// /** +// * 单据状态;FDocumentStatus +// */ +// @Excel(name = "单据状态;FDocumentStatus") +// private String documentStatus; +// +// /** +// * 物料ID,关联物料信息主键 +// */ +// @Excel(name = "物料ID,关联物料信息主键") +// private Long materialId; +// +// /** +// * 物料编码;对应FMaterialId.FNumber +// */ +// @Excel(name = "物料编码;对应FMaterialId.FNumber") +// private String materialCode; +// +// /** +// * 物料名称;对应FMaterialId.FName +// */ +// @Excel(name = "物料名称;对应FMaterialId.FName") +// private String materialName; +// +// /** +// * 采购订单分类:1ERP同步,2虚拟采购订单 +// */ +// private String purchaseOrderClassfication; +// +// +// /** +// * 订单计划数量;对应FQty +// */ +// @Excel(name = "订单计划数量;对应FQty") +// private BigDecimal orderAmount; +// +// /** +// * 完成采购数量 +// */ +// @Excel(name = "完成采购数量") +// private BigDecimal completeAmount; +// +// /** +// * 审核日期;对应FApproveDate +// */ +// @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") +// @Excel(name = "审核日期;对应FApproveDate", width = 30, dateFormat = "yyyy-MM-dd") +// private Date approveDate; +// +// /** +// * ERP最后修改日期;对应FModifyDate +// */ +// @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") +// @Excel(name = "ERP最后修改日期;对应FModifyDate", width = 30, dateFormat = "yyyy-MM-dd") +// private Date erpModifyDate; +// +// /** +// * 计划交货日期;对应FDeliveryDate +// */ +// @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") +// @Excel(name = "计划交货日期;对应FDeliveryDate", width = 30, dateFormat = "yyyy-MM-dd") +// private Date planDeliveryDate; +// +// /** +// * 计划开始日期 +// */ +// @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") +// @Excel(name = "计划开始日期", width = 30, dateFormat = "yyyy-MM-dd") +// private Date beginDate; +// +// /** +// * 计划结束日期 +// */ +// @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") +// @Excel(name = "计划结束日期", width = 30, dateFormat = "yyyy-MM-dd") +// private Date endDate; +// +// /** +// * 订单状态(1待采购2采购中3采购完成) +// */ +// @Excel(name = "订单状态(1待采购2采购中3采购完成)") +// private String orderStatus; +// +// /** +// * 完成日期 +// */ +// @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") +// @Excel(name = "完成日期", width = 30, dateFormat = "yyyy-MM-dd") +// private Date completeDate; +// +// /** +// * 是否标识:1-是;0-否 +// */ +// @Excel(name = "是否标识:1-是;0-否") +// private String isFlag; +// +// /** +// * 采购单位;FUnitId +// */ +// @Excel(name = "采购单位;FUnitId") +// private Long unitId; +// +// /** +// * 库存单位;FStockUnitID +// */ +// @Excel(name = "库存单位;FStockUnitID") +// private Long stockUnitId; +// +// /** +// * 计价单位;FPriceUnitID +// */ +// @Excel(name = "计价单位;FPriceUnitID") +// private Long priceUnitId; +// +// /** +// * 辅助属性;FAuxPropId +// */ +// @Excel(name = "辅助属性;FAuxPropId") +// private Long auxPropId; +// +// /** +// * 源单编号;FSrcBillNo +// */ +// @Excel(name = "源单编号;FSrcBillNo") +// private String srcBillNo; +// +// /** +// * 采购组织;FPurchaseOrgId +// */ +// @Excel(name = "采购组织;FPurchaseOrgId") +// private Long purchaseOrgId; +// +// /** +// * 京源项目;F_TOND_Base +// */ +// @Excel(name = "京源项目;F_TOND_Base") +// private String tondBase; +// +// /** +// * 供应商ID;FSupplierId +// */ +// @Excel(name = "供应商ID;FSupplierId") +// private Long supplierId; +// +// /** +// * 采购销售订单绑定信息信息 +// */ +// private List mesOrderBindList; +// +// /** +// * 判断是否需要绑定 +// */ +// private String bindFlag; +// +// /** +// * 规格参数 +// */ +// private String specificationParameter; +// +// /** +// * 物料规格 +// */ +// private String materialSpec; +// +// /** +// * 销售订单主键 +// */ +// private Long saleOrderId; +// +// /** +// * 采购销售订单绑定主键 +// */ +// private Long orderBindId; +// +// /** +// * 已绑定数 +// */ +// private BigDecimal boundAmount; +// +// /** +// * 销售订单已绑定数 +// */ +// private BigDecimal saleBindAmount; +// +// /** +// * 安全库存数 +// */ +// private BigDecimal safeAmount; +// +// /** +// * 条码数 +// */ +// private BigDecimal barcodeAmount; +// +// /** +// * 更新绑定数量 +// */ +// private BigDecimal updateAmount; +// +// /** +// * 序号 +// */ +// private Long serialNumber; +// +// /** +// * 订单绑定的数量和条码的数量,以-分割 +// */ +// private String orderBindBarcodeAmount; +// +// /** +// * 安全库存绑定的数量和条码的数量,以-分割 +// */ +// private String safeBindBarcodeAmount; +// +// private String batchFlag; +// +// private BigDecimal batchAmount; +// +// private long mesMaterialId;//物料信息表的物料ID主键 +// +// private String alwaysFlag; +// +// private Long productId; +// +// private String productCode; +// +// private String productName; +// +// private String productSpec; +// +// private String safeFlag; +// +// private String saleOrderCode; +// +// private BigDecimal bindAmount; +// +// private BigDecimal saleOrderAmount; +// +// private String mergeFlag; +// +// private String singleFlag; +// +// private Long erpMaterialId; +// +// +// public Long getSerialNumber() { +// return serialNumber; +// } +// +// public void setSerialNumber(Long serialNumber) { +// this.serialNumber = serialNumber; +// } +// +// public BigDecimal getUpdateAmount() { +// return updateAmount; +// } +// +// public void setUpdateAmount(BigDecimal updateAmount) { +// this.updateAmount = updateAmount; +// } +// +// public BigDecimal getBoundAmount() { +// return boundAmount; +// } +// +// public void setBoundAmount(BigDecimal boundAmount) { +// this.boundAmount = boundAmount; +// } +// +// public BigDecimal getSaleBindAmount() { +// return saleBindAmount; +// } +// +// public void setSaleBindAmount(BigDecimal saleBindAmount) { +// this.saleBindAmount = saleBindAmount; +// } +// +// public BigDecimal getSafeAmount() { +// return safeAmount; +// } +// +// public void setSafeAmount(BigDecimal safeAmount) { +// this.safeAmount = safeAmount; +// } +// +// public BigDecimal getBarcodeAmount() { +// return barcodeAmount; +// } +// +// public void setBarcodeAmount(BigDecimal barcodeAmount) { +// this.barcodeAmount = barcodeAmount; +// } +// +// public Long getSaleOrderId() { +// return saleOrderId; +// } +// +// public void setSaleOrderId(Long saleOrderId) { +// this.saleOrderId = saleOrderId; +// } +// +// public Long getOrderBindId() { +// return orderBindId; +// } +// +// public void setOrderBindId(Long orderBindId) { +// this.orderBindId = orderBindId; +// } +// +// public String getMaterialSpec() { +// return materialSpec; +// } +// +// public void setMaterialSpec(String materialSpec) { +// this.materialSpec = materialSpec; +// } +// +// public String getSpecificationParameter() { +// return specificationParameter; +// } +// +// public void setSpecificationParameter(String specificationParameter) { +// this.specificationParameter = specificationParameter; +// } +// +// public void setPurchaseOrderId(Long purchaseOrderId) { +// this.purchaseOrderId = purchaseOrderId; +// } +// +// public Long getPurchaseOrderId() { +// return purchaseOrderId; +// } +// +// public void setErpId(Long erpId) { +// this.erpId = erpId; +// } +// +// public Long getErpId() { +// return erpId; +// } +// +// public void setFentryId(Long fentryId) { +// this.fentryId = fentryId; +// } +// +// public Long getFentryId() { +// return fentryId; +// } +// +// public void setPoNo(String poNo) { +// this.poNo = poNo; +// } +// +// public String getPoNo() { +// return poNo; +// } +// +// public void setDocumentStatus(String documentStatus) { +// this.documentStatus = documentStatus; +// } +// +// public String getDocumentStatus() { +// return documentStatus; +// } +// +// public void setMaterialId(Long materialId) { +// this.materialId = materialId; +// } +// +// public Long getMaterialId() { +// return materialId; +// } +// +// public void setMaterialCode(String materialCode) { +// this.materialCode = materialCode; +// } +// +// public String getMaterialCode() { +// return materialCode; +// } +// +// public void setMaterialName(String materialName) { +// this.materialName = materialName; +// } +// +// public String getMaterialName() { +// return materialName; +// } +// +// public String getPurchaseOrderClassfication() { +// return purchaseOrderClassfication; +// } +// +// public void setPurchaseOrderClassfication(String purchaseOrderClassfication) { +// this.purchaseOrderClassfication = purchaseOrderClassfication; +// } +// +// public void setOrderAmount(BigDecimal orderAmount) { +// this.orderAmount = orderAmount; +// } +// +// public BigDecimal getOrderAmount() { +// return orderAmount; +// } +// +// public void setCompleteAmount(BigDecimal completeAmount) { +// this.completeAmount = completeAmount; +// } +// +// public BigDecimal getCompleteAmount() { +// return completeAmount; +// } +// +// public void setApproveDate(Date approveDate) { +// this.approveDate = approveDate; +// } +// +// public Date getApproveDate() { +// return approveDate; +// } +// +// public void setErpModifyDate(Date erpModifyDate) { +// this.erpModifyDate = erpModifyDate; +// } +// +// public Date getErpModifyDate() { +// return erpModifyDate; +// } +// +// public void setPlanDeliveryDate(Date planDeliveryDate) { +// this.planDeliveryDate = planDeliveryDate; +// } +// +// public Date getPlanDeliveryDate() { +// return planDeliveryDate; +// } +// +// public void setBeginDate(Date beginDate) { +// this.beginDate = beginDate; +// } +// +// public Date getBeginDate() { +// return beginDate; +// } +// +// public void setEndDate(Date endDate) { +// this.endDate = endDate; +// } +// +// public Date getEndDate() { +// return endDate; +// } +// +// public void setOrderStatus(String orderStatus) { +// this.orderStatus = orderStatus; +// } +// +// public String getOrderStatus() { +// return orderStatus; +// } +// +// public void setCompleteDate(Date completeDate) { +// this.completeDate = completeDate; +// } +// +// public Date getCompleteDate() { +// return completeDate; +// } +// +// public void setIsFlag(String isFlag) { +// this.isFlag = isFlag; +// } +// +// public String getIsFlag() { +// return isFlag; +// } +// +// public void setUnitId(Long unitId) { +// this.unitId = unitId; +// } +// +// public Long getUnitId() { +// return unitId; +// } +// +// public void setStockUnitId(Long stockUnitId) { +// this.stockUnitId = stockUnitId; +// } +// +// public Long getStockUnitId() { +// return stockUnitId; +// } +// +// public void setPriceUnitId(Long priceUnitId) { +// this.priceUnitId = priceUnitId; +// } +// +// public Long getPriceUnitId() { +// return priceUnitId; +// } +// +// public void setAuxPropId(Long auxPropId) { +// this.auxPropId = auxPropId; +// } +// +// public Long getAuxPropId() { +// return auxPropId; +// } +// +// public void setSrcBillNo(String srcBillNo) { +// this.srcBillNo = srcBillNo; +// } +// +// public String getSrcBillNo() { +// return srcBillNo; +// } +// +// public void setPurchaseOrgId(Long purchaseOrgId) { +// this.purchaseOrgId = purchaseOrgId; +// } +// +// public Long getPurchaseOrgId() { +// return purchaseOrgId; +// } +// +// public void setTondBase(String tondBase) { +// this.tondBase = tondBase; +// } +// +// public String getTondBase() { +// return tondBase; +// } +// +// public void setSupplierId(Long supplierId) { +// this.supplierId = supplierId; +// } +// +// public Long getSupplierId() { +// return supplierId; +// } +// +// public List getMesOrderBindList() { +// return mesOrderBindList; +// } +// +// public void setMesOrderBindList(List mesOrderBindList) { +// this.mesOrderBindList = mesOrderBindList; +// } +// +// public String getBindFlag() { +// return bindFlag; +// } +// +// public void setBindFlag(String bindFlag) { +// this.bindFlag = bindFlag; +// } +// +// public String getOrderBindBarcodeAmount() { +// return orderBindBarcodeAmount; +// } +// +// public void setOrderBindBarcodeAmount(String orderBindBarcodeAmount) { +// this.orderBindBarcodeAmount = orderBindBarcodeAmount; +// } +// +// public String getSafeBindBarcodeAmount() { +// return safeBindBarcodeAmount; +// } +// +// public void setSafeBindBarcodeAmount(String safeBindBarcodeAmount) { +// this.safeBindBarcodeAmount = safeBindBarcodeAmount; +// } +// +// public String getBatchFlag() { +// return batchFlag; +// } +// +// public void setBatchFlag(String batchFlag) { +// this.batchFlag = batchFlag; +// } +// +// public BigDecimal getBatchAmount() { +// return batchAmount; +// } +// +// public void setBatchAmount(BigDecimal batchAmount) { +// this.batchAmount = batchAmount; +// } +// +// public long getMesMaterialId() { +// return mesMaterialId; +// } +// +// public void setMesMaterialId(long mesMaterialId) { +// this.mesMaterialId = mesMaterialId; +// } +// +// public String getAlwaysFlag() { +// return alwaysFlag; +// } +// +// public void setAlwaysFlag(String alwaysFlag) { +// this.alwaysFlag = alwaysFlag; +// } +// +// public Long getProductId() { +// return productId; +// } +// +// public void setProductId(Long productId) { +// this.productId = productId; +// } +// +// public String getProductCode() { +// return productCode; +// } +// +// public void setProductCode(String productCode) { +// this.productCode = productCode; +// } +// +// public String getProductName() { +// return productName; +// } +// +// public void setProductName(String productName) { +// this.productName = productName; +// } +// +// public String getProductSpec() { +// return productSpec; +// } +// +// public void setProductSpec(String productSpec) { +// this.productSpec = productSpec; +// } +// +// public String getSafeFlag() { +// return safeFlag; +// } +// +// public void setSafeFlag(String safeFlag) { +// this.safeFlag = safeFlag; +// } +// +// public String getSaleOrderCode() { +// return saleOrderCode; +// } +// +// public void setSaleOrderCode(String saleOrderCode) { +// this.saleOrderCode = saleOrderCode; +// } +// +// public BigDecimal getBindAmount() { +// return bindAmount; +// } +// +// public void setBindAmount(BigDecimal bindAmount) { +// this.bindAmount = bindAmount; +// } +// +// public BigDecimal getSaleOrderAmount() { +// return saleOrderAmount; +// } +// +// public void setSaleOrderAmount(BigDecimal saleOrderAmount) { +// this.saleOrderAmount = saleOrderAmount; +// } +// +// public String getMergeFlag() { +// return mergeFlag; +// } +// +// public void setMergeFlag(String mergeFlag) { +// this.mergeFlag = mergeFlag; +// } +// +// public String getSingleFlag() { +// return singleFlag; +// } +// +// public void setSingleFlag(String singleFlag) { +// this.singleFlag = singleFlag; +// } +// +// public Long getErpMaterialId() { +// return erpMaterialId; +// } +// +// public void setErpMaterialId(Long erpMaterialId) { +// this.erpMaterialId = erpMaterialId; +// } +// +// @Override +// public String toString() { +// return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) +// .append("purchaseOrderId", getPurchaseOrderId()) +// .append("erpId", getErpId()) +// .append("fentryId", getFentryId()) +// .append("poNo", getPoNo()) +// .append("documentStatus", getDocumentStatus()) +// .append("materialId", getMaterialId()) +// .append("materialCode", getMaterialCode()) +// .append("materialName", getMaterialName()) +// .append("orderAmount", getOrderAmount()) +// .append("completeAmount", getCompleteAmount()) +// .append("approveDate", getApproveDate()) +// .append("erpModifyDate", getErpModifyDate()) +// .append("planDeliveryDate", getPlanDeliveryDate()) +// .append("beginDate", getBeginDate()) +// .append("endDate", getEndDate()) +// .append("orderStatus", getOrderStatus()) +// .append("completeDate", getCompleteDate()) +// .append("isFlag", getIsFlag()) +// .append("unitId", getUnitId()) +// .append("stockUnitId", getStockUnitId()) +// .append("priceUnitId", getPriceUnitId()) +// .append("auxPropId", getAuxPropId()) +// .append("srcBillNo", getSrcBillNo()) +// .append("purchaseOrgId", getPurchaseOrgId()) +// .append("tondBase", getTondBase()) +// .append("supplierId", getSupplierId()) +// .append("remark", getRemark()) +// .append("createBy", getCreateBy()) +// .append("createTime", getCreateTime()) +// .append("updateBy", getUpdateBy()) +// .append("updateTime", getUpdateTime()) +// .append("mesOrderBindList", getMesOrderBindList()) +// .toString(); +// } +// +// @Override +// public boolean equals(Object o) { +// if (this == o) return true; +// if (o == null || getClass() != o.getClass()) return false; +// MesPurchaseOrder that = (MesPurchaseOrder) o; +// boundAmount = boundAmount == null ? BigDecimal.ZERO : boundAmount; +// safeAmount = safeAmount == null ? BigDecimal.ZERO : safeAmount; +// that.boundAmount = that.boundAmount == null ? BigDecimal.ZERO : that.boundAmount; +// that.safeAmount = that.safeAmount == null ? BigDecimal.ZERO : that.safeAmount; +// return Objects.equals(purchaseOrderId, that.purchaseOrderId) +// && orderAmount.compareTo(that.orderAmount) == 0 //订单数量 +// && boundAmount.compareTo(that.boundAmount) == 0 //已绑定所有销售订单的总数量 +// && safeAmount.compareTo(that.safeAmount) == 0 //安全库存数量 +// && Objects.equals(orderBindBarcodeAmount, that.orderBindBarcodeAmount)//订单已绑定的数量-订单已生成的条码数量 +// && Objects.equals(safeBindBarcodeAmount, that.safeBindBarcodeAmount); //安全库存的数量-安全库存已生成的条码数量 +// } +// +// @Override +// public int hashCode() { +// return Objects.hash(purchaseOrderId, orderAmount, boundAmount, safeAmount, orderBindBarcodeAmount, safeBindBarcodeAmount); +// } +//} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java index 6b4c026..50959e0 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesSaleOrder.java @@ -5,6 +5,7 @@ import java.util.Date; import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; +import com.hw.mes.api.domain.MesPurchaseOrder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.hw.common.core.annotation.Excel; diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseOrderMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseOrderMapper.java index a458f19..7b30fc4 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseOrderMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesPurchaseOrderMapper.java @@ -3,7 +3,7 @@ package com.hw.mes.mapper; import java.util.List; import com.hw.mes.api.domain.MesOrderBind; -import com.hw.mes.domain.MesPurchaseOrder; +import com.hw.mes.api.domain.MesPurchaseOrder; import org.apache.ibatis.annotations.Param; /** @@ -143,4 +143,13 @@ public interface MesPurchaseOrderMapper public List selectNotRawInstockPurchaseOrderList(String applyDateStr); + /** + * 查询采购订单信息 + * + * @param purchaseOrderId 采购订单信息主键 + * @return 采购订单信息 + */ + public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId); + + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseOrderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseOrderService.java index a703676..4a53d72 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseOrderService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesPurchaseOrderService.java @@ -3,7 +3,7 @@ package com.hw.mes.service; import java.util.List; import com.hw.common.core.exception.ServiceException; -import com.hw.mes.domain.MesPurchaseOrder; +import com.hw.mes.api.domain.MesPurchaseOrder; import com.hw.mes.domain.MesSaleOrder; import org.springframework.transaction.annotation.Transactional; @@ -150,4 +150,12 @@ public interface IMesPurchaseOrderService * @return List */ public int autoOutstockLastPurchaseOrders(String dateStr); + + /** + * 查询采购订单信息, Join supplier + * + * @param purchaseOrderId 采购订单信息主键 + * @return 采购订单信息 + */ + public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java index cd504a3..828d888 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java @@ -84,4 +84,11 @@ public interface IMesSaleOrderService * @return */ public List getRelateProductsBySaleOrderId(Long saleOrderId); + + /** + * 根据relatesaleorderId查询关联的原材料信息 + * @param saleOrderId + * @return + */ + public List selectMesSaleOrderRelateJoinList(Long saleOrderId); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java index cc1a365..47e0754 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java @@ -189,36 +189,36 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService String poNo = StringUtils.isEmpty(mesBaseBarcodeInfo.getPoNo()) ? "0" : mesBaseBarcodeInfo.getPoNo(); String batchCode = this.getRawBatchCode(poNo); // if (!mesBaseMaterialInfo.getAlwaysFlag().equals(MesConstants.MES_MATERIAL_ALWAYS_FLAG_YES)) { - Long orderBindId = mesBaseBarcodeInfo.getOrderBindId(); - if (orderBindId == null) { - throw new ServiceException("请选择绑定销售订单信息的采购订单"); - } + Long orderBindId = mesBaseBarcodeInfo.getOrderBindId(); + if (orderBindId == null) { + throw new ServiceException("请选择绑定销售订单信息的采购订单"); + } - MesOrderBind mesOrderBind = mesOrderBindMapper.selectMesOrderBindByOrderBindId(orderBindId); - BigDecimal bindAmount = mesOrderBind.getBindAmount(); - BigDecimal bindBarcodeAmount = mesOrderBind.getBarcodeAmount();//已经生成的条码数量 - BigDecimal availableAmount = bindAmount.subtract(bindBarcodeAmount); - if (barcodeAmount.compareTo(availableAmount) > 0) { - throw new ServiceException("条码数量不能大于可用数量"); - } + MesOrderBind mesOrderBind = mesOrderBindMapper.selectMesOrderBindByOrderBindId(orderBindId); + BigDecimal bindAmount = mesOrderBind.getBindAmount(); + BigDecimal bindBarcodeAmount = mesOrderBind.getBarcodeAmount();//已经生成的条码数量 + BigDecimal availableAmount = bindAmount.subtract(bindBarcodeAmount); + if (barcodeAmount.compareTo(availableAmount) > 0) { + throw new ServiceException("条码数量不能大于可用数量"); + } - MesBaseBarcodeInfo toInsertedBarcodeInfo; - for (long i = 0; i < barcodeAmount.intValue(); i++) { - // 生成条码数量的不同条码内容 - toInsertedBarcodeInfo = getInsertedBarcodeInfo(mesBaseBarcodeInfo, Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode), batchCode, userName, currentDate); - toInsertedBarcodeInfo.setSaleOrderId(mesOrderBind.getSaleOrderId()); - toInsertedBarcodeInfo.setSaleorderCode(mesOrderBind.getSaleOrderCode()); - toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO); - mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(toInsertedBarcodeInfo); - } + MesBaseBarcodeInfo toInsertedBarcodeInfo; + for (long i = 0; i < barcodeAmount.intValue(); i++) { + // 生成条码数量的不同条码内容 + toInsertedBarcodeInfo = getInsertedBarcodeInfo(mesBaseBarcodeInfo, Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode), batchCode, userName, currentDate); + toInsertedBarcodeInfo.setSaleOrderId(mesOrderBind.getSaleOrderId()); + toInsertedBarcodeInfo.setSaleorderCode(mesOrderBind.getSaleOrderCode()); + toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO); + mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(toInsertedBarcodeInfo); + } - //更新订单绑定的条码已绑定数量 - mesOrderBind.setBarcodeAmount(bindBarcodeAmount.add(barcodeAmount)); - mesOrderBind.setUpdateBy(userName); - mesOrderBind.setUpdateTime(currentDate); - mesOrderBindMapper.updateMesOrderBind(mesOrderBind); + //更新订单绑定的条码已绑定数量 + mesOrderBind.setBarcodeAmount(bindBarcodeAmount.add(barcodeAmount)); + mesOrderBind.setUpdateBy(userName); + mesOrderBind.setUpdateTime(currentDate); + mesOrderBindMapper.updateMesOrderBind(mesOrderBind); // } else { @@ -869,6 +869,11 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService @Override public int insertInternalMesBaseBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) { Long materialId = 0L; + Long finalProductId = mesBaseBarcodeInfo.getProductId(); + if (finalProductId == null) { + throw new ServiceException("没有成品信息"); + } + String productBarcodes = mesBaseBarcodeInfo.getProductBarcode();//多个成品条码以,隔开 String splitCharacterEnglish = ","; String splitCharacterChinese = ","; @@ -993,6 +998,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService List toInsertedSaleOrderRelateList = new ArrayList<>(); + StringBuilder productNameTip = new StringBuilder(); + boolean isProductSame = false;//用来判断四楼的成品对应五楼的成品是否跟五楼生产的成品一致 for (MesBaseBarcodeInfo productBarcodeInfo : productBarcodeInfoList) { if (StringUtils.isNotEmpty(productBarcodeInfo.getPalletInfoCode())) { productBarcodeInfo.setPalletInfoCode(""); @@ -1002,47 +1009,61 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(productBarcodeInfo); } - Long bindMaterialId = productBarcodeInfo.getMaterialId(); - MesMaterialBom queryMaterialBom = new MesMaterialBom(); - queryMaterialBom.setMaterialId(bindMaterialId); - queryMaterialBom.setActiveFlag(MesConstants.MES_MATERIAL_BOM_ACTIVE_FLAG_NORMAL); - List mesMaterialBomList = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom); - if (mesMaterialBomList == null || mesMaterialBomList.isEmpty()) { - allErrorMsgBuilder.append("成品条码[").append(productBarcodeInfo.getBarcodeInfo()).append("]没有维护生产bom信息;"); + MesBaseMaterialInfo mesBaseMaterialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialId(productBarcodeInfo.getProductId()); + productNameTip.append("成品条码:").append(productBarcodeInfo.getBarcodeInfo()).append(",成品编码为:").append(mesBaseMaterialInfo.getMaterialCode()).append(";"); + if (productBarcodeInfo.getProductId().equals(finalProductId)) { + isProductSame = true; } + Long bindMaterialId = productBarcodeInfo.getMaterialId(); +// MesMaterialBom queryMaterialBom = new MesMaterialBom(); +// queryMaterialBom.setMaterialId(bindMaterialId); +// queryMaterialBom.setActiveFlag(MesConstants.MES_MATERIAL_BOM_ACTIVE_FLAG_NORMAL); +// List mesMaterialBomList = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom); +// if (mesMaterialBomList == null || mesMaterialBomList.isEmpty()) { +// allErrorMsgBuilder.append("成品条码[").append(productBarcodeInfo.getBarcodeInfo()).append("]没有维护生产bom信息;"); +// } - List childMaterialBomList = mesMaterialBomList.stream(). - filter(materialBom -> materialBom.getParentId() != null && !materialBom.getParentId().equals(0L)) - .collect(Collectors.toList()); +// List childMaterialBomList = mesMaterialBomList.stream(). +// filter(materialBom -> materialBom.getParentId() != null && !materialBom.getParentId().equals(0L)) +// .collect(Collectors.toList()); - if (childMaterialBomList == null || childMaterialBomList.isEmpty()) { - allErrorMsgBuilder.append("成品条码[").append(productBarcodeInfo.getBarcodeInfo()).append("]没有维护在五楼成品的生产bom信息中;"); - } else if (childMaterialBomList.size() > 1) { - allErrorMsgBuilder.append("成品条码[").append(productBarcodeInfo.getBarcodeInfo()) - .append("]五楼成品的生产bom信息不能多于1个[").append(mesMaterialBomList.size()).append("个];"); - } else { - MesMaterialBom childMaterialBom = childMaterialBomList.get(0); - MesMaterialBom parentBom = mesMaterialBomMapper.selectMesMaterialBomByMaterialBomId(childMaterialBom.getParentId()); - - //四楼到五楼,主要是多个成品合并到一个托盘后生成原材料条码需要保存以下信息,一个成品的保不保存无所谓 - MesSaleOrderRelate saleOrderRelate = new MesSaleOrderRelate(); - saleOrderRelate.setBarcodeInfo(barcodeInfo); - saleOrderRelate.setSaleOrderId(mesBaseBarcodeInfo.getSaleOrderId()); - saleOrderRelate.setVirtualMaterialId(materialId); - saleOrderRelate.setMaterialId(bindMaterialId);//四楼成品条码的物料id作为五楼原材料的物料id - saleOrderRelate.setProductId(parentBom.getMaterialId()); - saleOrderRelate.setBindBarcode(productBarcodeInfo.getBarcodeInfo()); - saleOrderRelate.setCreateBy(userName); - saleOrderRelate.setCreateTime(currentDate); - - saleOrderRelate.setOrderBindId(0L); - saleOrderRelate.setRelateSaleOrderId(0L); - saleOrderRelate.setRelateSaleOrderCode(""); - saleOrderRelate.setRelateSaleOrderAmount(BigDecimal.ONE); - - toInsertedSaleOrderRelateList.add(saleOrderRelate); +// if (childMaterialBomList == null || childMaterialBomList.isEmpty()) { +// allErrorMsgBuilder.append("成品条码[").append(productBarcodeInfo.getBarcodeInfo()).append("]没有维护在五楼成品的生产bom信息中;"); +// } else if (childMaterialBomList.size() > 1) { +// allErrorMsgBuilder.append("成品条码[").append(productBarcodeInfo.getBarcodeInfo()) +// .append("]五楼成品的生产bom信息不能多于1个[").append(mesMaterialBomList.size()).append("个];"); +// } else { +// MesMaterialBom childMaterialBom = childMaterialBomList.get(0); +// MesMaterialBom parentBom = mesMaterialBomMapper.selectMesMaterialBomByMaterialBomId(childMaterialBom.getParentId()); - } + //不需要以下判断,在生成后托盘号会清空 +// MesSaleOrderRelate bindBarcodeRelate = mesSaleOrderRelateMapper.selectMesSaleOrderRelateByBindBarcode(productBarcodeInfo.getBarcodeInfo()); +// if (bindBarcodeRelate != null) { +// allErrorMsgBuilder.append("成品条码:").append(productBarcodeInfo.getBarcodeInfo()).append("已经生成过原材料条码;"); +// } + //四楼到五楼,主要是多个成品合并到一个托盘后生成原材料条码需要保存以下信息,一个成品的保不保存无所谓 + MesSaleOrderRelate saleOrderRelate = new MesSaleOrderRelate(); + saleOrderRelate.setBarcodeInfo(barcodeInfo); + saleOrderRelate.setSaleOrderId(mesBaseBarcodeInfo.getSaleOrderId()); + saleOrderRelate.setVirtualMaterialId(materialId); + saleOrderRelate.setMaterialId(bindMaterialId);//四楼成品条码的物料id作为五楼原材料的物料id + saleOrderRelate.setProductId(productBarcodeInfo.getProductId()); + saleOrderRelate.setBindBarcode(productBarcodeInfo.getBarcodeInfo()); + saleOrderRelate.setCreateBy(userName); + saleOrderRelate.setCreateTime(currentDate); + + saleOrderRelate.setOrderBindId(0L); + saleOrderRelate.setRelateSaleOrderId(0L); + saleOrderRelate.setRelateSaleOrderCode(""); + saleOrderRelate.setRelateSaleOrderAmount(BigDecimal.ONE); + + toInsertedSaleOrderRelateList.add(saleOrderRelate); + +// } + } + + if (!isProductSame) { + allErrorMsgBuilder.append("成品条码对应五楼成品与此生产明细不一致,[").append(productNameTip).append("];"); } if (allErrorMsgBuilder.length() > 0) { @@ -1337,6 +1358,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService //purchaseorder可以不用判断,主要看生成条码的数量 + //找到销售订单物料的顶级bom信息 Long erpMaterialId = saleOrder.getMaterialId(); MesMaterialBom queryMaterialBom = new MesMaterialBom(); queryMaterialBom.setErpMaterialId(erpMaterialId); @@ -1352,6 +1374,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService .append(mesSaleOrderRelate.getProductCode()).append("成品名称:").append(mesSaleOrderRelate.getProductName()) .append("成品规格").append(mesSaleOrderRelate.getProductSpec()).append("; "); } else { + //修改 MesMaterialBom mesMaterialBom = mesMaterialBoms.get(0); //判断所选物料是否在销售订单的成品bom中(在绑定时判断) @@ -1493,12 +1516,24 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService mesMaterialBomMapper.insertMesMaterialBom(virtualMaterialBom); toUpdatedMaterialBoms.forEach(umb -> { + MesMaterialBom queryChildBom = new MesMaterialBom(); + queryChildBom.setParentId(umb.getParentId()); + List childBomList = mesMaterialBomMapper.selectMesMaterialBomList(queryChildBom); + for (MesMaterialBom childBom : childBomList) { + childBom.setAncestors(childBom.getAncestors() + "," + virtualMaterialBom.getMaterialBomId()); + childBom.setUpdateBy(userName); + childBom.setUpdateTime(currentDate); + mesMaterialBomMapper.updateMesMaterialBom(childBom); + } + umb.setParentId(virtualMaterialBom.getMaterialBomId()); umb.setAncestors(umb.getAncestors() + "," + umb.getParentId()); umb.setTopFlag(MesConstants.MES_MATERIAL_BOM_TOP_FLAG_NO); umb.setUpdateBy(userName); umb.setUpdateTime(currentDate); mesMaterialBomMapper.updateMesMaterialBom(umb); + + }); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java index cdd2d73..3f0cbff 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java @@ -309,9 +309,14 @@ public class MesImportImpl implements IMesImportService { throw new ServiceException("Excel格式错误:请设置成文本格式"); } + int productNameIndex = productBom.indexOf("("); + if (productNameIndex < 0) productNameIndex = productBom.indexOf("("); + if (productNameIndex > 0) { + productBom = productBom.substring(0,productNameIndex); + } - productBom = productBom.replaceAll("(.*?)", ""); - productBom = productBom.replaceAll("(.*?)", ""); +// productBom = productBom.replaceAll("(.*?)", ""); +// productBom = productBom.replaceAll("(.*?)", ""); MesBaseMaterialInfo productMaterial = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(productBom); if (productMaterial == null) { throw new ServiceException("Excel格式错误:物料编号:" + productBom + "的信息不存在!"); @@ -355,6 +360,7 @@ public class MesImportImpl implements IMesImportService { break; } Row rowC = sheet.getRow(i); + if (rowC == null) break; Cell numberCell = rowC.getCell(0); if (StringUtils.isNull(numberCell)) { break; diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java index 493c64e..038bef2 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java @@ -191,21 +191,21 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { } if (mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_SALE)) { - mesProductOrder.setProduceMaterialId(null); + mesProductOrder.setProduceMaterialId(-1L); } else { if (mesProductOrder.getProduceMaterialId() == null) { throw new ServiceException("请选择生产物料"); } - //校验此生产物料是否在销售订单成品物料的生产bom中 - MesMaterialBom queryMaterialBom = new MesMaterialBom(); - queryMaterialBom.setMaterialId(mesProductOrder.getProduceMaterialId()); - queryMaterialBom.setParentId(mesProductOrder.getMaterialBomId()); -// queryMaterialBom.setActiveFlag(MesConstants.MES_MATERIAL_BOM_ACTIVE_FLAG_NORMAL); - List mesMaterialBoms = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom); - if (mesMaterialBoms == null || mesMaterialBoms.isEmpty()) { - throw new ServiceException("所选择生产物料不在选择的成品bom中"); - } + //不需要校验此生产物料是否在销售订单成品物料的生产bom中(5楼的成品bom不包含4楼的成品,4楼的bom也是单独的) +// MesMaterialBom queryMaterialBom = new MesMaterialBom(); +// queryMaterialBom.setMaterialId(mesProductOrder.getProduceMaterialId()); +// queryMaterialBom.setParentId(mesProductOrder.getMaterialBomId()); +//// queryMaterialBom.setActiveFlag(MesConstants.MES_MATERIAL_BOM_ACTIVE_FLAG_NORMAL); +// List mesMaterialBoms = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom); +// if (mesMaterialBoms == null || mesMaterialBoms.isEmpty()) { +// throw new ServiceException("所选择生产物料不在选择的成品bom中"); +// } } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java index be0fc27..500c41a 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java @@ -23,7 +23,7 @@ import com.hw.wms.api.RemoteWmsService; import com.hw.wms.api.domain.vo.WmsAutoOutstockVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.hw.mes.domain.MesPurchaseOrder; +import com.hw.mes.api.domain.MesPurchaseOrder; import com.hw.mes.service.IMesPurchaseOrderService; import org.springframework.transaction.annotation.Transactional; @@ -570,4 +570,15 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService { return 1; } + + /** + * 查询采购订单信息, Join supplier + * + * @param purchaseOrderId 采购订单信息主键 + * @return 采购订单信息 + */ + @Override + public MesPurchaseOrder selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId) { + return mesPurchaseOrderMapper.selectPurchaseOrderJoinSupplierProjectByOrderId(purchaseOrderId); + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java index ae909f6..1a406dd 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java @@ -182,4 +182,19 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService { querySaleOrderRelate.setSaleOrderId(saleOrderId); return mesSaleOrderRelateMapper.selectMesSaleOrderRelateJoinProductList(querySaleOrderRelate); } + + /** + * 根据relatesaleorderId查询关联的原材料信息 + * @param saleOrderId + * @return + */ + @Override + public List selectMesSaleOrderRelateJoinList(Long saleOrderId){ + MesSaleOrderRelate querySaleOrderRelate = new MesSaleOrderRelate(); + querySaleOrderRelate.setSaleOrderId(saleOrderId); + return mesSaleOrderRelateMapper.selectMesSaleOrderRelateJoinList(querySaleOrderRelate); + } + + + } diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml index 950f917..3748c71 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml @@ -17,6 +17,7 @@ + @@ -63,6 +64,7 @@ bbi.pallet_info_code, bbi.bind_barcode, bbi.material_id, + bbi.product_id, bbi.barcode_spec, bmi.material_code, bmi.material_name, @@ -176,6 +178,7 @@ pallet_info_code, bind_barcode, material_id, + product_id, barcode_spec, manufacturer_id, amount, @@ -214,6 +217,7 @@ #{palletInfoCode}, #{bindBarcode}, #{materialId}, + #{productId}, #{barcodeSpec}, #{manufacturerId}, #{amount}, diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml index 8b5bded..b88163a 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml @@ -368,6 +368,6 @@ diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml index 0b3a59a..bd093e2 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml @@ -54,7 +54,7 @@ - + @@ -349,7 +349,7 @@ mpp.material_bom_id, mpp.process_id, mpp.process_order, mpp.last_process_id,mpp.final_process_flag,mpp.user_id, mpp.station_id, mpp.dispatch_amount, mpp.plan_amount, mpp.complete_amount, mpp.plan_begin_time, mpp.plan_end_time, mpp.real_begin_time, mpp.real_end_time, - mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mpo.sale_type,mpo.cabinet_channel, + mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mpo.sale_type,mpo.cabinet_channel,mpo.material_id as product_id, mbmi.material_code,mbmi.material_name,mbmi.material_spec from mes_product_plan mpp left join mes_product_order mpo on mpp.product_order_id = mpo.product_order_id left join mes_base_material_info mbmi on mpp.material_id=mbmi.material_id diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml index 90aafc8..d495832 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml @@ -63,6 +63,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -486,4 +488,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and mpo.order_status ='3' group by mpo.purchase_order_id,mpo.po_no,mpo.material_id + + + + diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java index 9b417b3..a31a5fe 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java @@ -1,5 +1,7 @@ package com.hw.wms.controller; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.hw.common.core.constant.SecurityConstants; import com.hw.common.core.constant.WmsConstants; import com.hw.common.core.domain.R; @@ -607,9 +609,8 @@ public class WmsMobileController extends BaseController { @GetMapping(value = "/getLockLocations") public AjaxResult getLockLocations(WmsBaseLocation wmsBaseLocation) { - Map> locationMap = wmsBaseLocationService.getLocationCodesGroupByWarehouse(wmsBaseLocation); - System.out.println(locationMap); - return success(locationMap); + JSONArray locationJsonArr = wmsBaseLocationService.getLocationCodesGroupByWarehouse(wmsBaseLocation); + return success(locationJsonArr); } } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsBaseLocationService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsBaseLocationService.java index 1908d38..13d27d1 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsBaseLocationService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsBaseLocationService.java @@ -3,6 +3,8 @@ package com.hw.wms.service; import java.util.List; import java.util.Map; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.hw.common.core.utils.DateUtils; import com.hw.wms.domain.WmsBaseLocation; @@ -132,5 +134,5 @@ public interface IWmsBaseLocationService * @param wmsBaseLocation * @return */ - public Map> getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation); + public JSONArray getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java index be4fbc6..6e075de 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java @@ -1,5 +1,7 @@ package com.hw.wms.service.impl; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.hw.common.core.constant.SecurityConstants; import com.hw.common.core.constant.WmsConstants; import com.hw.common.core.enums.WmsLocationStatus; @@ -291,15 +293,25 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { * @return */ @Override - public Map> getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation){ + public JSONArray getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation){ + JSONArray locationCodesByWarehouseJsonArr = new JSONArray(); wmsBaseLocation.setLocationStatus(WmsConstants.WMS_BASE_LOCATION_STATUS_MANUAL_LOCK); List wmsBaseLocations = wmsBaseLocationMapper.selectWmsBaseLocationJoinList(wmsBaseLocation); - Map> locationCodesByWarehouse = wmsBaseLocations.stream() + Map> locationCodesByWarehouseMap = wmsBaseLocations.stream() .collect(Collectors.groupingBy( WmsBaseLocation::getWarehouseName, Collectors.mapping(WmsBaseLocation::getLocationCode, Collectors.toList()) )); - return locationCodesByWarehouse; + JSONObject locationCodesByWarehouseJson; + for (String warehouseName : locationCodesByWarehouseMap.keySet()) { + locationCodesByWarehouseJson = new JSONObject(); + List locationCodeStrs = locationCodesByWarehouseMap.get(warehouseName); + locationCodesByWarehouseJson.put("warehouseName",warehouseName); + locationCodesByWarehouseJson.put("locationCodes",locationCodeStrs); + locationCodesByWarehouseJsonArr.add(locationCodesByWarehouseJson); + } + + return locationCodesByWarehouseJsonArr; } } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsErpScheduledTaskServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsErpScheduledTaskServiceImpl.java index 56de50f..9a1eca9 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsErpScheduledTaskServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsErpScheduledTaskServiceImpl.java @@ -7,6 +7,8 @@ import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.core.web.domain.AjaxResult; import com.hw.jindie.api.RemoteJindieService; +import com.hw.mes.api.RemoteMesService; +import com.hw.mes.api.domain.MesPurchaseOrder; import com.hw.wms.domain.WmsProductInstock; import com.hw.wms.domain.WmsProductOutstock; import com.hw.wms.domain.WmsRawInstock; @@ -51,6 +53,9 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi @Autowired private WmsProductOutstockMapper wmsProductOutstockMapper; + @Autowired + private RemoteMesService remoteMesService; + @Autowired private RemoteJindieService remoteJindieService; @@ -78,6 +83,15 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi @Transactional(propagation = Propagation.REQUIRES_NEW) public void syncInventoryInformation(Map> purchaseOrderIdMap, Long purchaseOrderId, int result) { + R purchaseOrderData = remoteMesService.selectPurchaseOrderJoinSupplierProjectByOrderId(purchaseOrderId, SecurityConstants.INNER); + MesPurchaseOrder mesPurchaseOrder = null; + if (purchaseOrderData != null) { + mesPurchaseOrder = purchaseOrderData.getData(); + } + String supplierCode = mesPurchaseOrder == null ? "": mesPurchaseOrder.getSupplierCode(); + String projectNo = mesPurchaseOrder == null ? "" : mesPurchaseOrder.getProjectNo(); + + List wmsRawInstockList = purchaseOrderIdMap.get(purchaseOrderId); JSONObject data = new JSONObject(); double FRealQty = wmsRawInstockList.stream().mapToDouble(item -> item.getInstockAmount().subtract(item.getErpAmount()).doubleValue()).sum(); @@ -95,6 +109,8 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi data.put("FUnitID", instock.getUnitCode()); data.put("FRealQty", FRealQty); data.put("FStockId", FStockId); + data.put("FSupplierCode", supplierCode); + data.put("FTondBase",projectNo); String params = data.toJSONString(); R paramsResult = remoteJindieService.savePurchaseStorage(params, SecurityConstants.INNER); String paramsResultData = paramsResult.getMsg(); @@ -105,7 +121,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi log.info("synchronizeInventoryInformationToERP同步原材料入库成功:" + paramsResult.toString()); } else { log.error("synchronizeInventoryInformationToERP同步原材料入库失败:" + paramsResult.toString()); - throw new RuntimeException("同步原材料入库失败"+paramsResult.toString()); + throw new RuntimeException("同步原材料入库失败" + paramsResult.toString()); } } @@ -144,6 +160,8 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi wmsRawOutstockMapper.updateWmsRawOutstock(wmsRawOutstock); } +// model.put("F_TOND_Combo", "一般领料"); //领料类型(必填项) + data.put("FDate", DateUtils.getTime()); data.put("FMaterialId", outstock.getMaterialCode()); data.put("FAuxPropId", outstock.getSpecificationParameter()); @@ -167,6 +185,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi /** * 定时同步成品入库信息给ERP + * * @param days 同步days天前数据 * @return */ @@ -176,7 +195,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi int result = 0; WmsProductInstock wmsProductInstock = new WmsProductInstock(); HashMap paramMap = new HashMap<>(); - String beginTime= subtractDaysFromCurrentDate(days); + String beginTime = subtractDaysFromCurrentDate(days); paramMap.put("beginTime", beginTime); paramMap.put("endTime", DateUtils.getTime()); wmsProductInstock.setParams(paramMap); @@ -224,6 +243,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi /** * 定时同步成品出库信息给ERP + * * @param days 同步days天前数据 * @return */ @@ -233,7 +253,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi int result = 0; WmsProductOutstock wmsProductOutstock = new WmsProductOutstock(); HashMap paramMap = new HashMap<>(); - String beginTime= subtractDaysFromCurrentDate(days); + String beginTime = subtractDaysFromCurrentDate(days); paramMap.put("beginTime", beginTime); paramMap.put("endTime", DateUtils.getTime()); wmsProductOutstock.setParams(paramMap); diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml index 1d86a15..862b006 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml @@ -228,9 +228,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join mes_purchase_order mpo on wri.purchase_order_id = mpo.purchase_order_id where wri.execute_status = 2 and (wri.erp_status != 1 or wri.erp_status is null) - and wri.instock_type in (1, 3) + and wri.instock_type in (1, 3, 4) and wri.instock_amount > if(wri.erp_amount is null, 0, wri.erp_amount) and wri.purchase_order_id is not null and wri.purchase_order_id !=0 + and mbmi.material_classfication = '1' diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml index d2ea710..fa9340c 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml @@ -378,7 +378,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where wro.real_outstock_amount > 0 and wro.outstock_amount >= wro.real_outstock_amount and wro.real_outstock_amount > if(wro.erp_amount is null, 0, wro.erp_amount) - and wro.task_type in (1, 3, 9) + and wro.task_type in (1, 3, 5,9) + and mbmi.material_classfication = '1' diff --git a/hw-ui/src/views/board/barcode/workshopBarcode.vue b/hw-ui/src/views/board/barcode/workshopBarcode.vue index 722ac5f..3a06609 100644 --- a/hw-ui/src/views/board/barcode/workshopBarcode.vue +++ b/hw-ui/src/views/board/barcode/workshopBarcode.vue @@ -511,6 +511,7 @@ export default { planDetailCode: this.defineData.planDetailCode, singleFlag: this.defineData.singleFlag, saleOrderId: this.defineData.saleOrderId, + productId:this.defineData.productId, batchFlag: '0', bindBarcode: bindBarcode, barcodeType: "", @@ -523,6 +524,7 @@ export default { planId: this.defineData.planId, planCode: this.defineData.planCode, planDetailCode: this.defineData.planDetailCode, + productId : this.defineData.productId, saleOrderId: this.defineData.saleOrderId, saleorderCode: this.defineData.saleorderCode, materialBomId: this.defineData.materialBomId, diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue index 1250684..a2b4074 100644 --- a/hw-ui/src/views/board/fifthFloor/index.vue +++ b/hw-ui/src/views/board/fifthFloor/index.vue @@ -977,6 +977,7 @@ export default { } this.form = data.data || {} this.form.materialId = val.materialId + this.form.productId = val.productId this.form.materialBomId = val.materialBomId this.form.materialCode = val.materialCode this.form.materialName = val.materialName @@ -1018,6 +1019,7 @@ export default { const {data} = await getNewestProductPlanDetail({planId: val.planId}) this.form = data || {} this.form.materialId = val.materialId + this.form.productId = val.materialId this.form.materialBomId = val.materialBomId this.form.materialCode = val.materialCode this.form.materialName = val.materialName diff --git a/hw-ui/src/views/board/fourthFloor/assemble.vue b/hw-ui/src/views/board/fourthFloor/assemble.vue index 69fc7e8..a946713 100644 --- a/hw-ui/src/views/board/fourthFloor/assemble.vue +++ b/hw-ui/src/views/board/fourthFloor/assemble.vue @@ -889,13 +889,13 @@ export default { } this.reloadFlag = "0"; this.planId = row.planId - this.productId = row.materialId; + this.finalProductId = row.productId;//如果是内部生产,则此为5楼成品ID + this.productId = row.materialId;//本楼层生产的成品 this.materialBomId = row.materialBomId this.nowMaterial = row.materialName this.saleOrderId = row.saleOrderId this.saleType = row.saleType this.finalProcessFlag = row.finalProcessFlag - await getProductPlanDetails({pageNum: 1, pageSize: 5, planId: row.planId}).then(res => { if (res.rows.length === 0) { insertProductPlanDetails({ @@ -924,7 +924,7 @@ export default { planCode: val.planCode, dispatchCode: val.dispatchCode, planDetailCode: val.planDetailCode, - saleOrderId: val.saleOrderId, + saleOrderId: this.saleOrderId, productId: this.productId, materialBomId: this.materialBomId, maxPlanAmount: 100000000, @@ -942,8 +942,10 @@ export default { print(val) { this.PrintData = val this.PrintData.barcodeType = '4';//成品配对码 + this.PrintData.productId = val.materialId; if (this.saleType === this.SALE_TYPE.INTERNAL) { this.PrintData.singleFlag = this.SINGLE_FLAG.INTERNAL; + this.PrintData.productId = this.finalProductId; } else { this.PrintData.singleFlag = this.SINGLE_FLAG.NOT_SINGLE; } diff --git a/hw-ui/src/views/mes/productOrder/index.vue b/hw-ui/src/views/mes/productOrder/index.vue index 9493f18..d1d1980 100644 --- a/hw-ui/src/views/mes/productOrder/index.vue +++ b/hw-ui/src/views/mes/productOrder/index.vue @@ -365,7 +365,7 @@ - + + + + + + + @@ -848,6 +860,8 @@ export default { {key: 29, label: `成品规格`, visible: true}, ], //物料BOM选项 materialBomList: [], + //物料BOM选项 + produceMaterialBomList: [], //工艺路线选项 routeList: [], saleOrderDisabled: true, @@ -1013,7 +1027,15 @@ export default { if (this.selectType === this.MATERIAL_TYPE.RAW) { this.form.produceMaterialId = selectedRow.materialId; this.$set(this.form, 'produceMaterialName', selectedRow.materialName) - // this.form.produceMaterialName = selectedRow.materialName;//此设置会触发不能为空的限制 + getMaterialVisionList(this.form.produceMaterialId).then(response => { + this.produceMaterialBomList = response.data + if (this.produceMaterialBomList.length !== 0) { + // this.form.materialBomId = this.materialBomList[0].materialBomId + } else { + this.form.materialBomId = null; + this.$modal.msgError("该生产物料未维护BOM信息!"); + } + }) } else { this.form.materialId = selectedRow.materialId; this.$set(this.form, 'materialName', selectedRow.materialName)