You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/Mobile/Views/OpStatus/Index.aspx.cs

255 lines
12 KiB
C#

3 years ago
using System;
using System.Collections.Generic;
using DSWeb.Areas.Mobile.Models.Login;
using System.Text;
using DSWeb.Areas.Mobile.Models.Common;
using DSWeb.Areas.MvcShipping.DAL;
using DSWeb.Areas.MvcShipping.Models.MsOpStatusNew;
using DSWeb.Areas.MvcShipping.DAL.MsOpSeaeQDPortDataDAL;
using DSWeb.MvcShipping.Models.MsOpSeae;
namespace DSWeb.Areas.Mobile.Views.OpStatus
{
public partial class Index : System.Web.Mvc.ViewPage
{
public User _User;
string _Keyword;
string _D;//登录方式wx微信pc电脑
public string _SingleView="0";//是否单票查看
public PageContentModel model = new PageContentModel();
protected void Page_Load ( object sender, EventArgs e )
{
var single = Request.QueryString["single"];
_SingleView = single == null ? "0" : single;
hdSingle.Value = _SingleView;
var mblno = Request.QueryString["mblno"];
if (mblno==null||mblno=="")
{
model.header = "";
model.content = "";
model.footer = "<li><a href=\"#\" data-icon=\"search\" id=\"btnBack\">查询</a></li>";
return;
}
mblno = mblno.Replace("'", "");
var d = Request.QueryString["d"];
_D = d == null ? "pc" : d;
_Keyword = mblno;
string msg = "";
MsOpSeaeQDPortDataDAL dal = new MsOpSeaeQDPortDataDAL("");
//获取状态
OpSeaeQDPortDataModel obj = dal.GetQdportModel(mblno, out msg);
//更新状态到本地
if (obj != null)
{
string bsno = MsOpStatusNewDAL.GetBSNOWithMBLNO(mblno);
if (bsno != null && bsno != "")
{
MsOpStatusNewDAL dalnew = new MsOpStatusNewDAL();
dalnew.UpdateQdportStatus(obj, bsno);
}
//生成html
SetupHTML(mblno);
}
else
{
model.content = "<li>"+msg+"</li>";
}
hdkeyword.Value = _Keyword;
}
public void SetupHTML (string mblno)
{
if (mblno=="")
{
return;
}
List<MsOpStatusNew> dataList = MsOpStatusNewDAL.GetStatusData(mblno);
StringBuilder sbMain = new StringBuilder();
if (dataList.Count > 0)
{
SetupHeader(dataList[0]);
MsOpStatusNew s = dataList[0];
StatusMain sm = s.StatusMain;
//主内容 系统生成的状态
//StringBuilder mainTable = new StringBuilder() ;
//mainTable.Append("<table style=\"font-size:11px\" align=\"left\">");
//string YiJieDanOpStr = sm.YiJieDanOp == "" ? "" : "[" + sm.YiJieDanOp + "]";
//mainTable.Append("<tr><td>" + sm.YiJieDanTime + "</td><td>|</td><td>已接单" + YiJieDanOpStr + "</td></tr>");
//string YiFaRuHuoTongZhiOpStr = sm.YiFaRuHuoTongZhiOp == "" ? "" : "[" + sm.YiFaRuHuoTongZhiOp + "]";
//mainTable.Append("<tr><td>" + sm.YiFaRuHuoTongZhiTime + "</td><td>|</td><td>已发入货通知" + YiFaRuHuoTongZhiOpStr + "</td></tr>");
//string YiDingCangOpStr = sm.YiDingCangOp == "" ? "" : "[" + sm.YiDingCangOp + "]";
//mainTable.Append("<tr><td>" + sm.YiDingCangTime + "</td><td>|</td><td>已订舱" + YiDingCangOpStr + "</td></tr>");
//string YiChuHaoOpStr = sm.YiChuHaoOp == "" ? "" : "[" + sm.YiChuHaoOp + "]";
//mainTable.Append("<tr><td>" + sm.YiChuHaoTime + "</td><td>|</td><td>已出号" + YiChuHaoOpStr + "</td></tr>");
//string YiTiDanQueRenOpStr = sm.YiTiDanQueRenOp == "" ? "" : "[" + sm.YiTiDanQueRenOp + "]";
//mainTable.Append("<tr><td>" + sm.YiTiDanQueRenTime + "</td><td>|</td><td>已提单确认" + YiTiDanQueRenOpStr + "</td></tr>");
//string FeiYongYiTiJiaoOpStr = sm.FeiYongYiTiJiaoOp == "" ? "" : "[" + sm.FeiYongYiTiJiaoOp + "]";
//mainTable.Append("<tr><td>" + sm.FeiYongYiTiJiaoTime + "</td><td>|</td><td>费用已提交" + FeiYongYiTiJiaoOpStr + "</td></tr>");
//mainTable.Append("</table>");
//sbMain.Append("<li style=\"padding-top:0px;padding-bottom:0px;padding-right:0px;padding-left:0px;\">");
//sbMain.Append("<div data-role=\"collapsible\" style=\"margin-left:0px;padding:0px\">");
//sbMain.Append("<h3>" + mainTable.ToString() + "</h3>");
//详细内容
sbMain.Append("<p>");
sbMain.Append("<ul data-role=\"listview\" data-inset=\"true\">");
StringBuilder sbDet = new StringBuilder();
foreach (var item in dataList)
{
StatusDetails sd = item.StatusDetails;
//箱号
sbDet.Append("<li data-role=\"list-divider\" style=\"font-size:11px\">");
sbDet.Append(sd.XiangHao);
sbDet.Append("</li>");
//已提箱
sbDet.Append("<li>");
sbDet.Append(sd.YiTiXiangTime +"|已提箱" );
sbDet.Append("</li>");
//已返场
sbDet.Append("<li>");
sbDet.Append(sd.YiFanChangTime+"|已返场");
sbDet.Append("</li>");
//舱单接受申报
sbDet.Append("<li>");
sbDet.Append(sd.YiFanChangTime+"|舱单接受申报");
sbDet.Append("</li>");
//运抵正常
sbDet.Append("<li>");
sbDet.Append(sd.YunDiZhengChangTime+"|" +sd.YunDiZhengChangMsg);
sbDet.Append("</li>");
//已入闸口
sbDet.Append("<li>");
sbDet.Append(sd.YiRuZhaKouTime+"|已入闸口");
sbDet.Append("</li>");
//报关单已通关放行
sbDet.Append("<li>");
sbDet.Append(sd.BaoGuanDanYiTongGuanFangXingTime+"|报关单已通关放行");
sbDet.Append("</li>");
//舱单已装载放行
sbDet.Append("<li>");
sbDet.Append(sd.CangDanYiZhuangZaiFangXingTime+"|舱单已装载放行");
sbDet.Append("</li>");
//已装船
sbDet.Append("<li>");
sbDet.Append(sd.YiZhuangChuanTime + "|已装船");
sbDet.Append("</li>");
//船公司CMA
//List<OpCMAStatus> cmalist = MsOpStatusNewDAL.GetCMADataFromDB(mblno, sd.XiangHao);
List<OpCMAStatus> cmalist = MsOpStatusNewDAL.GetStatusDetailsDataFromDB(mblno, sd.XiangHao);
foreach (var cma in cmalist)
{
string chuanminghangci = cma.ChuanMing + "/" + cma.HangCi;
chuanminghangci = chuanminghangci.Trim() != "/" ? "[" + chuanminghangci + "]" : "";
sbDet.Append("<li>");
sbDet.Append(cma.StatusTime + "|" + cma.StatusMsg + chuanminghangci);
sbDet.Append("</li>");
}
}
sbMain.Append(sbDet.ToString());
sbMain.Append("</ul>");
sbMain.Append("</p>");
sbMain.Append("</div>");
sbMain.Append("</li>");
model.content = sbMain.ToString();
//页脚按钮
StringBuilder sbFooter = new StringBuilder();
if (_D=="wx")
{
sbFooter.Append("<li><a href=\"#\" data-icon=\"search\" id=\"btnBack\">查询</a></li>");
}
else
{
sbFooter.Append("<li><a href=\"#\" data-icon=\"search\" id=\"btnBack\">查询</a></li>");
}
model.footer = sbFooter.ToString();
}
else
{
model.footer = "<li><a href=\"#\" data-icon=\"minus\" id=\"btnBack\">查询</a></li>";
}
}
public void SetupHeader ( MsOpStatusNew status )
{
StringBuilder sb = new StringBuilder();
sb.Append("<h2 style=\"font-size:12px\">" + status.StatusMain.MBLNO + ":</h2>");
sb.Append("<ul data-role=\"listview\" style=\"margin-top:11px\">");
sb.Append("<li>");
sb.Append("<table style=\"font-size:11px\">");
sb.Append("<tr>");
sb.Append("<td align='right'>");
sb.Append("船公司:");
sb.Append("</td>");
sb.Append("<td>");
sb.Append(status.StatusMain.ChuanGongSi);
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("<tr>");
sb.Append("<td align='right'>");
sb.Append("船名航次:");
sb.Append("</td>");
sb.Append("<td>");
sb.Append(status.StatusMain.ChuanMingHangCi);
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("<tr>");
sb.Append("<td align='right'>");
sb.Append("始发港:");
sb.Append("</td>");
sb.Append("<td>");
sb.Append(status.StatusMain.ShiFaGang);
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("<tr>");
sb.Append("<td align='right'>");
sb.Append("目的港:");
sb.Append("</td>");
sb.Append("<td>");
sb.Append(status.StatusMain.MuDiGang);
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("<tr>");
sb.Append("<td align='right'>");
sb.Append("ETD");
sb.Append("</td>");
sb.Append("<td>");
sb.Append(status.StatusMain.ETD);
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("<tr>");
sb.Append("<td align='right'>");
sb.Append("ETA");
sb.Append("</td>");
sb.Append("<td>");
sb.Append(status.StatusMain.ETA);
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("<tr>");
sb.Append("<td align='right'>");
sb.Append("箱型箱量:");
sb.Append("</td>");
sb.Append("<td>");
sb.Append(status.StatusMain.XiangXingXiangLiang);
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("</table>");
sb.Append("</li>");
sb.Append("</ul>");
model.header = sb.ToString();
}
}
}