diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java index c0fb65dd..8856c3dc 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java @@ -76,7 +76,8 @@ public class PrintLogServiceImpl extends ServiceImpl i * {"msg":"打印成功","code":0} * {"msg":"打印失败","code":500} * 根据返回值,更新打印机信息-printName及打印是否成功信息isPrint - */ + * */ + JSONObject jsonObject = JSONObject.parseObject(post); Integer code = jsonObject.getInteger("code"); String msg = jsonObject.getString("msg"); @@ -89,7 +90,12 @@ public class PrintLogServiceImpl extends ServiceImpl i PrintLog printLogOne = new PrintLog(); printLogOne.setHandle(printLog.getHandle()); printLogOne.setIsPrint("true"); - printLogOne.setPrintNum(printLog.getPrintNum()+1); + Integer printNum = printLog.getPrintNum(); + if (printNum == null){ + printLogOne.setPrintNum(1); + }else { + printLogOne.setPrintNum(printNum+1); + } if (!printLog.getCategory().equals(Constants.PRINT_TYPE_SFC)){ printLogOne.setPrintName(printLog.getPrintName()); }