123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- 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 PreSendStockDetailController : BaseController
- {
- public PreSendStockDetailController(IHttpContextAccessor accessor) : base(accessor)
- {
- }
- #region 创客-首页-仓库管理-小分仓-确认发货
-
-
-
-
- [HttpPost]
- [Authorize]
- [Route("/main/presendstockdetail/send")]
- public JsonResult Send(string value)
- {
- value = PublicFunction.DesDecrypt(value);
- JsonData data = JsonMapper.ToObject(value);
- int UserId = int.Parse(function.CheckInt(data["UserId"].ToString()));
- int ToUserId = int.Parse(function.CheckInt(data["ToUserId"].ToString()));
- int FromStoreId = int.Parse(function.CheckInt(data["FromStoreId"].ToString()));
- int BrandId = int.Parse(function.CheckInt(data["BrandId"].ToString()));
- string SnIds = data["SnIds"].ToString();
- if (ToUserId <= 0)
- {
- return Json(new AppResultJson() { Status = "-1", Info = "收货创客不存在,请检查收货创客编号是否正确" });
- }
- var info = PreSendStockDetailUtil.SendDo(UserId, ToUserId, FromStoreId, BrandId, SnIds);
- if (info == "success")
- {
- return Json(new AppResultJson() { Status = "1", Info = "发货成功", Data = "" });
- }
- else
- {
- return Json(new AppResultJson() { Status = "-1", Info = "发货失败", Data = info });
- }
- }
- #endregion
- #region 创客-首页-仓库管理-小分仓-撤回
-
-
-
-
- [HttpPost]
- [Authorize]
- [Route("/main/presendstockdetail/cancel")]
- public JsonResult Cancel(string value)
- {
- value = PublicFunction.DesDecrypt(value);
- JsonData data = JsonMapper.ToObject(value);
- int UserId = int.Parse(function.CheckInt(data["UserId"].ToString()));
- int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
- string check = RedisDbconn.Instance.Get<string>("SmallStoreCancel:" + UserId);
- if (!string.IsNullOrEmpty(check))
- {
- return Json(new AppResultJson() { Status = "-1", Info = "请勿频繁操作,稍后再试" });
- }
- var info = PreSendStockDetailUtil.CancelDo(UserId, Id);
- if (info == "success")
- {
- return Json(new AppResultJson() { Status = "1", Info = "撤回成功", Data = "" });
- }
- else
- {
- return Json(new AppResultJson() { Status = "-1", Info = "撤回失败", Data = info });
- }
- }
- #endregion
- }
- }
|