接收扫描器传递来的数据

This commit is contained in:
刘名喜 2024-11-26 17:19:35 +08:00
parent ea8f47d95e
commit a54c6c9a40
4 changed files with 88 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import com.ktg.mes.md.mapper.BaseKnifeMapper;
import com.ktg.mes.wm.domain.UcmCtBase;
import com.ktg.mes.wm.domain.box.Box;
import com.ktg.mes.wm.domain.box.BoxItem;
import com.ktg.mes.wm.domain.box.RfidCard;
import com.ktg.mes.wm.service.IUcmCtBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@ -68,6 +69,28 @@ public class UcmCtBaseController extends BaseController {
}
}
@PostMapping("/open/upload-temp-box-list-info")
public String uploadTempBoxListInfo(
@RequestBody List<RfidCard> rfidCardList
) {
try {
return ucmCtBaseService.uploadTempBoxListInfo(rfidCardList);
} catch (Exception e) {
return e.getMessage();
}
}
@PostMapping("/open/upload-temp-box-item-list-info")
public String uploadTempBoxItemListInfo(
@RequestBody List<RfidCard> rfidCardList
) {
try {
return ucmCtBaseService.uploadTempBoxItemListInfo(rfidCardList);
} catch (Exception e) {
return e.getMessage();
}
}
/**
* 查询料箱管理列表
*/

View File

@ -0,0 +1,42 @@
package com.ktg.mes.wm.domain.box;
/**
* 料箱实例
*/
public class RfidCard {
private Long number = null;
private String rfid = null;
public RfidCard() {
super();
}
public RfidCard(Long number, String rfid) {
this.number = number;
this.rfid = rfid;
}
public Long getNumber() {
return number;
}
public void setNumber(Long number) {
this.number = number;
}
public String getRfid() {
return rfid;
}
public void setRfid(String rfid) {
this.rfid = rfid;
}
@Override
public String toString() {
return "RfidCard{" +
"number=" + number +
", rfid='" + rfid + '\'' +
'}';
}
}

View File

@ -2,6 +2,7 @@ package com.ktg.mes.wm.service;
import com.ktg.mes.wm.domain.UcmCtBase;
import com.ktg.mes.wm.domain.box.Box;
import com.ktg.mes.wm.domain.box.RfidCard;
import java.util.List;
@ -66,4 +67,8 @@ public interface IUcmCtBaseService
int unbindUcmCtBase(String boxCode, String itemCode);
String bindAndUnbindUcmCtBase(List<Box> boxList);
String uploadTempBoxListInfo(List<RfidCard> rfidCardList);
String uploadTempBoxItemListInfo(List<RfidCard> rfidCardList);
}

View File

@ -1,5 +1,6 @@
package com.ktg.mes.wm.service.impl;
import com.alibaba.fastjson.JSON;
import com.ktg.common.utils.DateUtils;
import com.ktg.mes.md.domain.BaseKnife;
import com.ktg.mes.md.mapper.BaseKnifeMapper;
@ -8,6 +9,7 @@ import com.ktg.mes.wm.domain.UcmCtBase;
import com.ktg.mes.wm.domain.UcmCtMaterial;
import com.ktg.mes.wm.domain.box.Box;
import com.ktg.mes.wm.domain.box.BoxItem;
import com.ktg.mes.wm.domain.box.RfidCard;
import com.ktg.mes.wm.mapper.UcmCtBaseMapper;
import com.ktg.mes.wm.service.IUcmCtBaseService;
import org.springframework.beans.factory.annotation.Autowired;
@ -244,4 +246,20 @@ public class UcmCtBaseServiceImpl implements IUcmCtBaseService {
}
return "OK";
}
@Override
public String uploadTempBoxListInfo(List<RfidCard> rfidCardList) {
System.out.println("料箱工具========================================");
System.out.println(JSON.toJSONString(rfidCardList));
System.out.println("==============================================");
return "OK";
}
@Override
public String uploadTempBoxItemListInfo(List<RfidCard> rfidCardList) {
System.out.println("物料工具========================================");
System.out.println(JSON.toJSONString(rfidCardList));
System.out.println("==============================================");
return "OK";
}
}