DS7_JinGang
hanxuntao 1 year ago
parent 1fb55c9be5
commit 3ee5414241

@ -426,7 +426,7 @@ Ext.extend(Shipping.MsChDuiIndex, Ext.Panel, {
fields: ['DC', 'NAME']
});
this.storeBILLSTATUS.add({ "DC": "", "NAME": Zi.LAN.FEERANGALL });
this.storeBILLSTATUS.add({ "DC": "1", "NAME": Zi.LAN.SubmitAudi });
this.storeBILLSTATUS.add({ "DC": "1", "NAME": Zi.LAN.SubmitAudit });
this.storeBILLSTATUS.add({ "DC": "2", "NAME": Zi.LAN.NotSubmitAudit });
this.comboxBILLSTATUS = Ext.create('DsExt.ux.RefTableCombox', {

@ -40,6 +40,10 @@
<Reference Include="Common.Logging.Core, Version=3.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<HintPath>..\packages\Common.Logging.Core.3.3.1\lib\net40\Common.Logging.Core.dll</HintPath>
</Reference>
<Reference Include="JobAutoCreateFee, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\JobAutoCreateFee.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net40-full\log4net.dll</HintPath>
</Reference>

@ -31,7 +31,6 @@ namespace JobCreateFee
string CustName = context.JobDetail.JobDataMap.GetString("CustName");
string companySecret = context.JobDetail.JobDataMap.GetString("DjyCompanySecret");
string bsType = context.JobDetail.JobDataMap.GetString("DjybsType");
string carrier = context.JobDetail.JobDataMap.GetString("DjyCarrier");
int reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout"));
long ts = DataTableToJsonHelper.ConvertDateTimeToInt(DateTime.Now);
@ -80,35 +79,38 @@ namespace JobCreateFee
dbcon.Open();
foreach (var returndata in returnlist)
{
var bsno = GETD6BSNO(returndata.mblno, dbcon);
var BS = GETBSNO(returndata.mblno, dbcon);
if (returndata.price == "" || returndata.price == null) returndata.price = "0";
if (returndata.ctnrCount == "" || returndata.ctnrCount == null) returndata.ctnrCount = "0";
string sql = " if (select GID from t_op_txxp_log where GID='" + returndata.gid + "') is null INSERT INTO t_op_txxp_log([编号],[GID],[beizhu],[mblno],[bsstatus],[bstype],[createtime]";
sql = sql + ",[price],[sendtype],[ctnrCount],[ctnrInfo]) values ('" + bsno + "','" + returndata.gid + "'";
sql = sql + ",[price],[sendtype],[ctnrCount],[ctnrInfo]) values ('" + BS.BSNO + "','" + returndata.gid + "'";
sql = sql + ",'" + returndata.beizhu + "','" + returndata.mblno + "','" + returndata.bsstatus + "','" + returndata.bstype + "','" + returndata.createtime + "'";
sql = sql + "," + returndata.price + ",'" + returndata.sendtype + "'," + returndata.ctnrCount + ",'" + returndata.ctnrInfo + "')";
SqlCommand cmd = new SqlCommand(sql, dbcon);
cmd.ExecuteNonQuery();
if (Convert.ToDecimal(returndata.price)!= 0 &&!string.IsNullOrEmpty(CustName) && !string.IsNullOrEmpty(FeeName))
if (BS.BSNO != "" && BS.FEESTATUS != "提交财务" && BS.FEESTATUS != "费用封帐" && BS.BSSTATUS != "应付完毕")
{
sql = "INSERT INTO [t_ch_fee] ([类型],[费用状态],[编号],[费用名称],[结算单位],[客户名称],[标准]";
sql = sql + ",[单价],[数量],[金额],[币别],[汇率],[备注],[结算金额],[开票金额]";
sql = sql + ",[录入人],[录入日期],[是否对帐],[顺序],[冲抵金额]";
sql = sql + ",[机密],[是否垫付],[申请金额],[不开发票],[费用英文名称]";
sql = sql + ",[申请开票],[提交],[不含税价],[税率],[税额],PROJECTFEEID) VALUES ";
sql = sql + "('付','审核通过','" + bsno + "','" + FeeName + "','','" + CustName + "','票'";
sql = sql + "," + returndata.price + ",1," + returndata.price + ",'RMB',1,'',0,0";
sql = sql + ",'DEMO-SA',GETDATE(),0,0,0";
sql = sql + ",0,0,0,0,'" + FeeName + "'";
sql = sql + ",0,0," + returndata.price + ",0,0,'" + returndata.gid + "')";
log.Debug($"{returndata.mblno},-费用语句-{sql}");
dbcon.Open();
SqlCommand cmd2 = new SqlCommand(sql, dbcon);
cmd2.ExecuteNonQuery();
dbcon.Close();
if (Convert.ToDecimal(returndata.price) != 0 && !string.IsNullOrEmpty(CustName) && !string.IsNullOrEmpty(FeeName))
{
sql = "INSERT INTO [t_ch_fee] ([类型],[费用状态],[编号],[费用名称],[结算单位],[客户名称],[标准]";
sql = sql + ",[单价],[数量],[金额],[币别],[汇率],[备注],[结算金额],[开票金额]";
sql = sql + ",[录入人],[录入日期],[是否对帐],[顺序],[冲抵金额]";
sql = sql + ",[机密],[是否垫付],[申请金额],[不开发票],[费用英文名称]";
sql = sql + ",[申请开票],[提交],[不含税价],[税率],[税额],PROJECTFEEID) VALUES ";
sql = sql + "('付','审核通过','" + BS.BSNO + "','" + FeeName + "','','" + CustName + "','票'";
sql = sql + "," + returndata.price + ",1," + returndata.price + ",'RMB',1,'',0,0";
sql = sql + ",'DEMO-SA',GETDATE(),0,0,0";
sql = sql + ",0,0,0,0,'" + FeeName + "'";
sql = sql + ",0,0," + returndata.price + ",0,0,'" + returndata.gid + "')";
log.Debug($"{returndata.mblno},-费用语句-{sql}");
dbcon.Open();
SqlCommand cmd2 = new SqlCommand(sql, dbcon);
cmd2.ExecuteNonQuery();
dbcon.Close();
}
}
@ -144,11 +146,12 @@ namespace JobCreateFee
return cmd.ExecuteNonQuery();
}
static public string GETD6BSNO(string MBLNO, SqlConnection dbcon)
static public OPSEAE GETBSNO(string MBLNO, SqlConnection dbcon)
{
var OPSEAE = new OPSEAE();
var strSql = new StringBuilder();
strSql.Append("SELECT TOP 1 编号 BSNO from t_op_seae where 主提单号='" + MBLNO + "'");
strSql.Append("SELECT 编号,费用状态,业务状态 from t_op_seae where 主提单号='" + MBLNO + "'");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
@ -157,13 +160,16 @@ namespace JobCreateFee
{
foreach (DataRow row in table.Rows)
{
BSNO = row["BSNO"].ToString();
OPSEAE.BSNO = row["编号"].ToString();
OPSEAE.FEESTATUS = row["费用状态"].ToString();
OPSEAE.BSSTATUS = row["业务状态"].ToString();
}
}
return BSNO;
return OPSEAE;
}
}

@ -6,98 +6,77 @@
<schedule>
<!--订阅数据任务-->
<!--下载提箱小票打印明细-->
<job>
<name>JobSendBooking</name>
<name>Jobdowloaddjy</name>
<group>Job</group>
<description>订阅数据</description>
<job-type>JobSendAgentMail.JobSendBooking,JobSendAgentMail</job-type>
<job-type>JobCreateFee.JobDjyD6Xf,JobAutoCreateFee</job-type>
<durable>true</durable>
<recover>false</recover>
<job-data-map>
<!--连接字符串-->
<entry>
<key>ConnectString</key>
<value>Data Source=www.perways.net,18866;Initial Catalog=ShippingWeb_SZYT;Persist Security Info=True;User ID=sa;Password=Ds20040201</value>
<value>Data Source=223.223.95.213;Initial Catalog=DONGSHENG;Persist Security Info=True;User ID=sa;Password=Smart*DATA_80120</value>
</entry>
<!--查询SQL-->
<!--请求地址-->
<entry>
<key>QuerySql</key>
<value>
select BSNO,MBLNO,ORDERNO,OPERATORFAX AS BLREMARK,AGENTID,BLFRT,PORTLOAD,PORTDISCHARGE,DESTINATION,CONVERT(varchar(100), ETD, 23) AS ETD,ATD,HBLNO,CONVERT(varchar(100), ETA, 23) ETA,CNTRTOTAL,(
SELECT CODENAME FROM info_client WHERE SHORTNAME=OP_SEAE.CARRIER) CARRIERID,(CASE WHEN ISSUETYPE='电放' then 'Telex release'else case when ISSUETYPE='正本' then 'Original Bill' else case when ISSUETYPE='SWB' then 'Seaway Bill' else case when issuetype='云提单'then'INTELLIGENT BL'else '' end end end end) ISSUETYPE,(SELECT TOP 1 USERNAME FROM [user] where SHOWNAME=op_seae.OP) OPNAME,(SELECT TOP 1 email1 FROM [VW_user] where SHOWNAME=op_seae.OP) OPEMAIL, (((SELECT TOP 1 EMAIL FROM info_client where SHORTNAME=op_seae.AGENTID ))+';'+( SELECT TOP 1 email1 FROM [VW_userquan] where SHOWNAME=op_seae.SALE )) AGENTEMAIL from op_seae WHERE custno like 'CXE22050397'
</value>
<key>DjyReqUrl</key>
<value>http://djypaas.myshipping.net/api/open/finance/expendlist</value>
</entry>
<!--请求用户代码-->
<entry>
<key>HblQuerySql</key>
<value>
select HBLNO,(CASE WHEN ISSUETYPE='电放' then 'Telex release'else
case when ISSUETYPE='正本' then 'Original Bill' else case when ISSUETYPE='SWB' then 'Seaway Bill' else case when issuetype='云提单'then'INTELLIGENT BL'else '' end end end end ) ISSUETYPE
from op_seae_billmanage
</value>
<key>DjyCompanyCode</key>
<value>4fb53bc0-8901-4f0d-a34f-c8a7aeb6692e</value>
</entry>
<!--单据类型-->
<entry>
<key>DocType</key>
<value>PA</value>
</entry>
<!--DS7绝对路径-->
<entry>
<key>D7FilePath</key>
<value>D:\东胜\DONGSHENGWEB\</value>
<entry>
<key>DjyCompanyName</key>
<value>青岛益道信国际货运代理有限公司</value>
</entry>
<!--DS7邮箱发送账号-->
<entry>
<key>FeeName</key>
<value>舱单费</value>
</entry>
<entry>
<key>CustName</key>
<value>东胜软件</value>
</entry>
<!--秘钥-->
<entry>
<key>MAILSENDACCOUNT</key>
<value>szytcus@perways.com</value>
<key>DjyCompanySecret</key>
<value>Lily8256</value>
</entry>
<!--DS7邮箱发送密码-->
<!--消费记录类型-->
<entry>
<key>MAILSENDPASSWORD</key>
<value>PER202100558YT12</value>
<key>DjybsType</key>
<value>0</value>
</entry>
<!--DS7邮箱发送账号-->
<!--船公司-->
<entry>
<key>MAILSENDSERVICE</key>
<value>smtp.263.net</value>
<key>DjyCarrier</key>
<value>ONE</value>
</entry>
<!--DS7邮箱发送账号-->
<!--请求超时(单位:秒)-->
<entry>
<key>MAILSENDPORT</key>
<value>25</value>
<key>RequestTimeout</key>
<value>30</value>
</entry>
<!--DS7邮箱发送账号-->
<entry>
<key>MAILISSSL</key>
<value>false</value>
</entry>
<entry>
<key>MAILTEMPLATE</key>
<value>MailTemplate.html</value>
</entry>
</job-data-map>
</job>
<!-- 发送请求数据任务触发器-->
<trigger>
<trigger>
<cron>
<name>TriggerBooking</name>
<name>Triggerdownloaddjy</name>
<group>Job</group>
<description>订阅数据触发器</description>
<job-name>JobSendBooking</job-name>
<description>下载大简云账单数据触发器</description>
<job-name>Jobdowloaddjy</job-name>
<job-group>Job</job-group>
<cron-expression>0 34 14 * * ?</cron-expression>
<cron-expression>0 0 12,17 * * ? </cron-expression>
</cron>
</trigger>
<!--<trigger>
<simple>
<name>TriggerBooking</name>
<group>Job</group>
<description>订阅数据触发器</description>
<job-name>JobSendBooking</job-name>
<job-group>Job</job-group>
<cron-expression>0 5,10 9 * * ?</cron-expression>
</simple>
</trigger>-->
</schedule>
</job-scheduling-data>
Loading…
Cancel
Save