refactor: 注入优化

This commit is contained in:
Kelvin 2024-12-10 16:30:05 +08:00
parent 80c16a4ff5
commit b8133c3704
15 changed files with 65 additions and 75 deletions

View File

@ -14,6 +14,7 @@ import com.ktg.mes.md.domain.WmsOutPlan;
import com.ktg.mes.md.domain.WmsOutPlanDetailEntity; import com.ktg.mes.md.domain.WmsOutPlanDetailEntity;
import com.ktg.mes.md.service.IAP0AEService; import com.ktg.mes.md.service.IAP0AEService;
import com.ktg.mes.md.service.IWmsOutPlanService; import com.ktg.mes.md.service.IWmsOutPlanService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -30,9 +31,9 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping("/md/PLAN") @RequestMapping("/md/PLAN")
@RequiredArgsConstructor
public class WmsOutPlanController extends BaseController { public class WmsOutPlanController extends BaseController {
@Autowired private final IWmsOutPlanService wmsOutPlanService;
private IWmsOutPlanService wmsOutPlanService;
/** /**
* 查询出库计划管理列表 * 查询出库计划管理列表

View File

@ -2,6 +2,7 @@ package com.ktg.mes.md.mapper;
import com.ktg.mes.md.domain.BaseKnife; import com.ktg.mes.md.domain.BaseKnife;
import com.ktg.mes.md.domain.MdItem; import com.ktg.mes.md.domain.MdItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -12,6 +13,7 @@ import java.util.List;
* @author yinjinlu * @author yinjinlu
* @date 2024-10-31 * @date 2024-10-31
*/ */
@Mapper
public interface BaseKnifeMapper { public interface BaseKnifeMapper {
/** /**
* 查询工具台账 * 查询工具台账

View File

@ -2,6 +2,7 @@ package com.ktg.mes.md.mapper;
import java.util.List; import java.util.List;
import com.ktg.mes.md.domain.BaseTechnologyBom; import com.ktg.mes.md.domain.BaseTechnologyBom;
import org.apache.ibatis.annotations.Mapper;
/** /**
* 工艺bomMapper接口 * 工艺bomMapper接口
@ -9,7 +10,8 @@ import com.ktg.mes.md.domain.BaseTechnologyBom;
* @author yinjinlu * @author yinjinlu
* @date 2024-11-01 * @date 2024-11-01
*/ */
public interface BaseTechnologyBomMapper @Mapper
public interface BaseTechnologyBomMapper
{ {
/** /**
* 查询工艺bom * 查询工艺bom

View File

@ -3,6 +3,7 @@ package com.ktg.mes.md.mapper;
import java.util.List; import java.util.List;
import com.ktg.mes.md.domain.BomRoute; import com.ktg.mes.md.domain.BomRoute;
import com.ktg.mes.md.domain.MbbProduBom; import com.ktg.mes.md.domain.MbbProduBom;
import org.apache.ibatis.annotations.Mapper;
/** /**
* BOM头Mapper接口 * BOM头Mapper接口
@ -10,7 +11,8 @@ import com.ktg.mes.md.domain.MbbProduBom;
* @author yinjinlu * @author yinjinlu
* @date 2024-10-31 * @date 2024-10-31
*/ */
public interface BomRouteMapper @Mapper
public interface BomRouteMapper
{ {
/** /**
* 查询BOM头 * 查询BOM头

View File

@ -1,9 +1,11 @@
package com.ktg.mes.md.mapper; package com.ktg.mes.md.mapper;
import com.ktg.mes.md.domain.MdItem; import com.ktg.mes.md.domain.MdItem;
import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@Mapper
public interface MdItemMapper { public interface MdItemMapper {
/** /**
* 根据条件查询物料编码 * 根据条件查询物料编码

View File

@ -3,6 +3,7 @@ package com.ktg.mes.md.mapper;
import java.util.List; import java.util.List;
import com.ktg.mes.md.domain.WmsOutPlanDetailEntity; import com.ktg.mes.md.domain.WmsOutPlanDetailEntity;
import org.apache.ibatis.annotations.Mapper;
/** /**
* 出库计划明细实体Mapper接口 * 出库计划明细实体Mapper接口
@ -10,6 +11,7 @@ import com.ktg.mes.md.domain.WmsOutPlanDetailEntity;
* @author yinjinlu * @author yinjinlu
* @date 2024-11-11 * @date 2024-11-11
*/ */
@Mapper
public interface WmsOutPlanDetailEntityMapper { public interface WmsOutPlanDetailEntityMapper {
/** /**
* 查询出库计划明细实体 * 查询出库计划明细实体

View File

@ -2,6 +2,7 @@ package com.ktg.mes.md.mapper;
import com.ktg.mes.md.domain.WmsOutPlan; import com.ktg.mes.md.domain.WmsOutPlan;
import com.ktg.mes.md.domain.WmsOutPlanDetail; import com.ktg.mes.md.domain.WmsOutPlanDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -12,6 +13,7 @@ import java.util.List;
* @author yinjinlu * @author yinjinlu
* @date 2024-11-01 * @date 2024-11-01
*/ */
@Mapper
public interface WmsOutPlanMapper { public interface WmsOutPlanMapper {
/** /**
* 查询出库计划管理 * 查询出库计划管理

View File

@ -1,6 +1,7 @@
package com.ktg.mes.md.mapper; package com.ktg.mes.md.mapper;
import com.ktg.mes.md.domain.WmsOutTask; import com.ktg.mes.md.domain.WmsOutTask;
import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -10,6 +11,7 @@ import java.util.List;
* @author yinjinlu * @author yinjinlu
* @date 2024-11-02 * @date 2024-11-02
*/ */
@Mapper
public interface WmsOutTaskMapper { public interface WmsOutTaskMapper {
/** /**
* 查询出库任务 * 查询出库任务

View File

@ -4,8 +4,8 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ktg.mes.md.service.IAP0AEService; import com.ktg.mes.md.service.IAP0AEService;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize; 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.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@ -26,17 +26,15 @@ import com.ktg.common.core.page.TableDataInfo;
/** /**
* 入库计划Controller * 入库计划Controller
* *
* @author yinjinlu * @author Kelvin
* @date 2024-10-31 * @date 2024-10-31
*/ */
@RestController @RestController
@RequestMapping("/wm/PLAN") @RequestMapping("/wm/PLAN")
@RequiredArgsConstructor
public class WmsInPlanController extends BaseController { public class WmsInPlanController extends BaseController {
@Autowired private final IWmsInPlanService wmsInPlanService;
private IWmsInPlanService wmsInPlanService; private final IAP0AEService iAP0AEService;
@Autowired
private IAP0AEService iAP0AEService;
/** /**
* 查询入库计划列表 * 查询入库计划列表
@ -54,7 +52,7 @@ public class WmsInPlanController extends BaseController {
*/ */
@GetMapping(value = "/sync") @GetMapping(value = "/sync")
public AjaxResult sync() { public AjaxResult sync() {
return AjaxResult.success(iAP0AEService.selectInNewData()); return AjaxResult.success(iAP0AEService.selectReturnedNewData());
} }
/** /**

View File

@ -13,6 +13,7 @@ import com.ktg.mes.md.service.IBaseKnifeService;
import com.ktg.mes.md.service.IMdItemService; import com.ktg.mes.md.service.IMdItemService;
import com.ktg.mes.wm.domain.*; import com.ktg.mes.wm.domain.*;
import com.ktg.mes.wm.service.*; import com.ktg.mes.wm.service.*;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -35,51 +36,25 @@ import com.ktg.mes.md.mapper.*;
*/ */
@RestController @RestController
@RequestMapping("/wm/wmsInTask") @RequestMapping("/wm/wmsInTask")
@RequiredArgsConstructor
public class WmsInTaskController extends BaseController { public class WmsInTaskController extends BaseController {
@Autowired private final IWmsInTaskService wmsInTaskService;
private IWmsInTaskService wmsInTaskService; private final IWmsInPlanService wmsInPlanService;
@Autowired private final IWmsZdTaskService wmsZdTaskService;
private IWmsInPlanService wmsInPlanService; private final IMdItemService mdItemService;
@Autowired private final IBaseKnifeService baseKnifeService;
private IWmsZdTaskService wmsZdTaskService; private final IWmStorageAreaService wmStorageAreaService;
@Autowired private final IWmsInPlanDetailEntityService wmsInPlanDetailEntityService;
private IMdItemService mdItemService; private final WmsOutPlanMapper wmsOutPlanMapper;
@Autowired private final WmsOutPlanDetailEntityMapper wmsOutPlanDetailEntityMapper;
private IBaseKnifeService baseKnifeService; private final WmsOutTaskMapper wmsOutTaskMapper;
@Autowired private final ProductionArrangementsMapper productionArrangementsMapper;
private IWmStorageAreaService wmStorageAreaService; private final BaseKnifeMapper baseKnifeMapper;
@Autowired private final BomRouteMapper bomRouteMapper;
private IWmsInPlanDetailEntityService wmsInPlanDetailEntityService; private final MdItemMapper mdItemMapper;
private final BaseTechnologyBomMapper baseTechnologyBomMapper;
@Autowired private final WmsZdTaskMapper wmsZdTaskMapper;
private WmsOutPlanMapper wmsOutPlanMapper; private final WmStorageAreaMapper wmStorageAreaMapper;
@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;
/** /**
* 查询入库任务列表 * 查询入库任务列表

View File

@ -2,6 +2,7 @@ package com.ktg.mes.wm.mapper;
import java.util.List; import java.util.List;
import com.ktg.mes.wm.domain.ProductionArrangements; import com.ktg.mes.wm.domain.ProductionArrangements;
import org.apache.ibatis.annotations.Mapper;
/** /**
* 生产准备记录Mapper接口 * 生产准备记录Mapper接口
@ -9,7 +10,8 @@ import com.ktg.mes.wm.domain.ProductionArrangements;
* @author yinjinlu * @author yinjinlu
* @date 2024-11-18 * @date 2024-11-18
*/ */
public interface ProductionArrangementsMapper @Mapper
public interface ProductionArrangementsMapper
{ {
/** /**
* 查询生产准备记录 * 查询生产准备记录

View File

@ -3,6 +3,7 @@ package com.ktg.mes.wm.mapper;
import java.util.List; import java.util.List;
import com.ktg.mes.wm.domain.WmStorageArea; import com.ktg.mes.wm.domain.WmStorageArea;
import com.ktg.mes.wm.domain.vo.AreaVo; import com.ktg.mes.wm.domain.vo.AreaVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
/** /**
@ -11,6 +12,7 @@ import org.apache.ibatis.annotations.Select;
* @author yinjinlu * @author yinjinlu
* @date 2022-05-08 * @date 2022-05-08
*/ */
@Mapper
public interface WmStorageAreaMapper public interface WmStorageAreaMapper
{ {
/** /**

View File

@ -3,6 +3,7 @@ package com.ktg.mes.wm.mapper;
import java.util.List; import java.util.List;
import com.ktg.mes.wm.domain.WmsInTask; import com.ktg.mes.wm.domain.WmsInTask;
import com.ktg.mes.wm.domain.WmsZdTask; import com.ktg.mes.wm.domain.WmsZdTask;
import org.apache.ibatis.annotations.Mapper;
/** /**
* 入库任务Mapper接口 * 入库任务Mapper接口
@ -10,7 +11,8 @@ import com.ktg.mes.wm.domain.WmsZdTask;
* @author yinjinlu * @author yinjinlu
* @date 2024-11-01 * @date 2024-11-01
*/ */
public interface WmsInTaskMapper @Mapper
public interface WmsInTaskMapper
{ {
/** /**
* 查询入库任务 * 查询入库任务

View File

@ -2,6 +2,7 @@ package com.ktg.mes.wm.mapper;
import java.util.List; import java.util.List;
import com.ktg.mes.wm.domain.WmsZdTask; import com.ktg.mes.wm.domain.WmsZdTask;
import org.apache.ibatis.annotations.Mapper;
/** /**
* 组装任务Mapper接口 * 组装任务Mapper接口
@ -9,7 +10,8 @@ import com.ktg.mes.wm.domain.WmsZdTask;
* @author yinjinlu * @author yinjinlu
* @date 2024-11-01 * @date 2024-11-01
*/ */
public interface WmsZdTaskMapper @Mapper
public interface WmsZdTaskMapper
{ {
/** /**
* 查询组装任务 * 查询组装任务

View File

@ -13,6 +13,7 @@ import com.ktg.mes.md.service.IMdItemService;
import com.ktg.mes.wm.domain.*; import com.ktg.mes.wm.domain.*;
import com.ktg.mes.wm.mapper.WmStorageAreaMapper; import com.ktg.mes.wm.mapper.WmStorageAreaMapper;
import com.ktg.mes.wm.service.*; import com.ktg.mes.wm.service.*;
import lombok.RequiredArgsConstructor;
import org.checkerframework.checker.units.qual.A; import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -25,23 +26,16 @@ import com.ktg.mes.wm.mapper.WmsInTaskMapper;
* @date 2024-11-01 * @date 2024-11-01
*/ */
@Service @Service
@RequiredArgsConstructor
public class WmsInTaskServiceImpl implements IWmsInTaskService { public class WmsInTaskServiceImpl implements IWmsInTaskService {
@Autowired private final WmsInTaskMapper wmsInTaskMapper;
private WmsInTaskMapper wmsInTaskMapper; private final IMdItemService mdItemService;
@Autowired private final IWmsInPlanDetailEntityService wmsInPlanDetailEntityService;
private IMdItemService mdItemService; private final WmStorageAreaMapper wmStorageAreaMapper;
@Autowired private final IWmsInPlanService wmsInPlanService;
private IWmsInPlanDetailEntityService wmsInPlanDetailEntityService; private final IWmStorageAreaService wmStorageAreaService;
@Autowired private final IWmsZdTaskService wmsZdTaskService;
private WmStorageAreaMapper wmStorageAreaMapper; private final IBaseKnifeService baseKnifeService;
@Autowired
private IWmsInPlanService wmsInPlanService;
@Autowired
private IWmStorageAreaService wmStorageAreaService;
@Autowired
private IWmsZdTaskService wmsZdTaskService;
@Autowired
private IBaseKnifeService baseKnifeService;
/** /**
* 查询入库任务 * 查询入库任务