This commit is contained in:
2023-08-30 14:52:46 +08:00
44 changed files with 3677 additions and 2890 deletions
+2
View File
@@ -584,6 +584,8 @@
<Compile Include="PHTGL\BiddingManagement\SetSubReview_Sch2Service.cs" />
<Compile Include="Common\WordHelp.cs" />
<Compile Include="PHTGL\BillOfQuantities\PhtglBidprojectquantityService .cs" />
<Compile Include="PHTGL\ContractCompile\PhtglContracttrackprogressService.cs" />
<Compile Include="PHTGL\ContractCompile\PhtglContracttrackService .cs" />
<Compile Include="PHTGL\BillOfQuantities\PhtglMainprojectquantityService .cs" />
<Compile Include="PHTGL\BillOfQuantities\PhtglQuantityService.cs" />
<Compile Include="PHTGL\ContractCompile\AttachUrl10Service.cs" />
+9 -2
View File
@@ -3175,7 +3175,7 @@ namespace BLL
public const string TemQuantityListMenuId2= "0E04FA16-FFA6-4987-A0A5-A4658F0099F2";
public const string TemQuantityListMenuId3= "FAC4F0F7-A7C0-4F66-8BCB-846C082BCA40";
public const string TemQuantityListMenuId4= "10586190-0FDD-4DA8-A877-CE4599D6F0DF";
public const string TemQuantityListMenuId5= "10586190-0FDD-4DA8-A877-CE4599D6F0DF";
public const string TemQuantityListMenuId5= "1C770E20-7912-484C-9739-499B1B2F8DEB";
public const string TemQuantityListMenuId6= "92101A90-9C22-4B43-B012-9AFF8402F85D";
public const string TemQuantityListMenuId7= "33A03E2C-4E00-4722-AA14-F50419468154";
public const string TemQuantityListMenuId8= "A5A31FE8-0643-4396-99E3-A4A31A947789";
@@ -3184,7 +3184,10 @@ namespace BLL
/// 招标工程量清单定制
/// </summary>
public const string PHTGL_BidProjectQuantityMenuId = "687991B6-73AC-42FA-9A72-178AF94D1EB4";
/// <summary>
/// 合同执行跟踪
/// </summary>
public const string PHTGL_ContractTrackMenuId = "D9BAB30E-3255-4EA0-8631-EF15C9203EFD";
#endregion
@@ -3375,6 +3378,10 @@ namespace BLL
/// 合同工程量导入清单模板
/// </summary>
public const string TemQuantityTemplateUrl = "File\\Excel\\DataIn\\工程量清单模板.xlsx";
/// <summary>
/// 合同执行跟踪导入模板
/// </summary>
public const string TemContractTrackTemplateUrl = "File\\Excel\\DataIn\\合同执行跟踪导入模板.xlsx";
#endregion
+12 -2
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
@@ -175,7 +176,7 @@ namespace BLL
}
#region wpq
public static List<Model.View_HJGL_WPQ> GetMatchWPQ(Model.HJGL_WeldJoint jot,string projectid)
public static List<View_HJGL_WPQ> GetMatchWPQ(HJGL_WeldJoint jot, string projectid, string unitid)
{
var pipe = BLL.PipelineService.GetPipelineByPipelineId(jot.PipelineId);
var weldT = BLL.Base_WeldTypeService.GetWeldTypeByWeldTypeId(jot.WeldTypeId);
@@ -183,7 +184,16 @@ namespace BLL
string material2 = jot.Material2Id;
decimal dia = jot.Dia.HasValue ? jot.Dia.Value : 0;
decimal sch = jot.Thickness.HasValue ? jot.Thickness.Value : 0;
string unitId = pipe.UnitId;
string unitId = string.Empty;
if (unitid!=Const._Null)
{
unitId = unitid;
}
else
{
unitId = pipe.UnitId;
}
string weldType = string.Empty;
if (weldT != null)
{
@@ -652,7 +652,6 @@ namespace BLL
File.Delete(pdfUrl);
}
//删除文件夹
public static void PrintApprovalForm(string ContractReviewId)
{
@@ -64,9 +64,6 @@ namespace BLL
}
/// <summary>
/// 增加合同基本信息
/// </summary>
@@ -0,0 +1,327 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using EmitMapper;
using FineUIPro;
using MiniExcelLibs;
using MiniExcelLibs.Attributes;
using Model;
namespace BLL
{
public static class PHTGL_ContractTrackService
{
#region
/// <summary>
/// 记录数
/// </summary>
public static int Count { get; set; }
public static List<PHTGL_ContractTrack> GetPHTGL_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.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)) &&
(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) ||
x.ContractId.Contains(table.ContractId))
select x
;
return q.ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="table"></param>
/// <param name="grid1"></param>
/// <returns></returns>
public static IEnumerable GetListData(PHTGL_ContractTrack table, Grid grid1)
{
var q = GetPHTGL_ContractTrackByModle(table);
Count = q.Count();
if (Count == 0) return null;
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.ContractNum,
x.MainItemCode,
x.MainItemName,
x.MajorName,
x.MajorCode,
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.ConstructionSubcontractor,
x.ContractWeight,
x.MaterialSupplier,
x.IsWithinGeneralContractScope,
x.EstimatedQuantity,
x.EstimatedAmount,
x.SettledQuantity,
x.SettledAmount,
x.ContractId
};
}
#endregion
public static PHTGL_ContractTrack GetPHTGL_ContractTrackById(string id)
{
return Funs.DB.PHTGL_ContractTrack.FirstOrDefault(x => x.Id == id);
}
public static void AddPHTGL_ContractTrack(PHTGL_ContractTrack newtable)
{
var table = new PHTGL_ContractTrack
{
Id = newtable.Id,
ContractNum = newtable.ContractNum,
MainItemCode = newtable.MainItemCode,
MainItemName = newtable.MainItemName,
MajorName = newtable.MajorName,
MajorCode = newtable.MajorCode,
SubProject = newtable.SubProject,
SubItemProject = newtable.SubItemProject,
ProjectCode = newtable.ProjectCode,
ProjectName = newtable.ProjectName,
ProjectDescription = newtable.ProjectDescription,
UnitOfMeasurement = newtable.UnitOfMeasurement,
Quantity = newtable.Quantity,
TotalCostFixedComprehensiveUnitPrice = newtable.TotalCostFixedComprehensiveUnitPrice,
MainMaterialCost = newtable.MainMaterialCost,
TotalPrice = newtable.TotalPrice,
CalculationRule = newtable.CalculationRule,
WorkContent = newtable.WorkContent,
Remarks = newtable.Remarks,
ConstructionSubcontractor = newtable.ConstructionSubcontractor,
ContractWeight = newtable.ContractWeight,
MaterialSupplier = newtable.MaterialSupplier,
IsWithinGeneralContractScope = newtable.IsWithinGeneralContractScope,
EstimatedQuantity = newtable.EstimatedQuantity,
EstimatedAmount = newtable.EstimatedAmount,
SettledQuantity = newtable.SettledQuantity,
SettledAmount = newtable.SettledAmount,
ContractId = newtable.ContractId,
ProjectId = newtable.ProjectId,
};
Funs.DB.PHTGL_ContractTrack.InsertOnSubmit(table);
Funs.DB.SubmitChanges();
}
public static void UpdatePHTGL_ContractTrack(PHTGL_ContractTrack newtable)
{
var table = Funs.DB.PHTGL_ContractTrack.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
table.ContractNum = newtable.ContractNum;
table.MainItemCode = newtable.MainItemCode;
table.MainItemName = newtable.MainItemName;
table.MajorName = newtable.MajorName;
table.MajorCode = newtable.MajorCode;
table.SubProject = newtable.SubProject;
table.SubItemProject = newtable.SubItemProject;
table.ProjectCode = newtable.ProjectCode;
table.ProjectName = newtable.ProjectName;
table.ProjectDescription = newtable.ProjectDescription;
table.UnitOfMeasurement = newtable.UnitOfMeasurement;
table.Quantity = newtable.Quantity;
table.TotalCostFixedComprehensiveUnitPrice = newtable.TotalCostFixedComprehensiveUnitPrice;
table.MainMaterialCost = newtable.MainMaterialCost;
table.TotalPrice = newtable.TotalPrice;
table.CalculationRule = newtable.CalculationRule;
table.WorkContent = newtable.WorkContent;
table.Remarks = newtable.Remarks;
table.ConstructionSubcontractor = newtable.ConstructionSubcontractor;
table.ContractWeight = newtable.ContractWeight;
table.MaterialSupplier = newtable.MaterialSupplier;
table.IsWithinGeneralContractScope = newtable.IsWithinGeneralContractScope;
table.EstimatedQuantity = newtable.EstimatedQuantity;
table.EstimatedAmount = newtable.EstimatedAmount;
table.SettledQuantity = newtable.SettledQuantity;
table.SettledAmount = newtable.SettledAmount;
table.ContractId=newtable.ContractId;
table.ProjectId=newtable.ProjectId;
Funs.DB.SubmitChanges();
}
}
public static void DeletePHTGL_ContractTrackById(string id)
{
var table = Funs.DB.PHTGL_ContractTrack.FirstOrDefault(x => x.Id == id);
if (table != null)
{
Funs.DB.PHTGL_ContractTrack.DeleteOnSubmit(table);
Funs.DB.SubmitChanges();
}
}
public static ResponeData ImportData(string path, string contractid, string projectid)
{
var responeData = new ResponeData();
List<PHTGL_ContractTrackDtoIn> rows;
try
{
rows = MiniExcel.Query<PHTGL_ContractTrackDtoIn>(path).ToList();
}
catch (Exception e)
{
responeData.code = 0;
responeData.message = "模板错误";
return responeData;
}
var mapper =
ObjectMapperManager.DefaultInstance.GetMapper<List<PHTGL_ContractTrackDtoIn>, List<PHTGL_ContractTrack>>();
var modeList = mapper.Map(rows);
if (modeList.Count == 0)
{
responeData.code = 0;
responeData.message = "没有数据";
return responeData;
}
foreach (var item in modeList)
{
item.ContractId = contractid;
item.ProjectId = projectid;
var phtglContractTrack = new PHTGL_ContractTrack
{
ProjectCode = item.ProjectCode,
ContractId = contractid,
ProjectId = projectid,
};
var resultModel = GetPHTGL_ContractTrackByModle(phtglContractTrack);
if (resultModel.Any())
{
item.Id = resultModel[0].Id;
UpdatePHTGL_ContractTrack(item);
}
else
{
item.Id = SQLHelper.GetNewID();
AddPHTGL_ContractTrack(item);
}
}
return responeData;
}
}
public class PHTGL_ContractTrackDtoIn
{
/// <summary>
/// 主项号
/// </summary>
[ExcelColumnIndex("B")] public string MainItemCode { get; set; }
/// <summary>
/// 主项名称
/// </summary>
[ExcelColumnIndex("C")] public string MainItemName { get; set; }
/// <summary>
/// 专业代码
/// </summary>
[ExcelColumnIndex("D")] public string MajorCode { get; set; }
/// <summary>
/// 专业工程名称
/// </summary>
[ExcelColumnIndex("E")] public string MajorName { get; set; }
/// <summary>
/// 项目编码
/// </summary>
[ExcelColumnIndex("F")] public string ProjectCode { get; set; }
/// <summary>
/// 项目名称
/// </summary>
[ExcelColumnIndex("G")] public string ProjectName { get; set; }
/// <summary>
/// 项目特征描述
/// </summary>
[ExcelColumnIndex("H")] public string ProjectDescription { get; set; }
/// <summary>
/// 计量单位
/// </summary>
[ExcelColumnIndex("I")] public string UnitOfMeasurement { get; set; }
/// <summary>
/// 工程量
/// </summary>
[ExcelColumnIndex("J")] public string Quantity { get; set; }
/// <summary>
/// 全费用固定综合单价
/// </summary>
[ExcelColumnIndex("K")] public string TotalCostFixedComprehensiveUnitPrice { get; set; }
/// <summary>
/// 其中:主材费
/// </summary>
[ExcelColumnIndex("L")] public string MainMaterialCost { get; set; }
/// <summary>
/// 合价/元
/// </summary>
[ExcelColumnIndex("M")] public string TotalPrice { get; set; }
/// <summary>
/// 计算规则
/// </summary>
[ExcelColumnIndex("N")] public string CalculationRule { get; set; }
/// <summary>
/// 工作内容
/// </summary>
[ExcelColumnIndex("O")] public string WorkContent { get; set; }
/// <summary>
/// 备注
/// </summary>
[ExcelColumnIndex("P")] public string Remarks { get; set; }
}
}
@@ -0,0 +1,136 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using FineUIPro;
using Model;
namespace BLL
{
public static class PhtglContracttrackprogressService
{
#region
/// <summary>
/// 记录数
/// </summary>
public static int Count { get; set; }
public static List<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.BCWS_Quantity) || x.BCWS_Quantity.Contains(table.BCWS_Quantity)) &&
(string.IsNullOrEmpty(table.BCWS_OutputValue) ||
x.BCWS_OutputValue.Contains(table.BCWS_OutputValue)) &&
(string.IsNullOrEmpty(table.BCWS_Percentage) ||
x.BCWS_Percentage.Contains(table.BCWS_Percentage)) &&
(string.IsNullOrEmpty(table.ACWP_Quantity) || x.ACWP_Quantity.Contains(table.ACWP_Quantity)) &&
(string.IsNullOrEmpty(table.ACWP_OutputValue) ||
x.ACWP_OutputValue.Contains(table.ACWP_OutputValue)) &&
(string.IsNullOrEmpty(table.ACWP_Percentage) ||
x.ACWP_Percentage.Contains(table.ACWP_Percentage))
select x
;
return q.ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="table"></param>
/// <param name="grid1"></param>
/// <returns></returns>
public static IEnumerable GetListData(PHTGL_ContractTrackProgress table, Grid grid1)
{
var q = GetPHTGL_ContractTrackProgressByModle(table);
Count = q.Count();
if (Count == 0) return null;
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.ContractTrackProgressId,
x.ContractTrackId,
x.BCWS_Quantity,
x.BCWS_OutputValue,
x.BCWS_Percentage,
x.ACWP_Quantity,
x.ACWP_OutputValue,
x.ACWP_Percentage
};
}
#endregion
public static PHTGL_ContractTrackProgress GetPHTGL_ContractTrackProgressById(string ContractTrackProgressId)
{
return Funs.DB.PHTGL_ContractTrackProgress.FirstOrDefault(x =>
x.ContractTrackProgressId == ContractTrackProgressId);
}
public static void AddPHTGL_ContractTrackProgress(PHTGL_ContractTrackProgress newtable)
{
var table = new PHTGL_ContractTrackProgress
{
ContractTrackProgressId = newtable.ContractTrackProgressId,
ContractTrackId = newtable.ContractTrackId,
BCWS_Quantity = newtable.BCWS_Quantity,
BCWS_OutputValue = newtable.BCWS_OutputValue,
BCWS_Percentage = newtable.BCWS_Percentage,
ACWP_Quantity = newtable.ACWP_Quantity,
ACWP_OutputValue = newtable.ACWP_OutputValue,
ACWP_Percentage = newtable.ACWP_Percentage
};
Funs.DB.PHTGL_ContractTrackProgress.InsertOnSubmit(table);
Funs.DB.SubmitChanges();
}
public static void UpdatePHTGL_ContractTrackProgress(PHTGL_ContractTrackProgress newtable)
{
var table = Funs.DB.PHTGL_ContractTrackProgress.FirstOrDefault(x =>
x.ContractTrackProgressId == newtable.ContractTrackProgressId);
if (table != null)
{
table.ContractTrackProgressId = newtable.ContractTrackProgressId;
table.ContractTrackId = newtable.ContractTrackId;
table.BCWS_Quantity = newtable.BCWS_Quantity;
table.BCWS_OutputValue = newtable.BCWS_OutputValue;
table.BCWS_Percentage = newtable.BCWS_Percentage;
table.ACWP_Quantity = newtable.ACWP_Quantity;
table.ACWP_OutputValue = newtable.ACWP_OutputValue;
table.ACWP_Percentage = newtable.ACWP_Percentage;
Funs.DB.SubmitChanges();
}
}
public static void DeleteModleById(string ContractTrackProgressId)
{
var table = Funs.DB.PHTGL_ContractTrackProgress.FirstOrDefault(x =>
x.ContractTrackProgressId == ContractTrackProgressId);
if (table != null)
{
Funs.DB.PHTGL_ContractTrackProgress.DeleteOnSubmit(table);
Funs.DB.SubmitChanges();
}
}
public static void DeleteModleByContractTrackId(string ContractTrackId)
{
var table = Funs.DB.PHTGL_ContractTrackProgress.Where(x =>
x.ContractTrackId == ContractTrackId);
if (table != null)
{
Funs.DB.PHTGL_ContractTrackProgress.DeleteAllOnSubmit(table);
Funs.DB.SubmitChanges();
}
}
}
}
+9 -4
View File
@@ -46,7 +46,7 @@ namespace BLL
/// <param name="personType">人员类型</param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getListData(string unitId, string departId, string projetcId, string name, string idCard, string isPost, string personType,string account, Grid Grid1)
public static IEnumerable getListData(string unitId, string departId, string projetcId, string name, string idCard, string isPost, string personType, string account,string[] workPostIds, Grid Grid1)
{
IQueryable<Model.Person_Persons> getDataList = getDataLists.OrderBy(x => x.UnitId).ThenBy(x => x.DepartId);
if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null)
@@ -59,8 +59,9 @@ namespace BLL
}
if (!string.IsNullOrEmpty(projetcId) && projetcId != Const._Null)
{
var idLists=(from x in db.SitePerson_PersonItem where x.ProjectId == projetcId && !x.OutTime.HasValue
select x.PersonId).Distinct().ToList();
var idLists = (from x in db.SitePerson_PersonItem
where x.ProjectId == projetcId && !x.OutTime.HasValue
select x.PersonId).Distinct().ToList();
getDataList = getDataList.Where(x => idLists.Contains(x.PersonId));
}
@@ -80,7 +81,7 @@ namespace BLL
{
getDataList = getDataList.Where(e => e.IdentityCard.Contains(idCard));
}
if (!string.IsNullOrEmpty(isPost) && isPost != "-1" && isPost != Const._Null)
{
if (isPost == Const._True)
@@ -93,6 +94,10 @@ namespace BLL
}
}
if (workPostIds != null && workPostIds.Count() > 0)
{
getDataList = getDataList.Where(e => workPostIds.Contains(e.WorkPostId));
}
count = getDataList.Count();
if (count == 0)
{