202305291、修改奖励通知单、奖惩通知单。
This commit is contained in:
@@ -21,6 +21,28 @@ namespace BLL
|
||||
return Funs.DB.CostGoods_Expense.FirstOrDefault(e => e.ExpenseId == expenseId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取措施费用使用计划
|
||||
/// </summary>
|
||||
/// <param name="expenseId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.CostGoods_Expense> GetExpenseList(string projectId, string unitId, int? year)
|
||||
{
|
||||
var getData = from x in Funs.DB.CostGoods_Expense
|
||||
where x.ProjectId == projectId
|
||||
select x;
|
||||
if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null)
|
||||
{
|
||||
getData = getData.Where(x =>x.UnitId == unitId);
|
||||
}
|
||||
if (year.HasValue)
|
||||
{
|
||||
getData = getData.Where(x => x.Year == year);
|
||||
}
|
||||
|
||||
return getData.OrderBy(x => x.SortIndex).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间获取当期单位Id集合
|
||||
/// </summary>
|
||||
@@ -49,22 +71,17 @@ namespace BLL
|
||||
ProjectId = expense.ProjectId,
|
||||
ExpenseCode = expense.ExpenseCode,
|
||||
UnitId = expense.UnitId,
|
||||
//newExpense.CompileMan = expense.CompileMan;
|
||||
ReportDate=expense.ReportDate,
|
||||
CreateDate = expense.CreateDate,
|
||||
States = expense.States,
|
||||
Months = expense.Months,
|
||||
ReportDate = expense.ReportDate,
|
||||
PlanCostA = expense.PlanCostA,
|
||||
PlanCostB = expense.PlanCostB,
|
||||
CompileMan = expense.CompileMan,
|
||||
CompileDate = expense.CompileDate,
|
||||
// newExpense.CheckMan = expense.CheckMan;
|
||||
CheckDate = expense.CheckDate,
|
||||
// newExpense.ApproveMan = expense.ApproveMan;
|
||||
ApproveDate = expense.ApproveDate
|
||||
SortIndex = expense.SortIndex,
|
||||
Year = expense.Year,
|
||||
};
|
||||
db.CostGoods_Expense.InsertOnSubmit(newExpense);
|
||||
db.SubmitChanges();
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectExpenseMenuId, expense.ProjectId, null, expense.ExpenseId, expense.CreateDate);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -79,20 +96,22 @@ namespace BLL
|
||||
{
|
||||
//newExpense.ProjectId = expense.ProjectId;
|
||||
newExpense.ExpenseCode = expense.ExpenseCode;
|
||||
newExpense.UnitId = expense.UnitId;
|
||||
// newExpense.CompileMan = expense.CompileMan;
|
||||
newExpense.CreateDate = expense.CreateDate;
|
||||
newExpense.UnitId = expense.UnitId;
|
||||
newExpense.States = expense.States;
|
||||
newExpense.Months = expense.Months;
|
||||
newExpense.ReportDate = expense.ReportDate;
|
||||
newExpense.PlanCostA = expense.PlanCostA;
|
||||
newExpense.PlanCostB = expense.PlanCostB;
|
||||
newExpense.CompileDate = expense.CompileDate;
|
||||
newExpense.CompileMan = expense.CompileMan;
|
||||
//newExpense.CheckMan = expense.CheckMan;
|
||||
newExpense.CheckDate = expense.CheckDate;
|
||||
//newExpense.CheckDate = expense.CheckDate;
|
||||
//newExpense.ApproveMan = expense.ApproveMan;
|
||||
newExpense.ApproveDate = expense.ApproveDate;
|
||||
// newExpense.ApproveDate = expense.ApproveDate;
|
||||
newExpense.SortIndex = expense.SortIndex;
|
||||
newExpense.Year = expense.Year;
|
||||
db.SubmitChanges();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +131,48 @@ namespace BLL
|
||||
BLL.CommonService.DeleteFlowOperateByID(expenseId);
|
||||
db.CostGoods_Expense.DeleteOnSubmit(expense);
|
||||
db.SubmitChanges();
|
||||
|
||||
if (expense.Year.HasValue)
|
||||
{
|
||||
SetSumYearExpense(expense.ProjectId, expense.Year.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当前合计数
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="Year"></param>
|
||||
public static void SetSumYearExpense(string projectId,int Year)
|
||||
{
|
||||
var getYearEx = Funs.DB. CostGoods_Expense.FirstOrDefault(x=>x.ProjectId == projectId && x.Year == Year && x.UnitId == null);
|
||||
if (getYearEx != null)
|
||||
{
|
||||
Funs.DB.CostGoods_Expense.DeleteOnSubmit(getYearEx);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
var getALLEx=from x in Funs.DB.CostGoods_Expense where x.ProjectId == projectId && x.Year == Year && x.UnitId != null select x;
|
||||
if (getALLEx.Count() > 0)
|
||||
{
|
||||
Model.CostGoods_Expense newExpense = new Model.CostGoods_Expense
|
||||
{
|
||||
ExpenseId = SQLHelper.GetNewID(),
|
||||
ProjectId = projectId,
|
||||
UnitId = null,
|
||||
CreateDate = DateTime.Now,
|
||||
Months = DateTime.Now,
|
||||
ReportDate = DateTime.Now,
|
||||
CompileDate = DateTime.Now,
|
||||
CheckDate = DateTime.Now,
|
||||
ApproveDate = DateTime.Now,
|
||||
SortIndex = 0,
|
||||
Year = Year,
|
||||
};
|
||||
|
||||
db.CostGoods_Expense.InsertOnSubmit(newExpense);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user