|
@@ -1,5 +1,6 @@
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Diagnostics;
|
|
|
using System.Linq;
|
|
|
using System.Linq.Expressions;
|
|
|
using System.Text.RegularExpressions;
|
|
@@ -3764,6 +3765,7 @@ namespace wms.service.Service
|
|
|
private RepositoryTask<BaseErrorInfo> _baseErrorInfoRepository => new RepositoryTask<BaseErrorInfo>();
|
|
|
|
|
|
private Repository<BillBominfo> _billBominfoRepository => new Repository<BillBominfo>();
|
|
|
+ private Repository<BillPaiKu> _billBillPaiKuRepository => new Repository<BillPaiKu>();
|
|
|
|
|
|
/// <summary>
|
|
|
/// 垛形主表
|
|
@@ -4012,24 +4014,39 @@ namespace wms.service.Service
|
|
|
|
|
|
//机台垛型编码
|
|
|
var stack = _BillBomsetgrpRepository.GetSingle(p => p.Id == stackdetail.BomSetHdrId && p.IsStop == 0);
|
|
|
- var macList = _basemachinforepository.GetList(p => stack.Code == p.SetGrpCode); //找到垛型对应的机台信息
|
|
|
- //查询出来的垛型没有对应的机台,开始尝试通过产出匹配机台(适配同产出配多个垛型的情况)
|
|
|
- if (macList.Count <= 0)
|
|
|
+ //找到垛型对应的机台信息
|
|
|
+ //var macList = _basemachinforepository.GetList(p => stack.Code == p.SetGrpCode);
|
|
|
+ var paiKuList = _billBillPaiKuRepository.GetList(p => p.BomsetgrpId == stack.Id);
|
|
|
+
|
|
|
+ //查询出来的垛型没有对应的机台,开始尝试通过产出匹配机台(适配同产出配多个垛型的情况)
|
|
|
+ //if (macList.Count <= 0)
|
|
|
+ //{
|
|
|
+ // //查出当前这个垛型同产出对应的所有启用垛型
|
|
|
+ // var stacks =
|
|
|
+ // _BillBomsetgrpRepository.GetList(p => p.ProMaterCode == stack.ProMaterCode && p.IsStop == 0);
|
|
|
+ // var stackCodes = stacks.Select(x => x.Code).ToList();
|
|
|
+ // macList = _basemachinforepository.GetList(p => stackCodes.Contains(p.SetGrpCode));
|
|
|
+ //}
|
|
|
+ if (paiKuList.Count <= 0)
|
|
|
{
|
|
|
//查出当前这个垛型同产出对应的所有启用垛型
|
|
|
var stacks =
|
|
|
_BillBomsetgrpRepository.GetList(p => p.ProMaterCode == stack.ProMaterCode && p.IsStop == 0);
|
|
|
- var stackCodes = stacks.Select(x => x.Code).ToList();
|
|
|
- macList = _basemachinforepository.GetList(p => stackCodes.Contains(p.SetGrpCode));
|
|
|
+ var stackIds = stacks.Select(x => x.Id).ToList();
|
|
|
+ paiKuList = _billBillPaiKuRepository.GetList(p => stackIds.Contains(p.BomsetgrpId));
|
|
|
}
|
|
|
|
|
|
- //查询机台
|
|
|
- var wareList = macList.Where(x => !x.WarehouseCode.IsNullOrEmpty()).Select(p => p.WarehouseCode).Distinct()
|
|
|
- .OrderBy(v => v); //找到机台对应的仓库信息
|
|
|
+ //查询机台,找到机台对应的仓库信息
|
|
|
+ //var wareList = macList.Where(x => !x.WarehouseCode.IsNullOrEmpty()).Select(p => p.WarehouseCode).Distinct()
|
|
|
+ // .OrderBy(v => v);
|
|
|
+ var wareList = paiKuList.Where(x => !x.WarehouseCode.IsNullOrEmpty()).Select(p => p.WarehouseCode).Distinct()
|
|
|
+ .OrderBy(v => v);
|
|
|
+
|
|
|
if (!wareList.Any()) //当前订单没有对应仓库信息
|
|
|
{
|
|
|
res.ResCode = ResponseStatusCodeEnum.Fail.GetHashCode();
|
|
|
- res.ResMsg = $"条码:[{reqDto.SpoolCode}]对应的垛型[{stack.Code}]没有配置机台信息";
|
|
|
+ //res.ResMsg = $"条码:[{reqDto.SpoolCode}]对应的垛型[{stack.Code}]没有配置机台信息";
|
|
|
+ res.ResMsg = $"条码:[{reqDto.SpoolCode}]对应的垛型[{stack.Code}]没有配置排库信息";
|
|
|
var error = new BaseErrorInfo
|
|
|
{
|
|
|
BusName = "湿拉下盘注册",
|
|
@@ -4059,8 +4076,10 @@ namespace wms.service.Service
|
|
|
else //当前订单对应多个仓库信息
|
|
|
{
|
|
|
//先计算出当前物料在各仓库中应该的占比
|
|
|
- var wareTempList = macList.Where(x => !x.WarehouseCode.IsNullOrEmpty())
|
|
|
- .Select(p => new { p.WarehouseCode }).Distinct();
|
|
|
+ //var wareTempList = macList.Where(x => !x.WarehouseCode.IsNullOrEmpty())
|
|
|
+ // .Select(p => new { p.WarehouseCode }).Distinct();
|
|
|
+ var wareTempList = paiKuList.Where(x => !x.WarehouseCode.IsNullOrEmpty())
|
|
|
+ .Select(p => new { p.WarehouseCode }).Distinct();
|
|
|
var vaule = _sysconfigrepository.GetSingle(x => x.Code == "EqualDistributionTimeRange");
|
|
|
var equalDistributionTimeRange = Convert.ToDecimal(vaule.SContent);
|
|
|
equalDistributionTimeRange = Math.Abs(equalDistributionTimeRange);
|
|
@@ -4072,8 +4091,10 @@ namespace wms.service.Service
|
|
|
decimal currentWarehouseGoodsSum = warehouseGoods.Count(s =>
|
|
|
s.MatCode == reqDto.MatCode && s.WarehouseCode == x.WarehouseCode);
|
|
|
decimal warehouseGoodsSum = warehouseGoods.Count;
|
|
|
- var a = Convert.ToDecimal(macList.Count(m => m.WarehouseCode == x.WarehouseCode));
|
|
|
- var b = Convert.ToDecimal(macList.Count);
|
|
|
+ //var a = Convert.ToDecimal(macList.Count(m => m.WarehouseCode == x.WarehouseCode));
|
|
|
+ //var b = Convert.ToDecimal(macList.Count);
|
|
|
+ var a = Convert.ToDecimal(paiKuList.Where(m => m.WarehouseCode == x.WarehouseCode).Sum(m => m.Percent));
|
|
|
+ var b = Convert.ToDecimal(paiKuList.Sum(m => m.Percent));
|
|
|
var specificGravityValue = b == 0 ? 0 : a / b;
|
|
|
var currentSpecificGravityValue =
|
|
|
warehouseGoodsSum == 0 ? 0 : currentWarehouseGoodsSum / warehouseGoodsSum;
|
|
@@ -9277,7 +9298,7 @@ namespace wms.service.Service
|
|
|
/// <summary>
|
|
|
/// 机械臂设备号,用于判断是否启用直接入库
|
|
|
/// </summary>
|
|
|
- public string? RobotCode { get; set; }
|
|
|
+ public string? RobotCode { get; set; }=null;
|
|
|
}
|
|
|
|
|
|
public class FJGetTwoPalletDto : BaseRequest
|