From 129a03af6f58b100a5814870d667c738ffb84741 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com>
Date: Wed, 27 Sep 2023 15:10:46 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=93=E7=AE=97=E7=8A=B6?=
=?UTF-8?q?=E6=80=81=E6=9E=9A=E4=B8=BE=EF=BC=8C=E4=B8=AD=E6=96=87=E5=90=8D?=
=?UTF-8?q?=E7=A7=B0=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=89=A3=E5=87=8F=E9=80=BB?=
=?UTF-8?q?=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Bases/PD_SERVICE.cs | 48 +++++++++----------
.../BQ/Syncs/PendingDeductionService.cs | 2 +-
.../src/SettleAccount.Domain/EnumBillState.cs | 8 ++--
3 files changed, 27 insertions(+), 31 deletions(-)
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
index 03d4f3a5..904b9671 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
@@ -152,8 +152,6 @@ namespace Win.Sfs.SettleAccount.Bases
throw new UserFriendlyException($"扣减单状态不是【客户已收票】状态", "400");
}
-
-
return await InvokePD(invlist,p_list, _service, false);
}
[HttpPost]
@@ -193,47 +191,45 @@ namespace Win.Sfs.SettleAccount.Bases
{
throw new UserFriendlyException($"扣减单状态不是【已扣减】状态", "400");
}
- return await InvokePD(invlist,p_list, _service,true);
+ return await InvokePD(invlist, p_list, _service, true);
}
}
-
- ///
- /// 调用扣减
- ///
- ///
- ///
- ///
- ///
- ///
- [UnitOfWork(false)]
- protected async Task InvokePD(List p_invs,List p_list, TaskJobService p_service, bool isback=false) where T:PD_BASE_MAIN
+
+ ///
+ /// 调用扣减
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [UnitOfWork(false)]
+ protected async Task InvokePD(List p_invs, List p_list, TaskJobService p_service, bool isback = false) where T : PD_BASE_MAIN
{
var invlist = p_invs;
- // var invlist=_repository.Where(p=>p_list.Contains(p.BillNum)).ToList();
- var states= invlist.Select(p => p.State).Distinct().ToList();
+ // var invlist=_repository.Where(p=>p_list.Contains(p.BillNum)).ToList();
+ var states = invlist.Select(p => p.State).Distinct().ToList();
if (states.Count > 1)
{
throw new UserFriendlyException($"发票不是同一状态", "400");
}
var first = invlist.FirstOrDefault();//发票状态
- if(first.State != SettleBillState.客户已收票 && first.State != SettleBillState.已扣减)
+ if (first.State != SettleBillState.客户已收票 && first.State != SettleBillState.已扣减)
{
throw new UserFriendlyException($"当前发票状态不是【客户已收票】或【已扣减状态】不能进行出库扣减或撤销扣减操作", "400");
}
-
-
var detailist = _detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList();
- var first1=detailist.FirstOrDefault();
+ var first1 = detailist.FirstOrDefault();
List customConditionList = new List();
customConditionList.Add(new CustomCondition() { Name = "BillNumList", Value = string.Join(",", p_list) });
- customConditionList.Add(new CustomCondition() { Name = "Type", Value =first1.BusinessType.ToString() });
+ customConditionList.Add(new CustomCondition() { Name = "Type", Value = first1.BusinessType.ToString() });
if (isback == false)
{
customConditionList.Add(new CustomCondition() { Name = "IsOut", Value = "out" });
@@ -243,14 +239,14 @@ namespace Win.Sfs.SettleAccount.Bases
customConditionList.Add(new CustomCondition() { Name = "IsOut", Value = "in" });
}
var ls = _repository.Where(p => p_list.Contains(p.BillNum)).ToList();
- var lst=new List();
+ var lst = new List();
if (isback == false)
{
- lst = ls.Where(p => (p.State == SettleBillState.已提交扣减 || p.State == SettleBillState.已扣减)).ToList();
+ lst = ls.Where(p => (p.State == SettleBillState.扣减进行中 || p.State == SettleBillState.已扣减)).ToList();
}
else
{
- lst = ls.Where(p => (p.State == SettleBillState.已提交撤销扣减|| p.State == SettleBillState.客户已收票)).ToList();
+ lst = ls.Where(p => (p.State == SettleBillState.撤销扣减进行中 || p.State == SettleBillState.客户已收票)).ToList();
}
if (lst.Count() > 0)
{
@@ -260,11 +256,11 @@ namespace Win.Sfs.SettleAccount.Bases
{
if (isback == false)
{
- item.State = SettleBillState.已提交扣减;
+ item.State = SettleBillState.扣减进行中;
}
else
{
- item.State = SettleBillState.已提交撤销扣减;
+ item.State = SettleBillState.撤销扣减进行中;
}
}
await _repository.DbContext.BulkUpdateAsync(ls);
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
index 19889ad9..3b70f30c 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
@@ -42,7 +42,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
var list = billList.Split(",");
var projectList = _dbcontext.Set().Where(p => p.Project == "库位");
- if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type == "BeiJian")
+ if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type == "BeiJian" || type== "YinDuJian")
{
var jisdetail = _dbcontext.Set().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisBBAC);//jis
if (jisdetail != null && jisdetail.Count() > 0)
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs
index 322a918f..7f5a4efd 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs
@@ -25,10 +25,10 @@ namespace Win.Sfs.SettleAccount
已扣减 = 5,
[Description("客户已收票")]
客户已收票 = 4,
- [Description("已提交扣减")]
- 已提交扣减 = 6,
- [Description("已提交撤销扣减")]
- 已提交撤销扣减 = 7,
+ [Description("扣减进行中")]
+ 扣减进行中 = 6,
+ [Description("撤销扣减进行中")]
+ 撤销扣减进行中 = 7,
[Description("已提交QAD")]
已提交QAD = 8
}