Merge branch 'master' of https://gitee.com/frane-yang/SGGL_SeDin_New
This commit is contained in:
@@ -18,6 +18,8 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static string Http(string url, string method = "GET", string contenttype = "application/json;charset=utf-8", Hashtable header = null, string data = null)
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 ;
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
request.Method = string.IsNullOrEmpty(method) ? "GET" : method;
|
||||
request.ContentType = string.IsNullOrEmpty(contenttype) ? "application/json;charset=utf-8" : contenttype;
|
||||
|
||||
@@ -649,6 +649,9 @@
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogProblemService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogRecordService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogWorkEfficiencyCompanyService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogWorkEfficiencyMonthService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogWorkEfficiencyProjectService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogWorkEfficiencyService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionPlanApproveService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionPlanService.cs" />
|
||||
|
||||
@@ -893,11 +893,19 @@ namespace BLL
|
||||
row[7] = item.Id;
|
||||
if (workEfficiencys.Count() > 0)
|
||||
{
|
||||
var we = workEfficiencys.FirstOrDefault(x => x.ContractTrackId == item.Id);
|
||||
if (we != null)
|
||||
var we = (from x in workEfficiencys
|
||||
where x.ContractTrackId == item.Id
|
||||
select new { x.ConstructionLogId, x.ContractTrackId, x.PhysicalCompletionQuantity, x.MaterialConsumption }).Distinct().ToList();
|
||||
decimal physicalCompletionQuantity = 0, materialConsumption = 0;
|
||||
if (we.Count() > 0)
|
||||
{
|
||||
row[5] = we.PhysicalCompletionQuantity;
|
||||
row[6] = we.MaterialConsumption;
|
||||
foreach (var w in we)
|
||||
{
|
||||
physicalCompletionQuantity += w.PhysicalCompletionQuantity ?? 0;
|
||||
materialConsumption += w.MaterialConsumption ?? 0;
|
||||
}
|
||||
row[5] = physicalCompletionQuantity;
|
||||
row[6] = materialConsumption;
|
||||
}
|
||||
for (int i = 0; i < workPostIds.Count; i++)
|
||||
{
|
||||
@@ -915,9 +923,9 @@ namespace BLL
|
||||
if (d > 0)
|
||||
{
|
||||
row[8 + i * 2] = decimal.Round(d, 2);
|
||||
if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0)
|
||||
if (physicalCompletionQuantity > 0)
|
||||
{
|
||||
row[9 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2);
|
||||
row[9 + i * 2] = decimal.Round(Convert.ToDecimal(physicalCompletionQuantity / d), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -938,9 +946,9 @@ namespace BLL
|
||||
if (d > 0)
|
||||
{
|
||||
row[48 + i * 2] = decimal.Round(d, 2);
|
||||
if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0)
|
||||
if (physicalCompletionQuantity > 0)
|
||||
{
|
||||
row[49 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2);
|
||||
row[49 + i * 2] = decimal.Round(Convert.ToDecimal(physicalCompletionQuantity / d), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ConstructionLogWorkEfficiencyCompanyService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取施工日志公司工效明细列表
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ZHGL_ConstructionLogWorkEfficiencyCompany> getListData(string projectId, DateTime month)
|
||||
{
|
||||
return (from x in db.ZHGL_ConstructionLogWorkEfficiencyCompany
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加施工日志公司工效明细
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">施工日志公司工效明细实体</param>
|
||||
public static void AddConstructionLogWorkEfficiencyCompany(Model.ZHGL_ConstructionLogWorkEfficiencyCompany constructionLogWorkEfficiencyCompany)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionLogWorkEfficiencyCompany newConstructionLogWorkEfficiencyCompany = new Model.ZHGL_ConstructionLogWorkEfficiencyCompany();
|
||||
newConstructionLogWorkEfficiencyCompany.ConstructionLogWorkEfficiencyCompanyId = constructionLogWorkEfficiencyCompany.ConstructionLogWorkEfficiencyCompanyId;
|
||||
newConstructionLogWorkEfficiencyCompany.Type = constructionLogWorkEfficiencyCompany.Type;
|
||||
newConstructionLogWorkEfficiencyCompany.TypeId = constructionLogWorkEfficiencyCompany.TypeId;
|
||||
newConstructionLogWorkEfficiencyCompany.UnitOfMeasurement = constructionLogWorkEfficiencyCompany.UnitOfMeasurement;
|
||||
newConstructionLogWorkEfficiencyCompany.BaseWorkEfficiency = constructionLogWorkEfficiencyCompany.BaseWorkEfficiency;
|
||||
newConstructionLogWorkEfficiencyCompany.AvgWorkEfficiency = constructionLogWorkEfficiencyCompany.AvgWorkEfficiency;
|
||||
|
||||
db.ZHGL_ConstructionLogWorkEfficiencyCompany.InsertOnSubmit(newConstructionLogWorkEfficiencyCompany);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据月报id删除对应的所有施工日志公司工效明细
|
||||
/// </summary>
|
||||
public static void DeleteConstructionLogWorkEfficiencyCompanys()
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.ZHGL_ConstructionLogWorkEfficiencyCompany select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.ZHGL_ConstructionLogWorkEfficiencyCompany.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ConstructionLogWorkEfficiencyMonthService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取施工日志月工效明细列表
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ZHGL_ConstructionLogWorkEfficiencyMonth> getListData(string projectId, DateTime month)
|
||||
{
|
||||
return (from x in db.ZHGL_ConstructionLogWorkEfficiencyMonth
|
||||
where x.ProjectId == projectId && x.Month == month
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加施工日志月工效明细
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">施工日志月工效明细实体</param>
|
||||
public static void AddConstructionLogWorkEfficiencyMonth(Model.ZHGL_ConstructionLogWorkEfficiencyMonth constructionLogWorkEfficiencyMonth)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionLogWorkEfficiencyMonth newConstructionLogWorkEfficiencyMonth = new Model.ZHGL_ConstructionLogWorkEfficiencyMonth();
|
||||
newConstructionLogWorkEfficiencyMonth.ConstructionLogWorkEfficiencyMonthId = constructionLogWorkEfficiencyMonth.ConstructionLogWorkEfficiencyMonthId;
|
||||
newConstructionLogWorkEfficiencyMonth.ProjectId = constructionLogWorkEfficiencyMonth.ProjectId;
|
||||
newConstructionLogWorkEfficiencyMonth.Month = constructionLogWorkEfficiencyMonth.Month;
|
||||
newConstructionLogWorkEfficiencyMonth.ContractTrackId = constructionLogWorkEfficiencyMonth.ContractTrackId;
|
||||
newConstructionLogWorkEfficiencyMonth.PhysicalCompletionQuantity = constructionLogWorkEfficiencyMonth.PhysicalCompletionQuantity;
|
||||
newConstructionLogWorkEfficiencyMonth.MaterialConsumption = constructionLogWorkEfficiencyMonth.MaterialConsumption;
|
||||
newConstructionLogWorkEfficiencyMonth.UnitOfMeasurement = constructionLogWorkEfficiencyMonth.UnitOfMeasurement;
|
||||
newConstructionLogWorkEfficiencyMonth.Type = constructionLogWorkEfficiencyMonth.Type;
|
||||
newConstructionLogWorkEfficiencyMonth.TypeId = constructionLogWorkEfficiencyMonth.TypeId;
|
||||
newConstructionLogWorkEfficiencyMonth.ConsumeHours = constructionLogWorkEfficiencyMonth.ConsumeHours;
|
||||
newConstructionLogWorkEfficiencyMonth.WorkEfficiency = constructionLogWorkEfficiencyMonth.WorkEfficiency;
|
||||
|
||||
db.ZHGL_ConstructionLogWorkEfficiencyMonth.InsertOnSubmit(newConstructionLogWorkEfficiencyMonth);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据月报id删除对应的所有施工日志月工效明细
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLogId">施工日志月工效明细编号</param>
|
||||
public static void DeleteConstructionLogWorkEfficiencyMonthsByConstructionLogId(string projectId, DateTime month)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.ZHGL_ConstructionLogWorkEfficiencyMonth where x.ProjectId == projectId && x.Month == month select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.ZHGL_ConstructionLogWorkEfficiencyMonth.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ConstructionLogWorkEfficiencyProjectService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取施工日志项目工效明细列表
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ZHGL_ConstructionLogWorkEfficiencyProject> getListData(string projectId, DateTime month)
|
||||
{
|
||||
return (from x in db.ZHGL_ConstructionLogWorkEfficiencyProject
|
||||
where x.ProjectId == projectId
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加施工日志项目工效明细
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">施工日志项目工效明细实体</param>
|
||||
public static void AddConstructionLogWorkEfficiencyProject(Model.ZHGL_ConstructionLogWorkEfficiencyProject constructionLogWorkEfficiencyProject)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionLogWorkEfficiencyProject newConstructionLogWorkEfficiencyProject = new Model.ZHGL_ConstructionLogWorkEfficiencyProject();
|
||||
newConstructionLogWorkEfficiencyProject.ConstructionLogWorkEfficiencyProjectId = constructionLogWorkEfficiencyProject.ConstructionLogWorkEfficiencyProjectId;
|
||||
newConstructionLogWorkEfficiencyProject.ProjectId = constructionLogWorkEfficiencyProject.ProjectId;
|
||||
newConstructionLogWorkEfficiencyProject.Type = constructionLogWorkEfficiencyProject.Type;
|
||||
newConstructionLogWorkEfficiencyProject.TypeId = constructionLogWorkEfficiencyProject.TypeId;
|
||||
newConstructionLogWorkEfficiencyProject.UnitOfMeasurement = constructionLogWorkEfficiencyProject.UnitOfMeasurement;
|
||||
newConstructionLogWorkEfficiencyProject.BaseWorkEfficiency = constructionLogWorkEfficiencyProject.BaseWorkEfficiency;
|
||||
newConstructionLogWorkEfficiencyProject.AvgWorkEfficiency = constructionLogWorkEfficiencyProject.AvgWorkEfficiency;
|
||||
|
||||
db.ZHGL_ConstructionLogWorkEfficiencyProject.InsertOnSubmit(newConstructionLogWorkEfficiencyProject);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据月报id删除对应的所有施工日志项目工效明细
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLogId">施工日志项目工效明细编号</param>
|
||||
public static void DeleteConstructionLogWorkEfficiencyProjectsByConstructionLogId(string projectId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.ZHGL_ConstructionLogWorkEfficiencyProject where x.ProjectId == projectId select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.ZHGL_ConstructionLogWorkEfficiencyProject.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user