From 7cd93b02f4c08a829c7f3aa14ae715b40f70e77c Mon Sep 17 00:00:00 2001 From: 18516761980 <tqsxp@163.com> Date: 星期六, 04 二月 2023 09:48:51 +0800 Subject: [PATCH] # --- src/main/java/com/zy/ints/task/scheduler/ErpDetTbScheduler.java | 30 +++++++++++++++++++++++------- 1 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/zy/ints/task/scheduler/ErpDetTbScheduler.java b/src/main/java/com/zy/ints/task/scheduler/ErpDetTbScheduler.java index 7fca83c..19d2cd7 100644 --- a/src/main/java/com/zy/ints/task/scheduler/ErpDetTbScheduler.java +++ b/src/main/java/com/zy/ints/task/scheduler/ErpDetTbScheduler.java @@ -72,8 +72,13 @@ if (status == 0) { Mat mat = matService.selectByMatnr(erpDetTb.getPrdNo()); if (Cools.isEmpty(mat)) { - erpSqlServer.update(sqlUpDateErpDetTbTwo + ",Temp1='鍝佸彿淇℃伅鍦ㄧ珛搴撲笉瀛樺湪锛岃鍏堟坊鍔犲晢鍝侊紒锛侊紒'" + "where 1=1 and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'"); - callApiLogSave(erpDetTb, "ERP_DETTB", "鍝佸彿淇℃伅鍦ㄧ珛搴撲笉瀛樺湪锛岃鍏堟坊鍔犲晢鍝侊紒锛侊紒", false); + if(Cools.isEmpty(erpDetTb.getTemp1())){ + erpSqlServer.update(sqlUpDateErpDetTbTwo + ",Temp1='鍝佸彿淇℃伅鍦ㄧ珛搴撲笉瀛樺湪锛岃鍏堟坊鍔犲晢鍝侊紒锛侊紒'" + "where 1=1 " + +" and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'" + +" and ITM=" + "'" + erpDetTb.getItm() + "'" + +" and BIL_NO=" + "'" + erpDetTb.getBillNo() + "'"); + callApiLogSave(erpDetTb, "ERP_DETTB", "鍝佸彿淇℃伅鍦ㄧ珛搴撲笉瀛樺湪锛岃鍏堟坊鍔犲晢鍝侊紒锛侊紒", false); + } } else { Order order = orderService.selectByNo(erpDetTb.getBillNo()); if (Cools.isEmpty(order)) { @@ -113,8 +118,8 @@ now, // 淇敼鏃堕棿 null // 澶囨敞 ); - String InAndOut = erpDetTb.getAddId2()==2 ? "锛堝嚭搴擄級" : "锛堝叆搴擄級"; - DocType docType = docTypeService.selectOrAdd("ERP璁㈠崟"+InAndOut, erpDetTb.getAddId2()==1); + String InAndOut = erpDetTb.getAddId2().equals(2) ? "锛堝嚭搴擄級" : "锛堝叆搴擄級"; + DocType docType = docTypeService.selectOrAdd("ERP璁㈠崟"+InAndOut, erpDetTb.getAddId2().equals(1)); if (!Cools.isEmpty(docType)) { order.setDocType(docType.getDocId()); if (!orderService.insert(order)) { @@ -150,8 +155,13 @@ erpSqlServer.update(sqlUpDateErpDetTbOne + "'" + erpDetTb.getPrdNo() + "'"); callApiLogSave(erpDetTb, "ERP_DETTB", "鎺ユ敹ERP涓嬪彂璁㈠崟鎺ユ敹鎴愬姛锛侊紒", true); } else { - erpSqlServer.update(sqlUpDateErpDetTbTwo + ",temp1='娣诲姞璁㈠崟鏄庣粏妗eけ璐ワ紒锛侊紒'" + "where 1=1 and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'"); - callApiLogSave(erpDetTb, "ERP_DETTB", "ERP涓嬪彂璁㈠崟鎺ユ敹澶辫触锛侊紒", false); + if (Cools.isEmpty(erpDetTb.getTemp2())){ + erpSqlServer.update(sqlUpDateErpDetTbTwo + ",temp2='娣诲姞璁㈠崟鏄庣粏妗eけ璐ワ紒锛侊紒'" + "where 1=1 " + +" and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'" + +" and ITM=" + "'" + erpDetTb.getItm() + "'" + +" and BIL_NO=" + "'" + erpDetTb.getBillNo() + "'"); + callApiLogSave(erpDetTb, "ERP_DETTB", "ERP涓嬪彂璁㈠崟鎺ユ敹澶辫触锛侊紒", false); + } } } } @@ -185,7 +195,13 @@ // callApiLogSave(erpDetTb, "ERP_DETTB", "ERP涓嬪彂璁㈠崟澶囦唤鍚庡垹闄ゆ垚鍔燂紒锛�", true); } else { - callApiLogSave(erpDetTb, "ERP_DETTB", "鎺ユ敹ERP涓嬪彂璁㈠崟澶辫触锛侊紒锛佺姸鎬佸紓甯革紒锛侊紒", false); + if (Cools.isEmpty(erpDetTb.getTemp1()) && Cools.isEmpty(erpDetTb.getTemp2()) && Cools.isEmpty(erpDetTb.getTemp3())){ + erpSqlServer.update(sqlUpDateErpDetTbTwo + ",Temp1='鎺ユ敹ERP涓嬪彂璁㈠崟澶辫触锛侊紒锛佺姸鎬佸紓甯革紒锛侊紒璇稥RP銆佺珛搴撳弻鏂瑰崗鍔╄В鍐炽��'" + "where 1=1 " + +" and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'" + +" and ITM=" + "'" + erpDetTb.getItm() + "'" + +" and BIL_NO=" + "'" + erpDetTb.getBillNo() + "'"); + callApiLogSave(erpDetTb, "ERP_DETTB", "鎺ユ敹ERP涓嬪彂璁㈠崟澶辫触锛侊紒锛佺姸鎬佸紓甯革紒锛侊紒", false); + } } } } -- Gitblit v1.9.1