代码无效引用清理,试压包资料界面看板修改

This commit is contained in:
2025-10-10 14:33:21 +08:00
parent 87fb529521
commit 55b798135c
933 changed files with 5897 additions and 7541 deletions
@@ -231,7 +231,7 @@ namespace BLL
/// ActionPlanID
/// </summary>
/// <param name="ActionPlanID"></param>
public static Document Print( string ActionPlanID)
public static Document Print(string ActionPlanID)
{
string rootPath = Funs.RootPath;
@@ -550,12 +550,12 @@ namespace BLL
doc.UpdateWordCount();
File.Delete(Path);
}
doc.Save(newUrl);
Document doc1 = new Aspose.Words.Document(newUrl);
doc.Save(newUrl);
Document doc1 = new Aspose.Words.Document(newUrl);
File.Delete(newUrl);
return doc1;
}
public static void PrintFile( string Id)
public static void PrintFile(string Id)
{
string rootPath = Funs.RootPath;
string newUrl = string.Empty;
@@ -566,7 +566,7 @@ namespace BLL
File.Delete(newUrl);
}
var q = PHTGL_ActionPlanFormationService.GetPHTGL_ActionPlanFormationById(Id);
var doc = BLL.PHTGL_ActionPlanFormationService.Print( Id);
var doc = BLL.PHTGL_ActionPlanFormationService.Print(Id);
doc.Save(newUrl);
//生成PDF文件
string pdfUrl = newUrl.Replace(".docx", ".pdf");
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using Model;
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
@@ -1,11 +1,11 @@
using Aspose.Words;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using Model;
namespace BLL
{
@@ -186,7 +186,7 @@ namespace BLL
File.Delete(newUrl);
return doc1;
}
public static void PrintFile( string Id)
public static void PrintFile(string Id)
{
string rootPath = Funs.RootPath;
@@ -197,7 +197,7 @@ namespace BLL
{
File.Delete(newUrl);
}
var doc = Print( Id);
var doc = Print(Id);
doc.Save(newUrl);
//生成PDF文件
@@ -24,7 +24,7 @@ namespace BLL
Model.PHTGL_BidApproveUserReview_Sch1 table = new Model.PHTGL_BidApproveUserReview_Sch1();
table.ID = newtable.ID;
table.ApproveUserReviewID = newtable.ApproveUserReviewID;
var name= BLL.Person_PersonsService.GetPersonsNameById(newtable.ApproveUserName);
var name = BLL.Person_PersonsService.GetPersonsNameById(newtable.ApproveUserName);
if (!string.IsNullOrEmpty(name))
{
table.ApproveUserName = name;
@@ -1,11 +1,7 @@
using FineUIPro;
using MiniExcelLibs.Attributes;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
namespace BLL
@@ -41,11 +37,11 @@ namespace BLL
(string.IsNullOrEmpty(table.ApprovePersonFormCode) || x.ApprovePersonFormCode.Contains(table.ApprovePersonFormCode)) &&
(string.IsNullOrEmpty(table.BidWinner) || x.BidWinner.Contains(table.BidWinner)) &&
(string.IsNullOrEmpty(table.SetSubReviewCode) || x.SetSubReviewCode.Contains(table.SetSubReviewCode)) &&
(string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId))&&
(string.IsNullOrEmpty(table.BidNoticeCode) || x.BidNoticeCode.Contains(table.BidNoticeCode))&&
(string.IsNullOrEmpty(table.BidUnitFileCode) || x.BidUnitFileCode.Contains(table.BidUnitFileCode))&&
(table.State == null||x.State==table.State)
select x
(string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) &&
(string.IsNullOrEmpty(table.BidNoticeCode) || x.BidNoticeCode.Contains(table.BidNoticeCode)) &&
(string.IsNullOrEmpty(table.BidUnitFileCode) || x.BidUnitFileCode.Contains(table.BidUnitFileCode)) &&
(table.State == null || x.State == table.State)
select x
;
return q.ToList();
@@ -64,7 +60,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
@@ -108,8 +104,8 @@ namespace BLL
Model.PHTGL_BidDocumentsStandingBook table = new Model.PHTGL_BidDocumentsStandingBook
{
BidDocumentsStandingBookId = newtable.BidDocumentsStandingBookId,
UnitId= newtable.UnitId,
DepartId= newtable.DepartId,
UnitId = newtable.UnitId,
DepartId = newtable.DepartId,
EPCCode = newtable.EPCCode,
ProjectShortName = newtable.ProjectShortName,
ProjectCode = newtable.ProjectCode,
@@ -125,10 +121,10 @@ namespace BLL
ApprovePersonFormCode = newtable.ApprovePersonFormCode,
BidWinner = newtable.BidWinner,
SetSubReviewCode = newtable.SetSubReviewCode,
ProjectId= newtable.ProjectId,
State=newtable.State,
BidNoticeCode=newtable.BidNoticeCode,
BidUnitFileCode=newtable.BidUnitFileCode,
ProjectId = newtable.ProjectId,
State = newtable.State,
BidNoticeCode = newtable.BidNoticeCode,
BidUnitFileCode = newtable.BidUnitFileCode,
};
var db1 = Funs.DB;
db1.PHTGL_BidDocumentsStandingBook.InsertOnSubmit(table);
@@ -150,8 +146,8 @@ namespace BLL
if (table != null)
{
table.BidDocumentsStandingBookId = newtable.BidDocumentsStandingBookId;
table.UnitId= newtable.UnitId;
table.DepartId= newtable.DepartId;
table.UnitId = newtable.UnitId;
table.DepartId = newtable.DepartId;
table.EPCCode = newtable.EPCCode;
table.ProjectShortName = newtable.ProjectShortName;
table.ProjectCode = newtable.ProjectCode;
@@ -167,10 +163,10 @@ namespace BLL
table.ApprovePersonFormCode = newtable.ApprovePersonFormCode;
table.BidWinner = newtable.BidWinner;
table.SetSubReviewCode = newtable.SetSubReviewCode;
table.ProjectId=newtable.ProjectId;
table.State=newtable.State;
table.BidNoticeCode= newtable.BidNoticeCode;
table.BidUnitFileCode=newtable.BidUnitFileCode;
table.ProjectId = newtable.ProjectId;
table.State = newtable.State;
table.BidNoticeCode = newtable.BidNoticeCode;
table.BidUnitFileCode = newtable.BidUnitFileCode;
db1.SubmitChanges();
}
@@ -1,9 +1,9 @@
using Aspose.Words;
using Model;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Model;
namespace BLL
{
@@ -141,7 +141,7 @@ namespace BLL
/// </summary>
/// <param name="dropName"></param>
/// <param name="isShowPlease"></param>
public static void InitGetBidCompleteDropDownList(FineUIPro.DropDownList dropName,string projectid, bool isShowPlease)
public static void InitGetBidCompleteDropDownList(FineUIPro.DropDownList dropName, string projectid, bool isShowPlease)
{
dropName.DataValueField = "BidDocumentsReviewId";
dropName.DataTextField = "BidDocumentsCode";
@@ -244,9 +244,9 @@ namespace BLL
Document doc1 = new Aspose.Words.Document(newUrl);
File.Delete(newUrl);
return doc1;
}
public static void PrintFile( string Id)
public static void PrintFile(string Id)
{
string rootPath = Funs.RootPath;
@@ -258,7 +258,7 @@ namespace BLL
{
File.Delete(newUrl);
}
var doc = Print( Id);
var doc = Print(Id);
doc.Save(newUrl);
//生成PDF文件
@@ -1,5 +1,5 @@
using Aspose.Words;
using NPOI.SS.Formula.Functions;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
@@ -7,7 +7,6 @@ using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Web.UI.WebControls;
using Model;
namespace BLL
{
@@ -238,7 +237,7 @@ namespace BLL
+ @" FROM PHTGL_SetSubReview_Sch1 AS Sch1 "
+ @"where 1=1 AND SetSubReviewID = @SetSubReviewID order by SortIndex ";
break;
}
uploadfilepath = rootPath + initTemplatePath;
newUrl = uploadfilepath.Replace(".docx", string.Format("{0:yyyy-MM}", DateTime.Now) + ".docx");
@@ -315,7 +314,7 @@ namespace BLL
doc.Save(newUrl);
Document doc1 = new Aspose.Words.Document(newUrl);
File.Delete(newUrl);
return doc1;
}
@@ -345,7 +344,7 @@ namespace BLL
}
}
break;
case PHTGL_SetSubReviewService.Type_MinPrice:
if (Act != null)
@@ -361,9 +360,9 @@ namespace BLL
}
}
break;
}
newUrl = rootPath + initTemplatePath;
@@ -1,11 +1,11 @@
using System;
using FineUIPro;
using MiniExcelLibs;
using Model;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using FineUIPro;
using MiniExcelLibs;
using Model;
namespace BLL
{
@@ -78,27 +78,27 @@ namespace BLL
querytable.IsTemplate = false;
querytable.ParentId = item.MainProjectQuantityId;
var tb = PHTGL_QuantityService.GetPHTGL_QuantityByModle(querytable);
var exportmodel = (from x in tb
select new
{
= x.Major,
= x.SubProject,
= x.SubItemProject,
= x.ProjectCode,
=x.ProjectName,
= x.ProjectDescription,
= x.UnitOfMeasurement,
=x.Quantity,
=x.TotalCostFixedComprehensiveUnitPrice,
=x.MainMaterialCost,
=x.TotalPrice,
=x.CalculationRule,
=x.WorkContent,
=x.Remarks,
}).ToList();
sheets.Add(item.MainProjectQuantityName,exportmodel);
var exportmodel = (from x in tb
select new
{
= x.Major,
= x.SubProject,
= x.SubItemProject,
= x.ProjectCode,
= x.ProjectName,
= x.ProjectDescription,
= x.UnitOfMeasurement,
= x.Quantity,
= x.TotalCostFixedComprehensiveUnitPrice,
= x.MainMaterialCost,
= x.TotalPrice,
= x.CalculationRule,
= x.WorkContent,
= x.Remarks,
}).ToList();
sheets.Add(item.MainProjectQuantityName, exportmodel);
}
string path = Funs.RootPath + @"File\Excel\Temp\招标工作清单-"+ bidProjectQuantity.BidProjectCode+ ".xlsx";
string path = Funs.RootPath + @"File\Excel\Temp\招标工作清单-" + bidProjectQuantity.BidProjectCode + ".xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
MiniExcel.SaveAs(path, sheets);
string fileName = "招标工作清单-" + bidProjectQuantity.BidProjectCode + ".xlsx";
@@ -117,7 +117,7 @@ namespace BLL
{
var sheets = new Dictionary<string, object>();
var mainProjectList = PHTGL_MainProjectQuantityService.GetPHTGL_MainProjectQuantityById(mainProjectQuantityId);//获取主项
if (mainProjectList==null)
if (mainProjectList == null)
{
return;
}
@@ -126,25 +126,25 @@ namespace BLL
querytable.ParentId = mainProjectQuantityId;
var tb = PHTGL_QuantityService.GetPHTGL_QuantityByModle(querytable);
var exportmodel = (from x in tb
select new
{
= x.Major,
= x.SubProject,
= x.SubItemProject,
= x.ProjectCode,
= x.ProjectName,
= x.ProjectDescription,
= x.UnitOfMeasurement,
= x.Quantity,
= x.TotalCostFixedComprehensiveUnitPrice,
= x.MainMaterialCost,
= x.TotalPrice,
= x.CalculationRule,
= x.WorkContent,
= x.Remarks,
}).ToList();
select new
{
= x.Major,
= x.SubProject,
= x.SubItemProject,
= x.ProjectCode,
= x.ProjectName,
= x.ProjectDescription,
= x.UnitOfMeasurement,
= x.Quantity,
= x.TotalCostFixedComprehensiveUnitPrice,
= x.MainMaterialCost,
= x.TotalPrice,
= x.CalculationRule,
= x.WorkContent,
= x.Remarks,
}).ToList();
sheets.Add(mainProjectList.MainProjectQuantityName, exportmodel);
string path = Funs.RootPath + @"File\Excel\Temp\招标工作清单-" + mainProjectList.MainProjectQuantityCode + ".xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
MiniExcel.SaveAs(path, sheets);
@@ -202,16 +202,16 @@ namespace BLL
q = q.Skip(Grid1.PageSize * Grid1.PageIndex).Take(Grid1.PageSize).ToList();
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
{
x.BidProjectQuantityId,
x.LotNumber,
x.BidProjectCode,
x.IsMainProject,
x.ProjectId,
x.CreatorId,
x.CreateDate
};
select new
{
x.BidProjectQuantityId,
x.LotNumber,
x.BidProjectCode,
x.IsMainProject,
x.ProjectId,
x.CreatorId,
x.CreateDate
};
}
#endregion
@@ -1,8 +1,8 @@
using System.Collections;
using FineUIPro;
using Model;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using FineUIPro;
using Model;
namespace BLL
{
@@ -105,13 +105,13 @@ namespace BLL
q = q.Skip(Grid1.PageSize * Grid1.PageIndex).Take(Grid1.PageSize).ToList();
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
{
x.MainProjectQuantityId,
x.MainProjectQuantityCode,
x.MainProjectQuantityName,
x.QuantityId
};
select new
{
x.MainProjectQuantityId,
x.MainProjectQuantityCode,
x.MainProjectQuantityName,
x.QuantityId
};
}
#endregion
@@ -1,12 +1,12 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using EmitMapper;
using EmitMapper;
using FineUIPro;
using MiniExcelLibs;
using MiniExcelLibs.Attributes;
using Model;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
@@ -17,9 +17,9 @@ namespace BLL
return Funs.DB.PHTGL_Quantity.FirstOrDefault(x => x.Id == Id);
}
public static PHTGL_Quantity GetPHTGL_QuantityByNumBer(string serialNumber,string marjor)
public static PHTGL_Quantity GetPHTGL_QuantityByNumBer(string serialNumber, string marjor)
{
return Funs.DB.PHTGL_Quantity.FirstOrDefault(x => x.SerialNumber == serialNumber && x.Major==marjor);
return Funs.DB.PHTGL_Quantity.FirstOrDefault(x => x.SerialNumber == serialNumber && x.Major == marjor);
}
public static void AddPHTGL_Quantity(PHTGL_Quantity newtable)
@@ -136,24 +136,24 @@ namespace BLL
public static ResponeData ImportData(string path, string majortype)
{
var responeData = new ResponeData();
List<PHTGL_QuantityDtoIn> rows= new List<PHTGL_QuantityDtoIn>();
List<dynamic> remarkQuery=new List<dynamic>();
List<PHTGL_QuantityDtoIn> rows = new List<PHTGL_QuantityDtoIn>();
List<dynamic> remarkQuery = new List<dynamic>();
string Major = "";
try
{
var sheetNames = MiniExcel.GetSheetNames(path);
foreach (var item in sheetNames)
{
if (item=="编制说明")
if (item == "编制说明")
{
remarkQuery = MiniExcel.Query(path, sheetName: item).ToList();
remarkQuery = MiniExcel.Query(path, sheetName: item).ToList();
}
else
{
rows = MiniExcel.Query<PHTGL_QuantityDtoIn>(path, sheetName: item).ToList();
}
}
}
catch (Exception e)
{
@@ -174,7 +174,7 @@ namespace BLL
Major = GetMajorItems().Where(x => x.Text == majortype).Select(x => x.Value).FirstOrDefault() ??
"";
List<Model.Sys_Const> consts=new List<Model.Sys_Const>();
List<Model.Sys_Const> consts = new List<Model.Sys_Const>();
int SortIndex = 0;
foreach (var item in remarkQuery)
{
@@ -184,14 +184,14 @@ namespace BLL
ID = SQLHelper.GetNewID(),
ConstValue = item.A?.ToString(),
SortIndex = SortIndex,
GroupId = "工程量清单-"+ Major
GroupId = "工程量清单-" + Major
};
consts.Add(model);
SortIndex++;
}
var old = ConstValue.drpConstItemList("工程量清单-" + Major);
if (old.Count>0)
if (old.Count > 0)
{
Funs.DB.Sys_Const.DeleteAllOnSubmit(old);
Funs.DB.SubmitChanges();
@@ -203,8 +203,8 @@ namespace BLL
{
item.Major = Major;
if (string.IsNullOrEmpty(Major)) break;
if (string .IsNullOrEmpty(item.ProjectName)) continue;
if (item.ProjectName== "项目名称") continue;
if (string.IsNullOrEmpty(item.ProjectName)) continue;
if (item.ProjectName == "项目名称") continue;
var queryPhtglQuantity = new PHTGL_Quantity
{
Major = item.Major,
@@ -401,36 +401,36 @@ namespace BLL
public static List<PHTGL_Quantity> GetPHTGL_QuantityByModle(PHTGL_Quantity table)
{
var q = from x in Funs.DB.PHTGL_Quantity
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
(string.IsNullOrEmpty(table.Major) || x.Major.Contains(table.Major)) &&
(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.TotalCostFixedComprehensiveUnitPrice) ||
x.TotalCostFixedComprehensiveUnitPrice.Contains(table.TotalCostFixedComprehensiveUnitPrice)) &&
(string.IsNullOrEmpty(table.MainMaterialCost) ||
x.MainMaterialCost.Contains(table.MainMaterialCost)) &&
(string.IsNullOrEmpty(table.TotalPrice) || x.TotalPrice.Contains(table.TotalPrice)) &&
(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)) &&
x.IsTemplate == table.IsTemplate &&
(string.IsNullOrEmpty(table.ParentId) || x.ParentId.Contains(table.ParentId))
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
(string.IsNullOrEmpty(table.Major) || x.Major.Contains(table.Major)) &&
(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.TotalCostFixedComprehensiveUnitPrice) ||
x.TotalCostFixedComprehensiveUnitPrice.Contains(table.TotalCostFixedComprehensiveUnitPrice)) &&
(string.IsNullOrEmpty(table.MainMaterialCost) ||
x.MainMaterialCost.Contains(table.MainMaterialCost)) &&
(string.IsNullOrEmpty(table.TotalPrice) || x.TotalPrice.Contains(table.TotalPrice)) &&
(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)) &&
x.IsTemplate == table.IsTemplate &&
(string.IsNullOrEmpty(table.ParentId) || x.ParentId.Contains(table.ParentId))
select x;
//select new { x ,IntSerialNumber= Funs.GetNewIntOrZero(x.SerialNumber.Replace(".", ""))
// }
select x;
//select new { x ,IntSerialNumber= Funs.GetNewIntOrZero(x.SerialNumber.Replace(".", ""))
// }
;
;
//var model = q.ToList().OrderBy(x => x.IntSerialNumber).Select(itemx => itemx.x).ToList();
var model = q.ToList().OrderBy(x => x.SerialNumber, new CustomComparer()).ToList();
return model;
@@ -449,27 +449,27 @@ namespace BLL
q = q.Skip(Grid1.PageSize * Grid1.PageIndex).Take(Grid1.PageSize).ToList();
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
{
x.Id,
x.SerialNumber,
x.Major,
x.SubProject,
x.SubItemProject,
x.ProjectCode,
x.ProjectName,
x.ProjectDescription,
x.UnitOfMeasurement,
x.Quantity,
x.TotalCostFixedComprehensiveUnitPrice,
x.MainMaterialCost,
x.TotalPrice,
x.CalculationRule,
x.WorkContent,
x.Remarks,
x.IsTemplate,
x.ParentId
};
select new
{
x.Id,
x.SerialNumber,
x.Major,
x.SubProject,
x.SubItemProject,
x.ProjectCode,
x.ProjectName,
x.ProjectDescription,
x.UnitOfMeasurement,
x.Quantity,
x.TotalCostFixedComprehensiveUnitPrice,
x.MainMaterialCost,
x.TotalPrice,
x.CalculationRule,
x.WorkContent,
x.Remarks,
x.IsTemplate,
x.ParentId
};
}
public static void CheckSubProjectName(List<PHTGL_Quantity> list)
@@ -479,7 +479,7 @@ namespace BLL
var SubProject = "";
var SubItemProject = "";
var SerialNumberArry = item.SerialNumber?.Split('.');
if (SerialNumberArry.Length==2)
if (SerialNumberArry.Length == 2)
{
item.SubProject = GetPHTGL_QuantityByNumBer(SerialNumberArry[0], item.Major).ProjectName;
UpdatePHTGL_Quantity(item);
@@ -488,10 +488,10 @@ namespace BLL
else if (SerialNumberArry.Length == 3)
{
item.SubProject = GetPHTGL_QuantityByNumBer(SerialNumberArry[0], item.Major).ProjectName;
item.SubItemProject= GetPHTGL_QuantityByNumBer(SerialNumberArry[0]+"."+ SerialNumberArry[1], item.Major).ProjectName;
item.SubItemProject = GetPHTGL_QuantityByNumBer(SerialNumberArry[0] + "." + SerialNumberArry[1], item.Major).ProjectName;
UpdatePHTGL_Quantity(item);
}
}
}
@@ -501,7 +501,7 @@ namespace BLL
{
public int Compare(string x, string y)
{
if (string.IsNullOrEmpty(x)||string.IsNullOrEmpty(y))
if (string.IsNullOrEmpty(x) || string.IsNullOrEmpty(y))
{
return 0;
}
@@ -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 45
/// </summary>
@@ -729,37 +727,37 @@ namespace BLL
/// <summary>
/// ConfirmWay 123
/// </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);
@@ -1,20 +1,11 @@
using EmitMapper;
using FineUIPro;
using MiniExcelLibs;
using MiniExcelLibs.Attributes;
using Model;
using NPOI.SS.Formula.Eval;
using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Security;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Text;
using WIA;
namespace BLL
@@ -58,9 +49,9 @@ namespace BLL
public static string GetState(object invoiceId)
{
string result = "";
if (invoiceId!=null && !string.IsNullOrEmpty(invoiceId.ToString()) )
if (invoiceId != null && !string.IsNullOrEmpty(invoiceId.ToString()))
{
var InvoiceId=invoiceId.ToString();
var InvoiceId = invoiceId.ToString();
var model = GetPHTGL_InvoiceById(InvoiceId);
var approveModel = PHTGL_ApproveService.GetPHTGL_ApproveByContractId(InvoiceId);
@@ -74,7 +65,7 @@ namespace BLL
result = "已创建入库订单";
break;
case 1:
result = "入库审核中"+",当前节点-"+BLL.Person_PersonsService.getPersonsNamesPersonIds(string.Join(",",approveModel.Select(x => x.ApproveMan)));
result = "入库审核中" + ",当前节点-" + BLL.Person_PersonsService.getPersonsNamesPersonIds(string.Join(",", approveModel.Select(x => x.ApproveMan)));
break;
case 2:
result = "入库审核拒绝";
@@ -121,13 +112,13 @@ namespace BLL
(string.IsNullOrEmpty(table.SellerTaxNumber) || x.SellerTaxNumber.Contains(table.SellerTaxNumber)) &&
(string.IsNullOrEmpty(table.ApproveManJson) || x.ApproveManJson.Contains(table.ApproveManJson)) &&
(string.IsNullOrEmpty(table.CreateUser) || x.CreateUser.Contains(table.CreateUser)) &&
(table.State==null ||x.State==table.State)
(table.State == null || x.State == table.State)
select x
;
return q.ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
@@ -144,60 +135,61 @@ namespace BLL
}
q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList();
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return (from x in q
join y in Funs.DB.PHTGL_Contract on x.ContractId equals y.ContractId into g
from c in g.DefaultIfEmpty()
select new
{
c?.ContractName,
c?.ContractNum,
c?.Parties,
c?.ContractAmount,
x.InvoiceId,
x.ProjectId,
x.ContractId,
x.State,
x.InvoiceCode,
x.InvoiceNumber,
x.SellerName,
x.InvoiceDate,
x.AmountExcludingTax,
x.TotalTax,
x.Remark,
x.ImagePath,
x.SellerTaxNumber,
x.InvoiceAmount,
x.ApproveManJson,
x.CreateDate,
x.CreateUser,
x.OrderInDate,
x.OrderOutDate,
x.OrderCode,
x.MaterialRequisitionUnit
});
return (from x in q
join y in Funs.DB.PHTGL_Contract on x.ContractId equals y.ContractId into g
from c in g.DefaultIfEmpty()
select new
{
c?.ContractName,
c?.ContractNum,
c?.Parties,
c?.ContractAmount,
x.InvoiceId,
x.ProjectId,
x.ContractId,
x.State,
x.InvoiceCode,
x.InvoiceNumber,
x.SellerName,
x.InvoiceDate,
x.AmountExcludingTax,
x.TotalTax,
x.Remark,
x.ImagePath,
x.SellerTaxNumber,
x.InvoiceAmount,
x.ApproveManJson,
x.CreateDate,
x.CreateUser,
x.OrderInDate,
x.OrderOutDate,
x.OrderCode,
x.MaterialRequisitionUnit
});
}
public static IEnumerable GetOrderInListData(Model.PHTGL_Invoice table, Grid grid1,string state)
public static IEnumerable GetOrderInListData(Model.PHTGL_Invoice table, Grid grid1, string state)
{
var q = GetPHTGL_InvoiceByModle(table);
switch (state)
{
case "0": q = q.Where(x => x.State > StateDataIn); //全部
case "0":
q = q.Where(x => x.State > StateDataIn); //全部
break;
case "1":
q = q.Where(x => x.State > StateDataIn &&x.State< StateInPutApproveSuccess); //未入库
break;
case "2":
q = q.Where(x => x.State >= StateInPutApproveSuccess ); //已入库
break;
case "3":
q = q.Where(x => x.State >=StateInPutApproveSuccess && x.State < StateOutPutApproveSuccess);//未出库
break;
case "4":
case "1":
q = q.Where(x => x.State > StateDataIn && x.State < StateInPutApproveSuccess); //未入库
break;
case "2":
q = q.Where(x => x.State >= StateInPutApproveSuccess); //已入库
break;
case "3":
q = q.Where(x => x.State >= StateInPutApproveSuccess && x.State < StateOutPutApproveSuccess);//未出库
break;
case "4":
q = q.Where(x => x.State == StateOutPutApproveSuccess);//已出库
break;
break;
}
Count = q.Count();
@@ -208,37 +200,37 @@ namespace BLL
q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList();
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return (from x in q
join y in Funs.DB.PHTGL_Contract on x.ContractId equals y.ContractId into g
from c in g.DefaultIfEmpty()
where x.State>StateDataIn
select new
{
c?.ContractName,
c?.ContractNum,
c?.Parties,
c?.ContractAmount,
x.InvoiceId,
x.ProjectId,
x.ContractId,
x.State,
x.InvoiceCode,
x.InvoiceNumber,
x.SellerName,
x.InvoiceDate,
x.AmountExcludingTax,
x.TotalTax,
x.Remark,
x.ImagePath,
x.SellerTaxNumber,
x.InvoiceAmount,
x.ApproveManJson,
x.CreateDate,
x.CreateUser,
x.OrderInDate,
x.OrderOutDate,
x.OrderCode,
x.MaterialRequisitionUnit
}).ToList();
join y in Funs.DB.PHTGL_Contract on x.ContractId equals y.ContractId into g
from c in g.DefaultIfEmpty()
where x.State > StateDataIn
select new
{
c?.ContractName,
c?.ContractNum,
c?.Parties,
c?.ContractAmount,
x.InvoiceId,
x.ProjectId,
x.ContractId,
x.State,
x.InvoiceCode,
x.InvoiceNumber,
x.SellerName,
x.InvoiceDate,
x.AmountExcludingTax,
x.TotalTax,
x.Remark,
x.ImagePath,
x.SellerTaxNumber,
x.InvoiceAmount,
x.ApproveManJson,
x.CreateDate,
x.CreateUser,
x.OrderInDate,
x.OrderOutDate,
x.OrderCode,
x.MaterialRequisitionUnit
}).ToList();
}
#endregion
@@ -256,17 +248,17 @@ namespace BLL
OrderApproveOut orderApproveOut = new OrderApproveOut();
var invoiceModel = GetPHTGL_InvoiceById(InvoiceId);
var invoiceDetail = PhtglInvoicedetailService.GetPHTGL_InvoiceDetailByInvoiceId(InvoiceId);
var invoiceDetail = PhtglInvoicedetailService.GetPHTGL_InvoiceDetailByInvoiceId(InvoiceId);
var approveManModels = GetInvoiceApproveManEntity(InvoiceId);
//将invoiceModel 映射到order
var mapper = EmitMapper.ObjectMapperManager.DefaultInstance.GetMapper<PHTGL_Invoice, Order>();
order=mapper.Map(invoiceModel);
order.ProjectName=ProjectService.GetProjectNameByProjectId(invoiceModel.ProjectId);
order.ContractCode=ContractService.GetContractById(invoiceModel.ContractId)?.ContractNum;
order = mapper.Map(invoiceModel);
order.ProjectName = ProjectService.GetProjectNameByProjectId(invoiceModel.ProjectId);
order.ContractCode = ContractService.GetContractById(invoiceModel.ContractId)?.ContractNum;
//invoiceDetail 映射到orderDetails
var mapper2 = EmitMapper.ObjectMapperManager.DefaultInstance.GetMapper<List<PHTGL_InvoiceDetail>, List<OrderDetail>>();
orderDetails = mapper2.Map(invoiceDetail);
orderDetails= orderDetails.Select(x => new OrderDetail
orderDetails = orderDetails.Select(x => new OrderDetail
{
GoodsOrServicesName = x.GoodsOrServicesName,
SpecificationModel = x.SpecificationModel,
@@ -274,11 +266,11 @@ namespace BLL
Quantity = x.Quantity,
UnitPrice = x.UnitPrice,
NoTaxPrice = x.Amount - x.Tax,
TaxRate = string.Format("{0:P0}", Convert.ToDecimal(x.TaxRate) ),
Tax =x.Tax ,
TaxRate = string.Format("{0:P0}", Convert.ToDecimal(x.TaxRate)),
Tax = x.Tax,
Amount = x.Amount,
}).ToList();
if (approveManModels!=null)
if (approveManModels != null)
{
orderApproveIn.ProjectManager = !string.IsNullOrEmpty(approveManModels.InputApproveMan.ProjectManager) ? BLL.Person_PersonsService.getSignatureUrl(approveManModels.InputApproveMan.ProjectManager) : "";
orderApproveIn.ControlManager = !string.IsNullOrEmpty(approveManModels.InputApproveMan.ControlManager) ? BLL.Person_PersonsService.getSignatureUrl(approveManModels.InputApproveMan.ControlManager) : "";
@@ -395,10 +387,10 @@ namespace BLL
{
Model.PHTGL_InvoiceApproveManEntity list = new Model.PHTGL_InvoiceApproveManEntity();
Model.PHTGL_Invoice data = Funs.DB.PHTGL_Invoice.FirstOrDefault(e => e.InvoiceId == InvoiceId);
if (data != null && !string .IsNullOrEmpty(data.ApproveManJson))
if (data != null && !string.IsNullOrEmpty(data.ApproveManJson))
{
list = Newtonsoft.Json.JsonConvert.DeserializeObject<Model.PHTGL_InvoiceApproveManEntity>(data.ApproveManJson);
}
}
return list;
}
/// <summary>
@@ -527,33 +519,35 @@ namespace BLL
return responeData;
}
/// <summary>
/// 获取审批人员
/// </summary>
/// <param name="invoiceId">主键id</param>
/// <param name="type">0 入库 1出库</param>
/// <returns></returns>
public static List<ApproveManModel> GetApproveManModels(string invoiceId ,int type)
public static List<ApproveManModel> GetApproveManModels(string invoiceId, int type)
{
List<ApproveManModel> approveManModels = new List<ApproveManModel>();
var table = GetInvoiceApproveManEntity(invoiceId);
if (type==0) //入库
if (type == 0) //入库
{
approveManModels.Add(new ApproveManModel { Number = 1, userid = table.InputApproveMan.ProfessionalEngineer, Rolename = "专业工程师" });
approveManModels.Add(new ApproveManModel { Number = 2, userid = table.InputApproveMan.ConstructionManager, Rolename = "施工经理" });
approveManModels.Add(new ApproveManModel { Number = 3, userid = table.InputApproveMan.ControlManager, Rolename = "控制经理" });
approveManModels.Add(new ApproveManModel { Number = 4, userid = table.InputApproveMan.ProjectManager, Rolename = "项目经理" }); }
else {
approveManModels.Add(new ApproveManModel { Number = 5, userid = table.OutputApproveMan.PurchasingMan, Rolename = "采购员" });
approveManModels.Add(new ApproveManModel { Number = 6, userid = table.OutputApproveMan.ControlManager, Rolename = "控制经理" });
approveManModels.Add(new ApproveManModel { Number = 7, userid = table.OutputApproveMan.ProjectManager, Rolename = "项目经理" });
approveManModels.Add(new ApproveManModel { Number = 8, userid = table.OutputApproveMan.ConUnitMaterialOfficer, Rolename = "施工单位材料经理" });
approveManModels.Add(new ApproveManModel { Number = 9, userid = table.OutputApproveMan.ConUnitProjectManager, Rolename = "施工单位项目经理" });
approveManModels.Add(new ApproveManModel { Number = 4, userid = table.InputApproveMan.ProjectManager, Rolename = "项目经理" });
}
else
{
approveManModels.Add(new ApproveManModel { Number = 5, userid = table.OutputApproveMan.PurchasingMan, Rolename = "采购员" });
approveManModels.Add(new ApproveManModel { Number = 6, userid = table.OutputApproveMan.ControlManager, Rolename = "控制经理" });
approveManModels.Add(new ApproveManModel { Number = 7, userid = table.OutputApproveMan.ProjectManager, Rolename = "项目经理" });
approveManModels.Add(new ApproveManModel { Number = 8, userid = table.OutputApproveMan.ConUnitMaterialOfficer, Rolename = "施工单位材料经理" });
approveManModels.Add(new ApproveManModel { Number = 9, userid = table.OutputApproveMan.ConUnitProjectManager, Rolename = "施工单位项目经理" });
}
return approveManModels;
}
@@ -561,22 +555,22 @@ namespace BLL
/// 开启审批流程
/// </summary>
/// <param name="invoiceId"></param>
public static void StartApprovalProcess(string invoiceId )
public static void StartApprovalProcess(string invoiceId)
{
var model = GetPHTGL_InvoiceById(invoiceId);
if (model.State ==StateCreate || model.State == StateInPutApproveRefuse)
{
if (model.State == StateCreate || model.State == StateInPutApproveRefuse)
{
CreateFirstApprove(invoiceId, 0);
model.State = StateInPutApprove;
UpdatePHTGL_Invoice(model);
}
}
else if (model.State == StateInPutApproveSuccess || model.State == StateOutPutApproveRefuse)
{
CreateFirstApprove(invoiceId, 1);
model.State = StateOutPutApprove;
UpdatePHTGL_Invoice(model);
}
}
}
/// <summary>
@@ -585,8 +579,8 @@ namespace BLL
/// <param name="invoiceId">主键</param>
/// <param name="type">0 入库 1出库</param>
public static void CreateFirstApprove(string invoiceId, int type)
{
var approveManModels = GetApproveManModels(invoiceId, type).OrderBy(x=>x.Number).FirstOrDefault();
{
var approveManModels = GetApproveManModels(invoiceId, type).OrderBy(x => x.Number).FirstOrDefault();
Model.PHTGL_Approve _Approve = new Model.PHTGL_Approve();
_Approve.ApproveId = SQLHelper.GetNewID(typeof(Model.PHTGL_Approve));
_Approve.ContractId = invoiceId;
@@ -597,7 +591,7 @@ namespace BLL
_Approve.ApproveIdea = "";
_Approve.IsPushOa = 0;
_Approve.ApproveType = approveManModels.Rolename;
_Approve.ApproveForm =(type==0? "Invoice_Input": "Invoice_Output");
_Approve.ApproveForm = (type == 0 ? "Invoice_Input" : "Invoice_Output");
BLL.PHTGL_ApproveService.AddPHTGL_Approve(_Approve);
}
@@ -617,7 +611,7 @@ namespace BLL
var thisApproveTypeNumber = approveManModels.Find(x => x.userid == userid && x.Rolename == thisApprovemodel.ApproveType).Number; //当前审批人员序号
int nextApproveTypeNumber = thisApproveTypeNumber + 1; //下一个审批人员序号
int maxApproveTypeNumber = approveManModels.Max(x => x.Number); //最大审批人员序号
thisApprovemodel.ApproveDate = Funs.GetNewDateTimeOrNow("").ToString();
thisApprovemodel.IsAgree = isAgree ? 2 : 1;
@@ -626,7 +620,7 @@ namespace BLL
PHTGL_ApproveService.UpdatePHTGL_Approve(thisApprovemodel);
if (isAgree)
{
if (PHTGL_ApproveService.GetPHTGL_ApproveByContractId(invoiceId).Count==0) //当前节点是否全部审批结束
if (PHTGL_ApproveService.GetPHTGL_ApproveByContractId(invoiceId).Count == 0) //当前节点是否全部审批结束
{
if (thisApproveTypeNumber < maxApproveTypeNumber) //是否最末节点
{
@@ -647,8 +641,8 @@ namespace BLL
{
//流程走完结束
var model = GetPHTGL_InvoiceById(invoiceId);
model.State = (type == 0 ? StateInPutApproveSuccess:StateOutPutApproveSuccess);
UpdatePHTGL_Invoice(model);
model.State = (type == 0 ? StateInPutApproveSuccess : StateOutPutApproveSuccess);
UpdatePHTGL_Invoice(model);
}
}
}
@@ -656,7 +650,7 @@ namespace BLL
{ //审批拒绝-流程结束
var model = GetPHTGL_InvoiceById(invoiceId);
model.State = (type == 0 ? StateInPutApproveRefuse : StateOutPutApproveRefuse);
UpdatePHTGL_Invoice(model);
UpdatePHTGL_Invoice(model);
}
OAWebSevice.Pushoa();
OAWebSevice.DoneRequest(thisApprovemodel.ApproveId);
@@ -1,9 +1,7 @@
using FineUIPro;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
@@ -32,7 +30,7 @@ namespace BLL
(string.IsNullOrEmpty(table.GoodsOrServicesName) || x.GoodsOrServicesName.Contains(table.GoodsOrServicesName)) &&
(string.IsNullOrEmpty(table.SpecificationModel) || x.SpecificationModel.Contains(table.SpecificationModel)) &&
(string.IsNullOrEmpty(table.Unit) || x.Unit.Contains(table.Unit)) &&
(string.IsNullOrEmpty(table.TaxRate) || x.TaxRate.Contains(table.TaxRate))
(string.IsNullOrEmpty(table.TaxRate) || x.TaxRate.Contains(table.TaxRate))
select x
;
@@ -146,18 +144,18 @@ namespace BLL
}
}
public static void BatchAddPHTGL_InvoiveDetail(IEnumerable<Model.PHTGL_InvoiceDetail> list, string invoiceId )
public static void BatchAddPHTGL_InvoiveDetail(IEnumerable<Model.PHTGL_InvoiceDetail> list, string invoiceId)
{
foreach (var item in list)
{
item.InvoiceId= invoiceId;
item.InvoiceId = invoiceId;
AddPHTGL_InvoiceDetail(item);
}
}
public static void BatchAddPHTGL_InvoiveDetail(IEnumerable<Model.PHTGL_InvoiceDetail> list)
{
foreach (var item in list)
{
{
AddPHTGL_InvoiceDetail(item);
}
}
+3 -3
View File
@@ -259,7 +259,7 @@ namespace BLL
}
break;
case PHTGL_ApproveService.Invoice_Input:
case PHTGL_ApproveService.Invoice_Input:
var invoice = BLL.PhtglInvoiceService.GetPHTGL_InvoiceById(users.ContractId);
if (invoice != null)
{
@@ -275,7 +275,7 @@ namespace BLL
webJson.appurl = getAppurl(invoice.ProjectId, PHTGL_ApproveService.Invoice_Input, invoice.InvoiceId, gereceiver.PersonId);
}
break;
case PHTGL_ApproveService.Invoice_Output:
case PHTGL_ApproveService.Invoice_Output:
var invoice_output = BLL.PhtglInvoiceService.GetPHTGL_InvoiceById(users.ContractId);
if (invoice_output != null)
{
@@ -449,7 +449,7 @@ namespace BLL
webJson.appurl = getAppurl(invoice.ProjectId, PHTGL_ApproveService.Invoice_Input, invoice.InvoiceId, users[i].ApproveMan);
}
break;
case PHTGL_ApproveService.Invoice_Output:
case PHTGL_ApproveService.Invoice_Output:
var invoice_output = BLL.PhtglInvoiceService.GetPHTGL_InvoiceById(users[i].ContractId);
if (invoice_output != null)
{