hanxuntao 3 months ago
parent 7888384266
commit bc7d74ef21

@ -3876,4 +3876,77 @@ namespace DSWeb.Common.DB
public DateTime? CreateTime { get; set; }
public string Param { get; set; }
}
/// <summary>
/// 大简云VGMsend
/// </summary>
[Table("op_seae_vgm_send")]
public class op_seae_vgm_send_md
{
[Key]
public string GID { get; set; }
public string BSNO { get; set; }
public string VGMSTATUS { get; set; }
public string MFNO { get; set; }
public string MBLNO { get; set; }
public string ORDERNO { get; set; }
public string CARRIER { get; set; }
public string LOADPORT { get; set; }
public string MATOU { get; set; }
public bool? ISCARRIER { get; set; } = false;
public bool? ISYGT { get; set; } = false;
public string YGTSTATUS { get; set; }
public string CARRIERSTATUS { get; set; }
public string YARDSTATUS { get; set; }
public string SENDTYPE { get; set; }
public string VESSEL { get; set; }
public string VOYNO { get; set; }
public DateTime? VGM_TIME { get; set; }
public Int32? CTNNUM { get; set; } = 0;
public string REMARK { get; set; }
public string SENDERUSER { get; set; }
public DateTime? SENDTIME { get; set; }
public string LINKURL { get; set; }
[NotMapped]
public string sendstatus { get; set; }
}
[Table("op_seae_vgm_history")]
public class op_seae_vgm_history_md
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long ID { get; set; } = 0;
public string BSNO { get; set; }
public DateTime? SENDTIME { get; set; }
public string SENDTYPE { get; set; }
public string SENDERUSER { get; set; }
public int? CTNNUM { get; set; } = 0;
public string REMARK { get; set; }
[NotMapped]
public string SENDERNAME { get; set; }
}
/// <summary>
/// 云港通 码头 回执状态 type= YGTYARDCARRIER
/// </summary>
[Table("op_seae_vgm_state")]
public class op_seae_vgm_state_md
{
[Key]
public string gid { get; set; }
public string mfno { get; set; }
public string statustext { get; set; }
public DateTime? statustime { get; set; }
public DateTime? createtime { get; set; }
public string cntrno { get; set; }
public string mblno { get; set; }
public string TIPS { get; set; }
public string Type { get; set; }
}
}

@ -133,6 +133,12 @@ namespace DSWeb.Common.DB
public DbSet<t_Truck_FHApp_Fuel_md> t_Truck_FHApp_Fuel { get; set; }
public DbSet<t_PublicInterface_Log_md> t_PublicInterface_Log { get; set; }
public DbSet<op_seae_vgm_send_md> op_seae_vgm_send { get; set; }
public DbSet<op_seae_vgm_history_md> op_seae_vgm_history { get; set; }
public DbSet<op_seae_vgm_state_md> op_seae_vgm_state { get; set; }
}

@ -1898,7 +1898,6 @@ namespace DSWeb.Areas.Account.Controllers
//head.BILLSTATUS = 0;
head.REDCODE = RedCode;
head.REDNUM = RedNo;
head.INVAMOUNT = head.INVAMOUNT * -1;
head.INVOICEPDFURL = "";
head.INVOICEINFOURL = "";

@ -25467,19 +25467,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
foreach (var enumValue in CwVouitemsEntities)
{
//if (enumValue.AMTCR == 0 && enumValue.AMTDR == 0)
//{
if (enumValue.AMTCR == 0 && enumValue.AMTDR == 0)
{
//}
//else
//{
}
else
{
enumValue.GID = Guid.NewGuid().ToString();
// enumValue.ITEMNO = n;//行号
enumValue.DbOperationType = DbOperationType.DbotIns;
var modb2 = new ModelObjectDB();
DBResult result2 = modb2.Save(enumValue);
//}
n++;
}
n++;
}
//把凭证号更新到ch_fee_settlement
//string blSQL = "update ch_fee_settlement set VOUCHERNO='" + MsCwVouchersGl.VOUALLNO + "' where gid in(" + sGids.Trim() + ")";

