| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.domain.param.CreateInTaskParam; |
| | | import com.zy.asrs.domain.param.CreateOutTaskParam; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | |
| | | private CrnOperateProcessUtils crnOperateUtils; |
| | | @Autowired |
| | | private StationOperateProcessUtils stationOperateProcessUtils; |
| | | @Autowired |
| | | private HttpRequestLogService httpRequestLogService; |
| | | |
| | | @Override |
| | | public void run() { |
| | |
| | | continue; |
| | | } |
| | | |
| | | HashMap<String, Object> requestParam = new HashMap<>(); |
| | | String response = null; |
| | | try { |
| | | HashMap<String, Object> param = new HashMap<>(); |
| | | param.put("barcode", stationProtocol.getBarcode()); |
| | | param.put("sourceStaNo", stationProtocol.getStationId()); |
| | | param.put("locType1", stationProtocol.getPalletHeight()); |
| | | param.put("row", Utils.getInTaskEnableRow()); |
| | | requestParam.put("barcode", stationProtocol.getBarcode()); |
| | | requestParam.put("sourceStaNo", stationProtocol.getStationId()); |
| | | requestParam.put("locType1", stationProtocol.getPalletHeight()); |
| | | requestParam.put("row", Utils.getInTaskEnableRow()); |
| | | |
| | | String response = new HttpHandler.Builder() |
| | | response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath(wmsSystemInUrl) |
| | | .setJson(JSON.toJSONString(param)) |
| | | .setJson(JSON.toJSONString(requestParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | |
| | | taskParam.setTaskPri(dto.getTaskPri()); |
| | | taskParam.setBarcode(stationProtocol.getBarcode()); |
| | | boolean result = commonService.createInTask(taskParam); |
| | | |
| | | News.info("请求WMS接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); |
| | | } else { |
| | | News.error("请求WMS接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | News.error("请求WMS接口失败!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); |
| | | } |
| | | |
| | | redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 10); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | HttpRequestLog httpRequestLog = new HttpRequestLog(); |
| | | httpRequestLog.setName(wmsUrl + wmsSystemInUrl); |
| | | httpRequestLog.setRequest(JSON.toJSONString(requestParam)); |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | } |
| | | } |
| | | } |