| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.BasCrnErrorMapper; |
| | | import com.zy.asrs.mapper.TestMastMapper; |
| | | import com.zy.asrs.mapper.WaitPakinMapper; |
| | | import com.zy.asrs.mapper.WrkMastMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.MatDto; |
| | | import com.zy.common.model.SearchLocParam; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.model.*; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.CollectionUtils; |
| | | import com.zy.common.utils.HttpHandler; |
| | |
| | | private BasErrLogService basErrLogService; |
| | | @Autowired |
| | | private BasCrnErrorMapper basCrnErrorMapper; |
| | | @Autowired |
| | | private TestMastService testMastService; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | |
| | | @Value("${test.url}") |
| | | private String testUrl; |
| | | |
| | | /** |
| | | * 组托 |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public void outOfDevp() { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据PLC按钮测试信号,发送启动申请到测试系统 |
| | | */ |
| | | public void startTest() { |
| | | try { |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | if(null != devpThread){ |
| | | if (devpThread.startSignal1 == 1){ |
| | | TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>() |
| | | .eq("channel",1).eq("status",0)); |
| | | if(null != testMast){ |
| | | Date now = new Date(); |
| | | //http请求测试 |
| | | TestDto testDto = new TestDto(); |
| | | testDto.setLocNo(testMast.getLocNo()); |
| | | testDto.setBarcode(testMast.getBarcode()); |
| | | testDto.setUserId(testMast.getUserId()); |
| | | testDto.setRequestTime(DateUtils.convert(now)); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(testUrl) |
| | | .setPath("/testUrlPath") |
| | | .setJson(JSON.toJSONString(testDto)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | //更新测试表状态 |
| | | testMast.setStatus(1); |
| | | testMast.setModiTime(now); |
| | | testMastService.update(testMast,new EntityWrapper<TestMast>() |
| | | .eq("channel",1).eq("status",0)); |
| | | //复位PLC信号 |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, 0)); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{},request:{},response:{}", testUrl+"/rpc/pakin/loc/v1", JSON.toJSONString(testDto), response); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |