代码无效引用清理,试压包资料界面看板修改
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using Aspose.Words;
|
||||
using FineUIPro;
|
||||
using ICSharpCode.SharpZipLib.Zip;
|
||||
using Microsoft.SqlServer.Server;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -10,7 +9,6 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -584,7 +582,7 @@ namespace BLL
|
||||
return doc1;
|
||||
}
|
||||
|
||||
public static void PrintFile( string ContractReviewId)
|
||||
public static void PrintFile(string ContractReviewId)
|
||||
{
|
||||
string rootPath = Funs.RootPath;
|
||||
var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
|
||||
@@ -621,10 +619,10 @@ namespace BLL
|
||||
|
||||
}
|
||||
|
||||
public static void PrintFileByDocument(Document doc,string name)
|
||||
public static void PrintFileByDocument(Document doc, string name)
|
||||
{
|
||||
string rootPath = Funs.RootPath;
|
||||
|
||||
|
||||
string newUrl = string.Empty;
|
||||
newUrl = rootPath + "File\\Word\\PHTGL\\合同评审.docx";
|
||||
newUrl = newUrl.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx");
|
||||
@@ -639,7 +637,7 @@ namespace BLL
|
||||
//验证参数
|
||||
if (doc1 == null) { throw new Exception("Word文件无效"); }
|
||||
doc1.Save(pdfUrl, Aspose.Words.SaveFormat.Pdf);//还可以改成其它格式
|
||||
string fileName = Path.GetFileName(pdfUrl).Replace("合同评审", name );
|
||||
string fileName = Path.GetFileName(pdfUrl).Replace("合同评审", name);
|
||||
FileInfo info = new FileInfo(pdfUrl);
|
||||
long fileSize = info.Length;
|
||||
System.Web.HttpContext.Current.Response.Clear();
|
||||
@@ -654,15 +652,15 @@ namespace BLL
|
||||
|
||||
}
|
||||
|
||||
public static void PrintApprovalForm(string ContractReviewId)
|
||||
public static void PrintApprovalForm(string ContractReviewId)
|
||||
{
|
||||
var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
|
||||
var getFireWork = BLL.ContractService.GetContractById(ReviewModel.ContractId);
|
||||
string projectname=ProjectService.GetProjectNameByProjectId(getFireWork.ProjectId);
|
||||
string projectname = ProjectService.GetProjectNameByProjectId(getFireWork.ProjectId);
|
||||
string rootPath = Funs.RootPath;
|
||||
|
||||
string startPath = rootPath + "File\\Word\\PHTGL\\"+ getFireWork.ContractNum + "-"+projectname + "-" + getFireWork.ContractName + "-合同管理资料";
|
||||
if (!Directory.Exists(startPath))
|
||||
string startPath = rootPath + "File\\Word\\PHTGL\\" + getFireWork.ContractNum + "-" + projectname + "-" + getFireWork.ContractName + "-合同管理资料";
|
||||
if (!Directory.Exists(startPath))
|
||||
{
|
||||
Directory.CreateDirectory(startPath);
|
||||
}
|
||||
@@ -670,24 +668,24 @@ namespace BLL
|
||||
switch (getFireWork.ConfirmWay)
|
||||
{
|
||||
case "1":
|
||||
PrintApprovalFormType_SetSub(ContractReviewId, startPath + "\\");
|
||||
PrintApprovalFormType_SetSub(ContractReviewId, startPath + "\\");
|
||||
break;
|
||||
case "2":
|
||||
PrintApprovalFormType_SetSub(ContractReviewId, startPath + "\\");
|
||||
PrintApprovalFormType_SetSub(ContractReviewId, startPath + "\\");
|
||||
break;
|
||||
case "3":
|
||||
PrintApprovalFormType_SetSub(ContractReviewId, startPath + "\\");
|
||||
PrintApprovalFormType_SetSub(ContractReviewId, startPath + "\\");
|
||||
break;
|
||||
case "4":
|
||||
PrintApprovalFormType_Act(ContractReviewId, startPath + "\\");
|
||||
PrintApprovalFormType_Act(ContractReviewId, startPath + "\\");
|
||||
|
||||
break;
|
||||
case "5":
|
||||
PrintApprovalFormType_Act(ContractReviewId, startPath + "\\");
|
||||
|
||||
break;
|
||||
default :
|
||||
PrintApprovalFormType__Con(ContractReviewId, startPath + "\\");
|
||||
break;
|
||||
default:
|
||||
PrintApprovalFormType__Con(ContractReviewId, startPath + "\\");
|
||||
break;
|
||||
}
|
||||
System.IO.Compression.ZipFile.CreateFromDirectory(startPath, zipPath);
|
||||
@@ -701,9 +699,9 @@ namespace BLL
|
||||
System.Web.HttpContext.Current.Response.Flush();
|
||||
System.Web.HttpContext.Current.Response.Close();
|
||||
Funs.DeleteDir(startPath);
|
||||
File.Delete (zipPath);
|
||||
File.Delete(zipPath);
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// ConfirmWay 4,5
|
||||
/// </summary>
|
||||
@@ -729,37 +727,37 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// ConfirmWay 1,2,3
|
||||
/// </summary>
|
||||
public static void PrintApprovalFormType_SetSub(string ContractReviewId,string path)
|
||||
public static void PrintApprovalFormType_SetSub(string ContractReviewId, string path)
|
||||
{
|
||||
|
||||
Model.PHTGL_Contract Contract =new Model.PHTGL_Contract(); //合同信息
|
||||
|
||||
Model.PHTGL_Contract Contract = new Model.PHTGL_Contract(); //合同信息
|
||||
Model.PHTGL_SetSubReview SetSub = new Model.PHTGL_SetSubReview(); //确认分包商信息
|
||||
Model.PHTGL_BidApproveUserReview ApproveUser = new Model.PHTGL_BidApproveUserReview(); //评标小组名单信息
|
||||
Model.PHTGL_BidDocumentsReview BidDoc = new Model.PHTGL_BidDocumentsReview();//招标文件信息
|
||||
Model.PHTGL_ActionPlanReview ActPlan = new Model.PHTGL_ActionPlanReview();//实施计划信息
|
||||
Model.PHTGL_ActionPlanFormation ActPlanFormat = new Model.PHTGL_ActionPlanFormation(); //实施计划编制信息
|
||||
|
||||
var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
|
||||
Contract = BLL.ContractService.GetContractById(ReviewModel.ContractId);
|
||||
SetSub = BLL.PHTGL_SetSubReviewService.GetPHTGL_SetSubReviewBySetSubReviewCode(Contract.SetSubReviewCode);
|
||||
ApproveUser = BLL.PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(SetSub.ApproveUserReviewID);
|
||||
BidDoc = BLL.PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(ApproveUser.BidDocumentsReviewId);
|
||||
ActPlan = BLL.PHTGL_ActionPlanReviewService.GetPHTGL_ActionPlanReviewById(BidDoc.ActionPlanReviewId);
|
||||
ActPlanFormat = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(ActPlan.ActionPlanID);
|
||||
var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
|
||||
Contract = BLL.ContractService.GetContractById(ReviewModel.ContractId);
|
||||
SetSub = BLL.PHTGL_SetSubReviewService.GetPHTGL_SetSubReviewBySetSubReviewCode(Contract.SetSubReviewCode);
|
||||
ApproveUser = BLL.PHTGL_BidApproveUserReviewService.GetPHTGL_BidApproveUserReviewById(SetSub.ApproveUserReviewID);
|
||||
BidDoc = BLL.PHTGL_BidDocumentsReviewService.GetPHTGL_BidDocumentsReviewById(ApproveUser.BidDocumentsReviewId);
|
||||
ActPlan = BLL.PHTGL_ActionPlanReviewService.GetPHTGL_ActionPlanReviewById(BidDoc.ActionPlanReviewId);
|
||||
ActPlanFormat = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(ActPlan.ActionPlanID);
|
||||
|
||||
var Doc_ActPlan = PHTGL_ActionPlanFormationService.Print(ActPlan.ActionPlanID);
|
||||
var Doc_ActPlan = PHTGL_ActionPlanFormationService.Print(ActPlan.ActionPlanID);
|
||||
var Doc_BidDoc = PHTGL_BidDocumentsReviewService.Print(BidDoc.BidDocumentsReviewId);
|
||||
var Doc_ApproveUser = PHTGL_BidApproveUserReviewService.Print(ApproveUser.ApproveUserReviewID);
|
||||
var Doc_SetSub = PHTGL_SetSubReviewService.Print(SetSub.SetSubReviewID);
|
||||
var Doc_Contract = Print(ContractReviewId);
|
||||
|
||||
Doc_ActPlan.Save(path+ ActPlanFormat.ActionPlanCode+ "施工分包实施计划.pdf" , SaveFormat.Pdf);
|
||||
Doc_BidDoc.Save(path + BidDoc.BidDocumentsCode + "招标文件审批表.pdf",SaveFormat.Pdf);
|
||||
Doc_ApproveUser.Save(path+ "施工招标评标小组名单审批表.pdf", SaveFormat.Pdf);
|
||||
Doc_SetSub.Save(path+ SetSub.SetSubReviewCode+ "确定分包商审批表.pdf", SaveFormat.Pdf);
|
||||
Doc_Contract.Save(path+ Contract.ContractNum + "合同评审.pdf", SaveFormat.Pdf);
|
||||
Doc_ActPlan.Save(path + ActPlanFormat.ActionPlanCode + "施工分包实施计划.pdf", SaveFormat.Pdf);
|
||||
Doc_BidDoc.Save(path + BidDoc.BidDocumentsCode + "招标文件审批表.pdf", SaveFormat.Pdf);
|
||||
Doc_ApproveUser.Save(path + "施工招标评标小组名单审批表.pdf", SaveFormat.Pdf);
|
||||
Doc_SetSub.Save(path + SetSub.SetSubReviewCode + "确定分包商审批表.pdf", SaveFormat.Pdf);
|
||||
Doc_Contract.Save(path + Contract.ContractNum + "合同评审.pdf", SaveFormat.Pdf);
|
||||
}
|
||||
public static void PrintApprovalFormType__Con(string ContractReviewId,string path)
|
||||
public static void PrintApprovalFormType__Con(string ContractReviewId, string path)
|
||||
{
|
||||
Model.PHTGL_Contract Contract = new Model.PHTGL_Contract(); //合同信息
|
||||
var ReviewModel = BLL.PHTGL_ContractReviewService.GetPHTGL_ContractReviewById(ContractReviewId);
|
||||
|
||||
@@ -50,15 +50,15 @@ namespace BLL
|
||||
/// <param name="ProjectId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PHTGL_Contract> GetCompletedContracts(string ProjectId)
|
||||
{
|
||||
var q= from x in Funs.DB.PHTGL_Contract
|
||||
join y in Funs.DB.PHTGL_ContractReview on x.ContractId equals y.ContractId
|
||||
where
|
||||
y.State== Const.ContractReview_Complete &&
|
||||
x.ContractAttribute==0 &&
|
||||
x.ProjectId==ProjectId
|
||||
select x;
|
||||
return q.ToList();
|
||||
{
|
||||
var q = from x in Funs.DB.PHTGL_Contract
|
||||
join y in Funs.DB.PHTGL_ContractReview on x.ContractId equals y.ContractId
|
||||
where
|
||||
y.State == Const.ContractReview_Complete &&
|
||||
x.ContractAttribute == 0 &&
|
||||
x.ProjectId == ProjectId
|
||||
select x;
|
||||
return q.ToList();
|
||||
}
|
||||
public static void InitAllProjectCodeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
@@ -82,7 +82,7 @@ namespace BLL
|
||||
dropName.DataTextField = "ContractNum";
|
||||
var CompletedContractslist = GetCompletedContracts(projectId);
|
||||
dropName.DataSource = CompletedContractslist;
|
||||
dropName.DataBind();
|
||||
dropName.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class ContractStandingBookService
|
||||
{
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
@@ -58,7 +58,7 @@ namespace BLL
|
||||
(string.IsNullOrEmpty(table.Retentionmoney) || x.Retentionmoney.Contains(table.Retentionmoney)) &&
|
||||
(string.IsNullOrEmpty(table.CreateDate) || x.CreateDate.Contains(table.CreateDate)) &&
|
||||
(string.IsNullOrEmpty(table.Status) || x.Status.Contains(table.Status)) &&
|
||||
(table.States == null || x.States==table.States) &&
|
||||
(table.States == null || x.States == table.States) &&
|
||||
(string.IsNullOrEmpty(table.ContactUnitOfPartyA) || x.ContactUnitOfPartyA.Contains(table.ContactUnitOfPartyA)) &&
|
||||
(string.IsNullOrEmpty(table.ContactPersonOfPartyA) || x.ContactPersonOfPartyA.Contains(table.ContactPersonOfPartyA)) &&
|
||||
(string.IsNullOrEmpty(table.ContactPersonOfPartyB) || x.ContactPersonOfPartyB.Contains(table.ContactPersonOfPartyB)) &&
|
||||
@@ -72,7 +72,7 @@ namespace BLL
|
||||
(string.IsNullOrEmpty(table.SubcontractingMethod) || x.SubcontractingMethod.Contains(table.SubcontractingMethod)) &&
|
||||
(string.IsNullOrEmpty(table.IsItACentralizedPurchaseSupplier) || x.IsItACentralizedPurchaseSupplier.Contains(table.IsItACentralizedPurchaseSupplier)) &&
|
||||
(string.IsNullOrEmpty(table.Clause) || x.Clause.Contains(table.Clause)) &&
|
||||
(string.IsNullOrEmpty(table.MainContent) || x.MainContent.Contains(table.MainContent))
|
||||
(string.IsNullOrEmpty(table.MainContent) || x.MainContent.Contains(table.MainContent))
|
||||
select x
|
||||
;
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace BLL
|
||||
{
|
||||
return null;
|
||||
}
|
||||
q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
|
||||
q = q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
@@ -218,9 +218,9 @@ namespace BLL
|
||||
{
|
||||
ContractId = newtable.ContractId,
|
||||
ProjectId = newtable.ProjectId,
|
||||
UnitId=newtable.UnitId,
|
||||
ProjectName= newtable.ProjectName,
|
||||
ProjectCode= newtable.ProjectCode,
|
||||
UnitId = newtable.UnitId,
|
||||
ProjectName = newtable.ProjectName,
|
||||
ProjectCode = newtable.ProjectCode,
|
||||
ContractName = newtable.ContractName,
|
||||
ContractNum = newtable.ContractNum,
|
||||
Parties = newtable.Parties,
|
||||
@@ -286,9 +286,9 @@ namespace BLL
|
||||
if (newContract != null)
|
||||
{
|
||||
newContract.ProjectId = contract.ProjectId;
|
||||
newContract.UnitId= contract.UnitId;
|
||||
newContract.ProjectName=contract.ProjectName;
|
||||
newContract.ProjectCode=contract.ProjectCode;
|
||||
newContract.UnitId = contract.UnitId;
|
||||
newContract.ProjectName = contract.ProjectName;
|
||||
newContract.ProjectCode = contract.ProjectCode;
|
||||
newContract.ContractCode = contract.ContractCode;
|
||||
newContract.ContractName = contract.ContractName;
|
||||
newContract.ContractNum = contract.ContractNum;
|
||||
@@ -370,7 +370,7 @@ namespace BLL
|
||||
|
||||
public class ContractStandingBooKDtoIn
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 合同名称
|
||||
///</summary>
|
||||
@@ -379,7 +379,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 合同编号
|
||||
///</summary>
|
||||
[ExcelColumnName("合同编号")]
|
||||
[ExcelColumnName("合同编号")]
|
||||
public string ContractNum { get; set; }
|
||||
|
||||
[ExcelColumnName("项目名称")]
|
||||
@@ -390,7 +390,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 签约方
|
||||
///</summary>
|
||||
[ExcelColumnName("签约方")]
|
||||
[ExcelColumnName("签约方")]
|
||||
public string Parties { get; set; }
|
||||
/// <summary>
|
||||
/// 币种(人民币、美元、欧元、印尼盾)
|
||||
@@ -408,7 +408,7 @@ namespace BLL
|
||||
///</summary>
|
||||
[ExcelColumnName("合同类型")]
|
||||
public string ContractType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
@@ -424,7 +424,7 @@ namespace BLL
|
||||
///</summary>
|
||||
[ExcelColumnName("合同属性")]
|
||||
public string ContractAttribute { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
@@ -455,13 +455,13 @@ namespace BLL
|
||||
///</summary>
|
||||
[ExcelColumnName("质保金")]
|
||||
public string Retentionmoney { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 合同状态
|
||||
///</summary>
|
||||
[ExcelColumnName("合同状态")]
|
||||
public string Status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 甲方联系单位
|
||||
///</summary>
|
||||
@@ -527,7 +527,7 @@ namespace BLL
|
||||
///</summary>
|
||||
[ExcelColumnName("乙方是否为集采供应商/分包商")]
|
||||
public string IsItACentralizedPurchaseSupplier { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
@@ -37,7 +35,7 @@ namespace BLL
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///获取当前人员的所有审批信息
|
||||
/// </summary>
|
||||
@@ -52,7 +50,7 @@ namespace BLL
|
||||
}
|
||||
public static Model.PHTGL_Approve GetPHTGL_ApproveByContractIdandUserId(string contractId, string UserID)
|
||||
{
|
||||
var q=(from x in Funs.DB.PHTGL_Approve where x.ContractId==contractId && x.ApproveMan==UserID orderby x.ApproveDate descending select x ).FirstOrDefault();
|
||||
var q = (from x in Funs.DB.PHTGL_Approve where x.ContractId == contractId && x.ApproveMan == UserID orderby x.ApproveDate descending select x).FirstOrDefault();
|
||||
//return Funs.DB.PHTGL_Approve.FirstOrDefault(e => e.ContractId == contractId && e.ApproveMan == UserID );
|
||||
return q;
|
||||
}
|
||||
@@ -99,8 +97,8 @@ namespace BLL
|
||||
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)
|
||||
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;
|
||||
}
|
||||
@@ -172,7 +170,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.PHTGL_Approve> GetApproves_NopushOa()
|
||||
{
|
||||
var q = (from x in Funs.DB.PHTGL_Approve where x.IsPushOa == 0 && x.ApproveMan != "" && x.State==0 select x).ToList();
|
||||
var q = (from x in Funs.DB.PHTGL_Approve where x.IsPushOa == 0 && x.ApproveMan != "" && x.State == 0 select x).ToList();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -254,47 +252,47 @@ namespace BLL
|
||||
public static IEnumerable GetAllApproveData(string contractId)
|
||||
{
|
||||
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
|
||||
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
|
||||
}
|
||||
{
|
||||
ApproveMan = u.PersonName,
|
||||
x.ApproveDate,
|
||||
IsAgree = x.IsAgree == 1 ? "不同意" : "同意",
|
||||
x.ApproveIdea,
|
||||
x.ApproveId,
|
||||
x.ApproveType,
|
||||
x.ApproveForm
|
||||
}
|
||||
|
||||
).ToList();
|
||||
).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
public static IEnumerable GetAllApproveData(string contractId,string aproveForm)
|
||||
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
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
using System;
|
||||
using EmitMapper;
|
||||
using FineUIPro;
|
||||
using MiniExcelLibs;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using EmitMapper;
|
||||
using EmitMapper.MappingConfiguration;
|
||||
using FineUIPro;
|
||||
using MiniExcelLibs;
|
||||
using MiniExcelLibs.Attributes;
|
||||
using MiniExcelLibs.OpenXml;
|
||||
using Model;
|
||||
using WIA;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -59,7 +54,7 @@ namespace BLL
|
||||
(string.IsNullOrEmpty(table.SettledQuantity) ||
|
||||
x.SettledQuantity.Contains(table.SettledQuantity)) &&
|
||||
(string.IsNullOrEmpty(table.ContractId) ||
|
||||
table.ContractId.Split(',').Contains(x.ContractId))&&
|
||||
table.ContractId.Split(',').Contains(x.ContractId)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) ||
|
||||
x.ProjectId.Contains(table.ProjectId))
|
||||
|
||||
@@ -72,44 +67,44 @@ namespace BLL
|
||||
public static PHTGL_ContractTrack GetFirstPHTGL_ContractTrackByModle(PHTGL_ContractTrack table)
|
||||
{
|
||||
var q = (from x in Funs.DB.PHTGL_ContractTrack
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.ContractNum) || x.ContractNum.Contains(table.ContractNum)) &&
|
||||
(string.IsNullOrEmpty(table.MainItemCode) || x.MainItemCode.Contains(table.MainItemCode)) &&
|
||||
(string.IsNullOrEmpty(table.MainItemName) || x.MainItemName.Contains(table.MainItemName)) &&
|
||||
(string.IsNullOrEmpty(table.MajorName) || x.MajorName.Contains(table.MajorName)) &&
|
||||
(string.IsNullOrEmpty(table.MajorCode) || x.MajorCode.Contains(table.MajorCode)) &&
|
||||
(string.IsNullOrEmpty(table.SubProject) || x.SubProject.Contains(table.SubProject)) &&
|
||||
(string.IsNullOrEmpty(table.SubItemProject) ||
|
||||
x.SubItemProject.Contains(table.SubItemProject)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectCode) || x.ProjectCode.Contains(table.ProjectCode)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectName) || x.ProjectName.Contains(table.ProjectName)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectDescription) ||
|
||||
x.ProjectDescription.Contains(table.ProjectDescription)) &&
|
||||
(string.IsNullOrEmpty(table.UnitOfMeasurement) ||
|
||||
x.UnitOfMeasurement.Contains(table.UnitOfMeasurement)) &&
|
||||
(string.IsNullOrEmpty(table.Quantity) || x.Quantity.Contains(table.Quantity)) &&
|
||||
(string.IsNullOrEmpty(table.CalculationRule) ||
|
||||
x.CalculationRule.Contains(table.CalculationRule)) &&
|
||||
(string.IsNullOrEmpty(table.WorkContent) || x.WorkContent.Contains(table.WorkContent)) &&
|
||||
(string.IsNullOrEmpty(table.Remarks) || x.Remarks.Contains(table.Remarks)) &&
|
||||
(string.IsNullOrEmpty(table.ConstructionSubcontractor) ||
|
||||
x.ConstructionSubcontractor.Contains(table.ConstructionSubcontractor)) &&
|
||||
(string.IsNullOrEmpty(table.ContractWeight) ||
|
||||
x.ContractWeight.Contains(table.ContractWeight)) &&
|
||||
(string.IsNullOrEmpty(table.MaterialSupplier) ||
|
||||
x.MaterialSupplier.Contains(table.MaterialSupplier)) &&
|
||||
(string.IsNullOrEmpty(table.EstimatedQuantity) ||
|
||||
x.EstimatedQuantity.Contains(table.EstimatedQuantity)) &&
|
||||
(string.IsNullOrEmpty(table.SettledQuantity) ||
|
||||
x.SettledQuantity.Contains(table.SettledQuantity)) &&
|
||||
(string.IsNullOrEmpty(table.ContractId) ||
|
||||
table.ContractId.Split(',').Contains(x.ContractId)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) ||
|
||||
x.ProjectId.Contains(table.ProjectId))
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.ContractNum) || x.ContractNum.Contains(table.ContractNum)) &&
|
||||
(string.IsNullOrEmpty(table.MainItemCode) || x.MainItemCode.Contains(table.MainItemCode)) &&
|
||||
(string.IsNullOrEmpty(table.MainItemName) || x.MainItemName.Contains(table.MainItemName)) &&
|
||||
(string.IsNullOrEmpty(table.MajorName) || x.MajorName.Contains(table.MajorName)) &&
|
||||
(string.IsNullOrEmpty(table.MajorCode) || x.MajorCode.Contains(table.MajorCode)) &&
|
||||
(string.IsNullOrEmpty(table.SubProject) || x.SubProject.Contains(table.SubProject)) &&
|
||||
(string.IsNullOrEmpty(table.SubItemProject) ||
|
||||
x.SubItemProject.Contains(table.SubItemProject)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectCode) || x.ProjectCode.Contains(table.ProjectCode)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectName) || x.ProjectName.Contains(table.ProjectName)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectDescription) ||
|
||||
x.ProjectDescription.Contains(table.ProjectDescription)) &&
|
||||
(string.IsNullOrEmpty(table.UnitOfMeasurement) ||
|
||||
x.UnitOfMeasurement.Contains(table.UnitOfMeasurement)) &&
|
||||
(string.IsNullOrEmpty(table.Quantity) || x.Quantity.Contains(table.Quantity)) &&
|
||||
(string.IsNullOrEmpty(table.CalculationRule) ||
|
||||
x.CalculationRule.Contains(table.CalculationRule)) &&
|
||||
(string.IsNullOrEmpty(table.WorkContent) || x.WorkContent.Contains(table.WorkContent)) &&
|
||||
(string.IsNullOrEmpty(table.Remarks) || x.Remarks.Contains(table.Remarks)) &&
|
||||
(string.IsNullOrEmpty(table.ConstructionSubcontractor) ||
|
||||
x.ConstructionSubcontractor.Contains(table.ConstructionSubcontractor)) &&
|
||||
(string.IsNullOrEmpty(table.ContractWeight) ||
|
||||
x.ContractWeight.Contains(table.ContractWeight)) &&
|
||||
(string.IsNullOrEmpty(table.MaterialSupplier) ||
|
||||
x.MaterialSupplier.Contains(table.MaterialSupplier)) &&
|
||||
(string.IsNullOrEmpty(table.EstimatedQuantity) ||
|
||||
x.EstimatedQuantity.Contains(table.EstimatedQuantity)) &&
|
||||
(string.IsNullOrEmpty(table.SettledQuantity) ||
|
||||
x.SettledQuantity.Contains(table.SettledQuantity)) &&
|
||||
(string.IsNullOrEmpty(table.ContractId) ||
|
||||
table.ContractId.Split(',').Contains(x.ContractId)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) ||
|
||||
x.ProjectId.Contains(table.ProjectId))
|
||||
|
||||
select x).FirstOrDefault()
|
||||
;
|
||||
select x).FirstOrDefault()
|
||||
;
|
||||
return q;
|
||||
}
|
||||
|
||||
@@ -264,11 +259,11 @@ namespace BLL
|
||||
var table = Funs.DB.PHTGL_ContractTrack.FirstOrDefault(x => x.Id == id);
|
||||
if (table != null)
|
||||
{
|
||||
|
||||
|
||||
table.EstimatedQuantity = string.Empty;
|
||||
table.EstimatedAmount = 0m;
|
||||
table.SettledQuantity = string.Empty;
|
||||
table.SettledAmount = 0m;
|
||||
table.SettledAmount = 0m;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -350,7 +345,7 @@ namespace BLL
|
||||
Funs.GetNewDecimalOrZero(model.SettledQuantity);
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
@@ -364,7 +359,7 @@ namespace BLL
|
||||
var model = GetPHTGL_ContractTrackById(id.ToString());
|
||||
if (model != null)
|
||||
{
|
||||
result =(model.EstimatedAmount??0 )- ( model.SettledAmount??0);
|
||||
result = (model.EstimatedAmount ?? 0) - (model.SettledAmount ?? 0);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -373,19 +368,19 @@ namespace BLL
|
||||
{
|
||||
var responeData = new ResponeData();
|
||||
List<PHTGL_ContractTrackDtoIn> rows;
|
||||
List<PHTGL_ContractTrack> thisContractTracks =new List<PHTGL_ContractTrack>();
|
||||
|
||||
List<PHTGL_ContractTrack> thisContractTracks = new List<PHTGL_ContractTrack>();
|
||||
|
||||
var sheetNames = MiniExcel.GetSheetNames(path);
|
||||
foreach (var sheet in sheetNames) ////多sheet导入
|
||||
{
|
||||
try
|
||||
{
|
||||
rows = MiniExcel.Query<PHTGL_ContractTrackDtoIn>(path, sheetName: sheet,startCell:"A2").ToList();
|
||||
rows = MiniExcel.Query<PHTGL_ContractTrackDtoIn>(path, sheetName: sheet, startCell: "A2").ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = sheet+"模板错误:" + ex.ToString();
|
||||
responeData.message = sheet + "模板错误:" + ex.ToString();
|
||||
return responeData;
|
||||
}
|
||||
var mapper =
|
||||
@@ -396,7 +391,7 @@ namespace BLL
|
||||
if (modeList.Count == 0)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = sheet+ "没有数据";
|
||||
responeData.message = sheet + "没有数据";
|
||||
return responeData;
|
||||
}
|
||||
foreach (var item in modeList)
|
||||
@@ -418,8 +413,8 @@ namespace BLL
|
||||
|
||||
item.ProjectCode = item.MainItemCode + "-" + item.ProjectCode;
|
||||
}
|
||||
|
||||
if (resultModel!=null)
|
||||
|
||||
if (resultModel != null)
|
||||
{
|
||||
item.Id = resultModel.Id;
|
||||
UpdatePHTGL_ContractTrack(item);
|
||||
@@ -435,9 +430,9 @@ namespace BLL
|
||||
}
|
||||
|
||||
AddBulkPHTGL_ContractTrack(goingAddList);
|
||||
PhtglContracttrackprogressService.CreateTemplateByContractList(goingAddList,projectid);
|
||||
PhtglContracttrackprogressService.CreateTemplateByContractList(goingAddList, projectid);
|
||||
}
|
||||
|
||||
|
||||
return responeData;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
@@ -29,7 +27,7 @@ namespace BLL
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.ContractTrackId) || x.ContractTrackId.Contains(table.ContractTrackId)) &&
|
||||
(string.IsNullOrEmpty(table.ControlItemAndCycleId) || x.ControlItemAndCycleId.Contains(table.ControlItemAndCycleId))
|
||||
(string.IsNullOrEmpty(table.ControlItemAndCycleId) || x.ControlItemAndCycleId.Contains(table.ControlItemAndCycleId))
|
||||
select x
|
||||
;
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
using System;
|
||||
using FineUIPro;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using FineUIPro;
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -19,24 +18,9 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static int Count { get; set; }
|
||||
|
||||
public static IQueryable<PHTGL_ContractTrackProgress> GetPHTGL_ContractTrackProgressByModle( PHTGL_ContractTrackProgress table)
|
||||
public static IQueryable<PHTGL_ContractTrackProgress> GetPHTGL_ContractTrackProgressByModle(PHTGL_ContractTrackProgress table)
|
||||
{
|
||||
var q = from x in Funs.DB.PHTGL_ContractTrackProgress
|
||||
where
|
||||
(string.IsNullOrEmpty(table.ContractTrackProgressId) ||
|
||||
x.ContractTrackProgressId.Contains(table.ContractTrackProgressId)) &&
|
||||
(string.IsNullOrEmpty(table.ContractTrackId) ||
|
||||
x.ContractTrackId.Contains(table.ContractTrackId)) &&
|
||||
(string.IsNullOrEmpty(table.Date) ||
|
||||
x.Date.Contains(table.Date))
|
||||
orderby x.Date
|
||||
select x
|
||||
;
|
||||
return q;
|
||||
}
|
||||
public static PHTGL_ContractTrackProgress GetFirstOrDefaultByModle(PHTGL_ContractTrackProgress table)
|
||||
{
|
||||
var q = (from x in Funs.DB.PHTGL_ContractTrackProgress
|
||||
where
|
||||
(string.IsNullOrEmpty(table.ContractTrackProgressId) ||
|
||||
x.ContractTrackProgressId.Contains(table.ContractTrackProgressId)) &&
|
||||
@@ -45,7 +29,22 @@ namespace BLL
|
||||
(string.IsNullOrEmpty(table.Date) ||
|
||||
x.Date.Contains(table.Date))
|
||||
orderby x.Date
|
||||
select x).FirstOrDefault()
|
||||
select x
|
||||
;
|
||||
return q;
|
||||
}
|
||||
public static PHTGL_ContractTrackProgress GetFirstOrDefaultByModle(PHTGL_ContractTrackProgress table)
|
||||
{
|
||||
var q = (from x in Funs.DB.PHTGL_ContractTrackProgress
|
||||
where
|
||||
(string.IsNullOrEmpty(table.ContractTrackProgressId) ||
|
||||
x.ContractTrackProgressId.Contains(table.ContractTrackProgressId)) &&
|
||||
(string.IsNullOrEmpty(table.ContractTrackId) ||
|
||||
x.ContractTrackId.Contains(table.ContractTrackId)) &&
|
||||
(string.IsNullOrEmpty(table.Date) ||
|
||||
x.Date.Contains(table.Date))
|
||||
orderby x.Date
|
||||
select x).FirstOrDefault()
|
||||
;
|
||||
return q;
|
||||
}
|
||||
@@ -63,18 +62,18 @@ namespace BLL
|
||||
q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize);
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.ContractTrackProgressId,
|
||||
x.ContractTrackId,
|
||||
x.BCWS_Quantity,
|
||||
x.BCWS_OutputValue,
|
||||
x.BCWS_Percentage,
|
||||
x.ACWP_Quantity,
|
||||
x.ACWP_OutputValue,
|
||||
x.ACWP_Percentage,
|
||||
x.Date
|
||||
};
|
||||
select new
|
||||
{
|
||||
x.ContractTrackProgressId,
|
||||
x.ContractTrackId,
|
||||
x.BCWS_Quantity,
|
||||
x.BCWS_OutputValue,
|
||||
x.BCWS_Percentage,
|
||||
x.ACWP_Quantity,
|
||||
x.ACWP_OutputValue,
|
||||
x.ACWP_Percentage,
|
||||
x.Date
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -84,10 +83,10 @@ namespace BLL
|
||||
return Funs.DB.PHTGL_ContractTrackProgress.FirstOrDefault(x =>
|
||||
x.ContractTrackProgressId == ContractTrackProgressId);
|
||||
}
|
||||
public static PHTGL_ContractTrackProgress GetPHTGL_ContractTrackProgressByTrackIdAndDate(string ContractTrackId,string date)
|
||||
public static PHTGL_ContractTrackProgress GetPHTGL_ContractTrackProgressByTrackIdAndDate(string ContractTrackId, string date)
|
||||
{
|
||||
return Funs.DB.PHTGL_ContractTrackProgress.FirstOrDefault(x =>
|
||||
x.ContractTrackId == ContractTrackId && x.Date==date);
|
||||
x.ContractTrackId == ContractTrackId && x.Date == date);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据合同价格信息主键创建进度日期数据
|
||||
@@ -97,7 +96,7 @@ namespace BLL
|
||||
{
|
||||
var model = PhtglContractTrackService.GetPHTGL_ContractTrackById(ContractTrackId);
|
||||
if (model == null) return;
|
||||
var contractNum=model.ContractNum;
|
||||
var contractNum = model.ContractNum;
|
||||
var contractmode = ContractService.GetContractByContractNum(contractNum);
|
||||
if (contractmode.ContractStartDate != null && contractmode.ContractEndDate != null)
|
||||
{
|
||||
@@ -110,7 +109,7 @@ namespace BLL
|
||||
var querymodel = new Model.PHTGL_ContractTrackProgress
|
||||
{
|
||||
ContractTrackId = ContractTrackId,
|
||||
Date= month.ToString("yyyy-MM")
|
||||
Date = month.ToString("yyyy-MM")
|
||||
};
|
||||
|
||||
if (!GetPHTGL_ContractTrackProgressByModle(querymodel).Any())
|
||||
@@ -130,22 +129,23 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="contractTrackList"></param>
|
||||
/// <param name="projectid"></param>
|
||||
public static void CreateTemplateByContractList(List<PHTGL_ContractTrack> contractTrackList,string projectid)
|
||||
public static void CreateTemplateByContractList(List<PHTGL_ContractTrack> contractTrackList, string projectid)
|
||||
{
|
||||
var dbcontractTrack=(from x in Funs.DB.PHTGL_ContractTrack where x.ProjectId==projectid select x).ToList();
|
||||
var dbContractTrackProgress=(from x in Funs.DB.PHTGL_ContractTrackProgress
|
||||
join y in Funs.DB.PHTGL_ContractTrack on x.ContractTrackId equals y.Id
|
||||
where y.ProjectId==projectid select x).ToList();
|
||||
var dbcontractTrack = (from x in Funs.DB.PHTGL_ContractTrack where x.ProjectId == projectid select x).ToList();
|
||||
var dbContractTrackProgress = (from x in Funs.DB.PHTGL_ContractTrackProgress
|
||||
join y in Funs.DB.PHTGL_ContractTrack on x.ContractTrackId equals y.Id
|
||||
where y.ProjectId == projectid
|
||||
select x).ToList();
|
||||
|
||||
List<List<PHTGL_ContractTrack>> splitLists = new List<List<PHTGL_ContractTrack>>();
|
||||
if (contractTrackList.Count>10)
|
||||
List<List<PHTGL_ContractTrack>> splitLists = new List<List<PHTGL_ContractTrack>>();
|
||||
if (contractTrackList.Count > 10)
|
||||
{
|
||||
splitLists = Funs.SplitList(contractTrackList, 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
splitLists = Funs.SplitList(contractTrackList, 1);
|
||||
}
|
||||
}
|
||||
ConcurrentBag<PHTGL_ContractTrackProgress> contractTrackProgressList = new ConcurrentBag<PHTGL_ContractTrackProgress>();//用于批量新增的数据(无序集合)
|
||||
|
||||
ParallelOptions parallelOptions = new ParallelOptions();
|
||||
@@ -154,10 +154,10 @@ namespace BLL
|
||||
///使用多线程开启并行任务,操作拆分后的list 同时进行数据处理
|
||||
Parallel.ForEach(splitLists, parallelOptions, sublist =>
|
||||
{
|
||||
|
||||
foreach (var item in sublist)
|
||||
|
||||
foreach (var item in sublist)
|
||||
{
|
||||
var model =( from x in dbcontractTrack where x.Id==item.Id select x).FirstOrDefault() ;
|
||||
var model = (from x in dbcontractTrack where x.Id == item.Id select x).FirstOrDefault();
|
||||
if (model == null) return;
|
||||
var contractNum = model.ContractNum;
|
||||
var contractmode = ContractService.GetContractByContractNum(contractNum);
|
||||
@@ -175,13 +175,13 @@ namespace BLL
|
||||
Date = month.ToString("yyyy-MM")
|
||||
};
|
||||
var q = (from x in dbContractTrackProgress
|
||||
where
|
||||
(string.IsNullOrEmpty(querymodel.ContractTrackId) ||
|
||||
x.ContractTrackId.Contains(querymodel.ContractTrackId)) &&
|
||||
(string.IsNullOrEmpty(querymodel.Date) ||
|
||||
x.Date.Contains(querymodel.Date))
|
||||
orderby x.Date
|
||||
select x).ToList()
|
||||
where
|
||||
(string.IsNullOrEmpty(querymodel.ContractTrackId) ||
|
||||
x.ContractTrackId.Contains(querymodel.ContractTrackId)) &&
|
||||
(string.IsNullOrEmpty(querymodel.Date) ||
|
||||
x.Date.Contains(querymodel.Date))
|
||||
orderby x.Date
|
||||
select x).ToList()
|
||||
;
|
||||
if (!q.Any())
|
||||
{
|
||||
@@ -190,14 +190,14 @@ namespace BLL
|
||||
newmodel.ContractTrackId = item.Id;
|
||||
newmodel.Date = month.ToString("yyyy-MM");
|
||||
contractTrackProgressList.Add(newmodel);
|
||||
// AddPHTGL_ContractTrackProgress(newmodel);
|
||||
// AddPHTGL_ContractTrackProgress(newmodel);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // 处理完成后,可以将结果保存到集合或其他地方
|
||||
|
||||
});
|
||||
|
||||
|
||||
AddBulkPHTGL_ContractTrackProgress(contractTrackProgressList.ToList());
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ namespace BLL
|
||||
}
|
||||
|
||||
public static void UpdatePHTGL_ContractTrackProgress(PHTGL_ContractTrackProgress newtable)
|
||||
{
|
||||
{
|
||||
var table = Funs.DB.PHTGL_ContractTrackProgress.FirstOrDefault(x =>
|
||||
x.ContractTrackProgressId == newtable.ContractTrackProgressId);
|
||||
if (table != null)
|
||||
@@ -255,7 +255,7 @@ namespace BLL
|
||||
table.ACWP_Quantity = newtable.ACWP_Quantity;
|
||||
table.ACWP_OutputValue = newtable.ACWP_OutputValue;
|
||||
table.ACWP_Percentage = newtable.ACWP_Percentage;
|
||||
table.Date =newtable.Date;
|
||||
table.Date = newtable.Date;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -266,19 +266,19 @@ namespace BLL
|
||||
public static void CheckProgressByContractTrackId(string contractTrackId)
|
||||
{
|
||||
var modeContractTrack = PhtglContractTrackService.GetPHTGL_ContractTrackById(contractTrackId);
|
||||
if (modeContractTrack!=null)
|
||||
if (modeContractTrack != null)
|
||||
{
|
||||
var totalCostFixedComprehensiveUnitPrice = modeContractTrack.TotalCostFixedComprehensiveUnitPrice; //全费用综合单价
|
||||
var settledAmount = modeContractTrack.SettledAmount??0;//预算金额
|
||||
var contractWeight= Funs.GetNewDecimalOrZero(modeContractTrack.ContractWeight)==0?0: Funs.GetNewDecimalOrZero(modeContractTrack.ContractWeight)/100;//合同权重
|
||||
var settledAmount = modeContractTrack.SettledAmount ?? 0;//预算金额
|
||||
var contractWeight = Funs.GetNewDecimalOrZero(modeContractTrack.ContractWeight) == 0 ? 0 : Funs.GetNewDecimalOrZero(modeContractTrack.ContractWeight) / 100;//合同权重
|
||||
var quserytable = new Model.PHTGL_ContractTrackProgress();
|
||||
quserytable.ContractTrackId = contractTrackId;
|
||||
var list= GetPHTGL_ContractTrackProgressByModle(quserytable);
|
||||
var list = GetPHTGL_ContractTrackProgressByModle(quserytable);
|
||||
foreach (var item in list)
|
||||
{
|
||||
//产值=计划工程量*全费用综合单价(来源于“费用对比统计”),
|
||||
// 百分比 =(产值 / 预算金额)*合同权重
|
||||
item.ACWP_OutputValue = (item.ACWP_Quantity??0)* totalCostFixedComprehensiveUnitPrice;
|
||||
item.ACWP_OutputValue = (item.ACWP_Quantity ?? 0) * totalCostFixedComprehensiveUnitPrice;
|
||||
if (settledAmount == 0)
|
||||
{
|
||||
item.ACWP_Percentage = 0;
|
||||
@@ -295,7 +295,7 @@ namespace BLL
|
||||
}
|
||||
else
|
||||
{
|
||||
item.BCWS_Percentage = Math.Round(((item.BCWS_OutputValue ?? 0) / settledAmount) * contractWeight * 100, 2) ;
|
||||
item.BCWS_Percentage = Math.Round(((item.BCWS_OutputValue ?? 0) / settledAmount) * contractWeight * 100, 2);
|
||||
}
|
||||
UpdatePHTGL_ContractTrackProgress(item);
|
||||
}
|
||||
@@ -307,13 +307,13 @@ namespace BLL
|
||||
/// <param name="ContractTrackProgressId"></param>
|
||||
/// <param name="date"></param>
|
||||
public static PHTGL_ContractTrackProgress GetSumProgress(string contractTrackProgressId)
|
||||
{
|
||||
var result=new PHTGL_ContractTrackProgress();
|
||||
{
|
||||
var result = new PHTGL_ContractTrackProgress();
|
||||
var model = GetPHTGL_ContractTrackProgressById(contractTrackProgressId);
|
||||
var q = (from x in Funs.DB.PHTGL_ContractTrackProgress
|
||||
where x.ContractTrackId == model.ContractTrackId && string.Compare(x.Date,model.Date)<=0
|
||||
select x).ToList();
|
||||
result.ACWP_Quantity = q.Sum(x => x.ACWP_Quantity ??0);
|
||||
where x.ContractTrackId == model.ContractTrackId && string.Compare(x.Date, model.Date) <= 0
|
||||
select x).ToList();
|
||||
result.ACWP_Quantity = q.Sum(x => x.ACWP_Quantity ?? 0);
|
||||
result.ACWP_OutputValue = q.Sum(x => x.ACWP_OutputValue ?? 0);
|
||||
result.ACWP_Percentage = q.Sum(x => x.ACWP_Percentage ?? 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user