|
|
|
|
@ -8,12 +8,14 @@ import cn.iocoder.yudao.module.camera.dal.dataobject.resources.URLResourcesDo;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.dataobject.sensorgun.SensorGunDO;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.dataobject.stock.StockDO;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.dataobject.stocklog.StockLogDO;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.dataobject.street.LightSourceDO;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.dataobject.street.StreetDO;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.entity.ScanData;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.mysql.checklog.CheckLogMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.mysql.order.OrderMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.mysql.sensorgun.SensorGunMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.mysql.stocklog.StockLogMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.framework.light.LightFactory;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.framework.netty.ksec.KsecDataInfo;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.framework.netty.ksec.KsecInfo;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.framework.netty.streetAlgorithm.executor.AlgorithmDelayTask;
|
|
|
|
|
@ -21,6 +23,7 @@ import cn.iocoder.yudao.module.camera.framework.netty.streetAlgorithm.executor.G
|
|
|
|
|
import cn.iocoder.yudao.module.camera.service.camera.CameraService;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.service.cameraio.CameraIoService;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.service.checklog.CheckLogService;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.service.lightsource.LightSourceService;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.service.resources.URLResourcesService;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.service.scan.ScanGunScanServiceImpl;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.service.scan.ScanServiceFactory;
|
|
|
|
|
@ -183,6 +186,8 @@ public class PLCServiceImpl implements PLCService {
|
|
|
|
|
@Resource
|
|
|
|
|
ScanServiceFactory scanServiceFactory;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
LightSourceService lightSourceService;
|
|
|
|
|
|
|
|
|
|
ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
|
|
|
|
// 设置线程最大执行时间,单位为毫秒
|
|
|
|
|
@ -196,6 +201,8 @@ public class PLCServiceImpl implements PLCService {
|
|
|
|
|
|
|
|
|
|
//头部拍照
|
|
|
|
|
StreetDO street = streetService.getStreetByPlcId(dataInfo.getSRMNumber());
|
|
|
|
|
LightSourceDO lightSourceDO = lightSourceService.getOne(new QueryWrapper<LightSourceDO>().eq("street_id", street.getId()).last("limit 1"));
|
|
|
|
|
LightFactory.LightController(lightSourceDO,1);
|
|
|
|
|
// 获取记录
|
|
|
|
|
StockDO stock = stockService.getOne(
|
|
|
|
|
new QueryWrapper<StockDO>()
|
|
|
|
|
@ -316,6 +323,8 @@ public class PLCServiceImpl implements PLCService {
|
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
|
|
long s = end - startTime;
|
|
|
|
|
log.info("time:{}millisecond", s);
|
|
|
|
|
|
|
|
|
|
LightFactory.LightController(lightSourceDO,0);
|
|
|
|
|
// //ocr识别
|
|
|
|
|
// AlgorithmDelayTask algorithmDelayTask = new AlgorithmDelayTask(dataInfo.getFromDirection(),street.getPlcId()
|
|
|
|
|
// ,dataInfo.getTaskId(),10000,code,"E1",dataInfo.getFromRow(),dataInfo.getFromColumn());
|
|
|
|
|
@ -329,6 +338,9 @@ public class PLCServiceImpl implements PLCService {
|
|
|
|
|
|
|
|
|
|
//头部拍照
|
|
|
|
|
StreetDO street = streetService.getStreetByPlcId(dataInfo.getSRMNumber());
|
|
|
|
|
|
|
|
|
|
LightSourceDO lightSourceDO = lightSourceService.getOne(new QueryWrapper<LightSourceDO>().eq("street_id", street.getId()).last("limit 1"));
|
|
|
|
|
LightFactory.LightController(lightSourceDO,1);
|
|
|
|
|
// 获取记录
|
|
|
|
|
StockDO stock = stockService.getOne(
|
|
|
|
|
new QueryWrapper<StockDO>()
|
|
|
|
|
@ -469,8 +481,10 @@ public class PLCServiceImpl implements PLCService {
|
|
|
|
|
algorithmDelayTask.setUuid(uuid);
|
|
|
|
|
getPhotoDelayExecutor.communicationFactory(algorithmDelayTask);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LightFactory.LightController(lightSourceDO,0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static String capitalize(String str) {
|
|
|
|
|
if (str == null || str.isEmpty()) {
|
|
|
|
|
return str;
|
|
|
|
|
|