修复bug
This commit is contained in:
Binary file not shown.
@@ -25,6 +25,7 @@ using WMS.Web.Domain.Values;
|
|||||||
using WMS.Web.Core.Dto.Erp;
|
using WMS.Web.Core.Dto.Erp;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using WMS.Web.Domain.Services;
|
||||||
|
|
||||||
namespace WMS.Web.Api.Controllers
|
namespace WMS.Web.Api.Controllers
|
||||||
{
|
{
|
||||||
@@ -88,7 +89,11 @@ namespace WMS.Web.Api.Controllers
|
|||||||
[Route("hj")]
|
[Route("hj")]
|
||||||
public async Task<string> TestHJ()
|
public async Task<string> TestHJ()
|
||||||
{
|
{
|
||||||
//await _inStockTaskService.ErpDel(DateTime.Now.AddDays(-100));
|
//await _inStockTaskService.ErpDel();
|
||||||
|
//await _outStockTaskService.BillQueryForMisDeliveryOutStock(true, new List<string>() { "QTCK026812" });
|
||||||
|
await _inStockTaskService.SysnMiscellaneous(new List<string>() { "QTRK028204" }, true);
|
||||||
|
|
||||||
|
|
||||||
// List<int> boxIds = new List<int>();
|
// List<int> boxIds = new List<int>();
|
||||||
// boxIds.Add(5324);
|
// boxIds.Add(5324);
|
||||||
//var b= await _inStockService.UnBind(boxIds, true);
|
//var b= await _inStockService.UnBind(boxIds, true);
|
||||||
@@ -431,7 +436,7 @@ namespace WMS.Web.Api.Controllers
|
|||||||
if (IscanAccess)
|
if (IscanAccess)
|
||||||
return Result<bool>.ReFailure(ResultCodes.Concurrent_Instock);
|
return Result<bool>.ReFailure(ResultCodes.Concurrent_Instock);
|
||||||
|
|
||||||
Console.WriteLine("process..."+ IscanAccess);
|
Console.WriteLine("process..." + IscanAccess);
|
||||||
_redisConcurrentProcessService.UpdateAccessStatus(cacheKey, true);
|
_redisConcurrentProcessService.UpdateAccessStatus(cacheKey, true);
|
||||||
var tt2 = _redisConcurrentProcessService.GetRedisKeyValue(cacheKey);
|
var tt2 = _redisConcurrentProcessService.GetRedisKeyValue(cacheKey);
|
||||||
Console.WriteLine("redis1:" + tt2);
|
Console.WriteLine("redis1:" + tt2);
|
||||||
@@ -442,7 +447,7 @@ namespace WMS.Web.Api.Controllers
|
|||||||
[Route("lst3")]
|
[Route("lst3")]
|
||||||
public async Task<bool> lst3()
|
public async Task<bool> lst3()
|
||||||
{
|
{
|
||||||
var data=await _erpService.BillQueryForPurchaseInStockBy("1541693",null);
|
var data = await _erpService.BillQueryForPurchaseInStockBy("1541693", null);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,6 +183,12 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
//改变状态
|
//改变状态
|
||||||
public void ChangeInstockStatus()
|
public void ChangeInstockStatus()
|
||||||
{
|
{
|
||||||
|
//明细都作废后 整个单据作废
|
||||||
|
if (this.Details.Count() == this.Details.Where(w => w.IsRepeal == true).Count())
|
||||||
|
{
|
||||||
|
this.Status = InstockStatus.Repeal;
|
||||||
|
return;
|
||||||
|
}
|
||||||
//明细中:所有的应入数量之和
|
//明细中:所有的应入数量之和
|
||||||
var totalAccruedQty = this.Details.Where(x => x.IsRepeal != true).Sum(x => x.AccruedQty);
|
var totalAccruedQty = this.Details.Where(x => x.IsRepeal != true).Sum(x => x.AccruedQty);
|
||||||
|
|
||||||
|
|||||||
@@ -161,6 +161,13 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
{
|
{
|
||||||
if (this.Status == OutStockStatus.Repeal)
|
if (this.Status == OutStockStatus.Repeal)
|
||||||
return;
|
return;
|
||||||
|
//明细都作废后 整个单据作废
|
||||||
|
if (this.Details.Count() == this.Details.Where(w => w.IsRepeal == true).Count())
|
||||||
|
{
|
||||||
|
this.Status = OutStockStatus.Repeal;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var details = this.Details.Where(w => w.IsRepeal != true).ToList();
|
var details = this.Details.Where(w => w.IsRepeal != true).ToList();
|
||||||
|
|
||||||
if (details.Where(w => w.RealityQty <= 0).Count() == details.Count())
|
if (details.Where(w => w.RealityQty <= 0).Count() == details.Count())
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
{
|
{
|
||||||
//老物料,应收数量修改为0
|
//老物料,应收数量修改为0
|
||||||
det.AccruedQty = 0;
|
det.AccruedQty = 0;
|
||||||
|
det.IsRepeal = true;
|
||||||
}
|
}
|
||||||
//操作完后剔除
|
//操作完后剔除
|
||||||
erp_removeList.Add(erp_data);
|
erp_removeList.Add(erp_data);
|
||||||
@@ -593,14 +593,21 @@ namespace WMS.Web.Domain.Services
|
|||||||
else if (details_Groups.Sum(x => x.RealityQtyTotal) >= details_Groups.Sum(x => x.AccruedQtyTotal))
|
else if (details_Groups.Sum(x => x.RealityQtyTotal) >= details_Groups.Sum(x => x.AccruedQtyTotal))
|
||||||
order.Status = InstockStatus.Already;
|
order.Status = InstockStatus.Already;
|
||||||
|
|
||||||
|
//明细都作废后 整个单据作废
|
||||||
|
if (order.Details.Count() == order.Details.Where(w => w.IsRepeal == true).Count())
|
||||||
|
{
|
||||||
|
order.Status = InstockStatus.Repeal;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//2.4金蝶删除的明细,要把任务单里的明细应入库数量改为0
|
//2.4金蝶删除的明细,要把任务单里的明细应入库数量改为0
|
||||||
data_list.SelectMany(x => x.Details).Where(c => !erp_list.Any(a => a.ErpDetailId == c.ErpDetailId)).ToList().ForEach(x => { x.AccruedQty = 0; });
|
data_list.SelectMany(x => x.Details).Where(c => !erp_list.Any(a => a.ErpDetailId == c.ErpDetailId))
|
||||||
|
.ToList()
|
||||||
|
.ForEach(x => { x.AccruedQty = 0;x.IsRepeal = true; });
|
||||||
|
|
||||||
//过滤掉已经作废的单据
|
//过滤掉已经作废的单据
|
||||||
data_list = data_list.Where(w => w.Status != InstockStatus.Repeal).ToList();
|
//data_list = data_list.Where(w => w.Status != InstockStatus.Repeal).ToList();
|
||||||
//更新修改时间
|
//更新修改时间
|
||||||
data_list.ForEach(f => f.WmsUpdateTime = DateTime.Now);
|
data_list.ForEach(f => f.WmsUpdateTime = DateTime.Now);
|
||||||
//2.3.提交任务单的修改
|
//2.3.提交任务单的修改
|
||||||
|
|||||||
@@ -170,16 +170,30 @@ namespace WMS.Web.Domain.Services
|
|||||||
isUpdate = SsynDateComparison(outStockTask, erps);
|
isUpdate = SsynDateComparison(outStockTask, erps);
|
||||||
foreach (var erp in erps)
|
foreach (var erp in erps)
|
||||||
{
|
{
|
||||||
//仓库不同 拆分成不同的
|
//仓库不同 拆分成不同的 //如果该明细作废 则不修改了
|
||||||
var detail = outStockTask.Details.FirstOrDefault(w => w.MaterialNumber == erp.MaterialNumber);
|
var details = outStockTask.Details.Where(w => w.MaterialNumber == erp.MaterialNumber).ToList();
|
||||||
//如果该明细作废 则不修改了
|
bool isAdd = false;
|
||||||
if (detail != null && detail.IsRepeal == true)
|
if (details.Count() == 0) isAdd = true;
|
||||||
|
OutStockTaskDetails detail = null;
|
||||||
|
if (details.Where(w => w.IsRepeal != true).Count() > 0)
|
||||||
|
{
|
||||||
|
detail = details.Where(w => w.IsRepeal != true).FirstOrDefault();
|
||||||
|
isAdd = false;
|
||||||
|
}
|
||||||
|
if (details.Count() != 0 && details.Count() == details.Where(w => w.IsRepeal == true).Count())
|
||||||
|
{
|
||||||
|
//因为出库任务单有合并的情况 所以需要过滤一下
|
||||||
|
//如果这个明细已经作废,同时金蝶的明细id对不上 则新增一条明细
|
||||||
|
if (details.SelectMany(s => s.ErpDetails).Where(w => w.Erp_DetailId == erp.Erp_DetailId).Count() == 0)
|
||||||
|
isAdd = true;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
//操作完后剔除
|
//操作完后剔除
|
||||||
erp_removeList.Add(erp);
|
erp_removeList.Add(erp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (detail == null)
|
}
|
||||||
|
if (isAdd == true)
|
||||||
{
|
{
|
||||||
//添加一条物料明细
|
//添加一条物料明细
|
||||||
detail = _mapper.Map<OutStockTaskDetails>(erp);
|
detail = _mapper.Map<OutStockTaskDetails>(erp);
|
||||||
@@ -218,8 +232,9 @@ namespace WMS.Web.Domain.Services
|
|||||||
outStockTask.GenerateStatus();
|
outStockTask.GenerateStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//过滤掉已作废的单
|
//
|
||||||
var update_date_list = data_list.Where(w => update_ids.Contains(w.Id) && w.Status != OutStockStatus.Repeal).ToList();
|
//var update_date_list = data_list.Where(w => update_ids.Contains(w.Id) && w.Status != OutStockStatus.Repeal).ToList();
|
||||||
|
var update_date_list = data_list.Where(w => update_ids.Contains(w.Id)).ToList();
|
||||||
//更新修改时间
|
//更新修改时间
|
||||||
update_date_list.ForEach(f => f.WmsUpdateTime = DateTime.Now);
|
update_date_list.ForEach(f => f.WmsUpdateTime = DateTime.Now);
|
||||||
//2.2.提交修改
|
//2.2.提交修改
|
||||||
@@ -290,6 +305,8 @@ namespace WMS.Web.Domain.Services
|
|||||||
//金蝶删除明细数据后 wms对应数据修改为0
|
//金蝶删除明细数据后 wms对应数据修改为0
|
||||||
ed.AccruedQty = 0;
|
ed.AccruedQty = 0;
|
||||||
d.AccruedQty = d.ErpDetails.Sum(s => s.AccruedQty);
|
d.AccruedQty = d.ErpDetails.Sum(s => s.AccruedQty);
|
||||||
|
if (d.AccruedQty == 0)
|
||||||
|
d.IsRepeal = true;
|
||||||
isUpdate = true;
|
isUpdate = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user