2024-03-11 合同发票修改
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
@@ -21,12 +24,18 @@ namespace BLL
|
||||
return Funs.DB.PHTGL_Approve.FirstOrDefault(e => e.ApproveId == ApproveId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取未审批记录
|
||||
/// </summary>
|
||||
/// <param name="contractId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PHTGL_Approve> GetPHTGL_ApproveByContractId(string contractId)
|
||||
{
|
||||
var q = (from x in Funs.DB.PHTGL_Approve where x.ContractId == contractId && x.State == 0 select x).ToList();
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///获取当前人员的所有审批信息
|
||||
/// </summary>
|
||||
@@ -80,6 +89,22 @@ namespace BLL
|
||||
return IsExit;
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断当前人员是否正在审批
|
||||
/// </summary>
|
||||
/// <param name="contractId"></param>
|
||||
/// <param name="approveMan"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsApprovingMan(string contractId, string approveMan)
|
||||
{
|
||||
bool IsExit = false;
|
||||
var q = (from x in Funs.DB.PHTGL_Approve where x.ContractId == contractId && x.ApproveMan == approveMan && x.State==0 select x).ToList();
|
||||
if (q.Count>0)
|
||||
{
|
||||
IsExit = true;
|
||||
}
|
||||
return IsExit;
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加审批人员记录
|
||||
/// </summary>
|
||||
/// <param name="newtable"></param>
|
||||
@@ -207,23 +232,70 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="ContractId"></param>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetAllApproveData(string ContractId)
|
||||
//public static DataTable GetAllApproveData(string ContractId)
|
||||
//{
|
||||
// string strSql = @" select u.PersonName as ApproveMan,
|
||||
// App.ApproveDate,
|
||||
// (CASE App.IsAgree WHEN '1' THEN '不同意'
|
||||
// WHEN '2' THEN '同意' END) AS IsAgree,
|
||||
// App.ApproveIdea,
|
||||
// App.ApproveId,
|
||||
// App.ApproveType
|
||||
// from PHTGL_Approve as App"
|
||||
// + @" left join Person_Persons AS U ON U.PersonId = App.ApproveMan WHERE 1=1 and App.IsAgree <>0 and app.ContractId= @ContractId order by convert(datetime ,App.ApproveDate) ";
|
||||
// List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
// listStr.Add(new SqlParameter("@ContractId", ContractId));
|
||||
// SqlParameter[] parameter = listStr.ToArray();
|
||||
// DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
// return tb;
|
||||
//}
|
||||
public static IEnumerable GetAllApproveData(string contractId)
|
||||
{
|
||||
string strSql = @" select u.PersonName as ApproveMan,
|
||||
App.ApproveDate,
|
||||
(CASE App.IsAgree WHEN '1' THEN '不同意'
|
||||
WHEN '2' THEN '同意' END) AS IsAgree,
|
||||
App.ApproveIdea,
|
||||
App.ApproveId,
|
||||
App.ApproveType
|
||||
from PHTGL_Approve as App"
|
||||
+ @" left join Person_Persons AS U ON U.PersonId = App.ApproveMan WHERE 1=1 and App.IsAgree <>0 and app.ContractId= @ContractId order by convert(datetime ,App.ApproveDate) ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ContractId", ContractId));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
return tb;
|
||||
var result = (from x in Funs.DB.PHTGL_Approve
|
||||
join u in Funs.DB.Person_Persons on x.ApproveMan equals u.PersonId
|
||||
where x.IsAgree != 0 && x.ContractId == contractId
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
ApproveMan = u.PersonName,
|
||||
x.ApproveDate,
|
||||
IsAgree = x.IsAgree == 1 ? "不同意" : "同意",
|
||||
x.ApproveIdea,
|
||||
x.ApproveId,
|
||||
x.ApproveType,
|
||||
x.ApproveForm
|
||||
}
|
||||
|
||||
).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
public static IEnumerable GetAllApproveData(string contractId,string aproveForm)
|
||||
{
|
||||
var result = (from x in Funs.DB.PHTGL_Approve
|
||||
join u in Funs.DB.Person_Persons on x.ApproveMan equals u.PersonId
|
||||
where x.IsAgree != 0 && x.ContractId == contractId
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
ApproveMan = u.PersonName,
|
||||
x.ApproveDate,
|
||||
IsAgree = x.IsAgree == 1 ? "不同意" : "同意",
|
||||
x.ApproveIdea,
|
||||
x.ApproveId,
|
||||
x.ApproveType,
|
||||
x.ApproveForm
|
||||
}
|
||||
|
||||
).ToList();
|
||||
if (!string.IsNullOrEmpty(aproveForm))
|
||||
{
|
||||
result = result.Where(x => x.ApproveForm == aproveForm).ToList();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取最后拒绝的人员
|
||||
/// </summary>
|
||||
@@ -243,57 +315,4 @@ namespace BLL
|
||||
return tb;
|
||||
}
|
||||
}
|
||||
public class ApproveManModel
|
||||
{
|
||||
public int Number
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public string userid
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public string Rolename
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
}
|
||||
public class PrintModel
|
||||
{
|
||||
public int Number
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public string Rolename
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public string UserName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public string Image
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public string ApproveIdea
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public string ApproveDate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user