2022-10-10 焊接材料编码库导入修改及其相关联界面修改。小程序包装信息接口添加。合同劳务人员下拉框

This commit is contained in:
2022-10-10 09:56:40 +08:00
parent c1a7f0aa14
commit 00aeaac1e2
18 changed files with 260 additions and 32 deletions
+81
View File
@@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
namespace BLL
{
public class APIHJGLIndexService
{
public static Model.HJGLIndexItem GetJGLIndexItem(string projectid)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.HJGLIndexItem hJGLIndexItem = new Model.HJGLIndexItem();
var PipeRate1 = BLL.HJGL_WeldingReportService.GetPipeRate_finished(projectid);
var PipeRate2 = BLL.HJGL_WeldingReportService.GetPipeRate_unfinished(projectid);
var getCH_CheckItemList = (from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId
join z in Funs.DB.View_HJGL_WeldJoint on y.WeldJointId equals z.WeldJointId
join line in Funs.DB.HJGL_Pipeline on z.PipelineId equals line.PipelineId
where z.ProjectId == projectid
select new Model.sp_index_HJGLItem
{
ProjectId = line.ProjectId,
ID = x.NDEItemID,
UnitId = line.UnitId, ///重定义单位
UnitName = z.UnitName,
WorkAreaId = line.UnitId, /// 重定义区域
MaterialId = line.UnitWorkId, ///重定义材质
CHT_TotalFilm = x.TotalFilm,
CHT_PassFilm = x.PassFilm,
Specification = z.Specification,
WeldTypeCode = z.WeldTypeCode,
JointAttribute = z.JointAttribute,
UnitWorkName = z.UnitWorkName,
MaterialCode = z.MaterialCode
}).ToList();
var tb_type06 = getCH_CheckItemList.GroupBy(x => x.JointAttribute).Select(x => new {
JointAttribute = x.Key,
Current_pass_film = x.Sum(m => m.CHT_PassFilm) ?? 0,
Cht_totalfilm = x.Sum(m => m.CHT_TotalFilm) ?? 0
});
var GC_model = tb_type06.Where(x => x.JointAttribute == "预制口").FirstOrDefault();
var XC_model = tb_type06.Where(x => x.JointAttribute == "安装口").FirstOrDefault();
double PassRate1 = 0;
double PassRate2 = 0;
if (GC_model!=null &&GC_model.Cht_totalfilm>0)
{
PassRate1 = Math.Round((100 * GC_model.Current_pass_film * 1.0) / GC_model.Cht_totalfilm, 1);
}
if (XC_model!=null&& XC_model.Cht_totalfilm > 0)
{
PassRate2 = Math.Round((100 * XC_model.Current_pass_film * 1.0) / XC_model.Cht_totalfilm, 1);
}
hJGLIndexItem.GCFirstPassRate = PassRate1.ToString()+" %";
hJGLIndexItem.XCFirstPassRate = PassRate2.ToString()+" %";
hJGLIndexItem.GCProgress = BLL.HJGL_WeldingReportService.GetGCRate_finished(projectid).ToString() + "/" + HJGL_WeldingReportService.GetSumSize(projectid, 1).ToString() + " DIN";
hJGLIndexItem.XCProgress = BLL.HJGL_WeldingReportService.GetXCRate_finished(projectid).ToString() + "/" + HJGL_WeldingReportService.GetSumSize(projectid, 2).ToString() + " DIN";
if (PipeRate1 + PipeRate2 == 0)
{
hJGLIndexItem.PipePrefabricationRate = "0 %";
}
else
{
hJGLIndexItem.PipePrefabricationRate = Math.Floor(Math.Round(decimal.Parse((PipeRate1 / (PipeRate1 + PipeRate2)).ToString("0.000")), 2) * 100).ToString()+" %";
}
hJGLIndexItem.GCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_GC(projectid).ToString()+" DIN/天";
hJGLIndexItem.XCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_XC(projectid).ToString()+" DIN/天";
return hJGLIndexItem;
}
}
}
}
@@ -10,7 +10,7 @@ namespace BLL
{
public class APIPackagingManageService
{
public static List<Model.PackagingManageDetailItem> GetPackagingManageList(string projectId)
public static List<Model.PackagingManageDetailItem> GetPackagingManageList(string projectId,int pagesize,int pageindex)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
@@ -28,8 +28,9 @@ namespace BLL
ContactName = x.ContactName,
ContactPhone = x.ContactPhone,
StackingPosition = x.StackingPosition,
State= x.State,
}).Distinct();
return q.ToList();
return q.Take(pagesize*pageindex).Skip(pageindex).ToList();
}
}
@@ -50,6 +51,7 @@ namespace BLL
ContactName = x.ContactName,
ContactPhone = x.ContactPhone,
StackingPosition = x.StackingPosition,
State =x.State
}).FirstOrDefault();
var tb_packing = (from x in db.HJGL_PackagingManage where x.PackagingManageId==packagingManageId select x ).FirstOrDefault() ;
var PipelineComponentIdList = tb_packing.PipelineComponentId.Split(',');
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class APIPipelineComponentService
{
}
}
+2
View File
@@ -145,10 +145,12 @@
<Compile Include="API\APIUnitService.cs" />
<Compile Include="API\APIUpLoadFileService.cs" />
<Compile Include="API\APIUserService.cs" />
<Compile Include="API\HJGL\APIHJGLIndexService.cs" />
<Compile Include="API\HJGL\APIHotProcessHardService.cs" />
<Compile Include="API\HJGL\APINDETrustService.cs" />
<Compile Include="API\HJGL\APIPackagingManageService.cs" />
<Compile Include="API\HJGL\APIPipeJointService.cs" />
<Compile Include="API\HJGL\APIPipelineComponentService.cs" />
<Compile Include="API\HJGL\APIPreWeldingDailyService.cs" />
<Compile Include="API\HJGL\APIReportQueryService.cs" />
<Compile Include="API\HJGL\APITestPackageService.cs" />
@@ -46,7 +46,7 @@ namespace BLL
return result;
}
/// <summary>
/// 工厂预制完成
/// 工厂预制完成
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
@@ -72,7 +72,7 @@ namespace BLL
return result;
}
/// <summary>
/// 工厂预制未完成
/// 工厂预制未完成
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
@@ -83,7 +83,7 @@ namespace BLL
return result;
}
/// <summary>
/// 现场安装完成
/// 现场安装完成
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
@@ -109,7 +109,7 @@ namespace BLL
return result;
}
/// <summary>
/// 现场安装未完成
/// 现场安装未完成
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
@@ -120,7 +120,7 @@ namespace BLL
return result;
}
/// <summary>
/// 管道完成预制
/// 管道完成预制
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
@@ -131,7 +131,7 @@ namespace BLL
return result;
}
/// <summary>
/// 管道未完成预制
/// 管道未完成预制
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
@@ -141,6 +141,11 @@ namespace BLL
result = GetSumSize(projectId, 0) - GetPipeRate_finished(projectId);
return result;
}
/// <summary>
/// 焊工功效
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static decimal GetWelderEfficacy(string projectId)
{
decimal result = 0;
@@ -160,6 +165,48 @@ namespace BLL
}
return decimal.Truncate(result);
}
public static decimal GetWelderEfficacy_GC(string projectId)
{
decimal result = 0;
var db = Funs.DB;
var q = (from x in db.HJGL_WeldJoint
join y in db.HJGL_WeldingDaily on x.WeldingDailyId equals y.WeldingDailyId
where x.ProjectId == projectId && x.JointAttribute=="预制口"
group x by x.ProjectId into g
select new
{
TotalDin = g.Sum(x => x.Size),
worktime = g.Select(x => x.WeldingDailyId).Distinct().Count(),
});
foreach (var item in q)
{
result = decimal.Divide((decimal)item.TotalDin, item.worktime);
}
return decimal.Truncate(result);
}
public static decimal GetWelderEfficacy_XC(string projectId)
{
decimal result = 0;
var db = Funs.DB;
var q = (from x in db.HJGL_WeldJoint
join y in db.HJGL_WeldingDaily on x.WeldingDailyId equals y.WeldingDailyId
where x.ProjectId == projectId && x.JointAttribute == "安装口"
group x by x.ProjectId into g
select new
{
TotalDin = g.Sum(x => x.Size),
worktime = g.Select(x => x.WeldingDailyId).Distinct().Count(),
});
foreach (var item in q)
{
result = decimal.Divide((decimal)item.TotalDin, item.worktime);
}
return decimal.Truncate(result);
}
}