1
This commit is contained in:
@@ -95,13 +95,13 @@ namespace BLL
|
||||
}
|
||||
public static void GetPackingInfoConfirmArrival(string packagingManageId,string PersonId)
|
||||
{
|
||||
var q= BLL.HJGL_PackagingmanageService.GetHJGL_PackagingManageById(packagingManageId);
|
||||
var q= BLL.HJGLPackagingmanageService.GetHJGL_PackagingManageById(packagingManageId);
|
||||
if (q!=null)
|
||||
{
|
||||
q.State = HJGL_PackagingmanageService.state_2;
|
||||
q.State = HJGLPackagingmanageService.state_2;
|
||||
q.ReceiveMan = PersonId;
|
||||
q.ReceiveDate = DateTime.Now;
|
||||
HJGL_PackagingmanageService.UpdateHJGL_PackagingManage(q);
|
||||
HJGLPackagingmanageService.UpdateHJGL_PackagingManage(q);
|
||||
}
|
||||
}
|
||||
public static void getSavePackagingInformationById(string packagingManageId, string PipelineComponentIds)
|
||||
@@ -133,7 +133,7 @@ namespace BLL
|
||||
|
||||
}
|
||||
}
|
||||
BLL.HJGL_PackagingmanageService.UpdateHJGL_PackagingManage(table);
|
||||
BLL.HJGLPackagingmanageService.UpdateHJGL_PackagingManage(table);
|
||||
var newDetailList = new List<Model.HJGL_PackagingManageDetail>();
|
||||
foreach (var item in table.PipelineComponentId.Split(','))
|
||||
{
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class APITrainNumberManagerService
|
||||
{
|
||||
/// <summary>
|
||||
/// 车次发货验收
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="PersonId"></param>
|
||||
public static void SaveTrainInfoConfirmArrival(string id, string PersonId)
|
||||
{
|
||||
var model=TrainNumberManageService.GetModelById(id);
|
||||
if (model!=null)
|
||||
{
|
||||
model.ReceiveDate = DateTime.Now;
|
||||
TrainNumberManageService.Update(model);
|
||||
}
|
||||
var packManagerList= HJGLPackagingmanageService.GetPackagingManage(id);
|
||||
foreach (var item in packManagerList)
|
||||
{
|
||||
BLL.APIPackagingManageService.GetPackingInfoConfirmArrival(item.PackagingManageId, PersonId);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定车次的包装明细(包装表)
|
||||
/// </summary>
|
||||
public static List<Model.HJGL_PackagingManage> GetPackagingByTrainId(string trainNumberId)
|
||||
{
|
||||
return HJGLPackagingmanageService.GetPackagingManage(trainNumberId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将包装关联到车次(设置 HJGL_PackagingManage.TrainNumberId)
|
||||
/// </summary>
|
||||
public static void AddPackagingToTrain(string packagingManageId, string trainNumberId)
|
||||
{
|
||||
var packModel = HJGLPackagingmanageService.GetHJGL_PackagingManageById(packagingManageId);
|
||||
if (packModel == null)
|
||||
{
|
||||
throw new Exception("未找到对应的包装信息");
|
||||
}
|
||||
// 仅允许状态为未出库(state_0)时修改车次号,保持与前端逻辑一致
|
||||
if (packModel.State != HJGLPackagingmanageService.state_0)
|
||||
{
|
||||
throw new Exception("当前包装状态不可修改车次号");
|
||||
}
|
||||
packModel.TrainNumberId = trainNumberId;
|
||||
HJGLPackagingmanageService.UpdateHJGL_PackagingManage(packModel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取消包装与车次的关联(清空 HJGL_PackagingManage.TrainNumberId)
|
||||
/// </summary>
|
||||
public static void RemovePackagingFromTrain(string packagingManageId)
|
||||
{
|
||||
var packModel = HJGLPackagingmanageService.GetHJGL_PackagingManageById(packagingManageId);
|
||||
if (packModel == null)
|
||||
{
|
||||
throw new Exception("未找到对应的包装信息");
|
||||
}
|
||||
if (packModel.State != HJGLPackagingmanageService.state_0)
|
||||
{
|
||||
throw new Exception("当前包装状态不可修改车次号");
|
||||
}
|
||||
packModel.TrainNumberId = null;
|
||||
packModel.TrainNumber = null;
|
||||
HJGLPackagingmanageService.UpdateHJGL_PackagingManage(packModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,6 +207,7 @@
|
||||
<Compile Include="API\HJGL\APIPreWeldingDailyService.cs" />
|
||||
<Compile Include="API\HJGL\APIReportQueryService.cs" />
|
||||
<Compile Include="API\HJGL\APITestPackageService.cs" />
|
||||
<Compile Include="API\HJGL\APITrainNumberManagerService.cs" />
|
||||
<Compile Include="API\HSSE\APIPageDataService.cs" />
|
||||
<Compile Include="API\HSSE\APIChartAnalysisService.cs" />
|
||||
<Compile Include="API\HSSE\APICheckSpecialService.cs" />
|
||||
@@ -276,6 +277,7 @@
|
||||
<Compile Include="BaseInfo\UnitTypeService.cs" />
|
||||
<Compile Include="BaseInfo\WorkPostService.cs" />
|
||||
<Compile Include="BaseInfo\WorkStageService.cs" />
|
||||
<Compile Include="HJGL\BaseInfo\Base_MaterialColorService.cs" />
|
||||
<Compile Include="CLGL\TwArrivalStatisticsService.cs" />
|
||||
<Compile Include="CLGL\TwConst.cs" />
|
||||
<Compile Include="CLGL\TwInOutplandetailRelationService.cs" />
|
||||
|
||||
@@ -37,11 +37,14 @@ namespace BLL
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.OutputMasterId) || x.OutputMasterId.Contains(table.OutputMasterId)) &&
|
||||
(string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) &&
|
||||
(string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode))
|
||||
(string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode))&&
|
||||
(table.TypeInt ==null || master.TypeInt==table.TypeInt)
|
||||
select new Model.Tw_InOutDetailOutput
|
||||
{
|
||||
Id = x.Id,
|
||||
OutputMasterId = x.OutputMasterId,
|
||||
CusBillCode=master.CusBillCode,
|
||||
TypeInt=master.TypeInt,
|
||||
PipelineComponentId = x.PipelineComponentId,
|
||||
MaterialCode = x.MaterialCode,
|
||||
PlanNum = x.PlanNum,
|
||||
|
||||
@@ -122,6 +122,7 @@ namespace BLL
|
||||
CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key,
|
||||
WeldTaskId = x.WeldTaskId,
|
||||
WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == DateTime.ParseExact(x.WeldTaskId.Split('|')[2].ToString(), "yyyyMMdd", null).Date)?.TaskCode : "" : "",
|
||||
UnitWorkId= x.WeldTaskId != null? x.WeldTaskId.Split('|')[0].ToString():null,
|
||||
AuditMan = x.AuditMan,
|
||||
AuditManName = x.AuditManName,
|
||||
AuditDate = x.AuditDate,
|
||||
@@ -141,7 +142,7 @@ namespace BLL
|
||||
Count = q.Count();
|
||||
if (Count == 0)
|
||||
{
|
||||
return null;
|
||||
return new List<Tw_InOutMasterOutput>();
|
||||
}
|
||||
var result = q.ToList();
|
||||
return (from x in result
|
||||
@@ -166,6 +167,7 @@ namespace BLL
|
||||
CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key,
|
||||
WeldTaskId = x.WeldTaskId,
|
||||
WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == DateTime.ParseExact(x.WeldTaskId.Split('|')[2].ToString(), "yyyyMMdd", null).Date)?.TaskCode : "" : "",
|
||||
UnitWorkId = x.WeldTaskId != null ? x.WeldTaskId.Split('|')[0].ToString() : null,
|
||||
AuditMan = x.AuditMan,
|
||||
AuditManName = x.AuditManName,
|
||||
AuditDate = x.AuditDate,
|
||||
|
||||
@@ -5241,5 +5241,8 @@ namespace BLL
|
||||
/// 质量隐患
|
||||
/// </summary>
|
||||
public const string CQMSRectifyMenuId = "D72BB321-11A8-485B-BAC7-367C7FCA7FBA";
|
||||
|
||||
|
||||
public const string BaseMaterialcolorMenuId = "F6194C00-D256-485D-9056-171FAB75928A";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class BaseMaterialcolorService
|
||||
{
|
||||
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int Count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
private static IQueryable<Model.Base_MaterialColor> GetByQueryModle(Model.Base_MaterialColor table)
|
||||
{
|
||||
var q = from x in Funs.DB.Base_MaterialColor select x;
|
||||
if (table == null)
|
||||
{
|
||||
return q;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(table.MaterialColorId))
|
||||
{
|
||||
q = q.Where(x => x.MaterialColorId.Contains(table.MaterialColorId));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(table.UnitId))
|
||||
{
|
||||
q = q.Where(x => x.UnitId.Contains(table.UnitId));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(table.MaterialId))
|
||||
{
|
||||
q = q.Where(x => x.MaterialId.Contains(table.MaterialId));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(table.ColorName))
|
||||
{
|
||||
q = q.Where(x => x.ColorName.Contains(table.ColorName));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(table.ColorCardNo))
|
||||
{
|
||||
q = q.Where(x => x.ColorCardNo.Contains(table.ColorCardNo));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(table.RGB))
|
||||
{
|
||||
q = q.Where(x => x.RGB.Contains(table.RGB));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(table.Remark))
|
||||
{
|
||||
q = q.Where(x => x.Remark.Contains(table.Remark));
|
||||
}
|
||||
;
|
||||
|
||||
return q;
|
||||
}
|
||||
public static List<Model.Base_MaterialColor> GetListByQueryModle(Model.Base_MaterialColor table)
|
||||
{
|
||||
return GetByQueryModle(table).ToList();
|
||||
|
||||
}
|
||||
public static (List<Model.Base_MaterialColor> Data, int Total) GetListByQueryModle(Model.Base_MaterialColor table, int pageIndex = 0, int pageSize = 20)
|
||||
{
|
||||
var baseQuery = GetByQueryModle(table);
|
||||
var pagedData = baseQuery
|
||||
.Skip((pageIndex) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
|
||||
// 获取总记录数(延迟计数优化)
|
||||
var totalCount = baseQuery.Count();
|
||||
|
||||
return (pagedData, totalCount);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="table"></param>
|
||||
/// <param name="grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable GetListData(Model.Base_MaterialColor table, Grid grid1)
|
||||
{
|
||||
var q = GetByQueryModle(table);
|
||||
Count = q.Count();
|
||||
if (Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize);
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.MaterialColorId,
|
||||
x.UnitId,
|
||||
x.MaterialId,
|
||||
x.ColorName,
|
||||
x.ColorCardNo,
|
||||
x.RGB,
|
||||
x.Remark,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Base_MaterialColor GetModelById(string MaterialColorId)
|
||||
{
|
||||
return Funs.DB.Base_MaterialColor.FirstOrDefault(x => x.MaterialColorId == MaterialColorId);
|
||||
}
|
||||
|
||||
|
||||
public static void Add(Model.Base_MaterialColor newtable)
|
||||
{
|
||||
|
||||
Model.Base_MaterialColor table = new Model.Base_MaterialColor
|
||||
{
|
||||
MaterialColorId = newtable.MaterialColorId,
|
||||
UnitId = newtable.UnitId,
|
||||
MaterialId = newtable.MaterialId,
|
||||
ColorName = newtable.ColorName,
|
||||
ColorCardNo = newtable.ColorCardNo,
|
||||
RGB = newtable.RGB,
|
||||
Remark = newtable.Remark,
|
||||
};
|
||||
Funs.DB.Base_MaterialColor.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void Update(Model.Base_MaterialColor newtable)
|
||||
{
|
||||
|
||||
Model.Base_MaterialColor table = Funs.DB.Base_MaterialColor.FirstOrDefault(x => x.MaterialColorId == newtable.MaterialColorId);
|
||||
if (table != null)
|
||||
{
|
||||
table.MaterialColorId = newtable.MaterialColorId;
|
||||
table.UnitId = newtable.UnitId;
|
||||
table.MaterialId = newtable.MaterialId;
|
||||
table.ColorName = newtable.ColorName;
|
||||
table.ColorCardNo = newtable.ColorCardNo;
|
||||
table.RGB = newtable.RGB;
|
||||
table.Remark = newtable.Remark;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteById(string MaterialColorId)
|
||||
{
|
||||
|
||||
Model.Base_MaterialColor table = Funs.DB.Base_MaterialColor.FirstOrDefault(x => x.MaterialColorId == MaterialColorId);
|
||||
if (table != null)
|
||||
{
|
||||
Funs.DB.Base_MaterialColor.DeleteOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,58 @@ namespace BLL
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.HJGL_PackagingManageDetail> GetListByQueryModle(Model.HJGL_PackagingManageDetail table)
|
||||
{
|
||||
return GetByQueryModle(table).ToList();
|
||||
|
||||
}
|
||||
|
||||
public static (List<Model.HJGL_PackagingManageDetail> Data, int Total) GetListByQueryModle(Model.HJGL_PackagingManageDetail table, int pageIndex = 0, int pageSize = 20)
|
||||
{
|
||||
var baseQuery = GetByQueryModle(table);
|
||||
var pagedData = baseQuery
|
||||
.Skip((pageIndex) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
|
||||
// 获取总记录数(延迟计数优化)
|
||||
var totalCount = baseQuery.Count();
|
||||
|
||||
return (pagedData, totalCount);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="table"></param>
|
||||
/// <param name="grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable GetListData(Model.HJGL_PackagingManageDetail table, Grid grid1)
|
||||
{
|
||||
var q = GetByQueryModle(table);
|
||||
Count = q.Count();
|
||||
if (Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize);
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.PackagingManageId,
|
||||
x.PipelineId,
|
||||
x.PipelineComponentId,
|
||||
x.MaterialCode,
|
||||
x.Number,
|
||||
x.CreateTime,
|
||||
x.CreateUser,
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
private static IQueryable<Model.HJGL_PackagingManageDetail> GetByQueryModle(Model.HJGL_PackagingManageDetail table)
|
||||
{
|
||||
var q = from x in Funs.DB.HJGL_PackagingManageDetail select x;
|
||||
@@ -64,128 +116,9 @@ namespace BLL
|
||||
|
||||
return q;
|
||||
}
|
||||
public static List<Model.HJGL_PackagingManageDetail> GetListByQueryModle(Model.HJGL_PackagingManageDetail table)
|
||||
{
|
||||
return GetByQueryModle(table).ToList();
|
||||
|
||||
}
|
||||
public static (List<Model.HJGL_PackagingManageDetail> Data, int Total) GetListByQueryModle(Model.HJGL_PackagingManageDetail table, int pageIndex = 0, int pageSize = 20)
|
||||
{
|
||||
var baseQuery = GetByQueryModle(table);
|
||||
var pagedData = baseQuery
|
||||
.Skip((pageIndex) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
|
||||
// 获取总记录数(延迟计数优化)
|
||||
var totalCount = baseQuery.Count();
|
||||
|
||||
return (pagedData, totalCount);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="table"></param>
|
||||
/// <param name="grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable GetListData(Model.HJGL_PackagingManageDetail table, Grid grid1)
|
||||
{
|
||||
var q = GetByQueryModle(table);
|
||||
Count = q.Count();
|
||||
if (Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize);
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.PackagingManageId,
|
||||
x.PipelineId,
|
||||
x.PipelineComponentId,
|
||||
x.MaterialCode,
|
||||
x.Number,
|
||||
x.CreateTime,
|
||||
x.CreateUser,
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static Model.HJGL_PackagingManageDetail GetModelById(string Id)
|
||||
{
|
||||
return Funs.DB.HJGL_PackagingManageDetail.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
public static IEnumerable<Model.PipelinePrefabricatedComponentsItem> GetPackagingData(string PackagingManageId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(PackagingManageId))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var pack = HJGL_PackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
|
||||
if (pack == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var result = new List<Model.PipelinePrefabricatedComponentsItem>();
|
||||
if (pack.TypeInt == (int)HJGL_PackagingmanageService.TypeInt.预制散件)
|
||||
{
|
||||
var q = from detail in Funs.DB.HJGL_PackagingManageDetail
|
||||
join lib in Funs.DB.HJGL_MaterialCodeLib on detail.MaterialCode equals lib.MaterialCode into libJoin
|
||||
from libItem in libJoin.DefaultIfEmpty()
|
||||
join line in Funs.DB.HJGL_Pipeline on detail.PipelineId equals line.PipelineId into lineJoin
|
||||
from lineItem in lineJoin.DefaultIfEmpty()
|
||||
where detail.PackagingManageId == PackagingManageId /*&& (detail.PipelineId != null || detail.PipelineId != "") && (detail.PipelineComponentId == null || detail.PipelineComponentId == "")*/
|
||||
select new PipelinePrefabricatedComponentsItem
|
||||
{
|
||||
Id = detail.Id,
|
||||
MaterialCode = libItem.MaterialCode,
|
||||
MaterialName = libItem.MaterialName,
|
||||
MaterialUnit = libItem.MaterialUnit,
|
||||
MaterialSpec = libItem.MaterialSpec,
|
||||
MaterialMade = libItem.MaterialMade,
|
||||
MaterialDef = libItem.MaterialDef,
|
||||
Number = detail.Number,
|
||||
PipelineId = lineItem.PipelineId,
|
||||
PipelineCode = lineItem.PipelineCode,
|
||||
UnitWorkId = lineItem.UnitWorkId,
|
||||
FlowingSection = lineItem.FlowingSection,
|
||||
|
||||
};
|
||||
result= q.ToList();
|
||||
}
|
||||
else if(pack.TypeInt == (int)HJGL_PackagingmanageService.TypeInt.其他材料)
|
||||
{
|
||||
var q = from detail in Funs.DB.HJGL_PackagingManageDetail
|
||||
join lib in Funs.DB.HJGL_MaterialCodeLib on detail.MaterialCode equals lib.MaterialCode into libJoin
|
||||
from libItem in libJoin.DefaultIfEmpty()
|
||||
join line in Funs.DB.HJGL_Pipeline on detail.PipelineId equals line.PipelineId into lineJoin
|
||||
from lineItem in lineJoin.DefaultIfEmpty()
|
||||
where detail.PackagingManageId == PackagingManageId /*&& (detail.PipelineId == null || detail.PipelineId == "")*/
|
||||
select new PipelinePrefabricatedComponentsItem
|
||||
{
|
||||
Id = detail.Id,
|
||||
MaterialCode = libItem.MaterialCode,
|
||||
MaterialName = libItem.MaterialName,
|
||||
MaterialUnit = libItem.MaterialUnit,
|
||||
MaterialSpec = libItem.MaterialSpec,
|
||||
MaterialMade = libItem.MaterialMade,
|
||||
MaterialDef = libItem.MaterialDef,
|
||||
Number = detail.Number,
|
||||
PipelineId = lineItem.PipelineId,
|
||||
PipelineCode = lineItem.PipelineCode,
|
||||
FlowingSection = lineItem.FlowingSection,
|
||||
|
||||
};
|
||||
result = q.ToList();
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#region Methods
|
||||
|
||||
public static void Add(Model.HJGL_PackagingManageDetail newtable)
|
||||
{
|
||||
@@ -200,10 +133,84 @@ namespace BLL
|
||||
Number = newtable.Number,
|
||||
CreateTime = newtable.CreateTime,
|
||||
CreateUser = newtable.CreateUser,
|
||||
TwOutputDetailId = newtable.TwOutputDetailId,
|
||||
};
|
||||
Funs.DB.HJGL_PackagingManageDetail.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulk(List<Model.HJGL_PackagingManageDetail> newtables)
|
||||
{
|
||||
|
||||
Funs.DB.HJGL_PackagingManageDetail.InsertAllOnSubmit(newtables);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void DeleteById(string Id)
|
||||
{
|
||||
|
||||
Model.HJGL_PackagingManageDetail table = Funs.DB.HJGL_PackagingManageDetail.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
Funs.DB.HJGL_PackagingManageDetail.DeleteOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteByPackagingManageId(string packagingManageId)
|
||||
{
|
||||
|
||||
var list = Funs.DB.HJGL_PackagingManageDetail.Where(x => x.PackagingManageId == packagingManageId).ToList();
|
||||
if (list.Count > 0)
|
||||
{
|
||||
Funs.DB.HJGL_PackagingManageDetail.DeleteAllOnSubmit(list);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Model.HJGL_PackagingManageDetail GetModelById(string Id)
|
||||
{
|
||||
return Funs.DB.HJGL_PackagingManageDetail.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
public static IEnumerable<Model.PipelinePrefabricatedComponentsItem> GetPackagingData(string PackagingManageId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(PackagingManageId))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var pack = HJGLPackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
|
||||
if (pack == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var result = new List<Model.PipelinePrefabricatedComponentsItem>();
|
||||
var q = from tb in Funs.DB.HJGL_PackagingManageDetail
|
||||
join lib in Funs.DB.HJGL_MaterialCodeLib on tb.MaterialCode equals lib.MaterialCode into libJoin
|
||||
from libItem in libJoin.DefaultIfEmpty()
|
||||
join twOutDetail in Funs.DB.Tw_OutputDetail on tb.TwOutputDetailId equals twOutDetail.Id into twOutDetailJoin
|
||||
from twOutDetailItem in twOutDetailJoin.DefaultIfEmpty()
|
||||
join twOut in Funs.DB.Tw_OutputMaster on twOutDetailItem.OutputMasterId equals twOut.Id into twOutJoin
|
||||
from twOutItem in twOutJoin.DefaultIfEmpty()
|
||||
join twOutPlan in Funs.DB.Tw_InOutPlanMaster on twOutItem.InOutPlanMasterId equals twOutPlan.Id into twOutPlanJoin
|
||||
from twOutPlanItem in twOutPlanJoin.DefaultIfEmpty()
|
||||
where tb.PackagingManageId == PackagingManageId /*&& (detail.PipelineId != null || detail.PipelineId != "") && (detail.PipelineComponentId == null || detail.PipelineComponentId == "")*/
|
||||
select new PipelinePrefabricatedComponentsItem
|
||||
{
|
||||
Id = tb.Id,
|
||||
MaterialCode = libItem.MaterialCode,
|
||||
MaterialName = libItem.MaterialName,
|
||||
MaterialUnit = libItem.MaterialUnit,
|
||||
MaterialSpec = libItem.MaterialSpec,
|
||||
MaterialMade = libItem.MaterialMade,
|
||||
MaterialDef = libItem.MaterialDef,
|
||||
Number = tb.Number,
|
||||
CusBillCode = twOutItem.CusBillCode,
|
||||
};
|
||||
result = q.ToList();
|
||||
return result;
|
||||
}
|
||||
public static void Update(Model.HJGL_PackagingManageDetail newtable)
|
||||
{
|
||||
|
||||
@@ -218,38 +225,12 @@ namespace BLL
|
||||
table.Number = newtable.Number;
|
||||
table.CreateTime = newtable.CreateTime;
|
||||
table.CreateUser = newtable.CreateUser;
|
||||
table.TwOutputDetailId = newtable.TwOutputDetailId;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteById(string Id)
|
||||
{
|
||||
|
||||
Model.HJGL_PackagingManageDetail table = Funs.DB.HJGL_PackagingManageDetail.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
Funs.DB.HJGL_PackagingManageDetail.DeleteOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteByPackagingManageId(string packagingManageId)
|
||||
{
|
||||
|
||||
var list = Funs.DB.HJGL_PackagingManageDetail.Where(x => x.PackagingManageId == packagingManageId).ToList();
|
||||
if (list.Count>0)
|
||||
{
|
||||
Funs.DB.HJGL_PackagingManageDetail.DeleteAllOnSubmit(list);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void AddBulk(List<Model.HJGL_PackagingManageDetail> newtables)
|
||||
{
|
||||
|
||||
Funs.DB.HJGL_PackagingManageDetail.InsertAllOnSubmit(newtables);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
}
|
||||
}
|
||||
@@ -13,32 +13,9 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 包装管理服务类
|
||||
/// </summary>
|
||||
public static class HJGL_PackagingmanageService
|
||||
public static class HJGLPackagingmanageService
|
||||
{
|
||||
public class PackagingManageItem
|
||||
{
|
||||
public string PackagingManageId { get; set; }
|
||||
public string PackagingCode { get; set; }
|
||||
public string ProjectId { get; set; }
|
||||
public string ProjectName { get; set; }
|
||||
public string DriverName { get; set; }
|
||||
public string DriverPhone { get; set; }
|
||||
public string LicensePlateNumber { get; set; }
|
||||
public string ContactName { get; set; }
|
||||
public string ContactPhone { get; set; }
|
||||
public string StackingPosition { get; set; }
|
||||
public int? State { get; set; }
|
||||
public int? TypeInt { get; set; }
|
||||
public string TypeString { get; set; }
|
||||
|
||||
public string ReceiveMan { get; set; }
|
||||
public string ReceiveDate { get; set; }
|
||||
public string PlanStartDate { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
public string TrainNumber { get; set; }
|
||||
public string TrainNumberOld { get; set; }
|
||||
}
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// 未到场
|
||||
@@ -55,14 +32,16 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static int state_2 = 2;
|
||||
|
||||
public static ListItem[] GetState()
|
||||
public static Dictionary<string, int> TypeIntMap = new Dictionary<string, int>
|
||||
{
|
||||
ListItem[] list = new ListItem[3];
|
||||
list[0] = new ListItem("预出库", state_0.ToString());
|
||||
list[1] = new ListItem("已出库", state_1.ToString());
|
||||
list[2] = new ListItem("已到场", state_2.ToString());
|
||||
return list;
|
||||
}
|
||||
{ "预制组件" ,(int)TypeInt.预制组件},
|
||||
{ "预制散件" ,(int)TypeInt.预制散件},
|
||||
{ "其他材料" ,(int)TypeInt.其他材料},
|
||||
};
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Enums
|
||||
|
||||
public enum TypeInt : int
|
||||
{
|
||||
@@ -71,16 +50,49 @@ namespace BLL
|
||||
其他材料 = 30,
|
||||
}
|
||||
|
||||
public static Dictionary<string, int> TypeIntMap = new Dictionary<string, int>
|
||||
{
|
||||
{ "预制组件" ,(int)TypeInt.预制组件},
|
||||
{ "预制散件" ,(int)TypeInt.预制散件},
|
||||
{ "其他材料" ,(int)TypeInt.其他材料},
|
||||
};
|
||||
#endregion Enums
|
||||
|
||||
public static string GetTypeString(int? TypeInt)
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// 新增实体
|
||||
/// </summary>
|
||||
/// <param name="newtable"></param>
|
||||
public static void AddHJGL_PackagingManage(Model.HJGL_PackagingManage newtable)
|
||||
{
|
||||
return TypeIntMap.FirstOrDefault(c => c.Value == TypeInt).Key;
|
||||
Model.HJGL_PackagingManage table = new Model.HJGL_PackagingManage
|
||||
{
|
||||
PackagingManageId = newtable.PackagingManageId,
|
||||
PackagingCode = newtable.PackagingCode,
|
||||
ProjectId = newtable.ProjectId,
|
||||
PipelineComponentId = newtable.PipelineComponentId,
|
||||
StackingPosition = newtable.StackingPosition,
|
||||
State = newtable.State,
|
||||
ContactName = newtable.ContactName,
|
||||
ContactPhone = newtable.ContactPhone,
|
||||
Remark = newtable.Remark,
|
||||
ReceiveDate = newtable.ReceiveDate,
|
||||
ReceiveMan = newtable.ReceiveMan,
|
||||
TrainNumber = newtable.TrainNumber,
|
||||
TrainNumberId = newtable.TrainNumberId,
|
||||
TypeInt = newtable.TypeInt,
|
||||
CompileMan = newtable.CompileMan,
|
||||
CompileDate = newtable.CompileDate
|
||||
};
|
||||
var db1 = Funs.DB;
|
||||
db1.HJGL_PackagingManage.InsertOnSubmit(table);
|
||||
db1.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void DeleteHJGL_PackagingManageById(string PackagingManageId)
|
||||
{
|
||||
var db1 = Funs.DB;
|
||||
Model.HJGL_PackagingManage table = db1.HJGL_PackagingManage.FirstOrDefault(x => x.PackagingManageId == PackagingManageId);
|
||||
if (table != null)
|
||||
{
|
||||
db1.HJGL_PackagingManage.DeleteOnSubmit(table);
|
||||
db1.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static Model.HJGL_PackagingManage GetHJGL_PackagingManageById(string PackagingManageId)
|
||||
@@ -103,6 +115,96 @@ namespace BLL
|
||||
return PlanStartDate;
|
||||
}
|
||||
|
||||
public static string GetNewPackagingCode(string projectid)
|
||||
{
|
||||
string code = ProjectService.GetProjectCodeByProjectId(projectid) + "-" + string.Format("{0:yyyyMMdd}", DateTime.Now) + "-";
|
||||
|
||||
var q = GetPackagingManageList(projectid, code);
|
||||
if (q.Total > 0)
|
||||
{
|
||||
code = code + (q.Total + 1).ToString().PadLeft(3, '0');
|
||||
}
|
||||
else
|
||||
{
|
||||
code = code + "001";
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目号获取包装编号历史记录
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static List<string> GetPackagingCode(string projectid)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.HJGL_PackagingManage
|
||||
where x.ProjectId.Contains(projectid)
|
||||
select x.PackagingCode).Distinct().ToList();
|
||||
return q;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取装箱明细
|
||||
/// </summary>
|
||||
/// <param name="PackagingManageId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PackagingManagePrintOutput> GetPackagingDetailById(string PackagingManageId)
|
||||
{
|
||||
var model = GetHJGL_PackagingManageById(PackagingManageId);
|
||||
var result = new List<Model.PackagingManagePrintOutput>();
|
||||
if (model.TypeInt == (int)HJGLPackagingmanageService.TypeInt.预制组件)
|
||||
{
|
||||
if (string.IsNullOrEmpty(model.PipelineComponentId))
|
||||
return new List<Model.PackagingManagePrintOutput>();
|
||||
var PipelineComponentIds = model?.PipelineComponentId.Split(',');
|
||||
var query = from com in Funs.DB.HJGL_Pipeline_Component
|
||||
join pipe in Funs.DB.HJGL_Pipeline on com.PipelineId equals pipe.PipelineId into pipeGroup
|
||||
from pipe in pipeGroup.DefaultIfEmpty()
|
||||
join unitwork in Funs.DB.WBS_UnitWork on pipe.UnitWorkId equals unitwork.UnitWorkId into unitworkGroup
|
||||
from unitwork in unitworkGroup.DefaultIfEmpty()
|
||||
where PipelineComponentIds.Contains(com.PipelineComponentId)
|
||||
orderby com.PipelineComponentCode
|
||||
select new Model.PackagingManagePrintOutput
|
||||
{
|
||||
PipelineComponentId = com.PipelineComponentId,
|
||||
PipelineComponentCode = com.PipelineComponentCode,
|
||||
PlanStartDate = pipe != null && pipe.PlanStartDate != null ? pipe.PlanStartDate : DateTime.Now,
|
||||
UnitWorkName = unitwork != null ? unitwork.UnitWorkName : "",
|
||||
num = "1",
|
||||
CU = "个",
|
||||
FlowingSection = pipe != null ? pipe.FlowingSection : ""
|
||||
};
|
||||
result = query.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
var query = HJGLPackagingmanagedetailService.GetPackagingData(PackagingManageId).ToList();
|
||||
var detailList = from x in query
|
||||
select new Model.PackagingManagePrintOutput
|
||||
{
|
||||
PipelineComponentId = x.Id,
|
||||
PipelineComponentCode = x.MaterialCode,
|
||||
num = x.Number.ToString(),
|
||||
CU = x.MaterialUnit,
|
||||
UnitWorkName = x.UnitWorkId == null ? "" : UnitWorkService.GetNameById(x.UnitWorkId),
|
||||
FlowingSection = model.StackingPosition,
|
||||
};
|
||||
result = detailList.ToList();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static List<Model.HJGL_PackagingManage> GetPackagingManage(string trainNumberId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.HJGL_PackagingManage
|
||||
where x.TrainNumberId == trainNumberId
|
||||
select x).Distinct().ToList();
|
||||
return q;
|
||||
}
|
||||
|
||||
public static (List<PackagingManageItem> Data, int Total) GetPackagingManageList(string projectId, string PackagingCode, int pageIndex = 0, int pageSize = 20)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
@@ -149,6 +251,37 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
public static ListItem[] GetState()
|
||||
{
|
||||
ListItem[] list = new ListItem[3];
|
||||
list[0] = new ListItem("预出库", state_0.ToString());
|
||||
list[1] = new ListItem("已出库", state_1.ToString());
|
||||
list[2] = new ListItem("已到场", state_2.ToString());
|
||||
return list;
|
||||
}
|
||||
|
||||
public static string GetTypeString(int? TypeInt)
|
||||
{
|
||||
return TypeIntMap.FirstOrDefault(c => c.Value == TypeInt).Key;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 管线下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitPipelineDownList(FineUIPro.DropDownList dropName, string projectid, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "string";
|
||||
dropName.DataTextField = "string";
|
||||
dropName.DataSource = GetPackagingCode(projectid);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 形成出库单
|
||||
/// </summary>
|
||||
@@ -163,145 +296,6 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取装箱明细
|
||||
/// </summary>
|
||||
/// <param name="PackagingManageId"></param>
|
||||
/// <returns></returns>
|
||||
/* public static DataTable GetPackagingDetailById(string PackagingManageId)
|
||||
{
|
||||
DataTable tb = new DataTable();
|
||||
var model = GetHJGL_PackagingManageById(PackagingManageId);
|
||||
if (!string.IsNullOrEmpty(model.PipelineComponentId))
|
||||
{
|
||||
var PipelineComponentIds = model.PipelineComponentId.Split(',');
|
||||
string strSql = @"select com.PipelineComponentId, com.PipelineComponentCode,isnull(pipe.PlanStartDate,getdate()) as PlanStartDate,unitwork.UnitWorkName,'1' as num ,'个' as CU,pipe.FlowingSection
|
||||
from HJGL_Pipeline_Component com
|
||||
left join HJGL_Pipeline pipe on com.PipelineId=pipe.PipelineId
|
||||
left join WBS_UnitWork unitwork on pipe.UnitWorkId=unitwork.UnitWorkId
|
||||
";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql += string.Format("where com.PipelineComponentId in ( {0}) ", "'" + string.Join("','", PipelineComponentIds) + "'");
|
||||
strSql += " order by com.PipelineComponentCode";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
}
|
||||
return tb;
|
||||
}*/
|
||||
public static List<Model.PackagingManagePrintOutput> GetPackagingDetailById(string PackagingManageId)
|
||||
{
|
||||
var model = GetHJGL_PackagingManageById(PackagingManageId);
|
||||
var result = new List<Model.PackagingManagePrintOutput>();
|
||||
if (string.IsNullOrEmpty(model.PipelineComponentId))
|
||||
return new List<Model.PackagingManagePrintOutput>();
|
||||
|
||||
var PipelineComponentIds = model.PipelineComponentId.Split(',');
|
||||
|
||||
if (model.TypeInt == (int)HJGL_PackagingmanageService.TypeInt.预制组件)
|
||||
{
|
||||
var query = from com in Funs.DB.HJGL_Pipeline_Component
|
||||
join pipe in Funs.DB.HJGL_Pipeline on com.PipelineId equals pipe.PipelineId into pipeGroup
|
||||
from pipe in pipeGroup.DefaultIfEmpty()
|
||||
join unitwork in Funs.DB.WBS_UnitWork on pipe.UnitWorkId equals unitwork.UnitWorkId into unitworkGroup
|
||||
from unitwork in unitworkGroup.DefaultIfEmpty()
|
||||
where PipelineComponentIds.Contains(com.PipelineComponentId)
|
||||
orderby com.PipelineComponentCode
|
||||
select new Model.PackagingManagePrintOutput
|
||||
{
|
||||
PipelineComponentId = com.PipelineComponentId,
|
||||
PipelineComponentCode = com.PipelineComponentCode,
|
||||
PlanStartDate = pipe != null && pipe.PlanStartDate != null ? pipe.PlanStartDate : DateTime.Now,
|
||||
UnitWorkName = unitwork != null ? unitwork.UnitWorkName : "",
|
||||
num = "1",
|
||||
CU = "个",
|
||||
FlowingSection = pipe != null ? pipe.FlowingSection : ""
|
||||
};
|
||||
result = query.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
var query = HJGLPackagingmanagedetailService.GetPackagingData(PackagingManageId).ToList();
|
||||
var detailList = from x in query
|
||||
select new Model.PackagingManagePrintOutput
|
||||
{
|
||||
PipelineComponentId = x.Id,
|
||||
PipelineComponentCode = x.MaterialCode,
|
||||
num = x.Number.ToString(),
|
||||
CU = x.MaterialUnit,
|
||||
UnitWorkName = x.UnitWorkId == null ? "" : UnitWorkService.GetNameById(x.UnitWorkId),
|
||||
FlowingSection = x.FlowingSection,
|
||||
};
|
||||
result = detailList.ToList();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据项目号获取包装编号历史记录
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static List<string> GetPackagingCode(string projectid)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.HJGL_PackagingManage
|
||||
where x.ProjectId.Contains(projectid)
|
||||
select x.PackagingCode).Distinct().ToList();
|
||||
return q;
|
||||
}
|
||||
public static List<Model.HJGL_PackagingManage> GetPackagingManage(string trainNumberId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.HJGL_PackagingManage
|
||||
where x.TrainNumberId==trainNumberId
|
||||
select x).Distinct().ToList();
|
||||
return q;
|
||||
}
|
||||
public static string GetNewPackagingCode(string projectid)
|
||||
{
|
||||
string code = ProjectService.GetProjectCodeByProjectId(projectid) + "-" + string.Format("{0:yyyyMMdd}", DateTime.Now) + "-";
|
||||
|
||||
var q = GetPackagingManageList(projectid, code);
|
||||
if (q.Total > 0)
|
||||
{
|
||||
code = code + (q.Total + 1).ToString().PadLeft(3, '0');
|
||||
}
|
||||
else
|
||||
{
|
||||
code = code + "001";
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增实体
|
||||
/// </summary>
|
||||
/// <param name="newtable"></param>
|
||||
public static void AddHJGL_PackagingManage(Model.HJGL_PackagingManage newtable)
|
||||
{
|
||||
Model.HJGL_PackagingManage table = new Model.HJGL_PackagingManage
|
||||
{
|
||||
PackagingManageId = newtable.PackagingManageId,
|
||||
PackagingCode = newtable.PackagingCode,
|
||||
ProjectId = newtable.ProjectId,
|
||||
PipelineComponentId = newtable.PipelineComponentId,
|
||||
StackingPosition = newtable.StackingPosition,
|
||||
State = newtable.State,
|
||||
ContactName = newtable.ContactName,
|
||||
ContactPhone = newtable.ContactPhone,
|
||||
Remark = newtable.Remark,
|
||||
ReceiveDate = newtable.ReceiveDate,
|
||||
ReceiveMan = newtable.ReceiveMan,
|
||||
TrainNumber = newtable.TrainNumber,
|
||||
TrainNumberId = newtable.TrainNumberId,
|
||||
TypeInt = newtable.TypeInt,
|
||||
CompileMan=newtable.CompileMan,
|
||||
CompileDate = newtable.CompileDate
|
||||
};
|
||||
var db1 = Funs.DB;
|
||||
db1.HJGL_PackagingManage.InsertOnSubmit(table);
|
||||
db1.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void UpdateHJGL_PackagingManage(Model.HJGL_PackagingManage newtable)
|
||||
{
|
||||
var db1 = Funs.DB;
|
||||
@@ -326,32 +320,37 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteHJGL_PackagingManageById(string PackagingManageId)
|
||||
#endregion Methods
|
||||
|
||||
#region Classes
|
||||
|
||||
public class PackagingManageItem
|
||||
{
|
||||
var db1 = Funs.DB;
|
||||
Model.HJGL_PackagingManage table = db1.HJGL_PackagingManage.FirstOrDefault(x => x.PackagingManageId == PackagingManageId);
|
||||
if (table != null)
|
||||
{
|
||||
db1.HJGL_PackagingManage.DeleteOnSubmit(table);
|
||||
db1.SubmitChanges();
|
||||
}
|
||||
#region Properties
|
||||
|
||||
public string Code { get; set; }
|
||||
public string ContactName { get; set; }
|
||||
public string ContactPhone { get; set; }
|
||||
public string DriverName { get; set; }
|
||||
public string DriverPhone { get; set; }
|
||||
public string LicensePlateNumber { get; set; }
|
||||
public string PackagingCode { get; set; }
|
||||
public string PackagingManageId { get; set; }
|
||||
public string PlanStartDate { get; set; }
|
||||
public string ProjectId { get; set; }
|
||||
public string ProjectName { get; set; }
|
||||
public string ReceiveDate { get; set; }
|
||||
public string ReceiveMan { get; set; }
|
||||
public string StackingPosition { get; set; }
|
||||
public int? State { get; set; }
|
||||
public string TrainNumber { get; set; }
|
||||
public string TrainNumberOld { get; set; }
|
||||
public int? TypeInt { get; set; }
|
||||
public string TypeString { get; set; }
|
||||
|
||||
#endregion Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 管线下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitPipelineDownList(FineUIPro.DropDownList dropName, string projectid, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "string";
|
||||
dropName.DataTextField = "string";
|
||||
dropName.DataSource = GetPackagingCode(projectid);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
#endregion Classes
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,8 @@ namespace BLL
|
||||
newPlan.CompletedCount = plan.CompletedCount;
|
||||
newPlan.CompletedRate = plan.CompletedRate;
|
||||
newPlan.TotalCompletedRate = plan.TotalCompletedRate;
|
||||
newPlan.OnDayCompleteDyne = plan.OnDayCompleteDyne;
|
||||
newPlan.NextDayCompleteDyne = plan.NextDayCompleteDyne;
|
||||
db.HJGL_ProductionSchedulingPlan.InsertOnSubmit(newPlan);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -474,8 +474,10 @@ namespace BLL
|
||||
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
||||
var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid);
|
||||
var UnitWorkName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName;
|
||||
var UnitWorkCode = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkCode;
|
||||
keyValuePairs.Add("projectName", projectName);
|
||||
keyValuePairs.Add("UnitWorkName", UnitWorkName);
|
||||
keyValuePairs.Add("UnitWorkCode", UnitWorkCode);
|
||||
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
|
||||
string sql3 = @"SELECT isoList.PT_PipeId,
|
||||
isoList.PTP_ID,
|
||||
@@ -680,9 +682,11 @@ namespace BLL
|
||||
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
||||
var projectName = BLL.ProjectService.GetProjectNameByProjectId(projectid);
|
||||
var UnitWorkName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkName;
|
||||
var UnitWorkCode = BLL.UnitWorkService.getUnitWorkByUnitWorkId(updateTestPackage.UnitWorkId).UnitWorkCode;
|
||||
var unitNames = BLL.UnitService.GetUnitNameByUnitId(updateTestPackage.UnitId);
|
||||
keyValuePairs.Add("ProjectName", projectName);
|
||||
keyValuePairs.Add("UnitWorkName", UnitWorkName);
|
||||
keyValuePairs.Add("UnitWorkCode", UnitWorkCode);
|
||||
keyValuePairs.Add("UnitName2", unitNames);//施工单位
|
||||
if (!string.IsNullOrEmpty(q.PipingClassId))
|
||||
{
|
||||
|
||||
@@ -640,9 +640,9 @@ namespace BLL
|
||||
/// <param name="flowingSection">流水段</param>
|
||||
/// <param name="steelType">材质</param>
|
||||
/// <param name="caliber">口径</param>
|
||||
/// <param name="type">1-总达因,2-完成总达因</param>
|
||||
/// <param name="type">1-达因,2-完成达因</param>
|
||||
/// <returns></returns>
|
||||
public static decimal? GetSizeSum(string projectId, string unitWorkId, string flowingSection, string steelType, string caliber,string type)
|
||||
public static decimal? GetSizeSum(string projectId, string unitWorkId, string flowingSection, string steelType, string caliber, string type)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
decimal? sizeSum = 0;
|
||||
@@ -655,38 +655,40 @@ namespace BLL
|
||||
join z in db.Base_Material on y.MaterialId equals z.MaterialId
|
||||
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection && z.SteelType == steelType
|
||||
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
|
||||
//&& Convert.ToInt32(x.DNDia.Substring(2, x.DNDia.Length - 2)) < c
|
||||
select x);
|
||||
|
||||
foreach (var item in weldjoints)
|
||||
{
|
||||
int s = Convert.ToInt32(item.DNDia.Substring(2, item.DNDia.Length - 2));
|
||||
if (caliber.Substring(0, 1) == "<" && s < c)
|
||||
if (!string.IsNullOrEmpty(item.DNDia) && item.DNDia != null)
|
||||
{
|
||||
if (type == "1")
|
||||
int s = Convert.ToInt32(item.DNDia.Substring(2, item.DNDia.Length - 2));
|
||||
if (caliber.Substring(0, 1) == "<" && s < c)
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.WeldingDailyId))
|
||||
if (type == "1")
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.WeldingDailyId))
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (caliber.Substring(0, 1) == "≥" && s >= c)
|
||||
{
|
||||
if (type == "1")
|
||||
else if (caliber.Substring(0, 1) == "≥" && s >= c)
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.WeldingDailyId))
|
||||
if (type == "1")
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.WeldingDailyId))
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -695,14 +697,14 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位工程、流水段获取总达因
|
||||
/// 根据单位工程、流水段获取优先级总达因、完成总达因
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <param name="unitWorkId">单位工程</param>
|
||||
/// <param name="flowingSection">流水段</param>
|
||||
/// <param name="type">1-总达因,2-完成总达因</param>
|
||||
/// <returns></returns>
|
||||
public static decimal? GetSizeSumByUnitWorkIdAndFlowingSection(string projectId, string unitWorkId, string flowingSection,string type)
|
||||
public static decimal? GetSizeSumByUnitWorkIdAndFlowingSection(string projectId, string unitWorkId, string flowingSection, string type)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
decimal? sizeSum = 0;
|
||||
@@ -710,7 +712,7 @@ namespace BLL
|
||||
{
|
||||
sizeSum = (from x in db.HJGL_WeldJoint
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
|
||||
join z in db.Base_Material on y.MaterialId equals z.MaterialId
|
||||
//join z in db.Base_Material on y.MaterialId equals z.MaterialId
|
||||
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection
|
||||
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
|
||||
select x.Size).Sum();
|
||||
@@ -719,7 +721,7 @@ namespace BLL
|
||||
{
|
||||
sizeSum = (from x in db.HJGL_WeldJoint
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
|
||||
join z in db.Base_Material on y.MaterialId equals z.MaterialId
|
||||
//join z in db.Base_Material on y.MaterialId equals z.MaterialId
|
||||
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection
|
||||
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
|
||||
&& x.WeldingDailyId != "" && x.WeldingDailyId != null
|
||||
@@ -727,5 +729,85 @@ namespace BLL
|
||||
}
|
||||
return sizeSum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位工程、流水段、材质获取总达因(按材质)
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <param name="unitWorkId">单位工程id</param>
|
||||
/// <param name="flowingSection">流水号</param>
|
||||
/// <param name="material">材质</param>
|
||||
/// <returns></returns>
|
||||
public static decimal? GetSizeSumByUnitWorkIdAndFlowingSectionAndMaterial(string projectId, string unitWorkId, string flowingSection, string steelType)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
decimal? sizeSum = 0;
|
||||
sizeSum = (from x in db.HJGL_WeldJoint
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
|
||||
join z in db.Base_Material on y.MaterialId equals z.MaterialId
|
||||
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection
|
||||
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
|
||||
&& z.SteelType == steelType
|
||||
select x.Size).Sum();
|
||||
return sizeSum;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取当日已完成量
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitWorkId"></param>
|
||||
/// <param name="flowingSection"></param>
|
||||
/// <param name="steelType"></param>
|
||||
/// <param name="caliber"></param>
|
||||
/// <returns></returns>
|
||||
public static decimal? GetCurrentDaySizeSum(string projectId, string unitWorkId, string flowingSection, string steelType, string caliber)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
decimal? sizeSum = 0;
|
||||
int c = 0;
|
||||
if (!string.IsNullOrEmpty(caliber))
|
||||
{
|
||||
c = Convert.ToInt32(caliber.Substring(1, caliber.Length - 1));
|
||||
var weldjoints = (from x in db.HJGL_WeldJoint
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
|
||||
join z in db.Base_Material on y.MaterialId equals z.MaterialId
|
||||
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection && z.SteelType == steelType
|
||||
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
|
||||
select x);
|
||||
|
||||
foreach (var item in weldjoints)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.DNDia) && item.DNDia != null)
|
||||
{
|
||||
int s = Convert.ToInt32(item.DNDia.Substring(2, item.DNDia.Length - 2));
|
||||
if (caliber.Substring(0, 1) == "<" && s < c)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.WeldingDailyId))
|
||||
{
|
||||
var weldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(item.WeldingDailyId);
|
||||
if (weldingDaily != null && weldingDaily.WeldingDate.HasValue && weldingDaily.WeldingDate.Value.ToShortDateString() == DateTime.Now.ToShortDateString())
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (caliber.Substring(0, 1) == "≥" && s >= c)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.WeldingDailyId))
|
||||
{
|
||||
var weldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(item.WeldingDailyId);
|
||||
if (weldingDaily != null && weldingDaily.WeldingDate.HasValue && weldingDaily.WeldingDate.Value.ToShortDateString() == DateTime.Now.ToShortDateString())
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sizeSum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace BLL
|
||||
approveManModels.Add(new ApproveManModel { Number = 1, userid = table.ConstructionManager, Rolename = "施工经理" });
|
||||
// approveManModels.Add(new ApproveManModel { Number = 2, userid = table.ProjectManager, Rolename = "项目经理" });
|
||||
approveManModels.Add(new ApproveManModel { Number = 2, userid = table.Approval_Construction, Rolename = "施工管理部" });
|
||||
//approveManModels.Add(new ApproveManModel { Number = 4, userid = table.DeputyGeneralManager, Rolename = "分管副总经理" });
|
||||
approveManModels.Add(new ApproveManModel { Number = 3, userid = table.DeputyGeneralManager, Rolename = "分管领导" });
|
||||
return approveManModels;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user