From 710db11e4352ffc55fe78c998ff4bea842ba2125 Mon Sep 17 00:00:00 2001
From: gaofei1985 <181547018@qq.com>
Date: Mon, 9 Jun 2025 10:47:10 +0800
Subject: [PATCH] 1
---
.../BLL/Common/ProjectSet/Project_UnitService.cs | 14 +++++++++++++-
.../Common/SysManage/Sys_UserSettingsService.cs | 2 +-
.../HJGL/WeldingReport/FeedbackResultSelect.aspx | 2 +-
HJGL_DS/FineUIPro.Web/Web.config | 2 +-
.../common/BaseInfo/ProjectSave.aspx.cs | 6 ++++++
5 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/HJGL_DS/BLL/Common/ProjectSet/Project_UnitService.cs b/HJGL_DS/BLL/Common/ProjectSet/Project_UnitService.cs
index a26e1d3..6e65558 100644
--- a/HJGL_DS/BLL/Common/ProjectSet/Project_UnitService.cs
+++ b/HJGL_DS/BLL/Common/ProjectSet/Project_UnitService.cs
@@ -73,7 +73,7 @@ namespace BLL
Model.SGGLDB db = Funs.DB;
var fbUnit = from x in db.Project_Unit
join y in db.Base_Unit on x.UnitId equals y.UnitId
- where x.ProjectId == projectId && y.IsSubUnit == isSubUnit
+ where x.ProjectId == projectId && y.IsSubUnit == isSubUnit
select x;
if (fbUnit.Count() > 0)
{
@@ -106,6 +106,18 @@ namespace BLL
return pUnit;
}
+ ///
+ /// 根据项目id和单位id获取单位是否在项目中
+ ///
+ ///
+ ///
+ ///
+ public static Model.Project_Unit GetProject_UnitByUnitId(string unitId)
+ {
+ var pUnit = Funs.DB.Project_Unit.FirstOrDefault(x => x.UnitId == unitId && x.UnitType != null && x.UnitType != "");
+ return pUnit;
+ }
+
///
/// 根据项目id获取项目单位信息
///
diff --git a/HJGL_DS/BLL/Common/SysManage/Sys_UserSettingsService.cs b/HJGL_DS/BLL/Common/SysManage/Sys_UserSettingsService.cs
index a299726..c5ca295 100644
--- a/HJGL_DS/BLL/Common/SysManage/Sys_UserSettingsService.cs
+++ b/HJGL_DS/BLL/Common/SysManage/Sys_UserSettingsService.cs
@@ -260,7 +260,7 @@ namespace BLL
pUnit.ProjectId = projectid;
pUnit.UnitId = item.UnitId;
//单位类型
- var bresult = bUnit.FirstOrDefault(x => x.UnitId == item.UnitId);
+ var bresult = bUnit.FirstOrDefault(x => x.UnitId == item.UnitId && x.UnitType!=null && x.UnitType!="");
if (bresult != null)
{
pUnit.UnitType = bresult.UnitType;
diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/FeedbackResultSelect.aspx b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/FeedbackResultSelect.aspx
index 4314d61..a02316e 100644
--- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/FeedbackResultSelect.aspx
+++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/FeedbackResultSelect.aspx
@@ -31,7 +31,7 @@
-
+
diff --git a/HJGL_DS/FineUIPro.Web/Web.config b/HJGL_DS/FineUIPro.Web/Web.config
index 97d6b43..bf404b8 100644
--- a/HJGL_DS/FineUIPro.Web/Web.config
+++ b/HJGL_DS/FineUIPro.Web/Web.config
@@ -11,7 +11,7 @@
-
+
diff --git a/HJGL_DS/FineUIPro.Web/common/BaseInfo/ProjectSave.aspx.cs b/HJGL_DS/FineUIPro.Web/common/BaseInfo/ProjectSave.aspx.cs
index 631a263..289d4c0 100644
--- a/HJGL_DS/FineUIPro.Web/common/BaseInfo/ProjectSave.aspx.cs
+++ b/HJGL_DS/FineUIPro.Web/common/BaseInfo/ProjectSave.aspx.cs
@@ -200,6 +200,11 @@ namespace FineUIPro.Web.common.BaseInfo
newUnit.ProjectId = newProjectId;
newUnit.UnitId = this.CurrUser.UnitId;
newUnit.InTime = System.DateTime.Now;
+ Model.Project_Unit pu = BLL.Project_UnitService.GetProject_UnitByUnitId(newUnit.UnitId);
+ if (pu != null)
+ {
+ newUnit.UnitType = pu.UnitType;
+ }
BLL.Project_UnitService.AddProject_Unit(newUnit);
// 给新项目项目用户插入当前用户
@@ -266,6 +271,7 @@ namespace FineUIPro.Web.common.BaseInfo
Model.Project_Unit nUnit = new Model.Project_Unit();
nUnit.UnitId = this.drpCheckUnit.SelectedValue;
nUnit.ProjectId = project.ProjectId;
+ nUnit.UnitType = BLL.Const.UnitType_8;
BLL.Project_UnitService.AddProject_Unit(nUnit);
}
}