New file |
| | |
| | | package com.example.springboot.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import com.example.springboot.entity.StorageCage; |
| | | import com.example.springboot.entity.StorageTask; |
| | | import com.example.springboot.mapper.HomeMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class StorageCageService { |
| | | @Autowired |
| | | private HomeMapper homeMapper; |
| | | private OutSliceServive outSliceServive; |
| | | private SpianService spianService; |
| | | |
| | | public void EndTask(int types) { |
| | | if (types == 0) {// 终止进片任务 |
| | | List<StorageTask> cageList = homeMapper.SelectTaskByState(types); |
| | | for (StorageTask storageTask : cageList) { |
| | | outSliceServive.StopTask(storageTask.getGlassId(), types); |
| | | } |
| | | // 发送终止进片任务信号 |
| | | } else {// 终止出片任务 |
| | | List<StorageCage> storageCages =homeMapper.selectinout(types); |
| | | for (StorageCage storageCage : storageCages) { |
| | | List<StorageCage> storageCagess=homeMapper.SelectStoragesGlassById(storageCage.getGlassId()); |
| | | for (StorageCage storageCagez : storageCagess) { |
| | | if (storageCagez.getState().equals("2")) {//调拨进片 |
| | | outSliceServive.StopTask(storageCagez.getGlassId(), 0); |
| | | }else{//出片 |
| | | outSliceServive.StopTask(storageCagez.getGlassId(), types); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void UpdateTask(Integer types, Integer shelfrack, String glassid) { |
| | | if (types == 0) {// 完成进片 |
| | | spianService.overtask(glassid); |
| | | } else if (types == 1) {// 完成出片 |
| | | spianService.overtask(glassid); |
| | | } else if (types == 2) {// 终止进片任务 |
| | | outSliceServive.StopTask(glassid, 0); |
| | | // 发送终止进片任务信号 |
| | | } else {// 终止出片任务 |
| | | outSliceServive.StopTask(glassid, 1); |
| | | } |
| | | } |
| | | |
| | | } |