搭建基础接口,新增采购入库单、采购订单接口
This commit is contained in:
74
Gatedge.ScanCode/Controllers/InStockController.cs
Normal file
74
Gatedge.ScanCode/Controllers/InStockController.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using Gatedge.K3Cloud.Utils;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Request;
|
||||
using Gatedge.ScanCode.Common;
|
||||
using Gatedge.ScanCode.Extension;
|
||||
using Gatedge.ScanCode.Models.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Gatedge.ScanCode.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 采购入库单
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[Authorize]
|
||||
[ApiController]
|
||||
public class InStockController : ControllerBase
|
||||
{
|
||||
private readonly string _FormName = "采购入库单";
|
||||
private readonly string _FormId = "STK_InStock";
|
||||
private readonly K3CloudApiUtils _utils;
|
||||
/// <summary>
|
||||
/// 构造方法
|
||||
/// </summary>
|
||||
public InStockController(K3CloudApiUtils utils)
|
||||
{
|
||||
_utils = utils;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 列表
|
||||
/// </summary>
|
||||
/// <param name="Param"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("List")]
|
||||
public AjaxResult List([FromQuery] PageParam Param)
|
||||
{
|
||||
if (Param.PageSize <= 0 || Param.PageIndex <= 0)
|
||||
{
|
||||
var errMes = string.Format("传递的参数不合法,请检查PageIndex:{0},PageSize:{1}", Param.PageIndex, Param.PageSize);
|
||||
return AjaxResult.Error(500, errMes);
|
||||
}
|
||||
Query queryParam = new Query()
|
||||
{
|
||||
FormId = this._FormId,
|
||||
// 单据ID、单据编号
|
||||
FieldKeys = "FID,FBillNo,FDate",
|
||||
Limit = Param.PageSize,
|
||||
StartRow = Param.PageSize * (Param.PageIndex - 1),
|
||||
};
|
||||
//// 已审核未禁用
|
||||
var loginInfo = User.GetLoginInfoByClaimsPrincipal();
|
||||
queryParam.FilterString = $"FDocumentStatus = 'C' AND FFORBIDSTATUS = 'A' AND FPurchaseOrgId.FNumber = '{loginInfo.OrgNum}' AND (FBILLNO LIKE '{Param.QueryString}%') ";
|
||||
_utils.InitCloudApi(loginInfo);
|
||||
var data = _utils.QueryList(queryParam);
|
||||
return AjaxResult.Success(data).AddBillId(_FormId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查看
|
||||
/// </summary>
|
||||
/// <param name="Param"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("View")]
|
||||
public AjaxResult View([FromQuery] View Param)
|
||||
{
|
||||
var loginInfo = User.GetLoginInfoByClaimsPrincipal();
|
||||
_utils.InitCloudApi(loginInfo);
|
||||
var result = _utils.Query(_FormId, Param);
|
||||
return AjaxResult.Success(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user