diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs
index 63ded1eb..58c5b0c8 100644
--- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs
+++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs
@@ -613,7 +613,7 @@ public static class MultiLanguageConst
public const string NoNeedWithdraw = "NoNeed_Withdraw";
[Description("未能获取业务信息")]
public const string BusinessNotFound = "Business_NotFound";
- [Description("当前业务的费用状态为:{0},无法提交")]
+ [Description("当前业务的费用状态为:{0},无法执行此操作")]
public const string BusinessStatusError = "Business_Status_Error";
[Description("当前业务的审批状态不正确")]
public const string BusinessAuditStatusError = "Business_AuditStatus_Error";
diff --git a/ds-wms-service/DS.Module.SqlSugar/SqlsugarHelper.cs b/ds-wms-service/DS.Module.SqlSugar/SqlsugarHelper.cs
index 6da7ea64..f886a7d5 100644
--- a/ds-wms-service/DS.Module.SqlSugar/SqlsugarHelper.cs
+++ b/ds-wms-service/DS.Module.SqlSugar/SqlsugarHelper.cs
@@ -64,24 +64,20 @@ namespace DS.Module.SqlSugar
if (createByValue == null || Equals(createByValue, 0L))
{
if (!user.UserId.IsNullOrEmpty())
- {
entityInfo.SetValue(user.UserId);
- }
else
- {
entityInfo.SetValue(1288018625843826688);
- }
}
}
if (entityInfo.PropertyName == "CreateUserName")
{
- if (!user.UserId.IsNullOrEmpty())
+ var createUserName = PropertyExtensions.GetPropertyValue(entityInfo.EntityValue, entityInfo.PropertyName, Flags.InstancePublic) as string;
+ if (string.IsNullOrEmpty(createUserName))
{
- entityInfo.SetValue(user.UserName);
- }
- else
- {
- entityInfo.SetValue("超级管理员");
+ if (!user.UserId.IsNullOrEmpty())
+ entityInfo.SetValue(user.UserName);
+ else
+ entityInfo.SetValue("超级管理员");
}
}
if (entityInfo.PropertyName == "Deleted")
diff --git a/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeAuditService.cs b/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeAuditService.cs
index b099006a..f560718a 100644
--- a/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeAuditService.cs
+++ b/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeAuditService.cs
@@ -78,6 +78,14 @@ namespace DS.WMS.Core.Fee.Interface
///
Task SetFeeLockingAsync(IEnumerable items);
+ ///
+ /// 设置费用状态
+ ///
+ /// 费用状态
+ /// 费用ID
+ ///
+ Task SetFeeStatusAsync(FeeStatus status, params long[] ids);
+
///
/// 根据审批结果更新审批状态
///
diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs
index 4a4386d3..b9043046 100644
--- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs
+++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs
@@ -776,6 +776,43 @@ namespace DS.WMS.Core.Fee.Method
return rows > 0 ? DataResult.Success : DataResult.Failed(MultiLanguageConst.Operation_Failed);
}
+ ///
+ /// 设置费用状态
+ ///
+ /// 费用状态
+ /// 费用ID
+ ///
+ public async Task SetFeeStatusAsync(FeeStatus status, params long[] ids)
+ {
+ long userId = long.Parse(User.UserId);
+ DateTime dtNow = DateTime.Now;
+ var fees = ids.Select(x => new FeeRecord
+ {
+ Id = x,
+ FeeStatus = status
+ }).ToList();
+
+ if (status == FeeStatus.AuditPassed || status == FeeStatus.RejectSubmission)
+ {
+ foreach (var item in fees)
+ {
+ item.AuditBy = userId;
+ item.AuditOperator = User.UserName;
+ item.AuditDate = dtNow;
+ }
+ }
+
+ int rows = await TenantDb.Updateable(fees).UpdateColumns(x => new
+ {
+ x.FeeStatus,
+ x.AuditBy,
+ x.AuditOperator,
+ x.AuditDate
+ }).ExecuteCommandAsync();
+
+ return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
+ }
+
///
/// 根据审批结果更新审批状态
///
diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeCustTemplateService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeCustTemplateService.cs
index 00ad9b12..45dda6b4 100644
--- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeCustTemplateService.cs
+++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeCustTemplateService.cs
@@ -139,7 +139,7 @@ namespace DS.WMS.Core.Fee.Method
TemplateId = template.Id
};
await TenantDb.Insertable(record).ExecuteCommandAsync();
- break;
+ //break;
}
}
}
@@ -226,12 +226,12 @@ namespace DS.WMS.Core.Fee.Method
}
else
{
- var ctn = order.CtnInfo?.Find(x => x.Ctn == g.Key.Unit);
- if (ctn == null)
+ var ctnList = order.CtnInfo?.FindAll(x => x.Ctn == g.Key.Unit);
+ if (ctnList == null || ctnList.Count == 0)
continue;
- detail = g.FirstOrDefault(x => x.Unit == ctn.Ctn);
- qty = ctn.CtnNum;
+ detail = g.FirstOrDefault(x => x.Unit == g.Key.Unit);
+ qty = ctnList.Sum(x => x.CtnNum);
}
var fee = new FeeRecord
@@ -247,7 +247,6 @@ namespace DS.WMS.Core.Fee.Method
CustomerName = detail.CustomerName,
CustomerType = detail.CustomerType,
InputMethod = InputMethod.Automatic,
-
Quantity = qty,
FeeCode = detail.FeeCode,
FeeName = detail.FeeName,
@@ -259,7 +258,9 @@ namespace DS.WMS.Core.Fee.Method
Tax = detail.Tax.GetValueOrDefault(),
TaxUnitPrice = detail.TaxUnitPrice.GetValueOrDefault(),
IsInvoice = detail.IsInvoice,
- IsAdvancedPay = detail.IsAdvancedPay
+ IsAdvancedPay = detail.IsAdvancedPay,
+ CreateBy = order.OperatorId,
+ CreateUserName = order.OperatorName
};
if (fee.ExchangeRate.GetValueOrDefault() == 0 && fee.Currency != localCurrecy)
diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs
index 686baced..898d113d 100644
--- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs
+++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs
@@ -960,38 +960,33 @@ namespace DS.WMS.Core.Fee.Method
if (!result.Succeeded)
return result;
- FeeType feeType = default;
//变更状态为提交审核
if (taskType == TaskBaseTypeEnum.BILL_RECV_AUDIT)
{
entity.BillAuditStatus = BillAuditStatus.RecvSubmitted;
entity.ARFeeStatus = BillFeeStatus.AuditSubmitted;
- feeType = FeeType.Receivable;
-
+ entity.APFeeStatus = BillFeeStatus.AuditSubmitted;
await TenantDb.Updateable(entity).UpdateColumns(x => new
{
x.BillAuditStatus,
- x.ARFeeStatus
+ x.ARFeeStatus,
+ x.APFeeStatus
}).ExecuteCommandAsync();
+
+ //修改关联费用状态为提交审核
+ await TenantDb.Updateable().Where(x => x.BusinessId == bid && x.BusinessType == type &&
+ (x.FeeStatus == FeeStatus.Entering || x.FeeStatus == FeeStatus.Withdraw || x.FeeStatus == FeeStatus.RejectSubmission))
+ .SetColumns(x => x.FeeStatus == FeeStatus.AuditSubmitted).ExecuteCommandAsync();
}
else if (taskType == TaskBaseTypeEnum.BILL_PAY_AUDIT)
{
entity.BillAuditStatus = BillAuditStatus.PaySubmitted;
- entity.APFeeStatus = BillFeeStatus.AuditSubmitted;
- feeType = FeeType.Payable;
-
await TenantDb.Updateable(entity).UpdateColumns(x => new
{
- x.BillAuditStatus,
- x.APFeeStatus
+ x.BillAuditStatus
}).ExecuteCommandAsync();
}
- //修改关联费用状态为提交审核
- await TenantDb.Updateable().Where(x => x.BusinessId == bid && x.BusinessType == type && x.FeeType == feeType &&
- (x.FeeStatus == FeeStatus.Entering || x.FeeStatus == FeeStatus.Withdraw || x.FeeStatus == FeeStatus.RejectSubmission))
- .SetColumns(x => x.FeeStatus == FeeStatus.AuditSubmitted).ExecuteCommandAsync();
-
await TenantDb.Ado.CommitTranAsync();
return DataResult.Success;
}
@@ -1035,9 +1030,8 @@ namespace DS.WMS.Core.Fee.Method
}
else if (taskType == TaskBaseTypeEnum.BILL_PAY_AUDIT)
{
- if (entity.BillAuditStatus != BillAuditStatus.PaySubmitted)
- return DataResult.Failed(string.Format(
- MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BusinessStatusError)), entity.BillAuditStatus.GetDescription()));
+ return DataResult.Failed(string.Format(
+ MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BusinessStatusError)), entity.BillAuditStatus.GetDescription()));
}
else
{
@@ -1068,35 +1062,15 @@ namespace DS.WMS.Core.Fee.Method
return result;
}
- FeeType feeType = default;
- //变更状态为待提交
- if (taskType == TaskBaseTypeEnum.BILL_RECV_AUDIT)
+ entity.BillAuditStatus = BillAuditStatus.Pending;
+ entity.ARFeeStatus = BillFeeStatus.Entering;
+ await TenantDb.Updateable(entity).UpdateColumns(x => new
{
- entity.BillAuditStatus = BillAuditStatus.Pending;
- entity.ARFeeStatus = BillFeeStatus.Entering;
- feeType = FeeType.Receivable;
-
- await TenantDb.Updateable(entity).UpdateColumns(x => new
- {
- x.BillAuditStatus,
- x.ARFeeStatus
- }).ExecuteCommandAsync();
- }
- else if (taskType == TaskBaseTypeEnum.BILL_PAY_AUDIT)
- {
- entity.BillAuditStatus = BillAuditStatus.RecvPassed;
- entity.APFeeStatus = BillFeeStatus.Entering;
- feeType = FeeType.Payable;
-
- await TenantDb.Updateable(entity).UpdateColumns(x => new
- {
- x.BillAuditStatus,
- x.APFeeStatus
- }).ExecuteCommandAsync();
- }
-
+ x.BillAuditStatus,
+ x.ARFeeStatus
+ }).ExecuteCommandAsync();
//修改关联费用状态为录入状态
- await TenantDb.Updateable().Where(x => x.BusinessId == bid && x.BusinessType == type && x.FeeType == feeType && x.FeeStatus == FeeStatus.AuditSubmitted)
+ await TenantDb.Updateable().Where(x => x.BusinessId == bid && x.BusinessType == type && x.FeeStatus == FeeStatus.AuditSubmitted)
.SetColumns(x => x.FeeStatus == FeeStatus.Entering).ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync();
diff --git a/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs b/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs
index bb036678..e982120a 100644
--- a/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs
+++ b/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs
@@ -49,9 +49,7 @@ namespace DS.WMS.Core.TaskInteraction.Method
BusinessId = x.BusinessId,
BusinessType = x.BusinessType,
BillAuditStatus = x.BillAuditStatus,
- BillFeeStatusTime = x.BillFeeStatusTime,
- ARFeeStatus = x.ARFeeStatus,
- APFeeStatus = x.APFeeStatus
+ BillFeeStatusTime = x.BillFeeStatusTime
}).FirstAsync();
if (biz == null)
return;
@@ -63,34 +61,21 @@ namespace DS.WMS.Core.TaskInteraction.Method
{
if (auditType == TaskBaseTypeEnum.BILL_RECV_AUDIT)
{
- FeeStatus status = FeeStatus.RejectSubmission;
if (callback.FlowStatus == FlowStatusEnum.Approve)
{
biz.BillAuditStatus = BillAuditStatus.RecvPassed;
- biz.ARFeeStatus = BillFeeStatus.AuditPassed;
- status = FeeStatus.AuditPassed;
}
else if (callback.FlowStatus == FlowStatusEnum.Reject)
{
biz.BillAuditStatus = BillAuditStatus.RecvRejected;
- biz.ARFeeStatus = BillFeeStatus.RejectSubmission;
}
biz.BillFeeStatusTime = dtNow;
await TenantDb.Updateable(biz).UpdateColumns(x => new
{
x.BillAuditStatus,
- x.BillFeeStatusTime,
- x.ARFeeStatus
+ x.BillFeeStatusTime
}).ExecuteCommandAsync();
-
- await TenantDb.Updateable()
- .SetColumns(x => x.FeeStatus == status)
- .SetColumns(x => x.AuditBy == userId)
- .SetColumns(x => x.AuditOperator == User.UserName)
- .SetColumns(x => x.AuditDate == dtNow)
- .Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType && x.FeeType == FeeType.Receivable && x.FeeStatus == FeeStatus.AuditSubmitted)
- .ExecuteCommandAsync();
}
else if (auditType == TaskBaseTypeEnum.BILL_PAY_AUDIT)
{
@@ -98,13 +83,14 @@ namespace DS.WMS.Core.TaskInteraction.Method
if (callback.FlowStatus == FlowStatusEnum.Approve)
{
biz.BillAuditStatus = BillAuditStatus.PayPassed;
- biz.APFeeStatus = BillFeeStatus.AuditPassed;
+ biz.ARFeeStatus = biz.APFeeStatus = BillFeeStatus.AuditPassed;
status = FeeStatus.AuditPassed;
}
else if (callback.FlowStatus == FlowStatusEnum.Reject)
{
biz.BillAuditStatus = BillAuditStatus.PayRejected;
- biz.APFeeStatus = BillFeeStatus.RejectSubmission;
+ biz.ARFeeStatus = biz.APFeeStatus = BillFeeStatus.RejectSubmission;
+ status = FeeStatus.RejectSubmission;
}
biz.BillFeeStatusTime = dtNow;
@@ -112,6 +98,7 @@ namespace DS.WMS.Core.TaskInteraction.Method
{
x.BillAuditStatus,
x.BillFeeStatusTime,
+ x.ARFeeStatus,
x.APFeeStatus
}).ExecuteCommandAsync();
@@ -120,7 +107,7 @@ namespace DS.WMS.Core.TaskInteraction.Method
.SetColumns(x => x.AuditBy == userId)
.SetColumns(x => x.AuditOperator == User.UserName)
.SetColumns(x => x.AuditDate == dtNow)
- .Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType && x.FeeType == FeeType.Payable && x.FeeStatus == FeeStatus.AuditSubmitted)
+ .Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType && x.FeeStatus == FeeStatus.AuditSubmitted)
.ExecuteCommandAsync();
}
diff --git a/ds-wms-service/DS.WMS.FeeApi/Controllers/FeeAuditController.cs b/ds-wms-service/DS.WMS.FeeApi/Controllers/FeeAuditController.cs
index bff5b762..49995ab8 100644
--- a/ds-wms-service/DS.WMS.FeeApi/Controllers/FeeAuditController.cs
+++ b/ds-wms-service/DS.WMS.FeeApi/Controllers/FeeAuditController.cs
@@ -1,5 +1,6 @@
using System.Net;
using DS.Module.Core;
+using DS.Module.Core.Data;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Interface;
@@ -153,6 +154,17 @@ namespace DS.WMS.FeeApi.Controllers
}));
}
+ ///
+ /// 设置费用状态
+ ///
+ ///
+ ///
+ [HttpPost, Route("SetFeeStatus")]
+ public async Task SetFeeStatusAsync(IdModel idModel)
+ {
+ return await _auditService.SetFeeStatusAsync(idModel.Value, idModel.Ids);
+ }
+
///
/// 变更费用审核状态
///
diff --git a/ds-wms-service/DS.WMS.FeeApi/appsettings.json b/ds-wms-service/DS.WMS.FeeApi/appsettings.json
index 021d4d2d..c5a6c70c 100644
--- a/ds-wms-service/DS.WMS.FeeApi/appsettings.json
+++ b/ds-wms-service/DS.WMS.FeeApi/appsettings.json
@@ -75,6 +75,6 @@
"Queues": "fee"
},
"JobConfig": {
- "FeeCustTemplateJob": "1 59 23 * * ?"
+ "FeeCustTemplateJob": "0 0 5 * * ?"
}
}