Browse Source

更新版本

master
zhaoxinyu 11 months ago
parent
commit
b8e13f0f31
  1. 34
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  2. 343
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PDMakeService.cs
  3. 35
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  4. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs
  5. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  6. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs
  7. 10
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/BalanceSum/BalanceSumDapperRepository.cs

34
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs

@ -5,14 +5,18 @@ using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Castle.Core.Internal;
using DocumentFormat.OpenXml.Bibliography;
using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Bases;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.Services;
using Shouldly;
using SqlSugar;
using TaskJob.EventArgs;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Uow;
@ -22,6 +26,7 @@ using Win.Sfs.SettleAccount.Bases.DomainServices;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.Entities.BQ.Temp;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
@ -48,6 +53,7 @@ namespace Win.Sfs.SettleAccount.Bases
private readonly TaskJobService _service;
private readonly BaseDomainService _baseservice;
protected BA_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
@ -429,6 +435,34 @@ namespace Win.Sfs.SettleAccount.Bases
[HttpPost]
public virtual async Task<IActionResult> ReceivedAsync(List<string> p_ins)
{
var inv=await _invMng.GetInvoiceAsync(p_ins.FirstOrDefault()).ConfigureAwait(false);
#if DEBUG
//if (inv.BusinessType == EnumBusinessType.JisBBAC || inv.BusinessType == EnumBusinessType.JisHBPO)
//{
// var invstrs=string.Join(',', p_ins);
// var entities= await _invMng.GetInvoiceListAsync(p_ins).ConfigureAwait(false);
// foreach (var itm in entities)
// {
// itm.State = SettleBillState.扣减单生成中;
// }
// //await _repository.DbContext.BulkUpdateAsync(entities);
// var customConditionList =new List<CustomCondition>()
// { new CustomCondition() { Name = "invs", Value = invstrs }};
// var _taskid = await _service.ExportEnqueueAsync($"{inv.BusinessType.ToString()}生成待扣减单任务", ExportExtentsion.Excel, DateTime.Now.ToString("yyyyMM"), string.Empty, CurrentUser, typeof(PDMakeService),customConditionList, (rs) =>
// {
// }).ConfigureAwait(false);
// return new JsonResult(new { Code = 200, Message = "收票成功" });
//}
//else
//{
// bool issuc = await _invMng.ReceivedAsync(p_ins).ConfigureAwait(false);
// if (issuc == true)
// {
// return new JsonResult(new { Code = 200, Message = "收票成功" });
// }
// return new JsonResult(new { Code = 400, Message = "收票失败" });
//}
#endif
bool issuc = await _invMng.ReceivedAsync(p_ins).ConfigureAwait(false);
if (issuc == true)
{

343
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PDMakeService.cs

@ -0,0 +1,343 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using SettleAccount.Domain.BQ;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp;
using Volo.Abp.DependencyInjection;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.CommonManagers;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{
public class PDMakeService : BASE_SERVICE, ITransientDependency, IExportJob
{
protected readonly SettleAccountDbContext _dbcontext;
public PDMakeService(
SettleAccountDbContext dbcontext,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager) : base(excelImportService, snowflakeIdGenerator, commonManager)
{
_dbcontext = dbcontext;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{
var billList = property.Where(p => p.Name == "invoiceBillNum").FirstOrDefault().Value.Split(',').ToList();
var invList = _dbcontext.Set<INVOICE_GRP>().Where(p => billList.Contains(p.InvbillNum)).ToList();//所有提交发票信息
int count = invList.Select(p => p.InvGroupNum).Distinct().Count();
if (count > 1)
{
throw new UserFriendlyException($"发票不属于一个发票分组");
}
var lostlist = invList.Where(p => p.InvoiceState == InvoiceBillState. || p.State != SettleBillState.).ToList();
if (lostlist.Count > 0)
{
var invs = lostlist.Select(p => p.InvbillNum).ToList();
throw new UserFriendlyException($"发票{string.Join(",", invs)}已经报废或不是财务审核状态!", "400");
}
var inv = invList.FirstOrDefault();
if (inv.BusinessType == EnumBusinessType.JisBBAC)
{
var pdlist = _dbcontext.Set<BBAC_PD>().Where(p => billList.Contains(p.BillNum)).ToList();//包含发票号的代扣减单
if (pdlist != null && pdlist.Count > 0)
{
var invs = pdlist.Select(p => p.BillNum).ToList();
throw new UserFriendlyException($"发票{string.Join(",", invs)}已经生成待扣减过不能再次提交", "400");
}
var parentList = invList.Select(p => p.ParentInvbillNum).ToList();//所有发票存在父发票号
List<string> oldinvs = new List<string>();
oldinvs.AddRange(billList);
if (parentList != null && parentList.Count > 0)
{
oldinvs.AddRange(parentList);
}
List<string> oldlist = new List<string>();//以前提交过的发票
List<string> newlist = new List<string>();//没有提交过的发票
var pdoldlist = pdlist.Where(p => oldinvs.Contains(p.BillNum)).ToList();
if (pdoldlist != null && pdoldlist.Count > 0)
{
oldlist = pdoldlist.Select(p => p.BillNum).ToList();//已经存在扣减记录,的发票号
}
newlist = billList.Where(p => !oldlist.Contains(p)).ToList();//不存在扣减记录的发票号
List<BBAC_CAN_SA_DETAIL> entityList = new List<BBAC_CAN_SA_DETAIL>();//结算明细
var namelist = invList.Select(p => p.InvbillNum).ToList();
if (oldlist.Count > 0)
{
var involdList = invList.Where(p => oldinvs.Contains(p.ParentInvbillNum)).ToList();
var involdname = involdList.Select(p => p.InvbillNum);
var adjlist = _dbcontext.Set<PUB_ADJ_DETAIL>().Where(p => involdname.Contains(p.InvBillNum));
if (adjlist != null && adjlist.Any())
{
foreach (var itm in adjlist)
{
var detail = new BBAC_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: 0,
category: itm.BusinessType,
isReturn: itm.Qty > 0 ? false : true,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
contactid: itm.Extend1,//生产号
invbillnum: itm.InvBillNum,
partcode: itm.PartCode);
detail.ErpLoc = itm.ErpLoc;
detail.RealPartCode = itm.RealPartCode;
entityList.Add(detail);
}
}
}
if (newlist.Count > 0)
{
var entitys = invList.Where(p => newlist.Contains(p.InvbillNum)).ToList();
var entityDetail = _dbcontext.Set<BBAC_CAN_SA_DETAIL>().Where(p => newlist.Contains(p.InvbillNum)).ToList();//结算明细
var adjlist = _dbcontext.Set<PUB_ADJ_DETAIL>().Where(p => newlist.Contains(p.InvBillNum)).ToList();//发票关联调整表明细
if (adjlist != null && adjlist.Count > 0)
{
foreach (var itm in adjlist)
{
var detail = new BBAC_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: 0,
category: itm.BusinessType,
isReturn: itm.Qty > 0 ? false : true,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
contactid: itm.Extend1,//生产号
invbillnum: itm.InvBillNum,
partcode: itm.PartCode
);
detail.ErpLoc = itm.ErpLoc;
detail.RealPartCode = itm.RealPartCode;
entityDetail.Add(detail);
}
}
entityList.AddRange(entityDetail);
}
var bbacmainlist = new List<BBAC_PD>();
foreach (var itm in invList)
{
var bbac = new BBAC_PD(
guid: itm.Id,
version: int.Parse(DateTime.Now.ToString("yyyyMM")),
billNum: itm.InvbillNum,
settleBillNum: itm.InvGroupNum,
state: SettleBillState.,
invGroupNum: itm.InvGroupNum,
site: string.Empty
);
bbacmainlist.Add(bbac);
}
var bbacDetail = new List<BBAC_PD_DETAIL>();
foreach (var itm in entityList)
{
var detail = new BBAC_PD_DETAIL(
guid: itm.Id,
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvbillNum,
lU: itm.LU,
rELU: string.Empty,
pN: itm.PN,
rEPN: string.Empty,
site: itm.Site,
qty: itm.Qty,
price: 0,
invGroupNum: itm.InvGroupNum,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
extend1: string.Empty,
extend2: string.Empty,
extend3: string.Empty,
extend4: itm.PartCode,
p_businessType: itm.BusinessType
);//厂内实际零件号
detail.RELU = string.IsNullOrEmpty(itm.RealPartCode) ? itm.PartCode : itm.RealPartCode;//厂内替换零件号
detail.Extend2 = itm.ErpLoc;//ERP库位
bbacDetail.Add(detail);
}
_dbcontext.BulkInsert(bbacmainlist);
_dbcontext.BulkInsert(bbacDetail);
foreach (var itm in invList)
{
itm.State = SettleBillState.;
};
_dbcontext.BulkUpdate(invList);
}
else if (inv.BusinessType == EnumBusinessType.JisHBPO || inv.BusinessType == EnumBusinessType.MaiDanJianHBPO)
{
var pdlist = _dbcontext.Set<HBPO_PD>().Where(p => billList.Contains(p.BillNum)).ToList();//包含发票号的代扣减单
if (pdlist != null && pdlist.Count > 0)
{
var invs = pdlist.Select(p => p.BillNum).ToList();
throw new UserFriendlyException($"发票{string.Join(",", invs)}已经生成待扣减过不能再次提交", "400");
}
var parentList = invList.Select(p => p.ParentInvbillNum).ToList();//所有发票存在父发票号
List<string> oldinvs = new List<string>();
oldinvs.AddRange(billList);
if (parentList != null && parentList.Count > 0)
{
oldinvs.AddRange(parentList);
}
List<string> oldlist = new List<string>();//以前提交过的发票
List<string> newlist = new List<string>();//没有提交过的发票
var pdoldlist = pdlist.Where(p => oldinvs.Contains(p.BillNum)).ToList();
if (pdoldlist != null && pdoldlist.Count > 0)
{
oldlist = pdoldlist.Select(p => p.BillNum).ToList();//已经存在扣减记录,的发票号
}
newlist = billList.Where(p => !oldlist.Contains(p)).ToList();//不存在扣减记录的发票号
List<HBPO_CAN_SA_DETAIL> entityList = new List<HBPO_CAN_SA_DETAIL>();//结算明细
var namelist = invList.Select(p => p.InvbillNum).ToList();
if (oldlist.Count > 0)
{
var involdList = invList.Where(p => oldinvs.Contains(p.ParentInvbillNum)).ToList();
var involdname = involdList.Select(p => p.InvbillNum);
var adjlist = _dbcontext.Set<PUB_ADJ_DETAIL>().Where(p => involdname.Contains(p.InvBillNum));
if (adjlist != null && adjlist.Any())
{
foreach (var itm in adjlist)
{
var detail = new HBPO_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: 0,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum,
partcode: itm.PartCode
);
detail.ErpLoc = itm.ErpLoc;
detail.RealPartCode = itm.RealPartCode;
entityList.Add(detail);
}
}
}
if (newlist.Count > 0)
{
var entitys = invList.Where(p => newlist.Contains(p.InvbillNum)).ToList();
var entityDetail = _dbcontext.Set<HBPO_CAN_SA_DETAIL>().Where(p => newlist.Contains(p.InvbillNum)).ToList();//结算明细
var adjlist = _dbcontext.Set<PUB_ADJ_DETAIL>().Where(p => newlist.Contains(p.InvBillNum)).ToList();//发票关联调整表明细
if (adjlist != null && adjlist.Count > 0)
{
foreach (var itm in adjlist)
{
var entity = new HBPO_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: 0,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum,
partcode: itm.PartCode);
entity.ErpLoc = itm.ErpLoc;//补字段库位
entity.PartCode = itm.RealPartCode;//真实零件号
entityDetail.Add(entity);
}
}
entityList.AddRange(entityDetail);
}
var bbacmainlist = new List<HBPO_PD>();
foreach (var itm in invList)
{
var bbac = new HBPO_PD(
guid: itm.Id,
version: int.Parse(DateTime.Now.ToString("yyyyMM")),
billNum: itm.InvbillNum,
settleBillNum: itm.InvGroupNum,
state: SettleBillState.,
invGroupNum: itm.InvGroupNum,
site: string.Empty
);
bbacmainlist.Add(bbac);
}
var bbacDetail = new List<HBPO_PD_DETAIL>();
foreach (var itm in entityList)
{
var entity = new HBPO_PD_DETAIL(
guid: itm.Id,
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvbillNum,
lU: itm.LU,
rELU: string.Empty,
pN: itm.PN,
rEPN: string.Empty,
site: itm.Site,
qty: itm.Qty,
price: 0,
invGroupNum: itm.InvGroupNum,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
extend1: string.Empty,
extend2: string.Empty,
extend3: string.Empty,
extend4: itm.PartCode,
p_businessType: itm.BusinessType
);
entity.RELU = string.IsNullOrEmpty(itm.RealPartCode) ? itm.PartCode : itm.RealPartCode;//厂内替换零件号
entity.Extend2 = itm.ErpLoc;//ERP库位
bbacDetail.Add(entity
);
}
_dbcontext.BulkInsert(bbacmainlist);
_dbcontext.BulkInsert(bbacDetail);
foreach (var itm in invList)
{
itm.State = SettleBillState.;
};
_dbcontext.BulkUpdate(invList);
}
return id.ToString();
}
}
}

