入库模块init

This commit is contained in:
qianhao.xu
2024-03-13 17:30:57 +08:00
parent 59f7962ffc
commit 3ab1ba3064
9 changed files with 411 additions and 8 deletions

View File

@@ -1,10 +1,15 @@
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.IService;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace ZR.Admin.WebApi.Controllers.mes.wms
{
@@ -18,7 +23,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.wms
private readonly IWMentryWarehousing_productService wm_entryWarehousing_productService;
public WMentryWarehousing_productController(IWMentryWarehousing_productService wm_entryWarehousing_productService)
{
this.wm_entryWarehousing_productService = wm_entryWarehousing_productService;
this.wm_entryWarehousing_productService = wm_entryWarehousing_productService;
}
/// <summary>
@@ -28,7 +33,11 @@ namespace ZR.Admin.WebApi.Controllers.mes.wms
[HttpGet("is_production_location")]
public IActionResult IsProductionLocation(string production_location_code = "")
{
if(string.IsNullOrEmpty(production_location_code))
{
return ToResponse(new ApiResult(200, "传入为空", false));
}
// 查询 wm_info 表根据库位码查询在表中是否存在true false
bool state = this.wm_entryWarehousing_productService.IsProductionLoacation(production_location_code);
@@ -42,7 +51,24 @@ namespace ZR.Admin.WebApi.Controllers.mes.wms
[HttpGet("is_production_package")]
public IActionResult IsProductionPackage(string package_code = "")
{
return ToResponse(new ApiResult(200, "success", true));
if (string.IsNullOrEmpty(package_code))
{
return ToResponse(new ApiResult(200, "传入为空", false));
}
int state = this.wm_entryWarehousing_productService.isProductionPackage(package_code);
string msg = null;
if (state == 0)
msg = "外箱标签码不存在";
else if (state == 1)
msg = "success";
else if (state == 2)
msg = "误扫码,不是外箱标签码";
return ToResponse(new ApiResult(200, msg, state));
}
/// <summary>
@@ -52,8 +78,66 @@ namespace ZR.Admin.WebApi.Controllers.mes.wms
[HttpGet("is_full_package")]
public IActionResult IsFullPackage(string package_code = "")
{
return ToResponse(new ApiResult(200, "success", true));
if (string.IsNullOrEmpty(package_code))
{
return ToResponse(new ApiResult(200, "传入为空", false));
}
bool state = this.wm_entryWarehousing_productService.isFullPackage(package_code);
string msg = state ? "满箱" : "不满箱";
return ToResponse(new ApiResult(200, msg, true));
}
/// <summary>
/// 4.入库
/// </summary>
/// <param name="wmgoodsDto"></param>
/// <returns></returns>
[HttpPost("into_product_warehouse")]
public IActionResult IntoProductwarehouse([FromBody] WmgoodsDto wmgoodsDto)
{
if(wmgoodsDto == null)
{
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)
{
msg = "数据插入异常";
data = false;
}
else if(status == 1)
{
msg = "success";
data = true;
}
return ToResponse(new ApiResult(200, msg, data));
}
/// <summary>
/// 获取库位已经存在箱子
/// </summary>
/// <param name="locationcode"></param>
/// <returns></returns>
[HttpGet("packagelist")]
public IActionResult Getpackagelist(string locationcode)
{
if(string.IsNullOrEmpty(locationcode))
{
return ToResponse(new ApiResult(200, "传入为空", false));
}
string msg = null;
List<WmGoodsNowProduction> productionList= this.wm_entryWarehousing_productService.Getpackagelist(locationcode);
return ToResponse(new ApiResult(200, msg, productionList));
}
}
}

View File

@@ -5,6 +5,7 @@ using Microsoft.IdentityModel.Tokens;
using ZR.Model.MES.qu;
using ZR.Model.MES.wms;
using ZR.Service.mes.wms.IService;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace ZR.Admin.WebApi.Controllers.mes.wms
{
@@ -13,7 +14,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.wms
public class WMlocationInfoController : BaseController
{
private readonly IWMlocationInfoService wm_locationInfoService;
private readonly IWMlocationInfoService wm_locationInfoService;
public WMlocationInfoController(IWMlocationInfoService wm_locationInfoService)
{
this.wm_locationInfoService = wm_locationInfoService;
@@ -25,11 +26,25 @@ namespace ZR.Admin.WebApi.Controllers.mes.wms
/// </summary>
/// <returns></returns>
[HttpGet("production_warehouse_info")]
public IActionResult Queryproduction_warehouse_info(string shelf = "", int layer = 0,int pageNum=0,int pageSize=0)
public IActionResult Queryproduction_warehouse_info(string shelf = "", int layer = 0, int pageNum = 0, int pageSize = 0)
{
(List<WmInfo>, int) data = wm_locationInfoService.Getwminfo_product(shelf, layer, pageNum, pageSize);
return ToResponse(new ApiResult(200, "success", data));
}
/// <summary>
/// 获取库位信息
/// </summary>
[HttpGet("get_location_info")]
public IActionResult Querylocationinfo(int warehouse_num, string locationcode = "")
{
WmInfo wmInfo= wm_locationInfoService.Getlocationinfo(warehouse_num, locationcode);
return ToResponse(new ApiResult(200, "success", wmInfo));
}
}
}