Administrator 3 years ago
parent
commit
9feb431676
  1. 28
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs
  2. 10
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  3. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

28
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs

@ -200,7 +200,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
tm1 == null ? 0 : tm1.Qty, tm1 == null ? 0 : tm1.Qty,
itm.OutPutQty, itm.OutPutQty,
itm.Price, itm.Price,
itm.Amt itm.Amt,
itm.RealityNumber
); );
@ -246,7 +247,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{ {
var fileList = _joblist.Select(p => p.RealDownFileName).ToList(); var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();//无订单 List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();//无订单
List<WmsSharePart90OutPutDetial> _lstBill = new List<WmsSharePart90OutPutDetial>();//有订单 List<WmsSharePart90OutPutDetial> _lst90Bill = new List<WmsSharePart90OutPutDetial>();//有订单
foreach (var filename in fileList) foreach (var filename in fileList)
{ {
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename; string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
@ -258,7 +259,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
//NoOrder用来标识采购订单号为空的数据 //NoOrder用来标识采购订单号为空的数据
var _list = _listSummary.Where(p => p.OrderBillNum == "NoOrder").ToList();//没有采购订单号的集合 var _list = _listSummary.Where(p => p.OrderBillNum == "NoOrder").ToList();//没有采购订单号的集合
var _listBill = _list90Summary.Where(p => !string.IsNullOrEmpty(p.OrderBillNum) && p.OrderBillNum != "NoOrder").ToList();//有采购订单号的集合 var _list90Bill = _list90Summary.Where(p => !string.IsNullOrEmpty(p.OrderBillNum) && p.OrderBillNum != "NoOrder").ToList();//有采购订单号的集合
//var _list = _excelHelper.ExcelToList<WmsSharePartOutPutDetial>(); //var _list = _excelHelper.ExcelToList<WmsSharePartOutPutDetial>();
@ -288,15 +289,16 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
p.StockQty, p.StockQty,
p.Qty, p.Qty,
p.Price, p.Price,
p.Amt p.Amt,
p.RealityNumber
)); ));
_lst.AddRange(_list.ToArray()); _lst.AddRange(_list.ToArray());
} }
if (_listBill != null && _listBill.Count() > 0) if (_list90Bill != null && _list90Bill.Count() > 0)
{ {
var _lsAry = _listBill.Select(p => new var _lsAry = _list90Bill.Select(p => new
WmsSharePartOutPutDetial( WmsSharePart90OutPutDetial(
GuidGenerator.Create(), GuidGenerator.Create(),
p.WmsBillNum, p.WmsBillNum,
p.OrderBillNum, p.OrderBillNum,
@ -320,7 +322,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
p.Price, p.Price,
p.Amt p.Amt
)); ));
_lstBill.AddRange(_listBill.ToArray()); _lst90Bill.AddRange(_list90Bill.ToArray());
} }
} }
@ -371,7 +373,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
p.StockQty, p.StockQty,
p.Qty, p.Qty,
p.Price, p.Price,
p.Amt p.Amt,p.RealityNumber
)).ToList(); )).ToList();
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNoNum); int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNoNum);
@ -409,13 +411,13 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
//有采购订单号 //有采购订单号
//往Set_WmsSharePart90OutPutDetial表中存储 //往Set_WmsSharePart90OutPutDetial表中存储
if (_lstBill != null && _lstBill.Count>0) if (_lst90Bill != null && _lst90Bill.Count>0)
{ {
//有采购订单号 //有采购订单号
var outPutDetailBill = await _wmsRepository90.Where(p => p.Version == input.Version && !string.IsNullOrEmpty(p.OrderBillNum)).ToListAsync(); var outPutDetailBill = await _wmsRepository90.Where(p => p.Version == input.Version && !string.IsNullOrEmpty(p.OrderBillNum)).ToListAsync();
var error = from itm1 in outPutDetailBill var error = from itm1 in outPutDetailBill
join itm2 in _lstBill on join itm2 in _lst90Bill on
new { itm1.MaterialCode, itm1.OrderBillNum } new { itm1.MaterialCode, itm1.OrderBillNum }
equals equals
new { itm2.MaterialCode, itm2.OrderBillNum } new { itm2.MaterialCode, itm2.OrderBillNum }
@ -424,7 +426,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) }); var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
if (errList.Count() == 0) if (errList.Count() == 0)
{ {
var queryBill = from itm1 in _lstBill var queryBill = from itm1 in _lst90Bill
join itm2 in outPutDetailBill on join itm2 in outPutDetailBill on
new { itm1.MaterialCode, itm1.OrderBillNum } new { itm1.MaterialCode, itm1.OrderBillNum }
equals equals
@ -714,7 +716,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
, 0 , 0
, itm.Qty , itm.Qty
, itm.Price , itm.Price
, itm.Amt , itm.Amt,itm.RealityNumber
); );
_lsCopy.Add(_detail); _lsCopy.Add(_detail);
} }

10
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs

@ -2160,7 +2160,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public WmsSharePartOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc, public WmsSharePartOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc,
string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3,
string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty, decimal stockQty, string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty, decimal stockQty,
decimal outputQty, decimal price, decimal amt) decimal outputQty, decimal price, decimal amt,decimal realqty)
{ {
Id = id; Id = id;
WmsBillNum = wmsBillNum; WmsBillNum = wmsBillNum;
@ -2183,6 +2183,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
OutPutQty = outputQty; OutPutQty = outputQty;
Price = price; Price = price;
Amt = amt; Amt = amt;
RealityNumber = realqty;
} }
@ -2267,6 +2268,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[ImporterHeader(Name = "出库数量", IsIgnore = true)] [ImporterHeader(Name = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)] [ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
public decimal OutPutQty { set; get; } public decimal OutPutQty { set; get; }
[ImporterHeader(Name = "真实数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "真实数量", IsIgnore = true)]
public decimal RealityNumber { set; get; }
[ImporterHeader(Name = "开票单价")] [ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")] [ExporterHeader(DisplayName = "开票单价")]

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

@ -280,7 +280,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//var listCompare = DbConnection.Query<CompareExtend>(sql2); //var listCompare = DbConnection.Query<CompareExtend>(sql2);
var listCompare = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_inner_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); //var listCompare = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_inner_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure);
@ -299,7 +299,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//"WHERE\n" + //"WHERE\n" +
//" B.Kanban IS NULL"; //" B.Kanban IS NULL";
var listCompare1 = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_leftjoin_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); // var listCompare1 = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_leftjoin_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure);

Loading…
Cancel
Save