| | |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import com.zy.system.service.impl.ConfigServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | throw new CoolException("请检查目标库位是否闲置中!!"); |
| | | } |
| | | |
| | | String taskType = "M2"; |
| | | if (!params.getIsNewIn().isEmpty()) { |
| | | taskType = "M1"; |
| | | } |
| | | try { |
| | | generateAgvTask("agv", locCache, params.getOrgSite(), params.getBarcode(), userId); |
| | | generateAgvTask("agv", locCache, params.getOrgSite(), params.getBarcode(), userId, taskType); |
| | | } catch (Exception e) { |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | |
| | | * @version 1.0 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void generateAgvTask(String type, LocCache loc, String orgSite, String barcode, Long userId) { |
| | | public void generateAgvTask(String type, LocCache loc, String orgSite, String barcode, Long userId, String isNewIn) { |
| | | List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", barcode)); |
| | | if (!tasks.isEmpty()) { |
| | | throw new CoolException("托盘已在任务执行中.."); |
| | |
| | | .setIoType(1) // 入出库状态: 11.库格移载 |
| | | .setTaskType("agv") |
| | | .setIoPri(10D) |
| | | .setIsNewIn(isNewIn) |
| | | .setLocNo(loc.getLocNo()) // 目标库位 |
| | | .setFullPlt("Y") // 满板:Y |
| | | .setPicking("N") // 拣料 |
| | |
| | | |
| | | try { |
| | | //空台车回库 |
| | | generateAgvTask("agv_back", locCache, callAgvBackParam.getOrgSite(), station.getBarcode(), userId); |
| | | generateAgvTask("agv_back", locCache, callAgvBackParam.getOrgSite(), station.getBarcode(), userId, "M2"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(e.getMessage()); |