using DSWeb.Areas.Storage.DB;
using DSWeb.Areas.Storage.Models;
using System.Web.Mvc;
using System.Linq;
using System.Configuration;
using DSWeb.Areas.Storage.Helper;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Web;
using System.Globalization;
using DSWeb.Areas.Dispatch.Controllers;
using DSWeb.Storage.DAL;
using log4net;
using HcUtility.Comm;
using DSWeb.SoftMng.BLL;
using DSWeb.SoftMng.Model;
using DSWeb.SoftMng.Common;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.Areas.Dispatch.DB;
namespace DSWeb.Areas.Storage.Controllers
{
public class StorageController: Controller
{
private static readonly string StateKeyRegist = "regist";
//private static readonly string StateKeyDispatchList = "dispatchlist";
//private static readonly string StateKeyGrabList = "grablist";
//private static readonly string StateKeyFeeList = "feelist";
private static readonly string StateKeyRegistCust = "registCust";
private static readonly string StateKeyStockList = "stocklist"; //裕龙库存查询
private static readonly string StateKeyStorageList = "storagelist";// 裕龙 出入库
private static readonly string StateKeyKucunList = "kucunlist"; //裕龙库存查询
private static readonly string StateKeyRegistCustHJ = "registCustHJ"; //裕龙注册(新仓储通用)
private static readonly string StateKeyKucunList2 = "kucunlist2"; //裕龙库存查询
private static string appid = ConfigurationManager.AppSettings["YuLongStorageAppId"];
private static string appsecret = ConfigurationManager.AppSettings["secret"];
private static string dispatchServerUrl = ConfigurationManager.AppSettings["BeitongDispatchServerUrl"];
private static string storageServerUrl = ConfigurationManager.AppSettings["YuLongStorageServerUrl"];
private ILog logger = LogManager.GetLogger("StorageController");
private Storage.DB. DataContext dataContext = new Storage.DB.DataContext();
public StorageController()
{
//var config = dataContext.MpConfigs.FirstOrDefault(c => c.AppId == appid);
//if (config == null)
//{
// throw new Exception($"未找到公众号(ID: {appid}) 的配置记录,请配置后再试!");
//}
//appsecret = config.AppSecret;
}
#region 出入库查询
public ActionResult StorageList(string OPENID)
{
ViewData["openid"] = OPENID;
return View();
}
#endregion
#region 查询入库
//public ActionResult InDoList(string mblno)
//{
// var indoinfo = dataContext.IndoInfo.FirstOrDefault(d => d.MBLNO == mblno);
// if (indoinfo == null)
// {
// return RedirectToAction("DispInfoClientRegist", new { mblno });
// }
// ViewData["mblno"] = mblno;
// return View();
//}
[HttpPost]
public JsonResult InDoListData(string openid,string mblno, int page = 1, int pageSize = 10)
{
RespGetIndo resp = new RespGetIndo();
//var infoClient = dataContext.IndoInfo.FirstOrDefault(d => d.MBLNO == mblno);
var dataList = MsWMSDAL.GetIndoDataList(mblno, null, null);
//var list = dataList.Skip((page - 1) * pageSize).Take(pageSize);
resp.Success = true;
resp.Message = "查询成功";
resp.Data = dataList.ToList();
resp.Total = dataList.Count;
return Json(resp);
}
#endregion
#region 查询出库
//public ActionResult OutDoList(string mblno)
//{
// var indoinfo = dataContext.OutdoInfo.FirstOrDefault(d => d.MBLNO == mblno);
// ViewData["mblno"] = mblno;
// return View();
//}
[HttpPost]
public JsonResult OutDoListData(string openid, string mblno, int page = 1, int pageSize = 10)
{
RespGetOutdo resp = new RespGetOutdo();
//var infoClient = dataContext.OutdoInfo.FirstOrDefault(d => d.MBLNO == mblno);
var dataList = MsWMSDAL.GetOutdoDataList(mblno, null, null);
//var list = dataList.Skip((page - 1) * pageSize).Take(pageSize);
resp.Success = true;
resp.Message = "查询成功";
resp.Data = dataList.ToList();
resp.Total = dataList.Count;
return Json(resp);
}
#endregion
#region 入库委托详情
public ActionResult StorageInDetail(string wmsid)
{
ViewData["wmsid"] = wmsid;
return View();
}
public ActionResult StorageInDetailData(string wmsid)
{
var model = MsWMSDAL.GetOneIndoByWMSID(wmsid);
var obj = new
{
model.WMSID,
model.MBLNO,
model.DODATE,
model.GOODSNAME,
model.PKGS,
model.KGS
// FEE_LIST = dataList,
//STATE_LIST = staList
};
return Json(obj);
}
#endregion
#region 出库委托详情
public ActionResult StorageOutDetail(string wmsid)
{
ViewData["wmsid"] = wmsid;
return View();
}
public ActionResult StorageOutDetailData(string wmsid)
{
var model = MsWMSDAL.GetOneOutdoByWMSID(wmsid);
var obj = new
{
model.WMSID,
model.MBLNO,
model.DODATE,
model.GOODSNAME,
model.PKGS,
model.KGS
// FEE_LIST = dataList,
//STATE_LIST = staList
};
return Json(obj);
}
#endregion
#region 库存查询
[HttpPost]
public JsonResult StorageData(string openid, string mblno, int page = 1, int pageSize = 10)
{
RespGetKuCun resp = new RespGetKuCun();
//var infoClient = dataContext.IndoInfo.FirstOrDefault(d => d.MBLNO == mblno);
var condition = "";
if (!string.IsNullOrWhiteSpace(mblno))
{
condition = " MBLNO like '%" + mblno + "'";
}
var dataList = MsWMSDAL.GetKuCunDataList(openid, condition, null);
//var list = dataList.Skip((page - 1) * pageSize).Take(pageSize);
resp.Success = true;
resp.Message = "查询成功";
resp.Data = dataList.ToList();//暂不进行分页
resp.Total = dataList.Count;
return Json(resp, JsonRequestBehavior.AllowGet);
}
[HttpPost]
public JsonResult StorageData2(string openid, string mblno, string goodsfeetype, string goodsowner, int page = 1, int pageSize = 10)
{
RespGetKuCun resp = new RespGetKuCun();
//var infoClient = dataContext.IndoInfo.FirstOrDefault(d => d.MBLNO == mblno);
var condition = " 1=1 ";
if (!string.IsNullOrWhiteSpace(mblno))
{
condition += " and MBLNO like '%" + mblno + "'";
}
if (!string.IsNullOrWhiteSpace(goodsfeetype))
{
condition += " and goodsfeetype like '%" + goodsfeetype + "%'";
}
if (!string.IsNullOrWhiteSpace(goodsowner))
{
condition += " and goodsowner like '%" + goodsowner + "'";
}
var dataList = MsWMSDAL.GetKuCunDataList(openid, condition, null);
//var list = dataList.Skip((page - 1) * pageSize).Take(pageSize);
resp.Success = true;
resp.Message = "查询成功";
resp.Data = dataList.ToList();//暂不进行分页
resp.Total = dataList.Count;
return Json(resp, JsonRequestBehavior.AllowGet);
}
///
|
南
↑
↓
北
6号门
|
|
|
南
↑
↓
北
5号门
|
|
|
南
↑
↓
北
4号门
|
|
|
南
↑
↓
北
3号门
|
|
|
南
↑
↓
北
2号门
|
|
|
南
↑
↓
北
1号门
|
|