@ -3186,6 +3186,11 @@ Ext.extend(Shipping.MsChInvoicehexiaoEdit, Ext.Panel, {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '必须填折算汇率!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (UsdExrate < 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '折算汇率不能小于0!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var recs = DsStoreQueryBy(me.storeCurrExrate, 'CURR', bfcurr);
if (recs.getCount() > 0) {

@ -5078,6 +5078,11 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
Ext.Msg.show({ title: '提示', msg: '必须填折算汇率!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (UsdExrate < 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '折算汇率不能小于0!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var recs = DsStoreQueryBy(me.storeCurrExrate, 'CURR', bfcurr);
if (recs.getCount() > 0) {
// var dfdata = DFrecords.getAt(0).data;

@ -5988,6 +5988,11 @@ Ext.extend(Shipping.MsChInvoiceBLEdit, Ext.Panel, {
Ext.Msg.show({ title: '提示', msg: '必须填折算汇率!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (UsdExrate < 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '折算汇率不能小于0!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var recs = DsStoreQueryBy(me.storeCurrExrate, 'CURR', bfcurr);
if (recs.getCount() > 0) {

@ -6316,6 +6316,11 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
Ext.Msg.show({ title: '提示', msg: '必须填折算汇率!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (UsdExrate < 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '折算汇率不能小于0!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var recs = DsStoreQueryBy(me.storeCurrExrate, 'CURR', bfcurr);
if (recs.getCount() > 0) {
// var dfdata = DFrecords.getAt(0).data;

@ -7533,6 +7533,11 @@ Ext.extend(Shipping.MsChInvoiceBLEdit, Ext.Panel, {
});
return;
};
if (UsdExrate < 0) {
Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '折算汇率不能小于0!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var recs = DsStoreQueryBy(me.storeCurrExrate, 'CURR', bfcurr);
if (recs.getCount() > 0) {

@ -61,6 +61,7 @@ using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
using DSWeb.SoftMng.Model;
using System.Configuration;
using ICSharpCode.SharpZipLib.BZip2;
using DSWeb.MvcShipping.Models.CodeCtnEdi;
namespace DSWeb.Areas.CommMng.DAL
{
@ -3428,6 +3429,78 @@ namespace DSWeb.Areas.CommMng.DAL
}
#endregion
static public List<CodeCtnEdi> GetCustList(string strCondition, string sort = null)
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append("GID,CUST as CTN,EDICODE,EDINAME,REMARK");
strSql.Append(",(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97012 and EnumValueID=code_cust_edi.EDINAME) as EDINAMEREF,'' as PORTID");
strSql.Append(" from code_cust_edi where 1=1 ");
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" and " + strCondition);
}
var sortstring = DatasetSort.Getsortstring(sort);
if (!string.IsNullOrEmpty(sortstring))
{
strSql.Append(" order by " + sortstring);
}
else
{
strSql.Append(" order by EDINAME,CUST");
}
return SetData(strSql);
}
private static List<CodeCtnEdi> SetData(StringBuilder strSql)
{
var headList = new List<CodeCtnEdi>();
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
CodeCtnEdi data = new CodeCtnEdi();
#region Set DB data to Object
data.GID = Convert.ToString(reader["GID"]);
data.CTN = Convert.ToString(reader["CTN"]);
data.EDICODE = Convert.ToString(reader["EDICODE"]);
data.EDINAME = Convert.ToString(reader["EDINAME"]);
data.EDINAMEREF = Convert.ToString(reader["EDINAMEREF"]);
data.REMARK = Convert.ToString(reader["REMARK"]);
data.PORTID = Convert.ToString(reader["PORTID"]);
#endregion
headList.Add(data);
}
reader.Close();
}
return headList;
}
public static string GetCustEdiCodeByName2(string CUSTOMERNAME, string EDINAME)
{
var condition = $"code_cust_edi.CUST='{CUSTOMERNAME}' and EDINAME='{EDINAME}'";
var result = GetCustList(condition);
if (result != null && result.Count > 0)
{
return result[0].EDICODE;
}
else
{
return CUSTOMERNAME;
}
}
public static string Unicode2String(string source)
{
return new Regex(@"\\u([0-9A-F]{4})", RegexOptions.IgnoreCase | RegexOptions.Compiled).Replace(
source, x => string.Empty + Convert.ToChar(Convert.ToUInt16(x.Result("$1"), 16)));
}
#region 付费方式
static public List<CodeFrtModel> GetCodeFrtList()
{
@ -7493,5 +7566,7 @@ namespace DSWeb.Areas.CommMng.DAL
}
}
}

@ -29,6 +29,7 @@ using DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
using DSWeb.Areas.MvcShipping.Models.Message.VGM;
using System.Net;
using System.Threading;
namespace DSWeb.Areas.CommMng.DAL
{
@ -2876,5 +2877,84 @@ namespace DSWeb.Areas.CommMng.DAL
}
//ReceiveDjyVGMReceipt
}
public class DJYVGMReceipt_MqWorkDAL
{
#region 大简云VGM回执回推处理
public static void ReceiveDjyVGMReceipt(string itemstr)
{
try
{
Task.Run(() => { Do_ReceiveDjyVGMReceipt(itemstr); });
}
catch (Exception e)
{
//var errorobjstr = JsonConvert.SerializeObject(e);
//logger.Error($"导入出错:{e}//{errorobjstr}");
}
}
//ReceiveDjyVGMReceipt
public static void Do_ReceiveDjyVGMReceipt(string itemstr, int count = 0)
{
if (count > 2)
{
Thread.Sleep(300);
//loggerHelper.Save($"重试完结");
return;
}
var statusList = JsonConvert.DeserializeObject<List<op_seae_vgm_state_md>>(itemstr);
var cdc = new CommonDataContext();
try
{
var bsnoList = statusList.Select(s => s.mfno).Distinct().ToList();
var op_seaeList = cdc.OP_SEAE.Where(s => bsnoList.Contains(s.BSNO)).ToList();
foreach (var op_seae in op_seaeList)
{
var head = cdc.op_seae_vgm_send.FirstOrDefault(x => x.BSNO == op_seae.BSNO);
foreach (var item in statusList.Where(s => s.mfno == op_seae.BSNO).OrderBy(o => o.statustime).ToList())
{
cdc.op_seae_vgm_state.AddOrUpdate(item);
if (item.Type == "YGT")
head.YGTSTATUS = item.statustext;
if (item.Type == "YARD")
head.YARDSTATUS = item.statustext;
if (item.Type == "CARRIER")
head.CARRIERSTATUS = item.statustext;
cdc.op_seae_vgm_send.AddOrUpdate(head);
}
}
}
catch (Exception e)
{
}
finally
{
}
}
#endregion
}
}

@ -15,6 +15,7 @@ using DSWeb.Areas.MvcShipping.DB;
using DSWeb.MvcShipping.Models.MsOpSeae;
using DSWeb.Areas.MvcShipping.Models.Message.VGM;
using DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL;
using DSWeb.Common.DB;
namespace DSWeb.Areas.CommMng.Models
{
@ -1742,4 +1743,31 @@ namespace DSWeb.Areas.CommMng.Models
#endregion
public class DJYResult
{
public int statusCode { get; set; }
public object data { get; set; }
public bool? succeeded { get; set; }
public bool? errors { get; set; }
}
public class vgmResult : DJYResult
{
public string data { get; set; }
public string errors { get; set; }
}
public class djyvgmresult : DJYResult
{
public op_seae_vgm_send_md data { get; set; }
public string errors { get; set; }
}
}

@ -7,6 +7,7 @@ using System.IO;
using System.Xml;
using System.Net;
using System.IO.Compression;
using System.Collections.Specialized;
namespace DSWeb.Areas.MvcShipping.Comm
{
@ -97,6 +98,87 @@ namespace DSWeb.Areas.MvcShipping.Comm
return responseString;
}
public static string DoGet_Param_Header(string url, Dictionary<string, string> dic, int timeout = 10000, NameValueCollection Headers = null)
{
string responseString = "";//post返回的结果
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, err) => { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
if (dic.Count > 0)
{
url += "?";
var paramstr = "";
foreach (var item in dic)
{
if (paramstr != "") paramstr += "&";
paramstr += $"{item.Key}={item.Value}";
}
url += paramstr;
}
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
req.Method = "GET";
req.Timeout = timeout;
if (Headers != null)
{
foreach (string key in Headers.Keys)
{
req.Headers.Add(key, Headers[key]);
}
}
req.ContentLength = 0;
var response = req.GetResponse();
Stream streamResponse = response.GetResponseStream();
StreamReader streamRead = new StreamReader(streamResponse);
responseString = streamRead.ReadToEnd();
response.Close();
streamRead.Close();
return responseString;
}
public static string DoPost_JSON_Header(string url, string json, int timeout = 10000, NameValueCollection Headers = null)
{
string responseString = "";//post返回的结果
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, err) => { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
req.Method = "POST";
req.Timeout = timeout;
req.Headers.Add("Accept-Encoding", "gzip, deflate");
if (Headers != null)
{
foreach (string key in Headers.Keys)
{
req.Headers.Add(key, Headers[key]);
}
}
if (!string.IsNullOrWhiteSpace(json))
{
byte[] postBytes = Encoding.UTF8.GetBytes(json);
req.ContentType = "application/json; charset=utf-8";
req.ContentLength = Encoding.UTF8.GetByteCount(json);
Stream stream = req.GetRequestStream();
stream.Write(postBytes, 0, postBytes.Length);
stream.Close();
}
else
{
req.ContentLength = 0;
}
var response = req.GetResponse();
responseString = GetResponseBody((HttpWebResponse)response);
return responseString;
}
private static string GetResponseBody(HttpWebResponse response)
{
string responseBody = string.Empty;

@ -1530,7 +1530,7 @@ namespace DSWeb.MvcShipping.Controllers
public ContentResult GetGainPrint(string bsno, string oplb)
{
DBResult result = MsChFeeDAL.GetGainPrint(bsno, oplb, Convert.ToString(Session["USERID"]));
DBResult result = MsChFeeDAL.GetGainPrint(bsno, oplb, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]));
if (result.Success) {
var isopen = MsBaseInfoDAL.GetUserModuleEnable("modFeenotopen", Convert.ToString(Session["USERID"]));
@ -1546,7 +1546,7 @@ namespace DSWeb.MvcShipping.Controllers
public ContentResult GetGainPrintAmend(string bsno,string pbsno,string oplb)
{
DBResult result = MsChFeeDAL.GetGainPrintAmend(bsno,pbsno,oplb);
DBResult result = MsChFeeDAL.GetGainPrintAmend(bsno,pbsno,oplb, Convert.ToString(Session["SHOWNAME"]));
if (result.Success)
{

@ -0,0 +1,346 @@
using System;
using System.Linq;
using System.Web.Mvc;
using DSWeb.MvcShipping.Helper;
using DSWeb.MvcShipping.Comm.Cookie;
using HcUtility.Comm;
using HcUtility.Core;
using System.Collections.Generic;
using DSWeb.EntityDA;
using DSWeb.SoftMng.Filter;
using Renci.SshNet.Common;
using DSWeb.MvcShipping.DAL.MsOpVgmSendDAL;
using DSWeb.MvcShipping.Models.MsOpVgmSend;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.Areas.Dispatch.DB;
using DSWeb.Common.DB;
using static DSWeb.MvcShipping.DAL.MsOpVgmSendDAL.MsOpVgmSendDAL;
namespace DSWeb.MvcShipping.Controllers
{
[JsonRequestBehavior]
public class MsOpVgmSendController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult Edit()
{
return View();
}
public ActionResult ModifyEdit()
{
return View();
}
public ActionResult ModifyHisEdit()
{
return View();
}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetDataList(int start, int limit, string sort, string condition)
{
var dataList = MsOpVgmSendDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
var list = dataList.Skip(start).Take(limit);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
return new ContentResult() { Content = json };
}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetDataListStr(string sort, string condition)
{
var dataListStr = MsOpVgmSendDAL.GetDataListStr(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", data = dataListStr });
return new ContentResult() { Content = json };
}
//public ContentResult GetDataListSum(int start, int limit, string sort, string condition)
//{
// var dataList = MsOpSeaePreDAL.GetDataListSum(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
// var list = dataList.Skip(start).Take(limit);
// var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() });
// return new ContentResult() { Content = json };
//}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetData(string bsno)
{
MsOpVgmSend head = null;
head = MsOpVgmSendDAL.GetData("BSNO='"+bsno+"'");
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
/// <summary>
/// 点击 发送VGM
/// </summary>
/// <param name="data"></param>
/// <param name="bodylist"></param>
/// <returns></returns>
public ContentResult SendVgm(string data,string bodylist)
{
if (Convert.ToString(Session["COMPANYID"]).ToString().Trim() == "" || Convert.ToString(Session["USERID"]).ToString().Trim() == "" || Convert.ToString(Session["CODENAME"]).ToString().Trim() == "" || Convert.ToString(Session["SHOWNAME"]).ToString().Trim() == "" || Convert.ToString(Session["DEPTNAME"]).ToString().Trim() == "")
{
var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
//
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
var headData = JsonConvert.Deserialize<MsOpVgmSend>(data);
var MsOpVgmCtnList = JsonConvert.Deserialize<List<MsOpVgmCtn>>(bodylist);
var result = new DBResult();
var oldheaddata= MsOpVgmSendDAL.GetData("BSNO='" + headData.BSNO + "'");
if (!string.IsNullOrEmpty(oldheaddata.BSNO))
{
headData.GID = oldheaddata.GID;
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
}
else
{
//分公司代码
if (string.IsNullOrEmpty(headData.GID))
{
headData.GID = Guid.NewGuid().ToString().Replace("-", "");
}
//
headData.DbOperationType = DbOperationType.DbotIns;
}
//
string rq = T_ALL_DA.GetStrSQL("rq", "select getdate() as rq");
headData.SENDERUSER = Convert.ToString(Session["USERID"]);//创建人
headData.SENDTIME = DateTime.Parse(rq);//创建时间
headData.VGMSTATUS = "未发送";
headData.CTNNUM = MsOpVgmCtnList.Count;
result.OK();
if (headData.CTNNUM == null) { headData.CTNNUM = 0; }
//if (headData.CTNNUM == 0) {
// result.SetErrorInfo("必须有至少一条集装箱信息");
//}
if (result.Success)
{
var modb = new ModelObjectDB();
result = modb.Save(headData);
if (result.Success) {
if (MsOpVgmCtnList != null && MsOpVgmCtnList.Count > 0) {
foreach (var item in MsOpVgmCtnList) {
item.VGMKGS = item.KGS + item.TAREWEIGHT;
}
}
MsOpVgmSendDAL.SaveDetail(headData.GID, MsOpVgmCtnList);
}
var BSNO = headData.BSNO;
//20240830 发送vgm报文
var _r = MsOpVgmSendDAL.SendDjyVgm(headData, MsOpVgmCtnList);
if (_r.Success)
{
//记录日志
var cdc = new DSWeb.Common.DB.CommonDataContext();
var newrec = new op_seae_vgm_history_md();
newrec.BSNO = headData.BSNO;
newrec.SENDERUSER = headData.SENDERUSER;
newrec.SENDTIME = headData.SENDTIME;
newrec.CTNNUM = headData.CTNNUM;
newrec.REMARK = headData.REMARK;
newrec.SENDTYPE = headData.SENDTYPE;
cdc.op_seae_vgm_history.Add(newrec);
cdc.SaveChanges();
}
return BasicDataRefDAL.GetContentResult(_r);
}
else {
return BasicDataRefDAL.GetContentResult(result);
}
}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetVgmCtnList(string condition, string sort)
{
var dataList = MsOpVgmSendDAL.GetVgmCtnList(condition, sort);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetVgmHistoryList(string condition)
{
var dataList = MsOpVgmSendDAL.GetVgmHistoryList(condition);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
/// <summary>
/// 获取回执状态历史记录
/// </summary>
/// <param name="condition"></param>
/// <returns></returns>
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetStatusList_CARRIER(string condition)
{
var dataList = MsOpVgmSendDAL.GetStatusList(condition,"CARRIER");
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetStatusList_YGT(string condition)
{
var dataList = MsOpVgmSendDAL.GetStatusList(condition,"YGT");
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetStatusList_YARD(string condition)
{
var dataList = MsOpVgmSendDAL.GetStatusList(condition,"YARD");
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetVgmLink(string data, string bodylist)
{
if (Convert.ToString(Session["COMPANYID"]).ToString().Trim() == "" || Convert.ToString(Session["USERID"]).ToString().Trim() == "" || Convert.ToString(Session["CODENAME"]).ToString().Trim() == "" || Convert.ToString(Session["SHOWNAME"]).ToString().Trim() == "" || Convert.ToString(Session["DEPTNAME"]).ToString().Trim() == "")
{
var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
//
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
var headData = JsonConvert.Deserialize<MsOpVgmSend>(data);
var MsOpVgmCtnList = JsonConvert.Deserialize<List<MsOpVgmCtn>>(bodylist);
var result = new DBResult();
var oldheaddata = MsOpVgmSendDAL.GetData("BSNO='" + headData.BSNO + "'");
if (!string.IsNullOrEmpty(oldheaddata.BSNO))
{
headData.GID = oldheaddata.GID;
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
}
else
{
//分公司代码
if (string.IsNullOrEmpty(headData.GID))
{
headData.GID = Guid.NewGuid().ToString().Replace("-", "");
}
//
headData.DbOperationType = DbOperationType.DbotIns;
}
//
string rq = T_ALL_DA.GetStrSQL("rq", "select getdate() as rq");
headData.SENDERUSER = Convert.ToString(Session["USERID"]);//创建人
headData.SENDTIME = DateTime.Parse(rq);//创建时间
headData.VGMSTATUS = "未发送";
headData.CTNNUM = MsOpVgmCtnList.Count;
result.OK();
if (headData.CTNNUM == null) { headData.CTNNUM = 0; }
//if (headData.CTNNUM == 0) {
// result.SetErrorInfo("必须有至少一条集装箱信息");
//}
if (result.Success)
{
var modb = new ModelObjectDB();
result = modb.Save(headData);
if (result.Success)
{
if (MsOpVgmCtnList != null && MsOpVgmCtnList.Count > 0)
{
foreach (var item in MsOpVgmCtnList)
{
item.VGMKGS = item.KGS + item.TAREWEIGHT;
}
}
MsOpVgmSendDAL.SaveDetail(headData.GID, MsOpVgmCtnList);
}
var BSNO = headData.BSNO;
//如果有mfno 获取链接
if (!string.IsNullOrWhiteSpace(headData.MFNO))
{
var gp = new getlinkparam();
gp.mfno = headData.MFNO;
gp.sendCarr = headData.ISCARRIER;
gp.sendYGT = headData.ISYGT;
result = GetDjyVgmLink(gp);
}
else {
var _r = MsOpVgmSendDAL.SendDjyVgm(headData, MsOpVgmCtnList,"0");
if (!_r.Success)
{
return BasicDataRefDAL.GetContentResult(_r);
}
else {
var _data = (op_seae_vgm_send_md)_r.Data;
if (!string.IsNullOrWhiteSpace(_data.LINKURL))
{
result.OK();
}
else
if (!string.IsNullOrWhiteSpace(_data.MFNO))
{
var gp = new getlinkparam();
gp.mfno = _data.MFNO;
gp.sendCarr = headData.ISCARRIER;
gp.sendYGT = headData.ISYGT;
result = GetDjyVgmLink(gp);
}
}
}
return BasicDataRefDAL.GetContentResult(result);
}
else
{
return BasicDataRefDAL.GetContentResult(result);
}
}
}
}

@ -2041,7 +2041,7 @@ namespace DSWeb.MvcShipping.Controllers
if (!string.IsNullOrEmpty(condition))
{
strSql.Append(" and " + condition);
strSql.Append(" WHERE " + condition);
}

@ -2669,7 +2669,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append("GID,BSNO,PARENTID,FEESTATUS,ACCDATE,SALE,CREATEUSER,CREATETIME,REASON,REMARKS,AMENDNO,BillFeeStatus,BILLFEESTATUSTIME");
strSql.Append(",(CASE FEESTATUS WHEN 1 THEN '已锁定' else '未锁定' end) as FEESTATUSREF,PRINTTIME ");
strSql.Append(",(CASE FEESTATUS WHEN 1 THEN '已锁定' else '未锁定' end) as FEESTATUSREF,PRINTTIME,PRINTUSER ");
strSql.Append(" from op_amend ");
if (strCondition.Trim() != String.Empty)
@ -2719,6 +2719,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
if (reader["PRINTTIME"] != DBNull.Value)
data.PRINTTIME = Convert.ToDateTime(reader["PRINTTIME"]).ToString("yyyy-MM-dd HH:mm:ss");//截港日期
data.PRINTUSER = Convert.ToString(reader["PRINTUSER"]);
#endregion
@ -4727,7 +4728,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
#endregion
public static DBResult GetGainPrintAmend(string bsno,string pbsno, string oplb)
public static DBResult GetGainPrintAmend(string bsno,string pbsno, string oplb,string username)
{
var AuditPrint = MsSysParamSetDAL.GetData("PARAMNAME='PrintProfitafterAudit'");
@ -4741,7 +4742,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
var tran = conn.BeginTransaction();
try
{
var cmdupdatePrt = db.GetSqlStringCommand("update op_amend set ISPRINTPR='1',PRINTTIME=GETDATE() where BSNO=@BSNO");
var cmdupdatePrt = db.GetSqlStringCommand("update op_amend set ISPRINTPR='1',PRINTTIME=GETDATE(),PRINTUSER='"+ username + "' where BSNO=@BSNO");
cmdupdatePrt.Parameters.Clear();
db.AddInParameter(cmdupdatePrt, "@BSNO", DbType.String, bsno);
db.ExecuteNonQuery(cmdupdatePrt, tran);
@ -4793,7 +4794,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
return result;
}
public static DBResult GetGainPrint(string bsno, string oplb,string userid)
public static DBResult GetGainPrint(string bsno, string oplb,string userid,string username)
{
var AuditPrint = MsSysParamSetDAL.GetData("PARAMNAME='PrintProfitafterAudit'");
@ -4807,12 +4808,12 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
var tran = conn.BeginTransaction();
try
{
var cmdupdatePrt = db.GetSqlStringCommand("update " + oplb + " set ISPRINTPR='1',PRINTTIME=GETDATE() where BSNO=@BSNO");
var cmdupdatePrt = db.GetSqlStringCommand("update " + oplb + " set ISPRINTPR='1',PRINTTIME=GETDATE(),PRINTUSER='"+ username + "' where BSNO=@BSNO");
cmdupdatePrt.Parameters.Clear();
db.AddInParameter(cmdupdatePrt, "@BSNO", DbType.String, bsno);
db.ExecuteNonQuery(cmdupdatePrt, tran);
var cmdupdatePrt2 = db.GetSqlStringCommand("update op_amend set ISPRINTPR='1',PRINTTIME=GETDATE() where BSNO=@BSNO");
var cmdupdatePrt2 = db.GetSqlStringCommand("update op_amend set ISPRINTPR='1',PRINTTIME=GETDATE(),PRINTUSER='"+ username + "' where BSNO=@BSNO");
cmdupdatePrt2.Parameters.Clear();
db.AddInParameter(cmdupdatePrt2, "@BSNO", DbType.String, bsno);
db.ExecuteNonQuery(cmdupdatePrt2, tran);

@ -73,7 +73,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpAireDAL
strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS,ISPRINTPR");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR");
strSql.Append(",(SELECT COUNT(*) FROM OP_APPLY WHERE MASTERNO=B.BSNO) as APPLYCOUNT,B.BillFeeStatus ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,CONTRACTNO,LANE,DELIVERYDATE,DOC,HSCODE,ISCANCEL,PRINTTIME");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,CONTRACTNO,LANE,DELIVERYDATE,DOC,HSCODE,ISCANCEL,PRINTTIME,PRINTUSER ");
strSql.Append(",(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WHERE BSNO = B.BSNO ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR");
strSql.Append(" from OP_AIRE B");
@ -147,7 +147,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpAireDAL
strSql.Append(",dbo.F_GetBillDrFeeStatus(B.BSNO) DRFEESTATUS");
strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS,ISPRINTPR");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 APPLYCOUNT,B.BillFeeStatus ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,CONTRACTNO,LANE,DELIVERYDATE,DOC,HSCODE,ISCANCEL,PRINTTIME");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,CONTRACTNO,LANE,DELIVERYDATE,DOC,HSCODE,ISCANCEL,PRINTTIME,PRINTUSER ");
strSql.Append(",(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WHERE BSNO = B.BSNO ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR");
strSql.Append(" from OP_AIRE B");
@ -207,7 +207,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpAireDAL
strSql.Append(",(CASE FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF ");
strSql.Append(",(SELECT TOP 1 STATUS FROM OP_STATUS WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS ");
strSql.Append(",CUSTOMNO,ENTERPID,ENTERP,INSPECTIONNO,INSPECTIONDATE,CUSTOMDATE,TRADETYPE,TRADETERM,ISSUEBY,ISSUEDATE,ISSUEPLACE");
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,ISPRINTPR,CONTRACTNO,LANE,DELIVERYDATE,DOC,HSCODE,ISCANCEL,PRINTTIME");
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,ISPRINTPR,CONTRACTNO,LANE,DELIVERYDATE,DOC,HSCODE,ISCANCEL,PRINTTIME,PRINTUSER ");
strSql.Append(" from OP_AIRE B");
if (!string.IsNullOrEmpty(strCondition))
@ -251,7 +251,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpAireDAL
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10");
strSql.Append(",'' DRFEESTATUS");
strSql.Append(",'' CRFEESTATUS,ISPRINTPR,0 TTLDR,0 TTLINVDR,0 TTLDUIDR,0 TTLCR,0 TTLINVCR,0 TTLDUICR,0 APPLYCOUNT,B.BillFeeStatus ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,CONTRACTNO,LANE,DELIVERYDATE,DOC,HSCODE,ISCANCEL,PRINTTIME");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,CONTRACTNO,LANE,DELIVERYDATE,DOC,HSCODE,ISCANCEL,PRINTTIME,PRINTUSER ");
strSql.Append(",'' AS COLOR");
strSql.Append(" from OP_AIRE B");
@ -304,7 +304,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpAireDAL
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10");
strSql.Append(",dbo.F_GetBillDrFeeStatus(B.BSNO) DRFEESTATUS");
strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS,ISPRINTPR,0 TTLDR,0 TTLINVDR,0 TTLDUIDR,0 TTLCR,0 TTLINVCR,0 TTLDUICR,0 APPLYCOUNT,B.BillFeeStatus ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,CONTRACTNO,LANE,DELIVERYDATE,DOC,HSCODE,ISCANCEL,PRINTTIME");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,CONTRACTNO,LANE,DELIVERYDATE,DOC,HSCODE,ISCANCEL,PRINTTIME,PRINTUSER ");
strSql.Append(",(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WHERE BSNO = B.BSNO ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR");
strSql.Append(" from OP_AIRE B");
@ -575,6 +575,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpAireDAL
data.ISCANCEL = Convert.ToString(reader["ISCANCEL"]);
if (reader["PRINTTIME"] != DBNull.Value)
data.PRINTTIME = Convert.ToDateTime(reader["PRINTTIME"]).ToString("yyyy-MM-dd HH:mm:ss");//
data.PRINTUSER = Convert.ToString(reader["PRINTUSER"]);
#endregion
headList.Add(data);
}

@ -80,7 +80,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpAiriDAL
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,CURRENCY,CARGOVALUE");
strSql.Append(",(SELECT COUNT(*) FROM OP_APPLY WHERE MASTERNO=OP_AIRI.BSNO) as APPLYCOUNT ");
strSql.Append(",(SELECT TOP 1 BLSTATUS FROM op_blissue WHERE BSNO=OP_AIRI.BSNO) BLISSUESTATUS,DOC,OP_AIRI.BillFeeStatus ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=OP_AIRI.SALECORPID) as SALECORP,LANE,DELIVERYDATE,HSCODE,PRINTTIME");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=OP_AIRI.SALECORPID) as SALECORP,LANE,DELIVERYDATE,HSCODE,PRINTTIME,PRINTUSER ");
strSql.Append(",(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WHERE BSNO=OP_AIRI.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WHERE BSNO = OP_AIRI.BSNO ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR");
//SR2020060200003
@ -154,7 +154,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpAiriDAL
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,CURRENCY,CARGOVALUE");
strSql.Append(",(SELECT COUNT(*) FROM OP_APPLY WHERE MASTERNO=B.BSNO) as APPLYCOUNT ");
strSql.Append(",(SELECT TOP 1 BLSTATUS FROM op_blissue WHERE BSNO=B.BSNO) BLISSUESTATUS,DOC,B.BillFeeStatus ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,LANE,DELIVERYDATE,HSCODE,PRINTTIME");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,LANE,DELIVERYDATE,HSCODE,PRINTTIME,PRINTUSER ");
strSql.Append(",(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WHERE BSNO = B.BSNO ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR");
//SR2020060200003
@ -213,7 +213,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpAiriDAL
strSql.Append(",(SELECT TOP 1 STATUS FROM OP_STATUS WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS ");
strSql.Append(",CUSTOMNO,ENTERPID,ENTERP,INSPECTIONNO,INSPECTIONDATE,CUSTOMDATE,CHANGEDOCDATE,SERVICE,CUSTOMVALUE,CLASS,TRADETYPE,TRADETERM,CONTRACTNO");
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,0 FENPIAO");
strSql.Append(",ISPRINTPR,LANE,CURRENCY,CARGOVALUE,DELIVERYDATE,HSCODE,PRINTTIME");
strSql.Append(",ISPRINTPR,LANE,CURRENCY,CARGOVALUE,DELIVERYDATE,HSCODE,PRINTTIME,PRINTUSER ");
strSql.Append(" from OP_AIRI B");
if (!string.IsNullOrEmpty(strCondition))
@ -270,7 +270,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpAiriDAL
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,0 FENPIAO");
strSql.Append(",dbo.F_GetBillDrFeeStatus(B.BSNO) DRFEESTATUS");
strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS,ISPRINTPR,0 TTLDR,0 TTLINVDR,0 TTLDUIDR,0 TTLCR,0 TTLINVCR,0 TTLDUICR,0 APPLYCOUNT,B.BillFeeStatus,B.DOC ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,LANE,CURRENCY,CARGOVALUE,DELIVERYDATE,HSCODE,PRINTTIME");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,LANE,CURRENCY,CARGOVALUE,DELIVERYDATE,HSCODE,PRINTTIME,PRINTUSER ");
strSql.Append(",(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WHERE BSNO = B.BSNO ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR");
//SR2020060200003
@ -317,7 +317,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpAiriDAL
strSql.Append(",'' DRFEESTATUS");
strSql.Append(",'' CRFEESTATUS,ISPRINTPR,0 TTLDR,0 TTLINVDR,0 TTLDUIDR,0 TTLCR,0 TTLINVCR,0 TTLDUICR,0 APPLYCOUNT,DOC,B.BillFeeStatus ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,LANE,CURRENCY,CARGOVALUE,DELIVERYDATE,HSCODE");
strSql.Append(",'' AS COLOR,PRINTTIME");
strSql.Append(",'' AS COLOR,PRINTTIME,PRINTUSER ");
//SR2020060200003
strSql.Append(",isnull(ISBONDED,0) ISBONDED");
@ -521,6 +521,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpAiriDAL
data.COLOR = reader["COLOR"].ToString();
if (reader["PRINTTIME"] != DBNull.Value)
data.PRINTTIME = Convert.ToDateTime(reader["PRINTTIME"]).ToString("yyyy-MM-dd HH:mm:ss");//
data.PRINTUSER = Convert.ToString(reader["PRINTUSER"]);
#endregion
headList.Add(data);
}

@ -70,7 +70,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
strSql.Append(" MODIFIEDTIME, ORDERNO,OPERATOR,STLNAME,STLDATE,ENTERP,BOOKNO,dbo.F_GetBillDrFeeStatus(op_other.BSNO) DRFEESTATUS,dbo.F_GetBillCrFeeStatus(op_other.BSNO) CRFEESTATUS,ISPRINTPR,I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=op_other.SALECORPID) as SALECORP,CLOSINGDATE,CLOSEDOCDATE,SALEDEPT,CUSTOMSER,WAREHOUSE,COUNTRYOFORIGIN");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID = op_other.BSNO) as AMENDCOUNT,CARRIER,FORWARDER,TRUCKER,ISSUETYPE");
strSql.Append(",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,BLISSUESTATUS");
strSql.Append(",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,PRINTUSER,BLISSUESTATUS");
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,IsService11,IsService12,IsService13,IsService14,IsService15,IsService16,op_other.BillFeeStatus FROM op_other");
strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=op_other.BSNO) ");
@ -127,7 +127,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
strSql.Append(" MODIFIEDTIME, ORDERNO,OPERATOR,STLNAME,STLDATE,ENTERP,BOOKNO,dbo.F_GetBillDrFeeStatus(op_other.BSNO) DRFEESTATUS,dbo.F_GetBillCrFeeStatus(op_other.BSNO) CRFEESTATUS,ISPRINTPR,I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=op_other.SALECORPID) as SALECORP,CLOSINGDATE,CLOSEDOCDATE,SALEDEPT,CUSTOMSER,WAREHOUSE,COUNTRYOFORIGIN");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID = op_other.BSNO) as AMENDCOUNT,CARRIER,FORWARDER,TRUCKER,ISSUETYPE");
strSql.Append(",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,BLISSUESTATUS");
strSql.Append(",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,PRINTUSER,BLISSUESTATUS");
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,IsService11,IsService12,IsService13,IsService14,IsService15,IsService16,op_other.BillFeeStatus FROM op_other");
strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=op_other.BSNO) ");
@ -157,7 +157,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
strSql.Append(" MODIFIEDTIME, ORDERNO,OPERATOR,STLNAME,STLDATE,ENTERP,BOOKNO,dbo.F_GetBillDrFeeStatus(op_other.BSNO) DRFEESTATUS,dbo.F_GetBillCrFeeStatus(op_other.BSNO) CRFEESTATUS,ISPRINTPR,I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=op_other.SALECORPID) as SALECORP,CLOSINGDATE,CLOSEDOCDATE,SALEDEPT,CUSTOMSER,WAREHOUSE,COUNTRYOFORIGIN");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID = op_other.BSNO) as AMENDCOUNT,CARRIER,FORWARDER,TRUCKER,ISSUETYPE");
strSql.Append(",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,BLISSUESTATUS");
strSql.Append(",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,PRINTUSER,BLISSUESTATUS");
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,IsService11,IsService12,IsService13,IsService14,IsService15,IsService16,op_other.BillFeeStatus FROM op_other");
strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=op_other.BSNO) ");
@ -260,7 +260,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
strSql.Append(" MODIFIEDTIME, ORDERNO,OPERATOR,STLNAME,STLDATE,ENTERP,BOOKNO,dbo.F_GetBillDrFeeStatus(op_other.BSNO) DRFEESTATUS,dbo.F_GetBillCrFeeStatus(op_other.BSNO) CRFEESTATUS,ISPRINTPR,I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=op_other.SALECORPID) as SALECORP,CLOSINGDATE,CLOSEDOCDATE,SALEDEPT,CUSTOMSER,WAREHOUSE,COUNTRYOFORIGIN");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID = op_other.BSNO) as AMENDCOUNT,CARRIER,FORWARDER,TRUCKER,ISSUETYPE");
strSql.Append(",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,BLISSUESTATUS");
strSql.Append(",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,PRINTUSER,BLISSUESTATUS");
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,IsService11,IsService12,IsService13,IsService14,IsService15,IsService16,op_other.BillFeeStatus FROM op_other");
strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=op_other.BSNO) ");
@ -301,7 +301,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
strSql.Append(" MODIFIEDTIME, ORDERNO,OPERATOR,STLNAME,STLDATE,ENTERP,BOOKNO,dbo.F_GetBillDrFeeStatus(op_other.BSNO) DRFEESTATUS,dbo.F_GetBillCrFeeStatus(op_other.BSNO) CRFEESTATUS,ISPRINTPR,I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=op_other.SALECORPID) as SALECORP,CLOSINGDATE,CLOSEDOCDATE,SALEDEPT,CUSTOMSER,WAREHOUSE,COUNTRYOFORIGIN");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID = op_other.BSNO) as AMENDCOUNT,CARRIER,FORWARDER,TRUCKER,ISSUETYPE");
strSql.Append(",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,BLISSUESTATUS");
strSql.Append(",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,PRINTUSER,BLISSUESTATUS");
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,IsService11,IsService12,IsService13,IsService14,IsService15,IsService16,op_other.BillFeeStatus FROM op_other");
strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=op_other.BSNO) ");
@ -326,7 +326,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
strSql = strSql + ", ACCDATE, BSSOURCE, BSSOURCEDETAIL, OP, CUSTSERVICE,FRCUSTSERVICE, SALE, CORPID, TRANSTYPE, VESSEL, VOYNO, CONVERT(char(10), ETD, 20) as ETD, PORTLOAD, PORTDISCHARGE, TRADETYPE, GOODSNAME, KGS, NETWEIGHT, PKGS, KINDPKGS, CBM,CTNALL,CTNNUM, ISVOU, VOUNO, REMARK, (select top 1 showname from [user] where GID=op_other.CREATEUSER) as CREATEUSER, CREATETIME, (select top 1 showname from [user] where GID=op_other.MODIFIEDUSER) as MODIFIEDUSER, MODIFIEDTIME, ORDERNO,OPERATOR,STLNAME,STLDATE,ENTERP,BOOKNO ";
strSql = strSql + ",SALECORPID,(select [NAME] from [company] where GID=SALECORPID) as SALECORP,CLOSINGDATE,CLOSEDOCDATE,SALEDEPT,CUSTOMSER,WAREHOUSE,COUNTRYOFORIGIN";
strSql = strSql + ",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID = op_other.BSNO) as AMENDCOUNT,CARRIER,FORWARDER,TRUCKER,ISSUETYPE";
strSql = strSql + ",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,BLISSUESTATUS";
strSql = strSql + ",CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,TEU,CNTRTOTAL,INVDATE,PRINTTIME,PRINTUSER,BLISSUESTATUS";
strSql = strSql + ",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,IsService11,IsService12,IsService13,IsService14,IsService15,IsService16,'' DRFEESTATUS,'' CRFEESTATUS,ISPRINTPR,0 TTLDR,0 TTLINVDR,0 TTLDUIDR,0 TTLCR,0 TTLINVCR,0 TTLDUICR,BillFeeStatus FROM op_other";
if (!string.IsNullOrEmpty(condition))
@ -518,6 +518,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpOtherDAL
if (reader["PRINTTIME"] != DBNull.Value)
data.PRINTTIME = Convert.ToDateTime(reader["PRINTTIME"]).ToString("yyyy-MM-dd HH:mm:ss");//截港日期
data.BLISSUESTATUS = Convert.ToString(reader["BLISSUESTATUS"]);//
data.PRINTUSER = Convert.ToString(reader["PRINTUSER"]);
#endregion
headList.Add(data);
}

@ -115,7 +115,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",MSHIPPERID,MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL,BillFeeStatus,SALECORPID,'' MDESCRIPTION ");
strSql.Append(",(select [NAME] from [company] where GID=OP_SEAE.SALECORPID) as SALECORP");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,'' COUNTRY,PRINTTIME ");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,'' COUNTRY,PRINTTIME,PRINTUSER ");
strSql.Append(" from OP_SEAE ");
strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=OP_SEAE.BSNO) ");
// strSql.Append(" left join V_OP_STATUS S ON (S.BSNO=B.BSNO) ");
@ -251,7 +251,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",MSHIPPERID,MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL,BillFeeStatus,SALECORPID,'' MDESCRIPTION ");
strSql.Append(",(select [NAME] from [company] where GID=OP_SEAE.SALECORPID) as SALECORP,(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WHERE BSNO=OP_SEAE.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WHERE BSNO = OP_SEAE.BSNO ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR");
strSql.Append(" ,V.CUSTOMSSTATUS,V.PORTSTATUS,V.EXPSTATUS,V.TRUCKCTNSTATUS,V.CTNRETURNSTATUS,V.HGYDSTATUS,TRUCKSTATUS,V.ATASTATUS,V.STCSSTATUS,V.RCVESTATUS,PRINTTIME ");
strSql.Append(" ,V.CUSTOMSSTATUS,V.PORTSTATUS,V.EXPSTATUS,V.TRUCKCTNSTATUS,V.CTNRETURNSTATUS,V.HGYDSTATUS,TRUCKSTATUS,V.ATASTATUS,V.STCSSTATUS,V.RCVESTATUS,PRINTTIME,PRINTUSER ");
strSql.Append(" from OP_SEAE ");
@ -363,7 +363,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",(SELECT TOP 1 BLSTATUS FROM op_blissue WHERE BSNO=B.BSNO) BLISSUESTATUS,B.BillFeeStatus,SALECORPID,'' MDESCRIPTION ");
strSql.Append(",(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP,(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WITH (NOLOCK) WHERE BSNO=B.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WITH (NOLOCK) WHERE BSNO = B.BSNO ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR");
strSql.Append(" ,V.CUSTOMSSTATUS,V.PORTSTATUS,V.EXPSTATUS,V.TRUCKCTNSTATUS,V.CTNRETURNSTATUS,V.HGYDSTATUS,TRUCKSTATUS,V.ATASTATUS,V.STCSSTATUS,V.RCVESTATUS ");
strSql.Append(",CASE WHEN len(DESTINATIONID)<>5 THEN '' ELSE (select top 1 c_country_name from t_sys_country_code where c_country_code=LEFT(DESTINATIONID,2)) END as COUNTRY,PRINTTIME ");
strSql.Append(",CASE WHEN len(DESTINATIONID)<>5 THEN '' ELSE (select top 1 c_country_name from t_sys_country_code where c_country_code=LEFT(DESTINATIONID,2)) END as COUNTRY,PRINTTIME,PRINTUSER ");
strSql.Append(" from OP_SEAE B");
strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=B.BSNO) ");
@ -503,7 +503,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",MSHIPPERID,MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL,BillFeeStatus,SALECORPID,'' MDESCRIPTION ");
strSql.Append(",(select [NAME] from [company] where GID=OP_SEAE.SALECORPID) as SALECORP,(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WHERE BSNO=OP_SEAE.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WHERE BSNO = OP_SEAE.BSNO ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,'' COUNTRY,PRINTTIME ");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,'' COUNTRY,PRINTTIME,PRINTUSER ");
strSql.Append(" from OP_SEAE ");
@ -597,7 +597,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",(SELECT SHOWNAME FROM [user] WHERE GID IN (select top 1 AUDITOPERATOR from ch_fee where BSNO=B.BSNO ORDER BY AUDITDATE DESC)) MSHIPPERID," +
"dbo.trimdate((select top 1 AUDITDATE from ch_fee where BSNO=B.BSNO ORDER BY AUDITDATE DESC)) MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL,A.BillFeeStatus,B.SALECORPID,'' MDESCRIPTION ");
strSql.Append(",(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS ,B.TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,'' COUNTRY,A.PRINTTIME");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS ,B.TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,'' COUNTRY,A.PRINTTIME,A.PRINTUSER");
strSql.Append(" from OP_AMEND A ");
strSql.Append(" LEFT JOIN OP_SEAE B ON (B.BSNO=A.PARENTID)");
@ -715,7 +715,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",MSHIPPERID,MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL,A.BillFeeStatus,SALECORPID ");
strSql.Append(",(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,A.PRINTTIME ");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,A.PRINTTIME,A.PRINTUSER ");
strSql.Append(" from OP_AMEND A ");
strSql.Append(" LEFT JOIN OP_SEAE B ON (B.BSNO=A.PARENTID)");
@ -804,7 +804,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",MSHIPPERID,MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL,BillFeeStatus,SALECORPID,'' MDESCRIPTION ");
strSql.Append(",(select [NAME] from [company] where GID=OP_SEAE.SALECORPID) as SALECORP,(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WHERE BSNO=OP_SEAE.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WHERE BSNO = OP_SEAE.BSNO ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR");
strSql.Append(" ,V.CUSTOMSSTATUS,V.PORTSTATUS,V.EXPSTATUS,V.TRUCKCTNSTATUS,V.CTNRETURNSTATUS,V.HGYDSTATUS,TRUCKSTATUS,V.ATASTATUS,V.STCSSTATUS,V.RCVESTATUS,PRINTTIME ");
strSql.Append(" ,V.CUSTOMSSTATUS,V.PORTSTATUS,V.EXPSTATUS,V.TRUCKCTNSTATUS,V.CTNRETURNSTATUS,V.HGYDSTATUS,TRUCKSTATUS,V.ATASTATUS,V.STCSSTATUS,V.RCVESTATUS,PRINTTIME,PRINTUSER ");
strSql.Append(" from OP_SEAE ");
@ -874,7 +874,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",isnull(BLISSUESTATUS,'') BLISSUESTATUS,B.BillFeeStatus,SALECORPID,MDESCRIPTION ");
strSql.Append(",(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS ");
strSql.Append(",CASE WHEN len(DESTINATIONID)<>5 THEN '' ELSE (select top 1 c_country_name from t_sys_country_code where c_country_code=LEFT(DESTINATIONID,2)) END as COUNTRY,PRINTTIME ");
strSql.Append(",CASE WHEN len(DESTINATIONID)<>5 THEN '' ELSE (select top 1 c_country_name from t_sys_country_code where c_country_code=LEFT(DESTINATIONID,2)) END as COUNTRY,PRINTTIME,PRINTUSER ");
strSql.Append(" from OP_SEAE B");
@ -938,7 +938,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
//20161117 邓羽 增加对提单签发状态的查询
strSql.Append(",isnull(BLISSUESTATUS,'') BLISSUESTATUS,B.BillFeeStatus,SALECORPID,'' MDESCRIPTION ");
strSql.Append(",(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,'' COUNTRY,PRINTTIME ");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,'' COUNTRY,PRINTTIME,PRINTUSER ");
strSql.Append(" from OP_SEAE B");
// strSql.Append(" left join V_OP_STATUS S ON (S.BSNO=B.BSNO) ");
@ -1009,7 +1009,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
//20161117 邓羽 增加对提单签发状态的查询
strSql.Append(",isnull(BLISSUESTATUS,'') BLISSUESTATUS,BillFeeStatus,SALECORPID ");
strSql.Append(",(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,PRINTTIME ");
strSql.Append(",0 CUSTOMSSTATUS,0 PORTSTATUS,0 EXPSTATUS,0 TRUCKCTNSTATUS,0 CTNRETURNSTATUS,0 HGYDSTATUS,TRUCKSTATUS,0 ATASTATUS,0 STCSSTATUS,0 RCVESTATUS,PRINTTIME,PRINTUSER ");
strSql.Append(" from OP_SEAE B");
// strSql.Append(" left join V_OP_STATUS S ON (S.BSNO=B.BSNO) ");
@ -1399,6 +1399,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
data.IRCODE = Convert.ToString(reader["IRCODE"]);
if (reader["PRINTTIME"] != DBNull.Value)
data.PRINTTIME = Convert.ToDateTime(reader["PRINTTIME"]).ToString("yyyy-MM-dd HH:mm:ss");//
data.PRINTUSER = Convert.ToString(reader["PRINTUSER"]);
#endregion
headList.Add(data);
}
@ -1495,7 +1496,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",MSHIPPERID,MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL,BillFeeStatus,SALECORPID,'' MDESCRIPTION ");
strSql.Append(",(select [NAME] from [company] where GID=OP_SEAE.SALECORPID) as SALECORP,(select TOP 1 COLOR FROM code_op_status_detail WITH (NOLOCK) WHERE OPSTATUS = (CASE WHEN (SELECT TOP 1 [STATUS] FROM V_OP_STATUS WHERE BSNO=OP_SEAE.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) is null THEN '接受委托' else (SELECT TOP 1[STATUS] FROM V_OP_STATUS WHERE BSNO = OP_SEAE.BSNO ORDER BY COMPTIME DESC, INPUTTIME DESC) end))AS COLOR");
strSql.Append(" ,V.CUSTOMSSTATUS,V.PORTSTATUS,V.EXPSTATUS,V.TRUCKCTNSTATUS,V.CTNRETURNSTATUS,V.HGYDSTATUS,TRUCKSTATUS,V.ATASTATUS,V.STCSSTATUS,V.RCVESTATUS,PRINTTIME ");
strSql.Append(" ,V.CUSTOMSSTATUS,V.PORTSTATUS,V.EXPSTATUS,V.TRUCKCTNSTATUS,V.CTNRETURNSTATUS,V.HGYDSTATUS,TRUCKSTATUS,V.ATASTATUS,V.STCSSTATUS,V.RCVESTATUS,PRINTTIME,PRINTUSER ");
strSql.Append(" from OP_SEAE ");

