2022-10-10 焊接材料编码库导入修改及其相关联界面修改。小程序包装信息接口添加。合同劳务人员下拉框
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user