Browse Source

RFID手持机 接口更新

master
xia 2 years ago
parent
commit
82a550628e
  1. 21
      archives/src/main/java/com/storeroom/modules/archives/controller/RFIDController.java

21
archives/src/main/java/com/storeroom/modules/archives/controller/RFIDController.java

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

Loading…
Cancel
Save