|
@@ -437,14 +437,14 @@
|
|
<notepads>
|
|
<notepads>
|
|
</notepads>
|
|
</notepads>
|
|
<connection>
|
|
<connection>
|
|
- <name>MallSqlserver</name>
|
|
|
|
|
|
+ <name>mall</name>
|
|
<server>192.168.50.32</server>
|
|
<server>192.168.50.32</server>
|
|
<type>MSSQLNATIVE</type>
|
|
<type>MSSQLNATIVE</type>
|
|
<access>Native</access>
|
|
<access>Native</access>
|
|
<database>Mall</database>
|
|
<database>Mall</database>
|
|
<port>1433</port>
|
|
<port>1433</port>
|
|
<username>sa</username>
|
|
<username>sa</username>
|
|
- <password>Encrypted 2be98afc819c69e8ea300ff228dd38f99</password>
|
|
|
|
|
|
+ <password>Encrypted 2be98afc86aa7f297aa15a478c7d38f99</password>
|
|
<servername/>
|
|
<servername/>
|
|
<data_tablespace/>
|
|
<data_tablespace/>
|
|
<index_tablespace/>
|
|
<index_tablespace/>
|
|
@@ -457,10 +457,18 @@
|
|
<code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
|
|
<code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
|
|
<attribute>N</attribute>
|
|
<attribute>N</attribute>
|
|
</attribute>
|
|
</attribute>
|
|
|
|
+ <attribute>
|
|
|
|
+ <code>INITIAL_POOL_SIZE</code>
|
|
|
|
+ <attribute>30</attribute>
|
|
|
|
+ </attribute>
|
|
<attribute>
|
|
<attribute>
|
|
<code>IS_CLUSTERED</code>
|
|
<code>IS_CLUSTERED</code>
|
|
<attribute>N</attribute>
|
|
<attribute>N</attribute>
|
|
</attribute>
|
|
</attribute>
|
|
|
|
+ <attribute>
|
|
|
|
+ <code>MAXIMUM_POOL_SIZE</code>
|
|
|
|
+ <attribute>1000</attribute>
|
|
|
|
+ </attribute>
|
|
<attribute>
|
|
<attribute>
|
|
<code>MSSQLUseIntegratedSecurity</code>
|
|
<code>MSSQLUseIntegratedSecurity</code>
|
|
<attribute>false</attribute>
|
|
<attribute>false</attribute>
|
|
@@ -491,16 +499,31 @@
|
|
</attribute>
|
|
</attribute>
|
|
<attribute>
|
|
<attribute>
|
|
<code>USE_POOLING</code>
|
|
<code>USE_POOLING</code>
|
|
- <attribute>N</attribute>
|
|
|
|
|
|
+ <attribute>Y</attribute>
|
|
</attribute>
|
|
</attribute>
|
|
</attributes>
|
|
</attributes>
|
|
</connection>
|
|
</connection>
|
|
<order>
|
|
<order>
|
|
<hop>
|
|
<hop>
|
|
- <from>表输入 2</from>
|
|
|
|
|
|
+ <from>表输入 1</from>
|
|
|
|
+ <to>Java 代码</to>
|
|
|
|
+ <enabled>Y</enabled>
|
|
|
|
+ </hop>
|
|
|
|
+ <hop>
|
|
|
|
+ <from>Java 代码</from>
|
|
<to>Elasticsearch bulk insert 2</to>
|
|
<to>Elasticsearch bulk insert 2</to>
|
|
<enabled>Y</enabled>
|
|
<enabled>Y</enabled>
|
|
</hop>
|
|
</hop>
|
|
|
|
+ <hop>
|
|
|
|
+ <from>表输入 2</from>
|
|
|
|
+ <to>Java 代码</to>
|
|
|
|
+ <enabled>Y</enabled>
|
|
|
|
+ </hop>
|
|
|
|
+ <hop>
|
|
|
|
+ <from>表输入 3</from>
|
|
|
|
+ <to>Java 代码</to>
|
|
|
|
+ <enabled>Y</enabled>
|
|
|
|
+ </hop>
|
|
</order>
|
|
</order>
|
|
<step>
|
|
<step>
|
|
<name>Elasticsearch bulk insert 2</name>
|
|
<name>Elasticsearch bulk insert 2</name>
|
|
@@ -508,22 +531,22 @@
|
|
<description/>
|
|
<description/>
|
|
<distribute>Y</distribute>
|
|
<distribute>Y</distribute>
|
|
<custom_distribution/>
|
|
<custom_distribution/>
|
|
- <copies>30</copies>
|
|
|
|
|
|
+ <copies>1</copies>
|
|
<partitioning>
|
|
<partitioning>
|
|
<method>none</method>
|
|
<method>none</method>
|
|
<schema_name/>
|
|
<schema_name/>
|
|
</partitioning>
|
|
</partitioning>
|
|
<general>
|
|
<general>
|
|
- <index>crm_memberext_temp</index>
|
|
|
|
|
|
+ <index>crm_memberext_temp_orderkey_v1</index>
|
|
<type>_doc</type>
|
|
<type>_doc</type>
|
|
- <batchSize>3</batchSize>
|
|
|
|
|
|
+ <batchSize>150</batchSize>
|
|
<timeout>100</timeout>
|
|
<timeout>100</timeout>
|
|
<timeoutUnit>SECONDS</timeoutUnit>
|
|
<timeoutUnit>SECONDS</timeoutUnit>
|
|
<isJson>N</isJson>
|
|
<isJson>N</isJson>
|
|
- <idField>MemKey</idField>
|
|
|
|
- <overwriteIfExists>Y</overwriteIfExists>
|
|
|
|
|
|
+ <idField>OrderKey</idField>
|
|
|
|
+ <overwriteIfExists>N</overwriteIfExists>
|
|
<useOutput>N</useOutput>
|
|
<useOutput>N</useOutput>
|
|
- <stopOnError>Y</stopOnError>
|
|
|
|
|
|
+ <stopOnError>N</stopOnError>
|
|
</general>
|
|
</general>
|
|
<fields>
|
|
<fields>
|
|
<field>
|
|
<field>
|
|
@@ -559,8 +582,8 @@
|
|
<targetName>AgainOrderCount</targetName>
|
|
<targetName>AgainOrderCount</targetName>
|
|
</field>
|
|
</field>
|
|
<field>
|
|
<field>
|
|
- <columnName>Age</columnName>
|
|
|
|
- <targetName>Age</targetName>
|
|
|
|
|
|
+ <columnName>BirthDay</columnName>
|
|
|
|
+ <targetName>BirthDay</targetName>
|
|
</field>
|
|
</field>
|
|
<field>
|
|
<field>
|
|
<columnName>BusinessId</columnName>
|
|
<columnName>BusinessId</columnName>
|
|
@@ -598,14 +621,6 @@
|
|
<columnName>CustomerName</columnName>
|
|
<columnName>CustomerName</columnName>
|
|
<targetName>CustomerName</targetName>
|
|
<targetName>CustomerName</targetName>
|
|
</field>
|
|
</field>
|
|
- <field>
|
|
|
|
- <columnName>DataId</columnName>
|
|
|
|
- <targetName>DataId</targetName>
|
|
|
|
- </field>
|
|
|
|
- <field>
|
|
|
|
- <columnName>DataName</columnName>
|
|
|
|
- <targetName>DataName</targetName>
|
|
|
|
- </field>
|
|
|
|
<field>
|
|
<field>
|
|
<columnName>DeliveryType</columnName>
|
|
<columnName>DeliveryType</columnName>
|
|
<targetName>DeliveryType</targetName>
|
|
<targetName>DeliveryType</targetName>
|
|
@@ -626,10 +641,6 @@
|
|
<columnName>DeviceType</columnName>
|
|
<columnName>DeviceType</columnName>
|
|
<targetName>DeviceType</targetName>
|
|
<targetName>DeviceType</targetName>
|
|
</field>
|
|
</field>
|
|
- <field>
|
|
|
|
- <columnName>Discountprice</columnName>
|
|
|
|
- <targetName>Discountprice</targetName>
|
|
|
|
- </field>
|
|
|
|
<field>
|
|
<field>
|
|
<columnName>DiseaseClassCode</columnName>
|
|
<columnName>DiseaseClassCode</columnName>
|
|
<targetName>DiseaseClassCode</targetName>
|
|
<targetName>DiseaseClassCode</targetName>
|
|
@@ -638,14 +649,6 @@
|
|
<columnName>HuaWuOriginType</columnName>
|
|
<columnName>HuaWuOriginType</columnName>
|
|
<targetName>HuaWuOriginType</targetName>
|
|
<targetName>HuaWuOriginType</targetName>
|
|
</field>
|
|
</field>
|
|
- <field>
|
|
|
|
- <columnName>Id</columnName>
|
|
|
|
- <targetName>Id</targetName>
|
|
|
|
- </field>
|
|
|
|
- <field>
|
|
|
|
- <columnName>InitSum</columnName>
|
|
|
|
- <targetName>InitSum</targetName>
|
|
|
|
- </field>
|
|
|
|
<field>
|
|
<field>
|
|
<columnName>InventoryAuditDate</columnName>
|
|
<columnName>InventoryAuditDate</columnName>
|
|
<targetName>InventoryAuditDate</targetName>
|
|
<targetName>InventoryAuditDate</targetName>
|
|
@@ -802,10 +805,6 @@
|
|
<columnName>PreferentialRate</columnName>
|
|
<columnName>PreferentialRate</columnName>
|
|
<targetName>PreferentialRate</targetName>
|
|
<targetName>PreferentialRate</targetName>
|
|
</field>
|
|
</field>
|
|
- <field>
|
|
|
|
- <columnName>ProductCost</columnName>
|
|
|
|
- <targetName>ProductCost</targetName>
|
|
|
|
- </field>
|
|
|
|
<field>
|
|
<field>
|
|
<columnName>ProductLine</columnName>
|
|
<columnName>ProductLine</columnName>
|
|
<targetName>ProductLine</targetName>
|
|
<targetName>ProductLine</targetName>
|
|
@@ -814,18 +813,10 @@
|
|
<columnName>ReceivingTime</columnName>
|
|
<columnName>ReceivingTime</columnName>
|
|
<targetName>ReceivingTime</targetName>
|
|
<targetName>ReceivingTime</targetName>
|
|
</field>
|
|
</field>
|
|
- <field>
|
|
|
|
- <columnName>Reducing</columnName>
|
|
|
|
- <targetName>Reducing</targetName>
|
|
|
|
- </field>
|
|
|
|
<field>
|
|
<field>
|
|
<columnName>RegionCode</columnName>
|
|
<columnName>RegionCode</columnName>
|
|
<targetName>RegionCode</targetName>
|
|
<targetName>RegionCode</targetName>
|
|
</field>
|
|
</field>
|
|
- <field>
|
|
|
|
- <columnName>SDataId</columnName>
|
|
|
|
- <targetName>SDataId</targetName>
|
|
|
|
- </field>
|
|
|
|
<field>
|
|
<field>
|
|
<columnName>ShippingNo</columnName>
|
|
<columnName>ShippingNo</columnName>
|
|
<targetName>ShippingNo</targetName>
|
|
<targetName>ShippingNo</targetName>
|
|
@@ -842,10 +833,6 @@
|
|
<columnName>SubProductLine</columnName>
|
|
<columnName>SubProductLine</columnName>
|
|
<targetName>SubProductLine</targetName>
|
|
<targetName>SubProductLine</targetName>
|
|
</field>
|
|
</field>
|
|
- <field>
|
|
|
|
- <columnName>Sum</columnName>
|
|
|
|
- <targetName>Sum</targetName>
|
|
|
|
- </field>
|
|
|
|
<field>
|
|
<field>
|
|
<columnName>SyncStatus</columnName>
|
|
<columnName>SyncStatus</columnName>
|
|
<targetName>SyncStatus</targetName>
|
|
<targetName>SyncStatus</targetName>
|
|
@@ -857,7 +844,7 @@
|
|
</fields>
|
|
</fields>
|
|
<servers>
|
|
<servers>
|
|
<server>
|
|
<server>
|
|
- <address>192.168.50.32</address>
|
|
|
|
|
|
+ <address>192.168.50.34</address>
|
|
<port>9300</port>
|
|
<port>9300</port>
|
|
</server>
|
|
</server>
|
|
</servers>
|
|
</servers>
|
|
@@ -868,23 +855,42 @@
|
|
</setting>
|
|
</setting>
|
|
<setting>
|
|
<setting>
|
|
<name>custom.aliase.source</name>
|
|
<name>custom.aliase.source</name>
|
|
- <value>mem_memberext_temp</value>
|
|
|
|
|
|
+ <value>mem_memberexts_temp</value>
|
|
</setting>
|
|
</setting>
|
|
<setting>
|
|
<setting>
|
|
- <name>custom.fields.HasOrder</name>
|
|
|
|
- <value>{"type":"boolean"}</value>
|
|
|
|
|
|
+ <name>custom.fields.BirthDay</name>
|
|
|
|
+ <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
|
|
</setting>
|
|
</setting>
|
|
<setting>
|
|
<setting>
|
|
- <name>custom.fields.MemDesc</name>
|
|
|
|
- <value>{"type":"text","analyzer": "ik_smart",
|
|
|
|
-"search_analyzer":"ik_smart","index":true}</value>
|
|
|
|
|
|
+ <name>custom.fields.CreationDate</name>
|
|
|
|
+ <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
|
|
</setting>
|
|
</setting>
|
|
<setting>
|
|
<setting>
|
|
- <name>custom.fields.MemberBirthday</name>
|
|
|
|
|
|
+ <name>custom.fields.InventoryAuditDate</name>
|
|
<value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
|
|
<value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
|
|
</setting>
|
|
</setting>
|
|
<setting>
|
|
<setting>
|
|
- <name>custom.fields.RegisterTime</name>
|
|
|
|
|
|
+ <name>custom.fields.LastModified</name>
|
|
|
|
+ <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
|
|
|
|
+ </setting>
|
|
|
|
+ <setting>
|
|
|
|
+ <name>custom.fields.OrderProcessDate</name>
|
|
|
|
+ <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
|
|
|
|
+ </setting>
|
|
|
|
+ <setting>
|
|
|
|
+ <name>custom.fields.OrderTime</name>
|
|
|
|
+ <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
|
|
|
|
+ </setting>
|
|
|
|
+ <setting>
|
|
|
|
+ <name>custom.fields.PreferentialRate</name>
|
|
|
|
+ <value>{"type":"double"}</value>
|
|
|
|
+ </setting>
|
|
|
|
+ <setting>
|
|
|
|
+ <name>custom.fields.ReceivingTime</name>
|
|
|
|
+ <value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
|
|
|
|
+ </setting>
|
|
|
|
+ <setting>
|
|
|
|
+ <name>custom.fields.ShippingTime</name>
|
|
<value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
|
|
<value>{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"}</value>
|
|
</setting>
|
|
</setting>
|
|
<setting>
|
|
<setting>
|
|
@@ -906,7 +912,341 @@
|
|
</remotesteps>
|
|
</remotesteps>
|
|
<GUI>
|
|
<GUI>
|
|
<xloc>480</xloc>
|
|
<xloc>480</xloc>
|
|
- <yloc>96</yloc>
|
|
|
|
|
|
+ <yloc>32</yloc>
|
|
|
|
+ <draw>Y</draw>
|
|
|
|
+ </GUI>
|
|
|
|
+ </step>
|
|
|
|
+ <step>
|
|
|
|
+ <name>Java 代码</name>
|
|
|
|
+ <type>UserDefinedJavaClass</type>
|
|
|
|
+ <description/>
|
|
|
|
+ <distribute>Y</distribute>
|
|
|
|
+ <custom_distribution/>
|
|
|
|
+ <copies>1</copies>
|
|
|
|
+ <partitioning>
|
|
|
|
+ <method>none</method>
|
|
|
|
+ <schema_name/>
|
|
|
|
+ </partitioning>
|
|
|
|
+ <definitions>
|
|
|
|
+ <definition>
|
|
|
|
+ <class_type>TRANSFORM_CLASS</class_type>
|
|
|
|
+ <class_name>Processor</class_name>
|
|
|
|
+ <class_source>import java.sql.*;
|
|
|
|
+import org.pentaho.di.core.database.*;
|
|
|
|
+
|
|
|
|
+import org.apache.http.HttpHost;
|
|
|
|
+import org.elasticsearch.ElasticsearchException;
|
|
|
|
+import org.elasticsearch.action.get.GetRequest;
|
|
|
|
+import org.elasticsearch.action.get.GetResponse;
|
|
|
|
+import org.elasticsearch.client.RestHighLevelClient;
|
|
|
|
+import org.elasticsearch.client.RequestOptions;
|
|
|
|
+import org.elasticsearch.client.RestClient;
|
|
|
|
+import org.elasticsearch.common.Strings;
|
|
|
|
+import org.elasticsearch.rest.RestStatus;
|
|
|
|
+import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
|
|
|
|
+
|
|
|
|
+import org.elasticsearch.action.update.UpdateRequest;
|
|
|
|
+import org.elasticsearch.action.update.UpdateResponse;
|
|
|
|
+
|
|
|
|
+import org.elasticsearch.common.xcontent.XContentBuilder;
|
|
|
|
+import org.elasticsearch.common.xcontent.XContentFactory;
|
|
|
|
+import org.elasticsearch.script.Script;
|
|
|
|
+
|
|
|
|
+import java.lang.reflect.InvocationTargetException;
|
|
|
|
+import java.lang.reflect.Method;
|
|
|
|
+import com.microsoft.sqlserver.jdbc.SQLServerException;
|
|
|
|
+
|
|
|
|
+Database database = null;
|
|
|
|
+PreparedStatement stat = null;
|
|
|
|
+PreparedStatement stat1 = null;
|
|
|
|
+
|
|
|
|
+RestHighLevelClient client = new RestHighLevelClient(
|
|
|
|
+ RestClient.builder(
|
|
|
|
+ new HttpHost[]{new HttpHost("192.168.50.34", 9200, "http")}));
|
|
|
|
+Integer index = 0;
|
|
|
|
+public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
|
|
|
|
+{
|
|
|
|
+ //logBasic("start---");
|
|
|
|
+ String type = getVariable("type");
|
|
|
|
+ String indexs = getVariable("index");
|
|
|
|
+ //if (indexs != null) index = Integer.parseInt(indexs);
|
|
|
|
+
|
|
|
|
+ Object[] r = getRow();
|
|
|
|
+ if (r == null) {
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ if (stat!=null) {
|
|
|
|
+ stat.close();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (stat1!=null) {
|
|
|
|
+ stat1.close();
|
|
|
|
+ }
|
|
|
|
+ if (database!=null) {
|
|
|
|
+ database.disconnect();
|
|
|
|
+ }
|
|
|
|
+ if(client!=null){
|
|
|
|
+ client.close();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch(Exception e) {
|
|
|
|
+ throw new KettleException(e);
|
|
|
|
+ }
|
|
|
|
+ setOutputDone();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ synchronized(this) {
|
|
|
|
+
|
|
|
|
+ r = createOutputRow(r, data.outputRowMeta.size());
|
|
|
|
+ //获取数据库名和表名
|
|
|
|
+ String dbName = "MemberSqlServer";//getInputRowMeta().getString(r, "conname", null );
|
|
|
|
+ String tablename = "DataImport_membase";//getInputRowMeta().getString(r, "tablename", null );
|
|
|
|
+ String idname = "MemberKey";//getInputRowMeta().getString(r, "idname", null );
|
|
|
|
+ String idname1 = "MemPhone1";//getInputRowMeta().getString(r, "idname", null );
|
|
|
|
+ String idname2 = "MemPhone2";//getInputRowMeta().getString(r, "idname", null );
|
|
|
|
+ String idname3 = "MemPhone3";//getInputRowMeta().getString(r, "idname", null );
|
|
|
|
+
|
|
|
|
+ String sourceidname = "OrderKey";//getInputRowMeta().getString(r, "sourceidname", null );
|
|
|
|
+ String sourcetablename = "Orders";//getInputRowMeta().getString(r, "sourcetablename", null );
|
|
|
|
+ if (dbName==null||tablename==null) {
|
|
|
|
+ throw new KettleException("Unable to find field with name "+tablename+" in the input row.");
|
|
|
|
+ }
|
|
|
|
+ //logBasic("table---"+tablename);
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+if(database == null){
|
|
|
|
+//数据库连接
|
|
|
|
+ DatabaseMeta databaseMeta=null;
|
|
|
|
+ try {
|
|
|
|
+ databaseMeta = getTransMeta().findDatabase(dbName);
|
|
|
|
+ if (databaseMeta==null) {
|
|
|
|
+ logError("A connection with name "+dbName+" could not be found!");
|
|
|
|
+ setErrors(1);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ database = new Database(getTrans(), databaseMeta);
|
|
|
|
+ database.connect();
|
|
|
|
+ //logBasic("success!");
|
|
|
|
+ } catch(Exception e) {
|
|
|
|
+ logError("Connecting to database "+dbName+" failed.", e);
|
|
|
|
+ setErrors(1);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+*/
|
|
|
|
+
|
|
|
|
+//查询表数据
|
|
|
|
+ try {
|
|
|
|
+ RowMetaInterface idxRowMeta =data.outputRowMeta;
|
|
|
|
+
|
|
|
|
+ int i=0;
|
|
|
|
+
|
|
|
|
+ r = createOutputRow(r, data.outputRowMeta.size());
|
|
|
|
+
|
|
|
|
+ //int index = getInputRowMeta().size();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // Add the index name
|
|
|
|
+ //
|
|
|
|
+ String Id = idxRowMeta.getString(r, idname, null);
|
|
|
|
+ String Id1 = idxRowMeta.getString(r, idname1, null);
|
|
|
|
+ String Id2 = idxRowMeta.getString(r, idname2, null);
|
|
|
|
+ String Id3 = idxRowMeta.getString(r, idname3, null);
|
|
|
|
+
|
|
|
|
+ // Add the column name
|
|
|
|
+
|
|
|
|
+ String DataId = idxRowMeta.getString(r, sourceidname, null);
|
|
|
|
+
|
|
|
|
+ Thread.sleep(100);
|
|
|
|
+ /*
|
|
|
|
+ GetRequest getRequest = new GetRequest(
|
|
|
|
+ "crm_memberext_temp_orderkey_v1", // Index
|
|
|
|
+ "_doc", // /Type
|
|
|
|
+ DataId); // Document id
|
|
|
|
+ getRequest.fetchSourceContext(new FetchSourceContext(false)); // 禁用 _source 字段
|
|
|
|
+ getRequest.storedFields(new String[]{"_none_"}); // 禁止存储任何字段
|
|
|
|
+ boolean exists = client.exists(getRequest,RequestOptions.DEFAULT);
|
|
|
|
+ //client.close();
|
|
|
|
+ if(exists ){
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //logBasic("idxRow--Id"+Id);
|
|
|
|
+ //logBasic("idxRow--sourcetablename"+sourcetablename);
|
|
|
|
+ //logBasic("idxRow--DataId"+DataId);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //Integer pn = Integer.parseInt(Id);
|
|
|
|
+ //Integer curpageNum = Integer.parseInt(Id) % pagesize;
|
|
|
|
+ //if(pn > 0 && curpageNum == 0){
|
|
|
|
+ // setVariable("page",String.valueOf(page));
|
|
|
|
+ //}
|
|
|
|
+ //logBasic("idxRow--getVariable"+getVariable("page"));
|
|
|
|
+ //logBasic("idxRow--curpageNum"+curpageNum);
|
|
|
|
+
|
|
|
|
+ //logBasic("idxRow--length"+i);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ catch(SQLServerException e) {
|
|
|
|
+ return true;
|
|
|
|
+ }catch(Exception e) {
|
|
|
|
+
|
|
|
|
+ throw new KettleException(e);
|
|
|
|
+ }
|
|
|
|
+ //释放连接
|
|
|
|
+ //if (database!=null) {
|
|
|
|
+ // database.disconnect();
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ // Send the row on to the next step.
|
|
|
|
+}
|
|
|
|
+ putRow(data.outputRowMeta, r);
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+}</class_source>
|
|
|
|
+ </definition>
|
|
|
|
+ </definitions>
|
|
|
|
+ <fields>
|
|
|
|
+ </fields>
|
|
|
|
+ <clear_result_fields>N</clear_result_fields>
|
|
|
|
+ <info_steps/>
|
|
|
|
+ <target_steps/>
|
|
|
|
+ <usage_parameters/>
|
|
|
|
+ <attributes/>
|
|
|
|
+ <cluster_schema/>
|
|
|
|
+ <remotesteps>
|
|
|
|
+ <input>
|
|
|
|
+ </input>
|
|
|
|
+ <output>
|
|
|
|
+ </output>
|
|
|
|
+ </remotesteps>
|
|
|
|
+ <GUI>
|
|
|
|
+ <xloc>368</xloc>
|
|
|
|
+ <yloc>48</yloc>
|
|
|
|
+ <draw>Y</draw>
|
|
|
|
+ </GUI>
|
|
|
|
+ </step>
|
|
|
|
+ <step>
|
|
|
|
+ <name>表输入 1</name>
|
|
|
|
+ <type>TableInput</type>
|
|
|
|
+ <description/>
|
|
|
|
+ <distribute>Y</distribute>
|
|
|
|
+ <custom_distribution/>
|
|
|
|
+ <copies>1</copies>
|
|
|
|
+ <partitioning>
|
|
|
|
+ <method>none</method>
|
|
|
|
+ <schema_name/>
|
|
|
|
+ </partitioning>
|
|
|
|
+ <connection>mall</connection>
|
|
|
|
+ <sql>
|
|
|
|
+SELECT
|
|
|
|
+ 1 as MemKey,
|
|
|
|
+ OrdersCode as OrderKey,
|
|
|
|
+ OrdersCode
|
|
|
|
+ ,
|
|
|
|
+ dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone1) as MemUsualPhone
|
|
|
|
+, convert(varchar(19),[CreationDate],120) as [CreationDate]
|
|
|
|
+, convert(varchar(19),[LastModified],120) as [LastModified]
|
|
|
|
+, AccountId
|
|
|
|
+, AccountName
|
|
|
|
+, Consignee as MemberNickName
|
|
|
|
+, DeliveryZipCode
|
|
|
|
+, Invoice
|
|
|
|
+, InvoiceNo
|
|
|
|
+, OrderNotes
|
|
|
|
+, PaymentType
|
|
|
|
+, DeliveryType
|
|
|
|
+, convert(varchar(19),[OrderTime],120) as [OrderTime]
|
|
|
|
+, convert(varchar(19),[ShippingTime],120) as [ShippingTime]
|
|
|
|
+, convert(varchar(19),[ReceivingTime],120) as [ReceivingTime]
|
|
|
|
+, ShippingNo
|
|
|
|
+, OrderStatus
|
|
|
|
+, IsReturn
|
|
|
|
+, TransportCosts
|
|
|
|
+, RegionCode
|
|
|
|
+, IsRxDrug
|
|
|
|
+, OriginType
|
|
|
|
+, OperateID
|
|
|
|
+, DeptId
|
|
|
|
+, DeptCode
|
|
|
|
+, BuyUserId
|
|
|
|
+, ProductLine
|
|
|
|
+, SubProductLine
|
|
|
|
+, DiseaseClassCode
|
|
|
|
+, convert(varchar(19),[Age],120) as [BirthDay]
|
|
|
|
+, Sex as MemberGender
|
|
|
|
+, SyncStatus
|
|
|
|
+, IsVisible
|
|
|
|
+, SourcePlatforms
|
|
|
|
+, DeviceType
|
|
|
|
+, IsReward
|
|
|
|
+, IsEmailmark
|
|
|
|
+, CustomerDataId
|
|
|
|
+, IsDrug
|
|
|
|
+, HuaWuOriginType
|
|
|
|
+, AgainOrderCount
|
|
|
|
+, ConfimLevel
|
|
|
|
+, BusinessId
|
|
|
|
+, IsPayByCard
|
|
|
|
+, PreferentialRate
|
|
|
|
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone1) as AConsigneePhone1
|
|
|
|
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone2) as AConsigneePhone2
|
|
|
|
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone3) as AConsigneePhone3
|
|
|
|
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',ADeliveryAddress) as ADeliveryAddress
|
|
|
|
+, IsDealWith
|
|
|
|
+, IsNewOrder
|
|
|
|
+, ConsigneeType
|
|
|
|
+, CustomerCode
|
|
|
|
+, CustomerName
|
|
|
|
+, InvoiceContent
|
|
|
|
+, InvoiceContentType
|
|
|
|
+, OrdersType
|
|
|
|
+, LeverNumber
|
|
|
|
+, IsO2O
|
|
|
|
+, AdvancePayType
|
|
|
|
+, convert(varchar(19),[InventoryAuditDate],120) as [InventoryAuditDate]
|
|
|
|
+, convert(varchar(19),[OrderProcessDate],120) as [OrderProcessDate]
|
|
|
|
+, IsToERP
|
|
|
|
+, MerchantNote
|
|
|
|
+, OtherNote
|
|
|
|
+, IsPrescription
|
|
|
|
+, ConfirmId
|
|
|
|
+,
|
|
|
|
+ case when b0.Level= 3 then a.RegionCode else null end as MemUsualAreaCode,
|
|
|
|
+ case when b1.Level= 2 then b.ParentCode else b.AreaCode end as MemUsualCityCode,
|
|
|
|
+ case when c1.Level= 1 then c.ParentCode else c.AreaCode end as MemUsualProvinceCode
|
|
|
|
+FROM Orders a
|
|
|
|
+ left join Areamap b0 on b0.MappingCode=a.RegionCode
|
|
|
|
+ left join AreaRegion b on b.AreaCode=a.RegionCode left join Areamap b1 on b1.MappingCode=b.ParentCode
|
|
|
|
+ left join AreaRegion c on c.AreaCode=b.ParentCode left join Areamap c1 on c1.MappingCode=c.ParentCode
|
|
|
|
+where 1=1 and (AconsigneePhone1!='' and AconsigneePhone1 is not null)
|
|
|
|
+ and OrderTime > '2019-05-01 00:00:01'
|
|
|
|
+ --and datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-100),OrderTime )>0
|
|
|
|
+order by OrderTime desc
|
|
|
|
+--order by AConsigneePhone2 asc
|
|
|
|
+-- offset 4600 rows --fetch NEXT 2 rows only
|
|
|
|
+--offset ((524-1)*5000) rows --fetch next (10) rows only
|
|
|
|
+offset ((${mem_ext_temp_page1}-1)*${mem_ext_temp_pagesize1}) rows fetch next (${mem_ext_temp_pagesize1}) rows only</sql>
|
|
|
|
+ <limit>0</limit>
|
|
|
|
+ <lookup/>
|
|
|
|
+ <execute_each_row>N</execute_each_row>
|
|
|
|
+ <variables_active>Y</variables_active>
|
|
|
|
+ <lazy_conversion_active>N</lazy_conversion_active>
|
|
|
|
+ <attributes/>
|
|
|
|
+ <cluster_schema/>
|
|
|
|
+ <remotesteps>
|
|
|
|
+ <input>
|
|
|
|
+ </input>
|
|
|
|
+ <output>
|
|
|
|
+ </output>
|
|
|
|
+ </remotesteps>
|
|
|
|
+ <GUI>
|
|
|
|
+ <xloc>224</xloc>
|
|
|
|
+ <yloc>48</yloc>
|
|
<draw>Y</draw>
|
|
<draw>Y</draw>
|
|
</GUI>
|
|
</GUI>
|
|
</step>
|
|
</step>
|
|
@@ -921,17 +1261,13 @@
|
|
<method>none</method>
|
|
<method>none</method>
|
|
<schema_name/>
|
|
<schema_name/>
|
|
</partitioning>
|
|
</partitioning>
|
|
- <connection>MallSqlserver</connection>
|
|
|
|
|
|
+ <connection>mall</connection>
|
|
<sql>
|
|
<sql>
|
|
SELECT
|
|
SELECT
|
|
- row_number() over (order by AConsigneePhone2 asc ) as MemKey,
|
|
|
|
|
|
+ 1 as MemKey,
|
|
OrdersCode as OrderKey,
|
|
OrdersCode as OrderKey,
|
|
OrdersCode
|
|
OrdersCode
|
|
- ,case when AConsigneePhone2= '' then
|
|
|
|
-(case
|
|
|
|
- when AconsigneePhone1!='' then dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone1)
|
|
|
|
- else ''end)
|
|
|
|
- ELSE dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone2) end as MemUsualPhone
|
|
|
|
|
|
+ ,dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone2) as MemUsualPhone
|
|
, convert(varchar(19),[CreationDate],120) as [CreationDate]
|
|
, convert(varchar(19),[CreationDate],120) as [CreationDate]
|
|
, convert(varchar(19),[LastModified],120) as [LastModified]
|
|
, convert(varchar(19),[LastModified],120) as [LastModified]
|
|
, AccountId
|
|
, AccountId
|
|
@@ -1006,16 +1342,138 @@ FROM Orders a
|
|
left join Areamap b0 on b0.MappingCode=a.RegionCode
|
|
left join Areamap b0 on b0.MappingCode=a.RegionCode
|
|
left join AreaRegion b on b.AreaCode=a.RegionCode left join Areamap b1 on b1.MappingCode=b.ParentCode
|
|
left join AreaRegion b on b.AreaCode=a.RegionCode left join Areamap b1 on b1.MappingCode=b.ParentCode
|
|
left join AreaRegion c on c.AreaCode=b.ParentCode left join Areamap c1 on c1.MappingCode=c.ParentCode
|
|
left join AreaRegion c on c.AreaCode=b.ParentCode left join Areamap c1 on c1.MappingCode=c.ParentCode
|
|
-where 1=1 and (AconsigneePhone1!='' or AconsigneePhone2!='')
|
|
|
|
|
|
+where 1=1 and (AConsigneePhone2!='' and AConsigneePhone2 is not null)
|
|
|
|
+ and OrderTime > '2019-05-01 00:00:01'
|
|
|
|
+ --and datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-100),OrderTime )>0
|
|
|
|
+ order by OrderTime asc
|
|
--order by AConsigneePhone2 asc
|
|
--order by AConsigneePhone2 asc
|
|
- --offset 0 rows fetch NEXT 2 rows only
|
|
|
|
-
|
|
|
|
-order by AConsigneePhone2 asc
|
|
|
|
-offset ((524-1)*5000) rows --fetch next (10) rows only</sql>
|
|
|
|
|
|
+ --offset 8600 rows --fetch NEXT 2 rows only
|
|
|
|
+--offset ((524-1)*5000) rows --fetch next (10) rows only
|
|
|
|
+offset ((${mem_ext_temp_page2}-1)*${mem_ext_temp_pagesize2}) rows fetch next (${mem_ext_temp_pagesize2}) rows only</sql>
|
|
|
|
+ <limit>0</limit>
|
|
|
|
+ <lookup/>
|
|
|
|
+ <execute_each_row>N</execute_each_row>
|
|
|
|
+ <variables_active>Y</variables_active>
|
|
|
|
+ <lazy_conversion_active>N</lazy_conversion_active>
|
|
|
|
+ <attributes/>
|
|
|
|
+ <cluster_schema/>
|
|
|
|
+ <remotesteps>
|
|
|
|
+ <input>
|
|
|
|
+ </input>
|
|
|
|
+ <output>
|
|
|
|
+ </output>
|
|
|
|
+ </remotesteps>
|
|
|
|
+ <GUI>
|
|
|
|
+ <xloc>224</xloc>
|
|
|
|
+ <yloc>144</yloc>
|
|
|
|
+ <draw>Y</draw>
|
|
|
|
+ </GUI>
|
|
|
|
+ </step>
|
|
|
|
+ <step>
|
|
|
|
+ <name>表输入 3</name>
|
|
|
|
+ <type>TableInput</type>
|
|
|
|
+ <description/>
|
|
|
|
+ <distribute>Y</distribute>
|
|
|
|
+ <custom_distribution/>
|
|
|
|
+ <copies>1</copies>
|
|
|
|
+ <partitioning>
|
|
|
|
+ <method>none</method>
|
|
|
|
+ <schema_name/>
|
|
|
|
+ </partitioning>
|
|
|
|
+ <connection>mall</connection>
|
|
|
|
+ <sql>
|
|
|
|
+SELECT
|
|
|
|
+ 1 as MemKey,
|
|
|
|
+ OrdersCode as OrderKey,
|
|
|
|
+ OrdersCode
|
|
|
|
+ ,
|
|
|
|
+ dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone3) as MemUsualPhone
|
|
|
|
+, convert(varchar(19),[CreationDate],120) as [CreationDate]
|
|
|
|
+, convert(varchar(19),[LastModified],120) as [LastModified]
|
|
|
|
+, AccountId
|
|
|
|
+, AccountName
|
|
|
|
+, Consignee as MemberNickName
|
|
|
|
+, DeliveryZipCode
|
|
|
|
+, Invoice
|
|
|
|
+, InvoiceNo
|
|
|
|
+, OrderNotes
|
|
|
|
+, PaymentType
|
|
|
|
+, DeliveryType
|
|
|
|
+, convert(varchar(19),[OrderTime],120) as [OrderTime]
|
|
|
|
+, convert(varchar(19),[ShippingTime],120) as [ShippingTime]
|
|
|
|
+, convert(varchar(19),[ReceivingTime],120) as [ReceivingTime]
|
|
|
|
+, ShippingNo
|
|
|
|
+, OrderStatus
|
|
|
|
+, IsReturn
|
|
|
|
+, TransportCosts
|
|
|
|
+, RegionCode
|
|
|
|
+, IsRxDrug
|
|
|
|
+, OriginType
|
|
|
|
+, OperateID
|
|
|
|
+, DeptId
|
|
|
|
+, DeptCode
|
|
|
|
+, BuyUserId
|
|
|
|
+, ProductLine
|
|
|
|
+, SubProductLine
|
|
|
|
+, DiseaseClassCode
|
|
|
|
+, convert(varchar(19),[Age],120) as [BirthDay]
|
|
|
|
+, Sex as MemberGender
|
|
|
|
+, SyncStatus
|
|
|
|
+, IsVisible
|
|
|
|
+, SourcePlatforms
|
|
|
|
+, DeviceType
|
|
|
|
+, IsReward
|
|
|
|
+, IsEmailmark
|
|
|
|
+, CustomerDataId
|
|
|
|
+, IsDrug
|
|
|
|
+, HuaWuOriginType
|
|
|
|
+, AgainOrderCount
|
|
|
|
+, ConfimLevel
|
|
|
|
+, BusinessId
|
|
|
|
+, IsPayByCard
|
|
|
|
+, PreferentialRate
|
|
|
|
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone1) as AConsigneePhone1
|
|
|
|
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone2) as AConsigneePhone2
|
|
|
|
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',AConsigneePhone3) as AConsigneePhone3
|
|
|
|
+, dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',ADeliveryAddress) as ADeliveryAddress
|
|
|
|
+, IsDealWith
|
|
|
|
+, IsNewOrder
|
|
|
|
+, ConsigneeType
|
|
|
|
+, CustomerCode
|
|
|
|
+, CustomerName
|
|
|
|
+, InvoiceContent
|
|
|
|
+, InvoiceContentType
|
|
|
|
+, OrdersType
|
|
|
|
+, LeverNumber
|
|
|
|
+, IsO2O
|
|
|
|
+, AdvancePayType
|
|
|
|
+, convert(varchar(19),[InventoryAuditDate],120) as [InventoryAuditDate]
|
|
|
|
+, convert(varchar(19),[OrderProcessDate],120) as [OrderProcessDate]
|
|
|
|
+, IsToERP
|
|
|
|
+, MerchantNote
|
|
|
|
+, OtherNote
|
|
|
|
+, IsPrescription
|
|
|
|
+, ConfirmId
|
|
|
|
+,
|
|
|
|
+ case when b0.Level= 3 then a.RegionCode else null end as MemUsualAreaCode,
|
|
|
|
+ case when b1.Level= 2 then b.ParentCode else b.AreaCode end as MemUsualCityCode,
|
|
|
|
+ case when c1.Level= 1 then c.ParentCode else c.AreaCode end as MemUsualProvinceCode
|
|
|
|
+FROM Orders a
|
|
|
|
+ left join Areamap b0 on b0.MappingCode=a.RegionCode
|
|
|
|
+ left join AreaRegion b on b.AreaCode=a.RegionCode left join Areamap b1 on b1.MappingCode=b.ParentCode
|
|
|
|
+ left join AreaRegion c on c.AreaCode=b.ParentCode left join Areamap c1 on c1.MappingCode=c.ParentCode
|
|
|
|
+where 1=1 and (AConsigneePhone3!='' and AConsigneePhone3 is not null)
|
|
|
|
+ and OrderTime > '2019-05-01 00:00:01'
|
|
|
|
+ --and datediff(day,DATEADD(d,0,DATEDIFF(d,0,getdate())-100),OrderTime )>0
|
|
|
|
+order by OrderTime desc
|
|
|
|
+--order by AConsigneePhone3 asc
|
|
|
|
+--offset 10450 rows --fetch NEXT 2 rows only
|
|
|
|
+--offset ((524-1)*5000) rows --fetch next (10) rows only
|
|
|
|
+offset ((${mem_ext_temp_page3}-1)*${mem_ext_temp_pagesize3}) rows fetch next (${mem_ext_temp_pagesize3}) rows only</sql>
|
|
<limit>0</limit>
|
|
<limit>0</limit>
|
|
<lookup/>
|
|
<lookup/>
|
|
<execute_each_row>N</execute_each_row>
|
|
<execute_each_row>N</execute_each_row>
|
|
- <variables_active>N</variables_active>
|
|
|
|
|
|
+ <variables_active>Y</variables_active>
|
|
<lazy_conversion_active>N</lazy_conversion_active>
|
|
<lazy_conversion_active>N</lazy_conversion_active>
|
|
<attributes/>
|
|
<attributes/>
|
|
<cluster_schema/>
|
|
<cluster_schema/>
|
|
@@ -1026,8 +1484,8 @@ offset ((524-1)*5000) rows --fetch next (10) rows only</sql>
|
|
</output>
|
|
</output>
|
|
</remotesteps>
|
|
</remotesteps>
|
|
<GUI>
|
|
<GUI>
|
|
- <xloc>256</xloc>
|
|
|
|
- <yloc>112</yloc>
|
|
|
|
|
|
+ <xloc>242</xloc>
|
|
|
|
+ <yloc>240</yloc>
|
|
<draw>Y</draw>
|
|
<draw>Y</draw>
|
|
</GUI>
|
|
</GUI>
|
|
</step>
|
|
</step>
|