|
|
|
|
@ -182,6 +182,7 @@ public class PlcService {
|
|
|
|
|
order.setInOut2(plcCmdInfo.getSide2());
|
|
|
|
|
order.setLeftRight2(plcCmdInfo.getLeftRight2());
|
|
|
|
|
order.setColumn2(plcCmdInfo.getColumn2());
|
|
|
|
|
|
|
|
|
|
order.setRow2(plcCmdInfo.getRow2());
|
|
|
|
|
//todo 昆船的项目 ,取货 放货是独立的
|
|
|
|
|
//取货是是不知道放货的位置的,所以订单开始的时候只写1位置
|
|
|
|
|
@ -190,6 +191,51 @@ public class PlcService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 开始工单 robotic plcId是plcId,昆船的plcId是来自包体,即srmNumber
|
|
|
|
|
*
|
|
|
|
|
* @param plcCmdInfo
|
|
|
|
|
*/
|
|
|
|
|
public void orderStart(PlcCmdInfo plcCmdInfo,String code) {
|
|
|
|
|
Street street = streetService.getStreetByPlcId(plcCmdInfo.getPlcId());
|
|
|
|
|
//打开光源
|
|
|
|
|
streetController.openStreetLightSource(street.getId());
|
|
|
|
|
|
|
|
|
|
Integer cameraId = (plcCmdInfo.getFromAround() == 1) ? street.getCamera1Id() : street.getCamera2Id();
|
|
|
|
|
gyrateCameraByCode(cameraId, "C5", plcCmdInfo.getTaskId());
|
|
|
|
|
|
|
|
|
|
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.setStatus(0);
|
|
|
|
|
order.setStartTime(LocalDateTime.now());
|
|
|
|
|
order.setStreetId(street.getId());
|
|
|
|
|
order.setInOut1(plcCmdInfo.getSide1());
|
|
|
|
|
order.setLeftRight1(plcCmdInfo.getLeftRight1());
|
|
|
|
|
order.setColumn1(plcCmdInfo.getColumn1());
|
|
|
|
|
order.setRow1(plcCmdInfo.getRow1());
|
|
|
|
|
order.setInOut2(plcCmdInfo.getSide2());
|
|
|
|
|
order.setLeftRight2(plcCmdInfo.getLeftRight2());
|
|
|
|
|
order.setColumn2(plcCmdInfo.getColumn2());
|
|
|
|
|
order.setCode(code);
|
|
|
|
|
order.setRow2(plcCmdInfo.getRow2());
|
|
|
|
|
//todo 昆船的项目 ,取货 放货是独立的
|
|
|
|
|
//取货是是不知道放货的位置的,所以订单开始的时候只写1位置
|
|
|
|
|
//订单结束写2位置
|
|
|
|
|
orderMapper.insert(order);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 工单结束信息
|
|
|
|
|
* 判断有没有告警,有告警的不做处理
|
|
|
|
|
@ -756,6 +802,7 @@ public class PlcService {
|
|
|
|
|
.wmsCount(algorithmPojo.getGoodsNumber())
|
|
|
|
|
.wmsCategory(algorithmPojo.getGoodsType())
|
|
|
|
|
.streetId(orderInfo.getStreetId())
|
|
|
|
|
.wmsTrayCode(dataInfo.getTrayCode())
|
|
|
|
|
.direction(plcCmdInfo.getFromDirection())
|
|
|
|
|
.side(orderInfo.getSeparation())
|
|
|
|
|
.row(orderInfo.getRow())
|
|
|
|
|
@ -769,6 +816,7 @@ public class PlcService {
|
|
|
|
|
stock.setStatus(status);
|
|
|
|
|
stock.setLotnum(plcCmdInfo.getLotnum());
|
|
|
|
|
stock.setExportTime(LocalDateTime.now());
|
|
|
|
|
stock.setWmsTrayCode(dataInfo.getTrayCode());
|
|
|
|
|
stock.setCount(algorithmPojo.getGoodsNumberResult());
|
|
|
|
|
stock.setCategory(algorithmPojo.getGoodsTypeResult());
|
|
|
|
|
stock.setWmsCategory(algorithmPojo.getGoodsType());
|
|
|
|
|
@ -943,7 +991,7 @@ public class PlcService {
|
|
|
|
|
|
|
|
|
|
//任务开始 旋转到原点位
|
|
|
|
|
gyrateCamera(plcCmdInfo, Cmd.C5.name());
|
|
|
|
|
orderStart(plcCmdInfo);
|
|
|
|
|
orderStart(plcCmdInfo,dataInfo.getTrayCode());
|
|
|
|
|
// 添加延时任务
|
|
|
|
|
PlcCmdInfo finalPlcCmdInfo = plcCmdInfo;
|
|
|
|
|
ScheduledFuture<?> future = scheduler.schedule(() -> {
|
|
|
|
|
|