zhao
2021-07-19 8347f2fbddbd25369359dcb2da1233ac48a19fdc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using HH.WMS.BLL;
using HH.WMS.BLL.Basic;
using HH.WMS.DAL.Basic;
using HH.WMS.Entitys;
using HH.WMS.Entitys.Basic;
using HH.WMS.Entitys.Common;
using HH.WMS.WebApi.Areas.Common.Controllers;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
 
namespace HH.WMS.WebApi.Areas.Sys.Controllers
{
    public class AreaQtyController : BaseController
    {
        #region 根据货主查询货主下物料-维修工还料(PDA接口)
        /// <summary>
        /// 根据货主查询货主下物料 -维修工还料
        /// </summary>
        /// <param name="ownerCode">货主编码</param>
        /// <returns></returns>
        [HttpGet]
        public string GetAreaQtyByOwner(string ownerCode)
        {
            return ValidateToken(t =>
            {
                List<TN_WM_B_AREA_QTYEntity> areaQtyList = BLLCreator.Create<TN_WM_B_AREA_QTYBLL>().GetAreaQtyByOwner(ownerCode);
 
                List<TN_WM_B_AREA_QTYEntity> newList = new List<TN_WM_B_AREA_QTYEntity>();
                foreach (var item in areaQtyList)
                {
                    AutoBomItemEntity itemEnity = BLLCreator.Create<TN_WMS_ITEMBLL>().GetItem(item.CN_S_ITEM_CODE);
                    item.CN_S_MEASURE_UNIT = itemEnity == null ? "" : itemEnity.CN_S_MEASURE_UNIT;
                    item.CN_S_MODEL = itemEnity == null ? "" : itemEnity.CN_S_MODEL;
                    newList.Add(item);
                }
                return JsonConvert.SerializeObject(OperateResult.Succeed("", newList));
            });
        }
        #endregion
 
        [HttpGet]
        public string GetStockQty()
        {
            List<TN_WM_B_STOCK_QTYEntity> stockQtyList = BLLCreator.Create<DapperBLL<TN_WM_B_STOCK_QTYEntity>>().GetList();
            return JsonConvert.SerializeObject(OperateResult.Succeed("", stockQtyList));
        }
    }
}