|  |  |  | 
|---|
|  |  |  | @Value("${wms.url}") | 
|---|
|  |  |  | private String wmsUrl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 工装类型 WMS下发 N65/N87/G4X/B10 WCS转换为4,N74/PPE 转换为3 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static short getGzlx(String lx) { | 
|---|
|  |  |  | if (Cools.isEmpty(lx)) { | 
|---|
|  |  |  | return 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | switch (lx) { | 
|---|
|  |  |  | case "N74": | 
|---|
|  |  |  | case "PPE": | 
|---|
|  |  |  | return 3; | 
|---|
|  |  |  | case "N65": | 
|---|
|  |  |  | case "N87": | 
|---|
|  |  |  | case "B10": | 
|---|
|  |  |  | return 4; | 
|---|
|  |  |  | default: | 
|---|
|  |  |  | return 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public HashMap<String, Object> taskCreate(TaskCreateParam param) { | 
|---|
|  |  |  | HashMap<String, Object> map = new HashMap<>(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int workNoType = WorkNoType.PAKOUT.type; | 
|---|
|  |  |  | // 2,3号堆垛机出库,需要通过条码区分大小托盘,16开头小托盘,18开头大托盘,任务号3001-6000为小托盘 | 
|---|
|  |  |  | if (param.getIoType() == 2 && (locMast.getCrnNo() == 3 || locMast.getCrnNo() == 2) && locMast.getBarcode().startsWith("16")){ | 
|---|
|  |  |  | if (param.getIoType() == 2 && (locMast.getCrnNo() == 3 || locMast.getCrnNo() == 2) && locMast.getBarcode().startsWith("16")) { | 
|---|
|  |  |  | workNoType = WorkNoType.PICK.type; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int workNo1 = commonService.getWorkNo(workNoType);//获取入库工作号 | 
|---|
|  |  |  | 
|---|
|  |  |  | taskWrk.setBarcode(param.getBarcode());//条码 | 
|---|
|  |  |  | taskWrk.setCrnNo(locMast.getCrnNo()); | 
|---|
|  |  |  | taskWrk.setType(param.getType()); | 
|---|
|  |  |  | taskWrk.setMp((short) (param.getLev() > 1 ? 1 : 2)); | 
|---|
|  |  |  | taskWrk.setLx(getGzlx(param.getLx())); | 
|---|
|  |  |  | taskWrk.setLev(param.getLev()); | 
|---|
|  |  |  | if (param.getIoType() == 1) { | 
|---|
|  |  |  | taskWrk.setWrkSts(1); | 
|---|
|  |  |  | if (!Cools.isEmpty(param.getTargetPoint())) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } else if (param.getIoType() == 2) { | 
|---|
|  |  |  | taskWrk.setWrkSts(11); | 
|---|
|  |  |  | //            if (!Cools.isEmpty(param.getStartPoint())) { | 
|---|
|  |  |  | taskWrk.setStartPoint(param.getStartPoint());//起点 | 
|---|
|  |  |  | taskWrk.setTargetPoint(String.valueOf(Integer.parseInt(param.getTargetPoint())-1)); | 
|---|
|  |  |  | taskWrk.setStartPoint(param.getStartPoint());//起点 | 
|---|
|  |  |  | if (Integer.parseInt(param.getTargetPoint()) == 211 || Integer.parseInt(param.getTargetPoint()) == 206 || Integer.parseInt(param.getTargetPoint()) == 202) { | 
|---|
|  |  |  | taskWrk.setTargetPoint(String.valueOf(Integer.parseInt(param.getTargetPoint()) + 1)); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | taskWrk.setTargetPoint(String.valueOf(Integer.parseInt(param.getTargetPoint()) - 1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //            taskWrk.setTargetPoint(param.getTargetPoint()); | 
|---|
|  |  |  | } else if (param.getIoType() == 3) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | staProtocol = staProtocol.clone(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | StaProtocol staProtocol1 = devpThread.getStation().get(param.getTargetSite()); | 
|---|
|  |  |  | if (staProtocol1 == null) { | 
|---|
|  |  |  | return R.parse(param.getTargetSite() + "线程为空!"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | staProtocol1 = staProtocol1.clone(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        if (staProtocol1.isLoading()) { | 
|---|
|  |  |  | //            return R.error(staProtocol1.getSiteId() + "站点有物!"); | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!staProtocol.isAutoing()) { | 
|---|
|  |  |  | return R.error(staProtocol.getSiteId() + "站点fei自动"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | staProtocol.setWorkNo((short) commonService.getWorkNo(param.getFlag())); | 
|---|
|  |  |  | staProtocol.setStaNo(param.getTargetSite().shortValue()); | 
|---|
|  |  |  | basDevpService.updateById(basDevp); | 
|---|