This commit is contained in:
2026-04-28 20:01:33 +08:00
59 changed files with 4362 additions and 1806 deletions
+1 -1
View File
@@ -566,7 +566,7 @@ namespace BLL
{
var getPersons = from x in db.View_SitePerson_Person
where x.ProjectId == projectId && x.States == Const.ProjectPersonStates_1
where x.ProjectId == projectId
select new Model.PersonItem
{
SitePersonId = x.SitePersonId,
+2 -2
View File
@@ -17,8 +17,8 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getUser = db.Person_Persons.FirstOrDefault(x => (x.Account == userInfo.Account || x.Telephone == userInfo.Telephone || x.PersonName == userInfo.Account)
&& x.Password == Funs.EncryptionPassword(userInfo.Password) && (!x.IsPost.HasValue || x.IsPost == true)
&& (x.Account.Length > 1 || x.PersonId == Const.hfnbdId || x.PersonId == Const.sysglyId));
&& x.Password == Funs.EncryptionPassword(userInfo.Password) && (!x.IsPost.HasValue || x.IsPost == true));
/*&& (x.Account.Length > 1 || x.PersonId == Const.hfnbdId || x.PersonId == Const.sysglyId))*/
if (getUser != null)
{
Model.UserItem newItem = new Model.UserItem();
File diff suppressed because it is too large Load Diff
@@ -461,9 +461,8 @@ namespace BLL
weldingDaily.UnitWorkId = joint.UnitWorkId;
weldingDaily.UnitId = weldTask?.UnitId;
weldingDaily.Tabler = Personid;
weldingDaily.TableDate = Convert.ToDateTime(time).Date;
db.HJGL_WeldingDaily.InsertOnSubmit(weldingDaily);
db.SubmitChanges();
weldingDaily.TableDate = Convert.ToDateTime(time).Date;
BLL.WeldingDailyService.AddWeldingDaily(weldingDaily);
}
BLL.HJGL_PipelineComponentjointService.UpdateStateByWeldJointId(WeldJointId, (DateTime)weldingDaily.WeldingDate);//更改预制口实际时间和状态
PipelineService.UpdataDateByWeldJointId(WeldJointId);//更改安装口时间和状态
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
namespace BLL
@@ -53,6 +53,11 @@ namespace BLL
{
throw new Exception("当前包装状态不可修改车次号");
}
// 检查包装是否已关联其他车次
if (!string.IsNullOrEmpty(packModel.TrainNumberId) && packModel.TrainNumberId != trainNumberId)
{
throw new Exception("该包装已在其他车次中存在,不能重复添加");
}
packModel.TrainNumberId = trainNumberId;
HJGLPackagingmanageService.UpdateHJGL_PackagingManage(packModel);
}
+2 -1
View File
@@ -837,6 +837,7 @@
<Compile Include="ZHGL\RealName\OnPostService.cs" />
<Compile Include="ZHGL\RealName\RealNameMonitorService.cs" />
<Compile Include="ZHGL\RealName\RealName_ProjectService.cs" />
<Compile Include="ZHGL\RealName\SedinRealName.Service.cs" />
<Compile Include="ZHGL\RealName\SynchroSetService.cs" />
<Compile Include="ZHGL\Supervise\SubUnitCheckRectifyItemService.cs" />
<Compile Include="ZHGL\Supervise\SubUnitCheckRectifyService.cs" />
@@ -935,4 +936,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
+75 -58
View File
@@ -27,42 +27,54 @@ namespace BLL
NeedNum = g.Sum(x => x.Number) ?? 0,
};
///实际材料入库数量列表
var RealInMateriaList = from x in db.Tw_InputDetail
join master in db.Tw_InputMaster on x.InputMasterId equals master.Id
join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
where master.ProjectId == projectid && master.WarehouseCode == WarehouseCode
group x by x.MaterialCode
var RealInMateriaList = (from x in db.Tw_InputDetail
join master in db.Tw_InputMaster on x.InputMasterId equals master.Id
join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
where master.ProjectId == projectid && master.WarehouseCode == WarehouseCode
group x by x.MaterialCode
into g
where (string.IsNullOrEmpty(materialCode) || g.Key.Contains(materialCode))
select new
{
g.Key,
RealNum = g.Sum(x => x.ActNum) ?? 0,
};
where (string.IsNullOrEmpty(materialCode) || g.Key.Contains(materialCode))
select new
{
g.Key,
RealNum = g.Sum(x => x.ActNum) ?? 0,
}).ToList();
//库存数量
var tw_MaterialStock = from x in db.Tw_MaterialStock
where x.WarehouseCode == WarehouseCode && x.ProjectId == projectid
select x;
var tw_MaterialStock = (from x in db.Tw_MaterialStock
where x.WarehouseCode == WarehouseCode && x.ProjectId == projectid
select x).ToList();
var needMateriaList = NeedOutMateriaList.ToList();
var materialCodeList = needMateriaList.Select(x => x.Key)
.Union(RealInMateriaList.Select(x => x.Key))
.Distinct()
.ToList();
var StatisticsList = (from x in NeedOutMateriaList
join y in RealInMateriaList on x.Key equals y.Key into gg
from y in gg.DefaultIfEmpty()
join z in db.HJGL_MaterialCodeLib on x.Key equals z.MaterialCode into zz
from z in zz.DefaultIfEmpty()
join m in tw_MaterialStock on x.Key equals m.PipeLineMatCode into mm
from m in mm.DefaultIfEmpty()
var materialInfoList = (from x in db.HJGL_MaterialCodeLib
where materialCodeList.Contains(x.MaterialCode)
select x).ToList();
var StatisticsList = (from code in materialCodeList
join x in needMateriaList on code equals x.Key into needGroup
from x in needGroup.DefaultIfEmpty()
join y in RealInMateriaList on code equals y.Key into realGroup
from y in realGroup.DefaultIfEmpty()
join z in materialInfoList on code equals z.MaterialCode into infoGroup
from z in infoGroup.DefaultIfEmpty()
join m in tw_MaterialStock on code equals m.PipeLineMatCode into stockGroup
from m in stockGroup.DefaultIfEmpty()
orderby code
select new Tw_ArrivalStatisticsOutPut
{
MaterialCode = x.Key,
MaterialCode = code,
StockNum = m == null ? 0 : (decimal)m.StockNum,
NeedNum = x.NeedNum,
NeedNum = x == null ? 0 : x.NeedNum,
RealNum = y == null ? 0 : y.RealNum,
MaterialName = z.MaterialName,
MaterialSpec = z.MaterialSpec,
MaterialUnit = z.MaterialUnit,
MaterialDef = z.MaterialDef,
MatchRate = (x.NeedNum == 0 ? 0 : Math.Round((y == null ? 0 : y.RealNum) / x.NeedNum, 4, MidpointRounding.ToEven)),
MaterialName = z == null ? null : z.MaterialName,
MaterialSpec = z == null ? null : z.MaterialSpec,
MaterialUnit = z == null ? null : z.MaterialUnit,
MaterialDef = z == null ? null : z.MaterialDef,
MatchRate = (x == null || x.NeedNum == 0 ? 0 : Math.Round((y == null ? 0 : y.RealNum) / x.NeedNum, 4, MidpointRounding.ToEven)),
}).ToList();
foreach (var item in StatisticsList)
{
@@ -86,7 +98,35 @@ namespace BLL
WarehouseCode = warehouseCode,
ProjectId = projectId
};
var stockList = TwMaterialstockService.GetTw_MaterialStockByModle(twMaterialStockOutput).ToList();//获取库存列表
var stockList = TwMaterialstockService.GetTw_MaterialStockByModle(twMaterialStockOutput).ToList();//获取库存列表
// 预扣除出库申请单中状态为待审核/已审核的材料数量
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var outboundMaterials = from detail in db.Tw_InOutPlanDetail
join master in db.Tw_InOutPlanMaster on detail.InOutPlanMasterId equals master.Id
where master.InOutType == (int)TwConst.InOutType.
&& (master.State == (int)TwConst.State. || master.State == (int)TwConst.State.)
&& master.WarehouseCode == warehouseCode
&& master.ProjectId == projectId
group detail by detail.MaterialCode into g
select new
{
MaterialCode = g.Key,
TotalPlanNum = g.Sum(d => d.PlanNum) ?? 0
};
var outboundList = outboundMaterials.ToList();
foreach (var outbound in outboundList)
{
var stock = stockList.FirstOrDefault(x => x.PipeLineMatCode == outbound.MaterialCode);
if (stock != null)
{
stock.StockNum -= outbound.TotalPlanNum;
}
}
}
foreach (var material in requiredMaterials)
{
material.Id = Guid.NewGuid().ToString();
@@ -121,40 +161,17 @@ namespace BLL
/// <param name="pipelineId"></param>
/// <returns></returns>
public static decimal? GetPipeMatch(string pipelineId)
{
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var twPipeMatMatchOutputs = new List<Tw_PipeMatMatchOutput>();
List<string> pipelineIds = new List<string>();
pipelineIds.Add(pipelineId);
var pipelineModel = PipelineService.GetPipelineByPipelineId(pipelineId);
string warehouseCode = BLL.Base_WarehouseService.GetWarehouseByWarehouseId(PipelineService.GetPipelineByPipelineId(pipelineModel.PipelineId).WarehouseId).WarehouseName;
// 获取所需材料列表
var requiredMaterials = (from x in db.HJGL_PipeLineMat
join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
join z in db.HJGL_Pipeline on x.PipelineId equals z.PipelineId
join m in db.WBS_UnitWork on z.UnitWorkId equals m.UnitWorkId
where z.PipelineId == pipelineId && x.PrefabricatedComponents != "" //x.PrefabricatedComponents!="" 用于筛选非散件材料
select new Tw_PipeMatMatchOutput
{
Id = Guid.NewGuid().ToString(),
PipelineId = x.PipelineId,
PipelineCode = z.PipelineCode,
UnitWorkId = z.UnitWorkId,
UnitWorkName = m.UnitWorkName,
PrefabricatedComponents = x.PrefabricatedComponents,
MaterialCode = x.MaterialCode,
MaterialName = y.MaterialName,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
MaterialDef = y.MaterialDef,
NeedNum = x.Number,
}
).ToList();
twPipeMatMatchOutputs = GetMatMatchOutput(requiredMaterials, warehouseCode, pipelineModel.ProjectId);
var result = twPipeMatMatchOutputs.Any()
? twPipeMatMatchOutputs.Average(x => x.MatchRate)
: 0;
return result;
var PipeMatMatch = GetPipeMatMatch(pipelineModel.ProjectId, pipelineIds, warehouseCode);
var pipeMatchRate = GetPipeMatch(PipeMatMatch).FirstOrDefault(x => x.PipelineId == pipelineId);
return pipeMatchRate?.MatchRate;
}
}
/// <summary>
+2 -1
View File
@@ -130,7 +130,8 @@ namespace BLL
AuditDate2 = x.AuditDate2,
WarehouseMan = x.WarehouseMan,
WarehouseManName = x.WarehouseManName,
WarehouseDate = x.WarehouseDate
WarehouseDate = x.WarehouseDate,
Remark=x.Remark
};
}
+4 -1
View File
@@ -5358,6 +5358,9 @@ namespace BLL
/// </summary>
public const string CQMS_MeetingMenuId = "30754DF1-CB18-4F53-BB66-2B2A398D7180";
/// <summary>
/// 质量会议
/// </summary>
public const string EntryEducationTrainTypeId = "8920c9cc-fa92-49b2-9493-775a55da27bb";
}
}
@@ -208,7 +208,7 @@ namespace BLL
//小于500的焊口按比例及规则点口
var batchItems500Down = from x in db.HJGL_Batch_PointBatchItem
join y in db.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId
where y.Dia < 500 && x.PointBatchId == pointBatchId
where (y.Dia < 500 || y.Dia == null) && x.PointBatchId == pointBatchId
select x;
if (batch.DetectionRateId != null && batchItems500Down.Count() > 0)
{
@@ -219,11 +219,11 @@ namespace BLL
var weldG = from x in db.HJGL_Batch_PointBatchItem
join y in db.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId
where y.JointAttribute == "安装口" && y.Dia < 500 && x.PointBatchId == pointBatchId
where y.JointAttribute == "安装口" && (y.Dia < 500 || y.Dia == null) && x.PointBatchId == pointBatchId
select x;
var weldA = from x in db.HJGL_Batch_PointBatchItem
join y in db.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId
where y.JointAttribute == "预制口" && y.Dia < 500 && x.PointBatchId == pointBatchId
where y.JointAttribute == "预制口" && (y.Dia < 500 || y.Dia == null) && x.PointBatchId == pointBatchId
select x;
if (weldG.Count() > 0)
{
@@ -1,4 +1,4 @@
using FastReport.DevComponents.DotNetBar;
using FastReport.DevComponents.DotNetBar;
using FineUIPro;
using Model;
using System;
@@ -15,7 +15,9 @@ namespace BLL
public static class HJGLPackagingmanageService
{
#region Fields
/// <summary>
/// 包装分类映射字典
/// </summary>
public static Dictionary<string, int> CategoryIntMap = new Dictionary<string, int>
{
{ "打捆" ,(int)CategoryInt.},
@@ -141,19 +143,30 @@ namespace BLL
/// <exception cref="Exception">当该预制组件已被包装时抛出异常</exception>
public static void AddPipelineComponentToPackaging(string packagingManageId, string pipelineComponentId)
{
var ComponentModel = BLL.HJGL_PipelineComponentService.GetPipelineComponentById(pipelineComponentId);
if (ComponentModel != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var model = new Model.HJGL_PackagingManageDetail()
bool existsInCurrentPackaging = db.HJGL_PackagingManageDetail.Any(x => x.PackagingManageId == packagingManageId && x.PipelineComponentId == pipelineComponentId);
if (existsInCurrentPackaging)
{
Id = SQLHelper.GetNewID(),
PackagingManageId = packagingManageId,
PipelineId = ComponentModel.PipelineId,
PipelineComponentId = pipelineComponentId,
CreateTime = DateTime.Now,
CreateUser = null,
};
HJGLPackagingmanagedetailService.Add(model);
return;
}
ValidatePipelineComponentsNotInOtherPackaging(pipelineComponentId);
var ComponentModel = BLL.HJGL_PipelineComponentService.GetPipelineComponentById(pipelineComponentId);
if (ComponentModel != null)
{
var model = new Model.HJGL_PackagingManageDetail()
{
Id = SQLHelper.GetNewID(),
PackagingManageId = packagingManageId,
PipelineId = ComponentModel.PipelineId,
PipelineComponentId = pipelineComponentId,
CreateTime = DateTime.Now,
CreateUser = null,
};
db.HJGL_PackagingManageDetail.InsertOnSubmit(model);
db.SubmitChanges();
}
}
}
@@ -170,6 +183,7 @@ namespace BLL
db1.HJGL_PackagingManage.DeleteOnSubmit(table);
db1.SubmitChanges();
}
HJGLPackagingmanagedetailService.DeleteByPackagingManageId(PackagingManageId);
}
/// <summary>
@@ -528,6 +542,20 @@ namespace BLL
{
baseQuery = baseQuery.Where(z => z.train.Id != null && z.train.Id.Contains(filter.TrainNumberId));
}
// 是否关联车次筛选
if (filter.HasTrainNumber.HasValue)
{
if (filter.HasTrainNumber.Value)
{
// 已关联车次:TrainNumberId 不为空
baseQuery = baseQuery.Where(z => z.x.TrainNumberId != null && z.x.TrainNumberId != "");
}
else
{
// 未关联车次:TrainNumberId 为空
baseQuery = baseQuery.Where(z => z.x.TrainNumberId == null || z.x.TrainNumberId == "");
}
}
}
baseQuery = baseQuery.OrderByDescending(z => (z.x.ReceiveDate ?? DateTime.MinValue)).ThenBy(z => z.x.PackagingCode);
@@ -545,6 +573,9 @@ namespace BLL
ReceiveMan = z.train.ContactName,
ReceiveDate = string.Format("{0:g}", z.x.ReceiveDate),
TrainNumber = z.train.TrainNumber,
ComponentCount = db.HJGL_PackagingManageDetail.Count(d => d.PackagingManageId == z.x.PackagingManageId),
CategoryInt = z.x.CategoryInt,
CategoryString = z.x.CategoryInt == 10 ? "打捆" : (z.x.CategoryInt == 20 ? "装箱" : (z.x.CategoryInt == 30 ? "散装" : ""))
}).Distinct();
totalCount = q.Count();
@@ -613,6 +644,11 @@ namespace BLL
}
// 创建新的包装明细记录
var addedComponentIds = allComponentIds.Except(existingComponentIds).ToList();
foreach (var item in addedComponentIds)
{
ValidatePipelineComponentsNotInOtherPackaging(item);
}
var newDetailList = new List<Model.HJGL_PackagingManageDetail>();
foreach (var item in allComponentIds)
{
@@ -652,6 +688,28 @@ namespace BLL
/// 获取包装状态下拉框选项
/// </summary>
/// <returns>包装状态列表,包含状态文本和值的映射关系</returns>
private static void ValidatePipelineComponentsNotInOtherPackaging(string pipelineComponentId)
{
if (string.IsNullOrEmpty(pipelineComponentId))
{
return;
}
var existDetail = (from detail in Funs.DB.HJGL_PackagingManageDetail
join pack in Funs.DB.HJGL_PackagingManage on detail.PackagingManageId equals pack.PackagingManageId
where detail.PipelineComponentId == pipelineComponentId
select new
{
detail.PipelineComponentId,
PackagingCode = pack == null ? null : pack.PackagingCode
}).FirstOrDefault();
if (existDetail != null)
{
string packagingCodeText = string.IsNullOrEmpty(existDetail.PackagingCode) ? string.Empty : (",包装编号:" + existDetail.PackagingCode);
throw new Exception("组件已在其他包装中存在" + packagingCodeText + "。");
}
}
public static ListItem[] GetState()
{
ListItem[] list = new ListItem[3];
@@ -734,4 +792,4 @@ namespace BLL
}
#endregion Methods
}
}
}
@@ -144,11 +144,19 @@ namespace BLL
public static void DeleteById(string Id)
{
Model.HJGL_TrainNumberManage table = Funs.DB.HJGL_TrainNumberManage.FirstOrDefault(x => x.Id == Id);
var db = Funs.DB;
Model.HJGL_TrainNumberManage table = db.HJGL_TrainNumberManage.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
Funs.DB.HJGL_TrainNumberManage.DeleteOnSubmit(table);
Funs.DB.SubmitChanges();
var packagingList = db.HJGL_PackagingManage.Where(x => x.TrainNumberId == Id).ToList();
foreach (var item in packagingList)
{
item.TrainNumberId = null;
item.TrainNumber = null;
}
db.HJGL_TrainNumberManage.DeleteOnSubmit(table);
db.SubmitChanges();
}
}
@@ -167,4 +175,4 @@ namespace BLL
}
}
}
}
}
@@ -197,5 +197,24 @@ namespace BLL
}
return icount;
}
/// <summary>
/// 根据人员id、日期获取入场教育合格考试记录
/// </summary>
/// <param name="testRecordId"></param>
/// <returns></returns>
public static Model.Training_TestRecord GetOKTestRecordByPersonIdAndDate(string testManId, DateTime? date)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var testRecord = (from x in db.Training_TestRecord
join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
join z in db.Training_Plan on y.PlanId equals z.PlanId
where x.TestManId == testManId && x.TestStartTime >= date && x.TestScores >= 60
&& z.TrainTypeId == BLL.Const.EntryEducationTrainTypeId
select x).FirstOrDefault();
return testRecord;
}
}
}
}
@@ -49,21 +49,23 @@ namespace BLL
/// <param name="lawRegulationIdentify">法律法规辨识实体</param>
public static void UpdateLawRegulationIdentify(Model.Law_LawRegulationIdentify lawRegulationIdentify)
{
Model.SGGLDB db = Funs.DB;
Model.Law_LawRegulationIdentify newLawRegulationIdentify = db.Law_LawRegulationIdentify.FirstOrDefault(e => e.LawRegulationIdentifyId == lawRegulationIdentify.LawRegulationIdentifyId);
if (newLawRegulationIdentify != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
newLawRegulationIdentify.VersionNumber = lawRegulationIdentify.VersionNumber;
newLawRegulationIdentify.ProjectId = lawRegulationIdentify.ProjectId;
newLawRegulationIdentify.IdentifyPerson = lawRegulationIdentify.IdentifyPerson;
newLawRegulationIdentify.IdentifyDate = lawRegulationIdentify.IdentifyDate;
newLawRegulationIdentify.ManagerContent = lawRegulationIdentify.ManagerContent;
newLawRegulationIdentify.IdentifyConclude = lawRegulationIdentify.IdentifyConclude;
newLawRegulationIdentify.States = lawRegulationIdentify.States;
newLawRegulationIdentify.GroupMember = lawRegulationIdentify.GroupMember;
newLawRegulationIdentify.Remark = lawRegulationIdentify.Remark;
newLawRegulationIdentify.UpdateDate = lawRegulationIdentify.UpdateDate;
db.SubmitChanges();
Model.Law_LawRegulationIdentify newLawRegulationIdentify = db.Law_LawRegulationIdentify.FirstOrDefault(e => e.LawRegulationIdentifyId == lawRegulationIdentify.LawRegulationIdentifyId);
if (newLawRegulationIdentify != null)
{
newLawRegulationIdentify.VersionNumber = lawRegulationIdentify.VersionNumber;
newLawRegulationIdentify.ProjectId = lawRegulationIdentify.ProjectId;
newLawRegulationIdentify.IdentifyPerson = lawRegulationIdentify.IdentifyPerson;
newLawRegulationIdentify.IdentifyDate = lawRegulationIdentify.IdentifyDate;
newLawRegulationIdentify.ManagerContent = lawRegulationIdentify.ManagerContent;
newLawRegulationIdentify.IdentifyConclude = lawRegulationIdentify.IdentifyConclude;
newLawRegulationIdentify.States = lawRegulationIdentify.States;
newLawRegulationIdentify.GroupMember = lawRegulationIdentify.GroupMember;
newLawRegulationIdentify.Remark = lawRegulationIdentify.Remark;
newLawRegulationIdentify.UpdateDate = lawRegulationIdentify.UpdateDate;
db.SubmitChanges();
}
}
}
@@ -3058,7 +3058,7 @@ namespace BLL
from projectType in projectTypeJoin.DefaultIfEmpty()
join sysConst in Funs.DB.Sys_Const on new { ProjectState2 = "", GroupId = BLL.ConstValue.GroupId_ProjectState } equals new { ProjectState2 = sysConst.ConstValue, GroupId = sysConst.GroupId } into sysConstJoin
from sysConst in sysConstJoin.DefaultIfEmpty()
where project.ProjectState == "1" && project.MasterSysId != null
where project.ProjectState == "1" && project.MasterSysId != null && project.IsCNCECShow == true
select new ProjectOutput
{
ProjectId = project.ProjectId,
File diff suppressed because it is too large Load Diff