From 90d218ddb379c5e53ddb5786434da79e23cce643 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Mon, 19 Aug 2024 18:22:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99=E6=8E=A5=E6=94=B6=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=BA=93=E7=AE=A1=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/sgzb/common/log/aspect/LogAspect.java | 4 ++-- .../sgzb/material/mapper/PurchaseMacodeInfoMapper.java | 2 ++ .../service/impl/PurchaseMacodeInfoServiceImpl.java | 5 +++++ .../mapper/material/PurchaseMacodeInfoMapper.xml | 10 ++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/sgzb-common/sgzb-common-log/src/main/java/com/bonus/sgzb/common/log/aspect/LogAspect.java b/sgzb-common/sgzb-common-log/src/main/java/com/bonus/sgzb/common/log/aspect/LogAspect.java index debc989..498fd2e 100644 --- a/sgzb-common/sgzb-common-log/src/main/java/com/bonus/sgzb/common/log/aspect/LogAspect.java +++ b/sgzb-common/sgzb-common-log/src/main/java/com/bonus/sgzb/common/log/aspect/LogAspect.java @@ -261,9 +261,9 @@ public class LogAspect BmStorageLog bmStorageLog = new BmStorageLog(); bmStorageLog.setTypeId(Objects.isNull(maInputRecord.getTypeId()) ? 0 : maInputRecord.getTypeId().intValue()); bmStorageLog.setTypeName(maInputRecord.getMaCode()); - bmStorageLog.setPreStoreNum(Objects.isNull(maInputRecord.getNum()) ? 0: maInputRecord.getNum().intValue()); + bmStorageLog.setPostStoreNum(Objects.isNull(maInputRecord.getNum()) ? 0: maInputRecord.getNum().intValue()); bmStorageLog.setInNum(Objects.isNull(maInputRecord.getInputNum()) ? 0: maInputRecord.getInputNum().intValue()); - bmStorageLog.setPostStoreNum(bmStorageLog.getPreStoreNum() + bmStorageLog.getInNum()); + bmStorageLog.setPreStoreNum(bmStorageLog.getPostStoreNum() - bmStorageLog.getInNum()); bmStorageLog.setTaskId(String.valueOf(maInputRecord.getTaskId())); bmStorageLogList.add(bmStorageLog); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java index 5d1c70c..b89796d 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java @@ -284,4 +284,6 @@ public interface PurchaseMacodeInfoMapper { List selectPurchaseMacodeInfoListDetails(PurchaseMacodeInfo purchaseMacodeInfo); List selectKeepUser(Integer typeId); + + int getCountOfMachineByTypeId(Long typeId); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java index dc271ec..6ed8f72 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java @@ -334,6 +334,11 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService .add(maType.getNum() == null ? new BigDecimal(0) : maType.getNum())); purchaseMacodeInfoMapper.updateTypeByTypeId(maType); + if ("0".equals(maType.getManageType())) { //编码设备 + int countOfMachineByTypeId = purchaseMacodeInfoMapper.getCountOfMachineByTypeId(typeId); + maInputRecord.setNum((double) countOfMachineByTypeId); + } + //判断是否是成套机具,是的话配件库存也要增加 if ("2".equals(maType.getManageType())){ PurchaseCheckInfo purchaseCheckInfo = new PurchaseCheckInfo(); diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml index 732ca84..0d794d1 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml @@ -570,4 +570,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" UPDATE ma_type SET num = ifnull( num, 0 ) + #{partNum} WHERE type_id = #{typeId} + + \ No newline at end of file