Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -470,7 +470,7 @@ namespace Tnb.ProductionMgr
|
|||||||
minpacking = b.minpacking,
|
minpacking = b.minpacking,
|
||||||
main_num = k.number_of_primary_unit,
|
main_num = k.number_of_primary_unit,
|
||||||
deputy_num = k.number_of_auxiliary_unit,
|
deputy_num = k.number_of_auxiliary_unit,
|
||||||
third_equip_code = l.equip_code,
|
third_equip_code = f.code,
|
||||||
weight_name = l.label_point,
|
weight_name = l.label_point,
|
||||||
category_id = b.category_id,
|
category_id = b.category_id,
|
||||||
as_location_id = f.as_location_id,
|
as_location_id = f.as_location_id,
|
||||||
|
|||||||
@@ -61,11 +61,15 @@ namespace Tnb.ProductionMgr
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<dynamic> GetWeight(string device, string jihao)
|
public async Task<dynamic> GetWeight(string device, string jihao)
|
||||||
{
|
{
|
||||||
EqpDaq eqpDaq1 = await _repository.AsSugarClient().Queryable<EqpDaq>().Where(x => x.equip_code == device && x.label_name.Contains("允许称重")).FirstAsync();
|
EqpDaq eqpDaq1 = await _repository.AsSugarClient().Queryable<EqpDaq>().
|
||||||
|
LeftJoin<EqpEquipment>((x,y)=>x.equip_id==y.id).
|
||||||
|
Where((x,y) => y.code == device && x.label_name.Contains("允许称重")).FirstAsync();
|
||||||
if (eqpDaq1 == null)
|
if (eqpDaq1 == null)
|
||||||
{
|
{
|
||||||
throw Oops.Bah("未在数据采集中设置允许称重标签点");
|
throw Oops.Bah("未在数据采集中设置允许称重标签点");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
device = eqpDaq1.equip_code;
|
||||||
Dictionary<string, string> dicCommand = new(StringComparer.OrdinalIgnoreCase)
|
Dictionary<string, string> dicCommand = new(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
{
|
||||||
["DevName"] = device,
|
["DevName"] = device,
|
||||||
|
|||||||
@@ -40,13 +40,15 @@ namespace Tnb.ProductionMgr
|
|||||||
private readonly IBillRullService _billRullService;
|
private readonly IBillRullService _billRullService;
|
||||||
private readonly RedisData _redisData;
|
private readonly RedisData _redisData;
|
||||||
private readonly IWmsEmptyOutstockService _wmsEmptyOutstockService;
|
private readonly IWmsEmptyOutstockService _wmsEmptyOutstockService;
|
||||||
|
private readonly IWareHouseService _wareHouseService;
|
||||||
|
|
||||||
public TimeWorkService(
|
public TimeWorkService(
|
||||||
RedisData redisData,
|
RedisData redisData,
|
||||||
ISqlSugarRepository<BasMaterial> repository,
|
ISqlSugarRepository<BasMaterial> repository,
|
||||||
IBillRullService billRullService,
|
IBillRullService billRullService,
|
||||||
IOrganizeService organizeService,
|
IOrganizeService organizeService,
|
||||||
IWmsEmptyOutstockService wmsEmptyOutstockService
|
IWmsEmptyOutstockService wmsEmptyOutstockService,
|
||||||
|
IWareHouseService wareHouseService
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_redisData = redisData;
|
_redisData = redisData;
|
||||||
@@ -55,6 +57,7 @@ namespace Tnb.ProductionMgr
|
|||||||
_organizeService = organizeService;
|
_organizeService = organizeService;
|
||||||
_billRullService = billRullService;
|
_billRullService = billRullService;
|
||||||
_wmsEmptyOutstockService = wmsEmptyOutstockService;
|
_wmsEmptyOutstockService = wmsEmptyOutstockService;
|
||||||
|
_wareHouseService = wareHouseService;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
@@ -225,7 +228,7 @@ namespace Tnb.ProductionMgr
|
|||||||
|
|
||||||
List<String> eqpIds = equipments.Select(x => x.id).ToList();
|
List<String> eqpIds = equipments.Select(x => x.id).ToList();
|
||||||
List<EqpDaq> eqpDaqs = await _db.Queryable<EqpDaq>().Where(x => eqpIds.Contains(x.equip_id) && x.label_name.Contains("允许入空箱")).ToListAsync();
|
List<EqpDaq> eqpDaqs = await _db.Queryable<EqpDaq>().Where(x => eqpIds.Contains(x.equip_id) && x.label_name.Contains("允许入空箱")).ToListAsync();
|
||||||
BasFactoryConfig config = await _db.Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN);
|
//BasFactoryConfig config = await _db.Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN);
|
||||||
foreach (var equipment in equipments)
|
foreach (var equipment in equipments)
|
||||||
{
|
{
|
||||||
EqpDaq eqpDaq = eqpDaqs.FirstOrDefault(x => x.equip_id==equipment.id);
|
EqpDaq eqpDaq = eqpDaqs.FirstOrDefault(x => x.equip_id==equipment.id);
|
||||||
@@ -255,10 +258,11 @@ namespace Tnb.ProductionMgr
|
|||||||
postData.biz_type = WmsWareHouseConst.BIZTYPE_WMSDELIVERY_ID;
|
postData.biz_type = WmsWareHouseConst.BIZTYPE_WMSDELIVERY_ID;
|
||||||
postData.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
|
postData.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
|
||||||
Log.Information($"【FixedPointDelivery】注塑定点配送,参数:{JsonConvert.SerializeObject(postData)}");
|
Log.Information($"【FixedPointDelivery】注塑定点配送,参数:{JsonConvert.SerializeObject(postData)}");
|
||||||
string sendResult = HttpUtils.RequestPost($"{config.value}/api/wms/ware-house/common-create-pretask", JsonConvert.SerializeObject(postData), null);
|
Result result = await _wareHouseService.CommonCreatePretask(postData);
|
||||||
|
// string sendResult = HttpUtils.RequestPost($"{config.value}/api/wms/ware-house/common-create-pretask", JsonConvert.SerializeObject(postData), null);
|
||||||
// string sendResult = HttpUtils.RequestPost($"http://localhost:9232/api/wms/ware-house/common-create-pretask", JsonConvert.SerializeObject(postData), null);
|
// string sendResult = HttpUtils.RequestPost($"http://localhost:9232/api/wms/ware-house/common-create-pretask", JsonConvert.SerializeObject(postData), null);
|
||||||
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
|
// AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
|
||||||
if(authResponse.code == 200 && authResponse.data.ObjToBool())
|
if(result.code == HttpStatusCode.OK)
|
||||||
{
|
{
|
||||||
msg += $"{equipment.name}注塑定点配送成功,";
|
msg += $"{equipment.name}注塑定点配送成功,";
|
||||||
Log.Information($"【FixedPointDelivery】{equipment.name}注塑定点配送成功");
|
Log.Information($"【FixedPointDelivery】{equipment.name}注塑定点配送成功");
|
||||||
@@ -266,8 +270,8 @@ namespace Tnb.ProductionMgr
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg += $"{equipment.name}注塑定点配送失败:{authResponse.msg},";
|
msg += $"{equipment.name}注塑定点配送失败:{result.msg},";
|
||||||
Log.Error($"【FixedPointDelivery】{equipment.name}注塑定点配送失败:{authResponse.msg}");
|
Log.Error($"【FixedPointDelivery】{equipment.name}注塑定点配送失败:{result.msg}");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user