opt:优化打印功能,添加打印日志

This commit is contained in:
DESKTOP-5DIJMF9\admin
2025-04-08 09:54:16 +08:00
parent bb5513aa8e
commit fd1d854866
2 changed files with 9 additions and 0 deletions

View File

@@ -423,6 +423,11 @@ public class LashManageServiceImpl implements LashManageService {
int times = Integer.parseInt(labelingTemplateNum);
for(int i=0;i<times;i++){
new PrintServiceImpl().customerPrintBY2(print_jo);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
//更新打印机设备
result.put("printDevice", print_info.getString("print_code"));

View File

@@ -1,6 +1,7 @@
package org.nl.wms.pda.st.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
@@ -442,8 +443,10 @@ public class PrintServiceImpl implements PrintService {
bw.close();
jo.put("message", "打印成功!");
log.info(DateUtil.now()+"打印成功!");
} catch (Exception e) {
jo.put("message", "打印失败!" + e.getMessage());
log.info(DateUtil.now()+"1打印失败");
} finally {
try {
if(fw != null){
@@ -451,6 +454,7 @@ public class PrintServiceImpl implements PrintService {
}
} catch (Exception e) {
jo.put("message", "打印失败!" + e.getMessage());
log.info(DateUtil.now()+"2打印失败");
}
}
return jo;