@ -947,6 +947,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaiDAL
data.WMSSTATUS = Convert.ToString(reader["WMSSTATUS"]);
if (reader["PRINTTIME"] != DBNull.Value)
data.PRINTTIME = Convert.ToDateTime(reader["PRINTTIME"]).ToString("yyyy-MM-dd HH:mm:ss");//
data.PRINTUSER = Convert.ToString(reader["PRINTUSER"]);
#endregion
headList.Add(data);
}

@ -0,0 +1,681 @@
using System;
using System.Data;
using System.Data.Common;
using System.Collections.Generic;
using System.Text;
using DSWeb.MvcShipping.Models.MsOpVgmSend;
using Microsoft.Practices.EnterpriseLibrary.Data;
using DSWeb.EntityDA;
using DSWeb.Areas.CommMng.Models;
using HcUtility.Comm;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.MvcShipping.Models.MsChFee;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
using DSWeb.MvcShipping.Helper;
using DSWeb.Areas.MvcShipping.Comm;
using System.Collections.Specialized;
using DSWeb.Common.DB;
using System.Linq;
using DSWeb.Areas.MvcShipping.Models.Message.VGM;
using HcUtility.Core;
using System.Data.Entity.Migrations;
using DSWeb.MvcShipping.Models.MsOpSeae;
using NPOI.SS.Formula.Functions;
using Quartz.Util;
namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
{
public class MsOpVgmSendDAL
{
#region Inquery DataList
static public List<MsOpVgmSend> GetDataList(string strCondition, string userid, string usercode, string companyid, string sort = null)
{
var rangstr = GetRangDAStr("index", userid, usercode, companyid);
if (!string.IsNullOrEmpty(rangstr))
{
if (!string.IsNullOrEmpty(strCondition))
{
strCondition = strCondition + " and " + rangstr;
}
else
{
strCondition = rangstr;
}
}
//
String strSql = "SELECT *,(select top 1 showname from [user] where GID=op_seae_vgm_send.SENDERUSER) as SENDERUSERREF FROM op_seae_vgm_send ";
if (!string.IsNullOrEmpty(strCondition))
{
strSql += " where " + strCondition;
}
var sortstring = DatasetSort.Getsortstring(sort);
if (!string.IsNullOrEmpty(sortstring))
{
strSql += " order by " + sortstring;
}
else
{
strSql += " order by ETD desc";
}
return SetData(strSql);
}
static public string GetDataListStr(string strCondition, string userid, string usercode, string companyid, string sort = null)
{
var rangstr = GetRangDAStr("index", userid, usercode, companyid);
if (!string.IsNullOrEmpty(rangstr))
{
if (!string.IsNullOrEmpty(strCondition))
{
strCondition = strCondition + " and " + rangstr;
}
else
{
strCondition = rangstr;
}
}
//
String strSql = "SELECT *,(select top 1 showname from [user] where GID=op_seae_vgm_send.SENDERUSER) as SENDERUSERREF FROM op_seae_vgm_send ";
if (!string.IsNullOrEmpty(strCondition))
{
strSql += " where " + strCondition;
}
var sortstring = DatasetSort.Getsortstring(sort);
if (!string.IsNullOrEmpty(sortstring))
{
strSql += " order by " + sortstring;
}
else
{
strSql += " order by ETD desc";
}
return strSql.ToString();
}
static public MsOpVgmSend GetData(string condition)
{
String strSql = "SELECT *,(select top 1 showname from [user] where GID=op_seae_vgm_send.SENDERUSER) as SENDERUSERREF FROM op_seae_vgm_send ";
if (!string.IsNullOrEmpty(condition))
{
strSql += " where " + condition;
}
var list = SetData(strSql);
if (list.Count > 0)
{
return list[0];
}
return new MsOpVgmSend();
}
private static List<MsOpVgmSend> SetData(String strSql)
{
var headList = new List<MsOpVgmSend>();
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
MsOpVgmSend data = new MsOpVgmSend();
#region Set DB data to Object
data.GID = Convert.ToString(reader["GID"]);
data.BSNO = Convert.ToString(reader["BSNO"]);
data.VGMSTATUS = Convert.ToString(reader["VGMSTATUS"]);
data.MFNO = Convert.ToString(reader["MFNO"]);
data.MBLNO = Convert.ToString(reader["MBLNO"]);
data.ORDERNO = Convert.ToString(reader["ORDERNO"]);
data.CARRIER = Convert.ToString(reader["CARRIER"]);
data.LOADPORT = Convert.ToString(reader["LOADPORT"]);
data.MATOU = Convert.ToString(reader["MATOU"]);
data.VESSEL = Convert.ToString(reader["VESSEL"]);
data.VOYNO = Convert.ToString(reader["VOYNO"]);
data.CARRIERSTATUS = Convert.ToString(reader["CARRIERSTATUS"]);
data.YGTSTATUS = Convert.ToString(reader["YGTSTATUS"]);
data.YARDSTATUS = Convert.ToString(reader["YARDSTATUS"]);
data.VGM_TIME = Convert.ToString(reader["VGM_TIME"]);
data.SENDERUSER = Convert.ToString(reader["SENDERUSER"]);
data.SENDERUSERREF = Convert.ToString(reader["SENDERUSERREF"]);
if (reader["CTNNUM"] != DBNull.Value)
data.CTNNUM = Convert.ToInt16(reader["CTNNUM"]);
if (reader["ISCARRIER"] != DBNull.Value)
data.ISCARRIER = Convert.ToBoolean(reader["ISCARRIER"]);
if (reader["ISYGT"] != DBNull.Value)
data.ISYGT = Convert.ToBoolean(reader["ISYGT"]);
if (reader["SENDTIME"] != DBNull.Value)
data.SENDTIME = Convert.ToDateTime(reader["SENDTIME"]);
data.REMARK = Convert.ToString(reader["REMARK"]);
data.LINKURL = Convert.ToString(reader["LINKURL"]);
#endregion
headList.Add(data);
}
reader.Close();
}
return headList;
}
#endregion
#region 明细表
static public List<MsOpVgmCtn> GetVgmCtnList(string strCondition, string sort = null)
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append("*");
strSql.Append(" from op_seae_vgm_ctn ");
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" WHERE " + strCondition);
}
var sortstring = DatasetSort.Getsortstring(sort);
if (!string.IsNullOrEmpty(sortstring))
{
strSql.Append(" order by " + sortstring);
}
else
{
strSql.Append(" order by CTNALL ");
}
return SetVgmCtnData(strSql);
}
private static List<MsOpVgmCtn> SetVgmCtnData(StringBuilder strSql)
{
var headList = new List<MsOpVgmCtn>();
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
MsOpVgmCtn data = new MsOpVgmCtn();
#region Set DB data to Object
data.CTN_ID = Convert.ToString(reader["CTN_ID"]);
data.BSNO = Convert.ToString(reader["BSNO"]);
data.CTNALL = Convert.ToString(reader["CTNALL"]);
data.SENDGID = Convert.ToString(reader["SENDGID"]);
data.CNTRNO = Convert.ToString(reader["CNTRNO"]);
data.SEALNO = Convert.ToString(reader["SEALNO"]);
data.WEIGHTYPE = Convert.ToString(reader["WEIGHTYPE"]);
data.YARD = Convert.ToString(reader["YARD"]);
data.WEIGHDATE = Convert.ToString(reader["WEIGHDATE"]);
if (reader["KGS"] != DBNull.Value)
data.KGS = Convert.ToDecimal(reader["KGS"]);//
if (reader["TAREWEIGHT"] != DBNull.Value)
data.TAREWEIGHT = Convert.ToDecimal(reader["TAREWEIGHT"]);//
if (reader["VGMKGS"] != DBNull.Value)
data.VGMKGS = Convert.ToDecimal(reader["VGMKGS"]);//
#endregion
headList.Add(data);
}
reader.Close();
}
return headList;
}
public static DBResult SaveDetail(string LE_ID, List<MsOpVgmCtn> bodyList)
{
var result = new DBResult();
Database db = DatabaseFactory.CreateDatabase();
using (var conn = db.CreateConnection())
{
conn.Open();
var tran = conn.BeginTransaction();
try
{
var cmddelete = db.GetSqlStringCommand(@"delete from op_seae_vgm_ctn where SENDGID='" + LE_ID + "'");
db.ExecuteNonQuery(cmddelete, tran);
var cntr = "";
if (bodyList != null)
{
foreach (var enumValue in bodyList)
{
var cmdInsert = db.GetSqlStringCommand(@"insert into op_seae_vgm_ctn ([CTN_ID],[BSNO],[SENDGID],[CTNALL],[CNTRNO],[SEALNO],[KGS],[TAREWEIGHT],[WEIGHTYPE],[VGMKGS],[YARD],[WEIGHDATE])
values (NEWID(),'" + enumValue.BSNO + "','" + LE_ID + "','" + enumValue.CTNALL + "','" + enumValue.CNTRNO + "','" + enumValue.SEALNO + "'," + enumValue.KGS + "," + enumValue.TAREWEIGHT + ",'" + enumValue.WEIGHTYPE + "'," + enumValue.VGMKGS + ",'" + enumValue.YARD + "','" + enumValue.WEIGHDATE + "')");
db.ExecuteNonQuery(cmdInsert, tran);
}
}
tran.Commit();
}
catch (Exception)
{
tran.Rollback();
result.Success = false;
result.Message = "保存出现错误,请重试或联系系统管理员";
return result;
}
}
result.Success = true;
result.Message = "保存成功" + result.Message;
return result;
}
public static DsVgm CreateDjyVgm(MsOpVgmSend headData, List<MsOpVgmCtn> bodyList, MsOpSeae OpSeaehead)
{
var cdc = new CommonDataContext();
var DsVgm = new DsVgm();
DsVgm.mfno = headData.MFNO;
DsVgm.mblno = headData.MBLNO;
DsVgm.carrier = BasicDataRefDAL.GetCustEdiCodeByName2(OpSeaehead.CARRIER, "DJY");
//DsVgm.carrier = headData.CARRIER;
DsVgm.etd = OpSeaehead.ETD;
DsVgm.weiTuoFaSongFang = BasicDataRefDAL.GetCustEdiCodeByName2(OpSeaehead.CUSTOMERNAME, "DJY");
DsVgm.chuanMing = headData.CARRIER;
DsVgm.vsid = OpSeaehead.VESSELID;
DsVgm.hangCi = headData.VOYNO;
DsVgm.beiZhu = headData.REMARK;
//var 装货港 = OpSeaehead.PORTLOAD;
var = headData.LOADPORT;
//BasicDataRefDAL.GetPORTInfoByEDICODEAndEDIName("DJY", headData.LOADPORT, OpSeaehead.PORTLOAD, ref 装货港代码, ref 装货港);
var = cdc.tSysEnumValue.Where(x => x.EnumTypeID == 96303 && x.EnumValueID == ).FirstOrDefault();
if ( != null) {
DsVgm.zhuangHuoGang = .EnumValueName;
DsVgm.zhuangHuoGangDaiMa = .EnumValueID;
}
DsVgm.yard = BasicDataRefDAL.GetCustEdiCodeByName2(OpSeaehead.YARD, "DJY");
DsVgm.orderno = headData.ORDERNO;
DsVgm.vgmclosetime = headData.VGM_TIME;
DsVgm.vgmclosetime = string.IsNullOrWhiteSpace(DsVgm.vgmclosetime) ? null : DsVgm.vgmclosetime;
DsVgm.wharf = headData.MATOU;
var cntrlist = new List<Ctn>();
foreach (var ctn in bodyList)
{
var cntr = new Ctn();
cntr.ctn_id = ctn.CTN_ID;
cntr.ctnall = ctn.CTNALL;
cntr.cntrno = ctn.CNTRNO;
cntr.sealno = ctn.SEALNO;
cntr.chengZhongFangShi = ctn.WEIGHTYPE;
cntr.kgs = ctn.KGS;
cntr.pizhong = ctn.TAREWEIGHT;
cntr.chengZhongZhongLiang = ctn.KGS + ctn.TAREWEIGHT;
//cntr.yard = ctn.YARD;
cntr.yard = BasicDataRefDAL.GetCustEdiCodeByName2(ctn.YARD, "DJY");
if(!string.IsNullOrWhiteSpace(ctn.WEIGHDATE))
cntr.chengZhongShiJian = ctn.WEIGHDATE.Replace("T"," ");
cntrlist.Add(cntr);
}
DsVgm.ctnList = cntrlist;
DsVgm.sendType = Convert.ToInt32(headData.SENDTYPE);
DsVgm.sendCarr = headData.ISCARRIER;
DsVgm.sendYGT = headData.ISYGT;
return DsVgm;
}
static public List<op_seae_vgm_history_md> GetVgmHistoryList(string BSNO)
{
var result = new List<op_seae_vgm_history_md>();
var cdc = new CommonDataContext();
result = cdc.op_seae_vgm_history
.Where(x => x.BSNO == BSNO)
.OrderByDescending(o=>o.SENDTIME).ToList();
if (result != null && result.Count > 0) {
var useridlist= result.Select(x => x.SENDERUSER).Distinct().ToList();
var userlist = cdc.VW_user.Where(x => useridlist.Contains(x.USERID)).ToList();
foreach (var item in result) {
item.SENDERNAME = userlist.FirstOrDefault(x => x.USERID == item.SENDERUSER).SHOWNAME;
}
}
return result;
}
#endregion
static public List<op_seae_vgm_state_md> GetStatusList(string BSNO,string type)
{
var result = new List<op_seae_vgm_state_md>();
var cdc = new CommonDataContext();
result = cdc.op_seae_vgm_state
.Where(x => x.mfno==BSNO&& x.Type==type)
.OrderByDescending(o => o.statustime).ToList();
return result;
}
#region 发送vgm至大简云
public static DBResult SendDjyVgm(MsOpVgmSend headData, List<MsOpVgmCtn> bodyList, string SendType = "")
{
var result = new DBResult();
result.OK();
var DsVgmUrl = MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024URL'").PARAMVALUE;
var headers = new NameValueCollection();
var key= MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024_Key'").PARAMVALUE;
var secret = MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024_Secret'").PARAMVALUE;
headers["USER_KEY"] = key;
headers["USER_SECRET"] = secret;
var OpSeaehead = MsOpSeaeDAL.MsOpSeaeDAL.GetData("BSNO='" + headData.BSNO + "'");
headData.MBLNO = OpSeaehead.MBLNO;
if (!string.IsNullOrWhiteSpace(SendType)) {
//临时性修改 不记录
headData.SENDTYPE = SendType;
}
var sendinfo = CreateDjyVgm(headData, bodyList, OpSeaehead);
BasicDataRefDAL.SaveLog(JsonConvert.Serialize(DsVgmUrl) + "////" + key +"////"+ secret + "////"+JsonConvert.Serialize(sendinfo), "", "DJYVGM2024", "发送");
var rtn = WebRequestHelper.DoPost_JSON_Header(DsVgmUrl, JsonConvert.Serialize(sendinfo), 10000,headers);
BasicDataRefDAL.SaveLog(rtn, "", "DJYVGM2024", "返回");
var _r = JsonConvert.Deserialize<djyvgmresult>(rtn);
if (_r.statusCode == 200)
{
var cdc = new CommonDataContext();
var updrec = cdc.op_seae_vgm_send.FirstOrDefault(x => x.BSNO == OpSeaehead.BSNO);
updrec.MFNO = _r.data.MFNO;
updrec.LINKURL = _r.data.LINKURL;
updrec.VGMSTATUS = _r.data.sendstatus;
cdc.op_seae_vgm_send.AddOrUpdate(updrec);
cdc.SaveChanges();
result.OK("上传成功",updrec);
}
else {
result.Success = false;
result.Message = _r.errors;
}
return result;
}
#endregion
#region 从大简云获取VGM链接
public class getlinkparam {
public string mfno { get; set; }
public bool sendCarr { get; set; } = false;
public bool sendYGT { get; set; } = false;
}
public static DBResult GetDjyVgmLink(getlinkparam sendparam)
{
var result = new DBResult();
result.OK();
var cdc = new CommonDataContext();
var _head = cdc.op_seae_vgm_send.Where(p => p.BSNO == sendparam.mfno).FirstOrDefault();
//var head = MsOpVgmSendDAL.GetData("BSNO='" + sendparam.mfno + "'");
var DsVgmUrl = MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024GetUrl'").PARAMVALUE;
var headers = new NameValueCollection();
var key = MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024_GetUrl_Key'").PARAMVALUE;
var secret = MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024_GetUrl_Secret'").PARAMVALUE;
//测试数据
//sendparam.mfno = "585399286181957";
headers["USER_KEY"] = key;// MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024_GetUrl_Key'").PARAMVALUE;
headers["USER_SECRET"] = secret;// MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024_GetUrl_Secret'").PARAMVALUE;
var sendstr= JsonConvert.Serialize(sendparam);
var dic = new Dictionary<string, string>
{
{ "mfno", sendparam.mfno },
{ "sendCarr", sendparam.sendCarr.ToString().ToLower() },
{ "sendYGT", sendparam.sendYGT.ToString().ToLower() }
};
BasicDataRefDAL.SaveLog(JsonConvert.Serialize(DsVgmUrl) + "////" + key +"//"+ secret + "////" + JsonConvert.Serialize(sendstr), "", "DJYVGM2024GetUrl", "发送");
var rtn = WebRequestHelper.DoGet_Param_Header(DsVgmUrl, dic, 10000, headers);
BasicDataRefDAL.SaveLog(rtn, "", "DJYVGM2024GetUrl", "返回");
vgmResult rp = JsonConvert.Deserialize<vgmResult>(rtn);
if (rp.statusCode == 200)
{
var _str = rp.data;
_head.LINKURL = BasicDataRefDAL.Unicode2String(_str);
_head.ISCARRIER = sendparam.sendCarr;
_head.ISYGT = sendparam.sendYGT;
cdc.op_seae_vgm_send.AddOrUpdate(_head);
cdc.SaveChangesAsync();
result.OK("获取成功");
result.Data = _head.LINKURL;
}
else {
result.SetErrorInfo(BasicDataRefDAL.Unicode2String(rp.errors));
}
return result;
}
#endregion
#region 判断编码是否有重复
static public int GetRdCount(string strCondition)
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(" Count(BSNO) AS CT ");
strSql.Append(" from op_seae_pre ");
if (strCondition.Trim() != String.Empty)
{
strSql.Append(" where " + strCondition);
}
var ct=0;
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
ct = Convert.ToInt16(reader["CT"]);
}
reader.Close();
}
return ct;
}
#endregion
#region Rang权限范围
public static string GetRangDAStr(string tb, string userid, string username, string companyid)
{
string str = "";
var strSql = new StringBuilder();
strSql.Append("SELECT");
strSql.Append(" VISIBLERANGE,OPERATERANGE,AUTHORITYID");
strSql.Append(" from VW_User_Authority");
strSql.Append(" where [NAME]='modSaleRptList' and USERID='" + userid + "' and ISDELETE=0");
string visiblerange = "4";
string operaterange = "4";
string AUTHORITYID = "";
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
visiblerange = Convert.ToString(reader["VISIBLERANGE"]);
operaterange = Convert.ToString(reader["OPERATERANGE"]);
AUTHORITYID = Convert.ToString(reader["AUTHORITYID"]);
break;
}
reader.Close();
}
if (visiblerange == "4")
{
str = " SALE='" + username + "'";
}
else if (visiblerange == "3")
{
str = " SALE='" + username + "'";
}
else if (visiblerange == "2")
{
var rangeDa = new RangeDA();
var deptname = rangeDa.GetDEPTNAME(userid);
str = " SALE 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 + "'))";
}
else if (visiblerange == "1")
{
str = " SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') ";
}
else if (visiblerange == "5")
{
if (tb == "index")
{
var userstr = new StringBuilder();
userstr.Append(" select COMPANYID from user_authority_range_company where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1");
Database userdb = DatabaseFactory.CreateDatabase();
using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString()))
{
str = "";
while (reader.Read())
{
if (str == "")
{
str = " (SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + Convert.ToString(reader["COMPANYID"]) + "') ";
}
else
{
str = str + " or SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + Convert.ToString(reader["COMPANYID"]) + "')";
};
}
str = str + ")";
reader.Close();
}
}
else
{
str = " SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') ";
}
}
else if (visiblerange == "6")
{
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()))
{
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 + " )";
}
else
{
str = " (UPPER(op_other.Corpid)='" + companyid + "') ";
}
}
else if (visiblerange == "0")
{
str = " 1=1 ";
}
return str;
}
#endregion
}
}

