DS7_HYRD
dengyu 1 year ago
commit 50a595fa13

@ -22,8 +22,8 @@ namespace D7MqClient
{
logger.Debug("开始运行");
//JFtoSaveFile.DoProcess();
//JFtoDcStatus.DoProcess();
JFtoSaveFile.DoProcess();
JFtoDcStatus.DoProcess();
JFtoDjyBackNo.DoProcess();
//var invtoD7 = new InvToD7();
//var djytoD7_OPSTATUS = new DJYtoD7_OPSTATUS();
@ -32,8 +32,8 @@ namespace D7MqClient
protected override void OnStop()
{
logger.Debug("停止运行");
//JFtoSaveFile.StopProcess();
//JFtoDcStatus.StopProcess();
JFtoSaveFile.StopProcess();
JFtoDcStatus.StopProcess();
JFtoDjyBackNo.StopProcess();
//InvToD7.StopProcess();
//DJYtoD7_OPSTATUS.StopProcess();

@ -134,6 +134,7 @@ namespace MailAnalyzeTools.Common
// File.Delete(filename);
//}
//File.Copy((filename_src as string), (filename as string), false);
LogHelper.Debug("本地文件:" + filename_src);
FileInfo flinfo = new FileInfo(filename_src);
fsize = flinfo.Length;
@ -144,6 +145,8 @@ namespace MailAnalyzeTools.Common
try
{
LogHelper.Debug("准备上传本地文件:" + filename_src);
if (UpLoadProFile(filename_src, naspath, "user", "user", mainNo, bsno, fid, filetype, out guadanPath, isAddMblNoAsFilePre))
{
// 更新数量及任务路径
@ -207,8 +210,10 @@ namespace MailAnalyzeTools.Common
bool status = true;
//连接共享文件夹
//status = connectState(RemotePathName, Users, pw);
status = connectState(RemotePathName, Users, pw);
if (status)
{
try
{
//共享文件夹的目录
DirectoryInfo theFolder = new DirectoryInfo(RemotePathName);
@ -240,9 +245,15 @@ namespace MailAnalyzeTools.Common
//获取保存文件的路径
string filePathTarget = filepath_pre;// theFolder.ToString() + fielpath;
//执行方法
LogHelper.Debug("上传文件:" + filePathTarget + filename);
Transport(filename_src, filePathTarget, filename);
LogHelper.Debug("上传文件成功");
}
catch (Exception E) {
LogHelper.Debug("上传文件错误222" +E.Message);
}
Transport(filename_src, filePathTarget, filename);
}
else

@ -15,16 +15,16 @@ namespace D7MqClient
/// </summary>
static void Main()
{
//ServiceBase[] ServicesToRun;
//ServicesToRun = new ServiceBase[]
//{
// new DsService()
//};
//ServiceBase.Run(ServicesToRun);
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new DsService()
};
ServiceBase.Run(ServicesToRun);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new testForm1());
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new testForm1());
}
}

