pc端生产领料 齐套出库 物料签收 生产入库 的工位由用户选择的工位带出来导致的逻辑变更
This commit is contained in:
@@ -27,6 +27,10 @@ using Tnb.EquipMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Interfaces.Permission;
|
||||
using SQLitePCL;
|
||||
using SqlSugar.Extensions;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
@@ -40,15 +44,18 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
private readonly ISqlSugarRepository<PrdInstockH> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IOrganizeService _organizeService;
|
||||
private const string ModuleId = "25572529329173";
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
|
||||
public PrdInstockService(
|
||||
ISqlSugarRepository<PrdInstockH> repository,
|
||||
IOrganizeService organizeService,
|
||||
IUserManager userManager
|
||||
)
|
||||
{
|
||||
_repository = repository;
|
||||
_organizeService = organizeService;
|
||||
_userManager = userManager;
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
}
|
||||
@@ -100,8 +107,18 @@ namespace Tnb.ProductionMgr
|
||||
PrdInstockH prdInstockH = null;
|
||||
List<PrdInstockD> prdInstockDs = new List<PrdInstockD>() { };
|
||||
DbResult<bool> result2 = new DbResult<bool>();
|
||||
|
||||
if (string.IsNullOrEmpty(input.station_id))
|
||||
{
|
||||
throw Oops.Bah("请先选择工位");
|
||||
}
|
||||
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(input.station_id, DictConst.RegionCategoryWorklineCode);
|
||||
OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(input.station_id, DictConst.RegionCategoryWorkshopCode);
|
||||
|
||||
|
||||
prdInstockH = new PrdInstockH()
|
||||
{
|
||||
bill_type = input.bill_type,
|
||||
@@ -111,8 +128,8 @@ namespace Tnb.ProductionMgr
|
||||
carry_code = input.carry_code,
|
||||
is_check = input.is_check,
|
||||
station_id = input.station_id,
|
||||
workline_id = input.workline_id,
|
||||
workshop_id = input.workshop_id,
|
||||
workline_id = workline?.Id ?? "",
|
||||
workshop_id = workshop?.Id ?? "",
|
||||
org_id = _userManager.GetUserInfo().Result.organizeId,
|
||||
warehouse_id = location?.wh_id,
|
||||
status = 0,
|
||||
@@ -127,8 +144,10 @@ namespace Tnb.ProductionMgr
|
||||
material_id = item.ContainsKey("material_id") ? item["material_id"] : "",
|
||||
material_code = item.ContainsKey("material_code") ? item["material_code"] : "",
|
||||
unit_id = item.ContainsKey("unit_id") ? item["unit_id"] : "",
|
||||
code_batch = item.ContainsKey("batch") ? item["batch"] : "",
|
||||
barcode = item.ContainsKey("batch") ? item["batch"]+"0001" : "",
|
||||
// code_batch = item.ContainsKey("batch") ? item["batch"] : "",
|
||||
// barcode = item.ContainsKey("batch") ? item["batch"]+"0001" : "",
|
||||
barcode = item.ContainsKey("barcode") ? item["barcode"] : "",
|
||||
code_batch = item.ContainsKey("barcode") ? item["barcode"]+"0001" : "",
|
||||
quantity = Convert.ToInt32(item.ContainsKey("quantity") ? item["quantity"] : "0"),
|
||||
});
|
||||
}
|
||||
@@ -166,7 +185,7 @@ namespace Tnb.ProductionMgr
|
||||
material_id = item.ContainsKey("material_id") ? item["material_id"] : "",
|
||||
material_code = item.ContainsKey("material_code") ? item["material_code"] : "",
|
||||
unit_id = item.ContainsKey("unit_id") ? item["unit_id"] : "",
|
||||
code_batch = item.ContainsKey("batch") ? item["batch"] : "",
|
||||
code_batch = item.ContainsKey("barcode") ? item["barcode"]+"0001" : "",
|
||||
pr_qty = Convert.ToInt32(item.ContainsKey("quantity") ? item["quantity"] : "0"),
|
||||
});
|
||||
|
||||
@@ -175,8 +194,10 @@ namespace Tnb.ProductionMgr
|
||||
material_id = item.ContainsKey("material_id") ? item["material_id"] : "",
|
||||
material_code = item.ContainsKey("material_code") ? item["material_code"] : "",
|
||||
unit_id = item.ContainsKey("unit_id") ? item["unit_id"] : "",
|
||||
code_batch = item.ContainsKey("batch") ? item["batch"] : "",
|
||||
barcode = item.ContainsKey("batch") ? item["batch"]+"0001" : "",
|
||||
// code_batch = item.ContainsKey("batch") ? item["batch"] : "",
|
||||
// barcode = item.ContainsKey("batch") ? item["batch"]+"0001" : "",
|
||||
barcode = item.ContainsKey("barcode") ? item["barcode"] : "",
|
||||
code_batch = item.ContainsKey("barcode") ? item["barcode"]+"0001" : "",
|
||||
codeqty = Convert.ToInt32(item.ContainsKey("quantity") ? item["quantity"] : "0"),
|
||||
});
|
||||
}
|
||||
@@ -188,7 +209,7 @@ namespace Tnb.ProductionMgr
|
||||
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK,JsonConvert.SerializeObject(mesCreateInstockInput),header);
|
||||
Log.Information(sendResult);
|
||||
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
|
||||
if (authResponse.code != 200)
|
||||
if (authResponse.code != 200 || !authResponse.data.ObjToBool())
|
||||
{
|
||||
throw Oops.Bah(authResponse.msg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user