53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
using Quartz;
|
|
using System;
|
|
using System.Data;
|
|
using WX.CRM.BLL.Csvr;
|
|
using WX.CRM.BLL.Res;
|
|
using WX.CRM.BLL.Util;
|
|
using WX.CRM.Common;
|
|
using WX.CRM.DAL;
|
|
|
|
namespace WX.CRM.CRMServices.CRMJobs
|
|
{
|
|
public class OpenResSyncJob4MySQL : IJob
|
|
{
|
|
static bool isRuning = false;
|
|
public void Execute(JobExecutionContext context)
|
|
{
|
|
if (isRuning)
|
|
return;
|
|
isRuning = true;
|
|
try
|
|
{
|
|
var resdt = new RES_CUSTOMER_BL().GetOpenAccountRes();
|
|
if (null != resdt)
|
|
{
|
|
SecurityHelper he = new SecurityHelper();
|
|
var b = new CSVR_BLACKNUMBER_BL();
|
|
|
|
foreach (DataRow row in resdt.Rows)
|
|
{
|
|
var mobile = row["MOBILE"].ToString();
|
|
mobile = he.decyptData(b.CLIENTID, mobile);
|
|
mobile = Utility.EncryptMD5(mobile);
|
|
|
|
row["MOBILE"] = mobile;
|
|
}
|
|
string sql = "truncate table OpenAccountRes";
|
|
var mysqlConn = new MySqlDbHelper("CRMRESMYSQLConn");
|
|
var rst = mysqlConn.ExecuteNonQuery(sql);
|
|
mysqlConn.BulkInsert(resdt, "OpenAccountRes");
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
WX.CRM.Common.LogHelper.Error("开户资源同步For MySQL: ", e);
|
|
}
|
|
finally
|
|
{
|
|
isRuning = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
} |