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; 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 StateKeyStorageList = "storagelist"; private static readonly string StateKeyStockList = "stocklist"; //裕龙库存查询 private static readonly string StateKeyKucunList = "kucunlist"; //裕龙库存查询 private static readonly string StateKeyRegistCustHJ = "registCustHJ"; //裕龙注册 private static string appid = ConfigurationManager.AppSettings["YuLongStorageAppId"]; private static string appsecret = string.Empty; private static string dispatchServerUrl = ConfigurationManager.AppSettings["BeitongDispatchServerUrl"]; private static string storageServerUrl = ConfigurationManager.AppSettings["YuLongStorageServerUrl"]; private ILog logger = LogManager.GetLogger("StorageController"); private DataContext dataContext = new 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 = list.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 = list.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, int page = 1, int pageSize = 10) { RespGetKuCun resp = new RespGetKuCun(); //var infoClient = dataContext.IndoInfo.FirstOrDefault(d => d.MBLNO == mblno); var dataList = MsWMSDAL.GetKuCunDataList(openid, null, null); var list = dataList.Skip((page - 1) * pageSize).Take(pageSize); resp.Success = true; resp.Message = "查询成功"; resp.Data = list.ToList(); resp.Total = dataList.Count; return Json(resp, JsonRequestBehavior.AllowGet); } public JsonResult DQStorageData(string openid, int page = 1, int pageSize = 10) { RespGetKuCun resp = new RespGetKuCun(); //var infoClient = dataContext.IndoInfo.FirstOrDefault(d => d.MBLNO == mblno); var dataList = MsWMSDAL.GetDQKuCunDataList(openid, null, null); var list = dataList.Skip((page - 1) * pageSize).Take(pageSize); resp.Success = true; resp.Message = "查询成功"; resp.Data = list.ToList(); resp.Total = dataList.Count; return Json(resp, JsonRequestBehavior.AllowGet); } public ActionResult KucunList(string openid) { ViewData["openid"] = openid; return View(); } public ActionResult StorageMap(string STOREHOUSE,string AREACODE) { ViewData["STOREHOUSE"] = STOREHOUSE; ViewData["AREACODE"] = AREACODE; //var MapHtml = GetMapHtml(STOREHOUSE, AREACODE); //ViewData["MapHtml"] = MapHtml; return View(); } public ActionResult StorageMapstr(string STOREHOUSE, string AREACODE,string GOODSINFO) { //ViewData["STOREHOUSE"] = STOREHOUSE; //ViewData["AREACODE"] = AREACODE; var MapHtml = GetMapHtml(STOREHOUSE, AREACODE, GOODSINFO); //ViewData["MapHtml"] = MapHtml; return Content(MapHtml); } private string GetMapHtml(string STOREHOUSE, string AREACODE, string GOODSINFO) { string result = ""; result = GetMapDetail(STOREHOUSE); //然后寻找这个AREACODE所在的单元 将它所在的格设置成红色 SetAreacodeColor(ref result,AREACODE, GOODSINFO); result = GetBaseHtml(result); return result; } private string GetMapDetail(string STOREHOUSE) { string result = ""; //if (STOREHOUSE == "0001")// 00050036 //{ result = @"
|
南
↑
↓
北
6号门
|
|
|
南
↑
↓
北
5号门
|
|
|
南
↑
↓
北
4号门
|
|
|
南
↑
↓
北
3号门
|
|
|
南
↑
↓
北
2号门
|
|
|
南
↑
↓
北
1号门
|
|