Browse Source

更新版本

master
学 赵 1 year ago
parent
commit
662ea68053
  1. 47
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  2. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  3. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs
  4. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  5. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs
  6. 146
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
  7. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs
  8. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_ADJ_DETAIL.cs
  9. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  10. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs
  11. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs

47
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs

@ -99,26 +99,31 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{
foreach (var itm in adjlist)
{
bbaclist.Add(new BBAC_CAN_SA_DETAIL(
guid: itm.Id,
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: itm.Price,
category: itm.BusinessType,
isReturn: itm.Qty > 0 ? false : true,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
contactid: itm.Extend1,//生产号
invbillnum: string.Empty,
partcode: itm.PartCode
));
var entity = new BBAC_CAN_SA_DETAIL(
guid: itm.Id,
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: itm.Price,
category: itm.BusinessType,
isReturn: itm.Qty > 0 ? false : true,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
contactid: itm.Extend1,//生产号
invbillnum: string.Empty,
partcode: itm.PartCode
);
entity.IsMaiDan = itm.IsMaiDan;
bbaclist.Add(entity);
}
}
var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据
@ -260,7 +265,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s
join p in priceList on d.PartCode equals p.LU
join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号
select new TEMP_CAN_SA_DETAIL
{

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs

@ -242,7 +242,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
// var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in entitys
join p in priceList on d.PartCode equals p.LU
join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL
{

5
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs

@ -51,18 +51,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public override async Task<string> GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input)
{
var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var errors=await _hbpoNotMng.GenerateSettlementOrder(entitys);
var errors = await _hbpoNotMng.GenerateSettlementOrder(entitys);
if (errors.Count > 0)
{
List<ERR_EXP_DTO> errorlist = new List<ERR_EXP_DTO>();
foreach (var itm in errors)
{
errorlist.Add(new ERR_EXP_DTO() { Message = itm });
}
return await ExportErrorReportAsync(errorlist);
}
return ApplicationConsts.SuccessStr;

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

@ -128,7 +128,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
// var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in entitys
join p in priceList on d.PartCode equals p.LU
join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL
{

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs

@ -40,6 +40,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
PUB_NOT_SA_MNG pubNotMng
) : base(excelImportService, snowflakeIdGenerator, commonManager, detailRepository)
{
_pubNotMng = pubNotMng;
}
public override async Task<string> GenerateSettlementOrder(PUB_NOT_SA_DETAIL_REQ_DTO input)

146
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs

@ -4,9 +4,14 @@ using System.Linq;
using System.ServiceModel.Channels;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Nito.AsyncEx;
using SettleAccount.Domain.BQ;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
@ -16,23 +21,162 @@ public class PendingDeductionService : ITransientDependency, IExportJob
protected readonly INormalEfCoreRepository<BBAC_SEC_DETAIL, Guid> _bbacSecRepository;
protected readonly INormalEfCoreRepository<HBPO_SEC_DETAIL, Guid> _hbpoSecRepository;
protected readonly INormalEfCoreRepository<PUB_SEC_DETAIL, Guid> _pubSecRepository;
protected readonly INormalEfCoreRepository<BBAC_PD_DETAIL, Guid> _bbacRepository;
protected readonly INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> _hbpoRepository;
protected readonly INormalEfCoreRepository<PUB_PD_DETAIL, Guid> _pubRepository;
public PendingDeductionService(
INormalEfCoreRepository<BBAC_SEC_DETAIL, Guid> bbacSecRepository,
INormalEfCoreRepository<HBPO_SEC_DETAIL, Guid> hbpoSecRepository,
INormalEfCoreRepository<PUB_SEC_DETAIL, Guid> pubSecRepository,
INormalEfCoreRepository<BBAC_PD_DETAIL, Guid> bbacRepository,
INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> hbpoRepository,
INormalEfCoreRepository<PUB_PD_DETAIL, Guid> pubRepository,
VmiAppService vimservice
)
{
_hbpoRepository = hbpoRepository;
_bbacRepository= bbacRepository;
_pubRepository= pubRepository;
_bbacSecRepository = bbacSecRepository;
_hbpoSecRepository= hbpoSecRepository;
_pubSecRepository= pubSecRepository;
_vimservice =vimservice;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> condition)
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{
var list = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value;
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value;
if (type == "BBACJIS")
{
var jisdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan==false);
var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan ==true);
var query = from itm in jisdetail
join itm1 in _bbacSecRepository
on new { itm.PN, itm.LU } equals new { itm1.PN,LU= itm1.PrimitiveLU } into temp1
from tm in temp1
where tm == null
select
new
{
BillTime = DateTime.Now,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = tm!=null?tm.ReplaceLU:itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = tm != null ? tm.ReplaceLU : itm.LU,
CustomerPartCode =string.IsNullOrEmpty(itm.Extend4)?string.Empty:itm.Extend4,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
};
var ls=query.ToList();
if (ls != null && ls.Count > 0)
{
foreach (var itm in ls)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.BillTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.BillTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.PartCode,
SettlementVinCode = itm.VinCode,
PartCode2 = itm.PartCode2,
CustomerPartCode = itm.CustomerPartCode,
VinCode = itm.VinCode,
OrderNum = itm.OrderNum,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
}
else if (type == "HBPOJIS")
{
var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum)).ToList();
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
}
else
{
var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum)).ToList();
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
}
return ApplicationConsts.SuccessStr;
return id.ToString();
}
}

