Przeglądaj źródła

2023-05-17 性能优化

shenliang 1 rok temu
rodzic
commit
8f3a286977

+ 19 - 18
src/main/java/com/uas/eis/serviceImpl/InsertServiceImpl.java

@@ -275,29 +275,29 @@ public class InsertServiceImpl implements InsertService {
                     }
 //
 
+                if(trimNull(trades.get(i).getStatus() )!="TRADE_NO_CREATE_PAY"
+                        &&trimNull(trades.get(i).getStatus() )!="WAIT_BUYER_PAY"
+                        &&trimNull(trades.get(i).getStatus() )!="PAY_PENDING"
+                        &&trimNull(trades.get(i).getStatus() )!="WAIT_BUYER_CONFIRM_GOODS"
+                        &&trimNull(trades.get(i).getStatus() )!="TRADE_CLOSED_BY_TAOBAO"
+                        &&trimNull(trades.get(i).getStatus() )!="TRADE_CLOSED"
+                        &&trimNull(trades.get(i).getStatus() )!="TRADE_FINISHED") {
 
                     String INSERTSALESql = "insert into sale( SA_ISUPDATE,SA_DISCOUNTFEE,SA_TRADESTATUS, sa_sellernick,sa_custcode,sa_paymentscode,SA_TAOBAOID,sa_payments,sa_custname,sa_kind,sa_wwh_user,sa_need15,sa_id,sa_tradeid,sa_code,sa_date,sa_recorder,sa_recorddate,sa_currency,sa_rate" +
                             ",sa_apcustname,sa_need9,sa_toplace" +
                             ",sa_transport,sa_seller,sa_updatedate" +
                             ",sa_enddate,sa_statuscode,sa_status,sa_fare,sa_total" +
                             ",sa_recamount,sa_plandelivery,sa_printstatuscode,sa_remark)" +
-                            "  SELECT   1,"+trades.get(i).getDiscountFee() +",'"+trimNull(trades.get(i).getStatus() )+"','" + trimNull(trades.get(i).getSellerNick() ) + " ', 'GN0008358','P001', "   + trades.get(i).getTid() + " , '现结','HLK淘宝','国内标准销售订单', ' " +trimNull( name_oaid ) + "  ' , ' " + trimNull( receiver_mobile ) + " ' , " + said + "," + trades.get(i).getTid() + "," + trades.get(i).getTid()
+                            "  SELECT   1," + trades.get(i).getDiscountFee() + ",'" + trimNull(trades.get(i).getStatus()) + "',replace( nvl( '" + trimNull(trades.get(i).getSellerNick()) + " ' ,'静夜思solong'),' ',''), 'GN0008358','P001', " + trades.get(i).getTid() + " , '现结','HLK淘宝','国内标准销售订单', ' " + trimNull(name_oaid) + "  ' , ' " + trimNull(receiver_mobile) + " ' , " + said + "," + trades.get(i).getTid() + "," + trades.get(i).getTid()
                             + " , to_date (  '" + end_time + "' ,'YYYY-MM-DD hh24:mi:ss') , '管理员',sysdate,'RMB','1','"
-                            + trimNull(name_oaid )+ "','" + trimNull( trades.get(i).getBuyerNick() )+ "','" + address.replaceAll("'","") + "  ', '  "
-                            + trimNull( trades.get(i).getShippingType() ) + "  ', ' " + trimNull (trades.get(i).getO2oGuideName() ) + "  ', to_date ( '" + modified
-                            + "','YYYY-MM-DD hh24:mi:ss') , to_date ( '" +end_time + "','YYYY-MM-DD hh24:mi:ss') ,'ENTERING','在录入'," + trimNull( trades.get(i).getPostFee() )+ "," +trimNull( trades.get(i).getPayment() ) + ","
-                            + trimNull(trades.get(i).getPayment() ) + " , to_date ( '" +consigntime + "','YYYY-MM-DD hh24:mi:ss') ,'unprint', '淘宝自动抓取'   FROM DUAL  " +
-                            " WHERE '" + trimNull(trades.get(i).getStatus() )  + "' NOT IN  ( 'TRADE_NO_CREATE_PAY','WAIT_BUYER_PAY','PAY_PENDING' )    AND  NOT EXISTS ( select sa_id from sale WHERE SA_iD=" + said +  " )   AND  NOT EXISTS ( select SA_CODE from sale WHERE SA_CODE= '" +  trades.get(i).getTid() +  "'  )    AND  NOT EXISTS ( select SA_TAOBAOID from sale WHERE SA_TAOBAOID=" + trades.get(i).getTid() + "   )  ";
+                            + trimNull(name_oaid) + "','" + trimNull(trades.get(i).getBuyerNick()) + "','" + address.replaceAll("'", "") + "  ', '  "
+                            + trimNull(trades.get(i).getShippingType()) + "  ', ' " + trimNull(trades.get(i).getO2oGuideName()) + "  ', to_date ( '" + modified
+                            + "','YYYY-MM-DD hh24:mi:ss') , to_date ( '" + end_time + "','YYYY-MM-DD hh24:mi:ss') ,'ENTERING','在录入'," + trimNull(trades.get(i).getPostFee()) + "," + trimNull(trades.get(i).getPayment()) + ","
+                            + trimNull(trades.get(i).getPayment()) + " , to_date ( '" + consigntime + "','YYYY-MM-DD hh24:mi:ss') ,'unprint', '淘宝自动抓取'   FROM DUAL  " +
+                            " WHERE   NOT EXISTS ( select 1 from sale WHERE SA_TAOBAOID=" + trades.get(i).getTid() + "   )  ";
                     insertSqlsList.add(INSERTSALESql);
 
-//                    try{
-//                        baseDao.execute(INSERTSALESql);
-//
-//
-//                    }catch (Exception e) {
-//                        System.out.println(INSERTSALESql);
-//                        logger.info( e.getMessage() );
-//                    }
+
 
 
                     List<Order> orders = trades.get(i).getOrders();
@@ -309,15 +309,16 @@ public class InsertServiceImpl implements InsertService {
 
                         String INSERTSALEDETAILSql = "insert into saledetail(SD_PROPERTIES,sd_remark,sd_id,sd_said,sd_code,sd_detno,sd_prodcode,sd_qty,sd_price,sd_total" +
                                 ",sd_statuscode,sd_status,sd_discount,SD_DIVIDE_ORDER_FEE,SD_PART_MJZ_DISCOUNT )" +
-                                "  SELECT  ' " + trimNull ( orders.get(j).getSkuPropertiesName() ) + " ' ,  ' " + orders.get(j).getTitle() + " ' , "  + sdid + " ," + said + "  ,' " +  sdid + " '," + k + ",'" + trimNull(orders.get(j).getOuterIid()) + "'," + orders.get(j).getNum() + "," + orders.get(j).getPrice() + " ," + orders.get(j).getPayment() +
-                                ",'ENTERING','在录入', " + orders.get(j).getDiscountFee()  +","+orders.get(j).getDivideOrderFee()  +","+orders.get(j).getPartMjzDiscount()  + " FROM DUAL   WHERE NOT EXISTS ( select sd_id from saledetail " +
-                                "WHERE  '" + trimNull(trades.get(i).getStatus() )  + "' NOT IN  ( 'TRADE_NO_CREATE_PAY','WAIT_BUYER_PAY','PAY_PENDING' )    AND  sd_id=" + sdid + "  )  AND  NOT EXISTS ( select sd_id from  sale left join  saledetail on sa_id=sd_said " +
-                                "WHERE SA_TAOBAOID = " + trades.get(i).getTid() +  "  and sd_detno = "  + k +" )  ";
+                                "  SELECT  ' " + trimNull(orders.get(j).getSkuPropertiesName()) + " ' ,  ' " + orders.get(j).getTitle() + " ' , " + sdid + " ," + said + "  ,' " + trades.get(i).getTid() + " '," + k + ",'" + trimNull(orders.get(j).getOuterIid()) + "'," + orders.get(j).getNum() + "," + orders.get(j).getPrice() + " ," + orders.get(j).getPayment() +
+                                ",'ENTERING','在录入', " + orders.get(j).getDiscountFee() + "," + orders.get(j).getDivideOrderFee() + "," + orders.get(j).getPartMjzDiscount() + " FROM DUAL   WHERE  NOT EXISTS ( select sd_id from  sale left join  saledetail on sa_id=sd_said " +
+                                "WHERE SA_TAOBAOID = " + trades.get(i).getTid() + "  and sd_detno = " + k + " )  ";
                         insertSqlsList.add(INSERTSALEDETAILSql);
                     }
 
                 }
 
+                }
+
 
             }