仓库管理_物料管理:初始化
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
using Infrastructure.Extensions;
|
||||
using JinianNet.JNTemplate;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.MES.qu;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
using ZR.Service.mes.wms;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.mes.wms
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 退库模块
|
||||
/// </summary>
|
||||
[Route("/mes/wm/exitwarehouse")]
|
||||
public class WMExitwarehouseController : BaseController
|
||||
{
|
||||
private readonly IWMExitwarehouseService Exitwarehouse;
|
||||
public WMExitwarehouseController(IWMExitwarehouseService Exitwarehouse) {
|
||||
this.Exitwarehouse = Exitwarehouse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 一般退库
|
||||
/// </summary>
|
||||
/// <param name="original"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("common")]
|
||||
public IActionResult ExitwarehouseCommmon(string originalCode)
|
||||
{
|
||||
string msg = null;
|
||||
bool data = Exitwarehouse.ExitwarehouseCommmon(originalCode);
|
||||
if (data)
|
||||
{
|
||||
msg = "退库成功";
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "箱子不在仓库中";
|
||||
}
|
||||
return ToResponse(new ApiResult(200, msg, data));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 7 判断箱子是否存在成品库仓库里
|
||||
/// </summary>
|
||||
/// <param name="PatchCode"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("is_existed_warehouse")]
|
||||
public IActionResult IsExistedWarehouse(string originalCode = "")
|
||||
{
|
||||
if (string.IsNullOrEmpty(originalCode))
|
||||
{
|
||||
|
||||
return ToResponse(new ApiResult(200, "传入为空", false));
|
||||
}
|
||||
string msg = null;
|
||||
bool data = this.Exitwarehouse.IsExistedWarehouse(originalCode);
|
||||
if (data)
|
||||
{
|
||||
msg = "存在";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "不存在";
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, msg, data));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -113,23 +113,23 @@ namespace ZR.Admin.WebApi.Controllers.mes.wms
|
||||
return ToResponse(new ApiResult(200, "传入为空", false));
|
||||
}
|
||||
string msg = "";
|
||||
bool data = false;
|
||||
|
||||
string createName = HttpContext.GetName();
|
||||
|
||||
int status = this.wm_entryWarehousing_productService.IntoProductwarehouse(wmgoodsDto, createName);
|
||||
if (status == 0)
|
||||
int num = this.wm_entryWarehousing_productService.IntoProductwarehouse(wmgoodsDto, createName);
|
||||
if (num == 0)
|
||||
{
|
||||
msg = "数据插入异常";
|
||||
data = false;
|
||||
|
||||
|
||||
}
|
||||
else if (status == 1)
|
||||
else if (num >= 1)
|
||||
{
|
||||
msg = "success";
|
||||
data = true;
|
||||
msg = "成功入库"+num+"个";
|
||||
|
||||
|
||||
}
|
||||
return ToResponse(new ApiResult(200, msg, data));
|
||||
return ToResponse(new ApiResult(200, msg, num));
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取库位已经存在箱子
|
||||
|
||||
113
ZR.Admin.WebApi/Controllers/mes/wms/WmMaterialController.cs
Normal file
113
ZR.Admin.WebApi/Controllers/mes/wms/WmMaterialController.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Model.Dto;
|
||||
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
using ZR.Model.MES.wms;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
|
||||
//创建时间:2024-03-16
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料记录表增删改查
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("/mes/wm/WmMaterial")]
|
||||
public class WmMaterialController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料记录表接口
|
||||
/// </summary>
|
||||
private readonly IWmMaterialService _WmMaterialService;
|
||||
|
||||
public WmMaterialController(IWmMaterialService WmMaterialService)
|
||||
{
|
||||
_WmMaterialService = WmMaterialService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询物料记录表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "wms:wmmaterial:list")]
|
||||
public IActionResult QueryWmMaterial([FromQuery] WmMaterialQueryDto parm)
|
||||
{
|
||||
var response = _WmMaterialService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询物料记录表详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "wms:wmmaterial:query")]
|
||||
public IActionResult GetWmMaterial(string Id)
|
||||
{
|
||||
var response = _WmMaterialService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<WmMaterial>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加物料记录表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "wms:wmmaterial:add")]
|
||||
[Log(Title = "物料记录表", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddWmMaterial([FromBody] WmMaterialDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<WmMaterial>().ToCreate(HttpContext);
|
||||
|
||||
var response = _WmMaterialService.AddWmMaterial(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新物料记录表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "wms:wmmaterial:edit")]
|
||||
[Log(Title = "物料记录表", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateWmMaterial([FromBody] WmMaterialDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<WmMaterial>().ToUpdate(HttpContext);
|
||||
var response = _WmMaterialService.UpdateWmMaterial(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除物料记录表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "wms:wmmaterial:delete")]
|
||||
[Log(Title = "物料记录表", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteWmMaterial(string ids)
|
||||
{
|
||||
long[] idsArr = Tools.SpitLongArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
|
||||
var response = _WmMaterialService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user