@ -76,7 +76,7 @@ namespace DSWeb.MvcShipping.Models.MsOpAmend
public string BillFeeStatus { get; set; }
public string BILLFEESTATUSTIME { get; set; }
public string PRINTTIME { get; set; }
public string PRINTUSER { get; set; }
#endregion

@ -1712,6 +1712,8 @@ namespace DSWeb.MvcShipping.Models.MsOpAire
public string COLOR { get; set; }
public string PRINTTIME { get; set; }
public string PRINTUSER { get; set; }
#endregion
public MsOpAire()

@ -1214,6 +1214,8 @@ namespace DSWeb.MvcShipping.Models.MsOpAiri
}
public string COLOR { get; set; }
public string PRINTTIME { get; set; }
public string PRINTUSER { get; set; }
#endregion
public MsOpAiri()

@ -914,6 +914,8 @@ namespace DSWeb.MvcShipping.Models.MsOpOther
public int TEU { get; set; }
public string CNTRTOTAL { get; set; }
public string PRINTTIME { get; set; }
public string PRINTUSER { get; set; }
private string _BLISSUESTATUS = "";

@ -2131,6 +2131,8 @@ namespace DSWeb.MvcShipping.Models.MsOpSeae
public string USERID { get; set; }
public string PRINTTIME { get; set; }
public string PRINTUSER { get; set; }
[ModelDB(MDBType = ModelDBOprationType.Insert)]
public long? DJYID { get; set; }
#endregion

