123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- using System;
- using System.Web;
- using System.Collections.Generic;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.AspNetCore.Http;
- using MySystem.Models.Main;
- using Library;
- using System.Linq;
- using LitJson;
- using Microsoft.AspNetCore.Authorization;
- using MySystem.Service.Main;
- namespace MySystem.Areas.Api.Controllers.v1
- {
- [Area("Api")]
- [Route("Api/v1/[controller]/[action]")]
- public class StoreStockChangeController : BaseController
- {
- public StoreStockChangeController(IHttpContextAccessor accessor) : base(accessor)
- {
- }
- #region 首页-仓库管理-整箱划拨
- /// <summary>
- /// 首页-仓库管理-整箱划拨
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- [Authorize]
- [Route("/main/storestockchange/transferwholeorone")]
- public JsonResult TransferWholeOrOne(string value)
- {
- value = PublicFunction.DesDecrypt(value);
- JsonData data = JsonMapper.ToObject(value);
- int OrderId = int.Parse(function.CheckInt(data["OrderId"].ToString())); //订单Id
- int StoreId = int.Parse(function.CheckInt(data["StoreId"].ToString())); //仓库
- int ToUserId = int.Parse(function.CheckInt(data["ToUserId"].ToString())); //收货人
- string SnIds = data["SnIds"].ToString(); //机具SN的Id集合
- var info = StoreStockChangeUtil.TransferWholeOrOneDo(OrderId, StoreId, ToUserId, SnIds);
- if (info == "success")
- {
- return Json(new AppResultJson() { Status = "1", Info = "划拨成功", Data = "" });
- }
- else
- {
- return Json(new AppResultJson() { Status = "-1", Info = "划拨失败", Data = info });
- }
- }
- #endregion
- // #region 首页-仓库管理-逐台划拨
- // /// <summary>
- // /// 首页-仓库管理-逐台划拨
- // /// </summary>
- // /// <returns></returns>
- // [HttpPost]
- // [Authorize]
- // [Route("/main/storestockchange/transferone")]
- // public JsonResult TransferOne(string value)
- // {
- // value = PublicFunction.DesDecrypt(value);
- // JsonData data = JsonMapper.ToObject(value);
- // int OrderId = int.Parse(function.CheckInt(data["OrderId"].ToString())); //订单Id
- // int StoreId = int.Parse(function.CheckInt(data["StoreId"].ToString())); //仓库
- // int ToUserId = int.Parse(function.CheckInt(data["ToUserId"].ToString())); //收货人
- // string SnIds = data["SnIds"].ToString(); //机具SN的Id集合
- // return Json(new AppResultJson() { Status = "1", Info = "", Data = "" });
- // }
- // #endregion
- #region 首页-仓库管理-售后单划拨
- /// <summary>
- /// 首页-仓库管理-售后单划拨
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- [Authorize]
- [Route("/main/storestockchange/transferforchange")]
- public JsonResult TransferForChange(string value)
- {
- value = PublicFunction.DesDecrypt(value);
- JsonData data = JsonMapper.ToObject(value);
- int OrderId = int.Parse(function.CheckInt(data["OrderId"].ToString())); //订单Id
- int StoreId = int.Parse(function.CheckInt(data["StoreId"].ToString())); //仓库
- string SnIds = data["SnIds"].ToString(); //机具SN的Id集合
- var info = StoreStockChangeUtil.TransferForChangeDo(OrderId, StoreId, SnIds);
- if (info == "success")
- {
- return Json(new AppResultJson() { Status = "1", Info = "划拨成功", Data = "" });
- }
- else
- {
- return Json(new AppResultJson() { Status = "-1", Info = "划拨失败", Data = info });
- }
- }
- #endregion
- }
- }
|