去除引用common.props
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using JNPF;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
@@ -12,19 +11,17 @@ using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.Permission;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Interfaces;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.ProductionMgr.Entities.Dto;
|
||||
using Tnb.ProductionMgr.Interfaces;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
@@ -44,8 +41,8 @@ namespace Tnb.ProductionMgr
|
||||
private readonly IOrganizeService _organizeService;
|
||||
private readonly IBillRullService _billRullService;
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
|
||||
public PrdKittingOutService(ISqlSugarRepository<PrdKittingOutH> repository, IRunService runService,
|
||||
|
||||
public PrdKittingOutService(ISqlSugarRepository<PrdKittingOutH> repository, IRunService runService,
|
||||
IBillRullService billRullService,
|
||||
IUserManager userManager,
|
||||
IOrganizeService organizeService,
|
||||
@@ -59,7 +56,7 @@ namespace Tnb.ProductionMgr
|
||||
_billRullService = billRullService;
|
||||
// OverideFuncs.CreateAsync = Create;
|
||||
}
|
||||
|
||||
|
||||
// private async Task<dynamic> Create(VisualDevModelDataCrInput visualDevModelDataCrInput)
|
||||
// {
|
||||
// PrdKittingOutH prdKittingOutH = new PrdKittingOutH();
|
||||
@@ -157,7 +154,7 @@ namespace Tnb.ProductionMgr
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 齐套出库申请
|
||||
/// </summary>
|
||||
@@ -165,7 +162,7 @@ namespace Tnb.ProductionMgr
|
||||
/// <returns></returns>
|
||||
/// <exception cref="AppFriendlyException"></exception>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> KittingOut(KittingOutInput kittingOutInput)
|
||||
public async Task<dynamic> KittingOut(KittingOutInput kittingOutInput)
|
||||
{
|
||||
PrdKittingOutH prdKittingOutH = new PrdKittingOutH();
|
||||
try
|
||||
@@ -173,7 +170,7 @@ namespace Tnb.ProductionMgr
|
||||
var db = _repository.AsSugarClient();
|
||||
OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(kittingOutInput.workstation_id, DictConst.RegionCategoryWorklineCode);
|
||||
kittingOutInput.workline_id = workline?.Id ?? "";
|
||||
|
||||
|
||||
List<MESKittingOutStkInput> input = new List<MESKittingOutStkInput>();
|
||||
input.Add(new MESKittingOutStkInput()
|
||||
{
|
||||
@@ -189,14 +186,14 @@ namespace Tnb.ProductionMgr
|
||||
create_id = _userManager.UserId,
|
||||
wmsKittingoutDs = new List<MESKittingOutStkDInput>(),
|
||||
});
|
||||
|
||||
|
||||
input[0].wmsKittingoutDs = JsonConvert.DeserializeObject<List<MESKittingOutStkDInput>>(JsonConvert.SerializeObject(kittingOutInput.tableField115));
|
||||
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
Dictionary<string, object> header = new Dictionary<string, object>()
|
||||
{
|
||||
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
};
|
||||
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_KITTING_OUT_STK,JsonConvert.SerializeObject(input),header);
|
||||
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_KITTING_OUT_STK, JsonConvert.SerializeObject(input), header);
|
||||
Log.Information(sendResult);
|
||||
|
||||
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
|
||||
@@ -235,11 +232,11 @@ namespace Tnb.ProductionMgr
|
||||
kitting_out_id = prdKittingOutH.id,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true);
|
||||
// await _runService.Create(templateEntity, visualDevModelDataCrInput);
|
||||
|
||||
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
|
||||
|
||||
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
|
||||
{
|
||||
await _repository.InsertAsync(prdKittingOutH);
|
||||
if (prdKittingOutDs.Count > 0)
|
||||
@@ -261,10 +258,10 @@ namespace Tnb.ProductionMgr
|
||||
Log.Error(e.Message);
|
||||
throw Oops.Bah(e.Message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 齐套出库申请
|
||||
/// </summary>
|
||||
@@ -272,32 +269,32 @@ namespace Tnb.ProductionMgr
|
||||
/// <returns></returns>
|
||||
/// <exception cref="AppFriendlyException"></exception>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> KittingOutNew(KittingOutNewInput kittingOutInput)
|
||||
public async Task<dynamic> KittingOutNew(KittingOutNewInput kittingOutInput)
|
||||
{
|
||||
PrdKittingOutH prdKittingOutH = new PrdKittingOutH();
|
||||
string warehouse_id = "26103348825381";//二楼缓存仓
|
||||
try
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
PrdMoTask prdMoTask = await db.Queryable<PrdMoTask>().SingleAsync(x=>x.id==kittingOutInput.mo_task_id);
|
||||
BasMaterial basMaterial = await db.Queryable<BasMaterial>().SingleAsync(x=>x.id==prdMoTask.material_id);
|
||||
WmsCollocationSchemeH wmsCollocationSchemeH = await db.Queryable<WmsCollocationSchemeH>().SingleAsync(x=>x.id==kittingOutInput.collocation_scheme_id);
|
||||
List<WmsCollocationSchemeD> wmsCollocationSchemeDs = await db.Queryable<WmsCollocationSchemeD>().Where(x=>x.bill_id==kittingOutInput.collocation_scheme_id).ToListAsync();
|
||||
PrdMoTask prdMoTask = await db.Queryable<PrdMoTask>().SingleAsync(x => x.id == kittingOutInput.mo_task_id);
|
||||
BasMaterial basMaterial = await db.Queryable<BasMaterial>().SingleAsync(x => x.id == prdMoTask.material_id);
|
||||
WmsCollocationSchemeH wmsCollocationSchemeH = await db.Queryable<WmsCollocationSchemeH>().SingleAsync(x => x.id == kittingOutInput.collocation_scheme_id);
|
||||
List<WmsCollocationSchemeD> wmsCollocationSchemeDs = await db.Queryable<WmsCollocationSchemeD>().Where(x => x.bill_id == kittingOutInput.collocation_scheme_id).ToListAsync();
|
||||
List<string> materialIds = wmsCollocationSchemeDs.Select(x => x.material_id).ToList();
|
||||
List<BasMaterial> basMaterials = await db.Queryable<BasMaterial>().Where(x=>materialIds.Contains(x.id)).ToListAsync();
|
||||
Dictionary<string,object> unitIdDic = await db.Queryable<BasMaterial>()
|
||||
List<BasMaterial> basMaterials = await db.Queryable<BasMaterial>().Where(x => materialIds.Contains(x.id)).ToListAsync();
|
||||
Dictionary<string, object> unitIdDic = await db.Queryable<BasMaterial>()
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c) => b.Id == c.DictionaryTypeId && a.unit_id == c.EnCode)
|
||||
.Where((a,b,c)=>materialIds.Contains(a.id))
|
||||
.Select((a, b, c) => new
|
||||
.Where((a, b, c) => materialIds.Contains(a.id))
|
||||
.Select((a, b, c) => new
|
||||
{
|
||||
key = a.id,
|
||||
value = c.Id
|
||||
value = c.Id
|
||||
})
|
||||
.ToDictionaryAsync(x => x.key, x => x.value);
|
||||
Dictionary<string, string> unitCodeDic = basMaterials.ToDictionary(x => x.id, x => x.unit_id);
|
||||
OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(kittingOutInput.workstation_id, DictConst.RegionCategoryWorklineCode);
|
||||
|
||||
|
||||
List<MESKittingOutStkInput> input = new List<MESKittingOutStkInput>();
|
||||
input.Add(new MESKittingOutStkInput()
|
||||
{
|
||||
@@ -313,7 +310,7 @@ namespace Tnb.ProductionMgr
|
||||
create_id = _userManager.UserId,
|
||||
wmsKittingoutDs = new List<MESKittingOutStkDInput>(),
|
||||
});
|
||||
|
||||
|
||||
foreach (var item in wmsCollocationSchemeDs)
|
||||
{
|
||||
input[0].wmsKittingoutDs.Add(new MESKittingOutStkDInput()
|
||||
@@ -327,13 +324,13 @@ namespace Tnb.ProductionMgr
|
||||
box = item.box,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
Dictionary<string, object> header = new Dictionary<string, object>()
|
||||
{
|
||||
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
};
|
||||
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_KITTING_OUT_STK,JsonConvert.SerializeObject(input),header);
|
||||
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_KITTING_OUT_STK, JsonConvert.SerializeObject(input), header);
|
||||
Log.Information(sendResult);
|
||||
|
||||
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
|
||||
@@ -372,11 +369,11 @@ namespace Tnb.ProductionMgr
|
||||
kitting_out_id = prdKittingOutH.id,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true);
|
||||
// await _runService.Create(templateEntity, visualDevModelDataCrInput);
|
||||
|
||||
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
|
||||
|
||||
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
|
||||
{
|
||||
await _repository.InsertAsync(prdKittingOutH);
|
||||
if (prdKittingOutDs.Count > 0)
|
||||
@@ -398,7 +395,7 @@ namespace Tnb.ProductionMgr
|
||||
Log.Error(e.Message);
|
||||
throw Oops.Bah(e.Message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user