1.导入当前库存的逻辑修改
2.增加盘点接口
This commit is contained in:
@ -32,5 +32,10 @@ namespace WCS.BLL.Services.IService
|
||||
public Task<ResponseBase> confirmStocktakingOrder(ConfirmStocktakingOrderRequest request);
|
||||
|
||||
public Task<ResponseBase> commitStockTakingOrder(GetStockTakingOrderMatDetailRequest request);
|
||||
|
||||
|
||||
#region 赛特制冷
|
||||
public Task<ResponseBase> stockTakingById(StockTakingByIdRequest request);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -201,13 +201,13 @@ namespace WCS.BLL.Services.Service
|
||||
#region 校验
|
||||
//工位校验 工位是否有货架校验
|
||||
var station = await DbHelp.db.Queryable<LocationInfo>()
|
||||
.Where(t => t.LocationCode == stationCode || t.IsEnable == true)
|
||||
.Where(t => t.LocationCode == stationCode && t.IsEnable == true)
|
||||
.FirstAsync();
|
||||
if (station == null)
|
||||
{
|
||||
return new ResponseCommon<List<string>>()
|
||||
{
|
||||
Code = 200,
|
||||
Code = 201,
|
||||
Message = $"导入失败:工位[{stationCode}]不存在或已被禁用!",
|
||||
Data = null,
|
||||
};
|
||||
@ -222,7 +222,7 @@ namespace WCS.BLL.Services.Service
|
||||
{
|
||||
return new ResponseCommon<List<string>>()
|
||||
{
|
||||
Code = 200,
|
||||
Code = 201,
|
||||
Message = $"导入失败:当前工位不存在货架,请呼叫货架后再进行操作!",
|
||||
Data = null,
|
||||
};
|
||||
@ -240,7 +240,7 @@ namespace WCS.BLL.Services.Service
|
||||
{
|
||||
return new ResponseCommon<List<string>>()
|
||||
{
|
||||
Code = 200,
|
||||
Code = 201,
|
||||
Message = $"导入失败:数量应该大于0!",
|
||||
Data = null,
|
||||
};
|
||||
@ -249,7 +249,7 @@ namespace WCS.BLL.Services.Service
|
||||
{
|
||||
return new ResponseCommon<List<string>>()
|
||||
{
|
||||
Code = 200,
|
||||
Code = 201,
|
||||
Message = $"导入失败:物料编码必填!",
|
||||
Data = null,
|
||||
};
|
||||
@ -258,7 +258,7 @@ namespace WCS.BLL.Services.Service
|
||||
{
|
||||
return new ResponseCommon<List<string>>()
|
||||
{
|
||||
Code = 200,
|
||||
Code = 201,
|
||||
Message = $"导入失败:单据类型[{matDetailCurrentInfo.单据类型}]无效!",
|
||||
Data = null,
|
||||
};
|
||||
@ -268,7 +268,7 @@ namespace WCS.BLL.Services.Service
|
||||
{
|
||||
return new ResponseCommon<List<string>>()
|
||||
{
|
||||
Code = 200,
|
||||
Code = 201,
|
||||
Message = $"导入失败:货架[{matDetailCurrentInfo.货架编码}]不是当前工位的货架!",
|
||||
Data = null,
|
||||
};
|
||||
@ -289,7 +289,7 @@ namespace WCS.BLL.Services.Service
|
||||
{
|
||||
return new ResponseCommon<List<string>>()
|
||||
{
|
||||
Code = 200,
|
||||
Code = 201,
|
||||
Message = $"导入失败:请重试!",
|
||||
Data = null,
|
||||
};
|
||||
@ -303,7 +303,7 @@ namespace WCS.BLL.Services.Service
|
||||
{
|
||||
return new ResponseCommon<List<string>>()
|
||||
{
|
||||
Code = 200,
|
||||
Code = 201,
|
||||
Message = $"导入失败:以下物料编码无效!\r\n{string.Join(",", matCodes)}",
|
||||
Data = null,
|
||||
};
|
||||
@ -368,7 +368,7 @@ namespace WCS.BLL.Services.Service
|
||||
};
|
||||
return new ResponseCommon<List<string>>()
|
||||
{
|
||||
Code = 200,
|
||||
Code = 201,
|
||||
Message = "导入失败",
|
||||
Data = ErrList
|
||||
};
|
||||
|
@ -1045,5 +1045,20 @@ namespace WCS.BLL.Services.Service
|
||||
}
|
||||
|
||||
|
||||
#region 赛特制冷
|
||||
public async Task<ResponseBase> stockTakingById(StockTakingByIdRequest request)
|
||||
{
|
||||
//先查询有无这一条库存记录
|
||||
var matDetailCurrentInfo = DbHelp.db.Queryable<MatDetailCurrentInfo>()
|
||||
.Where(t => t.Id == request.MatDetailCurrentInfoId)
|
||||
.FirstAsync();
|
||||
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 200,
|
||||
Message = $"success",
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
13
WCS.Model/ApiModel/Stocktaking/StockTakingByIdRequest.cs
Normal file
13
WCS.Model/ApiModel/Stocktaking/StockTakingByIdRequest.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WCS.Model.ApiModel.Stocktaking
|
||||
{
|
||||
public class StockTakingByIdRequest:RequestBase
|
||||
{
|
||||
public int MatDetailCurrentInfoId { get; set; }
|
||||
|
||||
public int MatQty { get; set; }
|
||||
}
|
||||
}
|
69
WCS.WebApi/Controllers/PDAStocktakingController.cs
Normal file
69
WCS.WebApi/Controllers/PDAStocktakingController.cs
Normal file
@ -0,0 +1,69 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.BLL.Services.IService;
|
||||
using WCS.DAL.Db;
|
||||
using WCS.DAL.DbModels;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel;
|
||||
using WCS.Model.ApiModel.PDAMatBind;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using WCS.Model.ApiModel.User;
|
||||
using WCS.Model.WebSocketModel;
|
||||
|
||||
namespace WCS.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// PDA库存盘点
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class PDAStocktakingController : ControllerBase
|
||||
{
|
||||
public IWarningService _warningService { get; set; }
|
||||
|
||||
public PDAStocktakingController(IWarningService warningService)
|
||||
{
|
||||
_warningService = warningService;
|
||||
}
|
||||
|
||||
[Route("stockTakingById")]
|
||||
[HttpPost(Name = "stockTakingById")]
|
||||
public async Task<ResponseCommon> stockTakingById(StockTakingByIdRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
#region 参数校验
|
||||
//判断参数 //数量可以为空 数量为空盘点确认 这边删除对应数据即可
|
||||
if (request.MatDetailCurrentInfoId == 0)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = $"操作失败:参数传入错误(Id为0)!",
|
||||
Data = null,
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 200,
|
||||
Message = "success",
|
||||
Data = null,
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = ex.Message,
|
||||
Data = null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user