hanxuntao 3 days ago
parent e87a1d33ef
commit 229eeda48c

@ -2049,7 +2049,9 @@ namespace DSWeb.MvcShipping.Controllers
var headData = JsonConvert.Deserialize<MsOpSeaeAms>(data.Replace("}", ",") + data2.Replace("{", ""));
headData.BSNO = bsno;
if (headData.AMSNO == "*")
var headData2 = MsOpSeaeEdiPortDAL.GetAmsData("BSNO='" + bsno + "'");
if (headData2.AMSNO == "*")
{
headData.DbOperationType = DbOperationType.DbotIns;
headData.AMSNO = Guid.NewGuid().ToString();
@ -2058,6 +2060,7 @@ namespace DSWeb.MvcShipping.Controllers
{
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
headData.AMSNO = headData2.AMSNO;
}
var BSNO = headData.AMSNO;
@ -3290,7 +3293,7 @@ namespace DSWeb.MvcShipping.Controllers
var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json };
}
public ContentResult CreateCustomList(string bsnos, string type)
public ContentResult CreateCustomList(string bsnos, string type,string editype="CN")
{
bsnos = bsnos.Replace(",", "','");
var billList = MsOpSeaeDAL.GetDataList("BSNO IN ('" + bsnos + "')", CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
@ -3303,7 +3306,7 @@ namespace DSWeb.MvcShipping.Controllers
MsOpSeaeEdiPortDAL.IsCreateCustom(billList, type);
if (error == "")
{
result = MsOpSeaeEdiPortDAL.CreateCustomList(billList, type, CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
result = MsOpSeaeEdiPortDAL.CreateCustomList(billList, type, CookieConfig.GetCookie_UserId(Request), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), editype);
}
else

@ -353,6 +353,273 @@ namespace DSWeb.MvcShipping.Controllers
}
}
public ContentResult SaveENS(string opstatus, string data, string data2, string body, string cargobody,string bsno)
{
var ss = Session["SHOWNAME"];
if (ss == null)
{
var jsonRespose = new JsonResponse { Success = false, Message = "登录超时,请重新登录!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
var OpAmsData = JsonConvert.Deserialize<MsOpSeaeAms>(data);
var headData = JsonConvert.Deserialize<MsOpSeaeEdi>(data2);
var bodyList = JsonConvert.Deserialize<List<MsOpSeaeEdiCtn>>(body);
var cargoList = JsonConvert.Deserialize<List<MsOpSeaeEdiCtnDetail>>(cargobody);
var isPost = true;
var errorstr = "";
if (headData.CORPID == "" || headData.CORPID == null)
{
headData.CORPID = Convert.ToString(Session["COMPANYID"]);
}
if (opstatus == "add")
{
headData.INPUTBY = Convert.ToString(Session["SHOWNAME"]);
headData.INPUTDATE = DateTime.Now.ToShortDateString();
headData.DbOperationType = DbOperationType.DbotIns;
}
else if (opstatus == "edit")
{
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
}
else
{
headData.DbOperationType = DbOperationType.DbotDel;
}
if (headData.ETA == "") headData.ETA = null;
if (headData.ETD == "") headData.ETD = null;
if (!string.IsNullOrEmpty(headData.ETD))
{
headData.ETD = Convert.ToDateTime(headData.ETD).ToString("yyyy-MM-dd");
}
if (headData.LASTPORTOFCALLDATE == "") headData.LASTPORTOFCALLDATE = null;
if (headData.FIRSTPORTOFCALLDATE == "") headData.FIRSTPORTOFCALLDATE = null;
headData.VESSEL = MsBaseInfoDAL.DelPortCn(headData.VESSEL);
headData.PORTLOAD = MsBaseInfoDAL.DelPortCn(headData.PORTLOAD);
headData.PORTDISCHARGE = MsBaseInfoDAL.DelPortCn(headData.PORTDISCHARGE);
headData.PORTDISCHARGE = MsBaseInfoDAL.DelPortCn(headData.PORTDISCHARGE);
headData.DESTINATION = MsBaseInfoDAL.DelPortCn(headData.DESTINATION);
#region 判断字段长度
if (isPost)
{
var seaefield = MsSoftSysTableDAL.GetDefTableDetailList("OP_SEAE_EDI");
foreach (var enumValue in seaefield)
{
if (enumValue.FIELDNAME == "MBLNO" && headData.MBLNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "主提单号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "HBLNO" && headData.HBLNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "分提单号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CUSTNO" && headData.CUSTNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "委托编号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "ORDERNO" && headData.ORDERNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "订舱编号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPER" && headData.SHIPPER.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEE" && headData.CONSIGNEE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTY" && headData.NOTIFYPARTY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "AGENTID" && headData.AGENTID.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "代理名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "VESSEL" && headData.VESSEL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "船名超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "VOYNO" && headData.VOYNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "航次超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "PlACERECEIPT" && headData.PLACERECEIPT.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货地超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "PORTLOADID" && headData.PORTLOADID.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "装货港代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "PORTLOAD" && headData.PORTLOAD.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "装货港超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "PORTDISCHARGEID" && headData.PORTDISCHARGEID.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "卸货港代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "PORTDISCHARGE" && headData.PORTDISCHARGE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "卸货港超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "PLACEDELIVERYID" && headData.PLACEDELIVERYID.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "交货地代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "PLACEDELIVERY" && headData.PLACEDELIVERY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "交货地超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "DESTINATIONID" && headData.DESTINATIONID.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "目的地代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "DESTINATION" && headData.DESTINATION.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "目的地超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "ISSUEPLACE" && headData.ISSUEPLACE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "签单地点超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BLFRT" && headData.BLFRT.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "付费方式超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SERVICE" && headData.SERVICE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "运输条款超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "MARKS" && headData.MARKS.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "唛头超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "DESCRIPTION" && headData.DESCRIPTION.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "货物描述超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "KINDPKGS" && headData.KINDPKGS.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "包装超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "DCLASS" && headData.DCLASS.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "危险品类别超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "DUNNO" && headData.DUNNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "危险品编号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "REEFERF" && headData.REEFERF.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "冷藏通风量超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "TEMPID" && headData.TEMPID.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "温度单位超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "TEMPSET" && headData.TEMPSET.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "设置温度超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "TEMPMAX" && headData.TEMPMAX.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "最高温度超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "TEMPMIN" && headData.TEMPMIN.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "最低温度超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "LINKMAN" && headData.LINKMAN.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "客户联系人超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "DPAGE" && headData.DPAGE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "危险品页号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "HUMIDITY" && headData.HUMIDITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "湿度超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "DLABEL" && headData.DLABEL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "危险品标签超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPERNAME" && headData.SHIPPERNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPERADDR1" && headData.SHIPPERADDR1.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人地址1超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPERADDR2" && headData.SHIPPERADDR2.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人地址2超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPERADDR3" && headData.SHIPPERADDR3.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人地址3超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPERCITY" && headData.SHIPPERCITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人城市代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPERPOSTCODE" && headData.SHIPPERPOSTCODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人邮编超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPERPROVINCE" && headData.SHIPPERPROVINCE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人省份超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPERCOUNTRY" && headData.SHIPPERPOSTCODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人国家代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPERATTN" && headData.SHIPPERATTN.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人联系人超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPERTEL" && headData.SHIPPERPOSTCODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人电话超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPPERPOSTCODE" && headData.SHIPPERPOSTCODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "发货人邮编超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEENAME" && headData.CONSIGNEENAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEEADDR1" && headData.CONSIGNEEADDR1.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人地址1超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEEADDR2" && headData.CONSIGNEEADDR2.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人地址2超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEEADDR3" && headData.CONSIGNEEADDR3.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人地址3超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEECITY" && headData.CONSIGNEECITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人城市代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEEPOSTCODE" && headData.CONSIGNEEPOSTCODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人邮编超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEEPROVINCE" && headData.CONSIGNEEPROVINCE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人省份超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEECOUNTRY" && headData.CONSIGNEECOUNTRY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人国家代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEEATTN" && headData.CONSIGNEEATTN.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人联系人超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEETEL" && headData.CONSIGNEETEL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人电话超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEEPOSTCODE" && headData.CONSIGNEEPOSTCODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "收货人邮编超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTYNAME" && headData.NOTIFYPARTYNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTYADDR1" && headData.NOTIFYPARTYADDR1.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人地址1超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTYADDR2" && headData.NOTIFYPARTYADDR2.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人地址2超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTYADDR3" && headData.NOTIFYPARTYADDR3.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人地址3超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTYCITY" && headData.NOTIFYPARTYCITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人城市代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTYPOSTCODE" && headData.NOTIFYPARTYPOSTCODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人邮编超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTYPROVINCE" && headData.NOTIFYPARTYPROVINCE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人省份超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTYCOUNTRY" && headData.NOTIFYPARTYCOUNTRY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人国家代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTYATTN" && headData.NOTIFYPARTYATTN.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人联系人超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTYTEL" && headData.NOTIFYPARTYTEL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人电话超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "NOTIFYPARTYPOSTCODE" && headData.NOTIFYPARTYPOSTCODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "通知人邮编超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "LASTPORTOFCALLID" && headData.LASTPORTOFCALLID.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "最后境外港超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "FIRSTPORTOFCALLID" && headData.FIRSTPORTOFCALLID.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "第一个停靠港港口超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "LASTPORTOFCALLID" && headData.LASTPORTOFCALLID.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "最后境外港代码超长,字段长度限制" + enumValue.FIELDLEN; }
//if (enumValue.FIELDNAME == "LASTPORTOFCALLDATE" && headData.LASTPORTOFCALLDATE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "第一个停靠港港口代码超长,字段长度限制" + enumValue.FIELDLEN; }
//if (enumValue.FIELDNAME == "FIRSTPORTOFCALLDATE" && headData.FIRSTPORTOFCALLDATE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "离港日期超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPIMO" && headData.SHIPIMO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "船舶呼号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPSERVICENO" && headData.SHIPSERVICENO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "船舶(IMO)号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CARRIERID" && headData.CARRIERID.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "船公司代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "ARVESSEL" && headData.ARVESSEL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "抵港船名超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "ARVOYNO" && headData.ARVOYNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "抵港航次超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "ARSHIPIMO" && headData.ARSHIPIMO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "抵港呼号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "ARSHIPSERVICENO" && headData.ARSHIPSERVICENO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "抵港(IMO)号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "AGENTID" && headData.AGENTID.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "代理代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "AMSSCACCODE" && headData.AMSSCACCODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "AMS SCAC超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SELLERNAME" && headData.SELLERNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "卖方名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SELLERADDR1" && headData.SELLERADDR1.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "卖方地址1超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SELLERADDR2" && headData.SELLERADDR2.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "卖方地址2超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SELLERCITY" && headData.SELLERCITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "卖方城市代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SELLERPROVINCE" && headData.SELLERPROVINCE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "卖方省份代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SELLERCOUNTRY" && headData.SELLERCOUNTRY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "卖方国家代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SELLEREMAIL" && headData.SELLEREMAIL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "卖方邮箱超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BUYERNAME" && headData.BUYERNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "买方名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BUYERADDR1" && headData.BUYERADDR1.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "买方地址1超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BUYERADDR2" && headData.BUYERADDR2.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "买方地址2超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BUYERCITY" && headData.BUYERCITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "买方城市代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BUYERPROVINCE" && headData.BUYERPROVINCE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "买方省份代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BUYERCOUNTRY" && headData.BUYERCOUNTRY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "买方国家代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BUYEREMAIL" && headData.BUYEREMAIL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "买方邮箱超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPTOPARTYNAME" && headData.SHIPTOPARTYNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "货物送达的公司名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPTOPARTYADDR1" && headData.SHIPTOPARTYADDR1.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "货物送达的公司地址1超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPTOPARTYADDR2" && headData.SHIPTOPARTYADDR2.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "货物送达的公司地址2超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPTOPARTYCITY" && headData.SHIPTOPARTYCITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "货物送达的公司城市代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPTOPARTYPROVINCE" && headData.SHIPTOPARTYPROVINCE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "货物送达的公司省份代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPTOPARTYCOUNTRY" && headData.SHIPTOPARTYCOUNTRY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "货物送达的公司国家代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SHIPTOPARTYEMAIL" && headData.SHIPTOPARTYEMAIL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "货物送达的公司邮箱超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONTAINERLOCATIONNAME" && headData.CONTAINERLOCATIONNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "装柜信息名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONTAINERLOCATIONADDR1" && headData.CONTAINERLOCATIONADDR1.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "装柜信息地址1超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONTAINERLOCATIONADDR2" && headData.CONTAINERLOCATIONADDR2.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "装柜信息地址2超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONTAINERLOCATIONCITY" && headData.CONTAINERLOCATIONCITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "装柜信息城市代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONTAINERLOCATIONPROVINCE" && headData.CONTAINERLOCATIONPROVINCE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "装柜信息省份代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONTAINERLOCATIONCOUNTRY" && headData.CONTAINERLOCATIONCOUNTRY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "装柜信息国家代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONTAINERLOCATIONEMAIL" && headData.CONTAINERLOCATIONEMAIL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "装柜信息邮箱超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "MANUFACTURERNAME" && headData.MANUFACTURERNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "工厂名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "MANUFACTURERADDR1" && headData.MANUFACTURERADDR1.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "工厂地址1超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "MANUFACTURERADDR2" && headData.MANUFACTURERADDR2.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "工厂地址2超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "MANUFACTURERCITY" && headData.MANUFACTURERCITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "工厂城市代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "MANUFACTURERPROVINCE" && headData.MANUFACTURERPROVINCE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "工厂省份代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "MANUFACTURERCOUNTRY" && headData.MANUFACTURERCOUNTRY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "工厂国家代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "MANUFACTUREREMAIL" && headData.MANUFACTUREREMAIL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "工厂邮箱超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSOLIDATORNAME" && headData.CONSOLIDATORNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "拼箱公司名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSOLIDATORADDR1" && headData.CONSOLIDATORADDR1.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "拼箱公司地址1超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSOLIDATORADDR2" && headData.CONSOLIDATORADDR2.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "拼箱公司地址2超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSOLIDATORCITY" && headData.CONSOLIDATORCITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "拼箱公司城市代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSOLIDATORPROVINCE" && headData.CONSOLIDATORPROVINCE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "拼箱公司省份代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSOLIDATORCOUNTRY" && headData.CONSOLIDATORCOUNTRY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "拼箱公司国家代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSOLIDATOREMAIL" && headData.CONSOLIDATOREMAIL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "拼箱公司邮箱超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "IMPORTERNAME" && headData.IMPORTERNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "进口商名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "IMPORTERADDR1" && headData.IMPORTERADDR1.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "进口商地址1超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "IMPORTERADDR2" && headData.IMPORTERADDR2.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "进口商地址2超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "IMPORTERCITY" && headData.IMPORTERCITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "进口商城市代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "IMPORTERPROVINCE" && headData.IMPORTERPROVINCE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "进口商省份代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "IMPORTERCOUNTRY" && headData.IMPORTERCOUNTRY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "进口商国家代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "IMPORTEREMAIL" && headData.IMPORTEREMAIL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "进口商邮箱超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BOOKINGPARTYNAME" && headData.BOOKINGPARTYNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "订舱方名称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BOOKINGPARTYADDR1" && headData.BOOKINGPARTYADDR1.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "订舱方地址1超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BOOKINGPARTYADDR2" && headData.BOOKINGPARTYADDR2.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "订舱方地址2超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BOOKINGPARTYCITY" && headData.BOOKINGPARTYCITY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "订舱方城市代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BOOKINGPARTYPROVINCE" && headData.BOOKINGPARTYPROVINCE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "订舱方省份代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BOOKINGPARTYCOUNTRY" && headData.BOOKINGPARTYCOUNTRY.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "订舱方国家代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BOOKINGPARTYEMAIL" && headData.BOOKINGPARTYEMAIL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "订舱方邮箱超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "ISFIMPORTER_CODE" && headData.ISFIMPORTER_CODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "ISFImporter证件号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "IMPORTER_CODE" && headData.IMPORTER_CODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "Importer证件号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONSIGNEE_CODE" && headData.CONSIGNEE_CODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "Consignee证件号超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "BONDHOLDER_CODE" && headData.BONDHOLDER_CODE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "Bond Holder((买方)证件号超长,字段长度限制" + enumValue.FIELDLEN; }
}
}
#endregion
OpAmsData.BSNO = bsno;
var headData2 = MsOpSeaeEdiPortDAL.GetAmsData("BSNO='" + bsno + "'");
if (headData2.AMSNO == "*")
{
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
var blUpSQL = " INSERT INTO op_seae_ams(AMSNO,BSNO,ISHAVEHBL,APPLICATIONEORI) values(NEWID(),'"+bsno+"',"+ OpAmsData.ISHAVEHBL+ ",'"+ OpAmsData.APPLICATIONEOR+ "')";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
else
{
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
var blUpSQL = " UPDATE op_seae_ams SET ISHAVEHBL="+ OpAmsData.ISHAVEHBL + " ,APPLICATIONEORI='"+ OpAmsData.APPLICATIONEOR+ "' WHERE AMSNO='"+ OpAmsData.AMSNO+ "'";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
headData.BSNO = bsno;
var BSNO = headData.MFNO;
if (isPost)
{
var modb = new ModelObjectDB();
DBResult result = modb.Save(headData);
if (result.Success == true)
{
result = MsOpSeaeEdiDAL.SaveDetail(headData, bodyList, cargoList);
}
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = MsOpSeaeEdiDAL.GetData("MFNO='" + BSNO + "'")
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
else
{
var jsonRespose = new JsonResponse { Success = false, Message = errorstr };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
}
public ContentResult DeleteDetail(string data)
{
var head = JsonConvert.Deserialize<MsOpSeaeEdiCtn>(data);

@ -170,14 +170,14 @@ namespace DSWeb.MvcShipping.Controllers
return new ContentResult() { Content = json };
}
public ContentResult modifyStlDate(string data, string modifydata)
public ContentResult modifyStlDate(string data, string modifydata,string op)
{
var bodyList = JsonConvert.Deserialize<List<OpTask>>(data);
var result = new DBResult();
if (bodyList != null)
{
result = MsOpTaskDAL.ModifyStlDate(bodyList, modifydata, Convert.ToString(Session["COMPANYID"]));
result = MsOpTaskDAL.ModifyStlDate(bodyList, modifydata, op,Convert.ToString(Session["COMPANYID"]));
}
var jsonRespose = new JsonResponse
{

@ -48462,7 +48462,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
return error;
}
static public DBResult CreateCustomdb(MsOpSeae bill, Database db, DbTransaction tran, string type, CompanyDef companydef, string usercode, string companyid)
static public DBResult CreateCustomdb(MsOpSeae bill, Database db, DbTransaction tran, string type, CompanyDef companydef, string usercode, string companyid,string editype="CN")
{
var result = new DBResult();
try
@ -48480,7 +48480,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
,[DESTINATIONID],[DESTINATION],[SERVICE],[MARKS],[DESCRIPTION],[PKGS],[KINDPKGS],[KGS],[CBM],[CARGOID],[DCLASS]
,[DUNNO],[REEFERF],[TEMPID],[TEMPSET],[TEMPMAX],[TEMPMIN],[SHIPIMO],[CARRIERID],[ORDERNO]
,[FILEROLE],[PACKINGTYPE],[TRANSTYPE],[FILETYPE],[ISLASTHBL],[BLFRT],[ISSUEPLACE],YARD,CARRIER,ETA
,[AGENTID],[CORPID])
,[AGENTID],[CORPID],SHIPPERCORPTYPE,CONSIGNEECORPTYPE,NOTIFYPARTYCORPTYPE,SELLERCORPTYPE,BUYERCORPTYPE)
VALUES
(@MFNO,@BSNO,@MASTERNO,@EDITYPE,@EDISTATUS,@INPUTBY,@INPUTDATE,@CUSTNO,@MBLNO,@HBLNO,@SHIPPERCODE
,@SHIPPERNAME,@SHIPPERADDR1,@SHIPPERADDR2,@SHIPPERADDR3,@SHIPPERCITY,@SHIPPERPROVINCE,@SHIPPERPOSTCODE
@ -48492,14 +48492,17 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
,@DESTINATIONID,@DESTINATION,@SERVICE,@MARKS,@DESCRIPTION,@PKGS,@KINDPKGS,@KGS,@CBM,@CARGOID,@DCLASS
,@DUNNO,@REEFERF,@TEMPID,@TEMPSET,@TEMPMAX,@TEMPMIN,@SHIPIMO,@CARRIERID,@ORDERNO
,@FILEROLE,@PACKINGTYPE,@TRANSTYPE,@FILETYPE,@ISLASTHBL,@BLFRT,@ISSUEPLACE,@YARD,@CARRIER,@ETA
,@AGENTID,@CORPID) ");
,@AGENTID,@CORPID,@SHIPPERCORPTYPE,@CONSIGNEECORPTYPE,@NOTIFYPARTYCORPTYPE,@SELLERCORPTYPE,@BUYERCORPTYPE) ");
var MFNO = Guid.NewGuid().ToString();
cmdInsert.Parameters.Clear();
db.AddInParameter(cmdInsert, "@MFNO", DbType.String, MFNO);
db.AddInParameter(cmdInsert, "@BSNO", DbType.String, bill.BSNO);
db.AddInParameter(cmdInsert, "@MASTERNO", DbType.String, bill.MASTERNO);
db.AddInParameter(cmdInsert, "@EDITYPE", DbType.String, "CN");
db.AddInParameter(cmdInsert, "@EDITYPE", DbType.String, editype);
if (editype=="ENS")
db.AddInParameter(cmdInsert, "@FILETYPE", DbType.String, "Master");
else
db.AddInParameter(cmdInsert, "@FILETYPE", DbType.String, "House");
db.AddInParameter(cmdInsert, "@EDISTATUS", DbType.String, "未发送");
db.AddInParameter(cmdInsert, "@INPUTBY", DbType.String, usercode);
@ -48788,6 +48791,11 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
}
db.AddInParameter(cmdInsert, "@CORPID", DbType.String, companyid);
db.AddInParameter(cmdInsert, "@SHIPPERCORPTYPE", DbType.String,"L");
db.AddInParameter(cmdInsert, "@CONSIGNEECORPTYPE", DbType.String, "L");
db.AddInParameter(cmdInsert, "@NOTIFYPARTYCORPTYPE", DbType.String, "L");
db.AddInParameter(cmdInsert, "@SELLERCORPTYPE", DbType.String, "L");
db.AddInParameter(cmdInsert, "@BUYERCORPTYPE", DbType.String, "L");
db.ExecuteNonQuery(cmdInsert, tran);
@ -49849,7 +49857,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
return result;
}
public static DBResult CreateCustomList(List<MsOpSeae> billList, string type, string userid, string usercode, string companyid)
public static DBResult CreateCustomList(List<MsOpSeae> billList, string type, string userid, string usercode, string companyid,string editype="CN")
{
var result = new DBResult();
var companydef = GetCompanyDef(companyid);
@ -49867,20 +49875,20 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
{
if (bill.BLTYPE == "拼箱主票")
{
CreateCustomdb(bill, db, tran, type, companydef, usercode, companyid);
CreateCustomdb(bill, db, tran, type, companydef, usercode, companyid, editype);
var billfenlist = MsOpSeaeDAL.MsOpSeaeDAL.GetFenList(" MASTERNO<>BSNO AND MASTERNO='" + bill.BSNO + "'", userid, usercode, companyid);
if (billfenlist.Count > 0)
{
foreach (var billfen in billfenlist)
{
CreateCustomdb(billfen, db, tran, type, companydef, usercode, companyid);
CreateCustomdb(billfen, db, tran, type, companydef, usercode, companyid, editype);
}
}
}
else
CreateCustomdb(bill, db, tran, type, companydef, usercode, companyid);
CreateCustomdb(bill, db, tran, type, companydef, usercode, companyid, editype);
}

@ -76,6 +76,10 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiDAL
strSql.Append(",[SELLERADDR2],[SELLEREMAIL],[BUYERADDR2],[BUYEREMAIL],[MANUFACTURERADDR2] ,[MANUFACTUREREMAIL],[SHIPTOPARTYADDR2] ,[SHIPTOPARTYEMAIL],[CONTAINERLOCATIONADDR2]");
strSql.Append(",[CONTAINERLOCATIONEMAIL],[CONSOLIDATORADDR2] ,[CONSOLIDATOREMAIL],[IMPORTERADDR2],[IMPORTEREMAIL],[BOOKINGPARTYADDR2],[BOOKINGPARTYEMAIL]");
strSql.Append(",HBLTYPE,MASTERHBLNUMBER,PORTTERMINALCODETYPE,PORTTERMINALCODE,MASTERHBLPREFIX,CONTACTNAME,CONTACTPHONE,COMMENTS,DELIVERYPORTTERMINALCODETYPE,DELIVERYPORTTERMINALCODE");
strSql.Append(",[SHIPPERHOUSENO],[CONSIGNEERHOUSENO],[NOTIFYPARTYHOUSENO],[SELLERHOUSENO],[BUYERHOUSENO],[SHIPPEREORI],[CONSIGNEEREORI],[NOTIFYPARTYEORI],[SELLEREORI],[BUYEREORI]");
strSql.Append(",[SHIPPERCORPTYPE],[CONSIGNEERCORPTYPE],[NOTIFYPARTYCORPTYPE],[SELLERCORPTYPE],[BUYERCORPTYPE],[SELLERATTN],[SELLERTEL],[BUYERATTN],[BUYERTEL],[SELLERPOSTCODE],[BUYERPOSTCODE]");
strSql.Append(" from OP_SEAE_EDI B");
if (!string.IsNullOrEmpty(strCondition))
{
@ -133,6 +137,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiDAL
strSql.Append(",[SELLERADDR2],[SELLEREMAIL],[BUYERADDR2],[BUYEREMAIL],[MANUFACTURERADDR2] ,[MANUFACTUREREMAIL],[SHIPTOPARTYADDR2] ,[SHIPTOPARTYEMAIL],[CONTAINERLOCATIONADDR2]");
strSql.Append(",[CONTAINERLOCATIONEMAIL],[CONSOLIDATORADDR2] ,[CONSOLIDATOREMAIL],[IMPORTERADDR2],[IMPORTEREMAIL],[BOOKINGPARTYADDR2],[BOOKINGPARTYEMAIL]");
strSql.Append(",HBLTYPE,MASTERHBLNUMBER,PORTTERMINALCODETYPE,PORTTERMINALCODE,MASTERHBLPREFIX,CONTACTNAME,CONTACTPHONE,COMMENTS,DELIVERYPORTTERMINALCODETYPE,DELIVERYPORTTERMINALCODE");
strSql.Append(",[SHIPPERHOUSENO],[CONSIGNEERHOUSENO],[NOTIFYPARTYHOUSENO],[SELLERHOUSENO],[BUYERHOUSENO],[SHIPPEREORI],[CONSIGNEEREORI],[NOTIFYPARTYEORI],[SELLEREORI],[BUYEREORI]");
strSql.Append(",[SHIPPERCORPTYPE],[CONSIGNEERCORPTYPE],[NOTIFYPARTYCORPTYPE],[SELLERCORPTYPE],[BUYERCORPTYPE],[SELLERATTN],[SELLERTEL],[BUYERATTN],[BUYERTEL],[SELLERPOSTCODE],[BUYERPOSTCODE]");
strSql.Append(" from OP_SEAE_EDI B");
@ -179,6 +185,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiDAL
strSql.Append(",[SELLERADDR2],[SELLEREMAIL],[BUYERADDR2],[BUYEREMAIL],[MANUFACTURERADDR2] ,[MANUFACTUREREMAIL],[SHIPTOPARTYADDR2] ,[SHIPTOPARTYEMAIL],[CONTAINERLOCATIONADDR2]");
strSql.Append(",[CONTAINERLOCATIONEMAIL],[CONSOLIDATORADDR2] ,[CONSOLIDATOREMAIL],[IMPORTERADDR2],[IMPORTEREMAIL],[BOOKINGPARTYADDR2],[BOOKINGPARTYEMAIL]");
strSql.Append(",HBLTYPE,MASTERHBLNUMBER,PORTTERMINALCODETYPE,PORTTERMINALCODE,MASTERHBLPREFIX,CONTACTNAME,CONTACTPHONE,COMMENTS,DELIVERYPORTTERMINALCODETYPE,DELIVERYPORTTERMINALCODE");
strSql.Append(",[SHIPPERHOUSENO],[CONSIGNEERHOUSENO],[NOTIFYPARTYHOUSENO],[SELLERHOUSENO],[BUYERHOUSENO],[SHIPPEREORI],[CONSIGNEEREORI],[NOTIFYPARTYEORI],[SELLEREORI],[BUYEREORI]");
strSql.Append(",[SHIPPERCORPTYPE],[CONSIGNEERCORPTYPE],[NOTIFYPARTYCORPTYPE],[SELLERCORPTYPE],[BUYERCORPTYPE],[SELLERATTN],[SELLERTEL],[BUYERATTN],[BUYERTEL],[SELLERPOSTCODE],[BUYERPOSTCODE]");
strSql.Append(" from OP_SEAE_EDI B");
@ -430,6 +438,28 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiDAL
data.DELIVERYPORTTERMINALCODETYPE = Convert.ToString(reader["DELIVERYPORTTERMINALCODETYPE"]);//
data.DELIVERYPORTTERMINALCODE = Convert.ToString(reader["DELIVERYPORTTERMINALCODE"]);//
data.SHIPPERHOUSENO = Convert.ToString(reader["SHIPPERHOUSENO"]);//
data.CONSIGNEERHOUSENO = Convert.ToString(reader["CONSIGNEERHOUSENO"]);//
data.NOTIFYPARTYHOUSENO = Convert.ToString(reader["NOTIFYPARTYHOUSENO"]);//
data.SELLERHOUSENO = Convert.ToString(reader["SELLERHOUSENO"]);//
data.BUYERHOUSENO = Convert.ToString(reader["BUYERHOUSENO"]);//
data.SHIPPEREORI = Convert.ToString(reader["SHIPPEREORI"]);//
data.CONSIGNEEREORI = Convert.ToString(reader["CONSIGNEEREORI"]);//
data.NOTIFYPARTYEORI = Convert.ToString(reader["NOTIFYPARTYEORI"]);//
data.SELLEREORI = Convert.ToString(reader["SELLEREORI"]);//
data.BUYEREORI = Convert.ToString(reader["BUYEREORI"]);//
data.SHIPPERCORPTYPE = Convert.ToString(reader["SHIPPERCORPTYPE"]);//
data.CONSIGNEERCORPTYPE = Convert.ToString(reader["CONSIGNEERCORPTYPE"]);//
data.NOTIFYPARTYCORPTYPE = Convert.ToString(reader["NOTIFYPARTYCORPTYPE"]);//
data.SELLERCORPTYPE = Convert.ToString(reader["SELLERCORPTYPE"]);//
data.BUYERCORPTYPE = Convert.ToString(reader["BUYERCORPTYPE"]);//
data.SELLERATTN = Convert.ToString(reader["SELLERATTN"]);//
data.SELLERTEL = Convert.ToString(reader["SELLERTEL"]);//
data.BUYERATTN = Convert.ToString(reader["BUYERATTN"]);//
data.BUYERTEL = Convert.ToString(reader["BUYERTEL"]);//
data.SELLERPOSTCODE = Convert.ToString(reader["SELLERPOSTCODE"]);//
data.BUYERPOSTCODE = Convert.ToString(reader["BUYERPOSTCODE"]);//
#endregion
headList.Add(data);
}
@ -605,6 +635,29 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiDAL
data.BONDTYPE = Convert.ToString(reader["BONDTYPE"]);//
data.SELLREFCODE = Convert.ToString(reader["SELLREFCODE"]);//
data.MANUFACTURERREFCODE = Convert.ToString(reader["MANUFACTURERREFCODE"]);//
data.SHIPPERHOUSENO = Convert.ToString(reader["SHIPPERHOUSENO"]);//
data.CONSIGNEERHOUSENO = Convert.ToString(reader["CONSIGNEERHOUSENO"]);//
data.NOTIFYPARTYHOUSENO = Convert.ToString(reader["NOTIFYPARTYHOUSENO"]);//
data.SELLERHOUSENO = Convert.ToString(reader["SELLERHOUSENO"]);//
data.BUYERHOUSENO = Convert.ToString(reader["BUYERHOUSENO"]);//
data.SHIPPEREORI = Convert.ToString(reader["SHIPPEREORI"]);//
data.CONSIGNEEREORI = Convert.ToString(reader["CONSIGNEEREORI"]);//
data.NOTIFYPARTYEORI = Convert.ToString(reader["NOTIFYPARTYEORI"]);//
data.SELLEREORI = Convert.ToString(reader["SELLEREORI"]);//
data.BUYEREORI = Convert.ToString(reader["BUYEREORI"]);//
data.SHIPPERCORPTYPE = Convert.ToString(reader["SHIPPERCORPTYPE"]);//
data.CONSIGNEERCORPTYPE = Convert.ToString(reader["CONSIGNEERCORPTYPE"]);//
data.NOTIFYPARTYCORPTYPE = Convert.ToString(reader["NOTIFYPARTYCORPTYPE"]);//
data.SELLERCORPTYPE = Convert.ToString(reader["SELLERCORPTYPE"]);//
data.BUYERCORPTYPE = Convert.ToString(reader["BUYERCORPTYPE"]);//
data.SELLERATTN = Convert.ToString(reader["SELLERATTN"]);//
data.SELLERTEL = Convert.ToString(reader["SELLERTEL"]);//
data.BUYERATTN = Convert.ToString(reader["BUYERATTN"]);//
data.BUYERTEL = Convert.ToString(reader["BUYERTEL"]);//
data.SELLERPOSTCODE = Convert.ToString(reader["SELLERPOSTCODE"]);//
data.BUYERPOSTCODE = Convert.ToString(reader["BUYERPOSTCODE"]);//
#endregion
headList.Add(data);
}
@ -4336,6 +4389,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiDAL
strSql.Append(",[SELLERADDR2],[SELLEREMAIL],[BUYERADDR2],[BUYEREMAIL],[MANUFACTURERADDR2] ,[MANUFACTUREREMAIL],[SHIPTOPARTYADDR2] ,[SHIPTOPARTYEMAIL],[CONTAINERLOCATIONADDR2]");
strSql.Append(",[CONTAINERLOCATIONEMAIL],[CONSOLIDATORADDR2] ,[CONSOLIDATOREMAIL],[IMPORTERADDR2],[IMPORTEREMAIL],[BOOKINGPARTYADDR2],[BOOKINGPARTYEMAIL]");
strSql.Append(",HBLTYPE,MASTERHBLNUMBER,PORTTERMINALCODETYPE,PORTTERMINALCODE,MASTERHBLPREFIX,CONTACTNAME,CONTACTPHONE,COMMENTS,DELIVERYPORTTERMINALCODETYPE,DELIVERYPORTTERMINALCODE");
strSql.Append(",[SHIPPERHOUSENO],[CONSIGNEERHOUSENO],[NOTIFYPARTYHOUSENO],[SELLERHOUSENO],[BUYERHOUSENO],[SHIPPEREORI],[CONSIGNEEREORI],[NOTIFYPARTYEORI],[SELLEREORI],[BUYEREORI]");
strSql.Append(",[SHIPPERCORPTYPE],[CONSIGNEERCORPTYPE],[NOTIFYPARTYCORPTYPE],[SELLERCORPTYPE],[BUYERCORPTYPE],[SELLERATTN],[SELLERTEL],[BUYERATTN],[BUYERTEL],[SELLERPOSTCODE],[BUYERPOSTCODE]");
strSql.Append(" from OP_SEAE_EDI B");
strSql.Append(" where MASTERNO='" + bill.MFNO + "' and BSNO<>'" + bill.BSNO + "'");

@ -12,6 +12,7 @@ using DSWeb.MvcShipping.DAL.MsChFeeDAL;
using DSWeb.Areas.CommMng.Models;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.MvcShipping.Models.MsOpSeaePre;
using DSWeb.MvcShipping.Models.MsChFee;
namespace DSWeb.Areas.MvcShipping.DAL
{
@ -48,7 +49,8 @@ namespace DSWeb.Areas.MvcShipping.DAL
strSql.Append(" order by TASKNO DESC ");
}
strSql.Append(@") as num , ");
strSql.Append("t.GID,t.TASKNO,t.PTASKNO,t.TASKTYPE,t.TASKSOURCE,t.TASKSTATUS,t.TASKTITLE,t.TASKDESCRIP,t.CREATEUSER,t.CORPID,t.CREATETIME,t.TASKBEGINDATE");
strSql.Append("t.GID,t.TASKNO,t.PTASKNO,t.TASKTYPE,t.TASKSOURCE,t.TASKSTATUS,t.TASKTITLE,t.TASKDESCRIP,t.CREATEUSER,t.CORPID,t.CREATETIME,t.TASKBEGINDATE,t.COMPLETEUSER,t.CUSTNAME");
strSql.Append(",b.SALE,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP");
strSql.Append(",t.COMPLETETYPE,t.COMPLETETIME,t.KPI,ISNULL(b.MBLNO,t.MBLNO) MBLNO,t.FILENO,t.MAILNO,t.FILEPATH,t.ISPUBLIC,t.OP,t.BSNO,t.ISCOMPLETE,t.REMARK,b.CUSTOMERNAME,b.ETD,b.CARRIER,b.CUSTNO,b.STLDATE,b.OPLB ");
strSql.Append(" from op_task t left join v_op_bs b on (b.BSNO=t.BSNO) ");
@ -104,7 +106,8 @@ namespace DSWeb.Areas.MvcShipping.DAL
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append("t.GID,t.TASKNO,t.PTASKNO,t.TASKTYPE,t.TASKSOURCE,t.TASKSTATUS,t.TASKTITLE,t.TASKDESCRIP,t.CREATEUSER,t.CORPID,t.CREATETIME,t.TASKBEGINDATE");
strSql.Append("t.GID,t.TASKNO,t.PTASKNO,t.TASKTYPE,t.TASKSOURCE,t.TASKSTATUS,t.TASKTITLE,t.TASKDESCRIP,t.CREATEUSER,t.CORPID,t.CREATETIME,t.TASKBEGINDATE,t.COMPLETEUSER,t.CUSTNAME");
strSql.Append(",b.SALE,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP");
strSql.Append(",t.COMPLETETYPE,t.COMPLETETIME,t.KPI,ISNULL(b.MBLNO,t.MBLNO) MBLNO,t.FILENO,t.MAILNO,t.FILEPATH,t.ISPUBLIC,t.OP,t.BSNO,t.ISCOMPLETE,t.REMARK,b.CUSTOMERNAME,b.ETD,b.CARRIER,b.CUSTNO,b.STLDATE,b.OPLB ");
strSql.Append(" from op_task t left join v_op_bs b on (b.BSNO=t.BSNO) ");
if (!string.IsNullOrEmpty(condition))
@ -166,6 +169,10 @@ namespace DSWeb.Areas.MvcShipping.DAL
else
data.STLDATE = data.ETD;
data.OPLB = Convert.ToString(reader["OPLB"]);
data.COMPLETEUSER = Convert.ToString(reader["COMPLETEUSER"]);
data.CUSTNAME = Convert.ToString(reader["CUSTNAME"]);
data.SALE = Convert.ToString(reader["SALE"]);
data.SALECORP = Convert.ToString(reader["SALECORP"]);
#endregion
headList.Add(data);
@ -350,7 +357,7 @@ namespace DSWeb.Areas.MvcShipping.DAL
else
{
var cmdupdate = db.GetSqlStringCommand("update op_task set TASKSTATUS=@TASKSTATUS where GID=@GID");
if (transstatus == "取消任务") cmdupdate = db.GetSqlStringCommand("update op_task set TASKSTATUS=@TASKSTATUS,ISCOMPLETE=1,COMPLETETYPE='人工',COMPLETETIME=GETDATE(),OP='" + op + "' where GID=@GID");
if (transstatus == "取消任务") cmdupdate = db.GetSqlStringCommand("update op_task set TASKSTATUS=@TASKSTATUS,ISCOMPLETE=1,COMPLETETYPE='人工',COMPLETETIME=GETDATE(),COMPLETEUSER='" + op + "' where GID=@GID");
cmdupdate.Parameters.Clear();
db.AddInParameter(cmdupdate, "@GID", DbType.String, enumValue.GID);
db.AddInParameter(cmdupdate, "@TASKSTATUS", DbType.String, transstatus);
@ -799,7 +806,7 @@ namespace DSWeb.Areas.MvcShipping.DAL
}
public static DBResult ModifyStlDate(List<OpTask> bodyList,string stldate, string companyid)
public static DBResult ModifyStlDate(List<OpTask> bodyList,string stldate, string op,string companyid)
{
var result = new DBResult();
@ -830,6 +837,12 @@ namespace DSWeb.Areas.MvcShipping.DAL
db.AddInParameter(cmdupdate, "@STLDATE", DbType.String, stldate);
db.AddInParameter(cmdupdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdupdate, tran);
var cmdupdate2 = db.GetSqlStringCommand("update op_task set OP='" + op + "' where GID=@GID");
cmdupdate2.Parameters.Clear();
db.AddInParameter(cmdupdate2, "@GID", DbType.String, enumValue.GID);
db.ExecuteNonQuery(cmdupdate2, tran);
i = i + 1;

@ -3425,9 +3425,9 @@ namespace DSWeb.MvcShipping.Models.MsOpSeae
[ModelDB]
public string FACTORY { get; set; }
public bool ISHAVEHBL { get; set; } = false;
public string APPLICATIONEOR { get; set; }
#endregion

@ -2111,6 +2111,67 @@ namespace DSWeb.MvcShipping.Models.MsOpSeaeEdi
set { _COMMENTS = value; }
}
[ModelDB]
public string SHIPPERHOUSENO { get; set; }
[ModelDB]
public string CONSIGNEERHOUSENO { get; set; }
[ModelDB]
public string NOTIFYPARTYHOUSENO { get; set; }
[ModelDB]
public string SELLERHOUSENO { get; set; }
[ModelDB]
public string BUYERHOUSENO { get; set; }
[ModelDB]
public string SHIPPEREORI { get; set; }
[ModelDB]
public string CONSIGNEEREORI { get; set; }
[ModelDB]
public string NOTIFYPARTYEORI { get; set; }
[ModelDB]
public string SELLEREORI { get; set; }
[ModelDB]
public string BUYEREORI { get; set; }
[ModelDB]
public string SHIPPERCORPTYPE { get; set; }
[ModelDB]
public string CONSIGNEERCORPTYPE { get; set; }
[ModelDB]
public string NOTIFYPARTYCORPTYPE { get; set; }
[ModelDB]
public string SELLERCORPTYPE { get; set; }
[ModelDB]
public string BUYERCORPTYPE { get; set; }
[ModelDB]
public string SELLERATTN { get; set; }
[ModelDB]
public string SELLERTEL { get; set; }
[ModelDB]
public string BUYERATTN { get; set; }
[ModelDB]
public string BUYERTEL { get; set; }
[ModelDB]
public string SELLERPOSTCODE { get; set; }
[ModelDB]
public string BUYERPOSTCODE { get; set; }
#endregion
public MsOpSeaeEdi()

@ -226,6 +226,12 @@ namespace DSWeb.MvcShipping.Models.MsOpTask
public string STLDATE { get; set; }
public string OPLB { get; set; }
public string COMPLETEUSER { get; set; }
public string CUSTNAME { get; set; }
public string SALE { get; set; }
public string SALECORP { get; set; }
#endregion
}

@ -1360,10 +1360,15 @@ Ext.extend(Shipping.ReceiptEditGrid, Ext.Panel, {
type: 'submit',
handler: function () {
var UserFilePath = Ext.getCmp('LoadFile').getValue();
// if (!CheckFileExt(UserFilePath, /.jpg|.gif|.png|.bmp|.pdf/i)) {
// Ext.Msg.show({ title: '错误', msg: '请确认你上传的文件为图片文件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
// }
if (comboxFileType.getRawValue() == '到货通知') {
var nostr = Ext.getCmp('DOCUMENTATTACHEDNO').getValue();
if (nostr == '') {
Ext.Msg.show({ title: '错误', msg: '单据编号不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
}
if (!imgform.form.isValid()) { return; }
imgform.form.submit({
url: '/MvcShipping/MsOpReceipt/UploadFile',

@ -25,6 +25,12 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
//this.bodyDel = [];
this.itemindex = 1;
var mainform = window.parent.panelEdit;
if (mainform) {
this.MainEditRecord = mainform.editRecord;
this.BsNo = this.MainEditRecord.get("BSNO");
}
this.StoreCargoid = Ext.create('Ext.data.Store', {
fields: ['ID', 'NAME']
@ -380,58 +386,9 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
});
this.gridListCtn.addListener('itemclick', function (dataview, record, item, index, e, b) {
this.formDescriptionEdit.getForm().findField('DESCRIPTION').setValue(record.data.DESCRIPTION);
_this.formDescriptionEdit.getForm().findField('CTN_ID').setDisabled(false);
this.formDescriptionEdit.getForm().findField('CTN_ID').setValue(record.data.CTN_ID);
_this.formDescriptionEdit.getForm().findField('CTN_ID').setDisabled(true);
}, this);
_this = this;
this.formDescriptionEdit = Ext.widget('form', {
title: '货物描述',
region: 'east',
width:220,
frame: true,
border: false,
trackResetOnLoad: true,
items: [{
fieldLabel: 'GID',
name: 'GID', hidden: true
},{
fieldLabel: 'CTN_ID',
xtype: 'textfield',
name: 'CTN_ID', hidden: true
}, {
xtype: 'textareafield',
grow: true, //字段是否自动伸展和收缩,默认为false
labelSeparator: '', //标签分隔字符
name: 'DESCRIPTION',
height: 170,
anchor: '100%',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'blur': function blur(combo, eOpts, obj) {
_this.formDescriptionEdit.getForm().findField('CTN_ID').setDisabled(false);
var CTN_ID = _this.formDescriptionEdit.getForm().findField('CTN_ID').getValue();
_this.formDescriptionEdit.getForm().findField('CTN_ID').setDisabled(true);
//var selections = this.gridList.getSelectionModel().getSelection();
//if (selections.length > 0) {
// selections[0].set('DESCRIPTION', combo.value);
//}
for (i = 0; i < _this.storeBodyList.getCount(); i += 1) {
var memberyf = _this.storeBodyList.getAt(i);
if (memberyf.data.CTN_ID == CTN_ID) {
memberyf.data.DESCRIPTION = combo.value;
}
};
_this.formDescriptionEdit.getForm().findField('DESCRIPTION')
.setValue(combo.value.toUpperCase());
}
//
}
}]
});
//#endregion
@ -443,7 +400,7 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
// anchor:'50% 100%',
region: 'center',
frame: true,
items: [this.gridListCtn, this.formDescriptionEdit]
items: [this.gridListCtn]
});
@ -779,6 +736,9 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
_this.formEdit.getForm().findField('SHIPPERATTN').setValue(records[0].data.ATTN);
_this.formEdit.getForm().findField('SHIPPERTEL').setValue(records[0].data.TEL);
_this.formEdit.getForm().findField('SHIPPERCOUNTRY').setValue(records[0].data.COUNTRY);
_this.formEdit.getForm().findField('SHIPPERHOUSENO').setValue(records[0].data.HOUSENO);
_this.formEdit.getForm().findField('SHIPPEREORI').setValue(records[0].data.EORI);
_this.formEdit.getForm().findField('SHIPPERCORPTYPE').setValue(records[0].data.CORPTYPE);
}
}
@ -955,6 +915,9 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
_this.formEdit.getForm().findField('CONSIGNEEATTN').setValue(records[0].data.ATTN);
_this.formEdit.getForm().findField('CONSIGNEETEL').setValue(records[0].data.TEL);
_this.formEdit.getForm().findField('CONSIGNEECOUNTRY').setValue(records[0].data.COUNTRY);
_this.formEdit.getForm().findField('CONSIGNEEHOUSENO').setValue(records[0].data.HOUSENO);
_this.formEdit.getForm().findField('CONSIGNEEEORI').setValue(records[0].data.EORI);
_this.formEdit.getForm().findField('CONSIGNEECORPTYPE').setValue(records[0].data.CORPTYPE);
}
@ -1124,6 +1087,9 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
_this.formEdit.getForm().findField('NOTIFYPARTYATTN').setValue(records[0].data.ATTN);
_this.formEdit.getForm().findField('NOTIFYPARTYTEL').setValue(records[0].data.TEL);
_this.formEdit.getForm().findField('NOTIFYPARTYCOUNTRY').setValue(records[0].data.COUNTRY);
_this.formEdit.getForm().findField('NOTIFYPARTYHOUSENO').setValue(records[0].data.HOUSENO);
_this.formEdit.getForm().findField('NOTIFYPARTYEORI').setValue(records[0].data.EORI);
_this.formEdit.getForm().findField('NOTIFYPARTYCORPTYPE').setValue(records[0].data.CORPTYPE);
}
}
}
@ -1309,13 +1275,20 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
},
select: function (combo, records, eOpts) {
if (records.length > 0) {
_this.formcd.getForm().findField('SELLERNAME').setValue(records[0].data.NAME);
_this.formcd.getForm().findField('SELLERADDR1').setValue(records[0].data.ADDRESS);
_this.formcd.getForm().findField('SELLERADDR2').setValue(records[0].data.ADDRESS2);
_this.formcd.getForm().findField('SELLERCITY').setValue(records[0].data.CITY);
_this.formcd.getForm().findField('SELLERPROVINCE').setValue(records[0].data.PROVINCE);
_this.formcd.getForm().findField('SELLERCOUNTRY').setValue(records[0].data.COUNTRY);
_this.formcd.getForm().findField('SELLEREMAIL').setValue(records[0].data.POSTCODE);
_this.formEdit.getForm().findField('SELLERNAME').setValue(records[0].data.NAME);
_this.formEdit.getForm().findField('SELLERADDR1').setValue(records[0].data.ADDRESS);
_this.formEdit.getForm().findField('SELLERADDR2').setValue(records[0].data.ADDRESS2);
_this.formEdit.getForm().findField('SELLERCITY').setValue(records[0].data.CITY);
_this.formEdit.getForm().findField('SELLERPROVINCE').setValue(records[0].data.PROVINCE);
_this.formEdit.getForm().findField('SELLERCOUNTRY').setValue(records[0].data.COUNTRY);
_this.formEdit.getForm().findField('SELLERPOSTCODE').setValue(records[0].data.POSTCODE);
_this.formEdit.getForm().findField('SELLERATTN').setValue(records[0].data.ATTN);
_this.formEdit.getForm().findField('SELLERTEL').setValue(records[0].data.TEL);
_this.formEdit.getForm().findField('SELLERHOUSENO').setValue(records[0].data.HOUSENO);
_this.formEdit.getForm().findField('SELLEREORI').setValue(records[0].data.EORI);
_this.formEdit.getForm().findField('SELLERCORPTYPE').setValue(records[0].data.CORPTYPE);
}
}
@ -1366,6 +1339,26 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
handler: function () {
_TempType = 'SE';
_this.winTempSaveShow.show();
}
}, {
xtype: "button",
text: "复制发货人",
handler: function () {
_this.formEdit.getForm().findField('SELLERNAME').setValue(_this.formEdit.getForm().findField('SHIPPERNAME').getValue());
_this.formEdit.getForm().findField('SELLERADDR1').setValue(_this.formEdit.getForm().findField('SHIPPERADDR1').getValue());
_this.formEdit.getForm().findField('SELLERADDR2').setValue(_this.formEdit.getForm().findField('SHIPPERADDR2').getValue());
_this.formEdit.getForm().findField('SELLERCITY').setValue(_this.formEdit.getForm().findField('SHIPPERCITY').getValue());
_this.formEdit.getForm().findField('SELLERPROVINCE').setValue(_this.formEdit.getForm().findField('SHIPPERPROVINCE').getValue());
_this.formEdit.getForm().findField('SELLERCOUNTRY').setValue(_this.formEdit.getForm().findField('SHIPPERCOUNTRY').getValue());
_this.formEdit.getForm().findField('SELLERPOSTCODE').setValue(_this.formEdit.getForm().findField('SHIPPERPOSTCODE').getValue());
_this.formEdit.getForm().findField('SELLERATTN').setValue(_this.formEdit.getForm().findField('SHIPPERATTN').getValue());
_this.formEdit.getForm().findField('SELLERTEL').setValue(_this.formEdit.getForm().findField('SHIPPERTEL').getValue());
_this.formEdit.getForm().findField('SELLERHOUSENO').setValue(_this.formEdit.getForm().findField('SHIPPERHOUSENO').getValue());
_this.formEdit.getForm().findField('SELLEREORI').setValue(_this.formEdit.getForm().findField('SHIPPEREORI').getValue());
_this.formEdit.getForm().findField('SELLERCORPTYPE').setValue(_this.formEdit.getForm().findField('SHIPPERCORPTYPE').getValue());
}
}]
}, {
@ -1479,13 +1472,18 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
},
select: function (combo, records, eOpts) {
if (records.length > 0) {
_this.formcd.getForm().findField('BUYERNAME').setValue(records[0].data.NAME);
_this.formcd.getForm().findField('BUYERADDR1').setValue(records[0].data.ADDRESS);
_this.formcd.getForm().findField('BUYERADDR2').setValue(records[0].data.ADDRESS2);
_this.formcd.getForm().findField('BUYERCITY').setValue(records[0].data.CITY);
_this.formcd.getForm().findField('BUYERPROVINCE').setValue(records[0].data.PROVINCE);
_this.formcd.getForm().findField('BUYERCOUNTRY').setValue(records[0].data.COUNTRY);
_this.formcd.getForm().findField('BUYEREMAIL').setValue(records[0].data.POSTCODE);
_this.formEdit.getForm().findField('BUYERNAME').setValue(records[0].data.NAME);
_this.formEdit.getForm().findField('BUYERADDR1').setValue(records[0].data.ADDRESS);
_this.formEdit.getForm().findField('BUYERADDR2').setValue(records[0].data.ADDRESS2);
_this.formEdit.getForm().findField('BUYERCITY').setValue(records[0].data.CITY);
_this.formEdit.getForm().findField('BUYERPROVINCE').setValue(records[0].data.PROVINCE);
_this.formEdit.getForm().findField('BUYERCOUNTRY').setValue(records[0].data.COUNTRY);
_this.formEdit.getForm().findField('BUYEREMAIL').setValue(records[0].data.POSTCODE);
_this.formEdit.getForm().findField('BUYERATTN').setValue(records[0].data.ATTN);
_this.formEdit.getForm().findField('BUYERTEL').setValue(records[0].data.TEL);
_this.formEdit.getForm().findField('BUYERHOUSENO').setValue(records[0].data.HOUSENO);
_this.formEdit.getForm().findField('BUYEREORI').setValue(records[0].data.EORI);
_this.formEdit.getForm().findField('BUYERCORPTYPE').setValue(records[0].data.CORPTYPE);
}
}
@ -1535,6 +1533,26 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
handler: function () {
_TempType = 'BY';
_this.winTempSaveShow.show();
}
}, {
xtype: "button",
text: "复制收货人",
handler: function () {
_this.formEdit.getForm().findField('BUYERNAME').setValue(_this.formEdit.getForm().findField('CONSIGNEENAME').getValue());
_this.formEdit.getForm().findField('BUYERADDR1').setValue(_this.formEdit.getForm().findField('CONSIGNEEADDR1').getValue());
_this.formEdit.getForm().findField('BUYERADDR2').setValue(_this.formEdit.getForm().findField('CONSIGNEEADDR2').getValue());
_this.formEdit.getForm().findField('BUYERCITY').setValue(_this.formEdit.getForm().findField('CONSIGNEECITY').getValue());
_this.formEdit.getForm().findField('BUYERPROVINCE').setValue(_this.formEdit.getForm().findField('CONSIGNEEPROVINCE').getValue());
_this.formEdit.getForm().findField('BUYERCOUNTRY').setValue(_this.formEdit.getForm().findField('CONSIGNEECOUNTRY').getValue());
_this.formEdit.getForm().findField('BUYERPOSTCODE').setValue(_this.formEdit.getForm().findField('CONSIGNEEPOSTCODE').getValue());
_this.formEdit.getForm().findField('BUYERATTN').setValue(_this.formEdit.getForm().findField('CONSIGNEEATTN').getValue());
_this.formEdit.getForm().findField('BUYERTEL').setValue(_this.formEdit.getForm().findField('CONSIGNEETEL').getValue());
_this.formEdit.getForm().findField('BUYERHOUSENO').setValue(_this.formEdit.getForm().findField('CONSIGNEEHOUSENO').getValue());
_this.formEdit.getForm().findField('BUYEREORI').setValue(_this.formEdit.getForm().findField('CONSIGNEEEORI').getValue());
_this.formEdit.getForm().findField('BUYERCORPTYPE').setValue(_this.formEdit.getForm().findField('CONSIGNEECORPTYPE').getValue());
}
}]
}, {
@ -1616,129 +1634,6 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
});
//this.storeNameSHIPTOPARTY = Ext.create('DsExt.ux.RefTableStore', {
// model: 'DsShipping.ux.MsOpSeaeEdiTemplate',
// proxy: { url: '/MvcShipping/MsOpSeaeEdiTemplate/GetDataList' }
//});
//// this.storeNameFa.load({ params: { condition: "TYPE = 'F'" } });
//this.comboxNameSHIPTOPARTY = Ext.create('DsExt.ux.RefTableCombox', {
// fieldLabel: '名称',
// store: this.storeNameSHIPTOPARTY,
// queryParam: 'DisplayName',
// queryMode: 'remote',
// flex: 0.5,
// name: 'SHIPTOPARTYNAME',
// valueField: 'NAME',
// displayField: 'NAME',
// listeners: {
// beforequery: function (e) {
// var combo = e.combo;
// if (!e.forceAll) {
// var value = e.query;
// value = value.toUpperCase();
// combo.store.filterBy(function (record, id) {
// var text = record.get(combo.displayField);
// text = text.toUpperCase();
// return (text.indexOf(value) != -1);
// });
// combo.expand();
// return false;
// }
// },
// select: function (combo, records, eOpts) {
// if (records.length > 0) {
// _this.formcd.getForm().findField('SHIPTOPARTYNAME').setValue(records[0].data.NAME);
// _this.formcd.getForm().findField('SHIPTOPARTYADDR1').setValue(records[0].data.ADDRESS);
// _this.formcd.getForm().findField('SHIPTOPARTYADDR2').setValue(records[0].data.ADDRESS2);
// _this.formcd.getForm().findField('SHIPTOPARTYCITY').setValue(records[0].data.CITY);
// _this.formcd.getForm().findField('SHIPTOPARTYPROVINCE').setValue(records[0].data.PROVINCE);
// _this.formcd.getForm().findField('SHIPTOPARTYCOUNTRY').setValue(records[0].data.COUNTRY);
// _this.formcd.getForm().findField('SHIPTOPARTYEMAIL').setValue(records[0].data.POSTCODE);
// }
// }
// }
//});
//this.panelSHIPTOPARTY = new Ext.Panel({
// title: '货物送达仓库',
// layout: "anchor",
// height: 145,
// flex: 1,
// frame: true,
// fieldDefaults: {
// margins: '2 2 2 2',
// labelAlign: 'right',
// labelWidth: 60,
// msgTarget: 'qtip'
// },
// items: [{
// xtype: 'container',
// defaultType: 'textfield',
// layout: 'hbox',
// items: [{ xtype: 'hiddenfield' }]
// }, {
// xtype: 'container',
// defaultType: 'textfield',
// layout: 'hbox',
// items: [this.comboxNameSHIPTOPARTY, {
// xtype: "button",
// text: "保存为模板",
// handler: function () {
// _TempType = 'ST';
// _this.winTempSaveShow.show();
// }
// }]
// }, {
// xtype: 'container',
// defaultType: 'textfield',
// layout: 'hbox',
// items: [{
// fieldLabel: '地址1',
// flex: 1,
// name: 'SHIPTOPARTYADDR1'
// }]
// }, {
// xtype: 'container',
// defaultType: 'textfield',
// layout: 'hbox',
// items: [{
// fieldLabel: '地址2',
// flex: 2,
// name: 'SHIPTOPARTYADDR2'
// }, {
// fieldLabel: '邮编',
// flex: 1,
// name: 'SHIPTOPARTYEMAIL'
// }]
// }, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [{
// fieldLabel: '城市',
// flex: 0.30,
// //labelWidth: 50,
// name: 'SHIPTOPARTYCITY'
// }, {
// fieldLabel: '省份代码',
// flex: 0.30,
// //labelWidth: 50,
// name: 'SHIPTOPARTYPROVINCE'
// }, {
// fieldLabel: '国家代码',
// flex: 0.30,
// //labelWidth: 50,
// name: 'SHIPTOPARTYCOUNTRY'
// }]
// }
// ]
//});
//#region 编辑formEdit 基本信息
this.formEdit = Ext.widget('form', {
@ -1820,75 +1715,56 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
id: 'btnECopyNew',
id: 'btnENSCopyNew',
text: "复制新建",
handler: function (button, event) {
var basicForm = this.formHead.getForm();
var basicForm = this.formEdit.getForm();
this.opStatus = 'add';
basicForm.findField('BSNO').setDisabled(false);
var field = basicForm.findField('BSNO');
basicForm.findField('MFNO').setDisabled(false);
var field = basicForm.findField('MFNO');
var BSNO = NewGuid();
field.setValue(BSNO);
basicForm.findField('BSNO').setDisabled(true);
field = basicForm.findField('ORDNO');
field.setValue('');
basicForm.findField('MFNO').setDisabled(true);
field = basicForm.findField('INPUTBY');
field.setValue(SHOWNAME);
field = basicForm.findField('ORSTATUS');
field.setValue('9');
field = basicForm.findField('ORSTATUSREF');
field.setValue('录入状态');
field = basicForm.findField('MBLNO');
field.setValue('');
this.panelFee.strBSNO = BSNO;
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
memberbody.set("ORDNO", '*');
memberbody.commit();
};
for (var j = 0; j < this.panelFee.storeDrChFee.getCount(); j += 1) {
var memberbody = this.panelFee.storeDrChFee.getAt(j);
memberbody.set("GId", NewGuid());
memberbody.set("BsNo", '*');
memberbody.set("MFNO", '*');
memberbody.commit();
};
for (var j = 0; j < this.panelFee.storeCrChFee.getCount(); j += 1) {
var memberbody = this.panelFee.storeCrChFee.getAt(j);
memberbody.set("GId", NewGuid());
memberbody.set("BsNo", '*');
for (var j = 0; j < this.storeCargoList.getCount(); j += 1) {
var memberbody = this.storeCargoList.getAt(j);
memberbody.set("MFNO", '*');
memberbody.commit();
};
this.GetEditStatus();
var children = this.tabSeaepanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodSeaeOrderInfo') {
this.tabSeaepanel.setActiveTab(i);
}
}
}
}
this.tabSeaepanel.doLayout();
this.panelOcr.hide();
},
scope: this
}, {
id: 'btnESave',
id: 'btnENSSave',
text: "保存",
iconCls: "btnsave",
handler: function (button, event) {
this.Save('0');
},
scope: this
}, {
id: 'btnENSNew',
text:'新增',
handler: function (button, event) {
this.LoadNewData();
},
scope: this
}, '-', {
id: 'btnBDelete',
text: '删除',
iconCls: "btnENSdelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}]
}); //end 按钮Toolbar
//#endregion
@ -2016,6 +1892,12 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
})
});
this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) {
_this.editRecord = record;
_this.OpStatus = 'edit';
_this.LoadData("edit", "MFNO='" + record.data.MFNO + "'");
}, this);
this.panellist = new Ext.Panel({
// title: '提单信息',
@ -2132,7 +2014,7 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
var condition = '';
_this = this;
this.storeList.load({
params: { condition: "BSNO='" + this.BsNo + "'" },
params: { condition: "BSNO='" + this.BsNo + "' and EDITYPE='ENS' " },
callback: function (r, options, success) {
if (success) {
if (this.storeList.getCount() > 0) {
@ -2147,10 +2029,43 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
},
scope: this
});
_this.LoadMustBe();
// _this.LoadMustBe();
}, //end InitData
LoadNewData: function () {
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsOpSeae/CreateCustomList',
params: {
BSNOS: this.BsNo,
type: 'ENS',
editype:'ENS'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
//Ext.Msg.hide();
this.InitData();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
LoadData: function (opstatus, condition) {
this.serialNo = 0;
//this.bodyDel = [];
@ -2161,7 +2076,8 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
url: '/MvcShipping/MsOpSeaeEdi/GetData',
params: {
handle: opstatus,
condition: condition
condition: condition,
bsno: this.BsNo
},
callback: function (options, success, response) {
if (success) {
@ -2178,8 +2094,6 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
data = result.data;
this.formHead.getForm().reset();
this.formHead.getForm().setValues(data);
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(data);
@ -2192,6 +2106,38 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
},
scope: this
});
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询主表数据...',
url: '/MvcShipping/MsOpSeae/GetAmsData',
params: {
condition: "BSNO='" + this.BsNo + "'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
data = result.data;
this.formHead.getForm().reset();
this.formHead.getForm().setValues(data);
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
if (this.opStatus == 'edit') {
this.storeBodyList.load({ params: { condition: condition} });
this.storeCargoList.load({ params: { condition: condition} });
@ -2210,9 +2156,7 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
if (!basicForm.isValid()) {
return;
}
if (!basicForm2.isValid()) {
return;
}
//
var bodydatas = [];
for (var i = 0; i < this.storeBodyList.getCount(); i += 1) {
@ -2231,23 +2175,24 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
} //
var jsonCargo = ConvertRecordsToJsonAll(cargodatas);
this.formHead.getForm().findField('MFNO').setDisabled(false);
this.formEdit.getForm().findField('MFNO').setDisabled(false);
var data = this.formHead.getForm().getValues(false, false, false);
var data2 = this.formEdit.getForm().getValues(false, false, false);
this.formHead.getForm().findField('MFNO').setDisabled(true);
this.formEdit.getForm().findField('MFNO').setDisabled(true);
//
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsOpSeaeEdi/Save',
url: '/MvcShipping/MsOpSeaeEdi/SaveENS',
scope: this,
params: {
opstatus: this.opStatus,
data: Ext.JSON.encode(data),
data2: Ext.JSON.encode(data2),
body: jsonBody,
cargobody: jsonCargo
cargobody: jsonCargo,
bsno: this.BsNo
},
callback: function (options, success, response) {
if (success) {
@ -2257,8 +2202,8 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
var returnData = jsonresult.Data;
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(returnData);
this.formHead.getForm().reset();
this.formHead.getForm().setValues(returnData);
//this.formHead.getForm().reset();
//this.formHead.getForm().setValues(returnData);
//
if (this.opStatus == 'add') {
@ -2278,7 +2223,7 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
}
if (type == '0') {
this.opStatus = 'edit';
basicForm2.findField('MFNO').setDisabled(true);
basicForm.findField('MFNO').setDisabled(true);
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
var memberbody = this.storeBodyList.getAt(j);
memberbody.set("MFNO", this.editRecord.get('MFNO'));
@ -2756,7 +2701,65 @@ Ext.extend(Shipping.MsOpSeaeENSEdit, Ext.Panel, {
},
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
//if (this.StoreOpRange.getCount() == 0) {
// Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
// return;
//} else {
// var inputby = record.data.INPUTBY;
// var records = DsStoreQueryBy(this.StoreOpRange, 'OPID', inputby);
// if (records.getCount() > 0) {
// } else {
// canedit = false;
// Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
// return;
// }
//}
Ext.MessageBox.confirm('提示','确实要删除此业务吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除....');
Ext.Ajax.request({
waitMsg: '正在删除....',
url: '/MvcShipping/MsOpSeaeEdi/Delete',
params: {
data: Ext.JSON.encode(record.data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeList.remove(record);
if (this.storeList.getCount() > 0) {
var member = this.storeList.getAt(0);
this.LoadData("edit", "MFNO='" + member.data.MFNO + "'");
this.editRecord = member;
}
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
LoadInit: function () {

@ -114,6 +114,10 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
_this.sqlcontextselect = sql;
// if (sql2 != '') sql = sql + " and " + sql2;
this.sqlcontext = sql;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.currentPage = 1;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
@ -263,6 +267,21 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
header: '委托单位',
width: 120
}, {
sortable: true,
dataIndex: 'CUSTNAME',
header: '结算客户',
width: 120
}, {
sortable: true,
dataIndex: 'SALE',
header: '揽货人',
width: 120
}, {
sortable: true,
dataIndex: 'SALECORP',
header: '所属分部',
width: 120
}, {
sortable: true,
dataIndex: 'ETD',
@ -313,6 +332,12 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
dataIndex: 'COMPLETETYPE',
header: '完成方式',
width: 80
}, {
sortable: true,
align: 'center',
dataIndex: 'COMPLETEUSER',
header: '完成人',
width: 80
}, {
sortable: true,
dataIndex: 'ISCOMPLETE',
@ -338,6 +363,25 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
});
this.CheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
@ -356,9 +400,9 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
var TASKTYPE = record.get('TASKTYPE');
var STLDATE = record.get('STLDATE');
if (TASKTYPE == '未开票')
return 'text_yellow';
return 'feestatus_pass';
if (TASKTYPE == '超额度欠费')
return 'text_red';
return 'feestatus_nopass';
if (TASKTYPE == '欠费待收款') {
if (STLDATE != '') {
var myDate = new Date();
@ -367,24 +411,24 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
mydatestr = new Date(mydatestr);
ENDATE = new Date(STLDATE);
if (mydatestr.getTime() > ENDATE.getTime()) {
return 'text_red';
return 'feestatus_nopass';
} else {
return 'text_yellow';
return 'feestatus_refer';
}
} else {
return 'text_yellow';
return 'feestatus_refer';
}
}
}
},
columns: this.girdcolums,
bbar: Ext.create('Ext.PagingToolbar', {
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
}), this.Pagenum]
});
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
@ -403,6 +447,14 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
var openUrl = "";
openUrl = "../../TruckMng/PcHeadEdit_WFSD/TaskView?GID=" + record.data.BSNO;
window.open(openUrl, openType, openSet);
} if (record.data.TASKTYPE == "欠费待收款" || record.data.TASKTYPE == "未开票") {
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcShipping/MsOpBill/MsOpFeeView?handle=check&bsno=" + record.data.BSNO;
window.open(openUrl, openType, openSet);
} if (record.data.TASKTYPE == "超额度欠费") {
} else {
DsOpenEditWin('/MvcShipping/MsOpSeae/TaskView', record.data.BSNO);
}
@ -445,6 +497,33 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
}
});
this.storeCust = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' }
});
// this.storeCust.load({ params: { condition: ""} });
this.comboxCust = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel:'结算客户',
store: this.storeCust,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
forceSelection: true,
name: 'CUSTNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.formSearch = Ext.widget('form', {
frame: true,
@ -482,8 +561,8 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
}
}
}
, this.comboxCustCode,{
fieldLabel: '从任务日期',
, this.comboxCustCode, this.comboxCust,{
fieldLabel: '从开船日期',
format: 'Y-m-d',
xtype: 'datefield',
labelWidth: 65,
@ -497,7 +576,7 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
}
}
}, {
fieldLabel: '到任务日期',
fieldLabel: '到开船日期',
format: 'Y-m-d',
xtype: 'datefield',
labelWidth: 65,
@ -670,6 +749,34 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
// this.onRefreshClick();
//人员信息加载
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
});
//操 作
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '任务接收人', //'操 作',
store: this.storeOpCode,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
labelWidth: 30,
forceSelection: true,
name: 'OP',
flex: 0.6, valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.formModifyStlDate = Ext.widget('form', {
region: 'north',
frame: true,
@ -700,7 +807,7 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
flex: 1,
xtype: 'datefield',
name: 'STLDATE'
}
}, this.comboxOP
]
}
]//end items(fieldset 1)
@ -712,7 +819,7 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
this.winModifyStlDateShow = Ext.create('Ext.window.Window', {
title: "批量修改承诺付款日期", //"批量修改",
width: 230,
width: 260,
//height : 120,
//plain : true,
iconCls: "addicon",
@ -801,15 +908,22 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
var MBLNO = form.findField('MBLNO').getValue();
sql = sql + getAndConSql(sql, MBLNO, " ISNULL(b.MBLNO,t.MBLNO) like '%" + MBLNO + "%'");
var BSDATEBgn = form.findField('ExpDateBgn').getRawValue();
sql = sql + getAndConSql(sql, BSDATEBgn, "CONVERT(char(10), t.TASKBEGINDATE, 20) >='" + BSDATEBgn + "'");
sql = sql + getAndConSql(sql, BSDATEBgn, "b.ETD>='" + BSDATEBgn + "'");
var BSDATEEnd = form.findField('ExpDateEnd').getRawValue();
sql = sql + getAndConSql(sql, BSDATEEnd, "CONVERT(char(10), t.TASKBEGINDATE, 20) <='" + BSDATEEnd + " 23:59:59'");
sql = sql + getAndConSql(sql, BSDATEEnd, "b.ETD<='" + BSDATEEnd + " 23:59:59'");
//var BSDATEBgn = form.findField('ExpDateBgn').getRawValue();
//sql = sql + getAndConSql(sql, BSDATEBgn, "CONVERT(char(10), t.TASKBEGINDATE, 20) >='" + BSDATEBgn + "'");
//var BSDATEEnd = form.findField('ExpDateEnd').getRawValue();
//sql = sql + getAndConSql(sql, BSDATEEnd, "CONVERT(char(10), t.TASKBEGINDATE, 20) <='" + BSDATEEnd + " 23:59:59'");
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "b.CUSTOMERNAME='" + CUSTOMERNAME + "'");
var CUSTNAME = form.findField('CUSTNAME').getValue();
sql = sql + getAndConSql(sql, CUSTNAME, "t.CUSTNAME='" + CUSTNAME + "'");
return sql;
},
@ -892,6 +1006,7 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
var STLDATE = this.formModifyStlDate.getForm().findField('STLDATE').getValue();
var OP = this.formModifyStlDate.getForm().findField('OP').getValue();
var bodyAddDatas = [];
@ -915,7 +1030,8 @@ Ext.extend(Shipping.MsOpTaskIndex, Ext.Panel, {
url: '/MvcShipping/MsOpTask/modifyStlDate',
params: {
data: jsonbodyAddDatas,
modifydata: STLDATE
modifydata: STLDATE,
op:OP
},
callback: function (options, success, response) {
if (success) {

@ -29,6 +29,10 @@
{ name: 'CUSTNO', type: 'string' },
{ name: 'STLDATE', type: 'string' },
{ name: 'OPLB', type: 'string' },
{ name: 'COMPLETEUSER', type: 'string' },
{ name: 'CUSTNAME', type: 'string' },
{ name: 'SALE', type: 'string' },
{ name: 'SALECORP', type: 'string' },
{ name: 'CREATEUSER', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'REMARK', type: 'string' }

@ -201,6 +201,14 @@ namespace DSWeb.Areas.TruckMng.Controllers
var imgFile = Request.Files["file"];
var truckNo = Request.Form["TruckNo"].ToString().Trim();
var Cert_Type = Request.Form["Cert_Type"].ToString().Trim();
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) };
}
String strPath = "/Areas/TruckMng/CertImages/"+truckNo+"/";
String dirPath = System.Web.HttpContext.Current.Server.MapPath(strPath);
if (!Directory.Exists(dirPath))
@ -211,6 +219,15 @@ namespace DSWeb.Areas.TruckMng.Controllers
var filenameHead = Path.GetFileName(imgFile.FileName).Replace( fileExt,"");
string ext = Path.GetExtension(imgFile.FileName).ToLower();
if (ext == ".asp" || ext == ".aspx")
{
jsonRespose.Success = false;
jsonRespose.Message = "不允许上传ASP或ASPX文件";
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
String newFileName = filenameHead+"_"+DateTime.Now.ToString("yyyyMMddHHmmss_ffff", DateTimeFormatInfo.InvariantInfo) + fileExt;
String filePath = dirPath + newFileName;
imgFile.SaveAs(filePath);

@ -692,6 +692,14 @@ namespace DSWeb.Areas.TruckMng.Controllers
{
MsSysBillNoSetDAL.DeleteBsNo(custno);
}
if (result.Success&&headData.BLTYPE=="派车主票") {
var ct = MsRptPcHeadEditDAL.GetRdCount("Gid<>'" + headData.gId + "' AND PGID='" + headData.gId + "' and MblNoSe<>'" + headData.MblNoSe + "' ");
if (ct != 0)
{
result.Message = result.Message + ",存在分单,并且主提单号不一致!";
}
}
var jsonRespose = new JsonResponse
{
Success = result.Success,

@ -2457,27 +2457,15 @@ Ext.extend(DsTruck.MsPcHYRDEdit, Ext.Panel, {
}
if (type == '0') {
this.opStatus = 'edit';
/* basicForm.findField('BillNo').setDisabled(true);*/
//for (var i = 0; i < this.storeBodyFix.getCount(); i += 1) {
// var member = this.storeBodyFix.getAt(i);
// member.set("BillNo", this.editRecord.get('gId'));
// member.commit();
//};
var LE_ID = this.editRecord.get('gId');
//for (var j = 0; j < this.storeCtnList.getCount(); j += 1) {
// var memberbody = this.storeCtnList.getAt(j);
// memberbody.set("LE_ID", LE_ID);
// memberbody.commit();
//};
this.panelFee.strBSNO = LE_ID;
this.panelFee.StoreDateCurr.load({ params: { optype: "tMsWlPcHead", bsno: LE_ID } });
this.panelFee.StoreUnit.load({ params: { bsno: LE_ID, bstype: "tMsWlPcHead" } });
this.storeBodyFix.load({ params: { billno: LE_ID } });
if (jsonresult.Message != '保存成功')
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
if (jsonresult.Message != '保存成功' && jsonresult.Message != '数据保存成功')
/* Ext.MessageBox.alert('错误', jsonresult.Message);*/
alert(jsonresult.Message);
/* Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });*/
} else if (type == '1') {

@ -38,7 +38,7 @@ namespace JobCreateFee
if (NoInvList != null && NoInvList.Count != 0) {
foreach (var NoInv in NoInvList)
{
insertTask(NoInv.BSNO, NoInv.MBLNO,NoInv.SALEDEPT+"_"+NoInv.OPLBNAME+"_"+NoInv.CUSTOMERNAME + "_RMB应收:" + NoInv.RMBDR + "_USD应收:" + NoInv.USDDR, "未开票",NoInv.OP,dbcon);
insertTask(NoInv.BSNO, NoInv.MBLNO,NoInv.SALEDEPT+"_"+NoInv.OPLBNAME+"_"+NoInv.CUSTOMERNAME + "_RMB应收:" + NoInv.RMBDR + "_USD应收:" + NoInv.USDDR, "未开票",NoInv.OP, NoInv.CUSTOMERNAME, dbcon);
}
}
@ -49,19 +49,19 @@ namespace JobCreateFee
SqlCommand cmd21 = new SqlCommand(sql21, dbcon);
cmd21.ExecuteNonQuery();
var sql2 = "UPDATE op_task SET ISCOMPLETE=1,TASKSTATUS='已完成',COMPLETETYPE='自动',COMPLETETIME=GETDATE() where TASKTYPE='欠费待收款' and TASKSTATUS='未开始' and EXISTS (select 1 from v_op_gain_sum where op_task.BSNO=v_op_gain_sum.BSNO AND STLTTLDR=TTLDR and TTLDR<>0) ";
var sql2 = "UPDATE op_task SET ISCOMPLETE=1,TASKSTATUS='已完成',COMPLETETYPE='自动',COMPLETETIME=GETDATE() where TASKTYPE='欠费待收款' and TASKSTATUS='未开始' and NOT EXISTS (select 1 from v_op_gain_sum where op_task.BSNO=v_op_gain_sum.BSNO AND STLTTLDR<>TTLDR and TTLDR<>0) ";
SqlCommand cmd2 = new SqlCommand(sql2, dbcon);
cmd2.ExecuteNonQuery();
var strSql2 = new StringBuilder();
strSql2.Append(" F.FEETYPE=1 AND F.SETTLEMENT<>F.AMOUNT AND DATEDIFF([day],GETDATE(),ISNULL(B.STLDATE,B.ETD))<=7 AND NOT EXISTS (SELECT 1 FROM op_task WHERE op_task.BSNO=B.BSNO AND TASKTYPE='欠费待收款' )");
var NoStlList = GetNoInv(strSql2.ToString(), dbcon);
var NoStlList = GetNoStl(strSql2.ToString(), dbcon);
if (NoStlList != null && NoStlList.Count != 0)
{
foreach (var NoInv in NoStlList)
{
insertTask(NoInv.BSNO, NoInv.MBLNO, NoInv.SALEDEPT + "_" + NoInv.OPLBNAME + "_RMB未收:" + NoInv.RMBDR + "_USD未收:" + NoInv.USDDR + "_RMB开票:" + NoInv.INVRMBDR + "_USD开票:" + NoInv.INVUSDDR, "欠费待收款", NoInv.OP, dbcon);
insertTask(NoInv.BSNO, NoInv.MBLNO, NoInv.SALEDEPT + "_" + NoInv.OPLBNAME + "_RMB未收:" + NoInv.RMBDR + "_USD未收:" + NoInv.USDDR + "_RMB开票:" + NoInv.INVRMBDR + "_USD开票:" + NoInv.INVUSDDR, "欠费待收款", NoInv.OP, NoInv.CUSTOMERNAME, dbcon);
}
@ -78,7 +78,7 @@ namespace JobCreateFee
{
foreach (var NoInv in NoCustStlList)
{
insertTask("","", NoInv.CUSTOMERNAME + "_" + NoInv.CUSTZQ + "_欠费额度:" + NoInv.ALLOWAMOUNT + "_总欠费:" + NoInv.NOSTLAMOUNT, "超额度欠费", Admin, dbcon);
insertTask("","", NoInv.CUSTOMERNAME + "_" + NoInv.CUSTZQ + "_欠费额度:" + NoInv.ALLOWAMOUNT + "_总欠费:" + NoInv.NOSTLAMOUNT, "超额度欠费", Admin,NoInv.CUSTOMERNAME, dbcon);
}
@ -103,11 +103,12 @@ namespace JobCreateFee
var headList = new List<MsOpSeaeFee>();
var strSql = new StringBuilder();
strSql.Append("SELECT B.BSNO,B.SALE,B.OP,B.SALEDEPT,B.OPLBNAME,B.MBLNO,F.CUSTOMERNAME");
strSql.Append("SELECT B.BSNO,B.SALE,B.OP,B.SALECORPID,B.OPLBNAME,B.MBLNO,F.CUSTOMERNAME");
strSql.Append(",(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP");
strSql.Append(",isnull(SUM(CASE F.FEETYPE WHEN 1 THEN (CASE F.CURRENCY WHEN 'RMB' THEN ISNULL(F.AMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS RMBDR");
strSql.Append(",isnull(SUM(CASE F.FEETYPE WHEN 1 THEN (CASE F.CURRENCY WHEN 'USD' THEN ISNULL(F.AMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS USDDR");
strSql.Append(" from CH_FEE F INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) where 1=1 AND " + connStr);
strSql.Append(" GROUP BY B.BSNO,B.SALE,B.OP,B.SALEDEPT,B.OPLBNAME,B.MBLNO,F.CUSTOMERNAME");
strSql.Append(" GROUP BY B.BSNO,B.SALE,B.OP,B.SALECORPID,B.OPLBNAME,B.MBLNO,F.CUSTOMERNAME");
SqlDataAdapter adapter = new SqlDataAdapter(strSql.ToString(), dbcon);
DataTable table = new DataTable();
@ -121,7 +122,7 @@ namespace JobCreateFee
Feedata.BSNO = row["BSNO"].ToString();
Feedata.SALE = row["SALE"].ToString();
Feedata.OP = row["OP"].ToString();
Feedata.SALEDEPT = row["SALEDEPT"].ToString();
Feedata.SALEDEPT = row["SALECORP"].ToString();
Feedata.OPLBNAME = row["OPLBNAME"].ToString();
Feedata.MBLNO = row["MBLNO"].ToString();
Feedata.CUSTOMERNAME = row["CUSTOMERNAME"].ToString();
@ -221,13 +222,13 @@ namespace JobCreateFee
private string insertTask(string BSNO,string MBLNO,string TASKTITLE,string TASKTYPE,string OP, SqlConnection dbcon)
private string insertTask(string BSNO,string MBLNO,string TASKTITLE,string TASKTYPE,string OP,string CUSTNAME,SqlConnection dbcon)
{
string sql = " INSERT INTO [op_task] (GID,[TASKNO] ,[PTASKNO],[TASKTYPE],[TASKSOURCE],[TASKSTATUS],[TASKTITLE] ";
sql = sql + ",[CREATEUSER] ,[CREATETIME] ,[TASKBEGINDATE] ,[COMPLETETYPE] ,[COMPLETETIME] ,[KPI],[MBLNO],[FILENO],[MAILNO],[FILEPATH],[ISPUBLIC],[OP],[BSNO],ISCOMPLETE)";
sql = sql + ",[CREATEUSER] ,[CREATETIME] ,[TASKBEGINDATE] ,[COMPLETETYPE] ,[COMPLETETIME] ,[KPI],[MBLNO],[FILENO],[MAILNO],[FILEPATH],[ISPUBLIC],[OP],[BSNO],ISCOMPLETE,CUSTNAME)";
sql = sql + " SELECT NEWID(),NEWID(),null, '"+ TASKTYPE + "', '任务生成', '未开始' as [任务状态], '" + TASKTITLE + "' as [任务说明],";
sql = sql + "'DEMO-SA' as [发起人],GETDATE() as [录入日期],GETDATE() as[任务开始时间], '手动' as [完成方式],null as [完成时间] ,null as [KPI值] , '" + MBLNO + "' as [提单号], ";
sql = sql + " null as [文件编号], '' as [邮件编号], '' as [电子档案路径], 0 as 是否公共,'"+ OP + "','" + BSNO + "' as 编号,0";
sql = sql + " null as [文件编号], '' as [邮件编号], '' as [电子档案路径], 0 as 是否公共,'"+ OP + "','" + BSNO + "' as 编号,0,'"+CUSTNAME+"'";
// log.Debug($"插入语句:{sql}");
SqlCommand cmd = new SqlCommand(sql, dbcon);

@ -73,9 +73,9 @@ namespace JobSendAgentMail
var MAILTITLE = MAILTITLEJOB;
MAILTITLE = MAILTITLE.Replace("$MBLNO$", row["MBLNO"].ToString());
MAILTITLE = MAILTITLE.Replace("$HBLNO$", row["HBLNO"].ToString());
MAILTITLE = MAILTITLE.Replace("$ETA$", row["ETA"].ToString());
MAILTITLE = MAILTITLE.Replace("$VESSEL$", row["VESSEL"].ToString());
MAILTITLE = MAILTITLE.Replace("$VOYNO$", row["VOYNO"].ToString());
MAILTITLE = MAILTITLE.Replace("$CONSIGNEENAME$", row["CONSIGNEENAME"].ToString());
StringWriter writer = new StringWriter();
HtmlDocument htmlDoc = new HtmlDocument();
@ -85,7 +85,7 @@ namespace JobSendAgentMail
try
{
var message = new MimeMessage();
message.From.Add(new MailboxAddress(row["OPNAME"].ToString(), row["OPEMAIL"].ToString()));
message.From.Add(new MailboxAddress(row["OPNAME"].ToString(), row["EMAIL"].ToString()));
var maillist = row["EMAIL"].ToString().Split(';');
foreach (var mailaddr in maillist)
{

Loading…
Cancel
Save