using BLL;
|
using BLL.DAL;
|
using Common;
|
using Json;
|
using Lib;
|
using Model;
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.Mvc;
|
using System.Web.Script.Serialization;
|
|
namespace wms.Areas.Business.Controllers
|
{
|
public class IPalletBindAjaxController : AjaxPage
|
{
|
public ActionResult GetBindList()
|
{
|
try
|
{
|
var dd = Request["ajaxdata"];
|
var models = new JavaScriptSerializer().Deserialize<PalBindList>(dd);
|
if (models != null)
|
{
|
models.DepartGuid = this.LoginDepartNum;
|
PageInfo pageInfo = new PageInfo() { PageIndex = models.pageIndex, PageSize = models.pageSize };
|
|
DALPalletBind provider = new DALPalletBind();
|
List<PalBind> entity = provider.GetList(models, ref pageInfo).ToList();
|
|
string json = JsonHelper.IListToJson<PalBind>(entity, "List");
|
string pjson = ConvertJson.Serializer(pageInfo);
|
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("PageInfo", new JsonObject(pjson));
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "响应成功");
|
|
return Content(this.ReturnJson.ToString());
|
}
|
|
return Content(null);
|
}
|
catch (Exception ex)
|
{
|
WriteFileLog(ex.Message.ToString(), System.Reflection.MethodBase.GetCurrentMethod());
|
return Content(null);
|
}
|
}
|
|
public ActionResult Detail()
|
{
|
try
|
{
|
var dd = Request["ajaxdata"];
|
var models = new JavaScriptSerializer().Deserialize<PalBind>(dd);
|
if (models == null)
|
{
|
return Content(null);
|
}
|
|
models.CreatUser = this.LoginUserCode;
|
models.DepartGuid = this.LoginDepartNum;
|
|
if (string.IsNullOrEmpty(models.Palno))//新增
|
{
|
if (Session["TEMPDATA_CACHE_PALLETBIND"] == null)
|
{
|
Session["TEMPDATA_CACHE_PALLETBIND"] = new List<PalBind>();
|
}
|
List<PalBind> list = Session["TEMPDATA_CACHE_PALLETBIND"] as List<PalBind>;
|
|
IDALPalletBind dalPb = new DALPalletBind();
|
if (dalPb.Add(models, list))
|
{
|
Session["TEMPDATA_CACHE_PALLETBIND"] = null;
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "托盘物料绑定成功");
|
}
|
else
|
{
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "托盘物料绑定失败");
|
}
|
|
return Content(this.ReturnJson.ToString());
|
}
|
else
|
{
|
//查看、 编辑,返回组盘明细
|
Session["TEMPDATA_CACHE_PalletBind"] = null;
|
|
IDALPalletBind pb = new DALPalletBind();
|
IList<PalBind> lst = new List<PalBind>();
|
pb.GetPalletBind(models, ref lst);
|
Session["TEMPDATA_CACHE_PalletBind"] = lst;
|
|
string json = JsonHelper.IListToJson<PalBind>(lst, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "OK");
|
|
return Content(this.ReturnJson.ToString());
|
}
|
}
|
catch (Exception ex)
|
{
|
WriteFileLog(ex.Message.ToString(), System.Reflection.MethodBase.GetCurrentMethod());
|
return Content(null);
|
}
|
}
|
|
public ActionResult GetInNoDetail()
|
{
|
try
|
{
|
var dd = Request["ajaxdata"];
|
var models = new JavaScriptSerializer().Deserialize<PalBind>(dd);
|
if (models.MatNo != null)
|
{
|
List<PalBind> list = Session["TEMPDATA_CACHE_PALLETBIND"] as List<PalBind>;
|
models.DepartGuid = this.LoginDepartNum;
|
DALPalletBind dpl = new DALPalletBind();
|
PalBind lst = dpl.GetInNoDetail(models, list);
|
string json = ConvertJson.Serializer(lst);
|
|
if (lst.OrdNo == null)
|
{
|
ReturnJson.AddProperty("Code", -1);
|
ReturnJson.AddProperty("Message", "未找到与该物料匹配的入库单");
|
}
|
else
|
{
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("Message", "该物料存在,可进行绑定操作");
|
}
|
|
return Content(this.ReturnJson.ToString());
|
}
|
return Content(null);
|
}
|
catch (Exception ex)
|
{
|
WriteFileLog(ex.Message.ToString(), System.Reflection.MethodBase.GetCurrentMethod());
|
return Content(null);
|
}
|
}
|
|
public ActionResult GetAddreList()
|
{
|
try
|
{
|
var dd = Request["ajaxdata"];
|
var modelItems = new JavaScriptSerializer().Deserialize<QueryDLocation>(dd);
|
if (modelItems != null)
|
{
|
// 实例化分页信息
|
PageInfo pageInfo = new PageInfo()
|
{
|
PageIndex = modelItems.PageIndex,
|
PageSize = modelItems.PageSize
|
};
|
|
// 数据库交互,获取库区集合and分页信息。
|
DALDepotsLocation provider = new DALDepotsLocation();
|
List<DepotsLocation> entity = provider.GetDepotsLocationItems(modelItems, ref pageInfo).ToList();
|
|
// Data =》json
|
string json = JsonHelper.IListToJson<DepotsLocation>(entity, "List");
|
string pjson = ConvertJson.Serializer(pageInfo);
|
|
// controller => view
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("PageInfo", new JsonObject(pjson));
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "加载库位集合成功!");
|
|
return Content(this.ReturnJson.ToString());
|
}
|
|
return Content(null);
|
}
|
catch (Exception ex)
|
{
|
WriteFileLog(ex.Message.ToString(), System.Reflection.MethodBase.GetCurrentMethod());
|
return Content(null);
|
}
|
}
|
|
// liudl 注释 逻辑推断没必要验证
|
public ActionResult GetErpin()
|
{
|
try
|
{
|
var dd = Request["ajaxdata"];
|
var models = new JavaScriptSerializer().Deserialize<PalBind>(dd);
|
|
if (models != null)
|
{
|
IDALPalletBind idpl = new DALPalletBind();
|
IList<PalBind> lst = new List<PalBind>();
|
bool r = idpl.GetErpinByMatNo(models, ref lst);
|
int erpinCount = lst.Count;
|
List<PalBind> list = Session["TEMPDATA_CACHE_PALLETBIND"] as List<PalBind>;
|
if (erpinCount == 0)
|
{
|
List<PalBind> lt = new List<PalBind>();
|
string json = JsonHelper.IListToJson<PalBind>(lt, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("Code", -1);
|
ReturnJson.AddProperty("Message", "未找到与该物料匹配的入库单");
|
|
return Content(this.ReturnJson.ToString());
|
}
|
else
|
{
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "该物料存在,可进行绑定操作");
|
|
return Content(this.ReturnJson.ToString());
|
}
|
}
|
return Content(null);
|
}
|
catch (Exception ex)
|
{
|
WriteFileLog(ex.Message.ToString(), System.Reflection.MethodBase.GetCurrentMethod());
|
return Content(null);
|
}
|
}
|
|
// 未完成
|
public ActionResult AddBinding()
|
{
|
try
|
{
|
var dd = Request["ajaxdata"];
|
var models = new JavaScriptSerializer().Deserialize<PalBind>(dd);
|
|
if ((models.OrdNo != null) && (models.MatNo != null))
|
{
|
|
List<PalBind> list = Session["TEMPDATA_CACHE_PALLETBIND"] as List<PalBind>;
|
|
DALPalletBind pb = new DALPalletBind();
|
ErpInDetail eid = new ErpInDetail();
|
pb.GetOrderMatByMatNoAndOrd(models.OrdNo, models.MatNo, ref eid);
|
|
//models.LingNo = eid.LingNo;
|
//models.PageNo = eid.PageNo;
|
//models.TuNo = eid.TuNo;
|
models.MatName = eid.MatName;
|
// models.PackFormat = eid.PackFormat;
|
|
|
// liudl Edit 修改新增共用数量验证
|
int ordCount = 0, bindCount = 0, remainCount = 0;
|
pb.GetRemainBindCount(models.OrdNo, models.MatGuid, ref ordCount, ref bindCount, ref remainCount, models.Palno);
|
remainCount -= int.Parse(models.MatCount);//把当前要修改的数量减掉
|
if (remainCount < 0)
|
{
|
list = new List<PalBind>();
|
Session["TEMPDATA_CACHE_PALLETBIND"] = list;
|
string json2 = JsonHelper.IListToJson<PalBind>(list, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json2));
|
ReturnJson.AddProperty("Code", -1);
|
ReturnJson.AddProperty("Message", "绑定失败, 该物料绑定总数量超过入库单物料数量");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
return Content(this.ReturnJson.ToString());
|
}
|
|
|
if (!list.IsEmpty() && list.Count > 0)
|
{
|
//修改绑定 物料编码and单据号相同时才可更新
|
bool firstAdd = true;
|
for (int i = 0; i < list.Count; i++)
|
{
|
if (list[i].MatNo == models.MatNo && list[i].OrdNo == models.OrdNo)
|
{
|
firstAdd = false;
|
list[i].MatCount = models.MatCount;
|
list[i].Palno = models.Palno;
|
list[i].LocationCode = models.LocationCode;
|
list[i].LingNo = models.LingNo;
|
list[i].Demo = models.Demo;
|
}
|
}
|
if (firstAdd)
|
{
|
list.Add(models);
|
}
|
|
Session["TEMPDATA_CACHE_PALLETBIND"] = list;
|
string json1 = JsonHelper.IListToJson<PalBind>(list, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json1));
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "响应成功");
|
}
|
else
|
{
|
//添加绑定
|
list = new List<PalBind>();
|
list.Add(models);
|
Session["TEMPDATA_CACHE_PALLETBIND"] = list;
|
string json = JsonHelper.IListToJson<PalBind>(list, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "响应成功");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
}
|
|
return Content(this.ReturnJson.ToString());
|
}
|
return Content(null);
|
}
|
catch (Exception ex)
|
{
|
WriteFileLog(ex.Message.ToString(), System.Reflection.MethodBase.GetCurrentMethod());
|
return Content(null);
|
}
|
}
|
|
public ActionResult Add()
|
{
|
try
|
{
|
// 判断是否存在组盘信息
|
if (Session["TEMPDATA_CACHE_PALLETBIND"] == null)
|
{
|
ReturnJson.AddProperty("Code", -1);
|
ReturnJson.AddProperty("Message", "请添加绑定信息!");
|
return Content(this.ReturnJson.ToString());
|
}
|
string LocationCode = "";
|
string ajaxdata = Request["ajaxdata"];
|
var models = new JavaScriptSerializer().Deserialize<PalBind>(ajaxdata);
|
if (models != null)
|
{
|
LocationCode = models.LocationCode;
|
}
|
List<PalBind> list = Session["TEMPDATA_CACHE_PALLETBIND"] as List<PalBind>;
|
|
foreach (var item in list)
|
{
|
//if (string.IsNullOrWhiteSpace(item.LocationCode)
|
// && !string.IsNullOrWhiteSpace(LocationCode))
|
//{
|
item.LocationCode = LocationCode;
|
//}
|
}
|
|
DALPalletBind pb = new DALPalletBind();
|
string strMessage = pb.SetPalBinds(this.LoginUserCode, this.LoginDepartNum, list);
|
if (strMessage.Length > 0)
|
{
|
ReturnJson.AddProperty("Code", -1);
|
ReturnJson.AddProperty("Message", strMessage);
|
|
}
|
else
|
{
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "保存成功");
|
}
|
|
return Content(this.ReturnJson.ToString());
|
}
|
catch (Exception ex)
|
{
|
WriteFileLog(ex.Message.ToString(), System.Reflection.MethodBase.GetCurrentMethod());
|
return Content(null);
|
}
|
}
|
|
public ActionResult Del()
|
{
|
try
|
{
|
string OrdNo = Request["OrdNo"];
|
string Palno = Request["Palno"];
|
string LocationCode = Request["LocationCode"];
|
if (!string.IsNullOrEmpty(Palno) && !string.IsNullOrEmpty(OrdNo))
|
{
|
IDALPalletBind dalPB = new DALPalletBind();
|
string strMessage = dalPB.DelPalBind(this.LoginUserCode, Palno, OrdNo,LocationCode);
|
|
if (strMessage.Length > 0)
|
{
|
ReturnJson.AddProperty("Code", -1);
|
ReturnJson.AddProperty("Message", strMessage);
|
}
|
else
|
{
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "删除组盘成功");
|
}
|
|
return Content(this.ReturnJson.ToString());
|
}
|
|
return Content(null);
|
}
|
catch (Exception ex)
|
{
|
WriteFileLog(ex.Message.ToString(), System.Reflection.MethodBase.GetCurrentMethod());
|
return Content(null);
|
}
|
}
|
|
public ActionResult DelBinding()
|
{
|
try
|
{
|
var dd = Request["ajaxdata"];
|
var models = new JavaScriptSerializer().Deserialize<PalBind>(dd);
|
if (models != null)
|
{
|
List<PalBind> list = Session["TEMPDATA_CACHE_PALLETBIND"] as List<PalBind>;
|
|
if (!list.IsEmpty())
|
{
|
for (int i = 0; i < list.Count; i++)
|
{
|
if (list[i].MatNo == models.MatNo && list[i].OrdNo == models.OrdNo)
|
{
|
if (list[i].Guid != null)
|
{
|
// 删除数据库信息
|
IDALPalletBind dalPB = new DALPalletBind();
|
dalPB.DelPalBindDetail(this.LoginUserCode, list[i].Guid, list[i].OrdNo);
|
}
|
|
list.Remove(list[i]);
|
i--;
|
}
|
}
|
Session["TEMPDATA_CACHE_PALLETBIND"] = list;
|
string json = JsonHelper.IListToJson<PalBind>(list, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "响应成功");
|
|
}
|
else
|
{
|
Session["TEMPDATA_CACHE_PALLETBIND"] = list;
|
string json = JsonHelper.IListToJson<PalBind>(list, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("Code", -1);
|
ReturnJson.AddProperty("Message", "响应失败,列表为空");
|
}
|
|
return Content(this.ReturnJson.ToString());
|
}
|
return Content(null);
|
}
|
catch (Exception ex)
|
{
|
WriteFileLog(ex.Message.ToString(), System.Reflection.MethodBase.GetCurrentMethod());
|
return Content(null);
|
}
|
}
|
|
[LoginFilter]
|
public ActionResult Init()
|
{
|
Session["TEMPDATA_CACHE_PALLETBIND"] = null;
|
List<PalletBind> list = new List<PalletBind>();
|
string json = JsonHelper.IListToJson<PalletBind>(list, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "响应成功");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
return Content(this.ReturnJson.ToString());
|
}
|
|
|
|
|
|
|
|
|
|
|
[LoginFilter]
|
public ActionResult AddOneMat()
|
{
|
var dd = Request["ajaxdata"];
|
|
var models = new JavaScriptSerializer().Deserialize<PalletBind>(dd);
|
|
if (/*(models.OrdNo != null) &&*/ (models.MatNo != null))
|
{
|
List<PalletBind> list = Session["TEMPDATA_CACHE_PALLETBIND"] as List<PalletBind>;
|
DALPalletBind pb = new DALPalletBind();
|
ErpInDetail eid = new ErpInDetail();
|
pb.GetOrderMatByMatNoAndOrd(models.OrdNo, models.MatNo, ref eid);
|
models.MatName = eid.MatName;
|
models.PageNo = eid.PageNo;
|
models.TuNo = eid.TuNo;
|
models.MatCount = eid.CurQuant;
|
models.OrdNo = eid.OrdNo;
|
if (!list.IsEmpty())
|
{
|
//修改绑定
|
bool firstAdd = true;
|
for (int i = 0; i < list.Count; i++)
|
{
|
if (list[i].MatNo == models.MatNo)
|
{
|
int ordCount = 0, bindCount = 0, remainCount = 0;
|
pb.GetRemainBindCount(models.OrdNo, models.MatNo, ref ordCount, ref bindCount, ref remainCount, models.PalletNo);
|
//判断当前绑定数量是否大于待绑定数量
|
remainCount -= 1;
|
if ((remainCount < 0) || (int.Parse(list[i].MatCount) > remainCount))
|
{
|
Session["TEMPDATA_CACHE_PALLETBIND"] = list;
|
string json = JsonHelper.IListToJson<PalletBind>(list, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("Code", -1);
|
ReturnJson.AddProperty("Message", "物料绑定数量已经达到入库单数量");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
return Content(this.ReturnJson.ToString());
|
}
|
|
firstAdd = false;
|
list[i].MatCount = (int.Parse(list[i].MatCount) + 1).ToString();
|
}
|
}
|
if (firstAdd)
|
{
|
models.MatCount = "1";
|
list.Add(models);
|
}
|
|
Session["TEMPDATA_CACHE_PALLETBIND"] = list;
|
string json1 = JsonHelper.IListToJson<PalletBind>(list, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json1));
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "响应成功");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
|
}
|
else
|
{
|
models.MatCount = "1";
|
list = new List<PalletBind>();
|
int ordCount = 0, bindCount = 0, remainCount = 0;
|
pb.GetRemainBindCount(models.OrdNo, models.MatNo, ref ordCount, ref bindCount, ref remainCount, models.PalletNo);
|
remainCount -= 1;//把当前要修改的数量减掉
|
if (remainCount < 0)
|
{
|
Session["TEMPDATA_CACHE_PALLETBIND"] = list;
|
string json2 = JsonHelper.IListToJson<PalletBind>(list, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json2));
|
ReturnJson.AddProperty("Code", -1);
|
ReturnJson.AddProperty("Message", "物料绑定数量已经达到入库单数量");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
return Content(this.ReturnJson.ToString());
|
}
|
//添加绑定
|
list = new List<PalletBind>();
|
list.Add(models);
|
Session["TEMPDATA_CACHE_PALLETBIND"] = list;
|
string json = JsonHelper.IListToJson<PalletBind>(list, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "响应成功");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
}
|
|
return Content(this.ReturnJson.ToString());
|
}
|
return Content(null);
|
}
|
|
public ActionResult CheckPalletNo()
|
{
|
ViewBag.LingNo = "";
|
var dd = Request["ajaxdata"];
|
|
var models = new JavaScriptSerializer().Deserialize<PalletBind>(dd);
|
|
if (models != null)
|
{
|
IDALPalletBind idpl = new DALPalletBind();
|
IList<PalletBind> lst = new List<PalletBind>();
|
bool r = idpl.IsPalletUsing(models.PalletNo);
|
if (r)
|
{
|
ReturnJson.AddProperty("Code", -1);
|
ReturnJson.AddProperty("Message", "托盘码重复");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
|
return Content(this.ReturnJson.ToString());
|
}
|
else
|
{
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "托盘码可用");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
|
return Content(this.ReturnJson.ToString());
|
}
|
}
|
return Content(null);
|
}
|
|
public ActionResult ErpIn()
|
{
|
var dd = Request["ajaxdata"];
|
var models = new JavaScriptSerializer().Deserialize<Order>(dd);
|
|
DAL_Pub pub = new DAL_Pub();
|
models.CreateUser = this.LoginUserCode;
|
models.CMDStatu = 0;
|
models.CMDType = "in";
|
pub.GetEmptyPos(ref models.OldAddre, 0);
|
models.IsDel = 0;
|
|
int ret = -1;
|
ret = pub.GenPalletInOrder(models);
|
if (ret == 0)
|
{
|
//IDALPalletBind pb = new DALPalletBind();
|
//bool br = pb.UpdateAfterPalletIn(models.Palno, "2");
|
//if(!br)
|
// br = pb.UpdateAfterPalletIn(models.Palno, "2");
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "入库指令发送成功");
|
}
|
else
|
{
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "入库指令发送失败");
|
}
|
|
return Content(this.ReturnJson.ToString());
|
}
|
|
public ActionResult ErpClose()
|
{
|
var dd = Request["ajaxdata"];
|
var models = new JavaScriptSerializer().Deserialize<PalletBind>(dd);
|
var PalletNo = models.PalletNo;
|
var LingNo = models.LingNo;
|
var OrdNo = models.OrdNo;
|
if (string.IsNullOrEmpty(PalletNo))//新增
|
{
|
if (models != null)
|
{
|
List<PalletBind> list = Session["TEMPDATA_CACHE_PALLETBIND"] as List<PalletBind>;
|
|
IDALPalletBind dalPb = new DALPalletBind();
|
models.CreateUser = this.LoginUserCode;
|
|
bool value = false;
|
//if (editPallet == null)//
|
//{
|
//value = dalPb.Add(models, list);
|
//if (value)
|
//{
|
// Session["TEMPDATA_CACHE_PALLETBIND"] = null;
|
// ReturnJson.AddProperty("Code", 1);
|
// ReturnJson.AddProperty("Message", "托盘物料绑定成功");
|
//}
|
//else
|
//{
|
// ReturnJson.AddProperty("Code", 1);
|
// ReturnJson.AddProperty("Message", "托盘物料绑定失败");
|
//}
|
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
//}
|
//else
|
//{
|
// value = dalPb.Update(models,list);
|
// if (value)
|
// {
|
// Session["TEMPDATA_CACHE_PALLETBIND"] = null;
|
// ReturnJson.AddProperty("Code", 1);
|
// ReturnJson.AddProperty("Message", "托盘物料绑定成功");
|
// }
|
// else
|
// {
|
// ReturnJson.AddProperty("Code", -1);
|
// ReturnJson.AddProperty("Message", "托盘物料绑定失败");
|
// }
|
// ReturnJson.AddProperty("SubCode", 0);
|
// ReturnJson.AddProperty("SubMessage", "");
|
//}
|
|
return Content(this.ReturnJson.ToString());
|
}
|
|
}
|
else
|
{
|
//编辑,返回组盘明细
|
Session["TEMPDATA_CACHE_PalletBind"] = null;
|
|
IDALPalletBind pb = new DALPalletBind();
|
IList<PalletBind> lst = new List<PalletBind>();
|
pb.GetPalletBind(PalletNo, ref lst);
|
Session["TEMPDATA_CACHE_PalletBind"] = lst;
|
string json = JsonHelper.IListToJson<PalletBind>(lst, "List");
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "OK");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
return Content(this.ReturnJson.ToString());
|
}
|
return Content(null); ;
|
}
|
|
public ActionResult CheckStatus()
|
{
|
var dd = Request["ajaxdata"];
|
|
var models = new JavaScriptSerializer().Deserialize<PalletBind>(dd);
|
if (!string.IsNullOrEmpty(models.PalletNo))
|
{
|
IDALPalletBind pb = new DALPalletBind();
|
string status = "等待执行";
|
bool r = pb.GetPalletBindStatus(models.PalletNo, status);
|
//if (lst.Count > 0)
|
//{
|
if (r)
|
{
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "状态可编辑");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
return Content(this.ReturnJson.ToString());
|
}
|
else
|
{
|
ReturnJson.AddProperty("Code", -1);
|
ReturnJson.AddProperty("Message", "状态不可编辑");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
return Content(this.ReturnJson.ToString());
|
}
|
//}
|
}
|
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "状态可编辑");
|
ReturnJson.AddProperty("SubCode", 0);
|
ReturnJson.AddProperty("SubMessage", "");
|
return Content(this.ReturnJson.ToString());
|
}
|
}
|
}
|