|
|
@ -56,12 +56,12 @@ public class RFIDController { |
|
|
|
private final ArrangeService arrangeService; |
|
|
|
|
|
|
|
@ApiOperation("读取epc和Tid号") |
|
|
|
@GetMapping("/ReadEpc") |
|
|
|
public ApiResponse<Object> ReadEpc(String ip,String op, String sDevID) throws IOException { |
|
|
|
@AnonymousGetMapping("/ReadEpc") |
|
|
|
public ApiResponse<Object> ReadEpc(String ip, String sDevID) throws IOException { |
|
|
|
String result = ""; |
|
|
|
try { |
|
|
|
HttpClient client = HttpClients.createDefault(); |
|
|
|
String url = "http://" + ip + "/RFIDInterface.aspx?op=" + op + "&sDevID=" + sDevID; |
|
|
|
String url = "http://" + ip + "/api/RFIDInterface/RFID_ReadEpc?sDevID=" + sDevID; |
|
|
|
HttpGet httpGet = new HttpGet(url); |
|
|
|
httpGet.setHeader("Content-Type", "application/x-www-form-urlencoded"); |
|
|
|
System.out.println("调用URL: " + httpGet.getURI()); |
|
|
@ -92,13 +92,12 @@ public class RFIDController { |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("写epc") |
|
|
|
@GetMapping("/WriteEPC") |
|
|
|
public ApiResponse<Object> WriteEPC(String ip,String op, String sDevID, String EAS, String Type, String Code, String Tid) throws IOException { |
|
|
|
@AnonymousGetMapping("/WriteEPC") |
|
|
|
public ApiResponse<Object> WriteEPC(String ip, String sDevID, String EAS, String Type, String Code, String Tid) throws IOException { |
|
|
|
String result = ""; |
|
|
|
try { |
|
|
|
HttpClient client = HttpClients.createDefault(); |
|
|
|
String url = "http://" + ip + "/RFIDInterface.aspx?op=" + op |
|
|
|
+ "&sDevID=" + sDevID |
|
|
|
String url = "http://" + ip + "/api/RFIDInterface/RFID_WriteEPC?sDevID=" + sDevID |
|
|
|
+ "&EAS=" + EAS |
|
|
|
+ "&Type=" + Type |
|
|
|
+ "&Code=" + Code |
|
|
@ -138,7 +137,7 @@ public class RFIDController { |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("根据mac地址获取设备id") |
|
|
|
@GetMapping("/getDeviceIdByMac") |
|
|
|
@AnonymousGetMapping("/getDeviceIdByMac") |
|
|
|
public ApiResponse<Object> ReadEpc(String mac) { |
|
|
|
DeviceSpecParamDto deviceSpecParamDto = deviceSpecParamService.findMacAddress(mac); |
|
|
|
if (null == deviceSpecParamDto) |
|
|
@ -147,12 +146,12 @@ public class RFIDController { |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("读写器状态检测") |
|
|
|
@GetMapping("/CheckStatus") |
|
|
|
public ApiResponse<Object> CheckStatus(String ip,String op, String sDevID) throws IOException { |
|
|
|
@AnonymousGetMapping("/CheckStatus") |
|
|
|
public ApiResponse<Object> CheckStatus(String ip, String sDevID) throws IOException { |
|
|
|
String result = ""; |
|
|
|
try { |
|
|
|
HttpClient client = HttpClients.createDefault(); |
|
|
|
String url = "http://" + ip + "/RFIDInterface.aspx?op=" + op + "&sDevID=" + sDevID; |
|
|
|
String url = "http://" + ip + "/api/RFIDInterface/RFID_CheckStatus?sDevID=" + sDevID; |
|
|
|
HttpGet httpGet = new HttpGet(url); |
|
|
|
httpGet.setHeader("Content-Type", "application/x-www-form-urlencoded"); |
|
|
|
System.out.println("调用URL: " + httpGet.getURI()); |
|
|
|