From 0fd69271b96dcd7afd6a5ae5056293a238b8946f Mon Sep 17 00:00:00 2001 From: mzr Date: Wed, 1 Oct 2025 21:27:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=90=8C=E6=AD=A5=E9=AB=98?= =?UTF-8?q?=E5=8E=8B=E5=8A=A0=E5=B7=A5=E8=BD=A6=E9=97=B4IMS=E7=9A=84?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=8A=A5=E5=91=8A-=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bs/uapbd/task/ProductReportGyImsPlugin.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/uapbd/src/private/nc/bs/uapbd/task/ProductReportGyImsPlugin.java b/uapbd/src/private/nc/bs/uapbd/task/ProductReportGyImsPlugin.java index 2cc8eae9..69a061e5 100644 --- a/uapbd/src/private/nc/bs/uapbd/task/ProductReportGyImsPlugin.java +++ b/uapbd/src/private/nc/bs/uapbd/task/ProductReportGyImsPlugin.java @@ -39,8 +39,8 @@ import java.util.*; * @date 20250929 */ public class ProductReportGyImsPlugin implements IBackgroundWorkPlugin { - private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - private SimpleDateFormat sdf_ts = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + private SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd"); + private SimpleDateFormat DATETIME_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // BIP数据源 public static final BaseDAO baseDAO = new BaseDAO(); // IMS数据源 @@ -98,15 +98,13 @@ public class ProductReportGyImsPlugin implements IBackgroundWorkPlugin { hvo.setCreator("BIP"); hvo.setBillmaker("BIP"); String dmakedateStr = ""; - if (mainMap.get("dmakedate") != null) { - Timestamp dmakedate1 = (Timestamp) mainMap.get("dmakedate"); - dmakedateStr = sdf.format(dmakedate1); + if (mainMap.get("dmakedate") != null && mainMap.get("dmakedate") instanceof Timestamp dmakedate1) { + dmakedateStr = DATE_FORMATTER.format(dmakedate1); UFDate dmakedate = new UFDate(dmakedateStr); hvo.setDmakedate(dmakedate); } - if (mainMap.get("creationtime") != null) { - Timestamp creationtime1 = (Timestamp) mainMap.get("creationtime"); - String creationtimeStr = sdf_ts.format(creationtime1); + if (mainMap.get("creationtime") != null && mainMap.get("creationtime") instanceof Timestamp creationtime1) { + String creationtimeStr = DATETIME_FORMATTER.format(creationtime1); UFDateTime creationtime = new UFDateTime(creationtimeStr); hvo.setCreationtime(creationtime); } @@ -125,8 +123,9 @@ public class ProductReportGyImsPlugin implements IBackgroundWorkPlugin { // 如果物料不相等,则BIP物料替换为IMS物料 String cbmaterialvid = bvo.getCbmaterialvid(); String goodsCode = detailMap.get("cbmaterialvid") + ""; + String whereSql = MaterialVO.CODE + " = '" + goodsCode + "'" + " and pk_org = '" + hvo.getPk_org() + "'"; String goodsId = MyHelper.getStrValByCondition(MaterialVO.getDefaultTableName(), MaterialVO.PK_MATERIAL, - MaterialVO.CODE + " = '" + goodsCode + "'"); + whereSql); if (!cbmaterialvid.equals(goodsId)) { bvo.setCbmaterialvid(goodsId); }