3
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs

@ -1,4 +1,4 @@
using SettleAccount.Bases;
using SettleAccount.Bases;
using System;
using System.ComponentModel.DataAnnotations;
@ -47,6 +47,7 @@ public class BBAC_PD_DETAIL:PD_BASE
//public string GroupNum { get; set; } = null!;
public bool IsMaiDan { get; set; }
public BBAC_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string groupNum
,string extend1,string extend2,string extend3,string extend4

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_ADJ_DETAIL.cs

@ -105,7 +105,11 @@ public class HBPO_ADJ_DETAIL : SA_NOT_BASE
[Display(Name = "发票号")]
public string InvBillNum { get; set; }
/// <summary>
/// 是否是买单件
/// </summary>
[Display(Name = "是否是买单件")]
public bool IsMaiDan { get; set; }
public HBPO_ADJ_DETAIL(Guid guid ,string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType, string oldinv, string inv)

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

@ -479,6 +479,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
contactid: itm.Extend1,//生产号
invbillnum: itm.InvBillNum,
partcode:itm.PartCode
));
}
}
@ -509,6 +510,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
version: itm.Version,
billNum: itm.InvbillNum,
lU: itm.LU,
rELU: string.Empty,
pN: itm.PN,
rEPN: string.Empty,
@ -521,7 +524,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
extend1: string.Empty,
extend2: string.Empty,
extend3: string.Empty,
extend4: string.Empty
extend4: itm.PartCode
));
}
await _repository.DbContext.BulkInsertAsync(bbacmainlist);
@ -664,7 +667,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
extend1: string.Empty,
extend2: string.Empty,
extend3: string.Empty,
extend4: string.Empty
extend4: itm.PartCode
));
}
await _repository.DbContext.BulkInsertAsync(bbacmainlist);
@ -807,7 +810,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
extend1: string.Empty,
extend2: string.Empty,
extend3: string.Empty,
extend4: string.Empty
extend4: itm.PartCode
));
}
await _repository.DbContext.BulkInsertAsync(bbacmainlist);
@ -1530,7 +1533,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
//更新结算记录更新
var query = from itm in dtos
join itm1 in ls
on new { LU=itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate }
on new { LU=itm.LU,itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU,itm1.PartCode, itm1.BeginDate, itm1.EndDate }
join itm2 in details on new { itm.LU,itm.PartCode,itm.PN, itm.SettleDate } equals new { itm2.LU,itm2.PartCode,itm2.PN,itm2.SettleDate }
select itm2;
foreach (var itm in query)
@ -1542,7 +1545,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
var query1 = from itm in dtos
join itm1 in ls
on new {LU= itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate }
on new {LU= itm.LU,itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU,itm1.PartCode, itm1.BeginDate, itm1.EndDate }
join itm2 in p_adjlist on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate }
select itm2;

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs

@ -233,7 +233,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <returns></returns>
public virtual async Task<List<PUB_CAN_SA_DETAIL>> GetDetalListAsync(string billNum)
{
return await _detailRepository.Where(p=>p.InvGroupNum==billNum).ToListAsync();
return await _detailRepository.Where(p=>p.BillNum==billNum).ToListAsync();
}
/// <summary>
/// 获得主表信息
@ -242,7 +242,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <returns></returns>
public virtual async Task<PUB_CAN_SA> GetMainAsync(string billNum)
{
return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync();
return await _repository.Where(p => p.BillNum == billNum).FirstOrDefaultAsync();
}
/// <summary>
/// 获取发票对应结算分组所有零件

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs

@ -70,6 +70,8 @@ public class PUB_ADJ_DETAIL : SA_NOT_BASE
[Display(Name = "发票号")]
public string InvBillNum { get; set; }
[Display(Name = "是否是买单件")]
public bool IsMaiDan { get; set; }
public PUB_ADJ_DETAIL(Guid id, string keyCode, int version, string settleBillNum, string lU, string pN,
string site, decimal qty, string extend1, decimal price, string invGroupNum, DateTime settleDate,

Loading…
Cancel
Save