| | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | |
| | | @Autowired |
| | | private WorkService workService; |
| | | |
| | | @Value("${channel.equipmentRow}") |
| | | private Integer equipmentRow; //测试库位所在排号 |
| | | @Value("${channel.quietRow}") |
| | | private Integer quietRow; //静置库位所在排号 |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start() { |
| | | try { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "F") |
| | | .eq("pack_status", 3) |
| | | .eq("row1", 2) |
| | | .eq("row1", equipmentRow) |
| | | .eq("loc_type1", (short) 1) |
| | | .eq("fire_status",0) |
| | | ); |
| | |
| | | if (!Cools.isEmpty(testMast)){ |
| | | if (testMast.getStatus()==4){ |
| | | //移库开始,查询目标库位 |
| | | LocMast targetLocNo = locMastService.queryFreeLocMast(1,(short)2); |
| | | LocMast targetLocNo = locMastService.queryFreeLocMast(quietRow,(short)2); |
| | | if (Cools.isEmpty(targetLocNo)){ |
| | | targetLocNo=locMastService.queryFreeLocMast(2,(short)2); |
| | | targetLocNo=locMastService.queryFreeLocMast(equipmentRow,(short)2); |
| | | } |
| | | if (targetLocNo != null){ |
| | | workService.locMove(locMast.getLocNo(),targetLocNo.getLocNo(),(long)Integer.parseInt(testMast.getUserId())); |
| | | }else { |
| | | log.error("没有空库位"); |
| | | log.error("测试完成自动移库--->没有空库位!"); |
| | | } |
| | | }else if (testMast.getStatus()!=4) { |
| | | log.error("测试状态异常,库位号为:" + testMast.getLocNo()); |
| | | } |
| | | }else { |
| | | log.error("测试库位:"+locMast.getLocNo()+"所属测试档为空"); |
| | | log.error("测试库位:"+locMast.getLocNo()+"所属测试档为空或者不状态为4"); |
| | | } |
| | | } |
| | | } |