|
|
using log4net;
|
|
|
using Newtonsoft.Json;
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
using Quartz;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Data;
|
|
|
using System.Data.SqlClient;
|
|
|
using System.IO;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using HtmlAgilityPack;
|
|
|
using HcUtility.Core;
|
|
|
using HcUtility.Comm;
|
|
|
using System.Data.Entity;
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
|
using DSWeb.Common.DB;
|
|
|
using Terminal_CDMA;
|
|
|
using DSWeb.MvcShipping.Models.MsOpApply;
|
|
|
using DSWeb.SoftMng.Controllers;
|
|
|
using DSWeb.SoftMng.DAL;
|
|
|
using DSWeb.Areas.Mobile.DAL;
|
|
|
using Renci.SshNet;
|
|
|
|
|
|
namespace Job_Get_FanWeiDeE9
|
|
|
{
|
|
|
|
|
|
public class Job_Get_FanWeiDeE9 : IJob
|
|
|
{
|
|
|
private ILog log = LogManager.GetLogger(typeof(Job_Get_FanWeiDeE9));
|
|
|
|
|
|
//private string connStr { get; set; }
|
|
|
private const string admin_userid = "1BEC90E1-9780-472F-90C2-0C6390C044A4";
|
|
|
private const string admin_username = "系统管理员";
|
|
|
|
|
|
private string connStr = "";
|
|
|
private string EDINAME = "";
|
|
|
private string LocalDS7 = "";
|
|
|
|
|
|
public void Execute(IJobExecutionContext context)
|
|
|
{
|
|
|
log.Debug($"Execute开始");
|
|
|
|
|
|
connStr = context.JobDetail.JobDataMap.GetString("ConnectString");
|
|
|
|
|
|
EDINAME = context.JobDetail.JobDataMap.GetString("EDINAME");
|
|
|
|
|
|
//1:连接ds7库,查询
|
|
|
|
|
|
//2:连接到数据库 查找泛微的指定表 当中 状态值为
|
|
|
//
|
|
|
|
|
|
|
|
|
try
|
|
|
{
|
|
|
CommonDataContext cdc = new CommonDataContext(connStr);
|
|
|
|
|
|
var ftpinfo = new code_FtpSet_md();
|
|
|
|
|
|
var ftpinfoList = cdc.code_FtpSet.Where(x => x.EDINAME == EDINAME).ToList();
|
|
|
|
|
|
if (ftpinfoList == null || ftpinfoList.Count == 0)
|
|
|
{
|
|
|
log.Error("没有找到BOSCH的FTP信息");
|
|
|
return;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
ftpinfo = ftpinfoList[0];
|
|
|
}
|
|
|
|
|
|
var localpath = AppDomain.CurrentDomain.BaseDirectory + @"\XMLFILE\" + DateTime.Now.ToString("yyyy-MM-dd") + @"\";
|
|
|
if (Directory.Exists(localpath) == false)
|
|
|
{
|
|
|
Directory.CreateDirectory(localpath);
|
|
|
log.Debug($"服务器本地建立文件夹:{localpath}");
|
|
|
}
|
|
|
|
|
|
var remoatPath = ftpinfo.TMPFOLDERNAME.Replace(@"\", "/").EndsWith("/") ? ftpinfo.TMPFOLDERNAME : ftpinfo.TMPFOLDERNAME + "/";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
catch (Exception ex) {
|
|
|
log.Error("错误中断0:" + ex.Message);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
private void DoSendMessage(string mblno) {
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|