public RequestResult ScanCode(string barcode) { RequestResult result = new RequestResult(); try { List <BarCode> CodeList = ScaleOutStoke.GetCanRtnCode(MobileUser.UserName, barcode); if (CodeList != null && CodeList.Count > 0) { result.data = CodeList; result.message = "正确"; result.success = true; } else { result.message = "未找到条码,或者此条码你无权退货"; result.success = false; } } catch (Exception ex) { result.message = "失败,error:" + ex.Message; result.success = false; } return(result); }
public RequestResult OutStockCount(int pageindex, int pagesize, string startdate = "", string enddate = "", string keyword = "") { RequestResult result = new RequestResult(); try { int StartTimestamp = startdate != "" ? CommonFunc.GetTimestamp(Convert.ToDateTime(startdate + " 00:00:00")) : 0; int EndTimestamp = enddate != "" ? CommonFunc.GetTimestamp(Convert.ToDateTime(enddate + " 23:59:59")) : 0; int totalCount = 0; List <OutStokeRecord> CountList = ScaleOutStoke.GetOutStockCount(MobileUser.UserName, pagesize, pageindex, StartTimestamp, EndTimestamp, keyword, out totalCount); for (int i = 0; i < CountList.Count; i++) { CountList[i].ProductImg = WeConfig.b_domain + CountList[i].ProductImg; } result.data = CountList; result.pages = pageindex; result.total = totalCount; result.message = "成功"; result.success = true; } catch (Exception ex) { result.message = "失败,error:" + ex.Message; result.success = false; } return(result); }
private ActionResult GetOutStockCencusPages(OutStockCensusShow condition, string where) { PageJsonModel <OutStockCensus> page = new PageJsonModel <OutStockCensus>(); page.pageIndex = condition.pageIndex; page.pageSize = condition.pageSize; string strForm = ""; strForm = @"(select count(*) count,s.CreateTime,s.OutOrderNo,s.BigCode,s.MiddleCode,s.Consignee Consignee, s.Shipper Shipper,p.ProductName ProductName,p.ProductNumber ProductNumber " + "from ScaleOutStoke s left join Product p on s.ProductNo=p.ProductNumber where Shipper='总部' " + where; strForm += " group by s.CreateTime,s.OutOrderNo,s.BigCode,s.MiddleCode,s.Consignee,s.Shipper,p.ProductName,p.ProductNumber) as OutStockScaleShow left join C_User as c on c.UserName=OutStockScaleShow.Consignee"; page.strForm = strForm; page.strSelect = " OutStockScaleShow.*,c.Name C_Name "; if (string.IsNullOrWhiteSpace(condition.orderby) == false) { page.strOrder = Common.FilteSQLStr(condition.orderby); } else { page.strOrder = "OutStockScaleShow.CreateTime desc"; } page.LoadList(); if (page.pageResponse != null && page.pageResponse.RtnList != null && page.pageResponse.RtnList.Count > 0) { ScaleCodeCount OutCodeCount = ScaleOutStoke.GetC_UserOutCount(where); page.pageResponse.BigCount = OutCodeCount.BigCount; page.pageResponse.MiddleCount = OutCodeCount.MiddleCount; page.pageResponse.SmallCount = OutCodeCount.SmallCount; return(Json(page.pageResponse, JsonRequestBehavior.AllowGet)); } return(Json("", JsonRequestBehavior.AllowGet)); }
public ActionResult Index1(string ID) { try { string O_ID = "Beware of fake products without authorization"; string ProductNumber = "Beware of fake products without authorization"; string ProductName = "Beware of fake products without authorization"; string Name = "Beware of fake products without authorization"; string Province = "Beware of fake products without authorization"; string DatCreate = "Beware of fake products without authorization"; if (!string.IsNullOrWhiteSpace(ID)) { List <ScaleOutStoke> Scale = ScaleOutStoke.GetSmallScaleList(ID); if (Scale.Count > 0) { ScaleOutStokeShow show = ScaleOutStoke.GetProductC_UserByBig(ID); if (show != null) { Name = show.Name; ProductName = show.ProductName; ProductNumber = show.ProductNumber; O_ID = show.OutOrderNo; C_User user = C_User.GetC_UserByUserName(show.Consignee); Province = user == null ? "" : user.Province + user.City; DatCreate = CommonFunc.GetDateTimeFromTimestamp(show.CreateTime).ToString("yyyy-MM-dd"); } } else { ScaleOutStokeShow showbig = ScaleOutStoke.GetProductC_UserByBig(ID); if (showbig != null && showbig.Name != null && showbig.ProductName != null) { Name = showbig.Name; ProductName = showbig.ProductName; ProductNumber = showbig.ProductNumber; O_ID = showbig.OutOrderNo; C_User user = C_User.GetC_UserByUserName(showbig.Consignee); Province = user == null ? "" : user.Province + user.City; DatCreate = CommonFunc.GetDateTimeFromTimestamp(showbig.CreateTime).ToString("yyyy-MM-dd"); } } } ViewData["O_ID"] = O_ID; ViewData["ProductNumber"] = ProductNumber; ViewData["ProductName"] = ProductName; ViewData["Name"] = Name; ViewData["Province"] = Province; ViewData["DatCreate"] = DatCreate; } catch (Exception ex) { DAL.Log.Instance.Write(ex.Message, "查询出错!"); } return(View()); }
public ActionResult GetUpdateRtnScale(string Scale, string RtnOrderNo) { RequestResult result = new RequestResult(); bool IsOK = true; if (string.IsNullOrWhiteSpace(Scale)) { IsOK = false; result.message = "正确条码不能为空"; result.success = true; } if (IsOK) { List <BarCode> SmallCodeList = ScaleOutStoke.GetRtnStockID(CurrentUser.UserName, Scale); string IDSet = ""; foreach (BarCode b in SmallCodeList) { if (IDSet != "") { IDSet += ","; } IDSet += b.ID.ToString(); } if (IDSet != "") { RtnStockScale.ToRtnStockCode(CurrentUser.UserName, IDSet, RtnOrderNo); } result.data = SmallCodeList; result.message = "成功"; result.success = true; } //string[] Scales = Scale.Split(','); //string msg = string.Empty; //for (int i = 0; i < Scales.Length - 1; i++) //{ // if (RtnStockScale.GetBoolC_UserOutScale(CurrentUser.UserName, Scales[i].Trim()) != "ok") // { // msg += Scales[i].Trim() + "添加失败!"; // } // else // { // msg += "ok"; // } //} //if (string.IsNullOrWhiteSpace(msg) || msg.Contains("ok")) //{ // msg = "ok"; //} //return Content(msg); return(Json(result, JsonRequestBehavior.AllowGet)); }
public RequestResult RemoveBigCode(string code) { RequestResult result = new RequestResult(); try { List <Scale> scale = Scale.GetScaleForBig(code); if (scale.Count > 0) { if (scale.Where(sca => sca.IsOut == true && sca.OutWay == 3).Count() == 0) { result.message = "未使用大标出货"; result.success = false; } else if (ScaleOutStoke.IsSubOutStock_BigCode(code)) { result.message = "此条码下级已出货"; result.success = false; } else { Scale scaleDeal = scale.Where(sca => sca.IsOut == true && sca.OutWay == 3).FirstOrDefault(); scaleDeal.IsOut = false; scaleDeal.OutPDAUser = ""; // PdaUser.PUserName; scaleDeal.OutTime = 0; // CommonFunc.GetNowTimestamp(); scaleDeal.UserName = ""; scaleDeal.StateID = 6; scaleDeal.RemoveBigOut(); result.message = "成功"; result.success = true; } } else { result.code = 304; result.message = "条码不存在"; result.success = false; } PDALog.Write("撤消出货", "大标", code, PdaUser.PUserName + "-" + PdaUser.PRealName, string.Format("code:{0}", code), result.message); } catch (Exception ex) { result.code = 500; result.message = "服务出错"; result.success = false; DAL.Log.Instance.Write("撤消大标出货出错:" + ex.Message, "PDA上传出错"); } return(result); }
public RequestResult RemoveSmallCode(string code) { RequestResult result = new RequestResult(); try { Scale scale = Scale.GetScaleForSmall(code); if (scale != null) { if (!scale.IsOut) { result.message = "未出货"; result.success = false; } else if (ScaleOutStoke.IsSubOutStock_Small(code)) { result.message = "此条码下级已出货"; result.success = false; } else { scale.IsOut = false; scale.OutPDAUser = ""; // PdaUser.PUserName; scale.OutTime = 0; // CommonFunc.GetNowTimestamp(); scale.UserName = ""; scale.StateID = 6; scale.UpdateByID(); ScaleOutStoke.DeleteOutScaleRtnState(code); // 移除出货表记录 result.message = "成功"; result.success = true; } } else { result.code = 304; result.message = "条码不存在"; result.success = false; } PDALog.Write("撤消出货", "小标", code, PdaUser.PUserName + "-" + PdaUser.PRealName, string.Format("code:{0}", code), result.message); } catch (Exception ex) { result.code = 500; result.message = "服务出错"; result.success = false; DAL.Log.Instance.Write("撤消小标出货出错:" + ex.Message, "PDA上传出错"); } return(result); }
/// <summary> /// 不入库出货 /// </summary> /// <param name="ScaleOutStoke"></param> /// <returns></returns> public ActionResult NoOutStockInsert(ScaleOutStoke ScaleOutStoke) { List <Scale> BigScale = Scale.GetBigScaleList(ScaleOutStoke.Code); List <Scale> SmallScale = Scale.GetSmallScaleList(ScaleOutStoke.Code); List <Scale> CodeScale = new List <Scale>(); string msg = string.Empty; if (BigScale.Count > 0) { CodeScale = BigScale; } else if (SmallScale.Count > 0) { CodeScale = SmallScale; } else { return(Content("没有此条码!!")); } foreach (Scale item in CodeScale) { if (Scale.GetBoolInCode(item.SmallCode)) { msg += item.SmallCode + "条码已出库<br/>"; } else if (!ScaleOutStoke.GetInScale(item.SmallCode)) { ScaleOutStoke.BigCode = item.BigCode; ScaleOutStoke.SmallCode = item.SmallCode; ScaleOutStoke.AntiCode = item.AntiCode; ScaleOutStoke.Code = item.SmallCode; ScaleOutStoke.Shipper = "总部"; ScaleOutStoke.State = "启用"; ScaleOutStoke.InsertAndReturnIdentity(); Scale.GetUpdateScaleOutState(item.SmallCode); msg += item.SmallCode + "条码出货成功!<br/>"; } else { msg += item.SmallCode + "条码已出货!<br/>"; } } if (string.IsNullOrWhiteSpace(msg)) { msg = "条码已出货"; } return(Content(msg)); }
public RequestResult CheckMLBarCode(string BarCode, int type = 0) { RequestResult result = new RequestResult(); try { if (TB_BMCode.GetBoolBarCode(BarCode, type)) // 大标或中标是否存在 { result.message = "正常"; result.success = true; if (type == 1) { if (ScaleOutStoke.IsMiddleOutStock(BarCode)) { result.code = 304; result.message = "已出货,无法关联"; result.success = true; } } else if (type == 2) { if (ScaleOutStoke.IsBigOutStock(BarCode)) { result.code = 304; result.message = "已出货,无法关联"; result.success = true; } } } else { result.code = 304; result.message = "条码不存在"; result.success = false; } } catch (Exception ex) { result.code = 500; result.message = "服务出错"; result.success = false; DAL.Log.Instance.Write("检测中标或大标出错:" + ex.Message, "PDA上传出错"); } return(result); }
public ActionResult GetUpdateC_UserOutScale(string Agent, string Scale, string OutOrderNo) { RequestResult result = new RequestResult(); bool IsOK = true; if (string.IsNullOrWhiteSpace(Agent)) { IsOK = false; result.message = "姓名不能为空"; result.success = false; } if (string.IsNullOrWhiteSpace(Scale)) { IsOK = false; result.message = "正确条码不能为空"; result.success = false; } if (IsOK) { List <BarCode> SmallCodeList = ScaleOutStoke.GetOutStockID(CurrentUser.UserName, Scale); string IDSet = ""; foreach (BarCode b in SmallCodeList) { if (IDSet != "") { IDSet += ","; } IDSet += b.ID.ToString(); } if (IDSet != "") { ScaleOutStoke.ToOutStockAgent(CurrentUser.UserName, Agent, IDSet, OutOrderNo); } result.data = SmallCodeList; result.message = "成功"; result.success = true; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult GetBoolRtnScale(string ID) { RequestResult result = new RequestResult(); List <BarCode> CodeList = ScaleOutStoke.GetCanRtnCode(CurrentUser.UserName, ID); if (CodeList != null && CodeList.Count > 0) { result.data = CodeList; result.message = "正确"; result.success = true; } else { result.message = "未找到条码,或者此条码你无权退货"; result.success = false; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public RequestResult OutStockDetail(int pageindex, int pagesize, string outorderno, string productno, int timestamp, string consignee, string keyword = "") { RequestResult result = new RequestResult(); try { int totalCount = 0; List <ScaleCode_Simple> DetailList = ScaleOutStoke.GetOutStockDetail(MobileUser.UserName, outorderno, productno, pagesize, pageindex, timestamp, consignee, keyword, out totalCount); result.data = DetailList; result.pages = pageindex; result.total = totalCount; result.message = "成功"; result.success = true; } catch (Exception ex) { result.message = "失败,error:" + ex.Message; result.success = false; } return(result); }
public ContentResult DelOutStockCode(string CodeSet) { if (ScaleOutStoke.BatchIsSubOutStock(CodeSet)) { return(Content("有编码已出货下级,无法删除!")); } else { int iRet = Scale.BatchRemoveOutSmall(CodeSet); SYSLog.add("电脑端用户删除出货", "用户" + CurrentUser.Name + "(" + CurrentUser.UserName + ")删除了Code为(" + CodeSet + ")的条码入库,ip为" + Request.UserHostAddress, "/OutStock/DelOutStockCode", "删除出货", "电脑端后台"); if (iRet > 0) { return(Content("ok")); } else { return(Content("删除失败!")); } } }
public RequestResult SmallCodeToOutStock(string outorderno, string agent = "m2000") { RequestResult result = new RequestResult(); try { bool IsOK = true; IEnumerable <string> CodeArrayStr; Request.Headers.TryGetValues("CodeArrayStr", out CodeArrayStr); if (string.IsNullOrWhiteSpace(agent)) { IsOK = false; result.message = "经销商不能为空"; result.success = false; } if (CodeArrayStr.ToArray() == null || CodeArrayStr.ToArray()[0] == "") { IsOK = false; result.message = "正确条码不能为空"; result.success = false; } if (IsOK) { string[] codeArray = CodeArrayStr.ToArray()[0].Split(','); string SmallCodeArray = string.Empty; for (int i = 0; i < codeArray.Length; i++) { if (codeArray[i] != "") { if (SmallCodeArray != "") { SmallCodeArray += ","; } SmallCodeArray += "'" + codeArray[i] + "'"; } } if (string.IsNullOrEmpty(SmallCodeArray)) { result.message = "出货条码不能为空"; result.success = false; } else if (codeArray.Length > 1000) { result.message = "出货条码数量超出最大数量(1000)限制"; result.success = false; } else { List <BarCode> SmallCodeList = ScaleOutStoke.GetOutStockID(MobileUser.UserName, SmallCodeArray); string IDSet = ""; foreach (BarCode b in SmallCodeList) { if (IDSet != "") { IDSet += ","; } IDSet += b.ID.ToString(); } if (IDSet != "") { ScaleOutStoke.ToOutStockAgent(MobileUser.UserName, agent, IDSet, outorderno); } result.data = SmallCodeList; result.message = "成功"; result.success = true; } } } catch (Exception ex) { result.message = "失败,error:" + ex.Message; result.success = false; } return(result); }
public RequestResult InsertQuery(int FID, string AntiCode, string IP, string Province, string City, string Address, string Country = "") { DAL.Log.Instance.Write("FID:" + FID.ToString() + ",AntiCode:" + AntiCode + ",IP:" + IP + ",Country:" + Country + ",Province:" + Province + ",City:" + City + ",Address:" + Address, "防伪查询回调参数"); RequestResult result = new RequestResult(); try { SelScale selscale = new SelScale(); ScaleOutStoke Stoke = ScaleOutStoke.GetSmallScaleListcode(AntiCode); if (Stoke == null) { Scale scale = Scale.GetEntityByAntiCode(AntiCode); if (scale == null) { selscale.warning = "错误"; result.message = "错误"; result.success = true; } else if (!scale.IsOut) { selscale.warning = "未出货"; result.message = "未出货"; result.success = true; } else { selscale.warning = "异常"; result.message = "异常"; result.success = true; } } else if (Province == "未知" || City == "未知") { selscale.warning = "异常"; result.message = "异常"; result.success = true; } else { C_User user = new C_User(); if (Stoke.Consignee == "m2000") { //查到出货人信息 user = C_User.GetC_UserByUserName(Stoke.Shipper); if (user != null) { if (user.Province != Province) { selscale.warning = "窜货"; } else { selscale.warning = "正常"; } } else { selscale.warning = "异常"; } } else { user = C_User.GetC_UserByUserName(Stoke.Consignee); if (user != null) { if (user.Province != Province) { selscale.warning = "窜货"; } else { selscale.warning = "正常"; } } else { selscale.warning = "异常"; } } result.message = "成功"; result.success = true; } selscale.warning = string.IsNullOrWhiteSpace(selscale.warning) ? "未知" : selscale.warning; selscale.Country = Country; selscale.province = Province; selscale.city = City; selscale.IP = IP; selscale.FID = FID; selscale.AntiCode = AntiCode; selscale.Address = Address; selscale.CreateTime = CommonFunc.GetNowTimestamp(); selscale.InsertAndReturnIdentity(); } catch (Exception ex) { DAL.Log.Instance.Write(ex.Message, "防伪查询回调出错"); result.message = "失败,error:" + ex.Message; result.success = false; } return(result); }
public ActionResult Index(string ID) { try { // string O_ID = "", ProductNumber = "", ProductName = "", Name = "", Province = "", DatCreate = "", kw = "", ProductImg = ""; string O_ID = "产品未经授权,谨防假冒!"; string ProductNumber = "产品未经授权,谨防假冒!"; string ProductName = "产品未经授权,谨防假冒!"; string Name = "产品未经授权,谨防假冒!"; string Province = "产品未经授权,谨防假冒!"; string DatCreate = "产品未经授权,谨防假冒!"; string kw = "产品未经授权,谨防假冒!"; string ProductImg = ""; string ycd = "产品未经授权,谨防假冒!"; string zzs = "产品未经授权,谨防假冒!"; if (!string.IsNullOrWhiteSpace(ID)) { List <ScaleOutStoke> Scale = ScaleOutStoke.GetSmallScaleList(ID); if (Scale.Count > 0) { ScaleOutStokeShow show = ScaleOutStoke.GetProductC_UserByBig(ID); if (show != null) { Name = show.Name; ProductName = show.ProductName; ProductNumber = show.ProductNumber; ProductImg = show.ProductImg; O_ID = show.OutOrderNo; kw = show.kw.ToString(); ycd = "中国"; zzs = "zunko"; C_User user = C_User.GetC_UserByUserName(show.Consignee); Province = user == null ? "" : user.Province + user.City; DatCreate = CommonFunc.GetDateTimeFromTimestamp(show.CreateTime).ToString("yyyy-MM-dd"); DAL.Log.Instance.Write(" " + show.CreateTime + " || " + DatCreate, "111111"); } } else { ScaleOutStokeShow showbig = ScaleOutStoke.GetProductC_UserByBig(ID); if (showbig != null && showbig.Name != null && showbig.ProductName != null) { Name = showbig.Name; ProductName = showbig.ProductName; ProductNumber = showbig.ProductNumber; ProductImg = showbig.ProductImg; O_ID = showbig.OutOrderNo; kw = showbig.kw.ToString(); ycd = "中国"; zzs = "zunko"; C_User user = C_User.GetC_UserByUserName(showbig.Consignee); Province = user == null ? "" : user.Province + user.City; DatCreate = CommonFunc.GetDateTimeFromTimestamp(showbig.CreateTime).ToString("yyyy-MM-dd"); DAL.Log.Instance.Write(" " + showbig.CreateTime + " || " + DatCreate, "111111"); } } } /*if (string.IsNullOrWhiteSpace(O_ID) && string.IsNullOrWhiteSpace(ProductName)) * { * return Redirect("/cuanhuo/pre?Error=1"); * }*/ ViewData["O_ID"] = O_ID; ViewData["ProductNumber"] = ProductNumber; ViewData["ProductName"] = ProductName; ViewData["Name"] = Name; ViewData["ProductImg"] = ProductImg; ViewData["Province"] = Province; ViewData["DatCreate"] = DatCreate; ViewData["kw"] = kw; ViewData["ycd"] = ycd; ViewData["zzs"] = zzs; } catch (Exception ex) { DAL.Log.Instance.Write(ex.Message, "防窜货查询出错!"); } return(View()); }
public ActionResult TrackDetail(string SmallCode) { List <TrackCode> ListTrack = new List <TrackCode>(); Scale smallTrack = Scale.GetScaleSmallCode(SmallCode); List <ScaleOutStoke> smallOutTrackList = ScaleOutStoke.GetSmallCodeList(SmallCode); List <ScaleRtnStoke> smallRtnTrackList = ScaleRtnStoke.GetSmallCodeList(SmallCode); string ProductNo = ""; string ProductName = ""; if (!string.IsNullOrWhiteSpace(smallTrack.ProductNo)) { Product product = Product.GetProductNo(smallTrack.ProductNo); ProductNo = product.ProductNumber; ProductName = product.ProductName; } string PDAUserSet = ""; string AgentUser = ""; string BoxType = "中箱"; if (!PDAUserMsg.Param.MiddlePacking) { BoxType = "大箱"; } if (!string.IsNullOrWhiteSpace(smallTrack.IntoPDAUser)) { PDAUserSet += "'" + smallTrack.IntoPDAUser + "',"; } if (!string.IsNullOrWhiteSpace(smallTrack.LinkBigPDAUser)) { PDAUserSet += "'" + smallTrack.LinkBigPDAUser + "',"; } if (!string.IsNullOrWhiteSpace(smallTrack.LinkMidPDAUser)) { PDAUserSet += "'" + smallTrack.LinkMidPDAUser + "',"; } if (!string.IsNullOrWhiteSpace(smallTrack.OutPDAUser)) { PDAUserSet += "'" + smallTrack.OutPDAUser + "',"; } if (PDAUserSet != "") { PDAUserSet = PDAUserSet.Substring(0, PDAUserSet.Length - 1); } List <PDAUser> pdauser = new List <PDAUser>(); if (PDAUserSet != "") { pdauser = PDAUser.GetUserNameSet(PDAUserSet); } foreach (ScaleOutStoke outUser in smallOutTrackList) { AgentUser += "'" + (outUser.Shipper != "总部" ? outUser.Shipper : "") + "',"; AgentUser += "'" + outUser.Consignee + "',"; } foreach (ScaleRtnStoke rtnUser in smallRtnTrackList) { if (!string.IsNullOrWhiteSpace(rtnUser.Shipper) && rtnUser.Shipper != "总部") { AgentUser += "'" + rtnUser.Shipper + "',"; } if (!string.IsNullOrWhiteSpace(rtnUser.Consignee)) { AgentUser += "'" + rtnUser.Consignee + "',"; } } if (AgentUser != "") { AgentUser = AgentUser.Substring(0, AgentUser.Length - 1); } List <C_User> UserList = new List <C_User>(); if (AgentUser != "") { UserList = C_User.GetUserSet(AgentUser); } #region 关联记录 if (smallTrack.IsLinkMid) { TrackCode track = new TrackCode(); track.ITime = smallTrack.LinkMidTime; track.STitle = "小标装箱"; PDAUser PMUser = pdauser.Where(u => u.PUserName == smallTrack.LinkMidPDAUser).FirstOrDefault(); track.SContent = "操作员:" + smallTrack.LinkMidPDAUser + (PMUser != null ? "-" + PMUser.PRealName : "") + ",将产品码(" + smallTrack.SmallCode + ")装入" + BoxType + "(" + smallTrack.MiddleCode + ")"; if (PDAUserMsg.Param.IsLinkProduct) { track.SContent += ",关联产品为:" + ProductNo + "-" + ProductName; } ListTrack.Add(track); } if (smallTrack.IsLinkBig) { TrackCode track = new TrackCode(); track.ITime = smallTrack.LinkBigTime; track.STitle = "中标装箱"; PDAUser PBUser = pdauser.Where(u => u.PUserName == smallTrack.LinkBigPDAUser).FirstOrDefault(); track.SContent = "操作员:" + smallTrack.LinkBigPDAUser + (PBUser != null ? "-" + PBUser.PRealName : "") + ",将中箱码(" + smallTrack.MiddleCode + ")装入大箱(" + smallTrack.BigCode + ")"; if (PDAUserMsg.Param.IsLinkProduct) { track.SContent += ",关联产品为:" + ProductNo + "-" + ProductName; } ListTrack.Add(track); } #endregion #region 入库记录 if (smallTrack.IsInto) { TrackCode track = new TrackCode(); track.ITime = smallTrack.IntoTime; track.STitle = "产品入库"; PDAUser PIUser = pdauser.Where(u => u.PUserName == smallTrack.IntoPDAUser).FirstOrDefault(); string BarCode = smallTrack.IsLinkBig ? smallTrack.BigCode : smallTrack.IsLinkMid ? smallTrack.MiddleCode : smallTrack.SmallCode; string CodeType = "箱码"; if (BarCode == smallTrack.SmallCode) { CodeType = "产品码"; } track.SContent = "操作员:" + smallTrack.IntoPDAUser + (PIUser != null ? "-" + PIUser.PRealName : "") + ",将" + CodeType + "(" + BarCode + ")入库"; if (PDAUserMsg.Param.IsIntoProduct) { track.SContent += ",入库产品为:" + ProductNo + "-" + ProductName; } ListTrack.Add(track); } #endregion #region 所有出货记录(包含经销商) foreach (ScaleOutStoke outcode in smallOutTrackList) { TrackCode track = new TrackCode(); track.ITime = outcode.CreateTime; track.STitle = (outcode.Shipper == "总部" ? outcode.Shipper : "经销商") + "产品出货"; C_User OUser = UserList.Where(u => u.UserName == outcode.Consignee).FirstOrDefault(); C_User OUserShipper = UserList.Where(u => u.UserName == outcode.Shipper).FirstOrDefault(); track.SContent = outcode.Shipper + (OUserShipper != null ? "-" + OUserShipper.Name : "") + ">出货>" + outcode.Consignee + (OUser != null ? "-" + OUser.Name : "") + "<br>"; track.SContent += "出货单号:" + outcode.OutOrderNo; PDAUser POUser = pdauser.Where(u => u.PUserName == smallTrack.OutPDAUser).FirstOrDefault(); if (outcode.Shipper == "总部") { track.SContent += ",操作员:" + smallTrack.OutPDAUser + "-" + (POUser != null ? "-" + POUser.PRealName : ""); } if (PDAUserMsg.Param.IsOutProduct) { track.SContent += ",出货产品为:" + ProductNo + "-" + ProductName; } ListTrack.Add(track); } #endregion #region 退货记录 foreach (ScaleRtnStoke rtncode in smallRtnTrackList) { TrackCode track1 = new TrackCode(); track1.ITime = rtncode.OutTime; track1.STitle = (rtncode.Shipper == "总部" ? rtncode.Shipper : "经销商") + "产品出货"; C_User RUserShipper = UserList.Where(u => u.UserName == rtncode.Shipper).FirstOrDefault(); C_User RUserConsignee = UserList.Where(u => u.UserName == rtncode.Consignee).FirstOrDefault(); track1.SContent = rtncode.Shipper + (RUserShipper != null ? "-" + RUserShipper.Name : "") + ">出货>" + rtncode.Consignee + (RUserConsignee != null ? "-" + RUserConsignee.Name : "") + "<br>"; track1.SContent += "出货单号:" + rtncode.OutOrderNo; if (rtncode.Shipper == "总部") { track1.SContent += ",操作员:" + smallTrack.OutPDAUser + "-" + pdauser.Where(u => u.PUserName == smallTrack.OutPDAUser).FirstOrDefault().PRealName; } ListTrack.Add(track1); TrackCode track2 = new TrackCode(); track2.ITime = rtncode.ReturnTime; track2.STitle = "产品退货" + (rtncode.Shipper == "总部" ? rtncode.Shipper : "经销商"); track2.SContent = rtncode.Consignee + (RUserConsignee != null ? "-" + RUserConsignee.Name : "") + ">退货>" + rtncode.Shipper + (RUserShipper != null ? "-" + RUserShipper.Name : "") + "<br>"; track2.SContent += "退货单号 " + rtncode.OrderNo; ListTrack.Add(track2); } #endregion ViewData["BigCode"] = smallTrack.BigCode; ViewData["MiddleCode"] = smallTrack.MiddleCode; ViewData["SmallCode"] = smallTrack.SmallCode; ViewData["CodeTrack"] = ListTrack.OrderBy(m => m.ITime).ToList(); ViewData["ProductNo"] = ProductNo; ViewData["ProductName"] = ProductName; return(View()); }
public ActionResult SalesOrder(int Year) { ScaleOutStoke ordersale = new ScaleOutStoke(); return(Content(ordersale.GetSalesOrder(Year))); }
public RequestResult SmallCode(string code, string username, string orderno = "", string pno = "") { RequestResult result = new RequestResult(); try { if (PDAUserMsg.Param.IsOut && PDAUserMsg.Param.SmallOut) { if (string.IsNullOrWhiteSpace(pno) && PDAUserMsg.Param.IsOutProduct) { result.message = "请选择产品"; result.success = false; } else if (C_User.IsSysUser(username)) { Scale scale = Scale.GetScaleForSmall(code); if (scale != null) { if (scale.IsOut) { result.message = "重复出货"; result.success = false; } else if (!scale.IsInto && PDAUserMsg.Param.IsInto && (PDAUserMsg.Param.ScanProcess == 1 || PDAUserMsg.Param.ScanProcess == 2 || PDAUserMsg.Param.ScanProcess == 3 || PDAUserMsg.Param.ScanProcess == 4)) { result.message = "未入库"; result.success = false; } else if (!string.IsNullOrWhiteSpace(scale.ProductNo) && !string.IsNullOrWhiteSpace(pno) && pno != scale.ProductNo) { result.message = "出货产品错误"; result.success = false; } else { scale.IsOut = true; scale.OutPDAUser = PdaUser.PUserName; scale.UserName = username; scale.OutOrderNo = orderno; if (!string.IsNullOrWhiteSpace(pno)) { scale.ProductNo = pno; } scale.OutTime = CommonFunc.GetNowTimestamp(); scale.OutWay = 1; scale.StateID = 7; scale.UpdateByID(); ScaleOutStoke scaleOut = new ScaleOutStoke(); scaleOut.BigCode = scale.BigCode; scaleOut.SmallCode = scale.SmallCode; scaleOut.MiddleCode = scale.MiddleCode; scaleOut.AntiCode = scale.AntiCode; scaleOut.Shipper = "总部"; scaleOut.ProductNo = scale.ProductNo; scaleOut.Consignee = scale.UserName; scaleOut.State = "启用"; scaleOut.CreateTime = CommonFunc.GetNowTimestamp(); scaleOut.OutOrderNo = orderno; scaleOut.OutWay = 1; scaleOut.InsertAndReturnIdentity(); result.message = "成功"; result.success = true; } } else { result.code = 304; result.message = "条码不存在"; result.success = false; } } else { result.code = 504; result.message = "客户错误"; result.success = false; } } else { result.code = 704; result.message = "此出货功能已被禁用,请在管理后台开启。"; result.success = false; } PDALog.Write("小标出货", "小标", code, PdaUser.PUserName + "-" + PdaUser.PRealName, string.Format("code:{0}, pno:{1}, orderno:{2},username:{3}", code, pno, orderno, username), result.message); } catch (Exception ex) { result.code = 500; result.message = "服务出错"; result.success = false; DAL.Log.Instance.Write("小标出货错误:" + ex.Message, "PDA上传出错"); } return(result); }
public ActionResult AntiFakeSel(string ID) { string ip = System.Web.HttpContext.Current.Request.ServerVariables.Get("Remote_Addr").ToString(); ModelQueryParam queryip = new ModelQueryParam(); queryip = GetAddress(ip); string province = queryip.Province; string city = queryip.City; string msg = "此防伪码不存在,请您检查标签,确认防伪码是否输入正确,然后再请您试一次。"; Scale scake = Scale.GetCAntiFake(ID); SelScale.GetSelScale(); int countto = 0; //string img = ""; if (scake != null) { int count = 0; // scake.SelCount + 1; if (count == 1) { DateTime time = DateTime.Now; msg = "此防伪码有效,您购买的是深圳市通程防伪科技有限公司所生产的正牌产品,请放心使用!"; //scake.SelectDate = time; SelScale selscale = new SelScale(); //查到当前标签的出货记录 ScaleOutStoke Stoke = ScaleOutStoke.GetSmallScaleListcode(ID); if (Stoke != null) { C_User user = new C_User(); if (Stoke.Consignee == "m2000") { //查到出货人信息 user = C_User.GetC_UserByUserName(Stoke.Shipper); if (user.Province != province) { selscale.warning = "窜货"; } else { selscale.warning = "正常"; } selscale.Address = user.Province + user.City; } else { user = C_User.GetC_UserByUserName(Stoke.Consignee); if (user.Province != province) { selscale.warning = "窜货"; } else { selscale.warning = "正常"; } selscale.Address = user.Province + user.City; } } selscale.province = province; selscale.city = city; selscale.IP = ip; selscale.AntiCode = ID; selscale.InsertAndReturnIdentity(); } else { msg = "注意!此防伪码有效,但已被查询" + count + "次"; } scake.UpdateByID(); countto = count; return(Content(countto + "|" + msg + "|" + scake.CreateTime)); } return(Content(countto + "|" + msg)); }