feat(hjgl): 完善焊接任务与质量管理流程

This commit is contained in:
2026-08-19 17:13:33 +08:00
parent 08792e0dc8
commit 679e9f6cec
68 changed files with 2481 additions and 1170 deletions
+59 -1
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
namespace BLL
@@ -209,6 +210,36 @@ namespace BLL
}
}
/// <summary>
/// 按焊材类型获取焊接耗材,1为焊丝,2为焊条。
/// </summary>
/// <param name="consumablesType">焊材类型:1焊丝,2焊条</param>
/// <returns>焊接耗材基础项</returns>
public static List<Model.BaseInfoItem> GetWeldingConsumables(string consumablesType)
{
if (consumablesType != "1" && consumablesType != "2")
{
throw new ArgumentException("焊材类型只能为1(焊丝)或2(焊条)");
}
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
// 与PC端焊材下拉框保持一致:ID作为值,名称作为显示文本,并按名称排序。
return db.Base_Consumables
.Where(x => x.ConsumablesType == consumablesType)
.OrderBy(x => x.ConsumablesName)
.ThenBy(x => x.ConsumablesCode)
.ThenBy(x => x.ConsumablesId)
.Select(x => new Model.BaseInfoItem
{
BaseInfoId = x.ConsumablesId,
BaseInfoCode = x.ConsumablesCode,
BaseInfoName = x.ConsumablesName,
Remark = x.Remark
}).ToList();
}
}
/// <summary>
/// 获取探伤类型
/// </summary>
@@ -1016,5 +1047,32 @@ namespace BLL
}
#endregion
/// <summary>
/// 按条码关键字查询入库条码明细。空关键字不返回全表数据。
/// </summary>
public static Tuple<List<Model.Tw_InputDetailBarCode>, int> GetInputDetailBarCodes(
string barCodeKeyword, int pageIndex, int pageSize)
{
if (string.IsNullOrWhiteSpace(barCodeKeyword))
{
return Tuple.Create(new List<Model.Tw_InputDetailBarCode>(), 0);
}
string keyword = barCodeKeyword.Trim();
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var query = db.Tw_InputDetailBarCode
.Where(x => x.BarCode != null && x.BarCode.Contains(keyword));
int totalCount = query.Count();
var data = query
.OrderBy(x => x.BarCode)
.ThenBy(x => x.Id)
.Skip((pageIndex - 1) * pageSize)
.Take(pageSize)
.ToList();
return Tuple.Create(data, totalCount);
}
}
}
}
+5 -1
View File
@@ -20,6 +20,8 @@ namespace BLL
{
var getUser = from x in db.SitePerson_Person
join y in db.Person_Persons on x.IdentityCard equals y.IdentityCard
join team in db.ProjectData_TeamGroup on x.TeamGroupId equals team.TeamGroupId into teamGroup
from team in teamGroup.DefaultIfEmpty()
where (y.Telephone == userInfo.Account || x.PersonName == userInfo.Account)
&& (y.Password == Funs.EncryptionPassword(userInfo.Password)
|| (x.IdentityCard != null && x.IdentityCard.Substring(x.IdentityCard.Length - 4) == userInfo.Password))
@@ -35,6 +37,8 @@ namespace BLL
IdentityCard = x.IdentityCard,
Account = y.Telephone,
UnitName = db.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName,
TeamGroupId = x.TeamGroupId,
TeamGroupName = team == null ? string.Empty : team.TeamGroupName,
LoginProjectName = db.Base_Project.First(u => u.ProjectId == x.ProjectId).ProjectName,
Telephone = y.Telephone,
WorkPostId = x.WorkPostId,
@@ -1626,4 +1630,4 @@ namespace BLL
}
}
}
}
+9
View File
@@ -55,6 +55,15 @@ namespace BLL
newItem.LoginProjectId = getSitePerson.ProjectId;
}
}
// 班组归属随项目变化,登录时必须按当前登录项目读取项目人员关系,不能直接使用人员主表信息。
var loginSitePerson = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == getUser.PersonId
&& x.ProjectId == newItem.LoginProjectId && x.States == Const.ProjectPersonStates_1);
if (loginSitePerson != null)
{
newItem.TeamGroupId = loginSitePerson.TeamGroupId;
var teamGroup = db.ProjectData_TeamGroup.FirstOrDefault(x => x.TeamGroupId == loginSitePerson.TeamGroupId);
newItem.TeamGroupName = teamGroup == null ? string.Empty : teamGroup.TeamGroupName;
}
newItem.LoginProjectName = ProjectService.GetProjectNameByProjectId(newItem.LoginProjectId);
return newItem;
}
+40
View File
@@ -151,6 +151,46 @@ namespace BLL
}
}
/// <summary>
/// 分页查询当前项目的全部焊口,不限制是否已生成焊接日报。
/// </summary>
/// <param name="projectId">项目ID</param>
/// <param name="pipelineCode">管线号查询条件</param>
/// <param name="weldJointCode">焊口号查询条件</param>
/// <param name="pageIndex">页码,从0开始</param>
/// <param name="pageSize">每页记录数</param>
/// <returns>焊口列表</returns>
public static List<Model.WeldAppearanceJointItem> GetAllWeldJoints(string projectId,
string pipelineCode, string weldJointCode, int pageIndex, int pageSize)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
// 管线焊口选择需要包含未焊接焊口,因此不按 WeldingDailyId 过滤。
var query = db.View_HJGL_WeldJoint.Where(x => x.ProjectId == projectId);
if (!string.IsNullOrWhiteSpace(pipelineCode))
{
query = query.Where(x => x.PipelineCode.Contains(pipelineCode));
}
if (!string.IsNullOrWhiteSpace(weldJointCode))
{
query = query.Where(x => x.WeldJointCode.Contains(weldJointCode));
}
return query.OrderBy(x => x.PipelineCode).ThenBy(x => x.WeldJointCode)
.Skip(pageIndex * pageSize).Take(pageSize)
.Select(x => new Model.WeldAppearanceJointItem
{
WeldJointId = x.WeldJointId,
ProjectId = x.ProjectId,
PipelineCode = x.PipelineCode,
WeldJointCode = x.WeldJointCode,
WeldTypeCode = x.WeldTypeCode,
WeldingMethodCode = x.WeldingMethodCode,
WeldingDate = x.WeldingDateD
}).ToList();
}
}
#endregion 线ID获取所有焊口信息
#region
@@ -91,8 +91,6 @@ namespace BLL
{
var data = (from f in db.HJGL_PreWeldFitupCheck
join w in db.HJGL_WeldJoint on f.WeldJointId equals w.WeldJointId
join g in db.Base_GrooveType on f.GrooveTypeId equals g.GrooveTypeId into grooveTypes
from g in grooveTypes.DefaultIfEmpty()
join p in db.Person_Persons on f.CheckPerson equals p.PersonId into persons
from p in persons.DefaultIfEmpty()
where f.WeldJointId == weldJointId
@@ -104,17 +102,8 @@ namespace BLL
WeldJointId = f.WeldJointId,
PipelineCode = w.PipelineCode,
WeldJointCode = w.WeldJointCode,
GrooveTypeId = f.GrooveTypeId,
GrooveTypeCode = g == null ? string.Empty : g.GrooveTypeCode,
GrooveTypeName = g == null ? string.Empty : g.GrooveTypeName,
GrooveProcessType = f.GrooveProcessType,
GrooveAngle = f.GrooveAngle,
FitupGap = f.FitupGap,
Misalignment = f.Misalignment,
WeldReinforcement = f.WeldReinforcement,
WeldHeight = f.WeldHeight,
WeldWidth = f.WeldWidth,
SurfaceDefect = f.SurfaceDefect,
CheckPerson = f.CheckPerson,
CheckPersonName = p == null ? string.Empty : p.PersonName,
CheckTime = f.CheckTime,
@@ -135,7 +124,7 @@ namespace BLL
}
/// <summary>
/// 按材料编码获取防腐检查记录
/// 按入库条码获取材料信息及防腐检查记录
/// </summary>
public static List<Model.AntiCorrosionCheckRecordItem> GetAntiCorrosionChecksByMaterialCode(string barCode, string projectId)
{
@@ -296,7 +296,9 @@ namespace BLL
newItem.weldingLocation,
newItem.welderType,
newItem.WeldingMethodId,
newItem.WeldTypeId);
newItem.WeldTypeId,
newItem.WeldingWire,
newItem.WeldingRod);
if (!string.IsNullOrEmpty(res))
{
return res;
+6 -18
View File
@@ -8,9 +8,6 @@ namespace BLL
/// </summary>
public static class APIWeldReportService
{
/// <summary>
/// 获取焊接日报待审核列表。
/// </summary>
public static List<Model.WeldingDailyTempDetailItem> GetPendingWeldingDailyTempDetailList(
string projectId, string unitWorkId, string weldingDate, string pipelineCode, string welderCode)
{
@@ -18,26 +15,21 @@ namespace BLL
ParseWeldingDate(weldingDate), pipelineCode, welderCode);
}
/// <summary>
/// 查看单条焊接日报待审核明细。
/// </summary>
public static Model.WeldingDailyTempDetailItem GetPendingWeldingDailyTempDetail(string tempDetailId)
{
return WeldingDailyService.GetWeldingDailyTempDetailById(tempDetailId);
}
/// <summary>
/// 批量审核通过焊接日报待审核明细。
/// </summary>
public static string TeamAuditPendingWeldingDailyTempDetails(string[] tempDetailIds, string auditMan)
{
return WeldingDailyService.TeamAuditWeldingDailyTempDetails(tempDetailIds, auditMan);
}
public static string AuditPendingWeldingDailyTempDetails(string[] tempDetailIds, string auditMan)
{
// 审核规则、建日报、组批及状态回写统一由PC端已经使用的公共服务处理。
return WeldingDailyService.AuditWeldingDailyTempDetails(tempDetailIds, auditMan);
}
/// <summary>
/// 批量删除焊接日报待审核明细。
/// </summary>
public static string DeletePendingWeldingDailyTempDetails(string[] tempDetailIds)
{
return WeldingDailyService.DeleteWeldingDailyTempDetails(tempDetailIds);
@@ -45,17 +37,13 @@ namespace BLL
private static DateTime? ParseWeldingDate(string weldingDate)
{
if (string.IsNullOrWhiteSpace(weldingDate))
{
return null;
}
if (string.IsNullOrWhiteSpace(weldingDate)) return null;
DateTime parsedDate;
if (!DateTime.TryParse(weldingDate, out parsedDate))
{
throw new ArgumentException("焊接日期格式不正确");
}
return parsedDate.Date;
}
}