From b8133c37040b479a5913e3ecfa2a9b0c79f3c503 Mon Sep 17 00:00:00 2001 From: Kelvin Date: Tue, 10 Dec 2024 16:30:05 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=B3=A8=E5=85=A5=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/controller/WmsOutPlanController.java | 5 +- .../ktg/mes/md/mapper/BaseKnifeMapper.java | 2 + .../md/mapper/BaseTechnologyBomMapper.java | 4 +- .../com/ktg/mes/md/mapper/BomRouteMapper.java | 4 +- .../com/ktg/mes/md/mapper/MdItemMapper.java | 2 + .../mapper/WmsOutPlanDetailEntityMapper.java | 2 + .../ktg/mes/md/mapper/WmsOutPlanMapper.java | 2 + .../ktg/mes/md/mapper/WmsOutTaskMapper.java | 2 + .../wm/controller/WmsInPlanController.java | 14 ++--- .../wm/controller/WmsInTaskController.java | 63 ++++++------------- .../mapper/ProductionArrangementsMapper.java | 4 +- .../mes/wm/mapper/WmStorageAreaMapper.java | 2 + .../ktg/mes/wm/mapper/WmsInTaskMapper.java | 4 +- .../ktg/mes/wm/mapper/WmsZdTaskMapper.java | 4 +- .../wm/service/impl/WmsInTaskServiceImpl.java | 26 +++----- 15 files changed, 65 insertions(+), 75 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java index 9fe2df1..451ff28 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java @@ -14,6 +14,7 @@ import com.ktg.mes.md.domain.WmsOutPlan; import com.ktg.mes.md.domain.WmsOutPlanDetailEntity; import com.ktg.mes.md.service.IAP0AEService; import com.ktg.mes.md.service.IWmsOutPlanService; +import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -30,9 +31,9 @@ import java.util.List; */ @RestController @RequestMapping("/md/PLAN") +@RequiredArgsConstructor public class WmsOutPlanController extends BaseController { - @Autowired - private IWmsOutPlanService wmsOutPlanService; + private final IWmsOutPlanService wmsOutPlanService; /** * 查询出库计划管理列表 diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BaseKnifeMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BaseKnifeMapper.java index cc8c34c..25b6d43 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BaseKnifeMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BaseKnifeMapper.java @@ -2,6 +2,7 @@ package com.ktg.mes.md.mapper; import com.ktg.mes.md.domain.BaseKnife; import com.ktg.mes.md.domain.MdItem; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -12,6 +13,7 @@ import java.util.List; * @author yinjinlu * @date 2024-10-31 */ +@Mapper public interface BaseKnifeMapper { /** * 查询工具台账 diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BaseTechnologyBomMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BaseTechnologyBomMapper.java index faf9253..d9fd68e 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BaseTechnologyBomMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BaseTechnologyBomMapper.java @@ -2,6 +2,7 @@ package com.ktg.mes.md.mapper; import java.util.List; import com.ktg.mes.md.domain.BaseTechnologyBom; +import org.apache.ibatis.annotations.Mapper; /** * 工艺bomMapper接口 @@ -9,7 +10,8 @@ import com.ktg.mes.md.domain.BaseTechnologyBom; * @author yinjinlu * @date 2024-11-01 */ -public interface BaseTechnologyBomMapper +@Mapper +public interface BaseTechnologyBomMapper { /** * 查询工艺bom diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BomRouteMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BomRouteMapper.java index 0ccfd22..a6fdedc 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BomRouteMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/BomRouteMapper.java @@ -3,6 +3,7 @@ package com.ktg.mes.md.mapper; import java.util.List; import com.ktg.mes.md.domain.BomRoute; import com.ktg.mes.md.domain.MbbProduBom; +import org.apache.ibatis.annotations.Mapper; /** * BOM头Mapper接口 @@ -10,7 +11,8 @@ import com.ktg.mes.md.domain.MbbProduBom; * @author yinjinlu * @date 2024-10-31 */ -public interface BomRouteMapper +@Mapper +public interface BomRouteMapper { /** * 查询BOM头 diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/MdItemMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/MdItemMapper.java index e9473bb..2daa48d 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/MdItemMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/MdItemMapper.java @@ -1,9 +1,11 @@ package com.ktg.mes.md.mapper; import com.ktg.mes.md.domain.MdItem; +import org.apache.ibatis.annotations.Mapper; import java.util.List; +@Mapper public interface MdItemMapper { /** * 根据条件查询物料编码 diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanDetailEntityMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanDetailEntityMapper.java index b36de7a..8a6cb89 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanDetailEntityMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanDetailEntityMapper.java @@ -3,6 +3,7 @@ package com.ktg.mes.md.mapper; import java.util.List; import com.ktg.mes.md.domain.WmsOutPlanDetailEntity; +import org.apache.ibatis.annotations.Mapper; /** * 出库计划明细实体Mapper接口 @@ -10,6 +11,7 @@ import com.ktg.mes.md.domain.WmsOutPlanDetailEntity; * @author yinjinlu * @date 2024-11-11 */ +@Mapper public interface WmsOutPlanDetailEntityMapper { /** * 查询出库计划明细实体 diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanMapper.java index 432ed9a..4dc9150 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanMapper.java @@ -2,6 +2,7 @@ package com.ktg.mes.md.mapper; import com.ktg.mes.md.domain.WmsOutPlan; import com.ktg.mes.md.domain.WmsOutPlanDetail; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -12,6 +13,7 @@ import java.util.List; * @author yinjinlu * @date 2024-11-01 */ +@Mapper public interface WmsOutPlanMapper { /** * 查询出库计划管理 diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutTaskMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutTaskMapper.java index fd37e98..88e614f 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutTaskMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutTaskMapper.java @@ -1,6 +1,7 @@ package com.ktg.mes.md.mapper; import com.ktg.mes.md.domain.WmsOutTask; +import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -10,6 +11,7 @@ import java.util.List; * @author yinjinlu * @date 2024-11-02 */ +@Mapper public interface WmsOutTaskMapper { /** * 查询出库任务 diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInPlanController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInPlanController.java index 4102c33..ce5fbef 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInPlanController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInPlanController.java @@ -4,8 +4,8 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import com.ktg.mes.md.service.IAP0AEService; +import lombok.RequiredArgsConstructor; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -26,17 +26,15 @@ import com.ktg.common.core.page.TableDataInfo; /** * 入库计划Controller * - * @author yinjinlu + * @author Kelvin * @date 2024-10-31 */ @RestController @RequestMapping("/wm/PLAN") +@RequiredArgsConstructor public class WmsInPlanController extends BaseController { - @Autowired - private IWmsInPlanService wmsInPlanService; - - @Autowired - private IAP0AEService iAP0AEService; + private final IWmsInPlanService wmsInPlanService; + private final IAP0AEService iAP0AEService; /** * 查询入库计划列表 @@ -54,7 +52,7 @@ public class WmsInPlanController extends BaseController { */ @GetMapping(value = "/sync") public AjaxResult sync() { - return AjaxResult.success(iAP0AEService.selectInNewData()); + return AjaxResult.success(iAP0AEService.selectReturnedNewData()); } /** diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java index 3293f71..65d97cf 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java @@ -13,6 +13,7 @@ import com.ktg.mes.md.service.IBaseKnifeService; import com.ktg.mes.md.service.IMdItemService; import com.ktg.mes.wm.domain.*; import com.ktg.mes.wm.service.*; +import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.transaction.annotation.Transactional; @@ -35,51 +36,25 @@ import com.ktg.mes.md.mapper.*; */ @RestController @RequestMapping("/wm/wmsInTask") +@RequiredArgsConstructor public class WmsInTaskController extends BaseController { - @Autowired - private IWmsInTaskService wmsInTaskService; - @Autowired - private IWmsInPlanService wmsInPlanService; - @Autowired - private IWmsZdTaskService wmsZdTaskService; - @Autowired - private IMdItemService mdItemService; - @Autowired - private IBaseKnifeService baseKnifeService; - @Autowired - private IWmStorageAreaService wmStorageAreaService; - @Autowired - private IWmsInPlanDetailEntityService wmsInPlanDetailEntityService; - - @Autowired - private WmsOutPlanMapper wmsOutPlanMapper; - - @Autowired - private WmsOutPlanDetailEntityMapper wmsOutPlanDetailEntityMapper; - - @Autowired - private WmsOutTaskMapper wmsOutTaskMapper; - - @Autowired - private ProductionArrangementsMapper productionArrangementsMapper; - - @Autowired - private BaseKnifeMapper baseKnifeMapper; - - @Autowired - private BomRouteMapper bomRouteMapper; - - @Autowired - private MdItemMapper mdItemMapper; - - @Autowired - private BaseTechnologyBomMapper baseTechnologyBomMapper; - - @Autowired - private WmsZdTaskMapper wmsZdTaskMapper; - - @Autowired - private WmStorageAreaMapper wmStorageAreaMapper; + private final IWmsInTaskService wmsInTaskService; + private final IWmsInPlanService wmsInPlanService; + private final IWmsZdTaskService wmsZdTaskService; + private final IMdItemService mdItemService; + private final IBaseKnifeService baseKnifeService; + private final IWmStorageAreaService wmStorageAreaService; + private final IWmsInPlanDetailEntityService wmsInPlanDetailEntityService; + private final WmsOutPlanMapper wmsOutPlanMapper; + private final WmsOutPlanDetailEntityMapper wmsOutPlanDetailEntityMapper; + private final WmsOutTaskMapper wmsOutTaskMapper; + private final ProductionArrangementsMapper productionArrangementsMapper; + private final BaseKnifeMapper baseKnifeMapper; + private final BomRouteMapper bomRouteMapper; + private final MdItemMapper mdItemMapper; + private final BaseTechnologyBomMapper baseTechnologyBomMapper; + private final WmsZdTaskMapper wmsZdTaskMapper; + private final WmStorageAreaMapper wmStorageAreaMapper; /** * 查询入库任务列表 diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/ProductionArrangementsMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/ProductionArrangementsMapper.java index dcab11f..d72831d 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/ProductionArrangementsMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/ProductionArrangementsMapper.java @@ -2,6 +2,7 @@ package com.ktg.mes.wm.mapper; import java.util.List; import com.ktg.mes.wm.domain.ProductionArrangements; +import org.apache.ibatis.annotations.Mapper; /** * 生产准备记录Mapper接口 @@ -9,7 +10,8 @@ import com.ktg.mes.wm.domain.ProductionArrangements; * @author yinjinlu * @date 2024-11-18 */ -public interface ProductionArrangementsMapper +@Mapper +public interface ProductionArrangementsMapper { /** * 查询生产准备记录 diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmStorageAreaMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmStorageAreaMapper.java index 6253623..731290a 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmStorageAreaMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmStorageAreaMapper.java @@ -3,6 +3,7 @@ package com.ktg.mes.wm.mapper; import java.util.List; import com.ktg.mes.wm.domain.WmStorageArea; import com.ktg.mes.wm.domain.vo.AreaVo; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; /** @@ -11,6 +12,7 @@ import org.apache.ibatis.annotations.Select; * @author yinjinlu * @date 2022-05-08 */ +@Mapper public interface WmStorageAreaMapper { /** diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInTaskMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInTaskMapper.java index 45d6f1c..1ed2fdf 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInTaskMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInTaskMapper.java @@ -3,6 +3,7 @@ package com.ktg.mes.wm.mapper; import java.util.List; import com.ktg.mes.wm.domain.WmsInTask; import com.ktg.mes.wm.domain.WmsZdTask; +import org.apache.ibatis.annotations.Mapper; /** * 入库任务Mapper接口 @@ -10,7 +11,8 @@ import com.ktg.mes.wm.domain.WmsZdTask; * @author yinjinlu * @date 2024-11-01 */ -public interface WmsInTaskMapper +@Mapper +public interface WmsInTaskMapper { /** * 查询入库任务 diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsZdTaskMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsZdTaskMapper.java index 9eb69cf..536ad92 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsZdTaskMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsZdTaskMapper.java @@ -2,6 +2,7 @@ package com.ktg.mes.wm.mapper; import java.util.List; import com.ktg.mes.wm.domain.WmsZdTask; +import org.apache.ibatis.annotations.Mapper; /** * 组装任务Mapper接口 @@ -9,7 +10,8 @@ import com.ktg.mes.wm.domain.WmsZdTask; * @author yinjinlu * @date 2024-11-01 */ -public interface WmsZdTaskMapper +@Mapper +public interface WmsZdTaskMapper { /** * 查询组装任务 diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInTaskServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInTaskServiceImpl.java index bde6468..f06ee48 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInTaskServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInTaskServiceImpl.java @@ -13,6 +13,7 @@ import com.ktg.mes.md.service.IMdItemService; import com.ktg.mes.wm.domain.*; import com.ktg.mes.wm.mapper.WmStorageAreaMapper; import com.ktg.mes.wm.service.*; +import lombok.RequiredArgsConstructor; import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -25,23 +26,16 @@ import com.ktg.mes.wm.mapper.WmsInTaskMapper; * @date 2024-11-01 */ @Service +@RequiredArgsConstructor public class WmsInTaskServiceImpl implements IWmsInTaskService { - @Autowired - private WmsInTaskMapper wmsInTaskMapper; - @Autowired - private IMdItemService mdItemService; - @Autowired - private IWmsInPlanDetailEntityService wmsInPlanDetailEntityService; - @Autowired - private WmStorageAreaMapper wmStorageAreaMapper; - @Autowired - private IWmsInPlanService wmsInPlanService; - @Autowired - private IWmStorageAreaService wmStorageAreaService; - @Autowired - private IWmsZdTaskService wmsZdTaskService; - @Autowired - private IBaseKnifeService baseKnifeService; + private final WmsInTaskMapper wmsInTaskMapper; + private final IMdItemService mdItemService; + private final IWmsInPlanDetailEntityService wmsInPlanDetailEntityService; + private final WmStorageAreaMapper wmStorageAreaMapper; + private final IWmsInPlanService wmsInPlanService; + private final IWmStorageAreaService wmStorageAreaService; + private final IWmsZdTaskService wmsZdTaskService; + private final IBaseKnifeService baseKnifeService; /** * 查询入库任务