防止为空

bozhou-古井贡酒
LAPTOP-S9HJSOEB\昊天 3 weeks ago
parent c8a8ccc8e2
commit 8699bb7ead

@ -10,6 +10,7 @@ import com.zhehekeji.web.config.ConfigProperties;
import com.zhehekeji.web.config.WebSocketConfig;
import com.zhehekeji.web.controller.StreetController;
import com.zhehekeji.web.entity.*;
import com.zhehekeji.web.entity.yolo.Calculate;
import com.zhehekeji.web.lib.*;
import com.zhehekeji.web.mapper.*;
import com.zhehekeji.web.pojo.Cmd;
@ -30,6 +31,7 @@ import com.zhehekeji.web.util.ToolUtil;
import com.zhehekeji.web.ws.WebSocketServer;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.SetUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.poi.util.ArrayUtil;
@ -771,11 +773,27 @@ public class PlcService {
OrderInfo orderInfo = new OrderInfo(street, plcCmdInfo, 1, cmdCode);
Stock stock = stockMapper.getByStreetAndDirectionAndSideAndRowColumn(orderInfo.getStreetId(), plcCmdInfo.getFromDirection(), orderInfo.getSeparation(), orderInfo.getRow(), orderInfo.getColumn());
AlgorithmPojo algorithmPojo = algorithmService.getGoodResult(street, dataInfo);
String paths = String.join(";", algorithmPojo.getCalculate().getFisheye()) + ";" + String.join(";", algorithmPojo.getCalculate().getCloseUp()) + ";" + algorithmPojo.getCalculate().getPath();
String paths = "";
if (algorithmPojo != null && algorithmPojo.getCalculate() != null) {
Calculate calculate = algorithmPojo.getCalculate();
List<String> picPaths = new ArrayList<>();
if (CollectionUtils.isNotEmpty(calculate.getFisheye())) {
picPaths.addAll(calculate.getFisheye());
}
if (CollectionUtils.isNotEmpty(calculate.getCloseUp())) {
picPaths.addAll(calculate.getCloseUp());
}
if (StringUtils.hasText(calculate.getPath())) {
picPaths.add(calculate.getPath());
}
paths = picPaths.stream()
.filter(StringUtils::hasText)
.collect(Collectors.joining(";"));
}
//货物使用球机扫码
log.info("盘点信息:{}", algorithmPojo.toString());
log.info("盘点信息:{}", algorithmPojo);
// //关闭光源
// Thread thread = new Thread(() -> {
// try {

Loading…
Cancel
Save