|
|
@ -1,11 +1,14 @@ |
|
|
|
using AutoMapper; |
|
|
|
using DocumentFormat.OpenXml.Bibliography; |
|
|
|
using DocumentFormat.OpenXml.Drawing.Charts; |
|
|
|
using DocumentFormat.OpenXml.Office2010.Excel; |
|
|
|
using Magicodes.ExporterAndImporter.Core; |
|
|
|
using Magicodes.ExporterAndImporter.Csv; |
|
|
|
using Magicodes.ExporterAndImporter.Excel; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using NPOI.HPSF; |
|
|
|
using NPOI.OpenXmlFormats.Spreadsheet; |
|
|
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
|
|
|
using SettleAccount.Bases; |
|
|
|
using Shouldly; |
|
|
@ -25,7 +28,10 @@ using Win.Abp.Snowflakes; |
|
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
|
|
using Win.Sfs.SettleAccount.CommonManagers; |
|
|
|
using Win.Sfs.SettleAccount.Constant; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; |
|
|
|
using Win.Sfs.SettleAccount.ExcelImporter; |
|
|
|
using Win.Sfs.SettleAccount.ExportReports; |
|
|
|
using Win.Sfs.Shared.RepositoryBase; |
|
|
@ -41,19 +47,22 @@ namespace Win.Sfs.SettleAccount.Bases |
|
|
|
where TRequestDetailInput : RequestInputBase |
|
|
|
where TEntityDetailExportDto : class, new() |
|
|
|
{ |
|
|
|
|
|
|
|
private readonly VmiAppService _vimservice; |
|
|
|
private readonly INormalEfCoreRepository<TEntity, Guid> _repository; |
|
|
|
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository; |
|
|
|
|
|
|
|
public PD_SERVICE( |
|
|
|
|
|
|
|
|
|
|
|
IExcelImportAppService excelImportService, |
|
|
|
ISnowflakeIdGenerator snowflakeIdGenerator, |
|
|
|
ICommonManager commonManager, |
|
|
|
INormalEfCoreRepository<TEntity, Guid> repository, |
|
|
|
|
|
|
|
VmiAppService vimservice, |
|
|
|
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository |
|
|
|
) : base(excelImportService, snowflakeIdGenerator, commonManager) |
|
|
|
{ |
|
|
|
_vimservice = vimservice; |
|
|
|
_repository = repository; |
|
|
|
_detailRepository = detailRepository; |
|
|
|
} |
|
|
@ -116,11 +125,205 @@ namespace Win.Sfs.SettleAccount.Bases |
|
|
|
} |
|
|
|
[HttpPost] |
|
|
|
//[Route("generateinvoice")]
|
|
|
|
public virtual async Task<string> ApprovalPassed(TRequestMainInput input) |
|
|
|
public virtual async Task<string> ApprovalPassed(List<string> p_list) |
|
|
|
{ |
|
|
|
//_repository.Where(p => p_list.Contains(p.BillNum));
|
|
|
|
var detailist=_detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList(); |
|
|
|
if (detailist != null && detailist.Count > 0) |
|
|
|
{ |
|
|
|
foreach (var itm in detailist) |
|
|
|
{ |
|
|
|
await _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" |
|
|
|
}) ; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//public VmiLog()
|
|
|
|
//{
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//public VmiLog(Guid id)
|
|
|
|
//{
|
|
|
|
// this.Id = id;
|
|
|
|
//}
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
///// 分组编号
|
|
|
|
///// </summary>
|
|
|
|
//public string GroupId { get; set; }
|
|
|
|
|
|
|
|
// /// <summary>
|
|
|
|
// /// 库存事务分类
|
|
|
|
// /// </summary>
|
|
|
|
// public VmiLogType LogType { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "库存变动")]
|
|
|
|
// public decimal ChangedQty { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "变动单号")]
|
|
|
|
// public string ChangedNumber { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "变动时间")]
|
|
|
|
// public DateTime ChangedTime { get; set; } = DateTime.Now;
|
|
|
|
|
|
|
|
// [Display(Name = "变动类型")]
|
|
|
|
// public VmiType ChangedType { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "便动人")]
|
|
|
|
// public string ChangedBy { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "是否补货")]
|
|
|
|
// public bool? IsReplenished { get; set; }
|
|
|
|
|
|
|
|
// #region 附加信息
|
|
|
|
|
|
|
|
// //[Display(Name = "实扣厂内零件号")]
|
|
|
|
// //public string PartCode { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "结算厂内零件号")]
|
|
|
|
// public string PartCode2 { get; set; }
|
|
|
|
|
|
|
|
// //[Display(Name = "结算客户零件号")]
|
|
|
|
// //public string CustomerPartCode { get; set; }
|
|
|
|
|
|
|
|
// //[Display(Name = "EDI订单生产码")]
|
|
|
|
// //public string VinCode { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "结算生产码")]
|
|
|
|
// public string SettlementVinCode { get; set; }
|
|
|
|
|
|
|
|
// #endregion 附加信息
|
|
|
|
|
|
|
|
// #region 库存备份
|
|
|
|
|
|
|
|
// /// <summary>
|
|
|
|
// /// LU零件号
|
|
|
|
// /// </summary>
|
|
|
|
// [Display(Name = "LU零件号")]
|
|
|
|
// public string PartCode { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "生产码")]
|
|
|
|
// public string VinCode { get; set; }
|
|
|
|
|
|
|
|
// /// <summary>
|
|
|
|
// /// 根据零件关系表匹配
|
|
|
|
// /// </summary>
|
|
|
|
// [Display(Name = "客户零件号")]
|
|
|
|
// public string CustomerPartCode { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "生产码类型")]
|
|
|
|
// public string CodeType { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "发货类型")]
|
|
|
|
// public EnumDeliverBjBmpBillType BillType { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "数量")]
|
|
|
|
// public decimal Qty { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "发运日期")]
|
|
|
|
// public DateTime BillTime { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "订单日期")]
|
|
|
|
// public DateTime DeliverTime { get; set; }
|
|
|
|
|
|
|
|
// /// <summary>
|
|
|
|
// /// ERP库位
|
|
|
|
// /// </summary>
|
|
|
|
// [Display(Name = "ERP库位")]
|
|
|
|
// public string ErpToLoc { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "EDI顺序号")]
|
|
|
|
// public string Seq { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "客户订单号")]
|
|
|
|
// public string OrderNum { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "塑件唯一码")]
|
|
|
|
// public string UniqueCode { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "EDI总成号")]
|
|
|
|
// public string MatchNumber { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "PJIS生产顺序号")]
|
|
|
|
// public string PjsNum { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "配置码")]
|
|
|
|
// public string Configcode { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "工厂")]
|
|
|
|
// public string factory { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "发货子类型")]
|
|
|
|
// public EnumDeliverSubBillType SubBillType { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "WMS实发生产码")]
|
|
|
|
// public string RealCode { get; set; }
|
|
|
|
|
|
|
|
// [Display(Name = "备注")]
|
|
|
|
// public string ReMark { get; set; }
|
|
|
|
|
|
|
|
// #endregion 库存备份
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public enum VmiLogType
|
|
|
|
//{
|
|
|
|
// /// <summary>
|
|
|
|
// /// 发运入库
|
|
|
|
// /// </summary>
|
|
|
|
// [Display(Name = "发运入库")]
|
|
|
|
// Type100 = 100,
|
|
|
|
|
|
|
|
// /// <summary>
|
|
|
|
// /// 结算出库
|
|
|
|
// /// </summary>
|
|
|
|
// [Display(Name = "结算出库")]
|
|
|
|
// Type200 = 200,
|
|
|
|
|
|
|
|
// /// <summary>
|
|
|
|
// /// 反结入库
|
|
|
|
// /// </summary>
|
|
|
|
// [Display(Name = "反结入库")]
|
|
|
|
// Type300 = 300,
|
|
|
|
|
|
|
|
// /// <summary>
|
|
|
|
// /// 退货出库
|
|
|
|
// /// </summary>
|
|
|
|
// [Display(Name = "退货出库")]
|
|
|
|
// Type400 = 400,
|
|
|
|
|
|
|
|
// /// <summary>
|
|
|
|
// /// 调整入库
|
|
|
|
// /// </summary>
|
|
|
|
// [Display(Name = "调整入库")]
|
|
|
|
// Type500 = 500,
|
|
|
|
|
|
|
|
// /// <summary>
|
|
|
|
// /// 调整出库
|
|
|
|
// /// </summary>
|
|
|
|
// [Display(Name = "调整出库")]
|
|
|
|
// Type600 = 600,
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|