成品仓库记录
This commit is contained in:
@@ -104,27 +104,35 @@ namespace ZR.Admin.WebApi.Controllers.mes.wms
|
||||
[Log(Title = "入库")]
|
||||
public IActionResult IntoProductwarehouse([FromBody] WmgoodsDto wmgoodsDto)
|
||||
{
|
||||
if (wmgoodsDto == null)
|
||||
try
|
||||
{
|
||||
return ToResponse(new ApiResult(200, "传入为空", false));
|
||||
}
|
||||
string msg = "";
|
||||
if (wmgoodsDto == null)
|
||||
{
|
||||
return ToResponse(new ApiResult(200, "传入参数为空", false));
|
||||
}
|
||||
string msg = "";
|
||||
|
||||
string createName = HttpContext.GetName();
|
||||
int num = this.wm_entryWarehousing_productService.IntoProductwarehouse(wmgoodsDto, createName);
|
||||
if (num == 0)
|
||||
string createName = HttpContext.GetName();
|
||||
int num = this.wm_entryWarehousing_productService.IntoProductwarehouse(wmgoodsDto, createName);
|
||||
if (num == 0)
|
||||
{
|
||||
msg = "入库数为0!";
|
||||
|
||||
|
||||
}
|
||||
else if (num >= 1)
|
||||
{
|
||||
msg = "成功入库" + num + "箱";
|
||||
|
||||
|
||||
}
|
||||
return ToResponse(new ApiResult(200, msg, num));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
msg = "数据插入异常";
|
||||
|
||||
|
||||
return ToResponse(new ApiResult(500, e.Message, e.Message));
|
||||
}
|
||||
else if (num >= 1)
|
||||
{
|
||||
msg = "成功入库" + num + "个";
|
||||
|
||||
|
||||
}
|
||||
return ToResponse(new ApiResult(200, msg, num));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
107
ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsRecordController.cs
Normal file
107
ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsRecordController.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
|
||||
//创建时间:2024-08-05
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 成品库数据变动表
|
||||
/// </summary>
|
||||
// [Verify]
|
||||
[Route("/mes/wm/WmGoodsRecord")]
|
||||
public class WmGoodsRecordController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 成品库数据变动表接口
|
||||
/// </summary>
|
||||
private readonly IWmGoodsRecordService _WmGoodsRecordService;
|
||||
|
||||
public WmGoodsRecordController(IWmGoodsRecordService WmGoodsRecordService)
|
||||
{
|
||||
_WmGoodsRecordService = WmGoodsRecordService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询成品库数据变动表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "business:wmgoodsrecord:list")]
|
||||
public IActionResult QueryWmGoodsRecord([FromQuery] WmGoodsRecordQueryDto parm)
|
||||
{
|
||||
var response = _WmGoodsRecordService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询成品库数据变动表详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "business:wmgoodsrecord:query")]
|
||||
public IActionResult GetWmGoodsRecord(string Id)
|
||||
{
|
||||
var response = _WmGoodsRecordService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<WmGoodsRecord>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加成品库数据变动表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "business:wmgoodsrecord:add")]
|
||||
[Log(Title = "成品库数据变动表", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddWmGoodsRecord([FromBody] WmGoodsRecordDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<WmGoodsRecord>().ToCreate(HttpContext);
|
||||
|
||||
var response = _WmGoodsRecordService.AddWmGoodsRecord(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新成品库数据变动表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "business:wmgoodsrecord:edit")]
|
||||
[Log(Title = "成品库数据变动表", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateWmGoodsRecord([FromBody] WmGoodsRecordDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<WmGoodsRecord>().ToUpdate(HttpContext);
|
||||
var response = _WmGoodsRecordService.UpdateWmGoodsRecord(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除成品库数据变动表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "business:wmgoodsrecord:delete")]
|
||||
[Log(Title = "成品库数据变动表", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteWmGoodsRecord(string ids)
|
||||
{
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0)
|
||||
{
|
||||
return ToResponse(ApiResult.Error($"删除失败Id 不能为空"));
|
||||
}
|
||||
|
||||
var response = _WmGoodsRecordService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,6 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询出货单(物料+客户)详情
|
||||
/// </summary>
|
||||
@@ -100,9 +99,10 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
[Log(Title = "出货单(物料+客户)", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteWmOutOrder(string ids)
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(ids)) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
if (string.IsNullOrEmpty(ids))
|
||||
{
|
||||
return ToResponse(ApiResult.Error($"删除失败Id 不能为空"));
|
||||
}
|
||||
|
||||
var response = _WmOutOrderService.Delete(ids.Split(","));
|
||||
// 删除外键 物料清单
|
||||
@@ -128,15 +128,12 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getmaterial_list")]
|
||||
|
||||
public IActionResult QueryWmMaterial([FromQuery] WmMaterialQueryDto parm)
|
||||
{
|
||||
var response = _WmOutOrderService.GetmaterialList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 生成出货单的物料信息
|
||||
/// </summary>
|
||||
@@ -147,13 +144,13 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
if (shipment_num == null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
|
||||
}
|
||||
List<WmMaterialQuery_print> data = _WmOutOrderService.Queryoutoder_matrials(shipment_num);
|
||||
List<WmMaterialQuery_print> data = _WmOutOrderService.Queryoutoder_matrials(
|
||||
shipment_num
|
||||
);
|
||||
return SUCCESS(data);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 8.1根据出库单生成出库计划
|
||||
/// </summary>
|
||||
@@ -168,7 +165,9 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
}
|
||||
// TODO 1.返回值修改为 对象 返回是否可生成计划,计划结果:{canPlan:true,resultList:[]}
|
||||
// XXX 无计划返回空即可
|
||||
List<WmOutOrderPlan> WmOutOrderPlanList = _WmOutOrderService.Generate_outorderplan(shipment_num);
|
||||
List<WmOutOrderPlan> WmOutOrderPlanList = _WmOutOrderService.Generate_outorderplan(
|
||||
shipment_num
|
||||
);
|
||||
return SUCCESS(WmOutOrderPlanList);
|
||||
}
|
||||
|
||||
@@ -219,6 +218,7 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
int result = _WmOutOrderService.PersistenceOutorderplan(shipment_num);
|
||||
return SUCCESS(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 8.5 PDA端 获取出库单的持久化存储出库计划并计算计划批次当前已出库数量
|
||||
/// </summary>
|
||||
@@ -226,13 +226,19 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
/// <param name="partnumber">物料号(零件号)</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getOutOrderPlanAndOutProductionNum")]
|
||||
public IActionResult GetOutOrderPlanAndOutProductionNum(string shipment_num, string partnumber)
|
||||
public IActionResult GetOutOrderPlanAndOutProductionNum(
|
||||
string shipment_num,
|
||||
string partnumber
|
||||
)
|
||||
{
|
||||
if (shipment_num == null)
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "传入工单号为空!", "传入工单号为空!"));
|
||||
}
|
||||
var result = _WmOutOrderService.GetOutOrderPlanAndOutProductionNum(shipment_num, partnumber);
|
||||
var result = _WmOutOrderService.GetOutOrderPlanAndOutProductionNum(
|
||||
shipment_num,
|
||||
partnumber
|
||||
);
|
||||
if (result == null)
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "获取计划异常!", "获取计划异常!"));
|
||||
@@ -245,23 +251,28 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
/// </summary>
|
||||
/// <param name="doMaterialOut"></param>
|
||||
/// <returns>
|
||||
///
|
||||
///
|
||||
/// </returns>
|
||||
[HttpPost("doMaterialOut")]
|
||||
[Log(Title = "成品出库", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult DoMaterialOut([FromBody] WmDoMaterialOut_Dto doMaterialOut)
|
||||
{
|
||||
if (doMaterialOut == null || doMaterialOut.ShipmentNum == null)
|
||||
try
|
||||
{
|
||||
return SUCCESS(null);
|
||||
if (doMaterialOut == null || doMaterialOut.ShipmentNum == null)
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "出库数据为空!", "出库数据为空!"));
|
||||
}
|
||||
string createName = HttpContext.GetName();
|
||||
(int, int) data = _WmOutOrderService.DoMaterialOut(doMaterialOut, createName);
|
||||
return SUCCESS(data);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "出库异常!" + e.Message, "出库异常!"));
|
||||
}
|
||||
string createName = HttpContext.GetName();
|
||||
(int, int) data = _WmOutOrderService.DoMaterialOut(doMaterialOut, createName);
|
||||
|
||||
return SUCCESS(data);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 6 出库单完成
|
||||
/// </summary>
|
||||
@@ -286,14 +297,22 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
/// <param name="shipment_num">出库单号</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("checkProductionOut")]
|
||||
public IActionResult CheckProductionOut(string partnumber, string production_packcode = "", string shipment_num = "")
|
||||
public IActionResult CheckProductionOut(
|
||||
string partnumber,
|
||||
string production_packcode = "",
|
||||
string shipment_num = ""
|
||||
)
|
||||
{
|
||||
if (string.IsNullOrEmpty(partnumber))
|
||||
{
|
||||
return ToResponse(new ApiResult(200, "请选择物料号", false));
|
||||
}
|
||||
string msg = "";
|
||||
msg = _WmOutOrderService.CheckProductionOut(partnumber, production_packcode, shipment_num);
|
||||
msg = _WmOutOrderService.CheckProductionOut(
|
||||
partnumber,
|
||||
production_packcode,
|
||||
shipment_num
|
||||
);
|
||||
if (msg != "ok")
|
||||
{
|
||||
return ToResponse(new ApiResult(200, msg, false));
|
||||
@@ -303,6 +322,5 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
return ToResponse(new ApiResult(200, msg, true));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user