2022-10-11 焊接修改及接口新增

This commit is contained in:
2022-10-11 17:12:13 +08:00
parent e4052c419f
commit 6b0db8cd74
15 changed files with 1209 additions and 27 deletions
@@ -10,14 +10,11 @@ namespace BLL
{
public class APIPackagingManageService
{
public static List<Model.PackagingManageDetailItem> GetPackagingManageList(string projectId,int pagesize,int pageindex)
public static List<Model.PackagingManageDetailItem> GetPackagingManageList(string projectId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q = (from x in db.HJGL_PackagingManage
//join y in db.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId
// join z in db.HJGL_Pipeline on tt.PipelineId equals z.PipelineId
//join m in db.WBS_UnitWork on z.UnitWorkId equals m.UnitId
join n in db.Base_Project on x.ProjectId equals n.ProjectId
where x.ProjectId == projectId
select new PackagingManageDetailItem
@@ -30,24 +27,25 @@ namespace BLL
StackingPosition = x.StackingPosition,
State= x.State,
}).Distinct();
return q.Take(pagesize*pageindex).Skip(pageindex).ToList();
return q.ToList();
}
}
public static Model.PackagingManageItem GetPackagingInformationById(string projectId, string packagingManageId)
public static Model.PackagingManageItem GetPackagingInformationById(string projectId,string personId, string packagingManageId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
PackagingManageItem packagingManageItem = new PackagingManageItem();
var q = (from x in db.HJGL_PackagingManage
join n in db.Base_Project on x.ProjectId equals n.ProjectId
where x.ProjectId == projectId && x.PackagingManageId == packagingManageId
where x.PackagingManageId == packagingManageId
select new PackagingManageDetailItem
{
PackagingManageId = x.PackagingManageId,
PackagingCode = x.PackagingCode,
ProjectName = n.ProjectName,
ProjectId = x.ProjectId,
ContactName = x.ContactName,
ContactPhone = x.ContactPhone,
StackingPosition = x.StackingPosition,
@@ -67,8 +65,10 @@ namespace BLL
PlanStartDate=y.PlanStartDate
}).ToList();
bool isPower = Person_PersonsService.IsGeneralUnitByPersonId(personId, projectId);
packagingManageItem.packagingManageDetailItem = q;
packagingManageItem.packagingPrepipeItems = packagingPrepipeItem;
packagingManageItem.isPower = isPower;
return packagingManageItem;
}
@@ -1,12 +1,77 @@
using System;
using NPOI.OpenXmlFormats.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
namespace BLL
{
public class APIPipelineComponentService
{
public static List<PipelineComponentItem> GetPackagingManageList(string projectid)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q = (from x in db.HJGL_Pipeline_Component
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Unit on x.PreUnit equals z.UnitId into tt
from t in tt.DefaultIfEmpty()
where y.ProjectId == projectid
select new PipelineComponentItem
{
PipelineComponentId = x.PipelineComponentId,
PipelineComponentCode = x.PipelineComponentCode,
PreUnit = t.UnitName,
DrawingName = x.DrawingName,
BoxNumber = x.BoxNumber,
State = x.State,
PlanStartDate = y.PlanStartDate,
QRCode = x.QRCode,
}).Distinct();
return q.ToList();
}
}
public static PipelineComponentDetail GetPipelineComponentById(string projectId, string personId, string PipelineComponentId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
PipelineComponentDetail pipelineComponentDetail = new PipelineComponentDetail();
var q = (from x in db.HJGL_Pipeline_Component
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Unit on x.PreUnit equals z.UnitId into tt
from t in tt.DefaultIfEmpty()
where x.PipelineComponentId== PipelineComponentId
select new PipelineComponentItem
{
PipelineComponentId = x.PipelineComponentId,
PipelineComponentCode = x.PipelineComponentCode,
PreUnit = t.UnitName,
DrawingName = x.DrawingName,
BoxNumber = x.BoxNumber,
State = x.State,
PlanStartDate = y.PlanStartDate,
QRCode = x.QRCode,
}).FirstOrDefault();
bool isPower = Person_PersonsService.IsGeneralUnitByPersonId(personId, projectId);
pipelineComponentDetail.pipelineComponentItem = q;
pipelineComponentDetail.isPower=isPower;
return pipelineComponentDetail;
}
}
public static void GetComponentConfirmArrival(string PipelineComponentId)
{
var q = BLL.HJGL_PipelineComponentService.GetPipelineComponentById(PipelineComponentId);
if (q != null)
{
q.State = HJGL_PipelineComponentService.state_1;
HJGL_PipelineComponentService.UpdatePipelineComponent(q);
}
}
}
}
@@ -93,6 +93,7 @@ namespace BLL
{
model.PipelineId = PipelineId;
model.PipelineComponentCode = model_mat.PrefabricatedComponents;
model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-'));
model.State = state_0;
UpdatePipelineComponent(model);
}
@@ -102,6 +103,7 @@ namespace BLL
model.PipelineComponentId = SQLHelper.GetNewID();
model.PipelineId = PipelineId;
model.PipelineComponentCode = model_mat.PrefabricatedComponents;
model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-'));
model.State = state_0;
AddPipelineComponent(model);
}
+26
View File
@@ -192,6 +192,32 @@ namespace BLL
}
#endregion
/// <summary>
/// 根据主键,项目id判断当前人单位是否是总包单位
/// </summary>
/// <param name="PersonId"></param>
/// <param name="ProjectId"></param>
/// <returns></returns>
public static bool IsGeneralUnitByPersonId(string PersonId,string ProjectId)
{
bool result = false;
var PersonEntity = GetPerson_PersonsById(PersonId);
if (PersonEntity!=null)
{
var pUnit = Funs.DB.Project_ProjectUnit.FirstOrDefault(e => e.ProjectId == ProjectId && e.UnitId == PersonEntity.UnitId);
if (pUnit != null)
{
if (pUnit.UnitType == Const.ProjectUnitType_1 )
{
result = true;
}
}
}
return result;
}
#region
/// <summary>
/// 根据身份证号码获取人员信息