Browse Source

更新版本,错误提示

master
学 赵 1 year ago
parent
commit
7acf2af23c
  1. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  2. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs
  3. 27
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs
  4. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  5. 182
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
  6. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  7. 145
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs
  8. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs

@ -85,8 +85,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public async override Task<IActionResult> GenerateInvoice(string invbillNum)
{
var main =await _bbacMng.GetMainAsync(invbillNum);
if (main != null)
{
if (main.State != SettleBillState.)
{
return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" });
}
if (await _bbacMng.SetForwardState(main, SettleBillState.))
{
var entitys = await _bbacMng.GetDetalListAsync(invbillNum);//可结算
@ -105,6 +110,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL
{
SettleBillNum = d.SettleBillNum,
Site = d.Site,
Version = d.Version,
@ -159,7 +165,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
else
{
throw new UserFriendlyException(string.Format("{0}不存在该可结算单号", invbillNum));
return new JsonResult(new { Code = 400, Message = "不存在发票记录" });
}
return new JsonResult(new { Code = 200, Message = "生成成功" });
}

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

@ -95,7 +95,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
// });
// }
//}
return ApplicationConsts.SuccessStr;
// return ApplicationConsts.SuccessStr;
}

27
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs

@ -11,6 +11,7 @@ using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.ObjectMapping;
@ -78,8 +79,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{
var main =await _hbpoMng.GetMainAsync(invbillnum);
if (main != null)
{
if (main.State != SettleBillState.)
{
return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" });
}
if (await _hbpoMng.SetForwardState(main, SettleBillState.))
{
var entitys = await _hbpoMng.GetDetalListAsync(invbillnum);
@ -87,10 +96,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var notQuery = _notRepository.Where(p => groupNumList.Contains(p.InvGroupNum)).ToList();
var priceList = _priceRepository.ToList();//价格单
var errorList=await CheckInvoiceGenerationRules(entitys, priceList,main.BusinessType);//校验生成规则
var errorList = await CheckInvoiceGenerationRules(entitys, priceList, main.BusinessType);//校验生成规则
if (errorList.Count() > 0)
{
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) });
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) });
}
var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s
@ -111,10 +120,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
Qty = d.Qty,
GroupNum = d.GroupNum,
Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID="no",
ContractDocID = "no",
BeginDate = p.BeginTime,
EndDate = p.EndTime,
PartCode=d.PartCode
PartCode = d.PartCode
};
var dtos = q.ToList();
@ -138,19 +147,23 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
SettleDate = p.SettleDate,
GroupNum = p.GroupNum,
ContractDocID = string.Empty,
PartCode=p.PartCode
PartCode = p.PartCode
}).ToList();//不能结算
var falg= await FirstInvoice(entitys,new List<PUB_ADJ_DETAIL>(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty,main.BusinessType);
var falg = await FirstInvoice(entitys, new List<PUB_ADJ_DETAIL>(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType);
}
else//二次开票
{
var flag=await SecInvoice(entitys,new List<PUB_ADJ_DETAIL>(),dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType);
var flag = await SecInvoice(entitys, new List<PUB_ADJ_DETAIL>(), dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType);
}
}
}
}
else
{
return new JsonResult(new { Code = 400, Message = "不存在发票记录" });
}
return new JsonResult(new { Code = 200, Message = "生成成功" });
}

19
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs

@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore.Migrations;
using SettleAccount.Domain.BQ;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities;
using Win.Abp.Snowflakes;
@ -68,8 +69,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public async override Task<IActionResult> GenerateInvoice(string billnum)
{
var main = await _pubMng.GetMainAsync(billnum);
if (main != null)
{
if (main.State != SettleBillState.)
{
return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" });
}
if (await _pubMng.SetForwardState(main, SettleBillState.))
{
var entitys = await _pubMng.GetDetalListAsync(billnum);
@ -99,6 +107,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL
{
Id = d.Id,
SettleBillNum = d.SettleBillNum,
Site = d.Site,
Version = d.Version,
@ -115,7 +124,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
ContractDocID = "no",
BeginDate = p.BeginTime,
EndDate = p.EndTime,
PartCode=d.PartCode,//客户零件号
PartCode = d.PartCode,//客户零件号
};
var dtos = q.ToList();
if (dtos != null && dtos.Count > 0)
@ -123,16 +132,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
if (billnum.Substring(0, 1) == "C")//一次开票
{
await FirstInvoice(entitys, new List<PUB_ADJ_DETAIL>(), dtos, new List<TEMP_NOT_SA_DETAIL>(), main.Version, main.InvGroupNum, string.Empty, main.BusinessType);
await FirstInvoice(entitys, new List<PUB_ADJ_DETAIL>(), dtos, new List<TEMP_NOT_SA_DETAIL>(), main.Version, main.InvGroupNum, string.Empty, main.BusinessType);
}
else//二次开票
{
await SecInvoice(entitys,new List<PUB_ADJ_DETAIL>(), dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType);
await SecInvoice(entitys, new List<PUB_ADJ_DETAIL>(), dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType);
}
}
}
}
else
{
return new JsonResult(new { Code = 400, Message = "不存在发票记录" });
}
return new JsonResult(new { Code = 200, Message = "生成成功" });
}

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

