|
@@ -9,6 +9,7 @@ import com.fjhx.entity.stock.StockCheckrecord;
|
|
|
import com.fjhx.entity.stock.StockCheckrecorddetail;
|
|
|
import com.fjhx.entity.stock.StockDetail;
|
|
|
import com.fjhx.entity.stock.StockTag;
|
|
|
+import com.fjhx.entity.test.TestScan;
|
|
|
import com.fjhx.listener.WebSocketEventListener;
|
|
|
import com.fjhx.service.WebSocketServer;
|
|
|
import com.fjhx.stock.mapper.StockCheckrecordMapper;
|
|
@@ -16,6 +17,7 @@ import com.fjhx.stock.service.StockCheckrecordService;
|
|
|
import com.fjhx.stock.service.StockCheckrecorddetailService;
|
|
|
import com.fjhx.stock.service.StockDetailService;
|
|
|
import com.fjhx.stock.service.StockTagService;
|
|
|
+import com.fjhx.test.service.TestScanService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -38,6 +40,9 @@ import java.util.stream.Collectors;
|
|
|
@Slf4j
|
|
|
public class StockCheckrecordServiceImpl extends ServiceImpl<StockCheckrecordMapper, StockCheckrecord> implements StockCheckrecordService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TestScanService testScanService;
|
|
|
+
|
|
|
/**
|
|
|
* 记录盘点数据
|
|
|
* key:仓库id
|
|
@@ -78,9 +83,19 @@ public class StockCheckrecordServiceImpl extends ServiceImpl<StockCheckrecordMap
|
|
|
@Override
|
|
|
public void checkCallBack(JSONObject data) {
|
|
|
|
|
|
- String stockHouseId = data.getString("stockHouseId");
|
|
|
String rfid = data.getString("rfid");
|
|
|
|
|
|
+ if (data.getString("testFlag").equals("true")) {
|
|
|
+ TestScan testScan = new TestScan();
|
|
|
+ testScan.setRfid(rfid);
|
|
|
+ testScan.setBatchFlag(data.getLong("forwardSessionId"));
|
|
|
+ testScan.setScanTime(new Date());
|
|
|
+ testScanService.save(testScan);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ String stockHouseId = data.getString("stockHouseId");
|
|
|
+
|
|
|
map.get(stockHouseId).add(rfid);
|
|
|
}
|
|
|
|
|
@@ -241,6 +256,39 @@ public class StockCheckrecordServiceImpl extends ServiceImpl<StockCheckrecordMap
|
|
|
stockCheckrecorddetailService.saveBatch(list);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void testScanStart(String instructions, long flag, String stockHouseId) {
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+ // 盘点指令
|
|
|
+ data.put("instructions", instructions);
|
|
|
+ // 开启rfid扫描type
|
|
|
+ data.put("type", "2");
|
|
|
+ // 盘点业务类型
|
|
|
+ data.put("businessType", "3");
|
|
|
+ // 盘点仓库id 一楼仓库'c185883dba22478cb593d33f6b66cc53' 四楼仓库'0b8f584250bb4b40b72d641ce4849d15'
|
|
|
+ data.put("stockHouseId", stockHouseId);
|
|
|
+ data.put("forwardSessionId", flag);
|
|
|
+ data.put("forwardUserId", instructions);
|
|
|
+ // 测试标记
|
|
|
+ data.put("testFlag", "true");
|
|
|
+
|
|
|
+ // 开启扫描
|
|
|
+ WebSocketServer.sendInfo(WebSocketEventListener.WEB_STOCK_PROGRAM, WebSocketEventListener.OPERATING_UPPER_COMPUTER, data);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void testScanEnd(String instructions, long flag, String stockHouseId) {
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+ // 盘点指令
|
|
|
+ data.put("instructions", instructions);
|
|
|
+ // 关闭rfid扫描type
|
|
|
+ data.put("type", "9");
|
|
|
+ data.put("forwardSessionId", flag);
|
|
|
+ data.put("forwardUserId", instructions);
|
|
|
+ // 关闭扫描
|
|
|
+ WebSocketServer.sendInfo(WebSocketEventListener.WEB_STOCK_PROGRAM, WebSocketEventListener.OPERATING_UPPER_COMPUTER, data);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param date 完成时间
|
|
|
* @param recordId 盘点主表id
|