You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/Job_Get_FanWeiDeE9/Job_Get_FanWeiDeE9.cs

102 lines
2.7 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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) {
}
}
}