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 = "
  • 查询
  • "; 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 = "
  • "+msg+"
  • "; } hdkeyword.Value = _Keyword; } public void SetupHTML (string mblno) { if (mblno=="") { return; } List 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(""); //string YiJieDanOpStr = sm.YiJieDanOp == "" ? "" : "[" + sm.YiJieDanOp + "]"; //mainTable.Append(""); //string YiFaRuHuoTongZhiOpStr = sm.YiFaRuHuoTongZhiOp == "" ? "" : "[" + sm.YiFaRuHuoTongZhiOp + "]"; //mainTable.Append(""); //string YiDingCangOpStr = sm.YiDingCangOp == "" ? "" : "[" + sm.YiDingCangOp + "]"; //mainTable.Append(""); //string YiChuHaoOpStr = sm.YiChuHaoOp == "" ? "" : "[" + sm.YiChuHaoOp + "]"; //mainTable.Append(""); //string YiTiDanQueRenOpStr = sm.YiTiDanQueRenOp == "" ? "" : "[" + sm.YiTiDanQueRenOp + "]"; //mainTable.Append(""); //string FeiYongYiTiJiaoOpStr = sm.FeiYongYiTiJiaoOp == "" ? "" : "[" + sm.FeiYongYiTiJiaoOp + "]"; //mainTable.Append(""); //mainTable.Append("
    " + sm.YiJieDanTime + "|已接单" + YiJieDanOpStr + "
    " + sm.YiFaRuHuoTongZhiTime + "|已发入货通知" + YiFaRuHuoTongZhiOpStr + "
    " + sm.YiDingCangTime + "|已订舱" + YiDingCangOpStr + "
    " + sm.YiChuHaoTime + "|已出号" + YiChuHaoOpStr + "
    " + sm.YiTiDanQueRenTime + "|已提单确认" + YiTiDanQueRenOpStr + "
    " + sm.FeiYongYiTiJiaoTime + "|费用已提交" + FeiYongYiTiJiaoOpStr + "
    "); //sbMain.Append("
  • "); //sbMain.Append("
    "); //sbMain.Append("

    " + mainTable.ToString() + "

    "); //详细内容 sbMain.Append("

    "); sbMain.Append("

      "); StringBuilder sbDet = new StringBuilder(); foreach (var item in dataList) { StatusDetails sd = item.StatusDetails; //箱号 sbDet.Append("
    • "); sbDet.Append(sd.XiangHao); sbDet.Append("
    • "); //已提箱 sbDet.Append("
    • "); sbDet.Append(sd.YiTiXiangTime +"|已提箱" ); sbDet.Append("
    • "); //已返场 sbDet.Append("
    • "); sbDet.Append(sd.YiFanChangTime+"|已返场"); sbDet.Append("
    • "); //舱单接受申报 sbDet.Append("
    • "); sbDet.Append(sd.YiFanChangTime+"|舱单接受申报"); sbDet.Append("
    • "); //运抵正常 sbDet.Append("
    • "); sbDet.Append(sd.YunDiZhengChangTime+"|" +sd.YunDiZhengChangMsg); sbDet.Append("
    • "); //已入闸口 sbDet.Append("
    • "); sbDet.Append(sd.YiRuZhaKouTime+"|已入闸口"); sbDet.Append("
    • "); //报关单已通关放行 sbDet.Append("
    • "); sbDet.Append(sd.BaoGuanDanYiTongGuanFangXingTime+"|报关单已通关放行"); sbDet.Append("
    • "); //舱单已装载放行 sbDet.Append("
    • "); sbDet.Append(sd.CangDanYiZhuangZaiFangXingTime+"|舱单已装载放行"); sbDet.Append("
    • "); //已装船 sbDet.Append("
    • "); sbDet.Append(sd.YiZhuangChuanTime + "|已装船"); sbDet.Append("
    • "); //船公司CMA //List cmalist = MsOpStatusNewDAL.GetCMADataFromDB(mblno, sd.XiangHao); List cmalist = MsOpStatusNewDAL.GetStatusDetailsDataFromDB(mblno, sd.XiangHao); foreach (var cma in cmalist) { string chuanminghangci = cma.ChuanMing + "/" + cma.HangCi; chuanminghangci = chuanminghangci.Trim() != "/" ? "[" + chuanminghangci + "]" : ""; sbDet.Append("
    • "); sbDet.Append(cma.StatusTime + "|" + cma.StatusMsg + chuanminghangci); sbDet.Append("
    • "); } } sbMain.Append(sbDet.ToString()); sbMain.Append("
    "); sbMain.Append("

    "); sbMain.Append("
    "); sbMain.Append("
  • "); model.content = sbMain.ToString(); //页脚按钮 StringBuilder sbFooter = new StringBuilder(); if (_D=="wx") { sbFooter.Append("
  • 查询
  • "); } else { sbFooter.Append("
  • 查询
  • "); } model.footer = sbFooter.ToString(); } else { model.footer = "
  • 查询
  • "; } } public void SetupHeader ( MsOpStatusNew status ) { StringBuilder sb = new StringBuilder(); sb.Append("

    " + status.StatusMain.MBLNO + ":

    "); sb.Append(""); model.header = sb.ToString(); } } }