From 9a6587377a3c53a3e01bf6a8377bfa2531db488b Mon Sep 17 00:00:00 2001 From: zhouhy Date: Fri, 13 Oct 2023 10:16:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SAPPutStorageServiceImpl.java | 4 ++-- .../com/aucma/base/domain/BaseOrderInfo.java | 11 +++++---- .../impl/ProductPlanInfoServiceImpl.java | 23 ++++++++++--------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java b/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java index 9ee182f..e1bec46 100644 --- a/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java +++ b/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java @@ -96,7 +96,7 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService { baseOrderInfo.setMaterialCode(map.get("MATNR")); baseOrderInfo.setMaterialName(map.get("MAKTX")); if (!map.get("GAMNG").equals(null)) { - baseOrderInfo.setOrderAmount(Long.valueOf(map.get("GAMNG"))); + baseOrderInfo.setOrderAmount(new BigDecimal(map.get("GAMNG"))); } baseOrderInfo.setFactoryCode(map.get("WERKS")); baseOrderInfo.setOrderType(map.get("AUART")); @@ -129,7 +129,7 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService { device.setDeviceCode(map.get("EQUNR")); List baseDeviceLedgers = baseDeviceLedgerService.selectBaseDeviceLedgerList(device); - if (!baseDeviceLedgers.isEmpty()) { + if (baseDeviceLedgers.isEmpty()) { BaseDeviceLedger deviceLedger = new BaseDeviceLedger(); deviceLedger.setCostCenter(map.get("KOSTL"));// deviceLedger.setFactoryCode(map.get("IWERK")); diff --git a/aucma-base/src/main/java/com/aucma/base/domain/BaseOrderInfo.java b/aucma-base/src/main/java/com/aucma/base/domain/BaseOrderInfo.java index cb6a423..81186b9 100644 --- a/aucma-base/src/main/java/com/aucma/base/domain/BaseOrderInfo.java +++ b/aucma-base/src/main/java/com/aucma/base/domain/BaseOrderInfo.java @@ -1,5 +1,6 @@ package com.aucma.base.domain; +import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; @@ -62,7 +63,7 @@ public class BaseOrderInfo extends BaseEntity { * 订单计划数量 */ @Excel(name = "订单计划数量") - private Long orderAmount; + private BigDecimal orderAmount; /** * 完成数量 @@ -211,12 +212,12 @@ public class BaseOrderInfo extends BaseEntity { return matkl; } - public void setOrderAmount(Long orderAmount) { - this.orderAmount = orderAmount; + public BigDecimal getOrderAmount() { + return orderAmount; } - public Long getOrderAmount() { - return orderAmount; + public void setOrderAmount(BigDecimal orderAmount) { + this.orderAmount = orderAmount; } public void setCompleteAmount(Long completeAmount) { diff --git a/aucma-production/src/main/java/com/aucma/production/service/impl/ProductPlanInfoServiceImpl.java b/aucma-production/src/main/java/com/aucma/production/service/impl/ProductPlanInfoServiceImpl.java index 1a5cfd0..856cb0c 100644 --- a/aucma-production/src/main/java/com/aucma/production/service/impl/ProductPlanInfoServiceImpl.java +++ b/aucma-production/src/main/java/com/aucma/production/service/impl/ProductPlanInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.aucma.production.service.impl; +import java.math.BigDecimal; import java.util.List; import com.aucma.base.domain.BaseOrderInfo; @@ -20,12 +21,12 @@ import static com.aucma.common.utils.SecurityUtils.getUsername; /** * 生产计划Service业务层处理 - * + * * @author Yinq * @date 2023-10-07 */ @Service -public class ProductPlanInfoServiceImpl implements IProductPlanInfoService +public class ProductPlanInfoServiceImpl implements IProductPlanInfoService { @Autowired private ProductPlanInfoMapper productPlanInfoMapper; @@ -38,7 +39,7 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService /** * 查询生产计划 - * + * * @param objId 生产计划主键 * @return 生产计划 */ @@ -50,7 +51,7 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService /** * 查询生产计划列表 - * + * * @param productPlanInfo 生产计划 * @return 生产计划 */ @@ -62,7 +63,7 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService /** * 新增生产计划 - * + * * @param productPlanInfo 生产计划 * @return 结果 */ @@ -78,7 +79,7 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService /** * 修改生产计划 - * + * * @param productPlanInfo 生产计划 * @return 结果 */ @@ -91,7 +92,7 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService /** * 批量删除生产计划 - * + * * @param objIds 需要删除的生产计划主键 * @return 结果 */ @@ -103,7 +104,7 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService /** * 删除生产计划信息 - * + * * @param objId 生产计划主键 * @return 结果 */ @@ -125,8 +126,8 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService String orderCode = baseOrderInfo.getOrderCode(); String saleOrderCode = baseOrderInfo.getSaleOrderCode(); String saleOrderLineNumber = baseOrderInfo.getSaleOrderLineNumber(); - Long orderAmount = baseOrderInfo.getOrderAmount(); - if (StringUtils.isNull(orderAmount) || orderAmount < 1L){ + BigDecimal orderAmount = baseOrderInfo.getOrderAmount(); + if (StringUtils.isNull(orderAmount) || (orderAmount.compareTo(new BigDecimal(1))==-1)){ throw new BaseException("该工单计划数量不合法!"); } //获取生产BOM信息 @@ -147,7 +148,7 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService planInfo.setMaterialCode(baseBomInfo.getMaterialCode()); planInfo.setMaterialName(baseBomInfo.getMaterialName()); planInfo.setProductLineCode(baseBomInfo.getProductLineCode()); - planInfo.setPlanAmount(baseBomInfo.getStandardAmount() * orderAmount); + planInfo.setPlanAmount(baseBomInfo.getStandardAmount() * orderAmount.longValue()); this.insertProductPlanInfo(planInfo); } baseOrderInfo.setIsRelease(0L);