35
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -75,7 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
private readonly INormalEfCoreRepository<CodeSetting, Guid> _codeRepository;
private readonly INormalEfCoreRepository<VmiBalanceSumDetail, Guid> _vmiBalanceSumDetailRepository;
private readonly INormalEfCoreRepository<VmiBalanceSum, Guid> _vmiBalanceSumRepository;
private readonly INormalEfCoreRepository<BalanceSum, Guid> _balanceSumRepository;
private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly IHubContext<PageHub> _hubContext;
@ -93,6 +93,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<VmiLog, Guid> logRepository,
INormalEfCoreRepository<CodeSetting, Guid> codeRepository,
INormalEfCoreRepository<VmiBalanceSumDetail, Guid> vmiBalanceSumDetailRepository,
INormalEfCoreRepository<BalanceSum, Guid> balanceSumRepository,
IBlobContainer<MyFileContainer> fileContainer,
Volo.Abp.ObjectMapping.IObjectMapper maper,
IHubContext<PageHub> hubContext,
@ -105,6 +109,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
)
{
_balanceSumRepository = balanceSumRepository;
_vmiBalanceSumRepository = vmiBalanceSumRepository;
_vmiBalanceSumDetailRepository = vmiBalanceSumDetailRepository;
_maper = maper;
@ -194,7 +199,35 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <summary>
/// 1.库存余额查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<PagedResultDto<BalanceSum>> BalanceSumByVersion(RequestDto input)
{
var entities = await _balanceSumRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _balanceSumRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
//var dtos = _maper.Map<List<VmiBalanceSumDetail>, List<VmiBalanceSumDetailDto>>(entities);
//dtos = dtos.OrderByDescending(p => p.BillTime).ToList();
return new PagedResultDto<BalanceSum>(totalCount, entities);
}
/// <summary>
/// 1.1库存余额导出
/// </summary>
[HttpPost]
public async Task<string> BalanceSumByVersionExport(RequestDto input)
{
var entities = await _balanceSumRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount, true).ConfigureAwait(false);
var fileName = $"库存余额_期间_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx";
var content = this.GetContent(entities, "库存余额");
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
return fileName;
}