@ -159,7 +159,13 @@ namespace DSWeb.Areas.Account.Controllers
if (!string.IsNullOrEmpty(defaultCHECKER))
head.CHECKER = defaultCHECKER;
if (!string.IsNullOrEmpty(defaultINVKPR))
{
head.OPERATORNAME = defaultINVKPR;
T_ALL_DA T_ALL_DA = new T_ALL_DA();
var USERID = T_ALL_DA.GetStrSQL("USERID", "select top 1 USERID from VW_user where SHOWNAME='" + defaultINVKPR + "'");
head.OPERATOR = USERID;
}
if (isapp)
{

@ -668,7 +668,7 @@ namespace DSWeb.Areas.Account.Controllers
}
var DingTalkSet = MsCodeDingTalkSetDAL.GetData("MODULENAME='付款申请'", Convert.ToString(Session["COMPANYID"]));
var DingTalkSet = MsCodeDingTalkSetDAL.GetData("(MODULENAME='付款申请' or MODULENAME='付费申请')", Convert.ToString(Session["COMPANYID"]));
if (DingTalkSet != null && DingTalkSet.ISENABLE) {
var DingTalkSetDetail = MsCodeDingTalkSetDAL.GetBodyList("MODULEID='"+ DingTalkSet.GID + "'");
var bodyList = ChpayapplicationDAL.GetBodyAllList("BILLNO='"+ headdata.BILLNO + "'");
@ -764,7 +764,7 @@ namespace DSWeb.Areas.Account.Controllers
}
if (result.Success) {
var DingTalkSet = MsCodeDingTalkSetDAL.GetData("MODULENAME='付款申请'", Convert.ToString(Session["COMPANYID"]));
var DingTalkSet = MsCodeDingTalkSetDAL.GetData("(MODULENAME='付款申请' or MODULENAME='付费申请')", Convert.ToString(Session["COMPANYID"]));
if (DingTalkSet != null && DingTalkSet.ISENABLE)
{
@ -814,7 +814,7 @@ namespace DSWeb.Areas.Account.Controllers
var paylist = ChpayapplicationDAL.GetDataList(0, 1000, "BILLNO IN ('" + bills.Replace(",", "','") + "')", Convert.ToString(Session["USERID"]), Convert.ToString(Session["CODENAME"]), Convert.ToString(Session["COMPANYID"]));
DBResult result = new DBResult();
var DingTalkSet = MsCodeDingTalkSetDAL.GetData("MODULENAME='付款申请'", Convert.ToString(Session["COMPANYID"]));
var DingTalkSet = MsCodeDingTalkSetDAL.GetData("(MODULENAME='付款申请' or MODULENAME='付费申请')", Convert.ToString(Session["COMPANYID"]));
if (DingTalkSet != null && DingTalkSet.ISENABLE)
{
var billList = bills.Split(',');

@ -462,7 +462,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice
strSql.Append(" ,b.OPLBNAME,b.BSSTATUS,b.ACCDATE,b.MBLNO,b.HBLNO,b.CUSTNO");
strSql.Append(",b.CUSTOMERNAME");
strSql.Append(",b.VESSEL,b.VOYNO,b.ETD,b.PORTLOAD");
strSql.Append(",b.PORTDISCHARGE,b.DESTINATION,b.INPUTBY,b.OP,b.CUSTSERVICE");
strSql.Append(",b.PORTDISCHARGE,b.DESTINATION,b.INPUTBY,b.OP,b.CUSTSERVICE,b.ORDERNO");
strSql.Append(",b.DOC,b.SALE,b.CNTRTOTAL");
strSql.Append(",f.Remark Remark,f.INPUTMODE ");
strSql.Append(" FROM ch_fee_do c");
@ -493,7 +493,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice
strSql.Append(" SELECT '' GID,'' BSNO,'' FEEID,'' FEENAME,'' CURRENCY,sum(ISNULL((case when c.ORIGCURRENCY='RMB' THEN case when c.FEETYPE=1 THEN ORIGAMOUNT ELSE -ORIGAMOUNT END ELSE 0 END),0)) AMOUNT,0 DOAMOUNT");
strSql.Append(",'' ORIGCURRENCY,sum(ISNULL((case when c.ORIGCURRENCY!='RMB' THEN case when c.FEETYPE=1 THEN ORIGAMOUNT ELSE -ORIGAMOUNT END ELSE 0 END),0)) ORIGAMOUNT,0 ORIGSTLAMOUNT,0 EXCHANGERATE,0 ORIGEXCHANGERATE ");
strSql.Append(",1 FEETYPE,'' FEEOBJNAME,'收' AS FEETYPEREF");
strSql.Append(" ,b.OPLBNAME,b.BSSTATUS,b.ACCDATE,b.MBLNO,b.HBLNO,b.CUSTNO");
strSql.Append(" ,b.OPLBNAME,b.BSSTATUS,b.ACCDATE,b.MBLNO,b.HBLNO,b.CUSTNO,b.ORDERNO");
strSql.Append(",b.CUSTOMERNAME");
strSql.Append(",b.VESSEL,b.VOYNO,b.ETD,b.PORTLOAD");
strSql.Append(",b.PORTDISCHARGE,b.DESTINATION,b.INPUTBY,b.OP,b.CUSTSERVICE");
@ -506,7 +506,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice
{
strSql.Append(" where (c.ISDELETED=0 or c.ISDELETED IS NULL) and " + strCondition);
}
strSql.Append(" GROUP BY b.OPLBNAME,b.BSSTATUS,b.ACCDATE,b.MBLNO,b.HBLNO,b.CUSTNO");
strSql.Append(" GROUP BY b.OPLBNAME,b.BSSTATUS,b.ACCDATE,b.MBLNO,b.HBLNO,b.CUSTNO,b.ORDERNO");
strSql.Append(",b.CUSTOMERNAME");
strSql.Append(",b.VESSEL,b.VOYNO,b.ETD,b.PORTLOAD");
strSql.Append(",b.PORTDISCHARGE,b.DESTINATION,b.INPUTBY,b.OP,b.CUSTSERVICE");
@ -547,6 +547,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice
data.MBLNO = Convert.ToString(reader["MBLNO"]);
data.HBLNO = Convert.ToString(reader["HBLNO"]);
data.CUSTNO = Convert.ToString(reader["CUSTNO"]);
data.ORDERNO = Convert.ToString(reader["ORDERNO"]);
data.CUSTOMERNAME = Convert.ToString(reader["CUSTOMERNAME"]);
data.VESSEL = Convert.ToString(reader["VESSEL"]);
data.VOYNO = Convert.ToString(reader["VOYNO"]);
@ -4113,6 +4114,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice
var custbank = "";
var custaccount = "";
if (head.CUSTBANK != null)
{
string[] custbanklist = head.CUSTBANK.Trim().Split(' ');
if (custbanklist.Length == 2)
{
@ -4120,6 +4123,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoice
custaccount = custbanklist[1];
}
}
using (var conn = db.CreateConnection())
{

@ -4336,7 +4336,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
var strSql = new StringBuilder();
strSql.Append(" SELECT cm.BILLNO,cm.BILLSTATUS,cm.CUSTOMERNAME,cm.INVNO,cm.INVOICECUSTNAME, ");
strSql.Append("cm.CURR,cm.AMOUNT,cm.REMARKS,cm.INVDATE,cm.TAXCODE,");
strSql.Append("cm.ADDRTEL,cm.BANK,cm.OP,cm.OPDATE");
strSql.Append("cm.ADDRTEL,cm.BANK,cm.OP,cm.OPDATE,'' as SALECORP");
strSql.Append(" FROM v_fee_do_payapplication f left join ch_fee_invoicehexiao cm on (cm.BILLNO=f.PAYBILLNO) where f.BILLNO='" + billno + "'");
return SetInvhxData(strSql);
@ -21149,18 +21149,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (dsARTMSFC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (dsARTMSFC.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + dsVWChFeeAR.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (dsARTMSFC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (dsARTMSFC.ISITEMACC)
{
@ -21302,18 +21303,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (dsAR.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (dsAR.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + dsVWChFeeAR.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (dsAR.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (dsAR.ISITEMACC)
{
@ -21475,18 +21477,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (dsARFC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (dsARFC.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + dsVWChFeeAR.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (dsARFC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (dsARFC.ISITEMACC)
{
@ -21631,18 +21634,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (dsAPMBSPENDING.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (dsAPMBSPENDING.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + dsVWChFeeAR.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (dsAPMBSPENDING.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (dsAPMBSPENDING.ISITEMACC)
{
@ -21803,18 +21807,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (dsAPTMSFC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (dsAPTMSFC.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + dsVWChFeeAR.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (dsAPTMSFC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (dsAPTMSFC.ISITEMACC)
{
@ -21956,18 +21961,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (dsAP.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (dsAP.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + dsVWChFeeAR.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (dsAP.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (dsAP.ISITEMACC)
{
@ -22128,18 +22134,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (dsAPFC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (dsAPFC.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + dsVWChFeeAR.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (dsAPFC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (dsAPFC.ISITEMACC)
{
@ -22344,18 +22351,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (DRACCID.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (DRACCID.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + dsVWChFeeAR.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (DRACCID.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (DRACCID.ISITEMACC)
{
@ -22559,18 +22567,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (CRACCID.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (CRACCID.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + dsVWChFeeAR.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (CRACCID.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (CRACCID.ISITEMACC)
{
@ -23310,18 +23319,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = dsVwcfsdCASHCE.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (dsCASH.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVwcfsdCASHCE.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (dsCASH.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = dsVwcfsdCASHCE.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + dsVwcfsdCASHCE.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (dsCASH.ISEMPLACC)
{
MsCwVouitemsGl.SALE = dsVwcfsdCASHCE.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (dsCASH.ISITEMACC)
{
@ -23973,18 +23983,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = ds.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (BANKACC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = ds.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (BANKACC.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = ds.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + ds.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (BANKACC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = ds.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (BANKACC.ISITEMACC)
{
@ -24255,18 +24266,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.CUSTOMERNAME = ds.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim();//客户(系统)
strACCALL += "▁" + MsCwVouitemsGl.CUSTOMERNAME;
}
//是否核算人员_揽货人
if (BANKACC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = ds.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算部门
if (BANKACC.ISDEPTACC)
{
MsCwVouitemsGl.DEPTGID = ds.Tables[0].Rows[i]["DEPTGID"].ToString().Trim();//揽货人的部门
strACCALL += "▁" + ds.Tables[0].Rows[i]["DEPTNAME"].ToString().Trim();
}
//是否核算人员_揽货人
if (BANKACC.ISEMPLACC)
{
MsCwVouitemsGl.SALE = ds.Tables[0].Rows[i]["SALE"].ToString().Trim();//人员名称
strACCALL += "▁" + MsCwVouitemsGl.SALE;
}
//是否核算项目
if (BANKACC.ISITEMACC)
{

@ -5615,7 +5615,7 @@ Ext.extend(Shipping.MsChfeeAudit, Ext.Panel, {
var Settlement = rec.data.Settlement;
var Invoice = rec.data.Invoice;
var OrderInvoice = rec.data.OrderInvoice;
if (Settlement != 0 || Invoice != 0 || Invoice != 0) {
if ( Invoice != 0 || Invoice != 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi,
msg: Zi.LAN.NOtUpdate,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK

@ -4882,6 +4882,9 @@ SetRemarksTemplate: function () {
StoreFieldName.add({ "OPLBNAME": "外币金额(总计)" });
StoreFieldName.add({ "OPLBNAME": "人民币金额(总计)" });
StoreFieldName.add({ "OPLBNAME": "折算汇率(总计)" });
StoreFieldName.add({ "OPLBNAME": "购方银行" });
StoreFieldName.add({ "OPLBNAME": "购方账号" });
StoreFieldName.add({ "OPLBNAME": "销方银行" });
var gridField = new Ext.grid.GridPanel({
store: StoreFieldName,

@ -3362,8 +3362,8 @@ Ext.extend(Shipping.MsChRecvInvSettlementEdit, Ext.Panel, {
this.storeAddFeeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: this.BillSql });
var sql = this.sqlcontext;
Ext.apply(store.proxy.extraParams, { condition: this.sql });
}, this);
this.storeBodydetail.on('beforeload', function (store) {

@ -135,6 +135,13 @@ namespace DSWeb.MvcShipping.Controllers
headData.BSNO = "topseaepre" + Guid.NewGuid().ToString().Replace("-","");
}
var ct = MsOpSeaePreDAL.GetRdCount("BSNO<>'" + headData.BSNO + "' AND MBLNO='" + headData.MBLNO + "'");
if (ct != 0)
{
var jsonRespose = new JsonResponse { Success = false, Message = "主提单号不允许重复!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
//
if (headData.ETD == "") headData.ETD = null;

@ -844,7 +844,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
{
strSql.Append(" where " + strCondition);
}
strSql.Append(" order by FEEGROUP,sort,LineNum ");
strSql.Append(" order by isnull(FEEGROUP,''),sort,LineNum ");
return SetData(strSql);
}
@ -4646,7 +4646,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
var Closefee = MsSysParamSetDAL.GetData("PARAMNAME='closeafterPrintProfit'");
if (Closefee.PARAMVALUE == "1")
{
var cmddelete = db.GetSqlStringCommand("update " + oplb + " set FEESTATUS=1 where BSNO=@BSNO");
var cmddelete = db.GetSqlStringCommand("update op_amend set FEESTATUS=1 where BSNO=@BSNO");
cmddelete.Parameters.Clear();
db.AddInParameter(cmddelete, "@BSNO", DbType.String, pbsno);
db.ExecuteNonQuery(cmddelete, tran);

@ -1672,18 +1672,17 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
}
if (visiblerange == "4")
{
str = " (OP='" + username + "' OR CREATEUSER='" + userid + "' OR SALE='" + username + "' OR CUSTSERVICE='" + username + "')";
str = " (OP='" + username + "' OR CREATEUSER='" + userid + "' OR SALE='" + username + "' OR CUSTSERVICE='" + username + "' OR FRCUSTSERVICE='" + username + "')";
}
else if (visiblerange == "3")
{
str = " (OP='" + username + "' OR CREATEUSER='" + userid + "' OR SALE='" + username + "' OR CUSTSERVICE='" + username + "')";
str = " (OP='" + username + "' OR CREATEUSER='" + userid + "' OR SALE='" + username + "' OR CUSTSERVICE='" + username + "' OR FRCUSTSERVICE='" + username + "')";
}
else if (visiblerange == "2")
{
var rangeDa = new RangeDA();
var deptname = rangeDa.GetDEPTNAME(userid);
str = " (OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))"
+ " OR CREATEUSER in (select GID from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "')))";
var deptid = rangeDa.GetDEPTGID(userid);
str = $" exists(select 1 from vw_user where deptgid='{deptid}' and SHOWNAME in(op_other.OP,op_other.SALE,op_other.CUSTSERVICE,op_other.FRCUSTSERVICE,op_other.DOC)) ";
}
else if (visiblerange == "1")
{
@ -1724,32 +1723,34 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
{
if (tb == "index")
{
var opstr = "";
var userstr = new StringBuilder();
userstr.Append(" select OPID,(select SHOWNAME from [user] where GID=user_authority_range_op.OPID) SHOWNAME from user_authority_range_op where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1");
Database userdb = DatabaseFactory.CreateDatabase();
using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString()))
{
//var opstr = "";
//var userstr = new StringBuilder();
//userstr.Append(" select OPID,(select SHOWNAME from [user] where GID=user_authority_range_op.OPID) SHOWNAME from user_authority_range_op where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1");
//Database userdb = DatabaseFactory.CreateDatabase();
//using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString()))
//{
// while (reader.Read())
// {
// if (opstr == "")
// {
// opstr = " ('" + Convert.ToString(reader["SHOWNAME"]) + "'";
// }
// else
// {
// opstr = opstr + ",'" + Convert.ToString(reader["SHOWNAME"]) + "'";
// };
// }
// if (opstr != "") opstr = opstr + ")";
// reader.Close();
//}
//if (opstr == "") opstr = "('" + username + "')";
//str = " (OP in " + opstr + " or CREATEUSER in " + opstr + " or CUSTSERVICE IN " + opstr + " or SALE IN " + opstr + " )";
str = " EXISTS (select 1 from user_authority_range_op P left join [user] u on (u.GID=P.OPID) where (op_other.OP=U.SHOWNAME OR op_other.SALE=U.SHOWNAME OR op_other.CUSTSERVICE=U.SHOWNAME OR op_other.DOC=U.SHOWNAME OR op_other.FRCUSTSERVICE=U.SHOWNAME) AND P.userid='" + userid + "' and P.AUTHORITYID='" + AUTHORITYID + "' and P.VISIBLERANGE=1) ";
while (reader.Read())
{
if (opstr == "")
{
opstr = " ('" + Convert.ToString(reader["SHOWNAME"]) + "'";
}
else
{
opstr = opstr + ",'" + Convert.ToString(reader["SHOWNAME"]) + "'";
};
}
if (opstr != "") opstr = opstr + ")";
reader.Close();
}
if (opstr == "") opstr = "('" + username + "')";
str = " (OP in " + opstr + " or CREATEUSER in " + opstr + " or CUSTSERVICE IN " + opstr + " or SALE IN " + opstr + " )";
}
else

@ -756,7 +756,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaePreDAL
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(" Count(BSNO) AS CT ");
strSql.Append(" from op_other ");
strSql.Append(" from op_seae_pre ");
if (strCondition.Trim() != String.Empty)
{
strSql.Append(" where " + strCondition);

@ -911,9 +911,20 @@ namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL
var feelist = MsChFeeDAL.MsChFeeDAL.GetDataList("BSNO='" + bsno + "'", 0, "", "", "", "");
if (feelist != null) {
var USEBLFeeAudit = MsSysParamSetDAL.GetData("PARAMNAME='USEaleOrderFeeAudit'");
var WorkFlowName = "";
if (USEBLFeeAudit.PARAMVALUE == "1")
{
WorkFlowName = "SaleOrderFeeAudit";
Chfee_AuditDAL.Chfee_AuditDAL.SubmitAuditNew("op_Seae", userid, feelist, true, WorkFlowName,"1", companyid);
}
else
{
var ISSALEWORK = MsSysParamSetDAL.GetData("PARAMNAME='SALESUBMITFEE'");
Chfee_AuditDAL.Chfee_AuditDAL.SubmitAuditNew("op_Seae", userid, feelist, true, "", ISSALEWORK.PARAMVALUE,companyid);
Chfee_AuditDAL.Chfee_AuditDAL.SubmitAuditNew("op_Seae", userid, feelist, true, "", ISSALEWORK.PARAMVALUE, companyid);
}
}

@ -782,8 +782,9 @@ Ext.extend(Shipping.YJFeeEditGrid, Ext.Panel, {
}, this);
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.girdcolums.unshift(new Ext.grid.RowNumberer());
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.gridList.columns[1] = new Ext.grid.RowNumberer();
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.sortfield = column.dataIndex;

@ -893,7 +893,6 @@ Ext.extend(Shipping.MsInfoClientContractDsEdit, Ext.Panel, {
this.formEdit.getForm().setValues(returnData);
this.strBSNO = returnData.GID;
this.storeBodyList_ACCDATE.load({ params: { condition: "CONTRACTGID='" + returnData.GID + "'", isedit: "1" } });
this.storeContractRangeList.load({ params: { condition: "LINKID='" + returnData.GID + "'"} });
if (this.opStatus == 'add') {
var arrNewRecords = this.StoreList.insert(0, returnData);
this.editRecord = this.StoreList.getAt(0);
@ -909,6 +908,7 @@ Ext.extend(Shipping.MsInfoClientContractDsEdit, Ext.Panel, {
}, this);
this.editRecord.commit();
}
this.opStatus = 'edit';
if (type == '0') {
this.opStatus = 'edit';
@ -921,6 +921,8 @@ Ext.extend(Shipping.MsInfoClientContractDsEdit, Ext.Panel, {
this.LoadData('add', '');
basicForm.findField('GID').setDisabled(false);
}
this.storeContractRangeList.load({ params: { condition: "LINKID='" + returnData.GID + "'" } });
} else {
Ext.Msg.show({ title: Zi.LAN.CuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}

@ -457,6 +457,7 @@ Ext.extend(Shipping.MsInfoClientContractEdit, Ext.Panel, {
}, this);
this.editRecord.commit();
}
this.opStatus = 'edit';
if (type == '0') {
this.opStatus = 'edit';

@ -649,6 +649,10 @@ Ext.extend(Shipping.MsOpOtherIndex, Ext.Panel, {
dataIndex: 'SALECORP',
header:'所属分部', //'货物标识',
width: 120
}, {
dataIndex: 'FRCUSTSERVICE',
header: '海外客服', //'货物标识',
width: 120
}];
this.girdcolums = this.initgirdcolums;

@ -972,7 +972,37 @@ Ext.extend(Shipping.MsOpSeaePreIndex, Ext.Panel, {
displayField: 'VOYNO'
});
this.storeCodeLoadportm = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeLoadportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportListRm' }
});
this.comboxPORTLOADm = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '装货港', //'装货港',
store: this.storeCodeLoadportm,
name: 'PORTLOAD',
valueField: 'PORT',
displayField: 'CodeAndName',
queryMode: 'remote',
minChars: 2,
queryParam: 'PORT',
matchFieldWidth: false
});
this.storeCodeDisportm = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' }
});
this.comboxPORTDISCHARGEm = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '卸货港', //'卸货港',
store: this.storeCodeDisportm,
name: 'PORTDISCHARGE',
matchFieldWidth: false,
valueField: 'PORT',
queryMode: 'remote',
minChars: 2,
queryParam: 'PORT',
displayField: 'CodeAndName'
});
this.formModify = Ext.widget('form', {
region: 'north',
@ -1001,6 +1031,12 @@ Ext.extend(Shipping.MsOpSeaePreIndex, Ext.Panel, {
items: [this.comboxVoyVegm, this.comboxVoyNom
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxPORTLOADm, this.comboxPORTDISCHARGEm
]
},{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',

@ -1337,10 +1337,15 @@ Ext.extend(Shipping.MsOp_BLISSUEIndex, Ext.Panel, {
// isloadfee = false;
if (record.data.BLNO != "" && BSNO != "") {
if (LINKGID!= "") {
if (LINKGID != "") {
this.logsql = " (BSNO='" + LINKGID + "' or BSNO in(select linkgid from op_blissuelist_detail where BSNO='" + BSNO + "')) ";
this.storeLog.load({ params: { condition: " (BSNO='" + LINKGID + "' or BSNO in(select linkgid from op_blissuelist_detail where BSNO='" + BSNO + "')) "} });
} else this.storeLog.removeAll();
this.storeLog.load({ params: { condition: " (BSNO='" + LINKGID + "' or BSNO in(select linkgid from op_blissuelist_detail where BSNO='" + BSNO + "')) " } });
} else {
this.logsql = " BSNO in(select linkgid from op_blissuelist_detail where BSNO='" + BSNO + "') ";
this.storeLog.load({ params: { condition: " BSNO in(select linkgid from op_blissuelist_detail where BSNO='" + BSNO + "') " } });
}
Ext.Ajax.request({
waitMsg: '正在提交数据...',

@ -200,12 +200,6 @@ Ext.extend(Shipping.MsOp_BLISSUESPIndex, Ext.Panel, {
header: '揽货人',
width: 80
},
{
sortable: true,
dataIndex: 'OP',
header: '操作',
width: 80
},
{
sortable: true,
dataIndex: 'SALEDEPT',
@ -453,6 +447,33 @@ Ext.extend(Shipping.MsOp_BLISSUESPIndex, Ext.Panel, {
}
});
//人员信息加载
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
});
//操 作
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操 作', //'操 作',
store: this.storeOpCode,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
labelWidth: 30,
forceSelection: true,
name: 'OP',
flex: 0.6, valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//#endregion
this.formSearch_SP = Ext.widget('form', {
@ -496,7 +517,7 @@ Ext.extend(Shipping.MsOp_BLISSUESPIndex, Ext.Panel, {
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETD_END'
}]
},this.comboxOP]
}, {
xtype: 'container',
layout: 'hbox',
@ -1165,6 +1186,8 @@ Ext.extend(Shipping.MsOp_BLISSUESPIndex, Ext.Panel, {
var CUSTNO = form.findField('CUSTNO').getValue();
sql = sql + getAndConSql(sql, CUSTNO, " ob.GID in(select LINKGID from op_blissuelist_Detail where BSNO in(select BSNO from v_op_blissue_bill where CUSTNO like '%" + CUSTNO + "%')) ");
var OP = form.findField('OP').getValue();
sql = sql + getAndConSql(sql, OP, " ob.GID in(select LINKGID from op_blissuelist_Detail where BSNO in(select BSNO from v_op_blissue_bill where OP='" + OP + "')) ");
var BLSTATUS = form.findField('BLSTATUS').getValue();

@ -67,6 +67,7 @@
<ItemGroup>
<Compile Include="DateTimeExtension.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="JobHCCreateFee.cs" />
<Compile Include="JobDjyD7Xf.cs" />
<Compile Include="JobDjyD6Xf.cs" />
<Compile Include="JobYt2D6Fee.cs" />

@ -278,6 +278,13 @@ namespace JobCreateFee
}
else if (FeeTempDetail.CLIENT == "OP")
{
custtype = "操作";
}
else
{
@ -962,6 +969,7 @@ namespace JobCreateFee
if (custtype == "CUSTOMERNAME") custname = opSeae.CUSTOMERNAME;
if (custtype == "CUSTOMSER") custname = opSeae.CUSTOMSER;
if (custtype == "SHIPAGENCY") custname = opSeae.SHIPAGENCY;
if (custtype == "OP") custname = opSeae.OP;
return custname;
}

@ -77,7 +77,7 @@ namespace JobCreateFee
dbcon.Open();
foreach (var returndata in returnlist)
{
if (returndata.sendcom.IndexOf("捷丰") > 0)
if (returndata.sendcom.IndexOf("捷丰") > 0 && (returndata.mblno.IndexOf("ONEY")>0))
{
var bsno = GETD6BSNO(returndata.mblno, dbcon);
@ -97,7 +97,8 @@ namespace JobCreateFee
if (string.IsNullOrEmpty(bsno) && (headstr == "QGD" || headstr == "AMQ" || headstr == "AMG" || headstr == "AYQ"))
{
SaveMail(dbcon, "CMABKG@SDSMARTLOGISTICS.COM", returndata.mblno + "此单号已退仓,但是系统检测到打印过小票" + returndata.ctnrCount + "次,请知悉,谢谢", returndata.mblno + "此单号已退仓,但是系统检测到打印过小票" + returndata.ctnrCount + "次,请知悉,谢谢", "1");
var DELETBS = GETDELETED6BS(returndata.mblno, dbcon);
SaveMail(dbcon, "CMABKG@SDSMARTLOGISTICS.COM", returndata.mblno+ DELETBS.CUSTOMERNAME + "此单号已退仓,但是系统检测到打印过小票" + returndata.ctnrCount + "次,请知悉,谢谢", returndata.mblno + "此单号已退仓,但是系统检测到打印过小票" + returndata.ctnrCount + "次,请知悉,谢谢", "1");
}
}
@ -134,6 +135,28 @@ namespace JobCreateFee
return cmd.ExecuteNonQuery();
}
static public D6BS GETDELETED6BS(string MBLNO, SqlConnection dbcon)
{
var newbs = new D6BS();
var strSql = new StringBuilder();
strSql.Append("SELECT TOP 1 删除人 CUSTOMERNAME from t_op_delete where 主提单号='" + MBLNO + "'");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
var BSNO = "";
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
newbs.CUSTOMERNAME = row["CUSTOMERNAME"].ToString();
}
}
return newbs;
}
static public string GETD6BSNO(string MBLNO, SqlConnection dbcon)
{

@ -505,7 +505,7 @@ namespace JobCreateFee
bool status = true;
//连接共享文件夹
//status = connectState(RemotePathName, Users, pw);
status = connectState(RemotePathName, Users, pw);
if (status)
{
//共享文件夹的目录

@ -0,0 +1,526 @@
using log4net;
using Newtonsoft.Json;
using Quartz;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using JobAutoCreateFee.Model;
namespace JobCreateFee
{
public class JobHCCreateFee : IJob
{
private ILog log = LogManager.GetLogger(typeof(JobHCCreateFee));
public void Execute(IJobExecutionContext context)
{
string connStr = context.JobDetail.JobDataMap.GetString("ConnectString");
string querySql = context.JobDetail.JobDataMap.GetString("QuerySql");
using (SqlConnection dbcon = new SqlConnection(connStr))
{
var clientlist = CreateClientList(dbcon);
var strSql = new StringBuilder();
strSql.Append("select * from t_ch_project_new where 方案状态='审核通过' order by 方案名称 ");
SqlCommand cmd = new SqlCommand();
cmd.CommandText = strSql.ToString();
cmd.CommandTimeout = 120000; //要加这一句
cmd.Connection = dbcon;
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataTable table = new DataTable();
adapter.Fill(table);
if (table.Rows.Count > 0)
{
var feeprojectlist = CreateFeeProjectList(table);
if (feeprojectlist != null)
{
foreach (var enumFeeproject in feeprojectlist)
{
log.Debug($"开始费用方案:{enumFeeproject.FADESCRIP}--{DateTime.Now.ToString()}");
var bsstr = CreateSql(enumFeeproject.FA_ID, dbcon);
var strSqlBs = new StringBuilder();
strSqlBs.Clear();
strSqlBs.Append("select B.编号,B.方案名称,B.主提单号,B.委托单位,B.船公司,B.货代公司,B.报关行,B.船代,B.场站,B.代理,B.发货人,B.收货人,B.通知人,B.第三方付费,B.其他相关公司,B.承运车队,B.预抵日期 ");
strSqlBs.Append(" from t_op_seae B where ISNULL(B.是否占舱,'')<>'Y' And B.预抵日期>='"+ enumFeeproject.ETDFR + "' and B.预抵日期<'"+ enumFeeproject.ETDTO + "' ");
if (querySql != "")
strSqlBs.Append(querySql);
strSqlBs.Append(bsstr);
log.Debug($"费用方案语句:{strSqlBs.ToString()}");
SqlCommand cmdBS = new SqlCommand();
cmdBS.CommandText = strSqlBs.ToString();
cmdBS.CommandTimeout = 120000; //要加这一句
cmdBS.Connection = dbcon;
SqlDataAdapter bsadapter = new SqlDataAdapter(cmdBS);
DataTable bstable = new DataTable();
bsadapter.Fill(bstable);
dbcon.Close();
if (bstable.Rows.Count > 0)
{
var OpSeaeList = CreateOpSeaList(bstable);
var FeeTemplateDetailList = GetFeeTemplate(enumFeeproject.FA_ID, dbcon);
try
{
insertFee(OpSeaeList, FeeTemplateDetailList, enumFeeproject, dbcon);
}
catch (Exception e)
{
log.Debug($"{enumFeeproject.FADESCRIP + " " + enumFeeproject.PROJECTTYPE}生成费用错误:{e.Message}");
}
}
}
}
}
}
}
static public List<MsOpSeae> CreateOpSeaList(DataTable table)
{
var headList = new List<MsOpSeae>();
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
MsOpSeae data = new MsOpSeae();
data.BSNO = row["编号"].ToString();
data.MBLNO= row["主提单号"].ToString();
data.CUSTOMERNAME = row["委托单位"].ToString();
data.CARRIER = row["船公司"].ToString();
data.FORWARDER = row["货代公司"].ToString();
data.CUSTOMSER = row["报关行"].ToString();
data.CUSTSERVICE = row["船代"].ToString();
data.YARD = row["场站"].ToString();
data.TRUCKER = row["承运车队"].ToString();
data.AGENTID = row["代理"].ToString();
data.SHIPPERID = row["发货人"].ToString();
data.CONSIGNEEID = row["收货人"].ToString();
data.NOTIFYPARTYID = row["通知人"].ToString();
data.THIRDPARTY = row["第三方付费"].ToString();
data.OTHERPARTY = row["其他相关公司"].ToString();
data.DLFA = row["方案名称"].ToString();
if (row["预抵日期"] != DBNull.Value)
data.ETD = Convert.ToDateTime(row["预抵日期"].ToString()).ToString("yyyy-MM-dd");
headList.Add(data);
}
}
return headList;
}
static public List<MsFeeProject> CreateFeeProjectList(DataTable table)
{
var headList = new List<MsFeeProject>();
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
MsFeeProject data = new MsFeeProject();
data.FA_ID = row["方案代码"].ToString();
data.FADESCRIP = row["方案名称"].ToString();
// data.PROJECTTYPE = row["费用类型"].ToString();
if (row["开船日期起"] != DBNull.Value)
data.ETDFR = Convert.ToDateTime(row["开船日期起"].ToString()).ToString("yyyy-MM-dd");
if (row["开船日期止"] != DBNull.Value)
data.ETDTO = Convert.ToDateTime(row["开船日期止"].ToString()).ToString("yyyy-MM-dd");
data.FEETYPE = row["费用类型"].ToString();
data.INPUTBY = row["录入人"].ToString();
data.AUDITER = row["审核人"].ToString();
headList.Add(data);
}
}
return headList;
}
static public List<MsClient> CreateClientList(SqlConnection dbcon)
{
var headList = new List<MsClient>();
var strSql = new StringBuilder();
strSql.Append("SELECT 客户简称,客户全称,客商编码 from t_crm_client ");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
MsClient data = new MsClient();
data.CUSTCODE = row["客户简称"].ToString();
data.CUSTNAME = row["客户全称"].ToString();
data.FULLNAME = row["客商编码"].ToString();
headList.Add(data);
}
}
return headList;
}
private string insertFee(List<MsOpSeae> MsOpSeaeList, List<MsChFee> MsChFeeList, MsFeeProject feeProject, SqlConnection dbcon)
{
if (MsOpSeaeList != null)
{
foreach (var enumValue in MsOpSeaeList)
{
var usdexrate = GetUsdExrate(dbcon,enumValue.ETD);
try
{
if ( enumValue.DLFA.IndexOf(feeProject.FADESCRIP) < 0)
{
log.Debug($"{enumValue.MBLNO}开始生成费用,方案:{feeProject.FADESCRIP}--{DateTime.Now.ToString()}");
var FeeUnitList = GetFeeUnit(enumValue.BSNO, dbcon);
var oldfeelist = GetFeeList(enumValue.BSNO, dbcon);
if (MsChFeeList != null)
{
var iscreatefee = false;
foreach (var enumFeeValue in MsChFeeList)
{
decimal exrate = 1;
if (enumFeeValue.Currency == "USD") exrate = usdexrate;
decimal feequantity = 0;
decimal amount = 0;
decimal tax = 0;
FeeUnitList.ForEach(i =>
{
if (i.FEEUNIT == enumFeeValue.Unit)
{
feequantity = i.FEEQUANTITY;
amount = feequantity * enumFeeValue.UnitPrice;
}
});
tax =0;
var customername = GetClient(enumFeeValue.CustomerType, enumValue, enumFeeValue.CustomerName);
if (oldfeelist.Find(x=>x.CustomerName==customername&&x.FeeName== enumFeeValue.FeeName&&x.Unit== enumFeeValue.Unit&&x.Amount==amount&&x.Currency==enumFeeValue.Currency&&x.FeeType==enumFeeValue.FeeType)==null)
if (enumFeeValue.UnitPrice != 0 && amount != 0&& customername!="")
{
string sql = "INSERT INTO [t_ch_fee] ([类型],[费用状态],[编号],[费用名称],[结算单位],[客户名称],[标准]";
sql = sql + ",[单价],[数量],[金额],[币别],[汇率],[备注],[结算金额],[开票金额]";
sql = sql + ",[录入人],[录入日期],[是否对帐],[顺序],[冲抵金额]";
sql = sql + ",[机密],[是否垫付],[申请金额],[不开发票],[费用英文名称]";
sql = sql + ",[申请开票],[提交],[不含税价],[税率],[税额],方案名称) VALUES ";
sql = sql + "('" + enumFeeValue.FeeType + "','审核通过','" + enumValue.BSNO + "','" + enumFeeValue.FeeName + "','" + enumFeeValue.CustomerType + "','" + customername+ "','" + enumFeeValue.Unit.Replace("'", "''") + "'";
sql = sql + "," + enumFeeValue.UnitPrice + "," + feequantity.ToString() + "," + amount.ToString() + ",'" + enumFeeValue.Currency + "'," + exrate.ToString() + ",'" + enumFeeValue.Remark + "',0,0";
sql = sql + ",'DEMO-SA',GETDATE(),0," + enumFeeValue.Sort + ",0";
sql = sql + ",0,0,0,0,'"+enumFeeValue.FeeEName + "'";
sql = sql + ",0,0," + enumFeeValue.UnitPrice + "," + enumFeeValue.TAXRATE + "," + tax.ToString() + ",'" + feeProject.FADESCRIP + "')";
log.Debug($"{enumValue.MBLNO},方案:{feeProject.FADESCRIP}-费用语句-{sql}");
dbcon.Open();
SqlCommand cmd = new SqlCommand(sql, dbcon);
cmd.ExecuteNonQuery();
dbcon.Close();
iscreatefee = true;
}
if (enumFeeValue.UnitPrice == 0) iscreatefee = true;
}
if (iscreatefee)
{
string sqlupdate = "UPDATE [t_op_seae] set 编号=编号 ";
sqlupdate = sqlupdate + " ,方案名称=ISNULL(方案名称,'')+'," + feeProject.FA_ID + "'";
enumValue.DLFA = enumValue.DLFA + "(" + feeProject.FA_ID + ")";
dbcon.Open();
sqlupdate = sqlupdate + " WHERE 编号='" + enumValue.BSNO + "'";
SqlCommand cmdupdate = new SqlCommand(sqlupdate, dbcon);
cmdupdate.ExecuteNonQuery();
dbcon.Close();
}
}
}
}
catch {
log.Debug($"{enumValue.MBLNO},方案:{feeProject.FADESCRIP}-生成费用出错!-{DateTime.Now.ToString()}");
}
}
}
return "";
}
static public string CreateSql(string FA_ID, SqlConnection dbcon)
{
var str = " and 1=1 ";
var headList = new List<MsChFee>();
var strSql = new StringBuilder();
strSql.Append("SELECT *");
strSql.Append(" from t_ch_project_Condition where 方案代码=" + FA_ID);
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
str = str + " AND " + row["条件名称"].ToString();
str = str + "='" + row["条件值"].ToString() + "'";
}
}
return str;
}
static public List<MsChFee> GetFeeTemplate(string FA_ID, SqlConnection dbcon)
{
var headList = new List<MsChFee>();
var strSql = new StringBuilder();
strSql.Append("SELECT * ");
strSql.Append(" from t_ch_project_fee_new where 方案代码=" + FA_ID);
strSql.Append(" order by 顺序,DE_ID");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
var Feedata = new MsChFee();
Feedata.DE_ID = row["DE_ID"].ToString();
Feedata.FA_ID =row["方案代码"].ToString();
Feedata.FeeName = row["费用名称"].ToString();
Feedata.CustomerType = row["结算单位"].ToString();
Feedata.CustomerName = row["客户名称"].ToString();
Feedata.Currency = row["币别"].ToString();
if (row["汇率"] != DBNull.Value)
Feedata.ExChangerate= Convert.ToDecimal(row["汇率"].ToString());
if (row["单价"] != DBNull.Value)
Feedata.UnitPrice = Convert.ToDecimal(row["单价"].ToString());
if (row["税率"] != DBNull.Value)
Feedata.TAXRATE = Convert.ToDecimal(row["税率"].ToString());
Feedata.Unit =row["标准"].ToString();
// Feedata. = row["税率"].ToString();
Feedata.Remark = row["费用备注"].ToString();
headList.Add(Feedata);
}
}
return headList;
}
static public List<MsChFee> GetFeeList(string BSNO, SqlConnection dbcon)
{
var headList = new List<MsChFee>();
var strSql = new StringBuilder();
strSql.Append("SELECT * ");
strSql.Append(" from t_ch_fee where 编号='" + BSNO + "'");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
var Feedata = new MsChFee();
Feedata.FeeName = row["费用名称"].ToString();
Feedata.CustomerName = row["客户名称"].ToString();
Feedata.Currency = row["币别"].ToString();
if (row["金额"] != DBNull.Value)
Feedata.Amount = Convert.ToDecimal(row["金额"].ToString());
Feedata.Unit = row["标准"].ToString();
Feedata.FeeType= row["类型"].ToString();
headList.Add(Feedata);
}
}
return headList;
}
static public List<MsFeeUnit> GetFeeUnit(string BSNO, SqlConnection dbcon)
{
decimal TEUNUM;
TEUNUM = 0;
decimal PKGS;
PKGS = 0;
decimal KGS;
KGS = 0;
decimal CBM;
CBM = 0;
decimal NETWEIGHT = 0;
decimal CTNNUM;
CTNNUM = 0;
decimal FEEKGS=0;
var headList = new List<MsFeeUnit>();
var strSql = new StringBuilder();
strSql.Append("SELECT NO,PKGS,KGS,CBM,NETWEIGHT,FEEKGS,CTNALL,CTNNUM,TEU FROM (");
strSql.Append("SELECT '1' as NO,件数 PKGS,重量 KGS,尺码 CBM,重量 AS NETWEIGHT,计价重量 AS FEEKGS,");
strSql.Append("'' as CTNALL,0 AS CTNNUM,0 AS TEU ");
strSql.Append(",isnull((select sum(数量) from t_op_ctn where 编号=t_op_seae.编号),0) 总箱数 ");
// strSql.Append(",isnull((select sum(ctnrCount) from t_op_txxp_log where 编号=t_op_seae.编号),0)-isnull((select sum(数量) from t_op_ctn where 编号=t_op_seae.编号),0) 超额小票数 ");
strSql.Append(" from t_op_seae ");
strSql.Append(" where 编号='"+BSNO+"'");
strSql.Append(") AS T ");
strSql.Append(" union ");
strSql.Append("SELECT '2' AS NO,0 AS PKGS,0 AS KGS,0 AS CBM,0 AS NETWEIGHT,0 AS FEEKGS,");
strSql.Append("P.表现形式 CTNALL,SUM(P.数量) AS CTNNUM,SUM(P.TEU) AS TEU");
strSql.Append(" from t_op_ctn P ");
strSql.Append(" where p.编号='"+BSNO+"'");
strSql.Append(" GROUP BY P.表现形式 order by PKGS desc");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
var isfirst = 0;
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
if (row["NO"].ToString() == "1") {
var data = new MsFeeUnit();
data.FEEUNIT = "单票";
data.FEEQUANTITY = 1;
headList.Add(data);
if (!string.IsNullOrEmpty(row["PKGS"].ToString()))
PKGS = Convert.ToDecimal(row["PKGS"].ToString());
if (!string.IsNullOrEmpty(row["KGS"].ToString()))
KGS = Convert.ToDecimal(row["KGS"].ToString());
if (!string.IsNullOrEmpty(row["CBM"].ToString()))
CBM = Convert.ToDecimal(row["CBM"].ToString());
if (!string.IsNullOrEmpty(row["NETWEIGHT"].ToString()))
NETWEIGHT = Convert.ToDecimal(row["NETWEIGHT"].ToString());
if (!string.IsNullOrEmpty(row["FEEKGS"].ToString()))
FEEKGS = Convert.ToDecimal(row["FEEKGS"].ToString());
var data2 = new MsFeeUnit();
data2.FEEUNIT = "重量";
data2.FEEQUANTITY = KGS;
headList.Add(data2);
var data3 = new MsFeeUnit();
data3.FEEUNIT = "尺码";
data3.FEEQUANTITY = CBM;
headList.Add(data3);
var data4 = new MsFeeUnit();
data4.FEEUNIT = "件数";
data4.FEEQUANTITY = PKGS;
headList.Add(data4);
var data5 = new MsFeeUnit();
data5.FEEUNIT = "计价重量";
data5.FEEQUANTITY = FEEKGS;
headList.Add(data5);
var data6 = new MsFeeUnit();
data6.FEEUNIT = "计费吨";
data6.FEEQUANTITY =0;
headList.Add(data6);
}
if (row["CTNALL"].ToString()!="") {
var ctndata = new MsFeeUnit();
ctndata.FEEUNIT = row["CTNALL"].ToString();
if (!string.IsNullOrEmpty(row["CTNNUM"].ToString()))
ctndata.FEEQUANTITY= Convert.ToDecimal(row["CTNNUM"].ToString());
CTNNUM = CTNNUM + ctndata.FEEQUANTITY;
if (!string.IsNullOrEmpty(row["TEU"].ToString()))
TEUNUM = TEUNUM + Convert.ToDecimal(row["TEU"].ToString());
headList.Add(ctndata);
}
isfirst = 1;
}
var teudata = new MsFeeUnit();
teudata.FEEUNIT = "TEU";
teudata.FEEQUANTITY = TEUNUM;
headList.Add(teudata);
var ctnalldata = new MsFeeUnit();
ctnalldata.FEEUNIT = "箱数";
ctnalldata.FEEQUANTITY = CTNNUM;
headList.Add(ctnalldata);
}
return headList;
}
static public string GetClient(string custtype, MsOpSeae opSeae,string cust)
{
if (cust != "") return cust;
var custname = "";
if (custtype == "委托单位") custname = opSeae.CUSTOMERNAME;
if (custtype == "船公司") custname = opSeae.CARRIER;
if (custtype == "货代") custname = opSeae.FORWARDER;
if (custtype == "车队") custname = opSeae.TRUCKER;
if (custtype == "报关行") custname = opSeae.CUSTOMSER;
if (custtype == "船代") custname = opSeae.CUSTSERVICE;
if (custtype == "场站") custname = opSeae.YARD;
if (custtype == "代理") custname = opSeae.AGENTID;
if (custtype == "第三方") custname = opSeae.THIRDPARTY;
if (custtype == "发货人") custname = opSeae.SHIPPERID;
if (custtype == "收货人") custname = opSeae.CONSIGNEEID;
if (custtype == "通知人") custname = opSeae.NOTIFYPARTYID;
if (custtype == "其他相关公司") custname = opSeae.OTHERPARTY;
return custname;
}
static public decimal GetUsdExrate(SqlConnection dbcon,string etd)
{
decimal usdexrate = 0;
var strSql = new StringBuilder();
strSql.Append("select 汇率 from t_code_usdexrate where 开始日期<='"+ etd + "' and 结束日期>='"+ etd + "'");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
usdexrate= Convert.ToDecimal(row["汇率"].ToString());
}
}
if (usdexrate == 0) {
SqlDataAdapter adapter2 = new SqlDataAdapter("select 汇率 from t_code_currency where 币别='USD'", dbcon);
DataTable table2 = new DataTable();
adapter2.Fill(table2);
if (table2.Rows.Count > 0)
{
foreach (DataRow row in table2.Rows)
{
usdexrate = Convert.ToDecimal(row["汇率"].ToString());
}
}
}
return usdexrate;
}
}
}

@ -46,17 +46,19 @@ namespace JobCreateFee
//发送请求数据
string rtn = WebRequestHelper.DoPost(reqUrl, sendstr, reqTimeout * 1000);
log.Debug($"数据返回:{rtn}");
var objRtn = JsonConvert.DeserializeAnonymousType(rtn, new { status = "", message = "" });
//var objRtn = JsonConvert.DeserializeAnonymousType(rtn, new { status = "", message = "" });
var objRtn = JsonConvert.DeserializeObject<josnYtData>(rtn);
if (objRtn.status == "1")
{
var parseJsonObj = JsonConvert.DeserializeObject<List<JsonYtFee>>(objRtn.message);
//var parseJsonObj = JsonConvert.DeserializeObject<List<JsonYtFee>>(objRtn.message);
try
{
using (SqlConnection dbcon = new SqlConnection(connStr))
{
var FEELIST = new List<D6BS>();
dbcon.Open();
foreach (var returndata in parseJsonObj)
foreach (var returndata in objRtn.message)
{
if (returndata.fee == "" || returndata.fee == null) returndata.fee = "0";
if (returndata.ydFee == "" || returndata.ydFee == null) returndata.ydFee = "0";
@ -66,120 +68,173 @@ namespace JobCreateFee
string sql = " INSERT INTO t_op_ytfee_log([bsno],[vessel],[voyage],[bookingno],[ctn_type],[ctn_no],[yard],[operatetime],[operatetype]";
sql = sql + ",[printType],[fee],[ydFee],[secondPrintFee],[applicant_code]) values ('" + D6BS.BSNO + "','" + returndata.vessel + "'";
sql = sql + ",'" + returndata.voyage + "','" + returndata.bookingno + "','" + returndata.ctn_type + "','" + returndata.ctn_no + "','" + returndata.yard + "'";
sql = sql + "," + returndata.operatetime + ",'" + returndata.operatetype + "'," + returndata.printType + ",'" + returndata.fee
sql = sql + ",'" + returndata.operatetime + "','" + returndata.operatetype + "','" + returndata.printType + "','" + returndata.fee
+ "','" + returndata.ydFee + "','" + returndata.secondPrintFee + "','" + returndata.applicant_code + "')";
SqlCommand cmd = new SqlCommand(sql, dbcon);
cmd.ExecuteNonQuery();
if (!string.IsNullOrEmpty(D6BS.BSNO)) {
if (!string.IsNullOrEmpty(D6BS.BSNO))
{
decimal txxpf = 0;
decimal dxf = 0;
if (Convert.ToDecimal(returndata.ydFee) != 0)
{
dxf = Convert.ToDecimal(returndata.ydFee);
var fee = FEELIST.Find(x => x.BSNO == D6BS.BSNO && x.FEETYPE == "调箱费");
if (fee != null)
{
fee.AMOUNT = fee.AMOUNT + dxf;
fee.QUANTITY = fee.QUANTITY + 1;
}
else
{
var newfee = new D6BS();
newfee.BSNO = D6BS.BSNO;
newfee.CUSTOMERNAME = D6BS.CUSTOMERNAME;
newfee.AMOUNT = dxf;
newfee.FEETYPE = "调箱费";
newfee.QUANTITY = 1;
FEELIST.Add(newfee);
}
}
if (Convert.ToDecimal(returndata.fee) != 0)
{
txxpf = Convert.ToDecimal(returndata.fee);
var fee = FEELIST.Find(x => x.BSNO == D6BS.BSNO && x.FEETYPE == "提箱小票费"&& x.ISDX ==false);
if (fee != null)
{
fee.AMOUNT = fee.AMOUNT + txxpf;
fee.QUANTITY = fee.QUANTITY +1;
}
else
{
var newfee = new D6BS();
newfee.BSNO = D6BS.BSNO;
newfee.CUSTOMERNAME = D6BS.CUSTOMERNAME;
newfee.AMOUNT = txxpf;
newfee.FEETYPE = "提箱小票费";
newfee.QUANTITY = 1;
newfee.ISDX = false;
FEELIST.Add(newfee);
}
}
if (Convert.ToDecimal(returndata.secondPrintFee) != 0)
{
txxpf = Convert.ToDecimal(returndata.secondPrintFee);
var fee = FEELIST.Find(x => x.BSNO == D6BS.BSNO && x.FEETYPE == "提箱小票费" && x.ISDX == true);
if (fee != null)
{
fee.AMOUNT = fee.AMOUNT + txxpf;
fee.QUANTITY = fee.QUANTITY + 1;
}
else
{
var newfee = new D6BS();
newfee.BSNO = D6BS.BSNO;
newfee.CUSTOMERNAME = D6BS.CUSTOMERNAME;
newfee.AMOUNT = txxpf;
newfee.FEETYPE = "提箱小票费";
newfee.ISDX = true;
newfee.QUANTITY = 1;
FEELIST.Add(newfee);
}
}
string Feesql = "INSERT INTO [t_ch_fee] ([类型],[费用状态],[编号],[费用名称],[结算单位],[客户名称],[标准]";
Feesql = Feesql + ",[单价],[数量],[金额],[币别],[汇率],[备注],[结算金额],[开票金额]";
Feesql = Feesql + ",[录入人],[录入日期],[是否对帐],[顺序],[冲抵金额]";
Feesql = Feesql + ",[机密],[是否垫付],[申请金额],[不开发票],[费用英文名称]";
Feesql = Feesql + ",[申请开票],[提交],[不含税价],[税率],[税额],PROJECTFEEID) VALUES ";
Feesql = Feesql + "('收','审核通过','" + D6BS.BSNO + "','提箱小票费','委托单位','" + D6BS.CUSTOMERNAME + "','单票'";
Feesql = Feesql + ",5,1,5,'RMB',1,'',0,0";
Feesql = Feesql + ",'DEMO-SA',GETDATE(),0,100,0";
Feesql = Feesql + ",0,0,0,0,''";
Feesql = Feesql + ",0,0,5,0,0,'易通小票费')";
Feesql = Feesql + " INSERT INTO [t_ch_fee] ([类型],[费用状态],[编号],[费用名称],[结算单位],[客户名称],[标准]";
Feesql = Feesql + ",[单价],[数量],[金额],[币别],[汇率],[备注],[结算金额],[开票金额]";
Feesql = Feesql + ",[录入人],[录入日期],[是否对帐],[顺序],[冲抵金额]";
Feesql = Feesql + ",[机密],[是否垫付],[申请金额],[不开发票],[费用英文名称]";
Feesql = Feesql + ",[申请开票],[提交],[不含税价],[税率],[税额],PROJECTFEEID) VALUES ";
Feesql = Feesql + "('付','审核通过','" + D6BS.BSNO + "','提箱小票费','代理','亿通(付费)','单票'";
Feesql = Feesql + ","+ returndata.fee + ",1,"+ returndata.fee + ",'RMB',1,'',0,0";
Feesql = Feesql + ",'DEMO-SA',GETDATE(),0,100,0";
Feesql = Feesql + ",0,0,0,0,''";
Feesql = Feesql + ",0,0,"+ returndata.fee + ",0,0,'易通小票费')";
}
log.Debug($"费用语句-{Feesql}");
dbcon.Open();
SqlCommand Feecmd = new SqlCommand(Feesql, dbcon);
Feecmd.ExecuteNonQuery();
dbcon.Close();
var headstr = "";
if (returndata.bookingno.Length > 3)
{
headstr = returndata.bookingno.Substring(0, 3);
}
if (Convert.ToDecimal(returndata.ydFee) != 0)
if (string.IsNullOrEmpty(D6BS.BSNO) && (headstr == "QGD" || headstr == "AMQ" || headstr == "AMG" || headstr == "AYQ"))
{
var DELETBS = GETDELETED6BS(returndata.bookingno, dbcon);
string Feesql = "INSERT INTO [t_ch_fee] ([类型],[费用状态],[编号],[费用名称],[结算单位],[客户名称],[标准]";
Feesql = Feesql + ",[单价],[数量],[金额],[币别],[汇率],[备注],[结算金额],[开票金额]";
Feesql = Feesql + ",[录入人],[录入日期],[是否对帐],[顺序],[冲抵金额]";
Feesql = Feesql + ",[机密],[是否垫付],[申请金额],[不开发票],[费用英文名称]";
Feesql = Feesql + ",[申请开票],[提交],[不含税价],[税率],[税额],PROJECTFEEID) VALUES ";
Feesql = Feesql + "('收','审核通过','" + D6BS.BSNO + "','提箱小票费','委托单位','" + D6BS.CUSTOMERNAME + "','单票'";
Feesql = Feesql + "," + returndata.ydFee + ",1," + returndata.ydFee + ",'RMB',1,'',0,0";
Feesql = Feesql + ",'DEMO-SA',GETDATE(),0,100,0";
Feesql = Feesql + ",0,0,0,0,''";
Feesql = Feesql + ",0,0," + returndata.ydFee + ",0,0,'易通小票费')";
Feesql = Feesql + " INSERT INTO [t_ch_fee] ([类型],[费用状态],[编号],[费用名称],[结算单位],[客户名称],[标准]";
Feesql = Feesql + ",[单价],[数量],[金额],[币别],[汇率],[备注],[结算金额],[开票金额]";
Feesql = Feesql + ",[录入人],[录入日期],[是否对帐],[顺序],[冲抵金额]";
Feesql = Feesql + ",[机密],[是否垫付],[申请金额],[不开发票],[费用英文名称]";
Feesql = Feesql + ",[申请开票],[提交],[不含税价],[税率],[税额],PROJECTFEEID) VALUES ";
Feesql = Feesql + "('付','审核通过','" + D6BS.BSNO + "','提箱小票费','代理','C亿通付费','单票'";
Feesql = Feesql + "," + returndata.ydFee + ",1," + returndata.ydFee + ",'RMB',1,'',0,0";
Feesql = Feesql + ",'DEMO-SA',GETDATE(),0,100,0";
Feesql = Feesql + ",0,0,0,0,''";
Feesql = Feesql + ",0,0," + returndata.ydFee + ",0,0,'易通小票费')";
SaveMail(dbcon, "CMABKG@SDSMARTLOGISTICS.COM", returndata.bookingno+ DELETBS .CUSTOMERNAME+ "此单号已退仓,但是系统检测到打印过小票" + returndata.printType + ",请知悉,谢谢", returndata.bookingno + "此单号已退仓,但是系统检测到打印过小票" + returndata.printType + ",请知悉,谢谢", "1");
}
log.Debug($"费用语句-{Feesql}");
dbcon.Open();
SqlCommand Feecmd = new SqlCommand(Feesql, dbcon);
Feecmd.ExecuteNonQuery();
dbcon.Close();
}
if (Convert.ToDecimal(returndata.secondPrintFee) != 0)
if (FEELIST != null && FEELIST.Count!=0) {
foreach(var FEE in FEELIST)
{
var DRAMOUNT = FEE.AMOUNT;
var CRCUST = "C亿通付费";
if (FEE.FEETYPE == "提箱小票费" && FEE.ISDX == false)
{
DRAMOUNT = FEE.AMOUNT * 5;
CRCUST = "亿通(付费)";
}
string Feesql = "INSERT INTO [t_ch_fee] ([类型],[费用状态],[编号],[费用名称],[结算单位],[客户名称],[标准]";
Feesql = Feesql + ",[单价],[数量],[金额],[币别],[汇率],[备注],[结算金额],[开票金额]";
Feesql = Feesql + ",[录入人],[录入日期],[是否对帐],[顺序],[冲抵金额]";
Feesql = Feesql + ",[机密],[是否垫付],[申请金额],[不开发票],[费用英文名称]";
Feesql = Feesql + ",[申请开票],[提交],[不含税价],[税率],[税额],PROJECTFEEID) VALUES ";
Feesql = Feesql + "('收','审核通过','" + D6BS.BSNO + "','调箱费','委托单位','" + D6BS.CUSTOMERNAME + "','单票'";
Feesql = Feesql + "," + returndata.secondPrintFee + ",1," + returndata.secondPrintFee + ",'RMB',1,'',0,0";
Feesql = Feesql + "('收','审核通过','" + FEE.BSNO + "','"+FEE.FEETYPE+"','委托单位','" + FEE.CUSTOMERNAME + "','单票'";
Feesql = Feesql + ","+ DRAMOUNT.ToString() + ",1," + DRAMOUNT.ToString() + ",'RMB',1,'" + FEE.QUANTITY.ToString() + "票',0,0";
Feesql = Feesql + ",'DEMO-SA',GETDATE(),0,100,0";
Feesql = Feesql + ",0,0,0,0,''";
Feesql = Feesql + ",0,0," + returndata.secondPrintFee + ",0,0,'易通小票费')";
Feesql = Feesql + ",0,0," + DRAMOUNT.ToString() + ",0,0,'易通小票费')";
Feesql = Feesql + " INSERT INTO [t_ch_fee] ([类型],[费用状态],[编号],[费用名称],[结算单位],[客户名称],[标准]";
Feesql = Feesql + ",[单价],[数量],[金额],[币别],[汇率],[备注],[结算金额],[开票金额]";
Feesql = Feesql + ",[录入人],[录入日期],[是否对帐],[顺序],[冲抵金额]";
Feesql = Feesql + ",[机密],[是否垫付],[申请金额],[不开发票],[费用英文名称]";
Feesql = Feesql + ",[申请开票],[提交],[不含税价],[税率],[税额],PROJECTFEEID) VALUES ";
Feesql = Feesql + "('付','审核通过','" + D6BS.BSNO + "','调箱费','代理','C亿通付费','单票'";
Feesql = Feesql + "," + returndata.secondPrintFee + ",1," + returndata.secondPrintFee + ",'RMB',1,'',0,0";
Feesql = Feesql + "('付','审核通过','" + FEE.BSNO + "','"+ FEE.FEETYPE + "','代理','"+ CRCUST + "','单票'";
Feesql = Feesql + "," + FEE.AMOUNT.ToString() + ",1," + FEE.AMOUNT.ToString() + ",'RMB',1,'"+FEE.QUANTITY.ToString()+"票',0,0";
Feesql = Feesql + ",'DEMO-SA',GETDATE(),0,100,0";
Feesql = Feesql + ",0,0,0,0,''";
Feesql = Feesql + ",0,0," + returndata.secondPrintFee + ",0,0,'易通小票费')";
Feesql = Feesql + ",0,0," + FEE.AMOUNT.ToString() + ",0,0,'易通小票费')";
log.Debug($"费用语句-{Feesql}");
dbcon.Open();
//dbcon.Open();
SqlCommand Feecmd = new SqlCommand(Feesql, dbcon);
Feecmd.ExecuteNonQuery();
dbcon.Close();
}
}
//dbcon.Close();
//if (Convert.ToDecimal(returndata.ydFee) != 0)
//{
// string Feesql = "INSERT INTO [t_ch_fee] ([类型],[费用状态],[编号],[费用名称],[结算单位],[客户名称],[标准]";
// Feesql = Feesql + ",[单价],[数量],[金额],[币别],[汇率],[备注],[结算金额],[开票金额]";
// Feesql = Feesql + ",[录入人],[录入日期],[是否对帐],[顺序],[冲抵金额]";
// Feesql = Feesql + ",[机密],[是否垫付],[申请金额],[不开发票],[费用英文名称]";
// Feesql = Feesql + ",[申请开票],[提交],[不含税价],[税率],[税额],PROJECTFEEID) VALUES ";
// Feesql = Feesql + "('收','审核通过','" + D6BS.BSNO + "','调箱费','委托单位','" + D6BS.CUSTOMERNAME + "','单票'";
// Feesql = Feesql + "," + returndata.ydFee + ",1," + returndata.ydFee + ",'RMB',1,'',0,0";
// Feesql = Feesql + ",'DEMO-SA',GETDATE(),0,100,0";
// Feesql = Feesql + ",0,0,0,0,''";
// Feesql = Feesql + ",0,0," + returndata.ydFee + ",0,0,'易通小票费')";
// Feesql = Feesql + " INSERT INTO [t_ch_fee] ([类型],[费用状态],[编号],[费用名称],[结算单位],[客户名称],[标准]";
// Feesql = Feesql + ",[单价],[数量],[金额],[币别],[汇率],[备注],[结算金额],[开票金额]";
// Feesql = Feesql + ",[录入人],[录入日期],[是否对帐],[顺序],[冲抵金额]";
// Feesql = Feesql + ",[机密],[是否垫付],[申请金额],[不开发票],[费用英文名称]";
// Feesql = Feesql + ",[申请开票],[提交],[不含税价],[税率],[税额],PROJECTFEEID) VALUES ";
// Feesql = Feesql + "('付','审核通过','" + D6BS.BSNO + "','提箱小票费','代理','C亿通付费','单票'";
// Feesql = Feesql + "," + returndata.ydFee + ",1," + returndata.ydFee + ",'RMB',1,'',0,0";
// Feesql = Feesql + ",'DEMO-SA',GETDATE(),0,100,0";
// Feesql = Feesql + ",0,0,0,0,''";
// Feesql = Feesql + ",0,0," + returndata.ydFee + ",0,0,'易通小票费')";
// log.Debug($"费用语句-{Feesql}");
// //dbcon.Open();
// SqlCommand Feecmd = new SqlCommand(Feesql, dbcon);
// Feecmd.ExecuteNonQuery();
// //dbcon.Close();
//}
var headstr = "";
if (returndata.bookingno.Length > 3)
{
headstr = returndata.bookingno.Substring(0, 3);
}
if (string.IsNullOrEmpty(D6BS.BSNO) && (headstr == "QGD" || headstr == "AMQ" || headstr == "AMG" || headstr == "AYQ"))
{
SaveMail(dbcon, "CMABKG@SDSMARTLOGISTICS.COM", returndata.bookingno + "此单号已退仓,但是系统检测到打印过小票" + returndata.printType + ",请知悉,谢谢", returndata.bookingno + "此单号已退仓,但是系统检测到打印过小票" + returndata.printType + ",请知悉,谢谢", "1");
}
}
dbcon.Close();
}
}
@ -231,6 +286,27 @@ namespace JobCreateFee
}
return newbs;
}
static public D6BS GETDELETED6BS(string MBLNO, SqlConnection dbcon)
{
var newbs = new D6BS();
var strSql = new StringBuilder();
strSql.Append("SELECT TOP 1 删除人 CUSTOMERNAME from t_op_delete where 主提单号='" + MBLNO + "'");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
adapter.Fill(table);
var BSNO = "";
if (table.Rows.Count > 0)
{
foreach (DataRow row in table.Rows)
{
newbs.CUSTOMERNAME = row["CUSTOMERNAME"].ToString();
}
}
return newbs;
}
@ -251,7 +327,13 @@ namespace JobCreateFee
public string end_time { get; set; }
}
public class josnYtData
{
public string status { get; set; }
public List<JsonYtFee> message { get; set; }
}
public class JsonYtFee
{
@ -279,5 +361,12 @@ namespace JobCreateFee
public string BSNO { get; set; }
public string CUSTOMERNAME { get; set; }
public string FEETYPE { get; set; }
public bool ISDX { get; set; }
public decimal AMOUNT { get; set; }
public int QUANTITY { get; set; }
}
}

@ -19,6 +19,10 @@ namespace JobAutoCreateFee.Model
public string INPUTBY { get; set; }
public string OPTYPE { get; set; }
public string AUDITER { get; set; }
public string ETDFR { get; set; }
public string ETDTO { get; set; }
}
public class MsOpFeeCreate
@ -45,7 +49,13 @@ namespace JobAutoCreateFee.Model
}
public class MsClient
{
public string CUSTCODE { get; set; }
public string CUSTNAME { get; set; }
public string FULLNAME { get; set; }
}
[JsonObject]
public class MsFeeUnitD7
{
@ -1238,7 +1248,8 @@ namespace JobAutoCreateFee.Model
get { return _agentid; }
set { _agentid = value; }
}
public string THIRDPARTY { get; set; }
public string OTHERPARTY { get; set; }
private string _agent = "";
/// <summary>
/// 国外代理内容

Loading…
Cancel
Save