ApplyMachineController.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Data;
  5. using Microsoft.AspNetCore.Mvc;
  6. using Microsoft.AspNetCore.Http;
  7. using Microsoft.Extensions.Logging;
  8. using Microsoft.Extensions.Options;
  9. using Microsoft.AspNetCore.Authorization;
  10. using System.Web;
  11. using MySystem.MainModels;
  12. using LitJson;
  13. using Library;
  14. using System.Text;
  15. /// <summary>
  16. /// 分仓向总仓申请机具接口
  17. /// </summary>
  18. namespace MySystem.Areas.Api.Controllers.v1
  19. {
  20. [Area("Api")]
  21. [Route("/Api/v1/[controller]/[action]")]
  22. public class ApplyMachineController : BaseController
  23. {
  24. public ApplyMachineController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
  25. {
  26. }
  27. // #region 创客-首页-仓库管理-仓库列表
  28. // /// <summary>
  29. // /// 创客仓库列表
  30. // /// </summary>
  31. // /// <param name="value"></param>
  32. // /// <returns></returns>
  33. // [Authorize]
  34. // public JsonResult StoreHouseList(string value)
  35. // {
  36. // value = DesDecrypt(value);
  37. // JsonData data = JsonMapper.ToObject(value);
  38. // List<Dictionary<string, object>> dataList = StoreHouseListDo(value);
  39. // return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
  40. // }
  41. // public List<Dictionary<string, object>> StoreHouseListDo(string value)
  42. // {
  43. // JsonData data = JsonMapper.ToObject(value);
  44. // int UserId = int.Parse(function.CheckInt(data["UserId"].ToString())); //创客Id
  45. // int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
  46. // int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
  47. // List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  48. // List<int> query = ApplyMachineDbconn.Instance.GetList(UserId, PageNum, PageSize);
  49. // foreach (int StoreId in query)
  50. // {
  51. // StoreHouse subdata = ApplyMachineDbconn.Instance.Get(StoreId) ?? new StoreHouse();
  52. // Dictionary<string, object> curData = new Dictionary<string, object>();
  53. // curData.Add("Id", subdata.Id); //Id
  54. // curData.Add("Name", subdata.ProductName); //产品仓库名称
  55. // curData.Add("LaveNum", subdata.LaveNum); //剩余数量
  56. // dataList.Add(curData);
  57. // }
  58. // return dataList;
  59. // }
  60. // #endregion
  61. #region 创客-首页-仓库管理-机具申请-返回可申请机具数量
  62. [Authorize]
  63. public JsonResult StoreApply(string value)
  64. {
  65. value = DesDecrypt(value);
  66. JsonData data = JsonMapper.ToObject(value);
  67. AppResultJson result = StoreApplyDo(value);
  68. return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
  69. }
  70. public AppResultJson StoreApplyDo(string value)
  71. {
  72. // value = DesDecrypt(value);
  73. JsonData data = JsonMapper.ToObject(value);
  74. int UserId = int.Parse(function.CheckInt(data["UserId"].ToString())); //创客Id
  75. int StoreId = int.Parse(function.CheckInt(data["StoreId"].ToString())); //仓库Id
  76. int BrandId = int.Parse(function.CheckInt(data["BrandId"].ToString())); //产品类型
  77. DateTime LastTime = DateTime.Parse(DateTime.Now.AddMonths(-1).AddDays(1 - DateTime.Now.Day).ToString("yyyy-MM-dd 00:00:00"));
  78. DateTime ThisTime = DateTime.Parse(DateTime.Now.AddDays(1 - DateTime.Now.Day).AddDays(-1).ToString("yyyy-MM-dd 23:59:59"));
  79. //剩余库存量
  80. var storeHousesLaveNum = maindb.StoreHouse.FirstOrDefault(m => m.UserId == UserId && m.Id == StoreId).LaveNum;
  81. //上月出货总量
  82. int applyDeviceNum = 0;
  83. bool check = maindb.MachineApply.Any(m => m.UserId == UserId && m.StoreId == StoreId && m.ApplyTime >= LastTime && m.ApplyTime <= ThisTime);
  84. if (check)
  85. {
  86. applyDeviceNum = maindb.MachineApply.Where(m => m.UserId == UserId && m.StoreId == StoreId && m.ApplyTime >= LastTime && m.ApplyTime <= ThisTime).Sum(m => m.ApplyDeviceNum);
  87. }
  88. //上月出货量两倍
  89. int LastApplyTwo = applyDeviceNum * 2;
  90. //最低库存数 固定
  91. int minInventory = 0;
  92. //电签
  93. if (BrandId == 1 || BrandId == 2 || BrandId == 4 || BrandId == 6)
  94. {
  95. minInventory = 60;
  96. }
  97. //大Pos
  98. else if (BrandId == 3 || BrandId == 5)
  99. {
  100. minInventory = 25;
  101. }
  102. // //金控电签
  103. // if (BrandId == 1)
  104. // {
  105. // minInventory = 60;
  106. // }
  107. // //开店宝电签
  108. // else if (BrandId == 2)
  109. // {
  110. // minInventory = 60;
  111. // }
  112. // //金控大POS
  113. // else if (BrandId == 3)
  114. // {
  115. // minInventory = 25;
  116. // }
  117. // //乐刷电签
  118. // else if (BrandId == 4)
  119. // {
  120. // minInventory = 60;
  121. // }
  122. //申请数量上限(上月出库量的2倍或最低库存量)
  123. int findInventory = 0;
  124. if (LastApplyTwo > minInventory)
  125. {
  126. findInventory = (LastApplyTwo - storeHousesLaveNum) < 0 ? 0 : (LastApplyTwo - storeHousesLaveNum);
  127. }
  128. else
  129. {
  130. findInventory = minInventory - storeHousesLaveNum < 0 ? 0 : minInventory - storeHousesLaveNum;
  131. }
  132. //箱数
  133. int boxes = 0;
  134. //电签
  135. if (BrandId == 1 || BrandId == 2 || BrandId == 4 || BrandId == 6)
  136. {
  137. boxes = findInventory / 50;
  138. }
  139. //大Pos
  140. else if (BrandId == 3 || BrandId == 5)
  141. {
  142. boxes = findInventory / 10;
  143. }
  144. // //电签
  145. // if (BrandId == 1 || BrandId == 1 || BrandId == 1 || BrandId == 1)
  146. // {
  147. // boxes = findInventory / 50;
  148. // }
  149. // //开店宝电签
  150. // else if (BrandId == 2)
  151. // {
  152. // boxes = findInventory / 50;
  153. // }
  154. // //金控大POS
  155. // else if (BrandId == 3)
  156. // {
  157. // boxes = findInventory / 10;
  158. // }
  159. // //乐刷电签
  160. // else if (BrandId == 4)
  161. // {
  162. // boxes = findInventory / 50;
  163. // }
  164. // //乐刷大POS
  165. // else if (BrandId == 5)
  166. // {
  167. // boxes = findInventory / 10;
  168. // }
  169. // //立刷电签
  170. // else if (BrandId == 6)
  171. // {
  172. // boxes = findInventory / 50;
  173. // }
  174. //每箱台数
  175. int boxNum = 0;
  176. if (BrandId == 1 || BrandId == 2 || BrandId == 4 || BrandId == 6)
  177. {
  178. boxNum = 50;
  179. }
  180. else if (BrandId == 3 || BrandId == 5)
  181. {
  182. boxNum = 10;
  183. }
  184. Machines machines = new Machines();
  185. machines.findInventory = findInventory;
  186. machines.boxes = boxes;
  187. machines.boxeNum = boxNum;
  188. return new AppResultJson() { Status = "1", Info = "", Data = machines };
  189. }
  190. #endregion
  191. // #region 创客-首页-仓库管理-机具申请--确认申请
  192. // [Authorize]
  193. // public JsonResult ConfirmApply(string value)
  194. // {
  195. // value = DesDecrypt(value);
  196. // JsonData data = JsonMapper.ToObject(value);
  197. // AppResultJson result = ConfirmApplyDo(value);
  198. // return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
  199. // }
  200. // public AppResultJson ConfirmApplyDo(string value)
  201. // {
  202. // JsonData data = JsonMapper.ToObject(value);
  203. // int UserId = int.Parse(function.CheckInt(data["UserId"].ToString())); //创客Id
  204. // int StoreId = int.Parse(function.CheckInt(data["StoreId"].ToString())); //仓库Id
  205. // int BrandId = int.Parse(function.CheckInt(data["BrandId"].ToString())); //产品类型
  206. // int ApplyNum = int.Parse(function.CheckInt(data["ApplyNum"].ToString())); //申请箱数
  207. // DateTime LastTime = DateTime.Parse(DateTime.Now.AddMonths(-1).AddDays(1 - DateTime.Now.Day).ToString("yyyy-MM-dd 00:00:00"));
  208. // DateTime ThisTime = DateTime.Parse(DateTime.Now.AddDays(1 - DateTime.Now.Day).AddDays(-1).ToString("yyyy-MM-dd 23:59:59"));
  209. // //剩余库存量
  210. // var storeHousesLaveNum = maindb.StoreHouse.FirstOrDefault(m => m.UserId == UserId && m.Id == StoreId).LaveNum;
  211. // //上月出货总量
  212. // int applyDeviceNum = 0;
  213. // bool check = maindb.MachineApply.Any(m => m.UserId == UserId && m.StoreId == StoreId && m.ApplyTime >= LastTime && m.ApplyTime <= ThisTime);
  214. // if (check)
  215. // {
  216. // applyDeviceNum = maindb.MachineApply.Where(m => m.UserId == UserId && m.StoreId == StoreId && m.ApplyTime >= LastTime && m.ApplyTime <= ThisTime).Sum(m => m.ApplyDeviceNum);
  217. // }
  218. // //上月出货量两倍
  219. // int LastApplyTwo = applyDeviceNum * 2;
  220. // //最低库存数
  221. // int minInventory = 0;
  222. // //电签
  223. // if (BrandId == 1 || BrandId == 2 || BrandId == 4 || BrandId == 6)
  224. // {
  225. // minInventory = 60;
  226. // }
  227. // //大Pos
  228. // else if (BrandId == 3 || BrandId == 5)
  229. // {
  230. // minInventory = 25;
  231. // }
  232. // //申请数量上限(上月出库量的2倍或最低库存量)
  233. // int findInventory = 0;
  234. // if (LastApplyTwo > minInventory)
  235. // {
  236. // findInventory = (LastApplyTwo - storeHousesLaveNum) < 0 ? 0 : (LastApplyTwo - storeHousesLaveNum);
  237. // }
  238. // else
  239. // {
  240. // findInventory = minInventory - storeHousesLaveNum < 0 ? 0 : minInventory - storeHousesLaveNum;
  241. // }
  242. // //每箱台数
  243. // int boxNum = 0;
  244. // if (BrandId == 1 || BrandId == 2 || BrandId == 4 || BrandId == 6)
  245. // {
  246. // boxNum = 50;
  247. // }
  248. // else if (BrandId == 3 || BrandId == 5)
  249. // {
  250. // boxNum = 10;
  251. // }
  252. // bool checks = maindb.StoreMachineApply.Any(m => m.UserId == UserId && m.StoreId == StoreId && m.BrandId == BrandId && m.Status == 0);
  253. // if (checks)
  254. // {
  255. // return new AppResultJson() { Status = "-1", Info = "您有相同机具类型的申请正在进行中,请等待完成后再次申请" };
  256. // }
  257. // if (!checks)
  258. // {
  259. // if (findInventory < boxNum)
  260. // {
  261. // return new AppResultJson() { Status = "-1", Info = "可申请机具数量低于机具整箱数量,不可申请" };
  262. // }
  263. // if (storeHousesLaveNum <= applyDeviceNum || storeHousesLaveNum <= minInventory)
  264. // {
  265. // Users users = maindb.Users.Find(UserId);
  266. // StoreHouse storehouse = maindb.StoreHouse.Find(StoreId);
  267. // Orders orders = new Orders();
  268. // orders.Status = 0;
  269. // orders.CreateDate = DateTime.Now;
  270. // orders.StoreId = StoreId;
  271. // orders.Areas = storehouse.Areas;
  272. // orders.Address = storehouse.Address;
  273. // orders.Mobile = users.Mobile;
  274. // orders.StoreContactMobile = storehouse.ManageMobile;
  275. // orders.RealName = users.RealName;
  276. // orders.UserId = storehouse.UserId;
  277. // maindb.Orders.Add(orders);
  278. // maindb.SaveChanges();
  279. // StoreMachineApply storeMachineApply = new StoreMachineApply();
  280. // storeMachineApply.Version = 0;
  281. // storeMachineApply.CreateDate = DateTime.Now;
  282. // storeMachineApply.ApplyTime = DateTime.Now;
  283. // storeMachineApply.ApplyNo = "AS" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
  284. // storeMachineApply.BrandId = BrandId;
  285. // storeMachineApply.ApplyNum = ApplyNum;
  286. // storeMachineApply.BoxNum = boxNum;
  287. // storeMachineApply.LastApply = applyDeviceNum;
  288. // storeMachineApply.MaxApply = findInventory;
  289. // storeMachineApply.ActualApply = ApplyNum * boxNum;
  290. // storeMachineApply.UserId = UserId;
  291. // storeMachineApply.StoreId = StoreId;
  292. // maindb.StoreMachineApply.Add(storeMachineApply);
  293. // maindb.SaveChanges();
  294. // storeMachineApply.OrderId = orders.Id;
  295. // orders.Sort = storeMachineApply.Id;
  296. // maindb.SaveChanges();
  297. // }
  298. // }
  299. // return new AppResultJson() { Status = "1", Info = "申请成功", Data = "" };
  300. // }
  301. // #endregion
  302. // #region 创客-首页-仓库管理-机具申请-申请记录列表
  303. // /// <summary>
  304. // /// 机具申请记录列表
  305. // /// </summary>
  306. // /// <param name="value"></param>
  307. // /// <returns></returns>
  308. // [Authorize]
  309. // public JsonResult StoreApplyRecordList(string value)
  310. // {
  311. // value = DesDecrypt(value);
  312. // JsonData data = JsonMapper.ToObject(value);
  313. // List<Dictionary<string, object>> dataList = StoreApplyRecordListDo(value);
  314. // return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
  315. // }
  316. // public List<Dictionary<string, object>> StoreApplyRecordListDo(string value)
  317. // {
  318. // JsonData data = JsonMapper.ToObject(value);
  319. // int UserId = int.Parse(function.CheckInt(data["UserId"].ToString())); //创客Id
  320. // int BrandId = int.Parse(function.CheckInt(data["BrandId"].ToString()));//产品类型
  321. // int StoreId = int.Parse(function.CheckInt(data["StoreId"].ToString()));//仓库Id
  322. // int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
  323. // int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
  324. // List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  325. // List<int> query = ApplyMachineDbconn.Instance.GetApplyList(UserId, StoreId, PageNum, PageSize);
  326. // foreach (int Id in query)
  327. // {
  328. // StoreMachineApply subdata = ApplyMachineDbconn.Instance.GetApply(Id) ?? new StoreMachineApply();
  329. // Dictionary<string, object> curData = new Dictionary<string, object>();
  330. // curData.Add("Id", subdata.Id); //Id
  331. // curData.Add("ApplyTime", Convert.ToDateTime(subdata.ApplyTime).ToString("yyyy-MM-dd HH:mm:ss")); //申请时间
  332. // curData.Add("BrandId", subdata.BrandId); //机具类型
  333. // curData.Add("ApplyNum", subdata.ApplyNum); //申请箱数
  334. // curData.Add("Status", subdata.Status); //申请状态
  335. // dataList.Add(curData);
  336. // }
  337. // return dataList;
  338. // }
  339. // #endregion
  340. // #region 创客-首页-仓库管理-机具申请-申请记录详情
  341. // /// <summary>
  342. // /// 机具申请列表详情
  343. // /// </summary>
  344. // /// <param name="value"></param>
  345. // /// <returns></returns>
  346. // [Authorize]
  347. // public JsonResult StoreApplyDetail(string value)
  348. // {
  349. // value = DesDecrypt(value);
  350. // JsonData data = JsonMapper.ToObject(value);
  351. // List<Dictionary<string, object>> dataList = StoreApplyDetailDo(value);
  352. // return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
  353. // }
  354. // public List<Dictionary<string, object>> StoreApplyDetailDo(string value)
  355. // {
  356. // JsonData data = JsonMapper.ToObject(value);
  357. // int UserId = int.Parse(function.CheckInt(data["UserId"].ToString())); //创客Id
  358. // int StoreId = int.Parse(function.CheckInt(data["StoreId"].ToString()));//仓库Id
  359. // int StoreApplyId = int.Parse(function.CheckInt(data["StoreApplyId"].ToString()));//申请记录Id
  360. // List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  361. // List<int> query = ApplyMachineDbconn.Instance.GetApplyDetailList(UserId, StoreId, StoreApplyId);
  362. // foreach (int Id in query)
  363. // {
  364. // StoreMachineApply subdata = ApplyMachineDbconn.Instance.GetApply(Id) ?? new StoreMachineApply();
  365. // var temp = subdata.SwapSnExpand;
  366. // temp = temp.Substring(1);
  367. // temp = temp.Substring(0, temp.Length - 1);
  368. // var SwapSnExpand = temp.Split(",,");
  369. // Orders orders = OrdersDbconn.Instance.Get(subdata.OrderId.Value) ?? new Orders();
  370. // Dictionary<string, object> curData = new Dictionary<string, object>();
  371. // curData.Add("Id", subdata.Id); //Id
  372. // curData.Add("ApplyTime", Convert.ToDateTime(subdata.ApplyTime).ToString("yyyy-MM-dd HH:mm:ss")); //申请时间
  373. // curData.Add("BrandId", subdata.BrandId); //快递单号
  374. // curData.Add("ApplyNum", subdata.ApplyNum); //申请箱数
  375. // curData.Add("SendNum", subdata.SendNum); //发货箱数
  376. // curData.Add("BoxNum", subdata.BoxNum); //每箱台数
  377. // curData.Add("ErpMode", orders.ErpMode); //配送方式
  378. // curData.Add("OrderNo", orders.OrderNo); //快递单号
  379. // curData.Add("SwapSnExpand", SwapSnExpand); //机具SN号
  380. // dataList.Add(curData);
  381. // }
  382. // return dataList;
  383. // }
  384. // #endregion
  385. #region 创客-首页-仓库管理-订单列表-库存
  386. [Authorize]
  387. public JsonResult StoreStockList(string value)
  388. {
  389. value = DesDecrypt(value);
  390. JsonData data = JsonMapper.ToObject(value);
  391. List<Dictionary<string, object>> dataList = StoreStockListDo(value);
  392. return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
  393. }
  394. public List<Dictionary<string, object>> StoreStockListDo(string value)
  395. {
  396. JsonData data = JsonMapper.ToObject(value);
  397. int StoreId = int.Parse(function.CheckInt(data["StoreId"].ToString())); //仓库Id
  398. int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
  399. int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
  400. List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  401. IQueryable<PosMachinesTwo> query = maindb.PosMachinesTwo.Where(m => m.StoreId == StoreId && m.UserId == 0 && m.BuyUserId == 0 && m.PreUserId == 0 && m.Status > -1);//库存和预发机分离
  402. int skipNum = PageSize * (PageNum - 1);
  403. query = query.Skip(skipNum).Take(PageSize);
  404. foreach (var item in query.ToList())
  405. {
  406. PosMachinesTwo subdata = PosMachinesTwoDbconn.Instance.Get(item.Id) ?? new PosMachinesTwo();
  407. Dictionary<string, object> curData = new Dictionary<string, object>();
  408. curData.Add("PosSn", subdata.PosSn);
  409. curData.Add("CreateDate", subdata.CreateDate);
  410. curData.Add("PreUserId", subdata.PreUserId);
  411. dataList.Add(curData);
  412. }
  413. return dataList;
  414. }
  415. #endregion
  416. #region 创客-首页-仓库管理-订单列表-预发机
  417. [Authorize]
  418. public JsonResult PreStoreStockList(string value)
  419. {
  420. value = DesDecrypt(value);
  421. JsonData data = JsonMapper.ToObject(value);
  422. List<Dictionary<string, object>> dataList = PreStoreStockListDo(value);
  423. return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
  424. }
  425. public List<Dictionary<string, object>> PreStoreStockListDo(string value)
  426. {
  427. JsonData data = JsonMapper.ToObject(value);
  428. int StoreId = int.Parse(function.CheckInt(data["StoreId"].ToString())); //仓库Id
  429. int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
  430. int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
  431. List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  432. IQueryable<PreSendStockDetail> query = maindb.PreSendStockDetail.Where(m => m.FromStoreId == StoreId && m.Status >= 0 && m.Status <= 1 && m.ApplyFlag == 0);
  433. int skipNum = PageSize * (PageNum - 1);
  434. query = query.Skip(skipNum).Take(PageSize);
  435. foreach (var item in query.ToList())
  436. {
  437. Dictionary<string, object> curData = new Dictionary<string, object>();
  438. curData.Add("PosSn", item.SnNo);
  439. curData.Add("CreateDate", item.CreateDate);
  440. curData.Add("isGrant", item.AuthFlag); //占用小分仓额度标记
  441. dataList.Add(curData);
  442. }
  443. return dataList;
  444. }
  445. #endregion
  446. #region 检查签名是否合法,合法返回1,不合法返回提示信息
  447. /// <summary>
  448. /// 检查签名是否合法,合法返回1,不合法返回提示信息
  449. /// </summary>
  450. /// <param name="value">请求的参数(json字符串)</param>
  451. /// <param name="signField">要签名的字段</param>
  452. /// <returns></returns>
  453. private string CheckSign(string value, string[] signField)
  454. {
  455. JsonData json = JsonMapper.ToObject(value);
  456. Dictionary<string, string> dic = new Dictionary<string, string>();
  457. for (int i = 0; i < signField.Length; i++)
  458. {
  459. dic.Add(signField[i], json[signField[i]].ToString());
  460. }
  461. string sign = json["sign"].ToString(); //客户端签名字符串
  462. return new Sign().sign(dic, sign);
  463. }
  464. #endregion
  465. #region 私有类-获取最多申请台数、箱数、每箱台数
  466. public class Machines
  467. {
  468. //最多申请台数
  469. public int findInventory { get; set; }
  470. //最多申请箱数
  471. public int boxes { get; set; }
  472. //每箱台数
  473. public int boxeNum { get; set; }
  474. }
  475. #endregion
  476. }
  477. }