Browse Source

更新版本

master
学 赵 1 year ago
parent
commit
0446f12ace
  1. 16
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs
  2. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs
  3. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  4. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  5. 169
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
  6. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  7. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  8. 39
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs
  9. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  10. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs
  11. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  12. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  13. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  14. 75
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
  15. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs

16
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs

@ -162,10 +162,6 @@ public class ADJ_SERVICE : BASE_SERVICE
oldinv: itm.InvBillNum,
inv: string.Empty,
partcode: itm.PartCode
);
await _repository.DbContext.BulkDeleteAsync(deletels);//删除发票下所有调整明细
await _repository.DbContext.BulkInsertAsync(query.ToList());
@ -173,18 +169,6 @@ public class ADJ_SERVICE : BASE_SERVICE
}
/// <summary>
/// 导入文件
/// </summary>

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs

@ -40,7 +40,6 @@ namespace Win.Sfs.SettleAccount.Bases
_excelImportService = excelImportService;
_snowflakeIdGenerator = snowflakeIdGenerator;
_commonManager = commonManager;
}
@ -57,15 +56,12 @@ namespace Win.Sfs.SettleAccount.Bases
{
return ApplicationConsts.SuccessStr;
}
if (string.IsNullOrEmpty(fileName))
{
//导出文件名称
fileName = CommonMethod.GetExcelFileNameByUserID(ApplicationConsts.CheckErroFileName, _snowflakeIdGenerator.Create().ToString(), ApplicationConsts.FileExtension);
}
errorList = errorList.Distinct().OrderBy(p => p.Type).ThenBy(p => p.Model).ThenBy(p => p.ItemCode).ToList();
//声明导出容器
ExportImporter _exportImporter = new ExportImporter();

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

@ -115,7 +115,7 @@ namespace Win.Sfs.SettleAccount.Bases
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<IActionResult> ReissueInvoice(string input)
public virtual async Task<IActionResult> ReissueInvoice([FromBody] string input)
{
// await _invMng.SetForwardState(input.InvGroupNum, SettleBillState.商务已审核);
@ -204,7 +204,7 @@ namespace Win.Sfs.SettleAccount.Bases
/// <param name="input">主表查询条件</param>
/// <returns></returns>
[HttpPost]
public virtual async Task<IActionResult> RejectAsync(string p_invGroupNum)
public virtual async Task<IActionResult> RejectAsync([FromBody] string p_invGroupNum)
{
bool issuc= await _invMng.Reject(p_invGroupNum);
if (issuc == true)
@ -228,7 +228,7 @@ namespace Win.Sfs.SettleAccount.Bases
}
return new JsonResult(new { Code = 200, Message = "收票成功" });
return new JsonResult(new { Code = 400, Message = "收票失败" });
}
protected virtual async Task<List<INVOICE_MAP_GROUP_DTO>> GetMapGroupAsync(INVOICE_GRP_REQ_DTO input)
{
@ -249,7 +249,7 @@ namespace Win.Sfs.SettleAccount.Bases
return sdtos;
}
protected virtual async Task<List<INVOICE_NOT_SETTLE>> GetNotDetailAsync(string p_invbillNum)
protected virtual async Task<List<INVOICE_NOT_SETTLE>> GetNotDetailAsync( string p_invbillNum)
{
List<FilterCondition> filters = new List<FilterCondition>();

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs

@ -133,7 +133,7 @@ namespace Win.Sfs.SettleAccount.Bases
/// <returns></returns>
[HttpPost]
//[Route("generateinvoice")]
public virtual async Task<IActionResult> GenerateInvoice(string input)
public virtual async Task<IActionResult> GenerateInvoice([FromBody] string input)
{
return new JsonResult(new { Code = 200, Message = "创建成功" }); ;

169
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs

@ -138,170 +138,7 @@ namespace Win.Sfs.SettleAccount.Bases
public virtual async Task<string> ApprovalPassed(List<string> p_list)
{
//_repository.Where(p => p_list.Contains(p.BillNum));
//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,
//}
return ApplicationConsts.SuccessStr;
}
/// <summary>
@ -342,12 +179,12 @@ namespace Win.Sfs.SettleAccount.Bases
return ApplicationConsts.SuccessStr;
}
public virtual async Task<TEntity> GetMainAsync(string billNum)
public virtual async Task<TEntity> GetMainAsync([FromBody] string billNum)
{
return await _repository.Where(p=>p.InvGroupNum == billNum).FirstOrDefaultAsync();
}
public virtual async Task<List<TEntityDetail>> GetDetailAsync(string billNum)
public virtual async Task<List<TEntityDetail>> GetDetailAsync([FromBody] string billNum)
{
return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync();
}

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

@ -66,7 +66,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<IActionResult> ReissueInvoice(string p_invbillnum)
public override async Task<IActionResult> ReissueInvoice([FromBody] string p_invbillnum)
{
//var mappingList= await GetMapGroupAsync(p_invbillnum);//发票对应结算分组
//if (mappingList != null && mappingList.Count() > 0)

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

@ -82,7 +82,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <returns></returns>
[HttpPost]
public async override Task<IActionResult> GenerateInvoice(string invbillNum)
public async override Task<IActionResult> GenerateInvoice([FromBody] string invbillNum)
{
var main =await _bbacMng.GetMainAsync(invbillNum);

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

@ -51,13 +51,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
List<CustomCondition> customConditionList = new List<CustomCondition>();
//var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value;
//var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value;
customConditionList.Add(new CustomCondition() { Name = "BillNumList", Value =string.Join(",",p_list) });
customConditionList.Add(new CustomCondition() { Name = "Type", Value = EnumBusinessType.JisBBAC.ToString() });
//customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
//customConditionList.Add(new CustomCondition() { Name = "State", Value = string.IsNullOrEmpty(input.State) ? string.Empty : input.State });
var _taskid = await _service.ExportEnqueueAsync("BBAC待扣减任务", ExportExtentsion.Excel, DateTime.Now.ToString("yyyyMM"), string.Empty, CurrentUser, typeof(PendingDeductionService), customConditionList, (rs) =>
{
});
@ -65,39 +61,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
// _bbacSecRepository.Where(p=>)
//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"
// });
// }
//}
// return ApplicationConsts.SuccessStr;
}
}
}

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

