77 lines
2.8 KiB
C#
77 lines
2.8 KiB
C#
using Gatedge.K3Cloud.Utils;
|
||
using Gatedge.K3Cloud.Utils.Common;
|
||
using Gatedge.K3Cloud.Utils.Model.K3Request;
|
||
using Gatedge.ScanCode.Common;
|
||
using Gatedge.ScanCode.Extension;
|
||
using Gatedge.ScanCode.Models.Dto.ScanRecords;
|
||
using Gatedge.ScanCode.Services;
|
||
using Gatedge.ScanCode.Services.IServices;
|
||
using Microsoft.AspNetCore.Authorization;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
|
||
namespace Gatedge.ScanCode.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 仓位
|
||
/// </summary>
|
||
[Route("api/[controller]")]
|
||
[ApiController]
|
||
[Authorize]
|
||
public class StockFlexDetailController : ControllerBase
|
||
{
|
||
private readonly string _FormName = "仓位";
|
||
private readonly string _FormId = "BD_FLEXVALUES";
|
||
private readonly K3CloudApiUtils _utils;
|
||
|
||
|
||
/// <summary>
|
||
/// 构造函数
|
||
/// </summary>
|
||
/// <param name="utils"></param>
|
||
public StockFlexDetailController(K3CloudApiUtils utils)
|
||
{
|
||
_utils = utils;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查看列表
|
||
/// </summary>
|
||
/// <param name="Param"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("List")]
|
||
public AjaxResult List([FromQuery] ScanRecordsPageParam Param)
|
||
{
|
||
View viewParam = new View();
|
||
viewParam.Number = Param.Number;
|
||
//查询仓库
|
||
var loginInfo = User.GetLoginInfoByClaimsPrincipal();
|
||
_utils.InitCloudApi(loginInfo);
|
||
IStockService stockService = new StockService(_utils);
|
||
var result = stockService.View(viewParam);
|
||
var dyobj = (dynamic)result;
|
||
var stockFlexItem = dyobj.GetProperty("StockFlexItem");
|
||
//根据仓库StockFlexItem查询仓位
|
||
Query queryParam = new Query()
|
||
{
|
||
FormId = "BD_FLEXVALUES",
|
||
FieldKeys = "FEntity_FEntryId,FID,FNUMBER,FNAME,FFlexValueNumber,FFlexValueName",
|
||
};
|
||
FilterList filterString = new FilterList();
|
||
if (Param.QueryString != string.Empty && Param.QueryString != null)
|
||
{
|
||
FilterItem filterItem = new FilterItem("FFlexValueName", "17", Param.QueryString, "0");
|
||
filterString.AddFilterItem(filterItem);
|
||
}
|
||
for (int i = 0; i < stockFlexItem.GetArrayLength(); i++)
|
||
{
|
||
//循环追加过滤条件仓位集ID,0:并且,1;或者
|
||
FilterItem fbillnoItem = new FilterItem("FID", "67", stockFlexItem[i].GetProperty("FlexId_Id").ToString(), "1");
|
||
filterString.AddFilterItem(fbillnoItem);
|
||
}
|
||
queryParam.FilterString = filterString.GetFilterString();
|
||
var data = _utils.QueryList(queryParam);
|
||
return AjaxResult.Success(data).AddBillId(_FormId);
|
||
}
|
||
}
|
||
}
|