远航通 查询页面后台 远航物流单号查询官网

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

using Aero.Form.UI.WebControl;

using Aero.SOAServices.Entity;

using Aero.WorkFlow.Entity;

//using Aero.WorkFlow.Contract;

using Aero.View.Models;

using Aero.Form.Core.Common;

using Aero.SOAServices.BLL;

using Aero.SOAService.Contract;

using Aero.View.Common;

using Aero.Framework.DomainModel.Entity;

using System.Text;

namespace Aero.View.Controllers

{

public class GHPQController : ControllerBase

{

public ActionResult Index(string viewname, bool partial = false)

{

foreach (var key in Request.QueryString.AllKeys)

{

ViewData[key] = Server.UrlDecode(Request.QueryString[key]);

}

if (partial)

{

return PartialView(viewname);

}

return View(viewname);

}

/// <summary>

/// 加载数据请求处理逻辑

/// 根据服务名称: BehaviorName 附加服务参数 BehaviorParameter 获取数据源

/// 服务参数的格式: {参数名}@{参数值} 对象数组

/// 针对Grid数据源特殊处理

/// </summary>

/// <param name="settings"></param>

/// <param name="behaviorname"></param>

/// <param name="args"></param>

/// <returns></returns>

[HttpPost]

public ActionResult LoadForGrid(GridSettings settings, string behaviorname, string beparameters)

{

SOABehavior behavior = SoaServiceHelper.GetBehaviorByName(behaviorname);

List<DataPack> instanceList = SoaServiceHelper.GetInstancesByBehaviorWithParasForGrid(behavior, behaviorname, beparameters, settings.Page, settings.Rows, settings.Sort, settings.Order);

SOAModel metaObj = null;

string jsonData = string.Empty;

if (behavior != null && behavior.ValueModel != null)

{

//如果是基本类型引用DataTypeID,如果是Model则引用ModelPropertyID

metaObj = behavior.ValueModel;

}

if (metaObj == null || metaObj.Properties.Count == 0 || instanceList == null)

{

return Content("{ "rows": [],"total": 0 }");

}

#region 按照EasyUI DATAGRID客户端端数据绑定格式来封装

jsonData = Common.JsonFunc.SerializeForGrid(metaObj, instanceList);

#endregion

return Content(jsonData);

}

/// <summary>

/// 加载数据请求处理逻辑

/// 根据服务名称: BehaviorName 附加服务参数 BehaviorParameter 获取数据源

/// 服务参数的格式: {参数名}@{参数值} 对象数组

/// </summary>

(远航通)查询页面后台 远航物流单号查询官网
/// <param name="behaviorname"></param>

/// <param name="beparameters"></param>

/// <returns></returns>

[HttpPost]

public ActionResult Load(string behaviorname, string beparameters)

{

SOABehavior behavior = SoaServiceHelper.GetBehaviorByName(behaviorname);

List<DataPack> instanceList = SoaServiceHelper.GetInstancesByBehaviorWithParas(behavior, behaviorname, beparameters);

SOAModel metaObj = null;

string jsonData = string.Empty;

if (behavior != null && behavior.ValueModel != null)

{

metaObj = behavior.ValueModel;

}

else

{

return Content("{}");

}

if (metaObj == null || metaObj.Properties.Count == 0 || instanceList == null)

{

return Content("{}");

}

if (behavior.ValueIsArray)

{

if (instanceList != null && instanceList.Count > 0)

{

jsonData = Common.JsonFunc.Serialize(metaObj, instanceList);

}

else

{

return Content("{}");

}

}

else if (instanceList.Count > 0)

{

if (instanceList != null && instanceList.Count > 0)

{

jsonData = Common.JsonFunc.Serialize(metaObj, instanceList[0]);

}

}

else

{

return Content("{}");

}

return Content(jsonData);

}

/// <summary>

/// 提交数据请求处理逻辑

/// 提交时指定服务名称,具体的数据是以json格式封装

/// </summary>

/// <param name="behaviorname"></param>

/// <param name="data"></param>

/// <returns></returns>

[HttpPost]

public JsonResult Submit(string behaviorname, string modelid, string data)

{

try

{

#region 初始化

CallBehavior callBehavior = new CallBehavior();

callBehavior.BehaviorName = behaviorname;

IService soaService = new Aero.SOAServices.Service();

#endregion

#region 获取SOAModel

SOABehavior behavior = SoaServiceHelper.GetBehaviorByName(behaviorname);

SOAModel metaObj = null;

string jsonData = string.Empty;

if (!(string.IsNullOrEmpty(modelid)))

{

metaObj = SoaServiceHelper.GetSoaModelByID(modelid);

}

#endregion

//JsonObject dynamicObj = (JsonObject)SimpleJson.DeserializeObject(data);

if (SimpleJson.DeserializeObject(data) is JsonArray)

{

Variable param = new Variable() { ID = Common.JsonFunc.GetGuidString(), DataTypeID = modelid, IsArray = true };

JsonArray array = (JsonArray)SimpleJson.DeserializeObject(data);

foreach (JsonObject item in array)

{

DataPack instance = Common.JsonFunc.Deserialize(metaObj, item);

if (instance == null)

{

//提交数据JSON格式解析错误

return Json(new FeedbackModel { Result = false });

}

param.Values.Add(instance);

}

callBehavior.InputParameter.Add(param);

}

else

{

//string newData = ChangeData(data);

DataPack instance = Common.JsonFunc.Deserialize(metaObj, data);

if (instance == null)

{

//提交数据JSON格式解析错误

return Json(new FeedbackModel { Result = false });

}

Variable param = new Variable() { ID = Common.JsonFunc.GetGuidString(), DataTypeID = modelid, IsArray = false };

param.Values.Add(instance);

callBehavior.InputParameter.Add(param);

}

soaService.CallBehavioer(callBehavior);

}

catch

{

return Json(new FeedbackModel { Result = false });

}

return Json(new FeedbackModel { Result = true });

}

[HttpPost]

public JsonResult Save(string behaviorname, string modelName, string data)

{

try

{

#region 初始化

CallBehavior callBehavior = new CallBehavior();

callBehavior.BehaviorName = behaviorname;

IService soaService = new Aero.SOAServices.Service();

#endregion

#region 获取SOAModel

SOABehavior behavior = SoaServiceHelper.GetBehaviorByName(behaviorname);

SOAModel metaObj = null;

string jsonData = string.Empty;

if (!(string.IsNullOrEmpty(modelName)))

{

metaObj = SoaServiceHelper.GetModelByName(modelName);

}

#endregion

if (SimpleJson.DeserializeObject(data) is JsonArray)

{

Variable param = new Variable() { ID = Common.JsonFunc.GetGuidString(), DataTypeID = metaObj.ID, IsArray = true };

JsonArray array = (JsonArray)SimpleJson.DeserializeObject(data);

foreach (JsonObject item in array)

{

DataPack instance = Common.JsonFunc.Deserialize(metaObj, item);

if (instance == null)

{

//提交数据JSON格式解析错误

return Json(new FeedbackModel { Result = false });

}

param.Values.Add(instance);

}

callBehavior.InputParameter.Add(param);

}

else

{

DataPack instance = Common.JsonFunc.Deserialize(metaObj, data);

if (instance == null)

{

//提交数据JSON格式解析错误

return Json(new FeedbackModel { Result = false });

}

Variable param = new Variable() { ID = Common.JsonFunc.GetGuidString(), DataTypeID = metaObj.ID, IsArray = false };

param.Values.Add(instance);

callBehavior.InputParameter.Add(param);

}

soaService.CallBehavioer(callBehavior);

}

catch

{

return Json(new FeedbackModel { Result = false });

}

return Json(new FeedbackModel { Result = true });

}

[HttpPost]

public JsonResult SaveModel(string modelid, string data, string pendingtaskid)

{

try

{

#region 初始化

CallBehavior callBehavior = new CallBehavior();

callBehavior.BehaviorName = "SaveWFRelationBusinessModel";

IService soaService = new Aero.SOAServices.Service();

#endregion

#region 获取SOAModel

SOABehavior behavior = SoaServiceHelper.GetBehaviorByName("SaveWFRelationBusinessModel");

SOAModel metaObj = null;

string jsonData = string.Empty;

if (!(string.IsNullOrEmpty(modelid)))

{

metaObj = SoaServiceHelper.GetSoaModelByID(modelid);

}

#endregion

//JsonObject dynamicObj = (JsonObject)SimpleJson.DeserializeObject(data);

Variable param0 = new Variable() { ID = Common.JsonFunc.GetGuidString(), DataTypeID = "T02" };

DataPack d = new DataPack();

d.DataTypeID = "T02";

d.SetValue("T02", pendingtaskid);

param0.Values.Add(d);

callBehavior.InputParameter.Add(param0);

if (SimpleJson.DeserializeObject(data) is JsonArray)

{

Variable param = new Variable() { ID = Common.JsonFunc.GetGuidString(), DataTypeID = modelid, IsArray = true };

JsonArray array = (JsonArray)SimpleJson.DeserializeObject(data);

foreach (JsonObject item in array)

{

DataPack instance = Common.JsonFunc.Deserialize(metaObj, item);

if (instance == null)

{

//提交数据JSON格式解析错误

return Json(new FeedbackModel { Result = false });

}

param.Values.Add(instance);

}

callBehavior.InputParameter.Add(param);

}

else

{

DataPack instance = Common.JsonFunc.Deserialize(metaObj, data);

if (instance == null)

{

//提交数据JSON格式解析错误

return Json(new FeedbackModel { Result = false });

}

Variable param = new Variable() { ID = Common.JsonFunc.GetGuidString(), DataTypeID = modelid, IsArray = false };

param.Values.Add(instance);

callBehavior.InputParameter.Add(param);

}

soaService.CallBehavioer(callBehavior);

}

catch

{

return Json(new FeedbackModel { Result = false });

}

return Json(new FeedbackModel { Result = true });

}

/// <summary>

/// 启动工作流

/// </summary>

/// <param name="workflowCode">流程代码</param>

/// <param name="bussinessID">业务ID</param>

/// <param name="data">数据 json格式</param>

/// <returns></returns>

[HttpPost]

public JsonResult StartWorkFlow(string workflowCode, string bussinessID, string data)

{

LoginUser user = (LoginUser)Session["userInfo"];

if (!String.IsNullOrEmpty(workflowCode)

&& !String.IsNullOrEmpty(bussinessID)

&& !String.IsNullOrEmpty(data))

{

JsonObject dynamicObj = (JsonObject)SimpleJson.DeserializeObject(data);

IDictionary<string, string> dict = new Dictionary<string, string>();

foreach (var d in dynamicObj)

{

dict[d.Key] = (d.Value ?? String.Empty).ToString();

}

dict["HandlingID"] = user.UserID;

dict["HandlingName"] = user.UserName;

dict["HandlingPosition"] = user.Role;

bool flag = Common.WorkFlowHelper.InstanceWorkFlow(workflowCode, bussinessID, "", "", dict);

return Json(new FeedbackModel { Result = flag });

}

return Json(new FeedbackModel { Result = false });

}

/// <summary>

/// 处理代办

/// </summary>

/// <param name="pendingTaskID">代办ID</param>

/// <param name="result">处理结果</param>

/// <param name="data">处理数据 json格式</param>

/// <returns></returns>

[HttpPost]

public ActionResult ProcessPendingTask(string pendingTaskID, string result, string data)

{

if (!String.IsNullOrEmpty(pendingTaskID)

&& !String.IsNullOrEmpty(result)

&& !String.IsNullOrEmpty(data))

{

JsonObject dynamicObj = (JsonObject)SimpleJson.DeserializeObject(data);

IDictionary<string, string> dict = new Dictionary<string, string>();

foreach (var d in dynamicObj)

{

dict[d.Key] = (d.Value ?? String.Empty).ToString();

}

dict["HandlingID"] = CurrentUser.UserID;

dict["HandlingName"] = CurrentUser.UserName;

dict["HandlingPosition"] = CurrentUser.Role;

bool flag = Common.WorkFlowHelper.TaskDeal(pendingTaskID, result, dict);

return Json(new FeedbackModel { Result = flag });

}

return Json(new FeedbackModel { Result = false });

}

/// <summary>

/// 获取附件

/// </summary>

/// <param name="id">附件ID</param>

/// <returns></returns>

public ActionResult GetAttachment(string id)

{

SOABehavior behavior = SoaServiceHelper.GetBehaviorByName("GetDownloadUrlByAttachID");

List<DataPack> instanceList = SoaServiceHelper.GetInstancesByBehaviorWithParas(behavior, "GetDownloadUrlByAttachID", "{"FID":"" + id + ""}");

if (instanceList.Count > 0)

{

string path = instanceList[0].GetValue("T02");

if (!String.IsNullOrEmpty(path) && path != "#")

return RedirectPermanent(path);

}

return HttpNotFound();

}

//测试数据

public JsonResult GetGenderList()

{

return Json(new object[]{

new {text="请选择",value="0"},

new {text="男",value="true"},

new {text="女",value="false"}

});

}

//机型数据

public JsonResult GetAirPlane()

{

return Json(new object[]{

new {text="请选择",value="0"},

new {text="B737",value="B737"},

new {text="B747",value="B747"},

new {text="B777",value="B777"},

new {text="A319",value="A319"},

new {text="A321",value="A321"},

new {text="A330",value="A330"},

new {text="A340",value="A340"}

});

}

[HttpPost]

public ActionResult LoadNowYears()

{

System.Text.StringBuilder jsonData = new System.Text.StringBuilder();

jsonData.Append("[");

int year = DateTime.Now.Year;

for (int i = year - 7; i <= year + 1; i++)

{

if (i == year + 1)

{

jsonData.AppendFormat("&'ID':'{0}','NAME':'{0}'*", i);

}

else

{

jsonData.AppendFormat("&'ID':'{0}','NAME':'{0}'*,", i);

}

}

jsonData.Append("]");

string str = jsonData.ToString().Replace("*", "}").Replace("&", "{").Replace("'", """);

return Content(str);

}

}

}

  

爱华网本文地址 » http://www.413yy.cn/a/25101012/141889.html

更多阅读

如何查询快递单号和派件员电话号码? 中通快递单号查询号码

如何查询快递单号和派件员电话号码?——简介现在电商社会,在淘宝上购买了东西,卖家已经发货也有了单号,看着旺旺上的跟踪记录就快派送到自己的手上了,但迟迟没有派送!我们该如何让快递早派送?例如:现在我们在淘宝得知有了自己的申通快递单

手机IMEI码有什么用 小米imei码查询官网

手机IMEI码是手机鉴别的主要依据,由它可以判断出该手机是原厂正品手机,还是水改机或翻新机,在购机过程中充分使用它可以帮助用户减少上当受骗,买到真正正品手机。1.手机IMEI码解释手机IMEI(InternationalMobile Equipment Identity)是国

ems快递单号查询方法 韩国ems快递单号查询

EMS在全国通用,在一些小城市只能用EMS邮寄。那怎么查询快递单号呢?小五在这里介绍几个使用的方法。ems快递单号查询方法——【获得单号方法】ems快递单号查询方法 1、如果是在购物网站购买商

苹果怎么查序列号 苹果激活时间查询官网

苹果怎么查序列号——简介苹果手机的序列号怎么查询呢? 查询序列号的方法很简单,查到序列号以后,一般情况下都是想查询自己的机器是什么时候激活的,有没有过硬件保修期之类的信息。下面介绍一些常用的查询苹果手机序列号以及保修信息的

北京市小客车指标调控管理办公室 小客车指标查询官网

申请小客车指标办事指南(个人)http://www.bjhjyd.gov.cn/bszn/20131231/1388482774221_1.html目录:一、申请配置指标条件说明二、申请配置指标操作说明三、阶梯中签率说明四、申请更新指标操作说明五、示范应用新能源小客车指标说明六

声明:《远航通 查询页面后台 远航物流单号查询官网》为网友青春用来挥霍分享!如侵犯到您的合法权益请联系我们删除