代码无效引用清理,试压包资料界面看板修改
This commit is contained in:
@@ -1,43 +1,40 @@
|
||||
using System;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class APIPackagingManageService
|
||||
public class APIPackagingManageService
|
||||
{
|
||||
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 n in db.Base_Project on x.ProjectId equals n.ProjectId
|
||||
join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt
|
||||
from t in tt.DefaultIfEmpty()
|
||||
where x.ProjectId == projectId
|
||||
select new PackagingManageDetailItem
|
||||
{
|
||||
PackagingManageId = x.PackagingManageId,
|
||||
PackagingCode = x.PackagingCode,
|
||||
ProjectName = n.ProjectName,
|
||||
ContactName = x.ContactName,
|
||||
ContactPhone = x.ContactPhone,
|
||||
StackingPosition = x.StackingPosition,
|
||||
State= x.State,
|
||||
ReceiveMan=t.PersonName,
|
||||
ReceiveDate = string.Format("{0:g}", x.ReceiveDate),
|
||||
TrainNumber=x.TrainNumber,
|
||||
}).Distinct();
|
||||
join n in db.Base_Project on x.ProjectId equals n.ProjectId
|
||||
join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt
|
||||
from t in tt.DefaultIfEmpty()
|
||||
where x.ProjectId == projectId
|
||||
select new PackagingManageDetailItem
|
||||
{
|
||||
PackagingManageId = x.PackagingManageId,
|
||||
PackagingCode = x.PackagingCode,
|
||||
ProjectName = n.ProjectName,
|
||||
ContactName = x.ContactName,
|
||||
ContactPhone = x.ContactPhone,
|
||||
StackingPosition = x.StackingPosition,
|
||||
State = x.State,
|
||||
ReceiveMan = t.PersonName,
|
||||
ReceiveDate = string.Format("{0:g}", x.ReceiveDate),
|
||||
TrainNumber = x.TrainNumber,
|
||||
}).Distinct();
|
||||
return q.ToList();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static Model.PackagingManageItem GetPackagingInformationById(string projectId,string personId, string packagingManageId)
|
||||
public static Model.PackagingManageItem GetPackagingInformationById(string projectId, string personId, string packagingManageId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
@@ -54,41 +51,41 @@ namespace BLL
|
||||
PackagingManageId = x.PackagingManageId,
|
||||
PackagingCode = x.PackagingCode,
|
||||
ProjectName = n.ProjectName,
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectId = x.ProjectId,
|
||||
ContactName = x.ContactName,
|
||||
ContactPhone = x.ContactPhone,
|
||||
StackingPosition = x.StackingPosition,
|
||||
State =x.State,
|
||||
State = x.State,
|
||||
ReceiveMan = t.PersonName,
|
||||
ReceiveDate = string.Format("{0:g}", x.ReceiveDate),
|
||||
TrainNumber = x.TrainNumber,
|
||||
}).FirstOrDefault();
|
||||
var tb_packing = (from x in db.HJGL_PackagingManage where x.PackagingManageId==packagingManageId select x ).FirstOrDefault() ;
|
||||
var tb_packing = (from x in db.HJGL_PackagingManage where x.PackagingManageId == packagingManageId select x).FirstOrDefault();
|
||||
var PipelineComponentIdList = tb_packing?.PipelineComponentId?.Split(',');
|
||||
if (PipelineComponentIdList != null && PipelineComponentIdList.Count() > 0)
|
||||
{
|
||||
packagingPrepipeItem = (from x in db.HJGL_Pipeline_Component
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
|
||||
join z in db.WBS_UnitWork on y.UnitWorkId equals z.UnitWorkId
|
||||
where PipelineComponentIdList.Contains(x.PipelineComponentId)
|
||||
select new PackagingPrepipeItem
|
||||
{
|
||||
PipelineComponentId = x.PipelineComponentId,
|
||||
PipelineComponentCode = x.PipelineComponentCode,
|
||||
PreUnit = "1/个",
|
||||
UnitWorkName = z.UnitWorkName,
|
||||
PlanStartDate = string.Format("{0:g}", y.PlanStartDate),
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
|
||||
join z in db.WBS_UnitWork on y.UnitWorkId equals z.UnitWorkId
|
||||
where PipelineComponentIdList.Contains(x.PipelineComponentId)
|
||||
select new PackagingPrepipeItem
|
||||
{
|
||||
PipelineComponentId = x.PipelineComponentId,
|
||||
PipelineComponentCode = x.PipelineComponentCode,
|
||||
PreUnit = "1/个",
|
||||
UnitWorkName = z.UnitWorkName,
|
||||
PlanStartDate = string.Format("{0:g}", y.PlanStartDate),
|
||||
|
||||
}).ToList();
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
|
||||
bool isPower = Person_PersonsService.IsGeneralUnitByPersonId(personId, projectId);
|
||||
if (!isPower)
|
||||
{
|
||||
var roleList= Person_PersonsService.GetRoleListByProjectIdPersonId(projectId, personId);
|
||||
var roleList = Person_PersonsService.GetRoleListByProjectIdPersonId(projectId, personId);
|
||||
if (roleList.Contains(Const.CQEngineer))
|
||||
{
|
||||
isPower=true;
|
||||
isPower = true;
|
||||
}
|
||||
}
|
||||
packagingManageItem.packagingManageDetailItem = q;
|
||||
@@ -99,10 +96,10 @@ namespace BLL
|
||||
}
|
||||
|
||||
}
|
||||
public static void GetPackingInfoConfirmArrival(string packagingManageId,string PersonId)
|
||||
public static void GetPackingInfoConfirmArrival(string packagingManageId, string PersonId)
|
||||
{
|
||||
var q= BLL.HJGLPackagingmanageService.GetHJGL_PackagingManageById(packagingManageId);
|
||||
if (q!=null)
|
||||
var q = BLL.HJGLPackagingmanageService.GetHJGL_PackagingManageById(packagingManageId);
|
||||
if (q != null)
|
||||
{
|
||||
q.State = HJGLPackagingmanageService.state_2;
|
||||
q.ReceiveMan = PersonId;
|
||||
@@ -152,7 +149,7 @@ namespace BLL
|
||||
PackagingManageId = table.PackagingManageId,
|
||||
PipelineId = ComponentModel.PipelineId,
|
||||
PipelineComponentId = item,
|
||||
CreateTime = DateTime.Now,
|
||||
CreateTime = DateTime.Now,
|
||||
};
|
||||
newDetailList.Add(model);
|
||||
}
|
||||
@@ -160,7 +157,44 @@ namespace BLL
|
||||
HJGLPackagingmanagedetailService.DeleteByPackagingManageId(table.PackagingManageId);
|
||||
HJGLPackagingmanagedetailService.AddBulk(newDetailList);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 新增或更新包装信息(Id为空则新增,否则更新),返回创建或更新后的Id。
|
||||
/// </summary>
|
||||
public static string AddOrUpdatePackaging(Model.HJGL_PackagingManage model)
|
||||
{
|
||||
if (model == null)
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
|
||||
if (string.IsNullOrEmpty(model.PackagingManageId))
|
||||
{
|
||||
// 新增
|
||||
model.PackagingManageId = SQLHelper.GetNewID(typeof(Model.HJGL_PackagingManage));
|
||||
HJGLPackagingmanageService.AddHJGL_PackagingManage(model);
|
||||
return model.PackagingManageId;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 修改
|
||||
var exist = HJGLPackagingmanageService.GetHJGL_PackagingManageById(model.PackagingManageId);
|
||||
if (exist == null)
|
||||
{
|
||||
HJGLPackagingmanageService.AddHJGL_PackagingManage(model);
|
||||
return model.PackagingManageId;
|
||||
}
|
||||
else
|
||||
{
|
||||
HJGLPackagingmanageService.UpdateHJGL_PackagingManage(model);
|
||||
return model.PackagingManageId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static string GetNewPackagingCode(string projectId)
|
||||
{
|
||||
return HJGLPackagingmanageService.GetNewPackagingCode(projectId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user