@ -2730,6 +2730,9 @@ namespace DSWeb.MvcShipping.Models.MsOpSeai
public string WMSSTATUS { get; set; }
public string PRINTTIME { get; set; }
public string PRINTUSER { get; set; }
public MsOpSeai()
{
TableName = "op_seai";

@ -0,0 +1,312 @@
using System;
using System.Collections.Generic;
using HcUtility.Core;
using java.lang;
using Newtonsoft.Json;
namespace DSWeb.MvcShipping.Models.MsOpVgmSend
{
[JsonObject]
public class MsOpVgmSend : ModelObjectBillHead
{
#region 属性
private string _GID = "topseaevgm" + Guid.NewGuid().ToString();//业务编号
/// <summary>
/// 业务唯一编号
/// </summary>
[ModelDB(MDBType = ModelDBOprationType.All, IsPrimary = true)]
public string GID
{
get { return _GID; }
set { _GID = value; }
}
[ModelDB(MDBType = ModelDBOprationType.Insert)]
public string BSNO { get; set; }
[ModelDB]
public string MFNO { get; set; }
[ModelDB]
public string MBLNO{ get; set; }
[ModelDB]
public string ORDERNO { get; set; }
[ModelDB]
public string CARRIER { get; set; }
[ModelDB]
public string LOADPORT { get; set; }
[ModelDB]
public string MATOU { get; set; }
[ModelDB]
public string VGMSTATUS { get; set; }
[ModelDB]
public bool ISCARRIER { get; set; }
[ModelDB]
public bool ISYGT { get; set; }
[ModelDB]
public string SENDTYPE { get; set; }
[ModelDB]
public string VESSEL { get; set; }
[ModelDB]
public string VOYNO { get; set; }
[ModelDB]
public string VGM_TIME { get; set; }
[ModelDB(MDBType = ModelDBOprationType.Insert)]
public string CARRIERSTATUS { get; set; }
[ModelDB(MDBType = ModelDBOprationType.Insert)]
public string YGTSTATUS { get; set; }
[ModelDB(MDBType = ModelDBOprationType.Insert)]
public string YARDSTATUS { get; set; }
[ModelDB]
public int CTNNUM { get; set; }
private string _createuser = "";
/// <summary>
/// 创建人
/// </summary>
[ModelDB]
public string SENDERUSER
{
get { return _createuser; }
set { _createuser = value; }
}
public string SENDERUSERREF { get; set; }
private DateTime _createtime = DateTime.Now;
/// <summary>
/// 创建时间
/// </summary>
[ModelDB]
public DateTime SENDTIME
{
get { return _createtime; }
set { _createtime = value; }
}
/// <summary>
/// 备注
/// </summary>
[ModelDB]
public string REMARK { get; set; }
/// <summary>
/// 链接地址
/// </summary>
[ModelDB]
public string LINKURL { get; set; }
#endregion
public MsOpVgmSend()
{
TableName = "op_seae_vgm_send";
}
override public string GetBillNoFieldName()
{
return "BSNO";
}
}
[JsonObject]
public class MsOpVgmCtn
{
#region 属性
private string _GID = "topseaevgm" + Guid.NewGuid().ToString();//业务编号
/// <summary>
/// 业务唯一编号
/// </summary>
public string CTN_ID
{
get { return _GID; }
set { _GID = value; }
}
public string BSNO { get; set; }
public string SENDGID { get; set; }
public string CTNALL { get; set; }
public string CNTRNO { get; set; }
public string SEALNO { get; set; }
public decimal KGS { get; set; }
public decimal TAREWEIGHT { get; set; }
public string WEIGHTYPE { get; set; }
public decimal VGMKGS { get; set; }
public string YARD { get; set; }
public string WEIGHDATE { get; set; }
#endregion
//public MsOpVgmCtn()
//{
// TableName = "op_seae_vgm_ctn";
//}
//override public string GetBillNoFieldName()
//{
// return "BSNO";
//}
}
public class Ctn
{
/// <summary>
///
/// </summary>
public string ctn_id { get; set; }
/// <summary>
///
/// </summary>
public string ctnall { get; set; }
/// <summary>
///
/// </summary>
public string cntrno { get; set; }
/// <summary>
///
/// </summary>
public string sealno { get; set; }
/// <summary>
///
/// </summary>
public int pkgs { get; set; }
/// <summary>
///
/// </summary>
public decimal kgs { get; set; }
/// <summary>
///
/// </summary>
public decimal cbm { get; set; }
/// <summary>
///
/// </summary>
public decimal chengZhongZhongLiang { get; set; }
/// <summary>
///
/// </summary>
public string chengZhongFangShi { get; set; }
/// <summary>
///
/// </summary>
public string chengZhongShiJian { get; set; }
/// <summary>
///
/// </summary>
public decimal pizhong { get; set; }
/// <summary>
///
/// </summary>
public string yard { get; set; }
/// <summary>
///
/// </summary>
public string cargoId { get; set; }
/// <summary>
///
/// </summary>
public bool sendFlag { get; set; }
}
public class DsVgm
{
/// <summary>
///
/// </summary>
public string mfno { get; set; }
/// <summary>
///
/// </summary>
public string mblno { get; set; }
/// <summary>
///
/// </summary>
public string carrier { get; set; }
/// <summary>
///
/// </summary>
public string etd { get; set; }
/// <summary>
///
/// </summary>
public string weiTuoFaSongFang { get; set; }
/// <summary>
///
/// </summary>
public string chuanMing { get; set; }
/// <summary>
///
/// </summary>
public string vsid { get; set; }
/// <summary>
///
/// </summary>
public string hangCi { get; set; }
/// <summary>
///
/// </summary>
public string beiZhu { get; set; }
/// <summary>
///
/// </summary>
public string zhuangHuoGang { get; set; }
/// <summary>
///
/// </summary>
public string zhuangHuoGangDaiMa { get; set; }
/// <summary>
///
/// </summary>
public string yard { get; set; }
/// <summary>
///
/// </summary>
public string orderno { get; set; }
/// <summary>
///
/// </summary>
public string vgmclosetime { get; set; }
/// <summary>
///
/// </summary>
public string wharf { get; set; }
/// <summary>
///
/// </summary>
public List<Ctn> ctnList { get; set; }
/// <summary>
///
/// </summary>
public int sendType { get; set; }
/// <summary>
///
/// </summary>
public bool sendCarr { get; set; }
/// <summary>
///
/// </summary>
public bool sendYGT { get; set; }
}
}

@ -0,0 +1,37 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/MvcShipping/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
var GID;
function getSessgion1() {
GID = '<%= Session["USERID"] %>';
}
getSessgion1();
var usercode;
function getSessgion2() {
usercode = '<%= Session["CODENAME"] %>';
}
getSessgion2();
var SHOWNAME;
function getSessgion3() {
SHOWNAME = '<%= Session["SHOWNAME"] %>';
}
getSessgion3();
</script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/Comm/TimePickerField.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/Comm/DateTimePicker.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/Comm/DateTimeField.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/Comm/DateTimeMenu.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/Comm/MonthField.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendModel.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendEdit.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOpVgmSend/Edit.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
<div id="viewport" ></div>
</asp:Content>

@ -0,0 +1,35 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/MvcShipping/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
var USERID;
function getSessgion1() {
USERID = '<%= Session["USERID"] %>';
}
getSessgion1();
var usercode;
function getSessgion2() {
usercode = '<%= Session["CODENAME"] %>';
}
getSessgion2();
var SHOWNAME;
function getSessgion3() {
SHOWNAME = '<%= Session["SHOWNAME"] %>';
}
getSessgion3();
</script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsCompanys/MsCompanysModel.js"></script>
<script type="text/javascript" src="../../../../Views/../TruckMng/Scripts/ExtjsEx/exportexcel/export-all.js"></script>
<script type="text/javascript" src="../../../../Views/../TruckMng/Scripts/ExtjsEx/gridToExcel.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOpPrice/MsOpPriceModel.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOpPrice/MsOpPriceIndex.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/MsOpPrice/Index.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/Comm/DsQuery.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
<div id="viewport" ></div>
</asp:Content>

@ -1486,7 +1486,7 @@ Ext.extend(Shipping.MsChFeeYsAutoDuiEdit, Ext.Panel, {
} else if (FeiYongZhuangTai == "19") {
sql = sql + getAndConSql(sql, FeiYongZhuangTai, " C.FEETYPE=2 AND ISNULL(C.INVOICE,0)<>0 AND ((C.AMOUNT>0 and ISNULL(C.INVOICE,0)>ISNULL(C.SETTLEMENT,0)) or (C.AMOUNT<0 and ISNULL(C.INVOICE,0)<ISNULL(C.SETTLEMENT,0))) ");
} else if (FeiYongZhuangTai == "20") {
sql = sql + getAndConSql(sql, FeiYongZhuangTai, " ISNULL(C.SETTLEMENT,0)<>C.AMOUNT AND ISNULL(C.INVOICE,0)<>C.AMOUNT AND F.FEESTATUS IN (0,8) ");
sql = sql + getAndConSql(sql, FeiYongZhuangTai, " ISNULL(C.SETTLEMENT,0)<>C.AMOUNT AND ISNULL(C.INVOICE,0)<>C.AMOUNT AND C.FEESTATUS IN (0,8) ");
}
}
@ -1673,7 +1673,7 @@ Ext.extend(Shipping.MsChFeeYsAutoDuiEdit, Ext.Panel, {
} else if (FeiYongZhuangTai == "19") {
sql = sql + getAndConSql(sql, FeiYongZhuangTai, " C.FEETYPE=2 AND ISNULL(C.INVOICE,0)<>0 AND ((C.AMOUNT>0 and ISNULL(C.INVOICE,0)>ISNULL(C.SETTLEMENT,0)) or (C.AMOUNT<0 and ISNULL(C.INVOICE,0)<ISNULL(C.SETTLEMENT,0))) ");
} else if (FeiYongZhuangTai == "20") {
sql = sql + getAndConSql(sql, FeiYongZhuangTai, " ISNULL(C.SETTLEMENT,0)<>C.AMOUNT AND ISNULL(C.INVOICE,0)<>C.AMOUNT AND F.FEESTATUS IN (0,8) ");
sql = sql + getAndConSql(sql, FeiYongZhuangTai, " ISNULL(C.SETTLEMENT,0)<>C.AMOUNT AND ISNULL(C.INVOICE,0)<>C.AMOUNT AND C.FEESTATUS IN (0,8) ");
}
}
@ -1788,7 +1788,7 @@ Ext.extend(Shipping.MsChFeeYsAutoDuiEdit, Ext.Panel, {
} else if (FeiYongZhuangTai == "19") {
sql = sql + getAndConSql(sql, FeiYongZhuangTai, " C.FEETYPE=2 AND ISNULL(C.INVOICE,0)<>0 AND ((C.AMOUNT>0 and ISNULL(C.INVOICE,0)>ISNULL(C.SETTLEMENT,0)) or (C.AMOUNT<0 and ISNULL(C.INVOICE,0)<ISNULL(C.SETTLEMENT,0))) ");
} else if (FeiYongZhuangTai == "20") {
sql = sql + getAndConSql(sql, FeiYongZhuangTai, " ISNULL(C.SETTLEMENT,0)<>C.AMOUNT AND ISNULL(C.INVOICE,0)<>C.AMOUNT AND F.FEESTATUS IN (0,8) ");
sql = sql + getAndConSql(sql, FeiYongZhuangTai, " ISNULL(C.SETTLEMENT,0)<>C.AMOUNT AND ISNULL(C.INVOICE,0)<>C.AMOUNT AND C.FEESTATUS IN (0,8) ");
}
}

@ -781,6 +781,10 @@ Ext.extend(Shipping.MsOpAireIndex, Ext.Panel, {
dataIndex: 'PRINTTIME',
header: '核算单打印时间', //'货物标识',
width: 70
}, {
dataIndex: 'PRINTUSER',
header: '核算单打印人', //'货物标识',
width: 70
}];

@ -183,7 +183,8 @@
{ name: 'SERVICE9', type: 'string' },
{ name: 'SERVICE10', type: 'string' },
{ name: 'COLOR', type: 'string' },
{ name: 'PRINTTIME', type: 'string' },
{ name: 'PRINTTIME', type: 'string' },
{ name: 'PRINTUSER', type: 'string' },
{ name: 'BillFeeStatus', type: 'string' }
]
});

