|
|
@ -55,14 +55,23 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
.ToQueryPage(request.PageCondition);
|
|
|
|
.ToQueryPage(request.PageCondition);
|
|
|
|
|
|
|
|
|
|
|
|
//关联用户名称
|
|
|
|
//关联用户名称
|
|
|
|
var userIds = data.Data.Where(x => x.UpdateBy.HasValue).Select(x => x.UpdateBy.Value).Distinct().ToList();
|
|
|
|
var userIds = data.Data.Where(x => x.UpdateBy.HasValue).Select(x => x.UpdateBy.Value)
|
|
|
|
|
|
|
|
//.Union(data.Data.Where(x => x.SubmitBy.HasValue).Select(x => x.SubmitBy.Value))
|
|
|
|
|
|
|
|
.Union(data.Data.Select(x => x.CreateBy)).Distinct();
|
|
|
|
var users = db.Queryable<SysUser>().Where(x => userIds.Contains(x.Id)).Select(x => new { x.Id, x.UserName }).ToList();
|
|
|
|
var users = db.Queryable<SysUser>().Where(x => userIds.Contains(x.Id)).Select(x => new { x.Id, x.UserName }).ToList();
|
|
|
|
foreach (var item in data.Data)
|
|
|
|
foreach (var item in data.Data)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
item.CreateByName = users.Find(x => x.Id == item.CreateBy)?.UserName;
|
|
|
|
|
|
|
|
|
|
|
|
if (item.UpdateBy.HasValue)
|
|
|
|
if (item.UpdateBy.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
item.UpdateByName = users.Find(x => x.Id == item.UpdateBy.Value)?.UserName;
|
|
|
|
item.UpdateByName = users.Find(x => x.Id == item.UpdateBy.Value)?.UserName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (item.SubmitBy.HasValue)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// item.SubmitByName = users.Find(x => x.Id == item.SubmitBy.Value)?.UserName;
|
|
|
|
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
return data;
|
|
|
@ -111,7 +120,7 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
|
|
if (IsFeeLocked(bid))
|
|
|
|
if (IsFeeLocked(bid))
|
|
|
|
return DataResult.Failed("当前业务已费用锁定,禁止修改", MultiLanguageConst.Operation_Failed);
|
|
|
|
return DataResult.Failed("当前业务已费用锁定,禁止提交", MultiLanguageConst.Operation_Failed);
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -144,7 +153,6 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in items)
|
|
|
|
foreach (var item in items)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
item.SubmitDate = dtNow;
|
|
|
|
|
|
|
|
item.FeeStatus = FeeStatus.Entering;
|
|
|
|
item.FeeStatus = FeeStatus.Entering;
|
|
|
|
|
|
|
|
|
|
|
|
if (item.Id == 0)
|
|
|
|
if (item.Id == 0)
|
|
|
@ -156,13 +164,15 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tenantDb.Updateable(item).IgnoreColumns(x => new
|
|
|
|
tenantDb.Updateable(item).IgnoreColumns(x => new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//x.FeeStatus,
|
|
|
|
x.FeeStatus,
|
|
|
|
x.CreateBy,
|
|
|
|
x.CreateBy,
|
|
|
|
x.CreateTime,
|
|
|
|
x.CreateTime,
|
|
|
|
x.BusinessId,
|
|
|
|
x.BusinessId,
|
|
|
|
x.DeleteBy,
|
|
|
|
x.DeleteBy,
|
|
|
|
x.Deleted,
|
|
|
|
x.Deleted,
|
|
|
|
x.DeleteTime
|
|
|
|
x.DeleteTime,
|
|
|
|
|
|
|
|
x.SubmitDate,
|
|
|
|
|
|
|
|
x.SubmitBy
|
|
|
|
}).ExecuteCommand();
|
|
|
|
}).ExecuteCommand();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -312,6 +322,7 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
if (fees.IsNullOrEmpty())
|
|
|
|
if (fees.IsNullOrEmpty())
|
|
|
|
return DataResult.Failed($"未能获取费用信息,提交失败", MultiLanguageConst.Operation_Failed);
|
|
|
|
return DataResult.Failed($"未能获取费用信息,提交失败", MultiLanguageConst.Operation_Failed);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//业务状态检测
|
|
|
|
if (IsFeeLocked(fees[0].BusinessId))
|
|
|
|
if (IsFeeLocked(fees[0].BusinessId))
|
|
|
|
return DataResult.Failed("当前业务已费用锁定,禁止修改", MultiLanguageConst.Operation_Failed);
|
|
|
|
return DataResult.Failed("当前业务已费用锁定,禁止修改", MultiLanguageConst.Operation_Failed);
|
|
|
|
|
|
|
|
|
|
|
@ -334,7 +345,15 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
if (!result.Succeeded)
|
|
|
|
if (!result.Succeeded)
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
|
|
int rows = tenantDb.Updateable(fees).UpdateColumns(x => new { x.Id, x.FeeStatus, x.UpdateBy, x.UpdateTime, x.FlowId }).ExecuteCommand();
|
|
|
|
|
|
|
|
|
|
|
|
int rows = tenantDb.Updateable(fees).UpdateColumns(x => new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
x.Id,
|
|
|
|
|
|
|
|
x.FeeStatus,
|
|
|
|
|
|
|
|
x.SubmitBy,
|
|
|
|
|
|
|
|
x.SubmitDate,
|
|
|
|
|
|
|
|
x.FlowId
|
|
|
|
|
|
|
|
}).ExecuteCommand();
|
|
|
|
return rows > 0 ? DataResult.Successed("提交成功!", MultiLanguageConst.DataUpdateSuccess) : DataResult.Failed("提交失败!", MultiLanguageConst.Operation_Failed);
|
|
|
|
return rows > 0 ? DataResult.Successed("提交成功!", MultiLanguageConst.DataUpdateSuccess) : DataResult.Failed("提交失败!", MultiLanguageConst.Operation_Failed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -368,8 +387,8 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
|
|
|
|
|
|
|
//变更状态为提交审核
|
|
|
|
//变更状态为提交审核
|
|
|
|
item.FeeStatus = FeeStatus.AuditSubmitted;
|
|
|
|
item.FeeStatus = FeeStatus.AuditSubmitted;
|
|
|
|
item.UpdateBy = long.Parse(user.UserId);
|
|
|
|
item.SubmitBy = long.Parse(user.UserId);
|
|
|
|
item.UpdateTime = dtNow;
|
|
|
|
item.SubmitDate = dtNow;
|
|
|
|
item.FlowId = instance.Id;
|
|
|
|
item.FlowId = instance.Id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -407,8 +426,8 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
|
|
|
|
|
|
|
//变更状态为申请删除/修改
|
|
|
|
//变更状态为申请删除/修改
|
|
|
|
item.FeeStatus = auditType == FeeAuditType.ApplyDeletion ? FeeStatus.ApplyDeletion : FeeStatus.ApplyModification;
|
|
|
|
item.FeeStatus = auditType == FeeAuditType.ApplyDeletion ? FeeStatus.ApplyDeletion : FeeStatus.ApplyModification;
|
|
|
|
item.UpdateBy = long.Parse(user.UserId);
|
|
|
|
item.SubmitBy = long.Parse(user.UserId);
|
|
|
|
item.UpdateTime = dtNow;
|
|
|
|
item.SubmitDate = dtNow;
|
|
|
|
item.FlowId = instance.Id;
|
|
|
|
item.FlowId = instance.Id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -462,11 +481,18 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = fee.Id,
|
|
|
|
Id = fee.Id,
|
|
|
|
FeeStatus = targetStatus.Value,
|
|
|
|
FeeStatus = targetStatus.Value,
|
|
|
|
UpdateBy = long.Parse(user.UserId),
|
|
|
|
AuditBy = long.Parse(user.UserId),
|
|
|
|
UpdateTime = DateTime.Now,
|
|
|
|
AuditDate = DateTime.Now,
|
|
|
|
FlowId = null
|
|
|
|
FlowId = null
|
|
|
|
};
|
|
|
|
};
|
|
|
|
int rows = tenantDb.Updateable(entity).UpdateColumns(x => new { x.Id, x.FeeStatus, x.UpdateBy, x.UpdateTime, x.FlowId }).ExecuteCommand();
|
|
|
|
int rows = tenantDb.Updateable(entity).UpdateColumns(x => new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
x.Id,
|
|
|
|
|
|
|
|
x.FeeStatus,
|
|
|
|
|
|
|
|
x.AuditBy,
|
|
|
|
|
|
|
|
x.AuditDate,
|
|
|
|
|
|
|
|
x.FlowId
|
|
|
|
|
|
|
|
}).ExecuteCommand();
|
|
|
|
return rows > 0 ? DataResult.Successed("提交成功!", MultiLanguageConst.DataUpdateSuccess) : DataResult.Failed("提交失败!", MultiLanguageConst.Operation_Failed);
|
|
|
|
return rows > 0 ? DataResult.Successed("提交成功!", MultiLanguageConst.DataUpdateSuccess) : DataResult.Failed("提交失败!", MultiLanguageConst.Operation_Failed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -486,6 +512,9 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
FlowId = x.FlowId
|
|
|
|
FlowId = x.FlowId
|
|
|
|
}).ToList();
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fees.IsNullOrEmpty())
|
|
|
|
|
|
|
|
return DataResult.Failed("未能找到费用记录", MultiLanguageConst.Operation_Failed);
|
|
|
|
|
|
|
|
|
|
|
|
//未在审批状态中
|
|
|
|
//未在审批状态中
|
|
|
|
var fees2 = fees.FindAll(x => x.FlowId == null || x.FeeStatus != FeeStatus.AuditSubmitted ||
|
|
|
|
var fees2 = fees.FindAll(x => x.FlowId == null || x.FeeStatus != FeeStatus.AuditSubmitted ||
|
|
|
|
x.FeeStatus != FeeStatus.ApplyModification || x.FeeStatus != FeeStatus.ApplyDeletion).ToList();
|
|
|
|
x.FeeStatus != FeeStatus.ApplyModification || x.FeeStatus != FeeStatus.ApplyDeletion).ToList();
|
|
|
@ -517,12 +546,12 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
item.UpdateBy = long.Parse(user.UserId);
|
|
|
|
item.SubmitBy = long.Parse(user.UserId);
|
|
|
|
item.UpdateTime = dtNow;
|
|
|
|
item.SubmitDate = dtNow;
|
|
|
|
item.FlowId = null;
|
|
|
|
item.FlowId = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int rows = tenantDb.Updateable(fees).UpdateColumns(x => new { x.Id, x.FeeStatus, x.UpdateBy, x.UpdateTime, x.FlowId }).ExecuteCommand();
|
|
|
|
int rows = tenantDb.Updateable(fees).UpdateColumns(x => new { x.Id, x.FeeStatus, x.SubmitBy, x.SubmitDate, x.FlowId }).ExecuteCommand();
|
|
|
|
return rows > 0 ? DataResult.Successed("提交成功!", MultiLanguageConst.DataUpdateSuccess) : DataResult.Failed("提交失败!", MultiLanguageConst.Operation_Failed);
|
|
|
|
return rows > 0 ? DataResult.Successed("提交成功!", MultiLanguageConst.DataUpdateSuccess) : DataResult.Failed("提交失败!", MultiLanguageConst.Operation_Failed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -539,6 +568,5 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
x.AuditType == auditType).First();
|
|
|
|
x.AuditType == auditType).First();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|