From a70e8f4c9bf68ab7e748e7cc4421ba34d9f51c0f Mon Sep 17 00:00:00 2001 From: Kelvin Date: Tue, 10 Dec 2024 15:30:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=B0=8F=E5=9E=8B=E5=88=80=E5=85=B7?= =?UTF-8?q?=E5=BA=93=E5=90=8C=E6=AD=A5=E6=96=B9=E6=B3=95):=20=E6=B3=A8?= =?UTF-8?q?=E5=85=A5=E4=BC=98=E5=8C=96=EF=BC=8C=E6=96=B9=E6=B3=95=E5=90=8D?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/md/mapper/AP0AEMapper.java | 2 ++ .../com/ktg/mes/md/service/IAP0AEService.java | 12 +++++++-- .../mes/md/service/impl/AP0AEServiceImpl.java | 25 +++++++------------ 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/AP0AEMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/AP0AEMapper.java index 3529b4c..b812df1 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/AP0AEMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/AP0AEMapper.java @@ -3,12 +3,14 @@ package com.ktg.mes.md.mapper; import com.ktg.common.annotation.DataSource; import com.ktg.common.enums.DataSourceType; import com.ktg.mes.md.domain.AP0AE; +import org.apache.ibatis.annotations.Mapper; import java.util.List; /** * @author Kelvin */ +@Mapper public interface AP0AEMapper { @DataSource(DataSourceType.SQLSERVER) List selectOutNewData(); diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/IAP0AEService.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/IAP0AEService.java index 39b039f..fde0b60 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/IAP0AEService.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/IAP0AEService.java @@ -8,8 +8,16 @@ import java.util.List; * @author luo26 */ public interface IAP0AEService { - public List selectOutNewData(); + /** + * 获取借用记录 + * @return 借用记录列表 + */ + public List selectBorrowedNewData(); - public List selectInNewData(); + /** + * 获取归还记录 + * @return 归还记录列表 + */ + public List selectReturnedNewData(); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/AP0AEServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/AP0AEServiceImpl.java index 371709e..5db7c05 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/AP0AEServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/AP0AEServiceImpl.java @@ -15,6 +15,7 @@ import com.ktg.mes.wm.domain.WmsInTask; import com.ktg.mes.wm.service.IWmStorageAreaService; import com.ktg.mes.wm.service.IWmsInPlanService; import com.ktg.mes.wm.service.IWmsInTaskService; +import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -29,29 +30,21 @@ import java.util.List; * @author Kelvin */ @Service +@RequiredArgsConstructor public class AP0AEServiceImpl implements IAP0AEService { - @Autowired - private AP0AEMapper aP0AEMapper; - - @Autowired - private IWmsInPlanService wmsInPlanService; - - @Autowired - private IWmsInTaskService wmsInTaskService; - - @Autowired - private IWmStorageAreaService wmStorageAreaService; - - @Autowired - private IMdItemService mdItemService; + private final AP0AEMapper aP0AEMapper; + private final IWmsInPlanService wmsInPlanService; + private final IWmsInTaskService wmsInTaskService; + private final IWmStorageAreaService wmStorageAreaService; + private final IMdItemService mdItemService; @Override - public List selectOutNewData() { + public List selectBorrowedNewData() { return this.aP0AEMapper.selectOutNewData(); } @Override - public List selectInNewData() { + public List selectReturnedNewData() { List ap0aeList = aP0AEMapper.selectInNewData(); ap0aeList.stream().filter(ap0ae -> ap0ae.getAE003() != null).forEach(ap0ae -> { WmsInPlan wmsInPlan = new WmsInPlan();