Selaa lähdekoodia

Merge remote-tracking branch 'origin/freeze231204' into uat

njs 1 vuosi sitten
vanhempi
commit
4a38070e86

+ 9 - 9
suishenbang-sync/suishenbang-sync-common/src/main/java/com/dgtly/sync/service/HanaOrderComponent.java

@@ -400,14 +400,14 @@ public class HanaOrderComponent {
     /**HANA已冻结经销商**/
     public void hanaFreezeCustomer()throws Exception{
         Connection con = this.getHanaConnection();
-        PreparedStatement pstmt = con.prepareStatement("SELECT  KUNNR,VTWEG FROM ERP.KNVV  WHERE KVGR3 = 'D03'  and (LIFSD IS NULL or LIFSD = '') AND VTWEG = 'D9' union all \n" +
-                "\t SELECT  KUNNR,\n" +
-                "\t VTWEG \n" +
-                "FROM ERP.KNVV \n" +
-                "WHERE\n" +
-                "\t SPART = (case   when  SPART='14' then '14'\n" +
-                "\t when SPART='15' then '15'\n" +
-                "\t else  '16' end )   and (LIFSD IS NULL or LIFSD = '')  AND VTWEG = 'D9'and VKORG = 'S200' and KVGR3 not in ('D03') ");
+        PreparedStatement pstmt = con.prepareStatement(" SELECT   KUNNR, \n" +
+                "                 SPART  \n" +
+                "                FROM ERP.KNVV  \n" +
+                "                WHERE \n" +
+                "                 (SPART = (case   when  SPART='14' then '14' \n" +
+                "                 when SPART='15' then '15' \n" +
+                "                 else  '16' end )   and (LIFSD IS NULL or LIFSD = '')  AND VTWEG = 'D9'and VKORG = 'S200' and KVGR3 not in ('D03')) or (KVGR3 = 'D03'  and (LIFSD IS NULL or LIFSD = '') AND VTWEG = 'D9' ) \n" +
+                "         group by KUNNR order by SPART asc ");
         Long startTime = System.currentTimeMillis();
         ResultSet rs = pstmt.executeQuery();
         Long endTime = System.currentTimeMillis();
@@ -616,7 +616,7 @@ public class HanaOrderComponent {
 
                 fw.write(
                         result.getString("KUNNR")
-                           +"$$"+result.getString("VTWEG")
+                           +"$$"+result.getString("SPART")
                             +"\r\n");
                 fw.flush();
                 i++;