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

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;
}
}
}
}

View File

@ -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(',');

View File

@ -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
{
}
}

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" />

View File

@ -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);
}
}

View File

@ -49,16 +49,16 @@
TextAlign="Left" SortField="MaterialCode">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="MaterialName" DataField="MaterialName"
FieldType="String" HeaderText="元件类型" HeaderTextAlign="Center"
FieldType="String" HeaderText="类型" HeaderTextAlign="Center"
TextAlign="Left" SortField="MaterialName">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="" DataField="MaterialSpec"
FieldType="String" HeaderText="规格" HeaderTextAlign="Center"
TextAlign="Left" SortField="MaterialSpec">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="MaterialMade" DataField="MaterialMade" FieldType="String" HeaderText="材质"
<%--<f:RenderField Width="180px" ColumnID="MaterialMade" DataField="MaterialMade" FieldType="String" HeaderText="材质"
HeaderTextAlign="Center" TextAlign="Left" SortField="MaterialMade" >
</f:RenderField>
</f:RenderField>--%>
<f:RenderField Width="90px" ColumnID="MaterialUnit" DataField="MaterialUnit" FieldType="String" HeaderText="单位"
HeaderTextAlign="Center" TextAlign="Left" SortField="MaterialUnit" >
</f:RenderField>

View File

@ -128,7 +128,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo
return;
}
DataRow[] dv = ds.Tables[0].Select("采购码 <>'' and 元件类型 <>''");
DataRow[] dv = ds.Tables[0].Select("元件编码 <>'' and 类型 <>''");
//导入数据库
if (dv.Length > 0)
{
@ -137,20 +137,20 @@ namespace FineUIPro.Web.HJGL.BaseInfo
HJGL_MaterialCodeLib item = new HJGL_MaterialCodeLib();
#region
if (dv[i]["采购码"] != null && !string.IsNullOrEmpty(dv[i]["采购码"].ToString()))
if (dv[i]["元件编码"] != null && !string.IsNullOrEmpty(dv[i]["元件编码"].ToString()))
{
item.MaterialCode = dv[i]["采购码"].ToString();
item.MaterialCode = dv[i]["元件编码"].ToString();
}
else
{
errorInfos += (i + 2) + "Line, [采购码] 不能为空</br>";
errorInfos += (i + 2) + "Line, [元件编码] 不能为空</br>";
}
item.MaterialDef = dv[i]["材料描述"].ToString();
item.MaterialSpec = dv[i]["规格"].ToString();
item.MaterialMade = dv[i]["材质"].ToString();
// item.MaterialMade = dv[i]["材质"].ToString();
item.MaterialUnit = dv[i]["单位"].ToString();
item.MaterialName = dv[i]["元件类型"].ToString();
item.PipeGrade = dv[i]["管道等级"].ToString();
item.MaterialName = dv[i]["类型"].ToString();
//item.PipeGrade = dv[i]["管道等级"].ToString();
//item.ProjectId = CurrUser.LoginProjectId;
//= SQLHelper.GetNewID(typeof(Model.Editor_CostReport));
if (!codeLib.Select(x => x.MaterialCode).Contains(item.MaterialCode))

View File

@ -116,12 +116,12 @@
FieldType="String" HeaderText="规格" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialMade" DataField="MaterialMade" SortField="MaterialMade"
<%--<f:RenderField Width="150px" ColumnID="MaterialMade" DataField="MaterialMade" SortField="MaterialMade"
FieldType="String" HeaderText="材质" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
</f:RenderField>--%>
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="材料类型" HeaderTextAlign="Center"
FieldType="String" HeaderText="类型" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Number" DataField="Number" SortField="Number"
@ -162,12 +162,12 @@
FieldType="String" HeaderText="规格" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialMade" DataField="MaterialMade" SortField="MaterialMade"
<%-- <f:RenderField Width="150px" ColumnID="MaterialMade" DataField="MaterialMade" SortField="MaterialMade"
FieldType="String" HeaderText="材质" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
</f:RenderField>--%>
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="材料类型" HeaderTextAlign="Center"
FieldType="String" HeaderText="类型" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Number" DataField="Number" SortField="Number"

View File

@ -107,12 +107,12 @@
FieldType="String" HeaderText="单位" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialMade" DataField="MaterialMade" SortField="MaterialMade"
FieldType="String" HeaderText="材" HeaderTextAlign="Center"
<f:RenderField Width="150px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="材料类型" HeaderTextAlign="Center"
FieldType="String" HeaderText="类型" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>

View File

@ -46,7 +46,7 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement
PHTGL_BidApproveUserReviewService.InitGetBidCompleteDropDownList(DropBidCode, true);
Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.DropConstructionManager, null, Const.UnitId_SEDIN, null, true);
Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.DropProjectManager, null, Const.UnitId_SEDIN, null, true);
BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(DropApproval_Construction, CurrUser.UnitId, Const.ConstructionMinister, Const.ConstructionViceMinister, false);
BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(DropApproval_Construction, null, CurrUser.UnitId, Const.ConstructionMinister + "," + Const.ConstructionViceMinister, false);
BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(DropDeputyGeneralManager, null, this.CurrUser.UnitId, Const.DeputyGeneralManager, false);
if (PHTGL_ActionPlanReviewService.IsSpecialProject(this.CurrUser.LoginProjectId))
{

View File

@ -12,14 +12,14 @@
text-align: center;
min-width: 0.75rem;
margin-right: 0.02083rem;
font-size: revert;
font-size: smaller;
color: #6ceff1;
}
.real-time-echarts02 {
text-align: center;
min-width: 0.75rem;
margin-right: 0.02083rem;
font-size: revert;
font-size: smaller;
color: rgb(6 247 192 / 85%);
}
.real-time-echarts02-unit {

View File

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class HJGLIndexItem
{
/// <summary>
/// 工厂焊接一次合格率
/// </summary>
public string GCFirstPassRate { get; set; }
/// <summary>
/// 现场焊接一次合格率
/// </summary>
public string XCFirstPassRate { get; set; }
/// <summary>
/// 工厂预制进度
/// </summary>
public string GCProgress { get; set; }
/// <summary>
/// 现场预制进度
/// </summary>
public string XCProgress { get; set; }
/// <summary>
/// 工厂焊工功效
/// </summary>
public string GCWelderEfficacy { get; set; }
/// <summary>
/// 现场焊工功效
/// </summary>
public string XCWelderEfficacy { get; set; }
/// <summary>
/// 管道实时预制率
/// </summary>
public string PipePrefabricationRate { get; set; }
}
}

