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.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;
/**
* 查询出库计划管理列表

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.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 {
/**
* 查询工具台账

View File

@ -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

View File

@ -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头

View File

@ -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 {
/**
* 根据条件查询物料编码

View File

@ -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 {
/**
* 查询出库计划明细实体

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.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 {
/**
* 查询出库计划管理

View File

@ -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 {
/**
* 查询出库任务

View File

@ -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());
}
/**

View File

@ -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;
/**
* 查询入库任务列表

View File

@ -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
{
/**
* 查询生产准备记录

View File

@ -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
{
/**

View File

@ -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
{
/**
* 查询入库任务

View File

@ -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
{
/**
* 查询组装任务

View File

@ -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;
/**
* 查询入库任务