|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.Security;
|
|
|
|
|
using System.Web.UI;
|
|
|
|
|
using System.Web.UI.HtmlControls;
|
|
|
|
|
using System.Web.UI.WebControls;
|
|
|
|
|
using System.Web.UI.WebControls.WebParts;
|
|
|
|
|
using DSWeb.Models;
|
|
|
|
|
using DSWeb.EntityDA;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace DSWeb.FeeCodes
|
|
|
|
|
{
|
|
|
|
|
public partial class FeeCodeCtnService : System.Web.UI.Page
|
|
|
|
|
{
|
|
|
|
|
private string strHandle;
|
|
|
|
|
private string strUserID;//操作人GID
|
|
|
|
|
private string strBSNO;//委托编号
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (Session["USERID"] != null)
|
|
|
|
|
{
|
|
|
|
|
strUserID = Session["USERID"].ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Request.QueryString["handle"] != null)
|
|
|
|
|
{
|
|
|
|
|
strHandle = Request.QueryString["handle"].ToString().Trim().ToLower();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Request.QueryString["bsno"] != null)
|
|
|
|
|
{
|
|
|
|
|
strBSNO = Request.QueryString["bsno"].ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (strHandle != null)
|
|
|
|
|
{
|
|
|
|
|
if (strHandle == "getctnunit" && strBSNO != null)
|
|
|
|
|
{ //获取海运出口委托集装箱信息,返回JSON数据源
|
|
|
|
|
Response.Write(GetOpSeaeCtnInfo(strBSNO));
|
|
|
|
|
}
|
|
|
|
|
if (strHandle == "getcrmctn" && strBSNO != null)
|
|
|
|
|
{
|
|
|
|
|
Response.Write(GetCrmCtnInfo(strBSNO));
|
|
|
|
|
}
|
|
|
|
|
if(strHandle == "getallctn")
|
|
|
|
|
{
|
|
|
|
|
Response.Write(getAllCtn());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#region 获取销售订舱集装箱信息
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取销售订舱集装箱信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tempBSNO">销售订舱BSNO</param>
|
|
|
|
|
/// <returns>返回JSON集装箱数据集</returns>
|
|
|
|
|
private string GetCrmCtnInfo(string tempBSNO)
|
|
|
|
|
{
|
|
|
|
|
//获取销售订舱相关的集装箱信息
|
|
|
|
|
IList<CrmSeaeorderctnEntity> crmSeaeOrderCtnEntities = new List<CrmSeaeorderctnEntity>();
|
|
|
|
|
CrmSeaeorderctnDA crmSeaeorderctnDA = new CrmSeaeorderctnDA();
|
|
|
|
|
crmSeaeOrderCtnEntities = crmSeaeorderctnDA.GetCrmSeaeOrderCtnByOrdNo(tempBSNO);
|
|
|
|
|
|
|
|
|
|
StringBuilder sourceBuilder = new StringBuilder();
|
|
|
|
|
StringBuilder itemBuilder = new StringBuilder();
|
|
|
|
|
sourceBuilder.Append("{");
|
|
|
|
|
sourceBuilder.Append("ctns:[");
|
|
|
|
|
|
|
|
|
|
if (crmSeaeOrderCtnEntities.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (CrmSeaeorderctnEntity crmCtnEntity in crmSeaeOrderCtnEntities)
|
|
|
|
|
{
|
|
|
|
|
itemBuilder.Append("{name:\"" + crmCtnEntity.CTNALL + "\",");
|
|
|
|
|
itemBuilder.Append("num:" + crmCtnEntity.CTNNUM + "");
|
|
|
|
|
itemBuilder.Append("},");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (itemBuilder.ToString().EndsWith(","))
|
|
|
|
|
{
|
|
|
|
|
sourceBuilder.Append(itemBuilder.ToString().Trim().Substring(0, itemBuilder.ToString().Trim().Length - 1));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sourceBuilder.Append(itemBuilder.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
itemBuilder.Append("{name:\"\",");
|
|
|
|
|
itemBuilder.Append("num:0");
|
|
|
|
|
itemBuilder.Append("}");
|
|
|
|
|
}
|
|
|
|
|
sourceBuilder.Append("]");
|
|
|
|
|
sourceBuilder.Append("}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return sourceBuilder.ToString();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 根据BSNO获取海运出口委托集装箱(op_ctn)信息,返回JSON数据源
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据BSNO获取海运出口委托集装箱(op_ctn)信息,返回JSON数据源
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="tempBSNO">委托BSNO</param>
|
|
|
|
|
/// <returns>返回JSON数据源</returns>
|
|
|
|
|
private string GetOpSeaeCtnInfo(string tempBSNO)
|
|
|
|
|
{
|
|
|
|
|
//获取委托相关的集装箱信息,根据BSNO获取op_ctn信息TopCtnEntity集
|
|
|
|
|
IList<TopCtnEntity> topCtnEntities = new List<TopCtnEntity>();
|
|
|
|
|
TopCtnDA topCtnDA = new TopCtnDA();
|
|
|
|
|
topCtnEntities = topCtnDA.GetID(tempBSNO);
|
|
|
|
|
|
|
|
|
|
StringBuilder sourceBuilder = new StringBuilder();
|
|
|
|
|
StringBuilder itemBuilder = new StringBuilder();
|
|
|
|
|
sourceBuilder.Append("{");
|
|
|
|
|
sourceBuilder.Append("ctns:[");
|
|
|
|
|
|
|
|
|
|
if (topCtnEntities.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (TopCtnEntity ctnEntity in topCtnEntities)
|
|
|
|
|
{
|
|
|
|
|
itemBuilder.Append("{name:\"" + ctnEntity.CTNALL + "\",");
|
|
|
|
|
itemBuilder.Append("num:" + ctnEntity.CTNNUM + "");
|
|
|
|
|
itemBuilder.Append("},");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (itemBuilder.ToString().EndsWith(","))
|
|
|
|
|
{
|
|
|
|
|
sourceBuilder.Append(itemBuilder.ToString().Trim().Substring(0, itemBuilder.ToString().Trim().Length - 1));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sourceBuilder.Append(itemBuilder.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
itemBuilder.Append("{name:\"\",");
|
|
|
|
|
itemBuilder.Append("num:0");
|
|
|
|
|
itemBuilder.Append("}");
|
|
|
|
|
}
|
|
|
|
|
sourceBuilder.Append("]");
|
|
|
|
|
sourceBuilder.Append("}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return sourceBuilder.ToString();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取所有集装箱型信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>返回所有集装箱型号</returns>
|
|
|
|
|
private string getAllCtn()
|
|
|
|
|
{
|
|
|
|
|
IList<CodeCtnSetEntity> codeCtnSetEntities = new List<CodeCtnSetEntity>();
|
|
|
|
|
CodeCtnSetDA codeCtnSetDA = new CodeCtnSetDA();
|
|
|
|
|
|
|
|
|
|
codeCtnSetEntities = codeCtnSetDA.GetAllCodeCtnSet();
|
|
|
|
|
|
|
|
|
|
StringBuilder sourceBuilder = new StringBuilder();
|
|
|
|
|
StringBuilder itemBuilder = new StringBuilder();
|
|
|
|
|
sourceBuilder.Append("{");
|
|
|
|
|
sourceBuilder.Append("ctns:[");
|
|
|
|
|
|
|
|
|
|
if (codeCtnSetEntities.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (CodeCtnSetEntity codeCtnSetEntity in codeCtnSetEntities)
|
|
|
|
|
{
|
|
|
|
|
itemBuilder.Append("{name:\"" + codeCtnSetEntity.CTN + "\"");
|
|
|
|
|
itemBuilder.Append("},");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (itemBuilder.ToString().EndsWith(","))
|
|
|
|
|
{
|
|
|
|
|
sourceBuilder.Append(itemBuilder.ToString().Trim().Substring(0, itemBuilder.ToString().Trim().Length - 1));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sourceBuilder.Append(itemBuilder.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
itemBuilder.Append("{name:\"\"");
|
|
|
|
|
itemBuilder.Append("}");
|
|
|
|
|
}
|
|
|
|
|
sourceBuilder.Append("]");
|
|
|
|
|
sourceBuilder.Append("}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return sourceBuilder.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|