| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasDevpPosition; |
| | | import com.zy.asrs.service.BasDevpPositionService; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | @Data |
| | | public class WcsTaskDistributionParam { |
| | | |
| | | public static final List<Integer> STA_ALL = new ArrayList<Integer>() {{ |
| | | add(101);add(102);add(103);add(104);add(105);add(106);add(107);add(108);add(109);add(110); |
| | | add(111);add(113);add(114);add(115); |
| | | |
| | | add(116);add(117);add(118);add(119);add(120); |
| | | add(121);add(122);add(123);add(124);add(125);add(126);add(127);add(128);add(129);add(130); |
| | | add(131);add(132);add(133); |
| | | }}; |
| | | // public static final List<Integer> STA_ALL = new ArrayList<Integer>() {{ |
| | | // add(101);add(102);add(103);add(104);add(105);add(106);add(107);add(108);add(109);add(110); |
| | | // add(111);add(112);add(113);add(114);add(115); |
| | | // |
| | | // add(116);add(117);add(118);add(119);add(120); |
| | | // add(121);add(122);add(123);add(124);add(125);add(126);add(127);add(128);add(129);add(130); |
| | | // add(131);add(132);add(133); |
| | | // }}; |
| | | |
| | | private Long taskNo;//工作号 |
| | | private String startSta;//起点 |
| | |
| | | public Integer getStartSta$(){ |
| | | if (this.startSta != null){ |
| | | try{ |
| | | if (STA_ALL.contains(Integer.parseInt(this.startSta))) { |
| | | return Integer.parseInt(this.startSta); |
| | | } else { |
| | | int startStaI = Integer.parseInt(this.startSta); |
| | | BasDevpPositionService basDevpPositionService = SpringUtils.getBean(BasDevpPositionService.class); |
| | | List<BasDevpPosition> basDevpPositions = basDevpPositionService.list(new QueryWrapper<BasDevpPosition>().eq("dev_no",startStaI)); |
| | | if (basDevpPositions.isEmpty()){ |
| | | return 0; |
| | | } |
| | | return startStaI; |
| | | } catch (Exception e){ |
| | | return 0; |
| | | } |
| | |
| | | public Integer getEndSta$(){ |
| | | if (this.endSta != null){ |
| | | try{ |
| | | if (STA_ALL.contains(Integer.parseInt(this.endSta))) { |
| | | return Integer.parseInt(this.endSta); |
| | | } else { |
| | | int endStaI = Integer.parseInt(this.endSta); |
| | | BasDevpPositionService basDevpPositionService = SpringUtils.getBean(BasDevpPositionService.class); |
| | | List<BasDevpPosition> basDevpPositions = basDevpPositionService.list(new QueryWrapper<BasDevpPosition>().eq("dev_no",endStaI)); |
| | | if (basDevpPositions.isEmpty()){ |
| | | return 0; |
| | | } |
| | | return endStaI; |
| | | } catch (Exception e){ |
| | | return 0; |
| | | } |