feat:打印机客户端连接异常提醒
This commit is contained in:
parent
b795c96814
commit
6c3e07e6e4
@ -229,22 +229,21 @@ public class PrintController {
|
||||
if (CollectionUtils.isEmpty(pcBarcodes)) {
|
||||
return AjaxResult.error("未查询到二维码信息!" + "(" + businessCode + ")");
|
||||
}
|
||||
//TODO
|
||||
Long routeId =-1L,processId = -1L;
|
||||
Long routeId = -1L, processId = -1L;
|
||||
ProRouteProduct proRouteProduct = new ProRouteProduct();
|
||||
proRouteProduct.setItemId(proCard.getItemId());
|
||||
List<ProRouteProduct> products = proRouteProductMapper.selectProRouteProductList(proRouteProduct);
|
||||
if(CollectionUtil.isNotEmpty(products)){
|
||||
if (CollectionUtil.isNotEmpty(products)) {
|
||||
products = products.stream().filter(i -> proRouteMapper.selectProRouteByRouteId(i.getRouteId()).getEnableFlag().equals(UserConstants.YES)).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(products)){
|
||||
if (CollectionUtil.isNotEmpty(products)) {
|
||||
routeId = products.get(0).getRouteId();
|
||||
}
|
||||
}
|
||||
ProRouteProcess proRouteProcess =new ProRouteProcess();
|
||||
ProRouteProcess proRouteProcess = new ProRouteProcess();
|
||||
proRouteProcess.setRouteId(routeId);
|
||||
String processingProcedure = "";
|
||||
List<ProRouteProcess> proList = iProRouteProcessService.selectProRouteProcessList(proRouteProcess);
|
||||
for (ProRouteProcess process:proList) {
|
||||
for (ProRouteProcess process : proList) {
|
||||
processingProcedure = processingProcedure + "," + process.getProcessName();
|
||||
}
|
||||
dataType = PrintMessageProto.Printer.DataType.Printing_OfCirculation;
|
||||
@ -252,7 +251,7 @@ public class PrintController {
|
||||
setWorkOrderNumber(proCard.getWorkorderCode()).
|
||||
setMaterialCode(proCard.getItemCode()).
|
||||
setMaterialName(proCard.getItemName()).
|
||||
setSpecificationAndModel(proCard.getSpecification()==null?"":proCard.getSpecification()).
|
||||
setSpecificationAndModel(proCard.getSpecification() == null ? "" : proCard.getSpecification()).
|
||||
setProcessingProcedure(processingProcedure).
|
||||
setParam(pcBarcodes.get(0).getBarcodeUrl()).build();
|
||||
// 构造对应的消息对象
|
||||
@ -388,6 +387,9 @@ public class PrintController {
|
||||
//根据客户端和通道信息
|
||||
ConcurrentHashMap<SocketAddress, Channel> channels = PrintServerDefaultHandler.chanelMap;
|
||||
Channel channel = channels.get(socketAddress.get(clientIp));
|
||||
if (channel == null) {
|
||||
return AjaxResult.error("打印机客户端连接异常" + "(" + clientIp + ")");
|
||||
}
|
||||
channel.writeAndFlush(msg);
|
||||
return AjaxResult.success("打印成功");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user