|
|
|
|
@ -119,11 +119,38 @@ public class PlcService {
|
|
|
|
|
* @param plcCmdInfo
|
|
|
|
|
*/
|
|
|
|
|
public void orderStop(PlcCmdInfo plcCmdInfo) {
|
|
|
|
|
Street street = streetService.getStreetByPlcId(plcCmdInfo.getPlcId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (street != null) {
|
|
|
|
|
if(plcCmdInfo.getLeftRight1() == 1){
|
|
|
|
|
if(plcCmdInfo.getRow1()>street.getLeftRow() && plcCmdInfo.getColumn1() > street.getLeftColumn()){
|
|
|
|
|
log.error("row:{},column:{},error in streetId:{} left",plcCmdInfo.getRow1(),plcCmdInfo.getColumn1(),street.getId());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
if(plcCmdInfo.getRow1()>street.getRightRow() && plcCmdInfo.getColumn1() > street.getRightColumn()){
|
|
|
|
|
log.error("row:{},column:{},error in streetId:{} right",plcCmdInfo.getRow1(),plcCmdInfo.getColumn1(),street.getId());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//石家庄只记录入库情况
|
|
|
|
|
Order order = new Order();
|
|
|
|
|
order.setOrderNum(plcCmdInfo.getOrderNum());
|
|
|
|
|
order.setStreetId(street.getId());
|
|
|
|
|
order.setInOut1(plcCmdInfo.getSide2());
|
|
|
|
|
order.setLeftRight1(plcCmdInfo.getLeftRight2());
|
|
|
|
|
order.setColumn1(plcCmdInfo.getColumn2());
|
|
|
|
|
order.setRow1(plcCmdInfo.getRow2());
|
|
|
|
|
order.setIntoStockOverTime(LocalDateTime.now());
|
|
|
|
|
//todo 昆船的项目 ,取货 放货是独立的
|
|
|
|
|
//取货是是不知道放货的位置的,所以订单开始的时候只写1位置
|
|
|
|
|
//订单结束写2位置
|
|
|
|
|
orderMapper.insert(order);
|
|
|
|
|
OrderRealtime.startOrder(street.getId(), plcCmdInfo.getOrderNum());
|
|
|
|
|
|
|
|
|
|
TransmissionPojo transmissionPojo = new TransmissionPojo( street, plcCmdInfo.getRow2(), plcCmdInfo.getColumn2(),plcCmdInfo.getLeftRight2(),order.getId().toString());
|
|
|
|
|
ClientChanel.get(street.getPlcId()).writeAndFlush(transmissionPojo.toString(TransmissionType.SGPS));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -244,9 +271,6 @@ public class PlcService {
|
|
|
|
|
|
|
|
|
|
} else if (code.startsWith("C4")) {
|
|
|
|
|
|
|
|
|
|
TransmissionPojo transmissionPojo = new TransmissionPojo( street, plcCmdInfo.getRow2(), plcCmdInfo.getColumn2());
|
|
|
|
|
|
|
|
|
|
ClientChanel.get(street.getPlcId()).writeAndFlush(transmissionPojo.toString(TransmissionType.GPS));
|
|
|
|
|
if (sep == 1) {
|
|
|
|
|
delayTime = configProperties.getCameraConfig().getC4DelayCaptureTime();
|
|
|
|
|
} else {
|
|
|
|
|
@ -673,14 +697,17 @@ public class PlcService {
|
|
|
|
|
stockMapper.insert(stock);
|
|
|
|
|
} else stockMapper.updateById(stock);
|
|
|
|
|
TransmissionPojo transmissionPojo = new TransmissionPojo(checkLog, street);
|
|
|
|
|
ClientChanel.get(dataInfo.getSRMNumber()).writeAndFlush(transmissionPojo.toString(TransmissionType.ST));
|
|
|
|
|
|
|
|
|
|
if(ClientChanel.get(dataInfo.getSRMNumber()) != null) {
|
|
|
|
|
ClientChanel.get(dataInfo.getSRMNumber()).writeAndFlush(transmissionPojo.toString(TransmissionType.ST));
|
|
|
|
|
}else {
|
|
|
|
|
log.error("未找到对应plc" + transmissionPojo.toString());
|
|
|
|
|
}
|
|
|
|
|
//取货完成进行拍照
|
|
|
|
|
try {
|
|
|
|
|
Thread.sleep(50L);
|
|
|
|
|
if (lock.tryLock()) {
|
|
|
|
|
//队列中没有任务,发送取图指令
|
|
|
|
|
if (GetPhotoDelayExecutor.cameraDelayTasks.size() ==0) {
|
|
|
|
|
if (GetPhotoDelayExecutor.cameraDelayTasks.size() ==0 && ClientChanel.get(dataInfo.getSRMNumber()) != null) {
|
|
|
|
|
ClientChanel.get(dataInfo.getSRMNumber()).writeAndFlush(transmissionPojo.toString(TransmissionType.GPS));
|
|
|
|
|
}
|
|
|
|
|
//放置到队列中,等待取图返回后删除
|
|
|
|
|
@ -755,4 +782,12 @@ public class PlcService {
|
|
|
|
|
KsecInfo ksecInfo = new KsecInfo("KC", "E", ksecDataInfo);
|
|
|
|
|
return ksecInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void saveFollowPhoto(TransmissionPojo transmissionPojo) {
|
|
|
|
|
Street street = streetMapper.getStreetByPlcId(transmissionPojo.getStreetNumber());
|
|
|
|
|
Order order = orderMapper.selectById(transmissionPojo.getTaskId());
|
|
|
|
|
|
|
|
|
|
order.setIntoStockOverPic(transmissionPojo.getPicsPath()[0]);
|
|
|
|
|
orderMapper.updateById(order);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|