5
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs

@ -106,7 +106,10 @@ namespace Win.Sfs.SettleAccount
return implementationFactory.GetService<HBPOEdiWmsDiffService>();
}
if (key.Equals(typeof(PDMakeService).FullName))
{
return implementationFactory.GetService<PDMakeService>();
}

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -363,6 +363,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
return await _repository.Where(p => invs.Contains(p.InvbillNum)).ToListAsync().ConfigureAwait(false);
}
/// <summary>
/// 客户已收票
/// </summary>
@ -821,11 +826,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
itm.State = SettleBillState.;
};
await _repository.DbContext.BulkUpdateAsync(invList).ConfigureAwait(false);
return true;
}
}
public virtual async Task<bool> Reject(INVOICE_GRP p_entity)
{

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs

@ -35,6 +35,10 @@ namespace Win.Sfs.SettleAccount
= 9,
[Description("发票生成中")]
= 10,
[Description("扣减单生成中")]
= 11,
}
public enum PDBillState

10
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/BalanceSum/BalanceSumDapperRepository.cs

@ -346,7 +346,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
"isnull(a.[{0}09],0)+\n" +
"isnull(a.[{0}10],0)+\n" +
"isnull(a.[{0}11],0)+\n" +
"isnull(a.[{0}12],0) BalanceQty ,\n" +
"isnull(a.[{0}12],0) BalanceQty ,\n" +
"isnull(b.[{0}01],0) +\n" +
"isnull(b.[{0}02],0) +\n" +
"isnull(b.[{0}03],0) +\n" +
@ -421,7 +421,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
"select * from (\n" +
"select\n" +
"ISNULL(a.PN,b.PN) PN,\n" +
"ISNULL(a.LU,a.LU) LU,A.BillTime,\n" +
"ISNULL(a.LU,b.LU) LU,A.BillTime,\n" +
"B.EDITime,\n" +
"ISNULL(A.qty,0) ShippingQty,\n" +
"ISNULL(b.qty,0) EdiQty ,\n" +
@ -431,7 +431,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
"from\n" +
"(select PN,LU,CustomerPartCodeNoSpace,sum(Qty) qty ,MAX(BillTime) BillTime from Set_BBAC_SE_DETAIL where BusinessType=1 group by PN,CustomerPartCodeNoSpace,LU) a full join\n" +
"(select PN,LU,CustomerPartCodeNoSpace,sum(Qty) qty ,MAX(CreationTime) EDITime from Set_BBAC_SE_EDI group by PN,CustomerPartCodeNoSpace,LU) b on a.PN=b.PN and a.CustomerPartCodeNoSpace=b.CustomerPartCodeNoSpace\n" +
"WHERE A.qty<>B.qty ) temp order by EDITime,BillTime\n";
"WHERE isnull(A.qty,0)<>isnull(B.qty,0) ) temp order by EDITime,BillTime\n";
var entities = DbConnection.Query<EdiWms>(sql, null, null, false, 1200, null).ToList();
foreach(var itm in entities)
{
@ -451,7 +451,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
"select * from (\n" +
"select\n" +
"ISNULL(a.PN,b.PN) PN,\n" +
"ISNULL(a.LU,a.LU) LU,A.BillTime,\n" +
"ISNULL(a.LU,b.LU) LU,A.BillTime,\n" +
"B.EDITime,\n" +
"ISNULL(A.qty,0) ShippingQty,\n" +
"ISNULL(b.qty,0) EdiQty ,\n" +
@ -461,7 +461,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
"from\n" +
"(select PN,LU,CustomerPartCodeNoSpace,sum(Qty) qty ,MAX(BillTime) BillTime from Set_HBPO_SE_DETAIL where BusinessType=2 group by PN,CustomerPartCodeNoSpace,LU) a full join\n" +
"(select PN,LU,CustomerPartCodeNoSpace,sum(Qty) qty ,MAX(CreationTime) EDITime from Set_HBPO_SE_EDI group by PN,CustomerPartCodeNoSpace,LU) b on a.PN=b.PN and a.CustomerPartCodeNoSpace=b.CustomerPartCodeNoSpace\n" +
"WHERE A.qty<>B.qty ) temp order by EDITime,BillTime\n";
"WHERE isnull(A.qty,0)<>isnull(B.qty,0) ) temp order by EDITime,BillTime\n";
var entities = DbConnection.Query<EdiWms>(sql, null, null, false, 1200, null).ToList();
foreach (var itm in entities)
{

Loading…
Cancel
Save