@ -32,8 +32,6 @@ public class PendingDeductionService : ITransientDependency, IExportJob
INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> hbpoRepository,
INormalEfCoreRepository<PUB_PD_DETAIL, Guid> pubRepository,
VmiAppService vimservice
)
{
_hbpoRepository = hbpoRepository;
@ -105,8 +103,8 @@ public class PendingDeductionService : ITransientDependency, IExportJob
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
//SubBillType = EnumDeliverSubBillType.小件BBAC,
//BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.PartCode,
SettlementVinCode = itm.VinCode,
PartCode2 = itm.PartCode2,
@ -130,45 +128,118 @@ public class PendingDeductionService : ITransientDependency, IExportJob
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
// DeliverTime = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
}
else
{
var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum)).ToList();
switch (type)
{
case "ZhiGongJianBBAC":
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 = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.PN,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
break;
case "ZhiGongJianHBPO":
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 = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.PN,// 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
break;
case "MaiDanJianBBAC":
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 = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
@ -176,18 +247,99 @@ public class PendingDeductionService : ITransientDependency, IExportJob
case "MaiDanJianHBPO":
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 = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
break;
case "BeiJian":
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 = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
break;
case "YinDuJian":
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 = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}

5
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -174,11 +174,6 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
return await _priceListManager.DeleteListAsync(ids);
}
#endregion
#region 原方法(废弃)
// /// <summary>
// /// 获取总数

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