@ -749,6 +749,10 @@ Ext.extend(Shipping.MsOpAiriIndex, Ext.Panel, {
dataIndex: 'PRINTTIME',
header: '核算单打印时间', //'货物标识',
width: 70
}, {
dataIndex: 'PRINTUSER',
header: '核算单打印人', //'货物标识',
width: 70
}];

@ -132,7 +132,8 @@
{ name: 'HSCODE', type: 'string' },
{ name: 'COLOR', type: 'string' },
{ name: 'BillFeeStatus', type: 'string' },
{ name: 'PRINTTIME', type: 'string' },
{ name: 'PRINTTIME', type: 'string' },
{ name: 'PRINTUSER', type: 'string' },
{ name: 'ISBONDED', type: 'string' }
]

@ -782,6 +782,10 @@ Ext.extend(Shipping.MsOpOtherIndex, Ext.Panel, {
dataIndex: 'PRINTTIME',
header: '核算单打印时间', //'货物标识',
width: 70
}, {
dataIndex: 'PRINTUSER',
header: '核算单打印人', //'货物标识',
width: 70
}, {
dataIndex: 'BLISSUESTATUS',
header: '提单签发状态', //'货物标识',

@ -118,6 +118,7 @@
{ name: 'SERVICE14', type: 'string' },
{ name: 'SERVICE15', type: 'string' },
{ name: 'SERVICE16', type: 'string' },
{ name: 'PRINTUSER', type: 'string' },
{ name: 'BillFeeStatus', type: 'string' }
]
});

