Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
2024-09-30 16:22:17 +08:00
6 changed files with 36 additions and 10 deletions

View File

@@ -1,4 +1,6 @@
namespace Tnb.WarehouseMgr.Entities.Consts
using Microsoft.AspNetCore.Http;
namespace Tnb.WarehouseMgr.Entities.Consts
{
public class WmsWareHouseConst
{
@@ -751,5 +753,6 @@
/// 四厂区仓库vid
/// </summary>
public const string sichangqucangku_vid = "0001A1100000000AOMIG";
}
}

View File

@@ -733,7 +733,7 @@ namespace Tnb.WarehouseMgr
#region
// 齐套出入库
if (warehouse_outstock.id == WmsWareHouseConst.WAREHOUSE_ZC_ID
&& (warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_ZCC_ID || warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_HCC_ID))
&& (warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_ZCC_ID || warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_HCC_ID || warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_ZZXBK_ID))
{
//int count = input.details.Where(r => string.IsNullOrEmpty(r.station_code)).Count();
//if (count > 0)
@@ -997,7 +997,7 @@ namespace Tnb.WarehouseMgr
#region
// 齐套出入库
if (warehouse_outstock.id == WmsWareHouseConst.WAREHOUSE_ZC_ID
&& (warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_ZCC_ID || warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_HCC_ID))
&& (warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_ZCC_ID || warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_HCC_ID || warehouse_instock.id == WmsWareHouseConst.WAREHOUSE_ZZXBK_ID))
{
//int count = input.details.Where(r => string.IsNullOrEmpty(r.station_code)).Count();
//if (count > 0)

View File

@@ -225,11 +225,7 @@ namespace Tnb.WarehouseMgr
if (!string.IsNullOrEmpty(input.requireId))
{
bool isOk = await _db.Updateable<WmsDelivery>().SetColumns(it => new WmsDelivery { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandHasChangeAsync();
if (!isOk)
{
throw Oops.Oh(ErrorCode.COM1001);
}
await _db.Updateable<WmsDelivery>().SetColumns(it => new WmsDelivery { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandHasChangeAsync();
}
}

View File

@@ -72,6 +72,7 @@ namespace Tnb.WarehouseMgr
public static SemaphoreSlim s_taskDistributeYCL2ZCC = new(1);
public static SemaphoreSlim s_taskDistributeZCCToYCL = new(1);
public static string[] YCLCKPowerRole = new string[2] { "37184163262485", "37183913754133" };
public WmsMaterialTransferService(
ISqlSugarRepository<WmsCarryH> repository,
@@ -112,6 +113,18 @@ namespace Tnb.WarehouseMgr
{
queryJson = JObject.Parse(input.queryJson);
}
// 集中供料入库显示范围: 管理员以及 1.注塑加料工权限 2.注塑领班权限
bool isShowJZGL = false;
if (_userManager.UserId == WmsWareHouseConst.AdministratorUserId || _userManager.User?.Account == "admin")
isShowJZGL = true;
else
{
var power = _db.Queryable<UserEntity>()
.Where(r => r.Id == _userManager.UserId && YCLCKPowerRole.Contains(r.RoleId));
if (power.Count() > 0)
isShowJZGL = true;
}
SqlSugarPagedList<WmsMaterialTransfer> result = await _db.Queryable<WmsMaterialTransfer>()
.InnerJoin<DictionaryDataEntity>((a, b) => a.status == b.Id)
@@ -124,6 +137,7 @@ namespace Tnb.WarehouseMgr
.WhereIF(queryJson != null && queryJson["type"] != null, a => a.type == queryJson["type"].ToString())
.WhereIF(queryJson != null && queryJson["bill_code"] != null, a => a.bill_code.Contains(queryJson["bill_code"].ToString()))
.WhereIF(queryJson != null && queryJson["status"] != null, a => a.status == queryJson["status"].ToString())
.WhereIF(!isShowJZGL, a => a.type != WmsWareHouseConst.MATERIALTRANSFER_JZGLRK_CODE)
.Select((a, b, c, d, e, f) => new WmsMaterialTransfer
{
id = a.id,
@@ -152,6 +166,8 @@ namespace Tnb.WarehouseMgr
.OrderBy("a.create_time desc")
.ToPagedListAsync(input.currentPage, input.pageSize);
var _data = PageResult<WmsMaterialTransfer>.SqlSugarPageResult(result);
var json = JsonConvert.SerializeObject(_data);
var data = JsonConvert.DeserializeObject<dynamic>(json);
@@ -305,7 +321,7 @@ namespace Tnb.WarehouseMgr
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="AppFriendlyException"></exception>
[HttpPost, NonUnify, AllowAnonymous]
[HttpPost]
public async Task<Entities.Dto.Outputs.Result> Distribute(MaterialTransferDistributeInput input)
{
try
@@ -365,6 +381,13 @@ namespace Tnb.WarehouseMgr
// 集中供料区三工位
if (wmsMaterialTransfer.warehouse_instock == WmsWareHouseConst.WAREHOUSE_JZGL_ID|| wmsMaterialTransfer.warehouse_instock == WmsWareHouseConst.WAREHOUSE_WBZHHC_ID)
{
// 控制权限 原材料出库到集中供料权限 1.注塑加料工权限 2.注塑领班权限
var power = _db.Queryable<UserEntity>()
.Where(r => r.Id == _userManager.UserId && YCLCKPowerRole.Contains(r.RoleId));
if (power.Count() == 0)
{
throw new AppFriendlyException($@"当前用户:{_userManager.User.RealName} 用户ID:{_userManager.User.Id},没有转库到集中供料仓的操作权限", HttpStatusCode.InternalServerError);
}
// 根据三工位任务数平均分配任务 暂定
endLocations = _db.Queryable<BasLocation>().Where(r => _wareHouseService.GetFloor1GLSGWOutstockLocation().Contains(r.id) && r.is_lock == 0 && r.is_use == "0")
.OrderBy("is_lock, task_nums, location_code").ToList();

View File

@@ -426,6 +426,10 @@ namespace Tnb.WarehouseMgr
Logger.Error($"【FinishproductOutstockSign】库位id {wmsCarryH.location_id}没有对应的库位基础资料!");
throw new AppFriendlyException($"库位id {wmsCarryH.location_id}没有对应的库位基础资料!", 500);
}
if (location != null && location.is_type == "0")
{
throw new Exception($"托盘{wmsCarryH.carry_code}在存储库位中,不能签收!");
}
WmsDistaskH wmsDistaskH = _db.Queryable<WmsDistaskH>().Where(r => r.carry_code == input.carry_code && r.endlocation_id == location.id
&& r.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID && r.status != WmsWareHouseConst.TASK_BILL_STATUS_CANCEL_ID).First();

View File

@@ -247,7 +247,7 @@ namespace Tnb.WarehouseMgr
commonCreatePretaskInput1.carry_id = wmsCarryH.id;
commonCreatePretaskInput1.carry_code = wmsCarryH.carry_code;
commonCreatePretaskInput1.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
commonCreatePretaskInput1.biz_type = "";
commonCreatePretaskInput1.biz_type = WmsWareHouseConst.BIZTYPE_WMSDELIVERY_ID;
commonCreatePretaskInput1.require_id = wmsPrdInstockD.id;
commonCreatePretaskInput1.isExcuteMission = false;
Entities.Dto.Outputs.Result res1 = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput1, db);