|
|
@@ -64,10 +64,28 @@ public class CustomerTask {
|
|
|
Object em_code = baseDao.getFieldDataByCondition("employee", "max(em_code) em_code", "em_name='" + dataList.get(i).get("field_w9e4q__c") + "'");
|
|
|
Long create_time = Long.parseLong(new BigDecimal(dataList.get(i).get("create_time").toString()).toPlainString());
|
|
|
Long last_modified_time = Long.parseLong(new BigDecimal(dataList.get(i).get("last_modified_time").toString()).toPlainString());
|
|
|
- String sql="insert into PreCustomer(cu_id,cu_code,cu_name,cu_shortname,cu_add1,cu_sellercode,cu_sellername,cu_kind," +
|
|
|
+ String cuKind = getValueField(dataList, i, "account_type", "客户类型");
|
|
|
+ String wbsk_user = getValueField(dataList, i, "UDSSel1__c", "收款方式");//外部收款方式
|
|
|
+ Object[] pa_data = baseDao.getFieldsDataByCondition("Payments", new String[]{"pa_id","pa_code"}, "pa_name='" + wbsk_user + "'");//获取收款方式编号
|
|
|
+ String paID = pa_data[0] == null ? "" : pa_data[0].toString();
|
|
|
+ String paCode = pa_data[1] == null ? "" : pa_data[1].toString();
|
|
|
+ String cu_level = getValueField(dataList, i, "account_level", "客户级别");
|
|
|
+ String cu_turnSAP = getValueField(dataList, i, "field_RYzRf__c", "是否转正式客户在SAP内建档");
|
|
|
+ String cu_currency = getValueField(dataList, i, "field_RYzRf__c", "货币");
|
|
|
+ String cu_recordType = getValueField(dataList, i, "record_type", "业务类型");
|
|
|
+ String cu_industry = getValueField(dataList, i, "field_00Ijp__c", "所属行业");
|
|
|
+ //field_giBJk__c:收货人 UDSText5__c:送货地址 UDSText1__c:法定代表人 UDSText2__c:注册资金
|
|
|
+ String sql="insert into PreCustomer(cu_id,cu_code,cu_name,cu_shortname,cu_add2,cu_sellercode,cu_sellername,cu_kind," +
|
|
|
+ "cu_contact,cu_add1,cu_lawman,cu_regamount,cu_rate,cu_wbsk_user,cu_paymentid,cu_paymentscode,cu_payments,cu_level,cu_industry,cu_mainbusiness,cu_turnSAP,cu_currency,cu_taxrate," +
|
|
|
+ "cu_dealstatus,cu_Shipmentamount,cu_receivable,cu_businessRegister,cu_recordType," +
|
|
|
"cu_mobile,cu_email,cu_recordman,cu_recorddate,cu_lastdate,cu_auditstatus,cu_auditstatuscode,CU_FXXKID)" +
|
|
|
"values(PRECUSTOMER_SEQ.nextval,'"+dataList.get(i).get("account_no")+"','"+name+"','"+dataList.get(i).get("UDSText3__c")+"','"+ dataList.get(i).get("address")+"'," +
|
|
|
- "'"+em_code+"','"+dataList.get(i).get("field_w9e4q__c")+"','"+dataList.get(i).get("account_type")+"'," +
|
|
|
+ "'"+em_code+"','"+dataList.get(i).get("field_w9e4q__c")+"','"+cuKind+"'," +
|
|
|
+ "'"+getNotNull(dataList,i,"field_giBJk__c")+"','"+getNotNull(dataList,i,"UDSText5__c")+"'," +
|
|
|
+ "'"+getNotNull(dataList,i,"UDSText1__c")+"','"+getNotNull(dataList,i,"UDSText2__c")+"','" +
|
|
|
+ getNotNull(dataList,i,"field_1l3xo__c")+"','"+wbsk_user+"','"+paID+"','"+paCode+"','"+wbsk_user+"','"+cu_level+"','"+cu_industry+"'," +
|
|
|
+ "'"+getNotNull(dataList,i,"UDSText4__c")+"','"+cu_turnSAP+"','"+cu_currency+"',13,'"+getNotNull(dataList,i,"deal_status")+"'," +
|
|
|
+ "'"+getNotNull(dataList,i,"field_Ezg0w__c")+"','"+getNotNull(dataList,i,"field_59oLF__c")+"','"+getNotNull(dataList,i,"biz_reg_name")+"','"+cu_recordType+"',"+
|
|
|
"'"+dataList.get(i).get("tel")+"','"+dataList.get(i).get("email")+"'," +
|
|
|
"'"+dataList.get(i).get("created_by")+"',"+DateUtil.parseDateToOracleString(Constant.YMD_HMS,sdf.parse(sdf.format(create_time)))+"," +
|
|
|
DateUtil.parseDateToOracleString(Constant.YMD_HMS,sdf.parse(sdf.format(last_modified_time)))+",'已审核','AUDITED','"+_id+"')";
|
|
|
@@ -92,4 +110,18 @@ public class CustomerTask {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private String getValueField(List<Map<String, Object>> dataList, int i, String Field, String APINAME){
|
|
|
+ String ValueField ="";
|
|
|
+ Object account_type = dataList.get(i).get(Field);
|
|
|
+ if(account_type !=null && !"".equals(account_type.toString())){
|
|
|
+ Object DISPLAYFIELD = baseDao.getFieldDataByCondition("comboData", "DISPLAYFIELD", "VALUEFIELD='" + account_type + "' and APINAME='"+APINAME+"' and MODULEAPINAME='客户资料'");
|
|
|
+ ValueField= DISPLAYFIELD==null? "" :DISPLAYFIELD.toString();
|
|
|
+ }
|
|
|
+ return ValueField;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getNotNull(List<Map<String, Object>> dataList, int i, String Field){
|
|
|
+ return (dataList.get(i).get(Field)==null?"":dataList.get(i).get(Field)).toString();
|
|
|
+ }
|
|
|
}
|