add:增加token访问上位系统,acs定点任务无需请求上位系统
This commit is contained in:
@@ -67,7 +67,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
|||||||
};
|
};
|
||||||
log.info("下发删除AGV指令--{}", Bytes2HexString(b));
|
log.info("下发删除AGV指令--{}", Bytes2HexString(b));
|
||||||
|
|
||||||
// NDCSocketConnectionAutoRun.write(b);
|
OneNDCSocketConnectionAutoRun.write(b);
|
||||||
System.out.println("下发删除agv指令数据:" + Bytes2HexString(b));
|
System.out.println("下发删除agv指令数据:" + Bytes2HexString(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,9 +218,9 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
|||||||
};
|
};
|
||||||
log.info("下发AGV充电任务--{}", str1);
|
log.info("下发AGV充电任务--{}", str1);
|
||||||
|
|
||||||
try{
|
try {
|
||||||
OneNDCSocketConnectionAutoRun.write(b);
|
OneNDCSocketConnectionAutoRun.write(b);
|
||||||
} catch (Exception e){
|
} catch (Exception e) {
|
||||||
e.getMessage();
|
e.getMessage();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,9 +131,9 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
}
|
}
|
||||||
if (ikey != 0) {
|
if (ikey != 0) {
|
||||||
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
|
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
|
||||||
if (ObjectUtil.isEmpty(inst)) {
|
// if (ObjectUtil.isEmpty(inst)) {
|
||||||
inst = instructionService.findByCode(String.valueOf(ikey));
|
// inst = instructionService.findByCode(String.valueOf(ikey));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
if (!ObjectUtil.isEmpty(link_inst)) {
|
if (!ObjectUtil.isEmpty(link_inst)) {
|
||||||
link_flag = true;
|
link_flag = true;
|
||||||
@@ -154,8 +154,8 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
inst.setAgv_jobno(String.valueOf(index));
|
inst.setAgv_jobno(String.valueOf(index));
|
||||||
inst.setSend_status("1");
|
inst.setSend_status("1");
|
||||||
instructionService.update(inst);
|
instructionService.update(inst);
|
||||||
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
|
||||||
}
|
}
|
||||||
//任务完毕
|
//任务完毕
|
||||||
//(无车id及状态)
|
//(无车id及状态)
|
||||||
@@ -163,10 +163,10 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
if (!ObjectUtil.isEmpty(inst)) {
|
if (!ObjectUtil.isEmpty(inst)) {
|
||||||
instructionService.finish(inst.getInstruction_id());
|
instructionService.finish(inst.getInstruction_id());
|
||||||
} else {
|
} else {
|
||||||
log.warn("指令号:{},未反馈wms任务完成,因为agv上报指令号查询指令为空!");
|
log.warn("指令号:{},未反馈wms任务完成,因为agv上报指令号查询指令为空!",inst.getInstruction_code());
|
||||||
}
|
}
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
log.info("指令号:{},已反馈agv任务完成!");
|
log.info("指令号:{},已反馈agv任务完成!",inst.getInstruction_code());
|
||||||
}
|
}
|
||||||
//请求删除任务
|
//请求删除任务
|
||||||
//(需要WCS反馈)
|
//(需要WCS反馈)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.acs.AcsConfig;
|
||||||
import org.nl.acs.agv.server.NDCAgvService;
|
import org.nl.acs.agv.server.NDCAgvService;
|
||||||
import org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun;
|
import org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun;
|
||||||
import org.nl.acs.device.service.DeviceService;
|
import org.nl.acs.device.service.DeviceService;
|
||||||
@@ -96,9 +97,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
}
|
}
|
||||||
if (ikey != 0) {
|
if (ikey != 0) {
|
||||||
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
|
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
|
||||||
if (ObjectUtil.isEmpty(inst)) {
|
// if (ObjectUtil.isEmpty(inst)) {
|
||||||
inst = instructionService.findByCode(String.valueOf(ikey));
|
// inst = instructionService.findByCode(String.valueOf(ikey));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
if (!ObjectUtil.isEmpty(link_inst)) {
|
if (!ObjectUtil.isEmpty(link_inst)) {
|
||||||
link_flag = true;
|
link_flag = true;
|
||||||
@@ -168,30 +169,33 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey);
|
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")) {
|
||||||
Object reqWms = device.getExtraValue().get("reqWms");
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
|
} else {
|
||||||
JSONArray req = new JSONArray();
|
Object reqWms = device.getExtraValue().get("reqWms");
|
||||||
JSONObject map = new JSONObject();
|
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
|
||||||
map.put("vehicle_code", inst.getVehicle_code());
|
JSONArray req = new JSONArray();
|
||||||
map.put("status", "1");
|
JSONObject map = new JSONObject();
|
||||||
map.put("device_code", inst.getStart_point_code());
|
map.put("vehicle_code", inst.getVehicle_code());
|
||||||
map.put("task_code", inst.getTask_code());
|
map.put("status", "1");
|
||||||
req.add(map);
|
map.put("device_code", inst.getStart_point_code());
|
||||||
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
map.put("task_code", inst.getTask_code());
|
||||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
req.add(map);
|
||||||
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
||||||
if (resp.getInteger("status") == 200) {
|
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
||||||
log.info("指令号:{},acs请求wms取货申请成功,wms允许agv申请取货,已反馈agv允许取货", inst.getInstruction_code());
|
if (resp.getInteger("status") == 200) {
|
||||||
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
log.info("指令号:{},acs请求wms取货申请成功,wms允许agv申请取货,已反馈agv允许取货", inst.getInstruction_code());
|
||||||
|
} else {
|
||||||
|
log.warn("指令号:{},acs请求wms取货申请失败,wms不允许agv取货,未反馈agv允许取货", inst.getInstruction_code());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warn("指令号:{},acs请求wms取货申请成功,wms不允许agv申请取货,未反馈agv允许取货", inst.getInstruction_code());
|
log.warn("指令号:{},acs请求wms取货申请失败,连接被拒绝,未反馈agv允许取货", inst.getInstruction_code());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warn("指令号:{},acs请求wms取货申请失败,连接被拒绝,未反馈agv允许取货", inst.getInstruction_code());
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
|
||||||
}
|
}
|
||||||
//取货完毕
|
//取货完毕
|
||||||
//(需要WCS反馈)
|
//(需要WCS反馈)
|
||||||
@@ -230,29 +234,33 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object reqWms = device.getExtraValue().get("reqWms");
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")) {
|
||||||
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
JSONArray req = new JSONArray();
|
} else {
|
||||||
JSONObject map = new JSONObject();
|
Object reqWms = device.getExtraValue().get("reqWms");
|
||||||
map.put("vehicle_code", inst.getVehicle_code());
|
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
|
||||||
map.put("status", "2");
|
JSONArray req = new JSONArray();
|
||||||
map.put("device_code", inst.getStart_point_code());
|
JSONObject map = new JSONObject();
|
||||||
map.put("task_code", inst.getTask_code());
|
map.put("vehicle_code", inst.getVehicle_code());
|
||||||
req.add(map);
|
map.put("status", "2");
|
||||||
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
map.put("device_code", inst.getStart_point_code());
|
||||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
map.put("task_code", inst.getTask_code());
|
||||||
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
req.add(map);
|
||||||
if (resp.getInteger("status") == 200) {
|
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||||
log.info("指令号:{},acs反馈wms取货完成成功,wms允许agv取货完成,已反馈agv取货完成", inst.getInstruction_code());
|
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
||||||
|
if (resp.getInteger("status") == 200) {
|
||||||
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
log.info("指令号:{},acs反馈wms取货完成离开成功,wms允许agv取货完成离开,已反馈agv取货完成离开", inst.getInstruction_code());
|
||||||
|
} else {
|
||||||
|
log.warn("指令号:{},acs反馈wms取货完成离开失败,wms不允许agv取货完成离开,未反馈agv取货完成离开", inst.getInstruction_code());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warn("指令号:{},acs反馈wms取货完成成功,wms不允许agv取货完成,未反馈agv取货完成", inst.getInstruction_code());
|
log.warn("指令号:{},acs反馈wms取货完成离开失败,连接被拒绝,未反馈agv取货完成离开", inst.getInstruction_code());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warn("指令号:{},acs反馈wms取货完成失败,连接被拒绝,未反馈agv取货完成", inst.getInstruction_code());
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
|
||||||
}
|
}
|
||||||
//到达放货点
|
//到达放货点
|
||||||
//(需要WCS反馈)
|
//(需要WCS反馈)
|
||||||
@@ -287,30 +295,36 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
log.info("未找到关联编号{}对应的指令", ikey);
|
log.info("未找到关联编号{}对应的指令", ikey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Object reqWms = device.getExtraValue().get("reqWms");
|
|
||||||
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")) {
|
||||||
JSONArray req = new JSONArray();
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
JSONObject map = new JSONObject();
|
} else {
|
||||||
map.put("vehicle_code", inst.getVehicle_code());
|
Object reqWms = device.getExtraValue().get("reqWms");
|
||||||
map.put("status", "3");
|
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
|
||||||
map.put("device_code", inst.getNext_point_code());
|
JSONArray req = new JSONArray();
|
||||||
map.put("task_code", inst.getTask_code());
|
JSONObject map = new JSONObject();
|
||||||
req.add(map);
|
map.put("vehicle_code", inst.getVehicle_code());
|
||||||
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
map.put("status", "3");
|
||||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
map.put("device_code", inst.getNext_point_code());
|
||||||
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
map.put("task_code", inst.getTask_code());
|
||||||
if (resp.getInteger("status") == 200) {
|
req.add(map);
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
||||||
log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code());
|
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||||
|
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
||||||
|
if (resp.getInteger("status") == 200) {
|
||||||
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code());
|
||||||
|
} else {
|
||||||
|
log.warn("指令号:{},acs请求wms放货申请失败,wms不允许agv放货,未反馈agv允许放货", inst.getInstruction_code());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warn("指令号:{},acs请求wms放货申请成功,wms不允许agv申请放货,未反馈agv允许放货", inst.getInstruction_code());
|
log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code());
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//放货完毕
|
//放货完毕
|
||||||
//(需要WCS反馈)
|
//(需要WCS反馈)
|
||||||
} else if (phase == 0x09) {
|
} else if (phase == 0x09) {
|
||||||
@@ -345,25 +359,35 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
log.info("未找到编号{}对应的指令", ikey);
|
log.info("未找到编号{}对应的指令", ikey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Object reqWms = device.getExtraValue().get("reqWms");
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")) {
|
||||||
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
|
|
||||||
JSONArray req = new JSONArray();
|
|
||||||
JSONObject map = new JSONObject();
|
|
||||||
map.put("vehicle_code", inst.getVehicle_code());
|
|
||||||
map.put("status", "4");
|
|
||||||
map.put("device_code", inst.getNext_point_code());
|
|
||||||
map.put("task_code", inst.getTask_code());
|
|
||||||
req.add(map);
|
|
||||||
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
|
||||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
|
||||||
log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code());
|
|
||||||
} else {
|
|
||||||
log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
} else {
|
||||||
|
Object reqWms = device.getExtraValue().get("reqWms");
|
||||||
|
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
|
||||||
|
JSONArray req = new JSONArray();
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("vehicle_code", inst.getVehicle_code());
|
||||||
|
map.put("status", "4");
|
||||||
|
map.put("device_code", inst.getNext_point_code());
|
||||||
|
map.put("task_code", inst.getTask_code());
|
||||||
|
req.add(map);
|
||||||
|
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
||||||
|
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||||
|
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
||||||
|
if (resp.getInteger("status") == 200) {
|
||||||
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
log.info("指令号:{},acs请求wms放货完成申请成功,wms允许agv放货完成,已反馈agv放货完成", inst.getInstruction_code());
|
||||||
|
} else {
|
||||||
|
log.warn("指令号:{},acs请求wms放货完成离开失败,wms不允许agv放货完成离开,未反馈agv放货完成离开", inst.getInstruction_code());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.warn("指令号:{},acs请求wms放货完成离开失败,连接被拒绝,未反馈agv放货完成离开", inst.getInstruction_code());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//到达位置点
|
//到达位置点
|
||||||
//(需要WCS反馈)
|
//(需要WCS反馈)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
package org.nl.acs.ext.wms.rest;
|
package org.nl.acs.ext.wms.rest;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -15,10 +16,7 @@ import org.nl.modules.logging.InterfaceLogType;
|
|||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -35,14 +33,14 @@ public class AcsToWmsController {
|
|||||||
private final AcsToWmsService acstowmsService;
|
private final AcsToWmsService acstowmsService;
|
||||||
|
|
||||||
@PostMapping("/applyTask")
|
@PostMapping("/applyTask")
|
||||||
@Log(value = "ACS向WMS申请任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "ACS向WMS申请任务", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("ACS向WMS申请任务")
|
@ApiOperation("ACS向WMS申请任务")
|
||||||
public ResponseEntity<Object> applyTaskToWms(@RequestBody JSONObject jo) {
|
public ResponseEntity<Object> applyTaskToWms(@RequestBody JSONObject jo) {
|
||||||
return new ResponseEntity<>(acstowmsService.applyTaskToWms(jo), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.applyTaskToWms(jo), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/taskStatusFeedback")
|
@PostMapping("/taskStatusFeedback")
|
||||||
@Log(value = "ACS向WMS反馈任务状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "ACS向WMS反馈任务状态", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("ACS向WMS反馈任务状态")
|
@ApiOperation("ACS向WMS反馈任务状态")
|
||||||
public ResponseEntity<Object> feedbackTaskStatusToWms(@RequestBody Map whereJson) {
|
public ResponseEntity<Object> feedbackTaskStatusToWms(@RequestBody Map whereJson) {
|
||||||
JSONArray data = JSONArray.parseArray(String.valueOf(whereJson));
|
JSONArray data = JSONArray.parseArray(String.valueOf(whereJson));
|
||||||
@@ -50,28 +48,28 @@ public class AcsToWmsController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/feedbackAgvStatus")
|
@PostMapping("/feedbackAgvStatus")
|
||||||
@Log(value = "反馈AGV设备状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "反馈AGV设备状态", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("反馈AGV设备状态")
|
@ApiOperation("反馈AGV设备状态")
|
||||||
public ResponseEntity<Object> feedbackAgvStatus(@RequestBody String device_code, String error, String error_message) {
|
public ResponseEntity<Object> feedbackAgvStatus(@RequestBody String device_code, String error, String error_message) {
|
||||||
return new ResponseEntity<>(acstowmsService.feedbackAgvStatus(device_code, error, error_message), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.feedbackAgvStatus(device_code, error, error_message), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/feedbackAgv")
|
@PostMapping("/feedbackAgv")
|
||||||
@Log(value = "反馈AGV设备信息",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "反馈AGV设备信息", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("反馈AGV设备信息")
|
@ApiOperation("反馈AGV设备信息")
|
||||||
public ResponseEntity<Object> feedbackAgv(@RequestBody JSONArray from) {
|
public ResponseEntity<Object> feedbackAgv(@RequestBody JSONArray from) {
|
||||||
return new ResponseEntity<>(acstowmsService.feedbackAgv(from), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.feedbackAgv(from), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/feedbackDeviceStatus")
|
@PostMapping("/feedbackDeviceStatus")
|
||||||
@Log(value = "反馈设备状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "反馈设备状态", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("反馈设备状态")
|
@ApiOperation("反馈设备状态")
|
||||||
public ResponseEntity<Object> feedbackDeviceStatus(@RequestBody String device_code, String code, String value) {
|
public ResponseEntity<Object> feedbackDeviceStatus(@RequestBody String device_code, String code, String value) {
|
||||||
return new ResponseEntity<>(acstowmsService.feedbackDeviceStatus(device_code, code, value), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.feedbackDeviceStatus(device_code, code, value), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/feedbackOrderStatus")
|
@PostMapping("/feedbackOrderStatus")
|
||||||
@Log(value = "ACS强制完成向WMS反馈",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "ACS强制完成向WMS反馈", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("acs强制完成向wms反馈")
|
@ApiOperation("acs强制完成向wms反馈")
|
||||||
public ResponseEntity<Object> feedbackOrderStatus(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> feedbackOrderStatus(@RequestBody JSONObject param) {
|
||||||
return new ResponseEntity<>(acstowmsService.feedbackOrderStatus(param), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.feedbackOrderStatus(param), HttpStatus.OK);
|
||||||
@@ -79,37 +77,53 @@ public class AcsToWmsController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/applyInCacheLineTask")
|
@PostMapping("/applyInCacheLineTask")
|
||||||
@Log(value = "ACS申请缓存线入库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "ACS申请缓存线入库任务", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("ACS申请缓存线入库任务")
|
@ApiOperation("ACS申请缓存线入库任务")
|
||||||
public ResponseEntity<Object> applyInCacheLineTask(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> applyInCacheLineTask(@RequestBody JSONObject param) {
|
||||||
return new ResponseEntity<>(acstowmsService.applyInCacheLineTask(param), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.applyInCacheLineTask(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/applyOutCacheLineTask")
|
@PostMapping("/applyOutCacheLineTask")
|
||||||
@Log(value = "ACS系统申请出库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "ACS系统申请出库任务", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("ACS系统申请出库任务")
|
@ApiOperation("ACS系统申请出库任务")
|
||||||
public ResponseEntity<Object> applyOutCacheLineTask(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> applyOutCacheLineTask(@RequestBody JSONObject param) {
|
||||||
return new ResponseEntity<>(acstowmsService.applyOutCacheLineTask(param), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.applyOutCacheLineTask(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/applyLabelingAndBindingRequest")
|
@PostMapping("/applyLabelingAndBindingRequest")
|
||||||
@Log(value = "ACS系统申请贴标、捆扎",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "ACS系统申请贴标、捆扎", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("ACS系统申请贴标、捆扎")
|
@ApiOperation("ACS系统申请贴标、捆扎")
|
||||||
public ResponseEntity<Object> applyLabelingAndBindingRequest(@RequestBody ApplyLabelingAndBindingRequest param) {
|
public ResponseEntity<Object> applyLabelingAndBindingRequest(@RequestBody ApplyLabelingAndBindingRequest param) {
|
||||||
return new ResponseEntity<>(acstowmsService.applyLabelingAndBindingRequest(param), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.applyLabelingAndBindingRequest(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/liKuApplyTaskRequest")
|
@PostMapping("/liKuApplyTaskRequest")
|
||||||
@Log(value = "立库申请任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "立库申请任务", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("立库申请任务")
|
@ApiOperation("立库申请任务")
|
||||||
public ResponseEntity<Object> liKuApplyTaskRequest(@RequestBody LiKuApplyTaskRequest param) {
|
public ResponseEntity<Object> liKuApplyTaskRequest(@RequestBody LiKuApplyTaskRequest param) {
|
||||||
return new ResponseEntity<>(acstowmsService.liKuApplyTaskRequest(param), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.liKuApplyTaskRequest(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/feedAgvTaskStatus")
|
@PostMapping("/feedAgvTaskStatus")
|
||||||
@Log(value = "反馈AGV取放货状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
@Log(value = "反馈AGV取放货状态", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("反馈AGV取放货状态")
|
@ApiOperation("反馈AGV取放货状态")
|
||||||
public ResponseEntity<Object> feedAgvTaskStatus(@RequestBody JSONArray from) {
|
public ResponseEntity<Object> feedAgvTaskStatus(@RequestBody JSONArray from) {
|
||||||
return new ResponseEntity<>(acstowmsService.feedAgvTaskStatus(from), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.feedAgvTaskStatus(from), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getTokenFromWms")
|
||||||
|
@Log(value = "向wms获取token", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
|
@ApiOperation("向wms获取token")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> getTokenFromWms() {
|
||||||
|
return new ResponseEntity<>(acstowmsService.getTokenFromWms(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/test")
|
||||||
|
@Log(value = "test携带Token访问", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||||
|
@ApiOperation("test携带Token访问")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> test(@RequestBody JSONObject from) {
|
||||||
|
return new ResponseEntity<>(acstowmsService.test(from), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ public interface AcsToWmsService {
|
|||||||
*/
|
*/
|
||||||
public HttpResponse feedbackTaskStatusToWms(JSONArray arr);
|
public HttpResponse feedbackTaskStatusToWms(JSONArray arr);
|
||||||
|
|
||||||
|
public HttpResponse getTokenFromWms();
|
||||||
|
|
||||||
|
|
||||||
public String requestTaskAgain(String address, String task_id, String vehicle_code);
|
public String requestTaskAgain(String address, String task_id, String vehicle_code);
|
||||||
|
|
||||||
@@ -112,4 +114,6 @@ public interface AcsToWmsService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
HttpResponse feedAgvTaskStatus(JSONArray from);
|
HttpResponse feedAgvTaskStatus(JSONArray from);
|
||||||
|
|
||||||
|
public HttpResponse test(JSONObject form);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,36 +19,36 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
|
|||||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
|
import org.nl.modules.common.utils.RedisUtils;
|
||||||
import org.nl.modules.system.service.ParamService;
|
import org.nl.modules.system.service.ParamService;
|
||||||
import org.slf4j.MDC;
|
import org.slf4j.MDC;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AcsToWmsServiceImpl implements AcsToWmsService {
|
public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||||
@Autowired
|
@Autowired
|
||||||
ParamService paramService;
|
private ParamService paramService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
DeviceService deviceService;
|
private DeviceService deviceService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
AddressService addressService;
|
private AddressService addressService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
TaskService taskService;
|
private RedisUtils redisUtils;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
DeviceExecuteLogService logServer;
|
|
||||||
|
|
||||||
/*@Value("${acsTowms.token}")*/
|
/*@Value("${acsTowms.token}")*/
|
||||||
public String token;
|
public String token;
|
||||||
|
|
||||||
|
|
||||||
private String log_file_type="log_file_type";
|
private String log_file_type = "log_file_type";
|
||||||
private String log_type="ACS请求LMS";
|
private String log_type = "ACS请求LMS";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String applyTaskToWms(JSONObject jo) {
|
public String applyTaskToWms(JSONObject jo) {
|
||||||
@@ -71,7 +71,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
//网络不通
|
//网络不通
|
||||||
// //System.out.println(msg);
|
// //System.out.println(msg);
|
||||||
}
|
}
|
||||||
if(ObjectUtil.isEmpty(result2)){
|
if (ObjectUtil.isEmpty(result2)) {
|
||||||
log.info("applyTaskToWms-----输出参数{}", "返回结果为空");
|
log.info("applyTaskToWms-----输出参数{}", "返回结果为空");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -95,49 +95,64 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
MDC.put(log_file_type, log_type);
|
||||||
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
|
log.info("开始反馈wms任务状态,请求参数:{}", JSON.toJSONString(data));
|
||||||
String task_code = "";
|
if (!redisUtils.hasKey("wms_token")) {
|
||||||
for (int i = 0; i < data.size(); i++) {
|
this.getTokenFromWms();
|
||||||
JSONObject json = (JSONObject) data.get(i);
|
}
|
||||||
task_code = json.getString("task_code");
|
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
|
HttpResponse result = null;
|
||||||
|
AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms");
|
||||||
|
String methods_url = addressDto.getMethods_url();
|
||||||
|
try {
|
||||||
|
result = HttpRequest
|
||||||
|
.post(wmsurl + methods_url)
|
||||||
|
.header("Authorization", String.valueOf(redisUtils.get("wms_token")))
|
||||||
|
.body(JSON.toJSONString(data))
|
||||||
|
.execute();
|
||||||
|
log.info("反馈wms任务状态成功,请求路径:{},请求参数:{}", wmsurl + methods_url, JSON.toJSONString(data));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("反馈wms任务状态失败,请求路径:{},失败原因:{}", wmsurl + methods_url, e.getMessage());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
TaskDto taskDto = taskService.findByCode(task_code);
|
return null;
|
||||||
String vehicle_code = taskDto.getVehicle_code();
|
|
||||||
|
|
||||||
HttpResponse result2 = null;
|
|
||||||
log.info("feedbackTaskStatusToWms-----请求参数{}", data.toString());
|
|
||||||
|
|
||||||
AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms");
|
|
||||||
String methods_url = addressDto.getMethods_url();
|
|
||||||
try {
|
|
||||||
result2 = HttpRequest.post(wmsurl + methods_url)
|
|
||||||
.header("Authorization", token).body(String.valueOf(data))
|
|
||||||
.execute();
|
|
||||||
// //System.out.println(result2);
|
|
||||||
} catch (Exception e) {
|
|
||||||
String msg = e.getMessage();
|
|
||||||
//网络不通
|
|
||||||
// //System.out.println(msg);
|
|
||||||
log.info("feedbackTaskStatusToWms-----输出参数{}", msg);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
String type = "";
|
|
||||||
if (result2.getStatus() == 200) {
|
|
||||||
type = "info";
|
|
||||||
} else {
|
|
||||||
type = "error";
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject jo = JSONObject.parseObject(result2.body());
|
|
||||||
log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString());
|
|
||||||
return result2;
|
|
||||||
} finally {
|
} finally {
|
||||||
MDC.remove(log_file_type);
|
MDC.remove(log_file_type);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResponse getTokenFromWms() {
|
||||||
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
|
log.info("acs开始向wms获取token......");
|
||||||
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
|
AddressDto addressDto = addressService.findByCode("getTokenFromWms");
|
||||||
|
String methods_url = addressDto.getMethods_url();
|
||||||
|
String url = wmsUrl + methods_url;
|
||||||
|
HttpResponse result = null;
|
||||||
|
try {
|
||||||
|
result = HttpRequest.post(url)
|
||||||
|
.body(url + methods_url)
|
||||||
|
.execute();
|
||||||
|
if (ObjectUtil.isNotEmpty(result) && result.getStatus() == 200) {
|
||||||
|
String body = result.body();
|
||||||
|
if (StrUtil.isNotEmpty(body)) {
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||||
|
String access_token = jsonObject.getString("access_token");
|
||||||
|
String token_type = jsonObject.getString("token_type");
|
||||||
|
String expires_in = jsonObject.getString("expires_in");
|
||||||
|
String scope = jsonObject.getString("scope");
|
||||||
|
redisUtils.setExpire("wms_token", token_type + " " + access_token, Long.valueOf(expires_in), TimeUnit.SECONDS);
|
||||||
|
log.info("acs向wms获取token成功,响应参数:{},已向redis中设置wms_token值", jsonObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("acs向wms获取token失败,失败原因:{}", e.getMessage());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -472,7 +487,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLKTaskResponse updateLKTaskRequest(UpdateLKTaskRequest param) {
|
public UpdateLKTaskResponse updateLKTaskRequest(UpdateLKTaskRequest param) {
|
||||||
try {
|
try {
|
||||||
@@ -532,25 +546,38 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse feedAgvTaskStatus(JSONArray from) {
|
public HttpResponse feedAgvTaskStatus(JSONArray from) {
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
|
log.info("开始反馈WMS AGV取放货状态,请求参数:{}", from);
|
||||||
AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus");
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
String methods_url = addressDto.getMethods_url();
|
AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus");
|
||||||
String url = wmsUrl + methods_url;
|
String methods_url = addressDto.getMethods_url();
|
||||||
HttpResponse result = null;
|
String url = wmsUrl + methods_url;
|
||||||
log.info("feedAgvTaskStatus----请求参数{}", from);
|
HttpResponse result = null;
|
||||||
|
try {
|
||||||
try {
|
result = HttpRequest.post(url)
|
||||||
result = HttpRequest.post(url)
|
.header("Authorization", String.valueOf(redisUtils.get("wms_token")))
|
||||||
.body(String.valueOf(from))
|
.body(JSON.toJSONString(from))
|
||||||
.execute();
|
.execute();
|
||||||
System.out.println(result);
|
log.info("反馈WMS AGV取放货状态成功,请求路径:{},请求结果:{}", url, result.body());
|
||||||
log.info("feedAgvTaskStatus----返回参数{}", result);
|
} catch (Exception e) {
|
||||||
} catch (Exception e) {
|
log.info("反馈WMS AGV取放货状态失败,请求路径:{},请求结果:{}", url, e.getMessage());
|
||||||
String msg = e.getMessage();
|
}
|
||||||
//网络不通
|
return result;
|
||||||
//System.out.println(msg);
|
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResponse test(JSONObject form) {
|
||||||
|
if (!redisUtils.hasKey("wms_token")) {
|
||||||
|
this.getTokenFromWms();
|
||||||
|
}
|
||||||
|
String url = "https://zoneda.onestep-cloud.com/lwmss/v1/41/chsv-unqualified-products/execute-inspection-ng";
|
||||||
|
HttpResponse result = HttpRequest
|
||||||
|
.post(url)
|
||||||
|
.header("Authorization", String.valueOf(redisUtils.get("wms_token")))
|
||||||
|
.body(JSON.toJSONString(form))
|
||||||
|
.execute();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ public class RedisUtils {
|
|||||||
public List<Object> multiGet(List<String> keys) {
|
public List<Object> multiGet(List<String> keys) {
|
||||||
List list = redisTemplate.opsForValue().multiGet(Sets.newHashSet(keys));
|
List list = redisTemplate.opsForValue().multiGet(Sets.newHashSet(keys));
|
||||||
List resultList = Lists.newArrayList();
|
List resultList = Lists.newArrayList();
|
||||||
Optional.ofNullable(list).ifPresent(e-> list.forEach(ele-> Optional.ofNullable(ele).ifPresent(resultList::add)));
|
Optional.ofNullable(list).ifPresent(e -> list.forEach(ele -> Optional.ofNullable(ele).ifPresent(resultList::add)));
|
||||||
return resultList;
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,6 +282,14 @@ public class RedisUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setExpire(String key, Object value, long time, TimeUnit timeUnit) {
|
||||||
|
try {
|
||||||
|
redisTemplate.opsForValue().set(key, value, time, timeUnit);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ================================Map=================================
|
// ================================Map=================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user