|  |  |  | 
|---|
|  |  |  | import com.zy.core.model.protocol.CrnProtocol; | 
|---|
|  |  |  | import com.zy.core.properties.SlaveProperties; | 
|---|
|  |  |  | import com.zy.core.properties.SystemProperties; | 
|---|
|  |  |  | import com.zy.core.thread.RgvThread; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
|---|
|  |  |  | 
|---|
|  |  |  | command.setDestinationPosX(param.getRow());     // 目标库位排 | 
|---|
|  |  |  | command.setDestinationPosY(param.getBay());     // 目标库位列 | 
|---|
|  |  |  | command.setDestinationPosZ(param.getLev());     // 目标库位层 | 
|---|
|  |  |  | boolean locSts = isLocSts(param.getRow().toString(), param.getBay().toString(), param.getLev().toString()); | 
|---|
|  |  |  | command.setTraySize(locSts); | 
|---|
|  |  |  | return crnControl(command)?R.ok():R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | command.setDestinationPosX(param.getRow());     // 目标库位排 | 
|---|
|  |  |  | command.setDestinationPosY(param.getBay());     // 目标库位列 | 
|---|
|  |  |  | command.setDestinationPosZ(param.getLev());     // 目标库位层 | 
|---|
|  |  |  | boolean locSts = isLocSts(param.getSourceRow().toString(), param.getSourceBay().toString(), param.getSourceLev().toString()); | 
|---|
|  |  |  | command.setTraySize(locSts); | 
|---|
|  |  |  | return crnControl(command)?R.ok():R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | .eq("bay1", command.getSourcePosY()).eq("lev1", command.getSourcePosZ())); | 
|---|
|  |  |  | LocMast loc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", command.getDestinationPosX()) | 
|---|
|  |  |  | .eq("bay1", command.getDestinationPosY()).eq("lev1", command.getDestinationPosZ())); | 
|---|
|  |  |  | VersionUtils.locMoveCheckLocType(sourceLoc, loc); | 
|---|
|  |  |  | if (sourceLoc.getLocType1() != loc.getLocType1()){ | 
|---|
|  |  |  | return R.error("库位类型不一致"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | command.setTraySize(loc.getLocType1() == 2); | 
|---|
|  |  |  | //        VersionUtils.locMoveCheckLocType(sourceLoc, loc); | 
|---|
|  |  |  | return crnControl(command)?R.ok():R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | command.setDestinationPosZ((short) 0);     // 目标库位层 | 
|---|
|  |  |  | return crnControl(command)?R.ok():R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //    @ManagerAuth(memo = "暂停") | 
|---|
|  |  |  | //    @PostMapping("/operator/pause") | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private boolean isLocSts(String row,String bay,String lev){ | 
|---|
|  |  |  | String loc = String.format("%2d",row)+String.format("%3d",bay)+String.format("%2d",lev); | 
|---|
|  |  |  | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", loc)); | 
|---|
|  |  |  | if (Cools.isEmpty(locMast)){ | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (locMast.getLocType1() == 2){ | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|