@ -78,151 +78,6 @@ namespace Win.Sfs.SettleAccount
//if (key.Equals(typeof(InvoiceSettledDiffExportService).FullName))
//{
// return implementationFactory.GetService<InvoiceSettledDiffExportService>();
//}
//if (key.Equals(typeof(UnSettledExportService).FullName))
//{
// return implementationFactory.GetService<UnSettledExportService>();
//}
//if (key.Equals(typeof(fisUnsettledDiffReport).FullName))
//{//ERP总成开票报表
// return implementationFactory.GetService<fisUnsettledDiffReport>();
//}
//if (key.Equals(typeof(PriceQtyDifferenceExportService).FullName))
//{//量差和价差分析报表
// return implementationFactory.GetService<PriceQtyDifferenceExportService>();
//}
//if (key.Equals(typeof(SettledPartAndErpPartPriceDiffExportService).FullName))
//{
// return implementationFactory.GetService<SettledPartAndErpPartPriceDiffExportService>();
//}
//if (key.Equals(typeof(SecMatchBaseExportService).FullName))
//{
// return implementationFactory.GetService<SecMatchBaseExportService>();
//}
//if (key.Equals(typeof(SettleFisDiffExportService).FullName))
//{
// return implementationFactory.GetService<SettleFisDiffExportService>();
//}
////大众看板结算与交货核对明细表(有条码)
//if (key.Equals(typeof(SettleKBWithCodeExportService).FullName))
//{
// return implementationFactory.GetService<SettleKBWithCodeExportService>();
//}
////大众备件结算核对明细表
//if (key.Equals(typeof(SettleSparePartExportService).FullName))
//{
// return implementationFactory.GetService<SettleSparePartExportService>();
//}
////大众备件未结明细
//if (key.Equals(typeof(SettleUnSparePartExportService).FullName))
//{
// return implementationFactory.GetService<SettleUnSparePartExportService>();
//}
////大众备件90天核对明细
//if (key.Equals(typeof(SettleSparePart90ExportService).FullName))
//{
// return implementationFactory.GetService<SettleSparePart90ExportService>();
//}
//if (key.Equals(typeof(InvoiceSettledDetailDiffExportService).FullName))
//{
// return implementationFactory.GetService<InvoiceSettledDetailDiffExportService>();
//}
//if (key.Equals(typeof(UnInvoiceSettledDetailDiffExportService).FullName))
//{
// return implementationFactory.GetService<UnInvoiceSettledDetailDiffExportService>();
//}
//if (key.Equals(typeof(UnSettleDiffExportService).FullName))
//{
// return implementationFactory.GetService<UnSettleDiffExportService>();
//}
//if (key.Equals(typeof(SettleDoorPanelExportService).FullName))
//{
// return implementationFactory.GetService<SettleDoorPanelExportService>();
//}
//if (key.Equals(typeof(UnsettledDetailReportService).FullName))
//{
// return implementationFactory.GetService<UnsettledDetailReportService>();
//}
//if (key.Equals(typeof(SettleKBWithOutCodeExportService).FullName))
//{
// return implementationFactory.GetService<SettleKBWithOutCodeExportService>();
//}
//if (key.Equals(typeof(SharePartUnSettledExport).FullName))
//{
// return implementationFactory.GetService<SharePartUnSettledExport>();
//}
////红旗、一汽轿车结算报表
//if (key.Equals(typeof(HQFSettledDetailDiffExportService).FullName))
//{
// return implementationFactory.GetService<HQFSettledDetailDiffExportService>();
//}
//if (key.Equals(typeof(HQFSharePartSettledDetailDiffExportService).FullName))
//{
// return implementationFactory.GetService<HQFSharePartSettledDetailDiffExportService>();
//}
//if (key.Equals(typeof(HQMSettledDetailDiffExportService).FullName))
//{
// return implementationFactory.GetService<HQMSettledDetailDiffExportService>();
//}
//if (key.Equals(typeof(HQMSharePartSettledDetailDiffExportService).FullName))
//{
// return implementationFactory.GetService<HQMSharePartSettledDetailDiffExportService>();
//}
//if (key.Equals(typeof(HQHSettledDetailDiffExportService).FullName))
//{
// return implementationFactory.GetService<HQHSettledDetailDiffExportService>();
//}
////红旗结算未结明细
//if (key.Equals(typeof(HQHUnSettledDetailDiffExportService).FullName))
//{
// return implementationFactory.GetService<HQHUnSettledDetailDiffExportService>();
//}
////红旗未结核对
//if (key.Equals(typeof(HQFactoryUnSettledDetailDiffExportService).FullName))
//{
// return implementationFactory.GetService<HQFactoryUnSettledDetailDiffExportService>();
//}
//if (key.Equals(typeof(HQHSharePartSettledDetailDiffExportService).FullName))
//{
// return implementationFactory.GetService<HQHSharePartSettledDetailDiffExportService>();
//}
////红旗、轿车发运报表
//if (key.Equals(typeof(HQMShippingExportService).FullName))
//{
// return implementationFactory.GetService<HQMShippingExportService>();
//}
//if (key.Equals(typeof(HQHShippingExportService).FullName))
//{
// return implementationFactory.GetService<HQHShippingExportService>();
//}
//if (key.Equals(typeof(HQFShippingExportService).FullName))
//{
// return implementationFactory.GetService<HQFShippingExportService>();
//}
//if (key.Equals(typeof(WmsOutputSumExportService).FullName))
//{
// return implementationFactory.GetService<WmsOutputSumExportService>();
//}
////大众看板未结输出
//if (key.Equals(typeof(KanBanUnSettledExport).FullName))
//{
// return implementationFactory.GetService<KanBanUnSettledExport>();
//}
//if (key.Equals(typeof(FisUpdateExportService).FullName))
//{
// return implementationFactory.GetService<FisUpdateExportService>();
//}
//if (key.Equals(typeof(FisOutputService).FullName))
//{
// return implementationFactory.GetService<FisOutputService>();
//}

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs

@ -1078,7 +1078,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var query = from inv1 in invdetails
join dto1 in dtos on
new { inv1.LU, inv1.PN } equals new { dto1.LU, dto1.PN }
new { inv1.LU, inv1.PN,inv1.Id } equals new { dto1.LU, dto1.PN, dto1.Id }
select new
{
PartCode = inv1.PartCode,

Loading…
Cancel
Save