| | |
| | | return response; |
| | | } |
| | | |
| | | public Response sendTaskInbound(WmsTaskDto taskDto) { |
| | | String httpUrl = "http://192.168.10.133:8051"+"/api/wms_task/inbound"; |
| | | Response response = HttpUtil.doPost(httpUrl, JsonUtil.getGson().toJson(taskDto)); |
| | | //对结果进行处理 |
| | | if(response.getCode() == 1){ //请求成功,data有正常数据 |
| | | String dataStr = (String) response.getData(); |
| | | WmsTaskResponse responseInside = JsonUtil.getGson().fromJson(dataStr, WmsTaskResponse.class); |
| | | response.set(1,responseInside); |
| | | if(responseInside.getCode() ==0) { |
| | | //对下发的任务进行数据库存储 |
| | | Date date = new Date(); |
| | | String pallet = taskDto.getPallet_code(); |
| | | String startLocationCode = taskDto.getStartlocation_code(); |
| | | //1=搬运空托,2=搬运电池. 转化到字段Des中,1001=搬运空托,1002=搬运电池 |
| | | Integer type = taskDto.getType(); |
| | | String taskNo = responseInside.getTask_no(); |
| | | |
| | | Task task = new Task(); |
| | | task.setTaskNo(taskNo); |
| | | task.setPallets(pallet); |
| | | task.setStartLocationCode(startLocationCode); |
| | | task.setDes(type ==1?1001:1002); |
| | | |
| | | task.setCreateTime(date); |
| | | |
| | | taskService.add(task); |
| | | |
| | | |
| | | } |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | public Response getLocationList() { |
| | | String httpUrl = "http://192.168.10.133:8051"+"/api/wms_location/get_all"; |
| | | Response response = HttpUtil.doGet(httpUrl, (String) null); |