dev
ddlucky 8 months ago
parent 99d0cf075b
commit ed48d39a55

@ -371,6 +371,27 @@ namespace JobCreateFee
public int secondPrintFee_count { get; set; } = 0;
public decimal secondPrintFee_amount { get; set; } = 0;
public string CTN20 { get; set; }//业务中的20尺柜
public string CTN40 { get; set; }//业务中的20尺柜
public string CTN
{
get
{
if (!string.IsNullOrWhiteSpace(CTN40))
{
return CTN40;
}
else
{
return CTN20;
}
}
}
public string ENTEROPERATOR { get; set; }//费用录入人
public YTSumFee() { }
public YTSumFee(JsonYtFee addrec) {
@ -407,7 +428,7 @@ namespace JobCreateFee
public void addfee(JsonYtFee addrec)
{
if (MBLNO == addrec.ctn_no)
if (MBLNO == addrec.bookingno)
{
var newrec = new YTSumFee(addrec);
fee_count += newrec.fee_count;

@ -35,6 +35,7 @@ namespace JobCreateFee
string CustPsw = context.JobDetail.JobDataMap.GetString("CustPsw");
int reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout"));
YTFEEHelper.feeName = context.JobDetail.JobDataMap.GetString("feeName");
YTFEEHelper.ydFeeName = context.JobDetail.JobDataMap.GetString("ydFeeName");
YTFEEHelper.secondPrintFeeName = context.JobDetail.JobDataMap.GetString("secondPrintFeeName");
@ -43,7 +44,11 @@ namespace JobCreateFee
YTFEEHelper.connStr = connStr;
YTFEEHelper. = context.JobDetail.JobDataMap.GetString("AlertMail");
var yesterday = DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd");
int DAYS = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("DAYS"));
string ENTEROPERATOR = context.JobDetail.JobDataMap.GetString("ENTEROPERATOR");
var yesterday = DateTime.Now.AddDays(DAYS).ToString("yyyy-MM-dd");
JsonYtSend reqObj = new JsonYtSend();
reqObj.custname = CustName;
reqObj.custpsw = CustPsw;
@ -116,7 +121,8 @@ namespace JobCreateFee
+ "','" + returndata.ydFee + "','" + returndata.secondPrintFee + "','" + returndata.applicant_code + "')";
SqlCommand cmd = new SqlCommand(sql, dbcon);
cmd.ExecuteNonQuery();
D7BS.ENTEROPERATOR = ENTEROPERATOR;
hp.addYTFee(returndata, D7BS);
}
@ -163,7 +169,7 @@ namespace JobCreateFee
var newbs = new D7BS();
newbs.BSNO = "";
var strSql = new StringBuilder();
strSql.Append("SELECT TOP 1 BSNO, CUSTOMERNAME,FEESTATUS,ISCANCEL from op_seae where MBLNO like '" + MBLNO + "%'");
strSql.Append("SELECT TOP 1 BSNO, CUSTOMERNAME,FEESTATUS,ISCANCEL,isnull((select top 1 CTNALL from op_ctn where bsno=op_seae.BSNO and CTNALL like '20%'),'') CTN20,isnull((select top 1 CTNALL from op_ctn where bsno=op_seae.BSNO and CTNALL like '40%'),'') CTN40 from op_seae where MBLNO like '" + MBLNO + "%'");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
@ -176,6 +182,9 @@ namespace JobCreateFee
newbs.CUSTOMERNAME = row["CUSTOMERNAME"].ToString();
newbs.FEESTATUS = row["FEESTATUS"].ToString() == "1" ? true : false;
newbs.ISCANCEL = row["ISCANCEL"].ToString() == "1" ? true : false;
newbs.CTN20 = row["CTN20"].ToString();
newbs.CTN40 = row["CTN40"].ToString();
}
}
@ -213,14 +222,27 @@ namespace JobCreateFee
public string BSNO { get; set; }
public string CUSTOMERNAME { get; set; }
public string FEETYPE { get; set; }
public bool FEESTATUS { get; set; }
public bool ISCANCEL { get; set; }
public decimal AMOUNT { get; set; }
public int QUANTITY { get; set; }
public string CTN20 { get; set; }//业务中的20尺柜
public string CTN40 { get; set; }//业务中的20尺柜
public string CTN { get {
if (!string.IsNullOrWhiteSpace(CTN40)) {
return CTN40;
}
else {
return CTN20;
}
}
}
public string ENTEROPERATOR { get; set; }
}
public class YTFEEHelper
@ -270,18 +292,21 @@ namespace JobCreateFee
}
else {
addFee(addrec, ds7info.BSNO);
addFee(addrec, ds7info);
}
}
private void addFee(JsonYtFee addrec, string BSNO)
private void addFee(JsonYtFee addrec, D7BS ds7info)
{
if (!YTSUMFeeList.Exists(x => x.MBLNO == addrec.bookingno))
{
var newrec = new YTSumFee(addrec);
newrec.BSNO = BSNO;
newrec.BSNO = ds7info.BSNO;
newrec.CTN20 = ds7info.CTN20;
newrec.CTN40 = ds7info.CTN40;
newrec.ENTEROPERATOR = ds7info.ENTEROPERATOR;
YTSUMFeeList.Add(newrec);
}
else
@ -304,6 +329,7 @@ namespace JobCreateFee
makefee_(item);
}
var cdc = new CommonDataContext(connStr);
@ -314,17 +340,24 @@ namespace JobCreateFee
foreach (var fee in FeeList) {
if (CurrFeeList.Exists(x => x.BSNO == fee.BSNO && x.FEENAME == fee.FEENAME && x.UNITPRICE == fee.UNITPRICE))
{
//var updrec = CurrFeeList.First(x => x.BSNO == fee.BSNO && x.FEENAME == fee.FEENAME && x.UNITPRICE == fee.UNITPRICE);
CurrFeeList.First(x => x.BSNO == fee.BSNO && x.FEENAME == fee.FEENAME && x.UNITPRICE == fee.UNITPRICE).AMOUNT += fee.AMOUNT;
CurrFeeList.First(x => x.BSNO == fee.BSNO && x.FEENAME == fee.FEENAME && x.UNITPRICE == fee.UNITPRICE).NOTAXAMOUNT += fee.NOTAXAMOUNT;
CurrFeeList.First(x => x.BSNO == fee.BSNO && x.FEENAME == fee.FEENAME && x.UNITPRICE == fee.UNITPRICE).QUANTITY += fee.QUANTITY;
//ChFeeHelper.setTax(ref updrec);
CurrFeeList.First(x => x.BSNO == fee.BSNO && x.FEENAME == fee.FEENAME && x.UNITPRICE == fee.UNITPRICE).MODIFIEDUSER = fee.ENTEROPERATOR;
CurrFeeList.First(x => x.BSNO == fee.BSNO && x.FEENAME == fee.FEENAME && x.UNITPRICE == fee.UNITPRICE).MODIFIEDTIME = DateTime.Now;
//updFeeList.Add(fee);
}
else {
fee.ENTERDATE= DateTime.Now;
InsertFeeList.Add(fee);
}
}
@ -337,51 +370,77 @@ namespace JobCreateFee
private void makefee_(YTSumFee YTSumFee)
{
if (YTSumFee.fee_amount > 0)
{
var newfee = ChFeeHelper.getNewChfee();
newfee.BSNO = YTSumFee.BSNO;
newfee.CUSTOMERNAME = feeCustName;
newfee.FEETYPE = 2;
newfee.AMOUNT = YTSumFee.fee_amount;
newfee.QUANTITY = YTSumFee.fee_count;
newfee.UNIT = "箱";
//var newfee = ChFeeHelper.getNewChfee();
//newfee.BSNO = YTSumFee.BSNO;
//newfee.CUSTOMERNAME = feeCustName;
//newfee.FEETYPE = 2;
//newfee.AMOUNT = YTSumFee.fee_amount;
//newfee.QUANTITY = YTSumFee.fee_count;
//newfee.UNIT = "箱";
//newfee.ENTEROPERATOR = YTSumFee.OP;
//newfee.EXCHANGERATE = 1;
//newfee.FEENAME = "小票费";
var newfee = ChFeeHelper.getChFee(YTSumFee.ENTEROPERATOR, YTSumFee.BSNO, feeCustName, 2, "小票费", YTSumFee.fee_amount, YTSumFee.CTN, YTSumFee.fee_count, "", "");
newfee.CUSTOMERTYPE = "其他";
newfee.INPUTMODE = "导入亿通账单";
ChFeeHelper.setTax(ref newfee);
FeeList.Add(newfee);
}
if (YTSumFee.ydFee1_amount > 0)
{
var newfee = ChFeeHelper.getNewChfee();
newfee.BSNO = YTSumFee.BSNO;
newfee.CUSTOMERNAME = CarrierCustName;
newfee.FEETYPE = 2;
newfee.AMOUNT = YTSumFee.ydFee1_amount;
newfee.QUANTITY = YTSumFee.ydFee1_count;
newfee.UNIT = "20'";
//var newfee = ChFeeHelper.getNewChfee();
//newfee.BSNO = YTSumFee.BSNO;
//newfee.CUSTOMERNAME = CarrierCustName;
//newfee.FEETYPE = 2;
//newfee.AMOUNT = YTSumFee.ydFee1_amount;
//newfee.QUANTITY = YTSumFee.ydFee1_count;
//newfee.UNIT = "20'";
//newfee.ENTEROPERATOR = YTSumFee.OP;
//newfee.EXCHANGERATE = 1;
//newfee.FEENAME = "调箱费";
var newfee = ChFeeHelper.getChFee(YTSumFee.ENTEROPERATOR, YTSumFee.BSNO, CarrierCustName, 2, "调箱费", YTSumFee.ydFee1_amount, YTSumFee.CTN20, YTSumFee.ydFee1_count, "", "");
newfee.CUSTOMERTYPE = "其他";
newfee.INPUTMODE = "导入亿通账单";
ChFeeHelper.setTax(ref newfee);
FeeList.Add(newfee);
}
if (YTSumFee.ydFee2_amount > 0)
{
var newfee = ChFeeHelper.getNewChfee();
newfee.BSNO = YTSumFee.BSNO;
newfee.CUSTOMERNAME = CarrierCustName;
newfee.FEETYPE = 2;
newfee.AMOUNT = YTSumFee.ydFee2_amount;
newfee.QUANTITY = YTSumFee.ydFee2_count;
newfee.UNIT = "40'";
//var newfee = ChFeeHelper.getNewChfee();
//newfee.BSNO = YTSumFee.BSNO;
//newfee.CUSTOMERNAME = CarrierCustName;
//newfee.FEETYPE = 2;
//newfee.AMOUNT = YTSumFee.ydFee2_amount;
//newfee.QUANTITY = YTSumFee.ydFee2_count;
//newfee.UNIT = "40'";
//newfee.ENTEROPERATOR = YTSumFee.OP;
//newfee.EXCHANGERATE = 1;
//newfee.FEENAME = "调箱费";
var newfee = ChFeeHelper.getChFee(YTSumFee.ENTEROPERATOR, YTSumFee.BSNO, CarrierCustName, 2, "调箱费", YTSumFee.ydFee2_amount, YTSumFee.CTN40, YTSumFee.ydFee2_count, "", "");
newfee.CUSTOMERTYPE = "其他";
newfee.INPUTMODE = "导入亿通账单";
ChFeeHelper.setTax(ref newfee);
FeeList.Add(newfee);
}
if (YTSumFee.secondPrintFee_amount > 0)
{
var newfee = ChFeeHelper.getNewChfee();
newfee.BSNO = YTSumFee.BSNO;
newfee.CUSTOMERNAME = CarrierCustName;
newfee.FEETYPE = 2;
newfee.AMOUNT = YTSumFee.secondPrintFee_amount;
newfee.QUANTITY = YTSumFee.secondPrintFee_count;
newfee.UNIT = "箱";
//var newfee = ChFeeHelper.getNewChfee();
//newfee.BSNO = YTSumFee.BSNO;
//newfee.CUSTOMERNAME = CarrierCustName;
//newfee.FEETYPE = 2;
//newfee.AMOUNT = YTSumFee.secondPrintFee_amount;
//newfee.QUANTITY = YTSumFee.secondPrintFee_count;
//newfee.UNIT = "箱";
//newfee.ENTEROPERATOR = YTSumFee.OP;
//newfee.EXCHANGERATE = 1;
//newfee.FEENAME = "取消小票费";
var newfee = ChFeeHelper.getChFee(YTSumFee.ENTEROPERATOR, YTSumFee.BSNO, CarrierCustName, 2, "取消小票费", YTSumFee.secondPrintFee_amount, YTSumFee.CTN, YTSumFee.secondPrintFee_count, "", "");
newfee.CUSTOMERTYPE = "其他";
newfee.INPUTMODE = "导入亿通账单";
ChFeeHelper.setTax(ref newfee);
FeeList.Add(newfee);
}

@ -17,8 +17,12 @@
<!--连接字符串-->
<entry>
<key>ConnectString</key>
<value>Data Source=221.215.122.2,12456;Initial Catalog=2024_0322;Persist Security Info=True;User ID=sa;Password=Ds20040201</value>
<!--
<value>Data Source=47.104.253.169,62356;Initial Catalog=ShippingWeb_CS2;Persist Security Info=True;User ID=sa;Password=Ds20040201</value>
<!--<value>Data Source=.;Initial Catalog=dongshengdata_jf;Persist Security Info=True;User ID=sa;Password=ds20040201</value>-->
<value>Data Source=.;Initial Catalog=dongshengdata_jf;Persist Security Info=True;User ID=sa;Password=ds20040201</value>-->
</entry>
<!--接口地址-->
@ -77,6 +81,14 @@
<key>AlertMail</key>
<value>hhytcma@logisticsyt.com</value>
</entry>
<entry>
<key>DAYS</key>
<value>-2</value>
</entry>
<entry>
<key>ENTEROPERATOR</key>
<value>1BEC90E1-9780-472F-90C2-0C6390C044A4</value>
</entry>
</job-data-map>
</job>
<trigger>
@ -88,7 +100,7 @@
<job-group>Job</job-group>
<!--
<cron-expression>0 0 7,12 * * ? </cron-expression> -->
<cron-expression>* 0/1 * * * ? </cron-expression>
<cron-expression>0 9 15 * * ? </cron-expression>
</cron>
</trigger>

@ -11,6 +11,53 @@ using System.Web;
namespace JobSendAgentMail
{
/*
*
*
//待发邮件表 自动发出其中 sendstatus=create的
CREATE TABLE [dbo].[Mail_Send](
[GID] [nvarchar](128) NOT NULL,
[SendTo] [nvarchar](max) NULL,
[CCTo] [nvarchar](max) NULL,
[Title] [nvarchar](max) NULL,
[Body] [nvarchar](max) NULL,
[SendStatus] [nvarchar](40) NULL,
[SendTime] [datetime] NULL,
[TryCount] [int] NOT NULL,
[CreateTime] [datetime] NOT NULL,
[RelativeId] [nvarchar](max) NULL,
[SmtpConfig] [varchar](36) NULL,
[Sender] [varchar](64) NULL,
[ShowName] [nvarchar](50) NULL,
CONSTRAINT [PK_dbo.Mail_Send] PRIMARY KEY CLUSTERED
(
[GID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
//发送日志记录
CREATE TABLE [dbo].[op_mail_log](
[GID] [varchar](60) NOT NULL,
[BSNO] [varchar](60) NULL,
[BLTYPE] [varchar](20) NULL,
[RECEIVER] [varchar](100) NULL,
[SUBJECT] [varchar](300) NULL,
[DESCRIPTION] [varchar](max) NULL,
[ATTACHMENT] [varchar](600) NULL,
[SENDTIME] [datetime] NULL,
[SENDER] [varchar](10) NULL,
[SENDUSER] [varchar](60) NULL,
CCTo varchar(500) null,
CONSTRAINT [PK_op_mail_log] PRIMARY KEY CLUSTERED
(
[GID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
*/
/// <summary>
/// 发送邮件任务
/// </summary>
@ -74,25 +121,28 @@ namespace JobSendAgentMail
{
message.To.Add(MailboxAddress.Parse(sendMail.SendTo));
}
if (sendMail.CCTo.IndexOf(",") > -1)
if (!string.IsNullOrWhiteSpace(sendMail.CCTo))
{
var arrSendTo = sendMail.CCTo.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
foreach (var s in arrSendTo)
if (sendMail.CCTo.IndexOf(",") > -1)
{
message.To.Add(MailboxAddress.Parse(s));
var arrSendTo = sendMail.CCTo.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
foreach (var s in arrSendTo)
{
message.To.Add(MailboxAddress.Parse(s));
}
}
}
else if (sendMail.CCTo.IndexOf(";") > -1)
{
var arrSendTo = sendMail.CCTo.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
foreach (var s in arrSendTo)
else if (sendMail.CCTo.IndexOf(";") > -1)
{
message.To.Add(MailboxAddress.Parse(s));
var arrSendTo = sendMail.CCTo.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
foreach (var s in arrSendTo)
{
message.To.Add(MailboxAddress.Parse(s));
}
}
else
{
message.To.Add(MailboxAddress.Parse(sendMail.CCTo));
}
}
else
{
message.To.Add(MailboxAddress.Parse(sendMail.CCTo));
}
message.Subject = sendMail.Title;

@ -4,77 +4,128 @@
<overwrite-existing-data>true</overwrite-existing-data>
</processing-directives>
<schedule>
<!--订阅数据任务-->
<job>
<name>JobSendBooking</name>
<group>Job</group>
<description>订阅数据</description>
<job-type>JobSendAgentMail.JobSendCtn,JobSendAgentMail</job-type>
<durable>true</durable>
<recover>false</recover>
<job-data-map>
<!--连接字符串-->
<entry>
<key>ConnectString</key>
<value>Data Source=ds-hxt;Initial Catalog=DATA;Persist Security Info=True;User ID=sa;Password=yongfa_123</value>
</entry>
<!--查询SQL-->
<entry>
<key>QuerySql</key>
<value>
SELECT 箱号 FROM [dbo].[t_op_ctn_detail] where isnull(是否还箱,0)=0 and (GETDATE()-动态时间)>180
</value>
</entry>
<!--DS7邮箱发送账号-->
<entry>
<key>MAILSENDACCOUNT</key>
<value>han_xuntao@163.com</value>
</entry>
<!--DS7邮箱发送密码-->
<entry>
<key>MAILSENDPASSWORD</key>
<value>ds20040201</value>
</entry>
<!--DS7邮箱发送账号-->
<entry>
<key>MAILSENDSERVICE</key>
<value>smtp.163.com</value>
</entry>
<!--DS7邮箱发送账号-->
<entry>
<key>MAILSENDPORT</key>
<value>25</value>
</entry>
<!--DS7邮箱发送账号-->
<entry>
<key>MAILISSSL</key>
<value>false</value>
</entry>
<entry>
<key>MAILRECEIVER</key>
<value>e.control@win-fast.com.cn,e.control2@win-fast.com.cn</value>
</entry>
<entry>
<key>MAILTITLE</key>
<value>集装箱超期提醒</value>
</entry>
</job-data-map>
</job>
<!-- 发送请求数据任务触发器-->
<trigger>
<cron>
<name>TriggerBooking</name>
<group>Job</group>
<description>订阅数据触发器</description>
<job-name>JobSendBooking</job-name>
<job-group>Job</job-group>
<cron-expression>0 55 14 * * ?</cron-expression>
</cron>
</trigger>
<!--订阅数据任务-->
<job>
<name>JobSendBooking</name>
<group>Job</group>
<description>订阅数据</description>
<job-type>JobSendAgentMail.JobSendCtn,JobSendAgentMail</job-type>
<durable>true</durable>
<recover>false</recover>
<job-data-map>
<!--连接字符串-->
<entry>
<key>ConnectString</key>
<value>Data Source=ds-hxt;Initial Catalog=DATA;Persist Security Info=True;User ID=sa;Password=yongfa_123</value>
</entry>
<!--查询SQL-->
<entry>
<key>QuerySql</key>
<value>
SELECT 箱号 FROM [dbo].[t_op_ctn_detail] where isnull(是否还箱,0)=0 and (GETDATE()-动态时间)>180
</value>
</entry>
<!--DS7邮箱发送账号-->
<entry>
<key>MAILSENDACCOUNT</key>
<value>han_xuntao@163.com</value>
</entry>
<!--DS7邮箱发送密码-->
<entry>
<key>MAILSENDPASSWORD</key>
<value>ds20040201</value>
</entry>
<!--DS7邮箱发送账号-->
<entry>
<key>MAILSENDSERVICE</key>
<value>smtp.163.com</value>
</entry>
<!--DS7邮箱发送账号-->
<entry>
<key>MAILSENDPORT</key>
<value>25</value>
</entry>
<!--DS7邮箱发送账号-->
<entry>
<key>MAILISSSL</key>
<value>false</value>
</entry>
<entry>
<key>MAILRECEIVER</key>
<value>e.control@win-fast.com.cn,e.control2@win-fast.com.cn</value>
</entry>
<entry>
<key>MAILTITLE</key>
<value>集装箱超期提醒</value>
</entry>
</job-data-map>
</job>
<!-- 发送请求数据任务触发器-->
<trigger>
<cron>
<name>TriggerBooking</name>
<group>Job</group>
<description>订阅数据触发器</description>
<job-name>JobSendBooking</job-name>
<job-group>Job</job-group>
<cron-expression>0 55 14 * * ?</cron-expression>
</cron>
</trigger>
<job>
<name>SendMailJob</name>
<group>Job</group>
<description>发送邮件</description>
<job-type>JobSendAgentMail.SendMailJob,JobSendAgentMail</job-type>
<durable>true</durable>
<recover>false</recover>
<job-data-map>
<!-- 连接字符串 -->
<entry>
<key>ConnectString</key>
<value>Data Source=221.215.122.2,12456;Initial Catalog=2024_0322;Persist Security Info=True;User ID=sa;Password=Ds20040201</value>
</entry>
<!-- DS7邮箱发送账号 -->
<entry>
<key>MAILSENDACCOUNT</key>
<value>dongshengcangdan@h8j.top</value>
</entry>
<!-- DS7邮箱发送密码 -->
<entry>
<key>MAILSENDPASSWORD</key>
<value>A1B2C3ds040201</value>
</entry>
<!-- DS7邮箱发送账号 -->
<entry>
<key>MAILSENDSERVICE</key>
<value>smtpdm.aliyun.com</value>
</entry>
<!-- DS7邮箱发送账号 -->
<entry>
<key>MAILSENDPORT</key>
<value>80</value>
</entry>
<!-- DS7邮箱发送账号 -->
<entry>
<key>MAILISSSL</key>
<value>false</value>
</entry>
</job-data-map>
</job>
<!-- 发送请求数据任务触发器-->
<trigger>
<cron>
<name>TriggerSendMail</name>
<group>Job</group>
<description>订阅数据触发器</description>
<job-name>SendMailJob</job-name>
<job-group>Job</job-group>
<cron-expression>0 0/1 * * * ?</cron-expression>
</cron>
</trigger>
</schedule>
</job-scheduling-data>
Loading…
Cancel
Save