修复项目上出现的少量BUG
This commit is contained in:
parent
525491eaeb
commit
1850059708
|
|
@ -1,11 +1,9 @@
|
||||||
package org.wcs.business.led;
|
package org.wcs.business.led;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.wcs.model.pojo.led.LedDataDetail;
|
|
||||||
import org.wcs.model.pojo.led.LedShowData;
|
import org.wcs.model.pojo.led.LedShowData;
|
||||||
import com.listenvision.LxLedCommunication;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 灵信LED屏操作类
|
* 灵信LED屏操作类
|
||||||
|
|
@ -20,34 +18,6 @@ public class LxLedOperation implements ledOperation {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized String showLedBase(LedShowData ledShowData) {
|
public synchronized String showLedBase(LedShowData ledShowData) {
|
||||||
try {
|
return null;
|
||||||
LxLedCommunication.InitLedType(ledShowData.getLedType()); // 初始化卡型号
|
|
||||||
// 创建一个节目
|
|
||||||
long createResult = LxLedCommunication.CreateProgram(ledShowData.getLedWidth(), ledShowData.getLedHeight(), ledShowData.getColorType(), 0, 3);
|
|
||||||
if (createResult == 0) {
|
|
||||||
return "节目对象创建失败";
|
|
||||||
}
|
|
||||||
List<LedDataDetail> dataDetails = ledShowData.getDataDetails();
|
|
||||||
if(dataDetails == null || dataDetails.isEmpty()) {
|
|
||||||
return "显示内容为空";
|
|
||||||
}
|
|
||||||
for (int i = 0; i < dataDetails.size(); i++) {
|
|
||||||
LedDataDetail dataDetail = dataDetails.get(i);
|
|
||||||
int createAreaResult = LxLedCommunication.AddMultiLineTextToImageTextArea(createResult, 0, i, 0,
|
|
||||||
dataDetail.getContent(), dataDetail.getFontName(), dataDetail.getFontSize(), dataDetail.getFontColor(), 0, 0, 0,
|
|
||||||
dataDetail.getInStyle(), dataDetail.getNSpeed(), 0, dataDetail.getNSpeed(), dataDetail.isVCenterIs() ? 1 : 0);
|
|
||||||
if (createAreaResult != 0) {
|
|
||||||
return "区域创建失败,错误信息:" + LxLedCommunication.GetErrorCodeInfo(createAreaResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int sendResult = LxLedCommunication.NetWorkSend(ledShowData.getLedIp(), createResult);
|
|
||||||
if (sendResult != 0) {
|
|
||||||
return "发送失败,错误信息:" + LxLedCommunication.GetErrorCodeInfo(sendResult);
|
|
||||||
}
|
|
||||||
LxLedCommunication.DeleteProgram(createResult);
|
|
||||||
return "发送成功";
|
|
||||||
} catch (Exception e) {
|
|
||||||
return "LED屏显示失败,异常信息:" + e.getMessage();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ public class StackerTaskCreator {
|
||||||
task.setTaskType(StackerTaskTypeEnum.IN.getCode().shortValue());
|
task.setTaskType(StackerTaskTypeEnum.IN.getCode().shortValue());
|
||||||
task.setGetStand(AppStringUtils.forceToShort(origin));
|
task.setGetStand(AppStringUtils.forceToShort(origin));
|
||||||
task.setGetLaneId(originLocation.getLaneId().shortValue());
|
task.setGetLaneId(originLocation.getLaneId().shortValue());
|
||||||
|
task.setSetLaneId(destinationLocation.getLaneId().shortValue());
|
||||||
task.setSetDepth(destinationLocation.getLaneId().shortValue());
|
task.setSetDepth(destinationLocation.getLaneId().shortValue());
|
||||||
task.setSetStand(AppStringUtils.forceToShort(destination));
|
task.setSetStand(AppStringUtils.forceToShort(destination));
|
||||||
task.setGetRow(AppObjectUtils.stringToInteger(originLocationData.length > 0, originLocationData[0]).shortValue());
|
task.setGetRow(AppObjectUtils.stringToInteger(originLocationData.length > 0, originLocationData[0]).shortValue());
|
||||||
|
|
@ -117,6 +118,7 @@ public class StackerTaskCreator {
|
||||||
task.setTaskType(StackerTaskTypeEnum.ERROR.getCode().shortValue());
|
task.setTaskType(StackerTaskTypeEnum.ERROR.getCode().shortValue());
|
||||||
task.setGetStand(AppStringUtils.forceToShort(origin));
|
task.setGetStand(AppStringUtils.forceToShort(origin));
|
||||||
task.setGetLaneId(originLocation.getLaneId().shortValue());
|
task.setGetLaneId(originLocation.getLaneId().shortValue());
|
||||||
|
task.setSetLaneId(destinationLocation.getLaneId().shortValue());
|
||||||
task.setSetDepth(destinationLocation.getLaneId().shortValue());
|
task.setSetDepth(destinationLocation.getLaneId().shortValue());
|
||||||
task.setSetStand(AppStringUtils.forceToShort(destination));
|
task.setSetStand(AppStringUtils.forceToShort(destination));
|
||||||
task.setGetRow(AppObjectUtils.stringToInteger(originLocationData.length > 0, originLocationData[0]).shortValue());
|
task.setGetRow(AppObjectUtils.stringToInteger(originLocationData.length > 0, originLocationData[0]).shortValue());
|
||||||
|
|
@ -170,6 +172,7 @@ public class StackerTaskCreator {
|
||||||
task.setTaskType(StackerTaskTypeEnum.OUT.getCode().shortValue());
|
task.setTaskType(StackerTaskTypeEnum.OUT.getCode().shortValue());
|
||||||
task.setGetStand(AppStringUtils.forceToShort(origin));
|
task.setGetStand(AppStringUtils.forceToShort(origin));
|
||||||
task.setGetLaneId(originLocation.getLaneId().shortValue());
|
task.setGetLaneId(originLocation.getLaneId().shortValue());
|
||||||
|
task.setSetLaneId(destinationLocation.getLaneId().shortValue());
|
||||||
task.setSetDepth(destinationLocation.getLaneId().shortValue());
|
task.setSetDepth(destinationLocation.getLaneId().shortValue());
|
||||||
task.setSetStand(AppStringUtils.forceToShort(destination));
|
task.setSetStand(AppStringUtils.forceToShort(destination));
|
||||||
task.setGetRow(originLocation.getLRow().shortValue());
|
task.setGetRow(originLocation.getLRow().shortValue());
|
||||||
|
|
@ -221,6 +224,7 @@ public class StackerTaskCreator {
|
||||||
task.setTaskType(StackerTaskTypeEnum.MOVE.getCode().shortValue());
|
task.setTaskType(StackerTaskTypeEnum.MOVE.getCode().shortValue());
|
||||||
task.setGetStand(AppStringUtils.forceToShort(origin));
|
task.setGetStand(AppStringUtils.forceToShort(origin));
|
||||||
task.setGetLaneId(originLocation.getLaneId().shortValue());
|
task.setGetLaneId(originLocation.getLaneId().shortValue());
|
||||||
|
task.setSetLaneId(destinationLocation.getLaneId().shortValue());
|
||||||
task.setSetDepth(destinationLocation.getLaneId().shortValue());
|
task.setSetDepth(destinationLocation.getLaneId().shortValue());
|
||||||
task.setSetStand(AppStringUtils.forceToShort(destination));
|
task.setSetStand(AppStringUtils.forceToShort(destination));
|
||||||
task.setGetRow(originLocation.getLRow().shortValue());
|
task.setGetRow(originLocation.getLRow().shortValue());
|
||||||
|
|
|
||||||
|
|
@ -396,14 +396,15 @@ public class PlcSiemensCommunication implements IPlcCommunication {
|
||||||
return new Tuple2<>(readResult.Message, null);
|
return new Tuple2<>(readResult.Message, null);
|
||||||
}
|
}
|
||||||
byte[] readBytes = readResult.Content; // 读到的数据
|
byte[] readBytes = readResult.Content; // 读到的数据
|
||||||
ScanInfo scanInfo = new ScanInfo();
|
ScanInfo scanInfo = ScanInfo.builder()
|
||||||
scanInfo.setTag(siemensS7Net.getByteTransform().TransInt16(readBytes, 0));
|
.tag(siemensS7Net.getByteTransform().TransInt16(readBytes, 0))
|
||||||
scanInfo.setVehicleSize(siemensS7Net.getByteTransform().TransInt16(readBytes, 2));
|
.vehicleSize(siemensS7Net.getByteTransform().TransInt16(readBytes, 2))
|
||||||
scanInfo.setLength(siemensS7Net.getByteTransform().TransInt32(readBytes, 4));
|
.length(siemensS7Net.getByteTransform().TransInt32(readBytes, 4))
|
||||||
scanInfo.setWidth(siemensS7Net.getByteTransform().TransInt32(readBytes, 8));
|
.width(siemensS7Net.getByteTransform().TransInt32(readBytes, 8))
|
||||||
scanInfo.setHeight(siemensS7Net.getByteTransform().TransInt32(readBytes, 12));
|
.height(siemensS7Net.getByteTransform().TransInt32(readBytes, 12))
|
||||||
scanInfo.setWeight(siemensS7Net.getByteTransform().TransInt32(readBytes, 16));
|
.weight(siemensS7Net.getByteTransform().TransInt32(readBytes, 16))
|
||||||
scanInfo.setVehicleNo(siemensS7Net.getByteTransform().TransString(readBytes, 20 , PlcConfig.PLC_CONFIG_TASK_CONVEY_CODE_LENGTH, StandardCharsets.US_ASCII));
|
.vehicleNo(siemensS7Net.getByteTransform().TransString(readBytes, 20 , PlcConfig.PLC_CONFIG_TASK_CONVEY_CODE_LENGTH, StandardCharsets.US_ASCII))
|
||||||
|
.build();
|
||||||
return new Tuple2<>(null, scanInfo);
|
return new Tuple2<>(null, scanInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package org.wcs.plugin.plc.model;
|
package org.wcs.plugin.plc.model;
|
||||||
|
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
|
@ -8,6 +9,7 @@ import lombok.Setter;
|
||||||
*/
|
*/
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
|
@Builder
|
||||||
public class ScanInfo {
|
public class ScanInfo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ public class ResolveStockTaskJob implements Job {
|
||||||
*/
|
*/
|
||||||
private void resolveEndStockTask(List<AppStockComposeTask> endTaskList) {
|
private void resolveEndStockTask(List<AppStockComposeTask> endTaskList) {
|
||||||
for (AppStockComposeTask composeTask : endTaskList) {
|
for (AppStockComposeTask composeTask : endTaskList) {
|
||||||
List<AppStockSingleTask> stockSingleTasks = stockSingleTaskService.queryByUpperTaskId(composeTask.getUpperTaskId());
|
List<AppStockSingleTask> stockSingleTasks = stockSingleTaskService.queryByUpperTaskId(composeTask.getTaskId());
|
||||||
if(stockSingleTasks == null) {
|
if(stockSingleTasks == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -234,7 +234,7 @@ public class ResolveStockTaskJob implements Job {
|
||||||
Tuple2<String, String> reporterResult = ReportStandard.stockTaskReport(StockCallBackStatusEnum.FINISH, composeTask, composeTask.getTaskMsg());
|
Tuple2<String, String> reporterResult = ReportStandard.stockTaskReport(StockCallBackStatusEnum.FINISH, composeTask, composeTask.getTaskMsg());
|
||||||
if(reporterResult.getItem1() != null) {
|
if(reporterResult.getItem1() != null) {
|
||||||
log.info("任务完成上报失败,组合任务ID:{},错误信息:{}", composeTask.getTaskId(), reporterResult.getItem1());
|
log.info("任务完成上报失败,组合任务ID:{},错误信息:{}", composeTask.getTaskId(), reporterResult.getItem1());
|
||||||
dataRecorder.recordStockMsg(composeTask.getUpperTaskId(), composeTask.getVehicleNo(), "任务完成上报失败,错误信息:" + reporterResult.getItem1());
|
dataRecorder.recordStockMsg(composeTask.getTaskId(), composeTask.getVehicleNo(), "任务完成上报失败,错误信息:" + reporterResult.getItem1());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
log.info("任务完成上报成功,组合任务ID:{},返回信息:{}", composeTask.getTaskId(), reporterResult.getItem2());
|
log.info("任务完成上报成功,组合任务ID:{},返回信息:{}", composeTask.getTaskId(), reporterResult.getItem2());
|
||||||
|
|
@ -258,7 +258,7 @@ public class ResolveStockTaskJob implements Job {
|
||||||
Tuple2<String, String> reporterResult = ReportStandard.stockTaskReport(StockCallBackStatusEnum.CANCEL, composeTask, composeTask.getTaskMsg());
|
Tuple2<String, String> reporterResult = ReportStandard.stockTaskReport(StockCallBackStatusEnum.CANCEL, composeTask, composeTask.getTaskMsg());
|
||||||
if(reporterResult.getItem1() != null) {
|
if(reporterResult.getItem1() != null) {
|
||||||
log.info("任务取消上报失败,组合任务ID:{},错误信息:{}", composeTask.getTaskId(), reporterResult.getItem1());
|
log.info("任务取消上报失败,组合任务ID:{},错误信息:{}", composeTask.getTaskId(), reporterResult.getItem1());
|
||||||
dataRecorder.recordStockMsg(composeTask.getUpperTaskId(), composeTask.getVehicleNo(), "任务取消上报失败,错误信息:" + reporterResult.getItem1());
|
dataRecorder.recordStockMsg(composeTask.getTaskId(), composeTask.getVehicleNo(), "任务取消上报失败,错误信息:" + reporterResult.getItem1());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
log.info("任务取消上报成功,组合任务ID:{},返回信息:{}", composeTask.getTaskId(), reporterResult.getItem2());
|
log.info("任务取消上报成功,组合任务ID:{},返回信息:{}", composeTask.getTaskId(), reporterResult.getItem2());
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/wcs?characterEncoding=utf8&useSSL=false
|
url: jdbc:mysql://127.0.0.1:3306/wcs?characterEncoding=utf8&useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: Root123456
|
password: Root123456
|
||||||
data:
|
data:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user