| | |
| | | import com.zy.acs.manager.core.integrate.dto.ConveyorQueryParam; |
| | | import com.zy.acs.manager.core.integrate.dto.ConveyorQueryResult; |
| | | import com.zy.acs.manager.manager.entity.Sta; |
| | | import com.zy.acs.manager.manager.entity.Task; |
| | | import com.zy.acs.manager.manager.enums.StatusType; |
| | | import com.zy.acs.manager.manager.service.StaService; |
| | | import com.zy.acs.manager.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @Api(tags = "Open Api") |
| | | @RestController |
| | | @RequestMapping("/api/open") |
| | | public class ConveyorController extends BaseController { |
| | | public class ConveyorController { |
| | | |
| | | @Autowired |
| | | private StaService staService; |
| | |
| | | .orderByAsc(Sta::getStaNo) |
| | | ); |
| | | for (Sta sta : list) { |
| | | resultList.add(new ConveyorQueryResult(sta.getStaNo() |
| | | , staService.hasWorkingAgv(sta.getId()))); |
| | | Long staId = sta.getId(); |
| | | boolean conveyable = !staService.hasWorkingAgv(staId); |
| | | String taskNo = null; |
| | | if (conveyable) { |
| | | Task task = staService.checkoutTask(staId); |
| | | if (null != task) { |
| | | taskNo = task.getSeqNum(); |
| | | } |
| | | } |
| | | resultList.add(new ConveyorQueryResult(sta.getStaNo(), conveyable, taskNo)); |
| | | } |
| | | } else { |
| | | for (String staNo : staNos) { |
| | |
| | | resultList.add(new ConveyorQueryResult(staNo, Boolean.FALSE)); |
| | | continue; |
| | | } |
| | | resultList.add(new ConveyorQueryResult(staNo |
| | | , staService.hasWorkingAgv(sta.getId()))); |
| | | Long staId = sta.getId(); |
| | | boolean conveyable = !staService.hasWorkingAgv(staId); |
| | | String taskNo = null; |
| | | if (conveyable) { |
| | | Task task = staService.checkoutTask(staId); |
| | | if (null != task) { |
| | | taskNo = task.getSeqNum(); |
| | | } |
| | | } |
| | | resultList.add(new ConveyorQueryResult(staNo, conveyable, taskNo)); |
| | | } |
| | | } |
| | | |