ProcessServiceImpl.java 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package com.ruoyi.taiye.service.impl;
  2. import com.ruoyi.ams.business.IBusinessService;
  3. import com.ruoyi.ams.config.domain.dto.AgvCallDTO;
  4. import com.ruoyi.ams.config.domain.dto.AgvCallItemDTO;
  5. import com.ruoyi.ams.config.domain.dto.LotattDTO;
  6. import com.ruoyi.ams.task.domain.WcsTask;
  7. import com.ruoyi.ams.task.mapper.WcsTaskMapper;
  8. import com.ruoyi.base.constant.Constant;
  9. import com.ruoyi.base.domain.BaseLocationInfo;
  10. import com.ruoyi.base.service.IBaseLocationInfoService;
  11. import com.ruoyi.taiye.service.ProcessService;
  12. import lombok.extern.slf4j.Slf4j;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.stereotype.Service;
  15. import java.util.ArrayList;
  16. import java.util.List;
  17. @Service
  18. @Slf4j
  19. public class ProcessServiceImpl implements ProcessService {
  20. @Autowired
  21. WcsTaskMapper wcsTaskMapper;
  22. private final String SMID = "";
  23. @Autowired
  24. private IBusinessService iBusinessService;
  25. @Autowired
  26. private IBaseLocationInfoService iBaseLocationInfoService;
  27. @Override
  28. public void createPackingMachineUnloadingTask(String taskType, Integer from) {
  29. WcsTask wcsTask = new WcsTask();
  30. wcsTask.setLocationTo(SMID);
  31. List<WcsTask> tasking = wcsTaskMapper.getTasking(wcsTask);
  32. if (!tasking.isEmpty()){
  33. return;
  34. }
  35. // BaseLocationInfo fromLocation = iBaseLocationInfoService.selectBaseLocationInfoByIdOrNo(SMID, Constant.WAREHOUSE_ID);
  36. // fromLocation.setIsEmpty("N");
  37. // iBaseLocationInfoService.updateBaseLocationInfo(fromLocation);
  38. AgvCallDTO agvCallDTO = new AgvCallDTO();
  39. agvCallDTO.setLocationFrom(from+"");
  40. agvCallDTO.setLocationTo(SMID);
  41. iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.valueOf(taskType).getValue(),agvCallDTO);
  42. }
  43. @Override
  44. public void createPackingMachineUpEmptyPallets(String taskType, Integer to) {
  45. WcsTask wcsTask = new WcsTask();
  46. wcsTask.setLocationTo(to+"");
  47. List<WcsTask> tasking = wcsTaskMapper.getTasking(wcsTask);
  48. if (!tasking.isEmpty()){
  49. return;
  50. }
  51. List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
  52. AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
  53. agvCallItemDTO.setSku("EMPTY_TRAY"); // 空托
  54. agvCallItemDTO.setQty(1.0);
  55. agvCallItemDTOList.add(agvCallItemDTO);
  56. AgvCallDTO agvCallDTO = new AgvCallDTO();
  57. agvCallDTO.setLocationTo(to+"");
  58. agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
  59. iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.valueOf(taskType).getValue(),agvCallDTO);
  60. }
  61. }