From 00761a8fca6547ebb75c52ee7ba5f20ee64495c9 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期一, 23 十月 2023 10:42:17 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java |   42 ++++++++++++++++++++++--------------------
 1 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java b/src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java
index 0bc7bd1..a548629 100644
--- a/src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java
+++ b/src/main/java/com/zy/asrs/task/kingdee/handler/InboundOrderHandler.java
@@ -87,7 +87,7 @@
                 Tag tag = tagService.selectByName("鍏ㄩ儴", 1);
                 //鐗╂枡鐘舵�� FUseOrgId .FNumber
                 FDocumentStatus="C";
-                jsonObject.put("FilterString", "FCreateDate>'"+sdf.format(tag.getUpdateTime())+"' and FDocumentStatus='"+FDocumentStatus+"' and FUseOrgId .FNumber='201'");
+                jsonObject.put("FilterString", "FCreateDate>'"+sdf.format(tag.getUpdateTime())+"' and FDocumentStatus='"+FDocumentStatus+"' and FUseOrgId .FNumber='100'");
                 jsonObject.put("FieldKeys", "FName,FNumber,FCreateDate,FSpecification,FDocumentStatus");
                 // FName : 鐗╂枡鍚嶇О 锛�
                 // FNumber 锛氱墿鏂欑紪鍙凤紱
@@ -134,7 +134,7 @@
                     for (int j = 0; j < data.size(); j++) {
                         JSONArray jsonArray = data.getJSONArray(j);
                         //瀵圭編鍥芥椂闂磋繘琛岃浆鎹�
-                        Date date = KingDeeUtil.KingDeeDate(jsonArray.get(2).toString());
+                        Date jsonDate = KingDeeUtil.KingDeeDate(jsonArray.get(2).toString());
                         //鐢熸垚鍟嗗搧妗f
                         //鍟嗗搧缂栧彿
                         Mat mat = matService.selectByMatnr(jsonArray.get(1).toString());
@@ -144,7 +144,7 @@
                             mat.setMaktx(jsonArray.get(0).toString());
                             mat.setSpecs(jsonArray.get(3).toString());//瑙勬牸
                             mat.setTagId(tag.getId());
-                            mat.setCreateTime(date);//鍟嗗搧鍒涘缓鏃堕棿
+                            mat.setCreateTime(jsonDate);//鍟嗗搧鍒涘缓鏃堕棿
                             mat.setUpdateTime(new Date());
                             mat.setStatus(1);
                             //鏈�鏂版姄鍙栧晢鍝佹椂闂�
@@ -157,10 +157,12 @@
 //                                log.info("鍚屾鏂扮墿鏂橻鍟嗗搧缂栧彿锛歿}]", mat.getMatnr());
                             }
                         }else {
-                            callApiLogSaveMat(mat,kingDeeUtilType, "鍟嗗搧缂栧彿閲嶅:"+mat.getMatnr(), false);
-                            log.info("鍚屾鏂扮墿鏂橻鍟嗗搧缂栧彿锛歿}],鍟嗗搧缂栧彿閲嶅锛侊紒锛�", mat.getMatnr());
+                            if (!jsonDate.equals(tag.getUpdateTime())){
+                                callApiLogSaveMat(mat,kingDeeUtilType, "鍟嗗搧缂栧彿閲嶅:"+mat.getMatnr(), false);
+                                log.info("鍚屾鏂扮墿鏂橻鍟嗗搧缂栧彿锛歿}],鍟嗗搧缂栧彿閲嶅锛侊紒锛�", mat.getMatnr());
+                            }
                         }
-                        tag.setUpdateTime(date);
+                        tag.setUpdateTime(jsonDate);
                     }
                     tagService.updateById(tag);
                 } else {
@@ -251,20 +253,20 @@
 //            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return FAIL.setMsg(e.getMessage());
             } finally {
-                try {
-                    // 淇濆瓨鎺ュ彛鏃ュ織
-                    apiLogService.save(
-                            "杞鏁版嵁",
-                            URL + inaddress,
-                            null,
-                            "127.0.0.1",
-                            add,
-                            response,
-                            success
-                    );
-                } catch (Exception e) {
-                    log.error("", e);
-                }
+//                try {
+//                    // 淇濆瓨鎺ュ彛鏃ュ織
+//                    apiLogService.save(
+//                            "杞鏁版嵁",
+//                            URL + inaddress,
+//                            null,
+//                            "127.0.0.1",
+//                            add,
+//                            response,
+//                            success
+//                    );
+//                } catch (Exception e) {
+//                    log.error("", e);
+//                }
             }
         }
         return SUCCESS;

--
Gitblit v1.9.1