@ -54,7 +54,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<IActionResult> ReissueInvoice(string p_invbillnum)
public override async Task<IActionResult> ReissueInvoice([FromBody] string p_invbillnum)
{
//var mappingList = await GetMapGroupAsync(p_invbillnum);//发票对应结算分组
//if (mappingList != null && mappingList.Count() > 0)

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

@ -75,7 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <returns></returns>
[HttpPost]
//[Route("generateinvoice")]
public async override Task<IActionResult> GenerateInvoice(string invbillnum)
public async override Task<IActionResult> GenerateInvoice([FromBody] string invbillnum)
{
var main =await _hbpoMng.GetMainAsync(invbillnum);

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

@ -207,7 +207,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
[HttpPost]
public virtual async Task<string> RejectAsync(string p_invGroupNum)
public virtual async Task<string> RejectAsync([FromBody] string p_invGroupNum)
{
bool state = await _invMng.Reject(p_invGroupNum);

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

@ -187,7 +187,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <param name="input"></param>
/// <returns></returns>
public override async Task<IActionResult> ReissueInvoice(string p_invbillnum)
public override async Task<IActionResult> ReissueInvoice([FromBody] string p_invbillnum)
{
//var mappingList = await GetMapGroupAsync(p_invbillnum);//发票对应结算分组
//if (mappingList != null && mappingList.Count() > 0)

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

@ -66,7 +66,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_pricebjRepository = pricebjRepository;
}
[HttpPost]
public async override Task<IActionResult> GenerateInvoice(string billnum)
public async override Task<IActionResult> GenerateInvoice( [FromBody] string billnum)
{
var main = await _pubMng.GetMainAsync(billnum);

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

@ -35,6 +35,8 @@ public class PendingDeductionService : ITransientDependency, IExportJob
INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> hbpoRepository,
INormalEfCoreRepository<PUB_PD_DETAIL, Guid> pubRepository,
INormalEfCoreRepository<CodeSetting, Guid> codesetRepository,
VmiAppService vimservice
@ -47,6 +49,7 @@ public class PendingDeductionService : ITransientDependency, IExportJob
_hbpoSecRepository= hbpoSecRepository;
_pubSecRepository= pubSecRepository;
_vimservice =vimservice;
_codesetRepository = codesetRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
@ -54,21 +57,18 @@ public class PendingDeductionService : ITransientDependency, IExportJob
var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value;
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value;
var list=billList.Split(",");
var projectList=_codesetRepository.Where(p => p.Project == "库位");
if (type == "JisBBAC")
{
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
var query = from itm in jisdetail
select
new
{
BillTime = DateTime.Now,
@ -80,13 +80,13 @@ public class PendingDeductionService : ITransientDependency, IExportJob
ChangedType = VmiType.Out,
//SubBillType = EnumDeliverSubBillType.小件BBAC,
//BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = tm != null ? tm.ReplaceLU : itm.LU,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = tm != null ? tm.ReplaceLU : itm.LU,
PartCode2 = itm.LU,
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
//ErpToLoc = string.IsNullOrEmpty()
};
var ls=query.ToList();
if (ls != null && ls.Count > 0)
@ -114,10 +114,55 @@ public class PendingDeductionService : ITransientDependency, IExportJob
}).ConfigureAwait(false);
}
}
//var query1=
var query1 = from itm in mdetail
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 = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
};
var ls1 = query1.ToList();
if (ls1 != null && ls1.Count > 0)
{
foreach (var itm in ls1)
{
_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 == "JisHBPO")
{

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

@ -71,7 +71,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
var ls = p_list.Select(p => p.GroupNum).Distinct().ToList();
var notlist = _notRepository.Where(p => ls.Contains(p.GroupNum)).ToList();//JIT_ASN整发
var priceErrors = await _service.CheckPriceList(notlist);
List<PUB_NOT_SA_DETAIL> priceErrors = new List<PUB_NOT_SA_DETAIL>();
if (first.BusinessType == EnumBusinessType.BeiJian)
{
priceErrors = await _service.CheckPriceList(notlist,true);
}
else
{
priceErrors = await _service.CheckPriceList(notlist);
}
if (priceErrors.Count > 0)
{
foreach (var itm in priceErrors)

Loading…
Cancel
Save