1
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
@@ -366,12 +382,11 @@ namespace Tnb.WarehouseMgr
|
||||
if (wmsMaterialTransfer.warehouse_instock == WmsWareHouseConst.WAREHOUSE_JZGL_ID|| wmsMaterialTransfer.warehouse_instock == WmsWareHouseConst.WAREHOUSE_WBZHHC_ID)
|
||||
{
|
||||
// 控制权限 原材料出库到集中供料权限 1.注塑加料工权限 2.注塑领班权限
|
||||
string[] YCLCKPowerRole = new string[2] { "37184163262485", "37183913754133" };
|
||||
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);
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user