@ -2007,7 +2007,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
},
scope: this
}, '-', {
text: 'VGM', //'引入场站数据',
text: 'VGM(支持双报)', //'引入场站数据',
handler: function (button, event) {
_this.onCreateDSVGMClick(button, event);
},
@ -6436,7 +6436,22 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
]//end items(fieldset 1)
}); //end this.formEdit
}); //end this.formEdit
//#endregion
//#region VGM窗口用的 口岸和码头
this.storeLOADPORT = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsExtEnumModel',
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
});
this.storeLOADPORT.load({ params: { enumTypeId: 96303 } });
this.storeMATOU = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsExtEnumModel',
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
});
this.storeMATOU.load({ params: { enumTypeId: 96304 } });
//#endregion
@ -18546,7 +18561,12 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
//#region 东胜VGM
onCreateDSVGMClick: function (menu, event) {
this.winDSVGMShow.show();
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
var openSet = "height=390, width=900, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 300) / 2 + ",Left= " + (screen.width - 900) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcShipping/MsOpVgmSend/Edit?handle=check&bsno=" + BSNO;
window.open(openUrl, openType, openSet);
},
onSendDSVGM: function (mblno, userid, type) {
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
@ -22288,6 +22308,16 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
return ret;
},
OprationSwap_VGM: function () {
var ret = new Array();
ret[0] = this.editRecord;
ret[1] = this.storeBodyList;
ret[2] = this.storeCARRIER; //船公司
ret[3] = this.storeLOADPORT;//口岸
ret[4] = this.storeMATOU;//码头
return ret;
},
FormatTextarea: function (len, name) {
var textareaFiled = _this.formEdit.getForm().findField(name);
var value = textareaFiled.getValue();

@ -1255,6 +1255,10 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
header: Zi.LAN.PRINTTIME, //'货物标识',
width: 70
}, {
dataIndex: 'PRINTUSER',
header: Zi.LAN.PRINTUSER, //'货物标识',
width: 70
}, {
dataIndex: 'ISCANCEL',
header: Zi.LAN.TUI_B, //'退舱',
width: 60,
@ -2743,7 +2747,8 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
text: Zi.LAN.ListExpExcel, //"EXCEL导出",
iconCls: "btnexportexcel",
handler: function (button, event) {
GridExportExcelPage(_this.gridList);
/* GridExportExcelPage(_this.gridList);*/
this.onExportClick();
},
scope: this
@ -15867,6 +15872,63 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
//#endregion
//#region 打印
onExportClick: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var bsno = '11111';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.BSNO;
}
var sortstr = 'BSDATE desc ';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsOpSeae/GetDataListStr',
scope: this,
params: {
condition: _this.sqlcontext,
printstr: 'true',
sort: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var printType = 'MSOPSEAELIST';
var sql1 = returnstr;
sql1 = sql1.replace(/\+/g, "@@@")
if (sql1 != '') {
GridExportBySql(sql1, this.formname, '海运出口列表.xls');
}
} else {
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
});
},
Print: function () {
_this = this;

@ -227,7 +227,8 @@
{ name: 'PROFITRATE', type: 'string' },
{ name: 'GROUPBS', type: 'string' },
{ name: 'IRCODE', type: 'string' },
{ name: 'PRINTTIME', type: 'string' },
{ name: 'PRINTTIME', type: 'string' },
{ name: 'PRINTUSER', type: 'string' },
{ name: 'BillFeeStatus', type: 'string' }

@ -800,4 +800,5 @@ Zi.LAN.QueshiYaoShanChu2 = "】票业务吗?";
Zi.LAN.DeleteSuccess = "删除成功";
Zi.LAN.DeleteErro = "删除错误";
Zi.LAN.FEETYPE = "复制费用范围";
Zi.LAN.PRINTTIME = "核算单打印时间";
Zi.LAN.PRINTTIME = "核算单打印时间";
Zi.LAN.PRINTUSER = "核算单打印人";

@ -829,6 +829,7 @@ Zi.LAN.DeleteSuccess = "删除成功";
Zi.LAN.DeleteErro = "删除错误";
Zi.LAN.FEETYPE = "复制费用范围";
Zi.LAN.PRINTTIME = "核算单打印时间";
Zi.LAN.PRINTUSER = "核算单打印人";
//Zi.LAN. = "";

@ -6186,7 +6186,7 @@ GetFeeCustNoStatus:function(){
}
}
this.setAllTotal();
var bgdfxList = result.res[7].data;
if (bgdfxList != null && bgdfxList.length > 0) {
var member = bgdfxList[0];

@ -1122,6 +1122,10 @@ Ext.extend(Shipping.MsOpSeaiIndex, Ext.Panel, {
dataIndex: 'PRINTTIME',
header: Zi.LAN.PRINTTIME, //'货物标识',
width: 70
}, {
dataIndex: 'PRINTUSER',
header: Zi.LAN.PRINTUSER, //'货物标识',
width: 70
}
];

@ -259,7 +259,8 @@
{ name: 'CANGDANSTATUS', type: 'int' },
{ name: 'DEST_RTCNT_TIME', type: 'string' },
{ name: 'OPWMS_IN_COUNT', type: 'string' },
{ name: 'PRINTTIME', type: 'string' },
{ name: 'PRINTTIME', type: 'string' },
{ name: 'PRINTUSER', type: 'string' },
{ name: 'WMSSTATUS', type: 'string' }
]
});

@ -434,6 +434,7 @@ Zi.LAN.TOETA = "到开船日期";
Zi.LAN.YYRXT = "已引入系统,确认要覆盖以前业务吗?";
Zi.LAN.WMSSTATUS = "发仓储状态";
Zi.LAN.PRINTTIME = "核算单打印时间";
Zi.LAN.PRINTUSER = "核算单打印人";
//#endregion
//Zi.LAN. = "";

@ -435,6 +435,7 @@ Zi.LAN.TOETA = "到开船日期";
Zi.LAN.YYRXT = "已引入系统,确认要覆盖以前业务吗?";
Zi.LAN.WMSSTATUS = "发仓储状态";
Zi.LAN.PRINTTIME = "核算单打印时间";
Zi.LAN.PRINTUSER = "核算单打印人";
//#endregion

@ -0,0 +1,26 @@

Ext.BLANK_IMAGE_URL = '../../TruckMng/Content/Images/s.gif';
var panelEdit = null;
Ext.onReady(function () {
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
panelEdit = Ext.create('Shipping.MsOpVgmSendEdit', {
id:'OpPriceEdit',
layout: 'border',
region: 'center' });
var view = new Ext.Viewport({
layout: 'border',
renderTo: 'viewport',
border: false,
items: [
panelEdit
]
});
});
function getSaved() {
return panelEdit.getIsModify();
}

