代码无效引用清理,试压包资料界面看板修改

This commit is contained in:
2025-10-10 14:33:21 +08:00
parent 87fb529521
commit 55b798135c
933 changed files with 5897 additions and 7541 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ namespace BLL
return getDataLists;
}
}
/// <summary>
/// +
/// </summary>
+1 -1
View File
@@ -18,7 +18,7 @@ namespace BLL
/// <returns></returns>
public static string Http(string url, string method = "GET", string contenttype = "application/json;charset=utf-8", Hashtable header = null, string data = null)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 ;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = string.IsNullOrEmpty(method) ? "GET" : method;
-2
View File
@@ -1,10 +1,8 @@
using Model;
using NPOI.SS.Formula.PTG;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web.Security;
namespace BLL
{
+32 -32
View File
@@ -16,8 +16,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)
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));
if (getUser != null)
{
@@ -107,8 +107,8 @@ namespace BLL
{
var getUser = (from x in db.Person_Persons
join y in db.Sys_Role on x.RoleIds equals y.RoleId
where x.UnitId == unitId && x.IsPost == true && (strParam == null || x.PersonName.Contains(strParam))
&& x.RoleIds .Length > 1 && x.Account.Length > 1
where x.UnitId == unitId && x.IsPost == true && (strParam == null || x.PersonName.Contains(strParam))
&& x.RoleIds.Length > 1 && x.Account.Length > 1
orderby x.PersonName
select new Model.BaseInfoItem { BaseInfoId = x.PersonId, BaseInfoName = x.PersonName, BaseInfoCode = x.Telephone }).ToList();
@@ -131,10 +131,10 @@ namespace BLL
List<string> roleList = Funs.GetStrListByStr(roleIds, ',');
if (!string.IsNullOrEmpty(projectId))
{
var getDatas = from x in db.Person_Persons
var getDatas = from x in db.Person_Persons
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
where y.ProjectId == projectId && y.States == Const.State_1 && y.RoleIds.Length>1 && x.Account.Length > 1
select new Model.UserItem
where y.ProjectId == projectId && y.States == Const.State_1 && y.RoleIds.Length > 1 && x.Account.Length > 1
select new Model.UserItem
{
PersonId = x.PersonId,
Account = x.Account,
@@ -173,27 +173,27 @@ namespace BLL
}
else
{
var getPersons =from x in db.Person_Persons
where x.IsPost == true && x.RoleIds.Length>1 && x.Account.Length > 1
select new Model.UserItem
{
PersonId = x.PersonId,
Account = x.Account,
UserCode = x.JobNum,
Password = x.Password,
PersonName = x.PersonName,
RoleId = x.RoleIds,
RoleName = db.Sys_Role.First(z => z.RoleId == x.RoleIds).RoleName,
UnitId = x.UnitId,
UnitName = db.Base_Unit.First(z => z.UnitId == x.UnitId).UnitName,
//LoginProjectId = y.ProjectId,
//LoginProjectName = db.Base_Project.First(z => z.ProjectId == y.ProjectId).ProjectName,
IdentityCard = x.IdentityCard,
Email = x.Email,
Telephone = x.Telephone,
IsOffice = x.IsOffice,
SignatureUrl = x.SignatureUrl.Replace('\\', '/'),
};
var getPersons = from x in db.Person_Persons
where x.IsPost == true && x.RoleIds.Length > 1 && x.Account.Length > 1
select new Model.UserItem
{
PersonId = x.PersonId,
Account = x.Account,
UserCode = x.JobNum,
Password = x.Password,
PersonName = x.PersonName,
RoleId = x.RoleIds,
RoleName = db.Sys_Role.First(z => z.RoleId == x.RoleIds).RoleName,
UnitId = x.UnitId,
UnitName = db.Base_Unit.First(z => z.UnitId == x.UnitId).UnitName,
//LoginProjectId = y.ProjectId,
//LoginProjectName = db.Base_Project.First(z => z.ProjectId == y.ProjectId).ProjectName,
IdentityCard = x.IdentityCard,
Email = x.Email,
Telephone = x.Telephone,
IsOffice = x.IsOffice,
SignatureUrl = x.SignatureUrl.Replace('\\', '/'),
};
if (!string.IsNullOrEmpty(unitId))
{
@@ -236,7 +236,7 @@ namespace BLL
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
join z in db.Project_ProjectUnit on x.UnitId equals z.UnitId
where y.ProjectId == projectId && z.ProjectId == projectId && z.UnitType == unitType && y.States == Const.State_1
&& (strParam == null || x.PersonName.Contains(strParam)) && y.RoleIds.Length>1 && x.Account.Length > 1
&& (strParam == null || x.PersonName.Contains(strParam)) && y.RoleIds.Length > 1 && x.Account.Length > 1
select new Model.UserItem
{
PersonId = x.PersonId,
@@ -268,7 +268,7 @@ namespace BLL
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
join z in db.Project_ProjectUnit on x.UnitId equals z.UnitId
where y.ProjectId == projectId && z.ProjectId == projectId && z.UnitType == unitType && y.States == Const.State_1
&& (strParam == null || x.PersonName.Contains(strParam)) && y.RoleIds.Contains(item) && y.RoleIds.Length>1 && x.Account.Length > 1
&& (strParam == null || x.PersonName.Contains(strParam)) && y.RoleIds.Contains(item) && y.RoleIds.Length > 1 && x.Account.Length > 1
select new Model.UserItem
{
PersonId = x.PersonId,
@@ -348,7 +348,7 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getUser = db.Person_Persons.FirstOrDefault(x => x.PersonId == personId);
if (getUser != null&&!string .IsNullOrEmpty(SignatureUrl))
if (getUser != null && !string.IsNullOrEmpty(SignatureUrl))
{
getUser.SignatureUrl = SignatureUrl;
db.SubmitChanges();
@@ -445,7 +445,7 @@ namespace BLL
{
var getDatas = (from x in db.Person_Persons
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
where y.ProjectId == projectId && y.States == Const.State_1 && y.RoleIds.Length>1 && x.Account.Length > 1
where y.ProjectId == projectId && y.States == Const.State_1 && y.RoleIds.Length > 1 && x.Account.Length > 1
select new Model.UserItem
{
PersonId = x.PersonId,
+10 -13
View File
@@ -1,12 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
namespace BLL
{
public class APIHJGLIndexService
public class APIHJGLIndexService
{
public static Model.HJGLIndexItem GetJGLIndexItem(string projectid)
{
@@ -37,7 +33,8 @@ namespace BLL
UnitWorkName = z.UnitWorkName,
MaterialCode = z.MaterialCode
}).ToList();
var tb_type06 = getCH_CheckItemList.GroupBy(x => x.JointAttribute).Select(x => new {
var tb_type06 = getCH_CheckItemList.GroupBy(x => x.JointAttribute).Select(x => new
{
JointAttribute = x.Key,
Current_pass_film = x.Sum(m => m.CHT_PassFilm) ?? 0,
Cht_totalfilm = x.Sum(m => m.CHT_TotalFilm) ?? 0
@@ -46,16 +43,16 @@ namespace BLL
var XC_model = tb_type06.Where(x => x.JointAttribute == "安装口").FirstOrDefault();
double PassRate1 = 0;
double PassRate2 = 0;
if (GC_model!=null &&GC_model.Cht_totalfilm>0)
if (GC_model != null && GC_model.Cht_totalfilm > 0)
{
PassRate1 = Math.Round((100 * GC_model.Current_pass_film * 1.0) / GC_model.Cht_totalfilm, 1);
}
if (XC_model!=null&& XC_model.Cht_totalfilm > 0)
if (XC_model != null && XC_model.Cht_totalfilm > 0)
{
PassRate2 = Math.Round((100 * XC_model.Current_pass_film * 1.0) / XC_model.Cht_totalfilm, 1);
}
hJGLIndexItem.GCFirstPassRate = PassRate1.ToString()+" %";
hJGLIndexItem.XCFirstPassRate = PassRate2.ToString()+" %";
hJGLIndexItem.GCFirstPassRate = PassRate1.ToString() + " %";
hJGLIndexItem.XCFirstPassRate = PassRate2.ToString() + " %";
hJGLIndexItem.GCProgress = BLL.HJGL_WeldingReportService.GetGCRate_finished(projectid).ToString() + "/" + HJGL_WeldingReportService.GetSumSize(projectid, 1).ToString() + " DIN";
hJGLIndexItem.XCProgress = BLL.HJGL_WeldingReportService.GetXCRate_finished(projectid).ToString() + "/" + HJGL_WeldingReportService.GetSumSize(projectid, 2).ToString() + " DIN";
@@ -66,12 +63,12 @@ namespace BLL
}
else
{
hJGLIndexItem.PipePrefabricationRate = Math.Floor(Math.Round(decimal.Parse((PipeRate1 / (PipeRate1 + PipeRate2)).ToString("0.000")), 2) * 100).ToString()+" %";
hJGLIndexItem.PipePrefabricationRate = Math.Floor(Math.Round(decimal.Parse((PipeRate1 / (PipeRate1 + PipeRate2)).ToString("0.000")), 2) * 100).ToString() + " %";
}
hJGLIndexItem.GCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_GC(projectid).ToString()+" DIN/天";
hJGLIndexItem.XCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_XC(projectid).ToString()+" DIN/天";
hJGLIndexItem.GCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_GC(projectid).ToString() + " DIN/天";
hJGLIndexItem.XCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_XC(projectid).ToString() + " DIN/天";
return hJGLIndexItem;
}
+10 -11
View File
@@ -1,5 +1,4 @@
using FineUIPro;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -263,13 +262,13 @@ namespace BLL
/// </summary>
/// <param name="weldJointId"></param>
/// <returns></returns>
public static string ManualPointSave(string weldJointId)
public static string ManualPointSave(string weldJointId)
{
string res = "";
string res = "";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var PointBatchItemModel = db.HJGL_Batch_PointBatchItem.FirstOrDefault(e => e.WeldJointId == weldJointId);
var PointBatchId= PointBatchItemModel.PointBatchId;
var PointBatchId = PointBatchItemModel.PointBatchId;
var batch = BLL.PointBatchService.GetPointBatchById(PointBatchId);
if (!batch.EndDate.HasValue)
{
@@ -290,7 +289,7 @@ namespace BLL
where z.PointBatchId == PointBatchId
select x).FirstOrDefault();
if (pipeline != null)
{
{
Model.Base_DetectionRate rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(pipeline.DetectionRateId);
if (rate != null)
{
@@ -310,13 +309,13 @@ namespace BLL
select x).Count();
if (weldJoint.JointAttribute == "安装口" && pointGNum >= pointNumG)
{
res = "安装口已达检测标准,无需再点此安装口!";
res = "安装口已达检测标准,无需再点此安装口!";
return res;
}
if (weldJoint.JointAttribute == "预制口" && pointNotGNum >= pointNumA)
{
res = "预制口已达检测标准,无需再点此预制口!";
return res;
return res;
}
}
}
@@ -354,7 +353,7 @@ namespace BLL
if (weldJoint.JointAttribute == "安装口" && pointGNum >= pointNumG)
{
res = "安装口已达检测标准,无需再点此安装口!";
return res;
return res;
}
if (weldJoint.JointAttribute == "预制口" && pointNotGNum >= pointNumA)
{
@@ -365,7 +364,7 @@ namespace BLL
}
}
PointBatchDetailService.UpdatePointBatchDetail(PointBatchItemModel.PointBatchItemId, "1", System.DateTime.Now);
}
else
@@ -375,7 +374,7 @@ namespace BLL
}
return res;
}
}
#region
/// <summary>
/// 点口调整
+80 -46
View File
@@ -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);
}
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ namespace BLL
{
// 从数据库中获取符合条件的管线数据
var pipelines = db.HJGL_Pipeline
.Where(p =>p.ProjectId==projectid&& p.PipelineCode.Contains(pipelineCode))
.Where(p => p.ProjectId == projectid && p.PipelineCode.Contains(pipelineCode))
.OrderBy(p => p.PipelineCode)
.ToList();
return pipelines;
@@ -1,14 +1,11 @@
using NPOI.OpenXmlFormats.Shared;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
namespace BLL
{
public class APIPipelineComponentService
public class APIPipelineComponentService
{
public static List<PipelineComponentItem> GetPackagingManageList(string projectid)
{
@@ -16,25 +13,25 @@ namespace BLL
{
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
join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into pp
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
join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into pp
from t in tt.DefaultIfEmpty()
from p in pp.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 = string.Format("{0:g}", y.PlanStartDate) ,
QRCode = x.QRCode,
ReceiveMan=p.PersonName,
ReceiveDate= string.Format("{0:g}", x.ReceiveDate)
}).Distinct();
select new PipelineComponentItem
{
PipelineComponentId = x.PipelineComponentId,
PipelineComponentCode = x.PipelineComponentCode,
PreUnit = t.UnitName,
DrawingName = x.DrawingName,
BoxNumber = x.BoxNumber,
State = x.State,
PlanStartDate = string.Format("{0:g}", y.PlanStartDate),
QRCode = x.QRCode,
ReceiveMan = p.PersonName,
ReceiveDate = string.Format("{0:g}", x.ReceiveDate)
}).Distinct();
return q.ToList();
}
@@ -52,8 +49,8 @@ namespace BLL
from t in tt.DefaultIfEmpty()
from p in pp.DefaultIfEmpty()
join unitwork in db.WBS_UnitWork on y.UnitWorkId equals unitwork.UnitWorkId into unitworks
from unitwork in unitworks.DefaultIfEmpty()
where x.PipelineComponentId== PipelineComponentId
from unitwork in unitworks.DefaultIfEmpty()
where x.PipelineComponentId == PipelineComponentId
select new PipelineComponentItem
{
PipelineComponentId = x.PipelineComponentId,
@@ -61,12 +58,12 @@ namespace BLL
PreUnit = t.UnitName,
DrawingName = x.DrawingName,
BoxNumber = x.BoxNumber,
State = x.State,
State = x.State,
PlanStartDate = string.Format("{0:g}", y.PlanStartDate),
QRCode = x.QRCode,
ReceiveMan = p.PersonName,
ReceiveDate = string.Format("{0:g}", x.ReceiveDate),
UnitWorkName=unitwork.UnitWorkName,
UnitWorkName = unitwork.UnitWorkName,
Remark = x.Remark
}).FirstOrDefault();
if (q != null)
@@ -84,7 +81,7 @@ namespace BLL
}
}
public static void GetComponentConfirmArrival(string PipelineComponentId,string PersonId,string message)
public static void GetComponentConfirmArrival(string PipelineComponentId, string PersonId, string message)
{
var q = BLL.HJGL_PipelineComponentService.GetPipelineComponentById(PipelineComponentId);
if (q != null)
@@ -92,7 +89,7 @@ namespace BLL
if (!string.IsNullOrEmpty(message))
{
q.State = HJGL_PipelineComponentService.StatePenRec;
q.Remark=message;
q.Remark = message;
}
else
{
+45 -48
View File
@@ -1,11 +1,7 @@
using NPOI.SS.Formula.Functions;
using System;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using static QRCoder.PayloadGenerator;
namespace BLL
{
@@ -237,7 +233,7 @@ namespace BLL
ProjectId = newItem.ProjectId,
UnitWorkId = newItem.UnitWorkId,
UnitId = newItem.UnitId,
WeldingDate = newItem.WeldingDate,
WeldingDate = newItem.WeldingDate,
Tabler = newItem.Tabler,
TableDate = newItem.TableDate,
Remark = newItem.Remark,
@@ -257,54 +253,55 @@ namespace BLL
}
#endregion
public static string SaveWeldingDailyByWeldJointId(string WeldJointId, string Personid, string time)
public static string SaveWeldingDailyByWeldJointId(string WeldJointId, string Personid, string time)
{
string res = "";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try {
var peson=db.Person_Persons.FirstOrDefault(x => x.PersonId == Personid);
if (peson == null)
{
try
{
res = "人员不存在";
return res;
}
var joint = db.View_HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId);
if (joint == null)
{
res = "焊口不存在";
return res;
}
var weldingDaily = db.HJGL_WeldingDaily.FirstOrDefault(x => x.WeldingDate.Value.Date == Convert.ToDateTime(time).Date && x.UnitWorkId == joint.UnitWorkId);
var weldTask=db.HJGL_WeldTask.FirstOrDefault(x=>x.WeldJointId==joint.WeldJointId);
if (weldingDaily == null)
{
string perfix = string.Format("{0:yyyyMMdd}", System.DateTime.Now) + "-" + peson.PersonName + "-";
weldingDaily = new Model.HJGL_WeldingDaily();
weldingDaily.WeldingDailyId = Guid.NewGuid().ToString();
weldingDaily.WeldingDailyCode = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "dbo.HJGL_WeldingDaily", "WeldingDailyCode", joint.ProjectId, perfix);
weldingDaily.WeldingDate = Convert.ToDateTime(time).Date;
weldingDaily.ProjectId = joint.ProjectId;
weldingDaily.UnitWorkId = joint.UnitWorkId;
weldingDaily.UnitId = weldTask?.UnitId;
weldingDaily.Tabler = Personid;
weldingDaily.TableDate = Convert.ToDateTime(time).Date;
db.HJGL_WeldingDaily.InsertOnSubmit(weldingDaily);
db.SubmitChanges();
}
BLL.HJGL_PipelineComponentjointService.UpdateStateByWeldJointId(WeldJointId, (DateTime)weldingDaily.WeldingDate);//更改预制口实际时间和状态
PipelineService.UpdataDateByWeldJointId(WeldJointId);//更改安装口时间和状态
var peson = db.Person_Persons.FirstOrDefault(x => x.PersonId == Personid);
if (peson == null)
{
res = "人员不存在";
return res;
}
var joint = db.View_HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId);
if (joint == null)
{
res = "焊口不存在";
return res;
}
var weldingDaily = db.HJGL_WeldingDaily.FirstOrDefault(x => x.WeldingDate.Value.Date == Convert.ToDateTime(time).Date && x.UnitWorkId == joint.UnitWorkId);
var weldTask = db.HJGL_WeldTask.FirstOrDefault(x => x.WeldJointId == joint.WeldJointId);
if (weldingDaily == null)
{
string perfix = string.Format("{0:yyyyMMdd}", System.DateTime.Now) + "-" + peson.PersonName + "-";
weldingDaily = new Model.HJGL_WeldingDaily();
weldingDaily.WeldingDailyId = Guid.NewGuid().ToString();
weldingDaily.WeldingDailyCode = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "dbo.HJGL_WeldingDaily", "WeldingDailyCode", joint.ProjectId, perfix);
weldingDaily.WeldingDate = Convert.ToDateTime(time).Date;
weldingDaily.ProjectId = joint.ProjectId;
weldingDaily.UnitWorkId = joint.UnitWorkId;
weldingDaily.UnitId = weldTask?.UnitId;
weldingDaily.Tabler = Personid;
weldingDaily.TableDate = Convert.ToDateTime(time).Date;
db.HJGL_WeldingDaily.InsertOnSubmit(weldingDaily);
db.SubmitChanges();
}
BLL.HJGL_PipelineComponentjointService.UpdateStateByWeldJointId(WeldJointId, (DateTime)weldingDaily.WeldingDate);//更改预制口实际时间和状态
PipelineService.UpdataDateByWeldJointId(WeldJointId);//更改安装口时间和状态
var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", joint.ProjectId);
if (batchC != null)
{
string batchCondition = batchC.SetValue;
InsertWeldingDailyItem(WeldJointId, Personid, Personid, joint.JointAttribute, weldingDaily.WeldingDate, batchCondition, true, weldingDaily.WeldingDailyId, joint.ProjectId);
}
BLL.WeldJointService.UpdateWeldJointAddG(WeldJointId, joint.JointAttribute, Const.BtnAdd);
if (batchC != null)
{
string batchCondition = batchC.SetValue;
InsertWeldingDailyItem(WeldJointId, Personid, Personid, joint.JointAttribute, weldingDaily.WeldingDate, batchCondition, true, weldingDaily.WeldingDailyId, joint.ProjectId);
}
BLL.WeldJointService.UpdateWeldJointAddG(WeldJointId, joint.JointAttribute, Const.BtnAdd);
}
catch (Exception ex)
{
APICommonService.SaveSysAPILog("erro", ex.ToString(),"-1");
APICommonService.SaveSysAPILog("erro", ex.ToString(), "-1");
}
}
@@ -463,9 +460,9 @@ namespace BLL
/// <returns></returns>
private static string InsertWeldingDailyItem(string weldJointId, string coverWelderId, string backingWelderId, string jointAttribute, DateTime? weldingDate, string batchCondition, bool isSave, string weldingDailyId, string projectId)
{
string errlog = string.Empty;
string errlog = string.Empty;
var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId);
var pipeline = BLL.PipelineService.GetPipelineByPipelineId(newWeldJoint.PipelineId);
var pipeline = BLL.PipelineService.GetPipelineByPipelineId(newWeldJoint.PipelineId);
var weldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(weldingDailyId);
if (newWeldJoint != null /*&& string.IsNullOrEmpty(newWeldJoint.WeldingDailyId)*/)
{
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
@@ -15,13 +12,17 @@ namespace BLL
/// <param name="PersonId"></param>
public static void SaveTrainInfoConfirmArrival(string id, string PersonId)
{
var model=TrainNumberManageService.GetModelById(id);
if (model!=null)
var model = TrainNumberManageService.GetModelById(id);
if (model != null)
{
model.ReceiveDate = DateTime.Now;
TrainNumberManageService.Update(model);
}
var packManagerList= HJGLPackagingmanageService.GetPackagingManage(id);
else
{
throw new Exception("车次信息有误,请检查!");
}
var packManagerList = HJGLPackagingmanageService.GetPackagingManage(id);
foreach (var item in packManagerList)
{
BLL.APIPackagingManageService.GetPackingInfoConfirmArrival(item.PackagingManageId, PersonId);
@@ -65,13 +66,52 @@ namespace BLL
{
throw new Exception("未找到对应的包装信息");
}
if (packModel.State != HJGLPackagingmanageService.state_0)
/*if (packModel.State != HJGLPackagingmanageService.state_0)
{
throw new Exception("当前包装状态不可修改车次号");
}
}*/
packModel.TrainNumberId = null;
packModel.TrainNumber = null;
HJGLPackagingmanageService.UpdateHJGL_PackagingManage(packModel);
}
/// <summary>
/// 新增或更新车次信息。若 model.Id 为空则新增,否则修改。返回创建或更新后的Id。
/// 新增时 State=0ReceiveDate=null;修改时保持原有 State 和 ReceiveDate。
/// </summary>
public static string AddOrUpdateTrainNumber(Model.HJGL_TrainNumberManage model)
{
if (model == null)
{
throw new ArgumentNullException(nameof(model));
}
if (string.IsNullOrEmpty(model.Id))
{
// 新增
model.Id = SQLHelper.GetNewID(typeof(Model.HJGL_TrainNumberManage));
model.ReceiveDate = null;
TrainNumberManageService.Add(model);
return model.Id;
}
else
{
// 修改
var exist = TrainNumberManageService.GetModelById(model.Id);
if (exist == null)
{
model.ReceiveDate = null;
TrainNumberManageService.Add(model);
return model.Id;
}
else
{
// 保持原有ReceiveDate
model.ReceiveDate = exist.ReceiveDate;
TrainNumberManageService.Update(model);
return model.Id;
}
}
}
}
}
+3 -3
View File
@@ -106,7 +106,7 @@ namespace BLL
{
CheckSpecialId = newItem.CheckSpecialId,
CheckSpecialCode = newItem.CheckSpecialCode,
// CheckItemSetId = newItem.CheckItemSetId,
// CheckItemSetId = newItem.CheckItemSetId,
CheckType = newItem.CheckType,
ProjectId = newItem.ProjectId,
CheckPerson = newItem.CheckPersonId,
@@ -119,7 +119,7 @@ namespace BLL
CompileMan = newItem.CompileManId,
States = Const.State_0,
};
var getCheckSet=db.Technique_CheckItemSet.FirstOrDefault(x=>x.CheckItemSetId == newItem.CheckItemSetId);
var getCheckSet = db.Technique_CheckItemSet.FirstOrDefault(x => x.CheckItemSetId == newItem.CheckItemSetId);
if (getCheckSet != null)
{
newCheckSpecial.CheckItemSetId = newItem.CheckItemSetId;
@@ -318,7 +318,7 @@ namespace BLL
LimitedDate = Funs.GetNewDateTime(newDetail.LimitedDate),
CompletedDate = Funs.GetNewDateTime(newDetail.CompletedDate),
Suggestions = newDetail.Suggestions,
// WorkArea = newDetail.WorkArea,
// WorkArea = newDetail.WorkArea,
CheckArea = newDetail.WorkAreaId,
CheckContent = newDetail.CheckContent,
};
@@ -82,8 +82,8 @@ namespace BLL
RegisterTypes2Id = string.IsNullOrEmpty(hazardRegister.RegisterTypes2Id) ? null : hazardRegister.RegisterTypes2Id,
RegisterTypes3Id = string.IsNullOrEmpty(hazardRegister.RegisterTypes3Id) ? null : hazardRegister.RegisterTypes3Id,
RegisterTypes4Id = string.IsNullOrEmpty(hazardRegister.RegisterTypes4Id) ? null : hazardRegister.RegisterTypes4Id,
WorkPackageId=WorkPackageService.getWorkPageIdsByControlItemAndCycle(hazardRegister.WorkPackageId, null),
WorkPackageName= WorkPackageService.getWorkPageNamesByControlItemAndCycle(hazardRegister.WorkPackageId, null),
WorkPackageId = WorkPackageService.getWorkPageIdsByControlItemAndCycle(hazardRegister.WorkPackageId, null),
WorkPackageName = WorkPackageService.getWorkPageNamesByControlItemAndCycle(hazardRegister.WorkPackageId, null),
};
var isUpdate = db.HSSE_Hazard_HazardRegister.FirstOrDefault(x => x.HazardRegisterId == newHazardRegister.HazardRegisterId);
if (isUpdate == null)
@@ -152,7 +152,7 @@ namespace BLL
{
var hazardRegisters = (from x in db.HSSE_Hazard_HazardRegister
join y in db.Base_Project on x.ProjectId equals y.ProjectId
join u in db.Base_Unit on x.ResponsibleUnit equals u.UnitId
join u in db.Base_Unit on x.ResponsibleUnit equals u.UnitId
where x.ProjectId != null && x.States != null
select new Model.HazardRegisterItem
{
@@ -173,7 +173,7 @@ namespace BLL
ResponsibilityUnitName = db.Base_Unit.First(U => x.ResponsibleUnit == U.UnitId).UnitName,
ResponsibilityManName = "",
RectificationTime = x.RectificationTime,
Risk_Level = (x.HazardValue =="3"?"重大":"一般"),
Risk_Level = (x.HazardValue == "3" ? "重大" : "一般"),
}).OrderBy(x => x.CheckTime).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
return hazardRegisters;
+12 -13
View File
@@ -1,5 +1,4 @@
using Model;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -195,9 +194,9 @@ namespace BLL
}
var getMaxMonthReport = (from x in Funs.DB.SeDin_MonthReport
where x.ProjectId == projectId && x.ReporMonth < monthD
where x.ProjectId == projectId && x.ReporMonth < monthD
orderby x.ReporMonth descending
select x).FirstOrDefault();
select x).FirstOrDefault();
if (getMaxMonthReport != null)
{
var getMonthReport2 = Funs.DB.SeDin_MonthReport2.FirstOrDefault(x => x.MonthReportId == getMaxMonthReport.MonthReportId);
@@ -480,7 +479,7 @@ namespace BLL
///当月费用
var getCostManage = from x in db.CostGoods_CostManageItem
join y in db.CostGoods_CostManage on x.CostManageId equals y.CostManageId
where y.ProjectId ==projectId && y.CostManageDate >= startDateD && y.CostManageDate < endDateD.Value.AddDays(1)
where y.ProjectId == projectId && y.CostManageDate >= startDateD && y.CostManageDate < endDateD.Value.AddDays(1)
&& y.States == Const.State_2
select x;
if (getCostManage.Count() > 0)
@@ -521,11 +520,11 @@ namespace BLL
if (monthD >= Funs.GetNewDateTime("2023-07-01"))
{
getLists.SafetyYear += getLastMonthReport6.SafetyYear;
getLists.SafetyTotal += getLastMonthReport6.SafetyTotal;
getLists.SafetyTotal += getLastMonthReport6.SafetyTotal;
getLists.ProgressYear += getLastMonthReport6.ProgressYear;
getLists.ProgressTotal += getLastMonthReport6.ProgressTotal;
getLists.EducationYear += getLastMonthReport6.EducationYear;
getLists.EducationTotal += getLastMonthReport6.EducationTotal;
getLists.EducationTotal += getLastMonthReport6.EducationTotal;
}
else
{
@@ -540,16 +539,16 @@ namespace BLL
else
{
if (monthD >= Funs.GetNewDateTime("2023-07-01"))
{
{
getLists.SafetyTotal += getLastMonthReport6.SafetyTotal;
getLists.ProgressTotal += getLastMonthReport6.ProgressTotal;
getLists.EducationTotal += getLastMonthReport6.EducationTotal;
}
else
{
getLists.SafetyTotal += (getLastMonthReport6.SafetyTotal + getLastMonthReport6.ProgressTotal + getLastMonthReport6.EducationTotal);
{
getLists.SafetyTotal += (getLastMonthReport6.SafetyTotal + getLastMonthReport6.ProgressTotal + getLastMonthReport6.EducationTotal);
}
getLists.LaborTotal += getLastMonthReport6.LaborTotal;
getLists.SumTotal += getLastMonthReport6.SumTotal;
@@ -557,7 +556,7 @@ namespace BLL
}
}
return getLists;
return getLists;
}
}
#endregion
+2 -2
View File
@@ -94,7 +94,7 @@ namespace BLL
var item = db.Training_TestRecordItem.FirstOrDefault(x => x.TestRecordId == getTestRecord.TestRecordId);
if (item == null)
{
List<Model.Training_TestTrainingItem> getTestTrainingItemList = new List<Model.Training_TestTrainingItem>();
List<Model.Training_TestTrainingItem> getTestTrainingItemList = new List<Model.Training_TestTrainingItem>();
var testPlanTrainings = (from x in db.Training_TestPlanTraining
where x.TestPlanId == getTestPlan.TestPlanId
select new { x.TestPlanId, x.TrainingId, x.TestType1Count, x.TestType2Count, x.TestType3Count }).Distinct();
@@ -522,7 +522,7 @@ namespace BLL
foreach (var item in getTrainingTasks)
{
item.States = "2";
}
getTestPlan.States = "3";
db.SubmitChanges();
+1 -1
View File
@@ -102,7 +102,7 @@ namespace BLL
else
{
var person = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == personId && plan.ProjectId == e.ProjectId);
if (person != null && plan.UnitIds.Contains(person.UnitId)
if (person != null && plan.UnitIds.Contains(person.UnitId)
&& (string.IsNullOrEmpty(plan.WorkPostId) || plan.WorkPostId.Contains(person.WorkPostId)))
{
var trainType = db.Base_TrainType.FirstOrDefault(e => e.TrainTypeId == plan.TrainTypeId);
+2 -2
View File
@@ -73,7 +73,7 @@ namespace BLL
}
Person_Persons getPerson = new Person_Persons();
getPerson = Person_PersonsService.GetPerson_PersonsByIdCard(item.IdentityCard);
if (getPerson==null)
if (getPerson == null)
{
getPerson = Person_PersonsService.GetPerson_PersonsByJobNum(item.UserCode);
@@ -114,7 +114,7 @@ namespace BLL
PersonName = item.UserName,
IdentityCard = item.IdentityCard,
UnitId = Const.UnitId_SEDIN,
DataFrom = "API"
};