fix(ims): 优化异常处理与错误信息截断

This commit is contained in:
mzr 2025-11-22 12:27:53 +08:00
parent 7abb34d9e3
commit 0ae5800361
3 changed files with 19 additions and 6 deletions

View File

@ -11,6 +11,7 @@ import nc.bs.pub.taskcenter.IBackgroundWorkPlugin;
import nc.bs.uapbd.util.GyImsDbUtil;
import nc.bs.uapbd.util.MyHelper;
import nc.jdbc.framework.processor.MapProcessor;
import nc.util.mmf.framework.base.MMValueCheck;
import nc.vo.ic.m45.entity.PurchaseInVO;
import nc.vo.pub.BusinessException;
import nccloud.api.ic.m45.IAPIPurchaseInMaitain;
@ -146,10 +147,14 @@ public class ErpIaI2billFromGyImsPlugin implements IBackgroundWorkPlugin {
}
updateSql = updateSql.replace("[cgeneralhid]", cgeneralhid);
GyImsDbUtil.update(updateSql);
} catch (BusinessException e) {
} catch (Exception e) {
logger.error("ErpIaI2billFromGyImsPlugin Error: " + e.getMessage(), e);
String updateSql = "update BIPInputMainTab set err_msg = ? where cgeneralhid = ?";
Object[] params = new Object[]{e.getMessage(), cgeneralhid};
String message = e.getMessage();
if (MMValueCheck.isNotEmpty(message) && message.length() > 4000) {
message = message.substring(0, 4000);
}
Object[] params = new Object[]{message, cgeneralhid};
int rows = GyImsDbUtil.update(updateSql, params);
}
}

View File

@ -152,10 +152,14 @@ public class MaterialOutGyImsPlugin implements IBackgroundWorkPlugin {
}
updateSql = updateSql.replace("[cgeneralhid]", cgeneralhid);
GyImsDbUtil.update(updateSql);
} catch (BusinessException e) {
} catch (Exception e) {
logger.error("MaterialOutGyImsPlugin Error: ", e);
String updateSql = "update BIPOutMainTab set err_msg = ? where cgeneralhid = ?";
Object[] params = new Object[]{e.getMessage(), cgeneralhid};
String message = e.getMessage();
if (MMValueCheck.isNotEmpty(message) && message.length() > 4000) {
message = message.substring(0, 4000);
}
Object[] params = new Object[]{message, cgeneralhid};
int rows = GyImsDbUtil.update(updateSql, params);
}
}

View File

@ -154,10 +154,14 @@ public class ProductReportGyImsPlugin implements IBackgroundWorkPlugin {
}
updateSql = updateSql.replace("[pkWr]", pkWr);
GyImsDbUtil.update(updateSql);
} catch (BusinessException e) {
} catch (Exception e) {
logger.error("ProductReportGyImsPlugin Error: " + e.getMessage(), e);
String updateSql = "update BIPReportMainTab set err_msg = ? where pk_wr = ?";
Object[] params = new Object[]{e.getMessage(), pkWr};
String message = e.getMessage();
if (MMValueCheck.isNotEmpty(message) && message.length() > 4000) {
message = message.substring(0, 4000);
}
Object[] params = new Object[]{message, pkWr};
int rows = GyImsDbUtil.update(updateSql, params);
}
}