|  |  |  | 
|---|
|  |  |  | import com.core.common.DateUtils; | 
|---|
|  |  |  | import com.core.common.R; | 
|---|
|  |  |  | import com.core.exception.CoolException; | 
|---|
|  |  |  | import com.zy.asrs.domain.enums.LedErrorAreaType; | 
|---|
|  |  |  | import com.zy.asrs.domain.enums.WorkNoType; | 
|---|
|  |  |  | import com.zy.asrs.entity.*; | 
|---|
|  |  |  | import com.zy.asrs.mapper.*; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //    private static final Integer jarMaxLoc1 = 7; | 
|---|
|  |  |  | private static  Integer jarMaxLoc = 0; | 
|---|
|  |  |  | //    private static  Integer signBigTurn = 0; | 
|---|
|  |  |  | //    private static  Integer signSmallTurn = 0; | 
|---|
|  |  |  | private static final Float jarTemperature = 50F; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private CommonService commonService; | 
|---|
|  |  |  | 
|---|
|  |  |  | // 退回 | 
|---|
|  |  |  | if (back) { | 
|---|
|  |  |  | // led 异常显示 | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg(errMsg); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LedErrorThreadUtil.ledErrorThread(errMsg,inSta.getLed(), LedErrorAreaType.FOUR_BARCODE.getDesc()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // led 异常显示 | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg("入库请求失败"+jsonObject.getInteger("code")); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LedErrorThreadUtil.ledErrorThread("入库请求失败"+jsonObject.getInteger("code"),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); | 
|---|
|  |  |  | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 尺寸检测异常 | 
|---|
|  |  |  | boolean back = false; | 
|---|
|  |  |  | String errMsg = "异常:"; | 
|---|
|  |  |  | String errMsg = inSta.getStaNo()+"站点:"; | 
|---|
|  |  |  | if (staProtocol.isFrontErr()) { | 
|---|
|  |  |  | errMsg = errMsg+"前超限;"; | 
|---|
|  |  |  | back = true; | 
|---|
|  |  |  | 
|---|
|  |  |  | // 退回 | 
|---|
|  |  |  | if (back) { | 
|---|
|  |  |  | // led 异常显示 | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg(errMsg); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LedErrorThreadUtil.ledErrorThread(errMsg,inSta.getLed(), LedErrorAreaType.FOUR_BARCODE.getDesc()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // led 异常显示 | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg("入库请求失败"+jsonObject.getInteger("code")); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LedErrorThreadUtil.ledErrorThread("入库请求失败"+jsonObject.getInteger("code"),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); | 
|---|
|  |  |  | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 尺寸检测异常 | 
|---|
|  |  |  | boolean back = false; | 
|---|
|  |  |  | String errMsg = "异常:"; | 
|---|
|  |  |  | String errMsg = inSta.getStaNo()+"站点:"; | 
|---|
|  |  |  | if (staProtocol.isFrontErr()) { | 
|---|
|  |  |  | errMsg = errMsg+"前超限;"; | 
|---|
|  |  |  | back = true; | 
|---|
|  |  |  | 
|---|
|  |  |  | // 退回 | 
|---|
|  |  |  | if (back) { | 
|---|
|  |  |  | // led 异常显示 | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg(errMsg); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LedErrorThreadUtil.ledErrorThread(errMsg,inSta.getLed(), LedErrorAreaType.FOUR_BARCODE.getDesc()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | //                        if (!result) { | 
|---|
|  |  |  | //                            throw new CoolException("更新plc站点信息失败"); | 
|---|
|  |  |  | //                        } | 
|---|
|  |  |  | String msg =inSta.getStaNo()+"站点条码异常,条码="+barcode; | 
|---|
|  |  |  | LedErrorThreadUtil.ledErrorThread(msg,inSta.getLed(), LedErrorAreaType.FOUR_BARCODE.getDesc()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | if (wrkMast111 != null) { | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | barcodeThread.setBarcode(""); | 
|---|
|  |  |  | staProtocol.setWorkNo(wrkMast111.getWrkNo()); | 
|---|
|  |  |  | staProtocol.setStaNo(wrkMast111.getStaNo()); | 
|---|
|  |  |  | StaProtocol staProtocol1 = new StaProtocol(); | 
|---|
|  |  |  | staProtocol1.setSiteId(staProtocol.getSiteId()); | 
|---|
|  |  |  | staProtocol1.setWorkNo(wrkMast111.getWrkNo()); | 
|---|
|  |  |  | staProtocol1.setStaNo(wrkMast111.getStaNo()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | devpThread.setPakMk(staProtocol.getSiteId(), false,637); | 
|---|
|  |  |  | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | devpThread.setPakMk(staProtocol1.getSiteId(), false,637); | 
|---|
|  |  |  | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol1)); | 
|---|
|  |  |  | if (!result) { | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg("更新plc站点信息失败!站点好:"+inSta.getStaNo()); | 
|---|
|  |  |  | errMsg1.setErrMsg("更新plc站点信息失败!站点号:"+inSta.getStaNo()); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode); | 
|---|
|  |  |  | if (wrkMast != null) { | 
|---|
|  |  |  | log.error("工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo()); | 
|---|
|  |  |  | String msg ="工作档中已存在"+inSta.getStaNo()+"站点数据,工作号="+wrkMast.getWrkNo(); | 
|---|
|  |  |  | LedErrorThreadUtil.ledErrorThread(msg,inSta.getLed(),LedErrorAreaType.TWO_PAKIN.getDesc()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //                    // 获取入库通知档 | 
|---|
|  |  |  | 
|---|
|  |  |  | StartupDto dto = jsonObject.getObject("data", StartupDto.class); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | StaProtocol staProtocol1 = new StaProtocol(); | 
|---|
|  |  |  | staProtocol1.setSiteId(staProtocol.getSiteId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | barcodeThread.setBarcode(""); | 
|---|
|  |  |  | staProtocol.setWorkNo(dto.getWorkNo()); | 
|---|
|  |  |  | staProtocol1.setWorkNo(dto.getWorkNo()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(Cools.isEmpty(dto.getRgvNo()) || dto.getRgvNo() <= 0) { | 
|---|
|  |  |  | staProtocol.setStaNo(dto.getStaNo()); | 
|---|
|  |  |  | staProtocol1.setStaNo(dto.getStaNo()); | 
|---|
|  |  |  | } else {//如果存在RGV编号,说明需要RGV接驳,先下发任务到RGV源站 | 
|---|
|  |  |  | staProtocol.setStaNo(dto.getRgvSstaNo()); | 
|---|
|  |  |  | staProtocol1.setStaNo(dto.getRgvSstaNo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | devpThread.setPakMk(staProtocol.getSiteId(), false,695); | 
|---|
|  |  |  | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | devpThread.setPakMk(staProtocol1.getSiteId(), false,695); | 
|---|
|  |  |  | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol1)); | 
|---|
|  |  |  | if (!result) { | 
|---|
|  |  |  | LedErrorThreadUtil.ledErrorThread("更新plc站点信息失败!站点号:"+inSta.getStaNo(),inSta.getLed(),LedErrorAreaType.ONE_OTHER.getDesc()); | 
|---|
|  |  |  | throw new CoolException("更新plc站点信息失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg("更新plc站点信息失败!站点好:"+inSta.getStaNo()); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | throw new CoolException("更新plc站点信息失败"); | 
|---|
|  |  |  | } catch (Exception e){ | 
|---|
|  |  |  | log.error("入库成功!电视机信息更新失败,小料箱入库!!!request:{};response:{}",JSON.toJSONString(param), response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/pair/station/single/loc/v1", JSON.toJSONString(param), response); | 
|---|
|  |  |  | String msg = inSta.getStaNo()+"站点:"+jsonObject.getString("msg"); | 
|---|
|  |  |  | LedErrorThreadUtil.ledErrorThread(msg,inSta.getLed(), LedErrorAreaType.TWO_PAKIN.getDesc()); | 
|---|
|  |  |  | Thread.sleep(1000); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 尺寸检测异常 | 
|---|
|  |  |  | boolean back = false; | 
|---|
|  |  |  | String errMsg = "异常:"; | 
|---|
|  |  |  | String errMsg = inSta.getStaNo()+"站点:"; | 
|---|
|  |  |  | if (staProtocol.isFrontErr()) { | 
|---|
|  |  |  | errMsg = errMsg+"前超限;"; | 
|---|
|  |  |  | back = true; | 
|---|
|  |  |  | 
|---|
|  |  |  | // 退回 | 
|---|
|  |  |  | if (back) { | 
|---|
|  |  |  | // led 异常显示 | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg(errMsg); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LedErrorThreadUtil.ledErrorThread(errMsg,inSta.getLed(), LedErrorAreaType.FOUR_BARCODE.getDesc()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | if (wrkMast != null) { | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | barcodeThread.setBarcode(""); | 
|---|
|  |  |  | staProtocol.setWorkNo(wrkMast.getWrkNo()); | 
|---|
|  |  |  | staProtocol.setStaNo(wrkMast.getStaNo()); | 
|---|
|  |  |  | StaProtocol staProtocol1 = new StaProtocol(); | 
|---|
|  |  |  | staProtocol1.setWorkNo(wrkMast.getWrkNo()); | 
|---|
|  |  |  | staProtocol1.setStaNo(wrkMast.getStaNo()); | 
|---|
|  |  |  | staProtocol1.setSiteId(staProtocol.getSiteId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | devpThread.setPakMk(staProtocol.getSiteId(), false,843); | 
|---|
|  |  |  | log.info("锁定标记flase===》N===》站点号:{},工作号:{},条码:{}",staProtocol.getSiteId(),staProtocol.getWorkNo(),barcode); | 
|---|
|  |  |  | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | devpThread.setPakMk(staProtocol1.getSiteId(), false,843); | 
|---|
|  |  |  | log.info("锁定标记flase===》N===》站点号:{},工作号:{},条码:{}",staProtocol1.getSiteId(),staProtocol1.getWorkNo(),barcode); | 
|---|
|  |  |  | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol1)); | 
|---|
|  |  |  | if (!result) { | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg("更新plc站点信息失败!站点好:"+inSta.getStaNo()); | 
|---|
|  |  |  | errMsg1.setErrMsg("更新plc站点信息失败!站点号:"+inSta.getStaNo()); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | JSONObject jsonObject = JSON.parseObject(response); | 
|---|
|  |  |  | if (jsonObject.getInteger("code").equals(200)) { | 
|---|
|  |  |  | StartupDto dto = jsonObject.getObject("data", StartupDto.class); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | StaProtocol staProtocol1 = new StaProtocol(); | 
|---|
|  |  |  | staProtocol1.setSiteId(staProtocol.getSiteId()); | 
|---|
|  |  |  | barcodeThread.setBarcode(""); | 
|---|
|  |  |  | staProtocol.setWorkNo(dto.getWorkNo()); | 
|---|
|  |  |  | staProtocol1.setWorkNo(dto.getWorkNo()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(Cools.isEmpty(dto.getRgvNo()) || dto.getRgvNo() <= 0) { | 
|---|
|  |  |  | staProtocol.setStaNo(dto.getStaNo()); | 
|---|
|  |  |  | staProtocol1.setStaNo(dto.getStaNo()); | 
|---|
|  |  |  | } else {//如果存在RGV编号,说明需要RGV接驳,先下发任务到RGV源站 | 
|---|
|  |  |  | staProtocol.setStaNo(dto.getRgvSstaNo()); | 
|---|
|  |  |  | staProtocol1.setStaNo(dto.getRgvSstaNo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | devpThread.setPakMk(staProtocol.getSiteId(), false,892); | 
|---|
|  |  |  | log.info("锁定标记flase===》N===》站点号:{},工作号:{},条码:{}",staProtocol.getStaNo(),staProtocol.getWorkNo(),barcode); | 
|---|
|  |  |  | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | devpThread.setPakMk(staProtocol1.getSiteId(), false,892); | 
|---|
|  |  |  | log.info("锁定标记flase===》N===》站点号:{},工作号:{},条码:{}",staProtocol1.getStaNo(),staProtocol1.getWorkNo(),barcode); | 
|---|
|  |  |  | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol1)); | 
|---|
|  |  |  | if (!result) { | 
|---|
|  |  |  | throw new CoolException("更新plc站点信息失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else  if (jsonObject.getInteger("code").equals(700)){ | 
|---|
|  |  |  | SearchLocParam param2 = new SearchLocParam(); | 
|---|
|  |  |  | param2.setBarcode(barcode); | 
|---|
|  |  |  | param2.setSourceStaNo(inSta.getStaNo()); | 
|---|
|  |  |  | param2.setLocType1(locTypeDto.getLocType1()); | 
|---|
|  |  |  | String response2 = new HttpHandler.Builder() | 
|---|
|  |  |  | .setUri(wmsUrl) | 
|---|
|  |  |  | .setPath("/rpc/pakin/yx/loc/v33") | 
|---|
|  |  |  | .setJson(JSON.toJSONString(param2)) | 
|---|
|  |  |  | .build() | 
|---|
|  |  |  | .doPost(); | 
|---|
|  |  |  | JSONObject jsonObject2 = JSON.parseObject(response2); | 
|---|
|  |  |  | if (jsonObject2.getInteger("code").equals(200)) { | 
|---|
|  |  |  | log.info("大料箱自动组托成功!!"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e){ | 
|---|
|  |  |  | log.error("入库成功!电视机信息更新失败,大料箱入库!!!request:{};response:{}",JSON.toJSONString(param), response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //                        } else  if (jsonObject.getInteger("code").equals(700)){ | 
|---|
|  |  |  | //                            SearchLocParam param2 = new SearchLocParam(); | 
|---|
|  |  |  | //                            param2.setBarcode(barcode); | 
|---|
|  |  |  | //                            param2.setSourceStaNo(inSta.getStaNo()); | 
|---|
|  |  |  | //                            param2.setLocType1(locTypeDto.getLocType1()); | 
|---|
|  |  |  | //                            String response2 = new HttpHandler.Builder() | 
|---|
|  |  |  | //                                    .setUri(wmsUrl) | 
|---|
|  |  |  | //                                    .setPath("/rpc/pakin/yx/loc/v33") | 
|---|
|  |  |  | //                                    .setJson(JSON.toJSONString(param2)) | 
|---|
|  |  |  | //                                    .build() | 
|---|
|  |  |  | //                                    .doPost(); | 
|---|
|  |  |  | //                            JSONObject jsonObject2 = JSON.parseObject(response2); | 
|---|
|  |  |  | //                            if (jsonObject2.getInteger("code").equals(200)) { | 
|---|
|  |  |  | //                                log.info("大料箱自动组托成功!!"); | 
|---|
|  |  |  | //                            } else { | 
|---|
|  |  |  | //                                log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                                LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                                if (ledThread != null) { | 
|---|
|  |  |  | //                                    ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | //                                    errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); | 
|---|
|  |  |  | //                                    errMsg1.setArea("1"); | 
|---|
|  |  |  | //                                    MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | //                                } | 
|---|
|  |  |  | //                            } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String msg = inSta.getStaNo()+"站点:"+jsonObject.getString("msg"); | 
|---|
|  |  |  | LedErrorThreadUtil.ledErrorThread(msg,inSta.getLed(),LedErrorAreaType.TWO_PAKIN.getDesc()); | 
|---|
|  |  |  | Thread.sleep(1000); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | 
|---|
|  |  |  | log.error("入库 ===>> 堆垛机站点在数据库不存在, 站点编号={}", crnStn.getStaNoOther()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | boolean signStanOther81 = false; | 
|---|
|  |  |  | if (staProtocolOther.getWorkNo()!=0){ | 
|---|
|  |  |  | WrkMast wrkMastOther = wrkMastMapper.selectPakInStep3(staProtocolOther.getWorkNo()); | 
|---|
|  |  |  | if (Cools.isEmpty(wrkMastOther)){ | 
|---|
|  |  |  | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | signStanOther81 = true; | 
|---|
|  |  |  | crnStation=2; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | StaProtocol staProtocolOther1 = devpThread.getStation().get(crnStn.getStaNoOther1()); | 
|---|
|  |  |  | if (staProtocolOther1 == null) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | staProtocolOther1 = staProtocolOther1.clone(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!signStanOther81){ | 
|---|
|  |  |  | StaProtocol staProtocolOther1 = devpThread.getStation().get(crnStn.getStaNoOther1()); | 
|---|
|  |  |  | if (staProtocolOther1 == null) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | staProtocolOther1 = staProtocolOther1.clone(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (staProtocolOther1.isAutoing() && staProtocolOther1.getWorkNo()!=0){ | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (staProtocolOther1.isAutoing() || staProtocolOther1.getWorkNo()!=0){ | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | StaProtocol staProtocolOther2 = devpThread.getStation().get(crnStn.getStaNoOther2()); | 
|---|
|  |  |  | if (staProtocolOther2 == null) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | staProtocolOther2 = staProtocolOther2.clone(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (staProtocolOther2.isAutoing() && staProtocolOther2.getWorkNo()!=0){ | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | StaProtocol staProtocolOther2 = devpThread.getStation().get(crnStn.getStaNoOther2()); | 
|---|
|  |  |  | if (staProtocolOther2 == null) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | staProtocolOther2 = staProtocolOther2.clone(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (staProtocolOther2.isAutoing() || staProtocolOther2.getWorkNo()!=0){ | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | crnStation = 2; | 
|---|
|  |  |  | // 命令下发区 -------------------------------------------------------------------------- | 
|---|
|  |  |  | 
|---|
|  |  |  | if (wrkMast == null) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //            if (wrkMast.getStaNoSign().equals(signBigTurn)){ | 
|---|
|  |  |  | //                continue; | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | crnStation = crnStation1; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (wrkMast.getStaNo()>309){ | 
|---|
|  |  |  | int wrkCount = wrkMastMapper.selectCount(new EntityWrapper<WrkMast>().eq("io_type", 110).gt("sta_no", 309).lt("sta_no", 314).gt("wrk_sts",11L)); | 
|---|
|  |  |  | if (wrkCount>=12){ | 
|---|
|  |  |  | if (wrkMast.booleanStaNoSign()){ | 
|---|
|  |  |  | RgvOneSign rgvOneSign = rgvOneSignMapper.selectOneSign("LineUp"+wrkMast.getStaNo()); | 
|---|
|  |  |  | if (Cools.isEmpty(rgvOneSign)){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | RgvOneSign bigTurn = rgvOneSignMapper.selectOneSign("bigTurn"); | 
|---|
|  |  |  | if (Cools.isEmpty(bigTurn)){ | 
|---|
|  |  |  | if (rgvOneSign.getRgvOneSign()>=2){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (bigTurn.getRgvOneSign()>13){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); | 
|---|
|  |  |  | StaProtocol staProtocolEnt = devpThread.getStation().get(212); | 
|---|
|  |  |  | if (staProtocolEnt.isLoading() || staProtocolEnt.getWorkNo()!=0){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //                int wrkCount = wrkMastMapper.selectCount(new EntityWrapper<WrkMast>().eq("io_type", 110).gt("sta_no", 309).lt("sta_no", 314).gt("wrk_sts",11L)); | 
|---|
|  |  |  | //                if (wrkCount>=12){ | 
|---|
|  |  |  | //                    continue; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                RgvOneSign bigTurn = rgvOneSignMapper.selectOneSign("bigTurn"); | 
|---|
|  |  |  | //                if (Cools.isEmpty(bigTurn)){ | 
|---|
|  |  |  | //                    continue; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                if (bigTurn.getRgvOneSign()>13){ | 
|---|
|  |  |  | //                    continue; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); | 
|---|
|  |  |  | //                StaProtocol staProtocolEnt = devpThread.getStation().get(wrkMast.getStaNoBying()); | 
|---|
|  |  |  | //                if (staProtocolEnt.isLoading() || staProtocolEnt.getWorkNo()!=0){ | 
|---|
|  |  |  | //                    continue; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 工作档状态判断 | 
|---|
|  |  |  | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        signBigTurn++; | 
|---|
|  |  |  | //        if (signBigTurn > 2){ | 
|---|
|  |  |  | //            signBigTurn = 0; | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jarProtocol.modeType != JarModeType.AUTO){ | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | //自动、空闲、右门关闭、   Other左门关闭 | 
|---|
|  |  |  | if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 | 
|---|
|  |  |  | && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){ | 
|---|
|  |  |  | if (jarProtocol.statusType != JarStatusType.SOS){ | 
|---|
|  |  |  | if (jarProtocol.statusType != JarStatusType.SOS && jarProtocol.statusType != JarStatusType.SOS2){ | 
|---|
|  |  |  | log.error("Jar任务创建===》执行===>行={}",4537); | 
|---|
|  |  |  | BasJarMast basJarMast = new BasJarMast(basJar, wrkMast, jarLocDigit); | 
|---|
|  |  |  | basJarMast.setJarEnterStaNo(staNo);//入硫化罐站点 | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jarProtocol.modeType != JarModeType.AUTO){ | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.getJarTemperature()>jarTemperature){ | 
|---|
|  |  |  | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //门作业  无 | 
|---|
|  |  |  | if (jarProtocol.isAutoing() && jarProtocol.statusType != JarStatusType.SOS && jarProtocol.jarErr==0 | 
|---|
|  |  |  | if (jarProtocol.isAutoing() && jarProtocol.statusType != JarStatusType.SOS && jarProtocol.statusType!= JarStatusType.SOS2 && jarProtocol.jarErr==0 | 
|---|
|  |  |  | && jarProtocol.isRightDoor() && jarProtocol.isLeftDoor() | 
|---|
|  |  |  | && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){ | 
|---|
|  |  |  | //关进料门 | 
|---|
|  |  |  | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMastSign)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } else if (jarProtocol.isAutoing() && jarProtocol.statusType != JarStatusType.SOS | 
|---|
|  |  |  | } else if (jarProtocol.isAutoing() && jarProtocol.statusType != JarStatusType.SOS && jarProtocol.statusType != JarStatusType.SOS2 | 
|---|
|  |  |  | && jarProtocol.statusType != JarStatusType.WAITING2 && jarProtocol.jarErr==0 | 
|---|
|  |  |  | && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor() | 
|---|
|  |  |  | && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){ | 
|---|
|  |  |  | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jarProtocol.modeType != JarModeType.AUTO){ | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jarProtocol.modeType != JarModeType.AUTO){ | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jarProtocol.modeType != JarModeType.AUTO){ | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jarProtocol.modeType != JarModeType.AUTO){ | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jarProtocol.modeType != JarModeType.AUTO){ | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (jarProtocolOther.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocolOther.statusType .equals(JarStatusType.SOS)  || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | //                    log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | add(5); | 
|---|
|  |  |  | add(11); | 
|---|
|  |  |  | add(17); | 
|---|
|  |  |  | add(99); | 
|---|
|  |  |  | add(100); | 
|---|
|  |  |  | add(999); | 
|---|
|  |  |  | }}); | 
|---|
|  |  |  | if(!basJarMastList.isEmpty()){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jarProtocol.modeType != JarModeType.AUTO){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.getJarTemperature()>jarTemperature){ | 
|---|
|  |  |  | 
|---|
|  |  |  | add(5); | 
|---|
|  |  |  | add(11); | 
|---|
|  |  |  | add(17); | 
|---|
|  |  |  | add(99); | 
|---|
|  |  |  | add(100); | 
|---|
|  |  |  | add(999); | 
|---|
|  |  |  | }}); | 
|---|
|  |  |  | if(basJarMastList.isEmpty()){ | 
|---|
|  |  |  | if (wrkMastExecuteService.selectNoStartCharge(steSlave.getId())==0){ | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jarProtocol.modeType != JarModeType.AUTO){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.getJarTemperature()>jarTemperature){ | 
|---|
|  |  |  | 
|---|
|  |  |  | if (!jarSteTake(wrkMastExecuteByCharge,SteLocaType.POINT20.id,SteLocaType.POINT20.id,SteTaskModeType.CLOSE_CHARGE,true,wrkMastExecuteByCharge.getJarId())){ | 
|---|
|  |  |  | log.error("穿梭板Ste命令下发失败,ste号={},任务数据={}", | 
|---|
|  |  |  | wrkMastExecuteByCharge.getSteId(), JSON.toJSONString(wrkMastExecuteByCharge)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | Thread.sleep(1000); | 
|---|
|  |  |  | } catch (Exception e){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | wrkMastExecuteByCharge.setWrkType(2); | 
|---|
|  |  |  | wrkMastExecuteByCharge.setWrkSts(100); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | for (int idi = 1;idi<5;idi++){ | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, idi); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg("测试:"+idi); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, idi, new Task(5, errMsg1)); | 
|---|
|  |  |  | } try { | 
|---|
|  |  |  | Thread.sleep(500); | 
|---|
|  |  |  | } catch (Exception e){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LedThread ledThread3 = (LedThread) SlaveConnection.get(SlaveType.Led, 3); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (ledThread3 != null) { | 
|---|
|  |  |  | ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | errMsg1.setErrMsg("测试测试测试测试测试测试测试测试测试测试测试测试测试:"+3); | 
|---|
|  |  |  | errMsg1.setArea("1"); | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, 3, new Task(5, errMsg1)); | 
|---|
|  |  |  | } try { | 
|---|
|  |  |  | Thread.sleep(500); | 
|---|
|  |  |  | } catch (Exception e){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        try{ | 
|---|
|  |  |  | //            for (int idi = 1;idi<5;idi++){ | 
|---|
|  |  |  | //                LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, idi); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                if (ledThread != null) { | 
|---|
|  |  |  | //                    ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | //                    errMsg1.setErrMsg("测试:"+idi); | 
|---|
|  |  |  | //                    errMsg1.setArea("1"); | 
|---|
|  |  |  | //                    MessageQueue.offer(SlaveType.Led, idi, new Task(5, errMsg1)); | 
|---|
|  |  |  | //                } try { | 
|---|
|  |  |  | //                    Thread.sleep(500); | 
|---|
|  |  |  | //                } catch (Exception e){ | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //            LedThread ledThread3 = (LedThread) SlaveConnection.get(SlaveType.Led, 3); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //            if (ledThread3 != null) { | 
|---|
|  |  |  | //                ErrMsg errMsg1 = new ErrMsg(); | 
|---|
|  |  |  | //                errMsg1.setErrMsg("测试测试测试测试测试测试测试测试测试测试测试测试测试:"+3); | 
|---|
|  |  |  | //                errMsg1.setArea("1"); | 
|---|
|  |  |  | //                MessageQueue.offer(SlaveType.Led, 3, new Task(5, errMsg1)); | 
|---|
|  |  |  | //            } try { | 
|---|
|  |  |  | //                Thread.sleep(500); | 
|---|
|  |  |  | //            } catch (Exception e){ | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } catch (Exception e){ } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (jarProtocol.modeType != JarModeType.AUTO){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ | 
|---|
|  |  |  | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (jarProtocol.getJarTemperature()>jarTemperature){ | 
|---|