View File

@ -14,6 +14,8 @@ namespace Model
public string ContactName { get; set; }
public string ContactPhone { get; set; }
public string StackingPosition { get; set; }
public int? State { get; set; }
}
public class PackagingPrepipeItem

View File

@ -63,6 +63,7 @@
<Compile Include="APIItem\DigData\SafeLawItem.cs" />
<Compile Include="APIItem\HJGL\AttachSourceItems.cs" />
<Compile Include="APIItem\HJGL\BatchItem.cs" />
<Compile Include="APIItem\HJGL\HJGLIndexItem.cs" />
<Compile Include="APIItem\HJGL\ItemEndCheck.cs" />
<Compile Include="APIItem\HJGL\ItemEndCheckList.cs" />
<Compile Include="APIItem\HJGL\JointCompreInfoItem.cs" />

View File

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
namespace WebAPI.Controllers
{
/// <summary>
///
/// </summary>
public class HJGLIndexController : ApiController
{
/// <summary>
/// 获取首页数据分析
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public Model.ResponeData GetJGLIndexItem(string projectId)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = BLL.APIHJGLIndexService.GetJGLIndexItem(projectId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
}
}

View File

@ -13,12 +13,12 @@ namespace WebAPI.Controllers
/// </summary>
public class PackagingManageController : ApiController
{
public Model.ResponeData GetPackagingInformationList(string projectid)
public Model.ResponeData GetPackagingInformationList(string projectid, int pagesize, int pageindex)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = BLL.APIPackagingManageService.GetPackagingManageList(projectid);
responeData.data = BLL.APIPackagingManageService.GetPackagingManageList(projectid, pagesize,pageindex);
}
catch (Exception ex)
{

View File

@ -169,6 +169,7 @@
<Compile Include="Controllers\CommonController.cs" />
<Compile Include="Controllers\CQMS\CQMSPersonManageController.cs" />
<Compile Include="Controllers\CQMS\WBSController.cs" />
<Compile Include="Controllers\HJGL\HJGLIndexController.cs" />
<Compile Include="Controllers\HJGL\PackagingManageController.cs" />
<Compile Include="Controllers\HTGL\HTGLPersonController.cs" />
<Compile Include="Controllers\Person\PersonCheckController.cs" />
@ -293,6 +294,7 @@
<Folder Include="Images\" />
<Folder Include="Models\" />
<Folder Include="Views\CQMSPersonManage\" />
<Folder Include="Views\HJGLIndex\" />
<Folder Include="Views\Login\" />
</ItemGroup>
<ItemGroup>