@ -0,0 +1,31 @@
Ext.BLANK_IMAGE_URL = '../../TruckMng/Content/Images/s.gif';
var panelIndex = null;
Ext.onReady(function () {
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
panelIndex = new window.Shipping.MsOpSaleRptIndex({
layout: 'border'
});
var view = new Ext.Viewport({
layout: 'border',
renderTo: 'viewport',
border: false,
items: [{
region: 'center',
layout: 'fit',
items: [panelIndex]
}]
});
});
function OprationSwap() {
return panelIndex.OprationSwap();
}
function AddNewRecord(record) {
panelIndex.AddNewRecord(record);
}

@ -0,0 +1,46 @@
Ext.define('MsOpVgmSend', {
extend: 'Ext.data.Model',
idProperty: 'GID',
fields: [
{ name: 'GID', type: 'string' }, // 业务编号
{ name: 'BSNO', type: 'string' }, // 业务编号
{ name: 'MBLNO', type: 'string' },
{ name: 'VGMSTATUS', type: 'string' }, // 委托单位
{ name: 'ORDERNO', type: 'string' }, // 会计期间
{ name: 'CARRIER', type: 'string' },
{ name: 'LOADPORT', type: 'string' }, // 揽货人
{ name: 'MATOU', type: 'string' }, //
{ name: 'ISCARRIER', type: 'bool' }, //
{ name: 'ISYGT', type: 'bool' }, //
{ name: 'SENDTYPE', type: 'string' }, //
{ name: 'REMARK', type: 'string' },
{ name: 'VESSEL', type: 'string' },
{ name: 'VOYNO', type: 'string' },
{ name: 'VGM_TIME', type: 'string' },
{ name: 'CTNNUM', type: 'number' }, //
{ name: 'SENDERUSER', type: 'string' }, // 创建人
{ name: 'SENDERUSERREF', type: 'string' }, // 创建人
{ name: 'SENDTIME', type: 'string' }
]
});
Ext.define('MsOpVgmCtn', {
extend: 'Ext.data.Model',
idProperty: 'GID',
fields: [
{ name: 'CTN_ID', type: 'string' }, // 业务编号
{ name: 'BSNO', type: 'string' }, // 业务编号
{ name: 'SENDGID', type: 'string' },
{ name: 'CTNALL', type: 'string' }, // 委托单位
{ name: 'CNTRNO', type: 'string' }, // 会计期间
{ name: 'SEALNO', type: 'string' },
{ name: 'WEIGHTYPE', type: 'string' },
{ name: 'KGS', type: 'number' }, //
{ name: 'TAREWEIGHT', type: 'number' }, //
{ name: 'VGMKGS', type: 'number' }, //
{ name: 'YARD', type: 'string' }, // 创建人
{ name: 'WEIGHDATE', type: 'date' }
]
});

@ -56,6 +56,7 @@ Ext.extend(Shipping.MsRptCdTotalIndex, Ext.Panel, {
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptNoTotal/FeeCDListData',
timeout: 120000,
reader: {
id: '',
root: 'data',
@ -86,11 +87,6 @@ Ext.extend(Shipping.MsRptCdTotalIndex, Ext.Panel, {
dataIndex: 'MBLNO',
header: '主提单号',
width: 160
}, {
sortable: true,
dataIndex: 'FEENAME',
header: '费用名称',
width: 100
}, {
sortable: true,
dataIndex: 'CURRENCY',
@ -150,6 +146,10 @@ Ext.extend(Shipping.MsRptCdTotalIndex, Ext.Panel, {
disableSelection: false,
selModel: this.GridCheckBoxModel,
columns: this.girdcolumsfeedr,
viewConfig: {
enableTextSelection: true,
autoFill: true
},
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeFeeListDr,
@ -759,20 +759,7 @@ Ext.extend(Shipping.MsRptCdTotalIndex, Ext.Panel, {
selType: 'cellmodel',
viewConfig: {
autoFill: true,
enableTextSelection: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('FeeStatus');
var BsNo = record.get('BsNo');
var ISSEL = record.get('ISSEL');
if (ISSEL == '1') { return Shipping.FeeGetRowClassFont(feeStatus); }
else {
if (BsNo == _thisfeeview.strBSNO)
return Shipping.FeeGetRowClass(feeStatus);
else return Shipping.FeeGetRowClassFont(feeStatus);
}
}
enableTextSelection: true
},
columns: this.girdDrcolums
});
@ -794,9 +781,9 @@ Ext.extend(Shipping.MsRptCdTotalIndex, Ext.Panel, {
this.storeDrChFee.on('beforeload', function (store) {
var xcondition = " ch_fee.BSNO IN (SELECT BSNO FROM V_OP_BILL WHERE MBLNO='" + this.selectbsno + "') and ch_fee.FEESTATUS=0 and ch_fee.SETTLEMENT=0 and ch_fee.ORDERAMOUNT=0 and ch_fee.ORDERINVOICE=0 AND ISNULL(ch_fee.INVOICE,0)=0 AND ch_fee.AMOUNT<>0 ";
xcondition = xcondition + " AND ch_fee.CUSTOMERNAME='" + this.selectcust + "' AND ch_fee.CURRENCY='" + this.selectcurr + "' and ch_fee.FEENAME='" + this.selectfeename + "' ";
xcondition = xcondition + " AND ch_fee.CUSTOMERNAME='" + this.selectcust + "' AND ch_fee.CURRENCY='" + this.selectcurr + "' ";
if (this.isinputmode == '1') xcondition = xcondition + " and ch_fee.INPUTMODE='" + this.selectinputmode + "'";
Ext.apply(store.proxy.extraParams, { condition: xcondition, billno: '1', type: 1, optype:'op_seae' });
Ext.apply(store.proxy.extraParams, { condition: xcondition, billno: '1', type: 1, optype:'' });
}, this);
this.panelFeeListDr = new Ext.Panel({

@ -2499,6 +2499,11 @@
<Content Include="Areas\MvcShipping\Viewsjs\MsOpStatus\Zi_en-us.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsOpStatus\Zi_zh-cn.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsOpSubSeaOrder\FeeTemplatePLAdd.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsOpVgmSend\Edit.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsOpVgmSend\Index.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsOpVgmSend\MsOpVgmSendEdit.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsOpVgmSend\MsOpVgmSendIndex.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsOpVgmSend\MsOpVgmSendModel.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsRptChInvTotal\MsBsCrChInvView.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsRptCwBaoXiao\MsRptCwBaoXiaoIndex.js" />
<Content Include="Areas\MvcShipping\Viewsjs\MsRptFeeSettleStatus\MsRptFeeSettleZnjIndex.js" />
@ -3616,6 +3621,8 @@
<Content Include="Areas\MvcShipping\Views\MsOpSeaePre\ModifyEdit.aspx" />
<Content Include="Areas\MvcShipping\Views\MsOpSeaePre\ModifyHisEdit.aspx" />
<Content Include="Areas\MvcShipping\Views\MsOpSubSeaOrder\AddFeePLIndex.aspx" />
<Content Include="Areas\MvcShipping\Views\MsOpVgmSend\Edit.aspx" />
<Content Include="Areas\MvcShipping\Views\MsOpVgmSend\Index.aspx" />
<Content Include="Areas\MvcShipping\Views\MsRptChInvTotal\BsCrView.aspx" />
<Content Include="Areas\MvcShipping\Views\MsRptCwBaoXiao\Index.aspx" />
<Content Include="Areas\MvcShipping\Views\MsRptFeeSettleStatus\ZnjIndex.aspx" />
@ -8465,6 +8472,7 @@
<Compile Include="Areas\MvcShipping\Controllers\MsOpSocCtnController.cs" />
<Compile Include="Areas\MvcShipping\Controllers\MsOpSeaePreController.cs" />
<Compile Include="Areas\MvcShipping\Controllers\BIReportController.cs" />
<Compile Include="Areas\MvcShipping\Controllers\MsOpVgmSendController.cs" />
<Compile Include="Areas\MvcShipping\Controllers\MsRptCwBaoXiaoController.cs" />
<Compile Include="Areas\MvcShipping\Controllers\MsRptOpProfitFeeController.cs" />
<Compile Include="Areas\MvcShipping\Controllers\MsSysInvInterFaceSetController.cs" />
@ -8494,6 +8502,7 @@
<Compile Include="Areas\MvcShipping\DAL\MsOpSocCtn\MsOpSocCtnDAL.cs" />
<Compile Include="Areas\MvcShipping\DAL\MsOpSeaePre\MsOpSeaePreDAL.cs" />
<Compile Include="Areas\MvcShipping\DAL\BIREPORT\BIReportDAL.cs" />
<Compile Include="Areas\MvcShipping\DAL\MsOpVgmSend\MsOpVgmSendDAL.cs" />
<Compile Include="Areas\MvcShipping\DAL\MsRptCwBaoXiao\MsRptCwBaoXiaoDAL.cs" />
<Compile Include="Areas\MvcShipping\DAL\MsRptNoTotal\MsRptNoTotalDAL.cs" />
<Compile Include="Areas\MvcShipping\DAL\MsRptZjTotal\MsRptZjTotalDAL.cs" />
@ -8550,6 +8559,7 @@
<Compile Include="Areas\MvcShipping\Models\MsOpSocCtn\MsOpSocCtn.cs" />
<Compile Include="Areas\MvcShipping\Models\MsOpSeaePre\MsOpSeaePre.cs" />
<Compile Include="Areas\MvcShipping\Models\MsOpSeae\MsOpSeaeDjy.cs" />
<Compile Include="Areas\MvcShipping\Models\MsOpVgmSend\MsOpVgmSend.cs" />
<Compile Include="Areas\MvcShipping\Models\MsRptCwBaoXiao\MsRptCwBaoXiao.cs" />
<Compile Include="Areas\MvcShipping\Models\MsSysInvInterFaceSet\SysInvInterFaceSet.cs" />
<Compile Include="Areas\MvcShipping\Models\MsOpBillProfit\MsOpBillYj.cs" />

@ -26,6 +26,8 @@ using System.Text;
using DSWeb.Areas.CommMng.DAL;
using sun.net.idn;
using System.Text.RegularExpressions;
using DSWeb.Common.DB;
using Newtonsoft.Json;
namespace DSWeb
{
@ -130,6 +132,15 @@ namespace DSWeb
DoReceiveBill();
}
var ReceiveVGMReceipt = ConfigurationManager.AppSettings["ReceiveVGMReceipt"];
if (ReceiveVGMReceipt != null && ReceiveVGMReceipt.ToString().ToUpper() == "TRUE")
{
DoReceiveDjyVGMReceipt();
}
InitMapper();
JobScheduler.Start();
@ -410,7 +421,7 @@ namespace DSWeb
//var strBody = Areas.CommMng.DAL.BasicDataRefDAL.Decompress(strBodyZip);
//测试数据不需解压缩
var strBody = Regex.Unescape(strBodyZip);
BasicDataRefDAL.SaveLog(strBody, "", "接收账单解压缩数据", "");
//BasicDataRefDAL.SaveLog(strBody, "", "接收账单解压缩数据", "");
//导出到东胜6
//if(strBody.Contains("TAHT30633700"))
@ -434,5 +445,78 @@ namespace DSWeb
}
#endregion
#region 接收大简云vgm回执状态回推消息队列
private void DoReceiveDjyVGMReceipt()
{
var RecMqUri = ConfigurationManager.AppSettings["VGMMQUrl"];
var = true;
ConnectionFactory factory = new ConnectionFactory();
factory.Uri = RecMqUri;
mqConn = factory.CreateConnection();
IModel modelDingCang = mqConn.CreateModel();
//if (!string.IsNullOrWhiteSpace(ExchangeName))
// modelDingCang.ExchangeDeclare(ExchangeName, ExchangeType.Direct);
var QueuePrefix = ConfigurationManager.AppSettings["QueuePrefix_VGMReceipt"];
var Companyid = ConfigurationManager.AppSettings["DjydcCompanyid"];
modelDingCang.QueueDeclare($"{QueuePrefix}{Companyid}", false, false, false, null);
var consumer = new EventingBasicConsumer(modelDingCang);
consumer.Received += (ch, ea) =>
{
var body = ea.Body;
try
{
////不压缩
//var strBody = Encoding.UTF8.GetString(body.ToArray());
////压缩
//var strBodyZip = Encoding.UTF8.GetString(body.ToArray());
//logger.Debug($"收到大简云订舱输出压缩数据:{strBodyZip}");
//LoggerHelper loggerHelper = new LoggerHelper("接收大简云订舱");
//SaveLog(strBodyZip, "", "接收大简云订舱", "压缩内容");
//var strBody = Areas.CommMng.DAL.BasicDataRefDAL.Decompress(strBodyZip);
var strBody = Encoding.UTF8.GetString(body.ToArray());
BasicDataRefDAL.SaveLog(strBody, "", "接收VGM回执", "解压内容");
//测试数据不需解压缩
//var strBody = strBodyZip;
//logger.Debug($"收到大简云订舱输出数据:{strBody}");
//导出到东胜6
//if(strBody.Contains("TAHT30633700"))
DSWeb.Areas.CommMng.DAL.DJYVGMReceipt_MqWorkDAL.ReceiveDjyVGMReceipt(strBody);
}
catch (Exception ex)
{
var excep = ex;
while (excep != null)
{
//logger.Error(excep.Message);
//logger.Error(excep.StackTrace);
excep = excep.InnerException;
}
}
};
//第二个参数控制【是否消费掉队列里的数据】
modelDingCang.BasicConsume($"{QueuePrefix}{Companyid}", , consumer);
}
#endregion
}
}
Loading…
Cancel
Save