增加随行拍照功能

新疆科信智慧盘点
LAPTOP-S9HJSOEB\昊天 2 months ago
parent 91827af36f
commit f23b1ac19c

@ -34,6 +34,12 @@ public class PathUtil {
return cameraId+"/"+row+"-"+column+"/"+date + "/" +now.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss-"))+row+"-"+column + "."+fileType; return cameraId+"/"+row+"-"+column+"/"+date + "/" +now.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss-"))+row+"-"+column + "."+fileType;
} }
public static String createFileNameByRowColumn2(String fileType,Integer cameraId,Integer row,Integer column){
LocalDateTime now = LocalDateTime.now();
String date = now.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
return cameraId+"-"+"-"+date + "-" +now.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss-"))+"-"+row+"-"+column + "."+fileType;
}
/** /**
* 检查文件的文件夹是否存在,不存在则新建 * 检查文件的文件夹是否存在,不存在则新建
* @param url * @param url

@ -40,6 +40,7 @@ public class ConfigProperties {
private ScanCodeMode scanCodeMode; private ScanCodeMode scanCodeMode;
private Rfid rfid; private Rfid rfid;
private Boolean actionCheckPic = false;
private AsyncExecutorThread asyncExecutorThread; private AsyncExecutorThread asyncExecutorThread;
private VisualSense visualSense; private VisualSense visualSense;

@ -446,6 +446,21 @@ public class PlcService {
gyrateCameraByCodeTimeLater(cameraId, "C5", configProperties.getCameraConfig().getC2OutDelayCaptureTime() + 500); gyrateCameraByCodeTimeLater(cameraId, "C5", configProperties.getCameraConfig().getC2OutDelayCaptureTime() + 500);
} }
if (configProperties.getActionCheckPic()){
code = "E1" + "-" + plcCmdInfo.getEndStr(1, plcCmdInfo.getFromAround());
gyrateCameraByCode(cameraId, code);
path = PathUtil.createFileNameByRowColumn2("jpg", cameraId, plcCmdInfo.getRow1(), plcCmdInfo.getColumn1());
try {
cameraCapture(cameraId, false, null, path);
} catch (NullPointerException e) {
log.error("相机{}未连接无法拍照", cameraId);
}
}
// threadPoolExecutor.execute(()->{ // threadPoolExecutor.execute(()->{
// rfidLiveService.rfidOrderStock(plcCmdInfo, times, code); // rfidLiveService.rfidOrderStock(plcCmdInfo, times, code);
// }); // });
@ -778,23 +793,7 @@ public class PlcService {
//货物使用球机扫码 //货物使用球机扫码
log.info("盘点信息:{}", algorithmPojo.toString()); log.info("盘点信息:{}", algorithmPojo.toString());
// //关闭光源
// Thread thread = new Thread(() -> {
// try {
// Thread.sleep(30000);
// } catch (InterruptedException e) {
// throw new RuntimeException(e);
// }
// //关闭光源
// streetController.closeStreetLightSource(street.getId());
// });
// thread.start();
//核对异常
// Integer status = 4;
//托盘和货物都正确
// if (algorithmPojo != null && algorithmPojo.getResult() != null && algorithmPojo.getResult() == 1) {
// status = 2;
// }
Integer status = 1; Integer status = 1;
if (algorithmPojo != null && algorithmPojo.getResult() != null && algorithmPojo.getResult() == 0) { if (algorithmPojo != null && algorithmPojo.getResult() != null && algorithmPojo.getResult() == 0) {
status = 2; status = 2;

@ -176,13 +176,13 @@ public class AlgorithmService {
// System.out.println(calculate); // System.out.println(calculate);
}catch (RestClientException e){ }catch (RestClientException e){
log.error("未连接上堆垛机"+e); log.error("未连接上算法平台"+e);
//Assert.isTrue(false,"请求失败,视觉服务未连接"); //Assert.isTrue(false,"请求失败,视觉服务未连接");
algorithmPojo.setResult(0); algorithmPojo.setResult(0);
return algorithmPojo; return algorithmPojo;
}catch (Exception e){ }catch (Exception e){
log.error("堆垛机报错"+e); log.error("算法平台报错"+e);
e.printStackTrace(); e.printStackTrace();
algorithmPojo.setResult(0); algorithmPojo.setResult(0);
return algorithmPojo; return algorithmPojo;

@ -98,6 +98,9 @@ rfid:
#rfid连续扫描时间,默认5s 单位s #rfid连续扫描时间,默认5s 单位s
scanTime: 1 scanTime: 1
# 随行进行盘点拍照
actionCheckPic: true
asyncExecutorThread: asyncExecutorThread:
corePoolSize: 5 corePoolSize: 5

Loading…
Cancel
Save