diff --git a/DataBase/ConstInitData.sql b/DataBase/ConstInitData.sql
index bd27932e..eb357dc8 100644
--- a/DataBase/ConstInitData.sql
+++ b/DataBase/ConstInitData.sql
@@ -538,36 +538,40 @@ GO
--GO
/*项目*/
+
INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
VALUES('D097252D-B42A-4CAE-9030-A5C351057ABD','Menu_ProjectSet','项目设置',1,'MenuType_P')
GO
-INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
-VALUES('E116D85E-6215-4299-9EEA-FBC46B0E6163','Menu_CQMS','质量管理',2,'MenuType_P')
+INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
+VALUES('CF2CA03F-84B3-432E-AEAC-4ECF7890D6D7','Menu_PZHGL','施工管理',2,'MenuType_P')
GO
INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
-VALUES('35282E20-81AB-4DA2-80F2-8F136776642D','Menu_HSSE','安全管理',3,'MenuType_P')
+VALUES('E116D85E-6215-4299-9EEA-FBC46B0E6163','Menu_CQMS','质量管理',3,'MenuType_P')
GO
INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
-VALUES('B4F6F0B8-C7AD-421A-9BE3-DCC70EB39A8C','Menu_JDGL','进度管理',4,'MenuType_P')
+VALUES('B4F6F0B8-C7AD-421A-9BE3-DCC70EB39A8C','Menu_JDGL','进度/计划',4,'MenuType_P')
GO
INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
-VALUES('CE689095-841F-4714-A2B4-BF72D13E2B94','Menu_HJGL','焊接管理',5,'MenuType_P')
+VALUES('35282E20-81AB-4DA2-80F2-8F136776642D','Menu_HSSE','HSE管理',5,'MenuType_P')
+GO
+INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
+VALUES('CE689095-841F-4714-A2B4-BF72D13E2B94','Menu_HJGL','焊接管理',6,'MenuType_P')
GO
INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
-VALUES('7AD04F82-91B3-4579-993C-8C8FAC503864','Menu_TestRun','试车管理',6,'MenuType_P')
-GO
-INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
-VALUES('CF2CA03F-84B3-432E-AEAC-4ECF7890D6D7','Menu_PZHGL','施工综合',7,'MenuType_P')
+VALUES('7AD04F82-91B3-4579-993C-8C8FAC503864','Menu_TestRun','试车管理',7,'MenuType_P')
GO
INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
-VALUES('85CF0BBF-A3F3-42DF-89DC-CE9A4886BCA1','Menu_DigitalSite','视频监控',8,'MenuType_P')
+VALUES('126FB0AC-521C-4145-86FC-B507D83B7646','Menu_Change','变更管理',8,'MenuType_P')
+GO
+INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
+VALUES('C0457DFF-AAA3-4019-AC9B-34BF22BF3A0E','Menu_DocControl','文控管理',9,'MenuType_P')
+GO
+INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
+VALUES('0B13D4A9-E047-4C18-AD68-8D3724D4F0A8','Menu_Attendance','现场考勤',10,'MenuType_P')
+GO
+INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
+VALUES('85CF0BBF-A3F3-42DF-89DC-CE9A4886BCA1','Menu_Video','视频监控',11,'MenuType_P')
GO
---INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
---VALUES('0B13D4A9-E047-4C18-AD68-8D3724D4F0A8','Menu_Video','现场考勤',9,'MenuType_P')
---GO
---INSERT INTO Sys_Const (ID,ConstValue,ConstText,SortIndex,GroupId)
---VALUES('69B856E6-E385-4771-9341-23E7416C46F1','Menu_PDigData','项目考勤',9,'MenuType_P')
---GO
--项目类型
INSERT INTO dbo.Sys_Const(ID, ConstValue, ConstText, SortIndex, GroupId)
diff --git a/DataBase/鐗堟湰鏃ュ織/SGGLDB_V2022-08-04-001淇敼鏄庣粏.txt b/DataBase/鐗堟湰鏃ュ織/宸叉洿鏂拌剼鏈/SGGLDB_V2022-08-04-001淇敼鏄庣粏.txt
similarity index 100%
rename from DataBase/鐗堟湰鏃ュ織/SGGLDB_V2022-08-04-001淇敼鏄庣粏.txt
rename to DataBase/鐗堟湰鏃ュ織/宸叉洿鏂拌剼鏈/SGGLDB_V2022-08-04-001淇敼鏄庣粏.txt
diff --git a/DataBase/鐗堟湰鏃ュ織/宸叉洿鏂拌剼鏈/SGGLDB_V2022-08-29-001.sql b/DataBase/鐗堟湰鏃ュ織/宸叉洿鏂拌剼鏈/SGGLDB_V2022-08-29-001.sql
new file mode 100644
index 00000000..50d55a1e
--- /dev/null
+++ b/DataBase/鐗堟湰鏃ュ織/宸叉洿鏂拌剼鏈/SGGLDB_V2022-08-29-001.sql
@@ -0,0 +1,4 @@
+ALTER TABLE [dbo].[EduTrain_TrainRecord] DROP CONSTRAINT [FK_EduTrain_TrainRecord_Training_Plan]
+GO
+
+
diff --git a/DataBase/鐗堟湰鏃ュ織/宸叉洿鏂拌剼鏈/SGGLDB_V2022-08-29-001淇敼鏄庣粏.txt b/DataBase/鐗堟湰鏃ュ織/宸叉洿鏂拌剼鏈/SGGLDB_V2022-08-29-001淇敼鏄庣粏.txt
new file mode 100644
index 00000000..854c6e83
--- /dev/null
+++ b/DataBase/鐗堟湰鏃ュ織/宸叉洿鏂拌剼鏈/SGGLDB_V2022-08-29-001淇敼鏄庣粏.txt
@@ -0,0 +1,3 @@
+--ADD BY YangHongwei 2022-08-29
+1銆佹棴绉戦」鐩紙寮犺嫳榄侊級澶勭悊鏈仛鍩硅璁″垝锛岀洿鎺ユ寜鐓ц冭瘯璁″垝鑰冭瘯鐨勬儏鍐碉紝鏂板鎸夐挳锛屾墜鍔ㄥ皢杩欓儴鍒嗚冭瘯璁板綍褰掑埌鍒板煿璁褰曚腑銆
+--END
\ No newline at end of file
diff --git a/SGGL/BLL/API/HSSE/APITrainRecordService.cs b/SGGL/BLL/API/HSSE/APITrainRecordService.cs
index 82a9ff42..c5ce2526 100644
--- a/SGGL/BLL/API/HSSE/APITrainRecordService.cs
+++ b/SGGL/BLL/API/HSSE/APITrainRecordService.cs
@@ -184,5 +184,96 @@ namespace BLL
}
}
#endregion
+
+ #region 灏嗙浉鍏虫湭鍋氬煿璁 浣嗚冭瘯鑰冪敓鍐呭 鍐欏煿璁褰曞綊妗
+ ///
+ /// 灏嗙浉鍏虫湭鍋氬煿璁 浣嗚冭瘯鑰冪敓鍐呭 鍐欏煿璁褰曞綊妗
+ ///
+ ///
+
+ public static void InsertTrainRecordNoTrainingPlan(Model.Training_TestPlan getTestPlan)
+ {
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
+ {
+ Model.EduTrain_TrainRecord newTrainRecord = new Model.EduTrain_TrainRecord
+ {
+ TrainingId = SQLHelper.GetNewID(),
+ TrainingCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectTrainRecordMenuId, getTestPlan.ProjectId, Const.UnitId_CWCEC),
+ ProjectId = getTestPlan.ProjectId,
+ TrainTitle = getTestPlan.PlanName,
+ TrainContent = getTestPlan.PlanName,
+ TrainStartDate = getTestPlan.TestStartTime,
+ TeachHour = getTestPlan.Duration,
+ TrainEndDate = getTestPlan.TestEndTime,
+ TeachMan = UserService.GetUserNameByUserId(getTestPlan.PlanManId),
+ TeachAddress = getTestPlan.TestPalce,
+ Remark = "鏉ユ簮锛氳冭瘯璁″垝",
+ TrainTypeId = Const.EntryTrainTypeId,
+ UnitIds = getTestPlan.UnitIds,
+ States = Const.State_2,
+ WorkPostIds = getTestPlan.WorkPostIds,
+ PlanId = getTestPlan.TestPlanId,
+ };
+ newTrainRecord.CompileMan = newTrainRecord.TeachMan;
+ ///鑾峰彇鍩硅浜哄憳
+ var getTestRecords = from x in db.Training_TestRecord
+ where x.TestPlanId == getTestPlan.TestPlanId
+ select x;
+ newTrainRecord.TrainPersonNum = getTestRecords.Count();
+ ///鏂板鍩硅璁板綍
+ db.EduTrain_TrainRecord.InsertOnSubmit(newTrainRecord);
+ db.SubmitChanges();
+
+ ////鍙婃牸鍒嗘暟
+ int passScore = 80;
+ var testRule = db.Sys_TestRule.FirstOrDefault();
+ if (testRule != null)
+ {
+ passScore = testRule.PassingScore;
+ }
+
+ foreach (var item in getTestRecords)
+ {
+ var getItem = db.EduTrain_TrainRecordDetail.FirstOrDefault(x => x.PersonId == item.TestManId && x.CheckResult);
+ if (getItem == null)
+ {
+
+ decimal gScores = item.TestScores ?? 0;
+ bool result = false;
+ if (gScores >= passScore)
+ {
+ result = true;
+ }
+
+ Model.EduTrain_TrainRecordDetail newDetail = new Model.EduTrain_TrainRecordDetail
+ {
+ TrainDetailId = SQLHelper.GetNewID(),
+ TrainingId = newTrainRecord.TrainingId,
+ PersonId = item.TestManId,
+ CheckScore = gScores,
+ CheckResult = result,
+ };
+ db.EduTrain_TrainRecordDetail.InsertOnSubmit(newDetail);
+ db.SubmitChanges();
+
+ ///// 鍩硅鑰冭瘯 閫氳繃 鏇存柊鍗″彿
+ if (result)
+ {
+ var getPerson = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == newDetail.PersonId);
+ if (getPerson != null && string.IsNullOrEmpty(getPerson.CardNo))
+ {
+ getPerson.CardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", getPerson.ProjectId, UnitService.GetUnitCodeByUnitId(getPerson.UnitId));
+ db.SubmitChanges();
+ }
+ }
+ }
+
+ ////澧炲姞涓鏉$紪鐮佽褰
+ CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectTrainRecordMenuId, newTrainRecord.ProjectId, null, newTrainRecord.TrainingId, newTrainRecord.TrainStartDate);
+ CommonService.btnSaveData(newTrainRecord.ProjectId, Const.ProjectTrainRecordMenuId, newTrainRecord.TrainingId, getTestPlan.PlanManId, true, newTrainRecord.TrainTitle, "../EduTrain/TrainRecordView.aspx?TrainingId={0}");
+ }
+ }
+ }
+ #endregion
}
}
diff --git a/SGGL/BLL/HSSE/EduTrain/TestPlanService.cs b/SGGL/BLL/HSSE/EduTrain/TestPlanService.cs
index 90429d7f..dafd06de 100644
--- a/SGGL/BLL/HSSE/EduTrain/TestPlanService.cs
+++ b/SGGL/BLL/HSSE/EduTrain/TestPlanService.cs
@@ -147,7 +147,7 @@ namespace BLL
///
public static Model.Training_TestPlan GetTestPlanByPlanId(string planId)
{
- return Funs.DB.Training_TestPlan.FirstOrDefault(x => x.PlanId == planId);
+ return Funs.DB.Training_TestPlan.FirstOrDefault(x => x.PlanId == planId || x.TestPlanId ==planId);
}
}
}
diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.cs
index 015c7065..b2ed5240 100644
--- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.cs
@@ -1,4 +1,5 @@
锘縰sing BLL;
+using FineUIPro.Web.BoSheng;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -548,7 +549,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
{
var getTrainRecordDetail = Funs.DB.EduTrain_TrainRecordDetail.Where(x => x.TrainingId == itemRecord.TrainingId);
if (itemRecord.TrainPersonNum > getTrainRecordDetail.Count())
- {
+ {
var getTrainingTasks = from x in Funs.DB.Training_Task
where x.PlanId == itemRecord.PlanId
select x;
@@ -628,14 +629,36 @@ namespace FineUIPro.Web.HSSE.EduTrain
Alert.ShowInTop("鍒锋柊瀹屾垚锛", MessageBoxIcon.Success);
}
- var getTestPlanStates = from x in Funs.DB.Training_TestPlan
- join y in Funs.DB.Training_Plan on x.PlanId equals y.PlanId
- where x.States == Const.State_3 && y.States == Const.State_2
- select x;
- foreach (var item in getTestPlanStates)
+ var getTestPlans = from x in Funs.DB.Training_TestPlan
+ where x.ProjectId == this.CurrUser.LoginProjectId && x.States == Const.State_3
+ select x;
+
+ var getTestPlanStates = from x in getTestPlans
+ join y in Funs.DB.Training_Plan on x.PlanId equals y.PlanId
+ where x.PlanId != null && y.States == Const.State_2
+ select x;
+ if (getTestPlanStates.Count() > 0)
{
- ////TODO 璁插煿璁鍒 鑰冭瘯璁板綍 鍐欏叆鍒板煿璁褰
- BLL. APITrainRecordService.InsertTrainRecord(item);
+ foreach (var item in getTestPlanStates)
+ {
+ ////TODO 璁插煿璁鍒 鑰冭瘯璁板綍 鍐欏叆鍒板煿璁褰
+ BLL.APITrainRecordService.InsertTrainRecord(item);
+ }
+ }
+
+ var getTestPlanS = from x in getTestPlans
+ join y in Funs.DB.EduTrain_TrainRecord on x.TestPlanId equals y.PlanId into jonPerson
+ from y in jonPerson.DefaultIfEmpty()
+ where x.PlanId == null && y.TrainingId == null
+ orderby y.TrainStartDate
+ select x;
+ if (getTestPlanS.Count() > 0)
+ {
+ foreach (var item in getTestPlanS)
+ {
+ //// 灏嗙浉鍏虫湭鍋氬煿璁 浣嗚冭瘯鑰冪敓鍐呭 鍐欏煿璁褰曞綊妗
+ BLL.APITrainRecordService.InsertTrainRecordNoTrainingPlan(item);
+ }
}
}
}
diff --git a/SGGL/FineUIPro.Web/Login.aspx b/SGGL/FineUIPro.Web/Login.aspx
index c099a13a..422ad4f8 100644
--- a/SGGL/FineUIPro.Web/Login.aspx
+++ b/SGGL/FineUIPro.Web/Login.aspx
@@ -140,11 +140,11 @@
--%>
diff --git a/SGGL/WebAPI/Controllers/HSSE/TestingController.cs b/SGGL/WebAPI/Controllers/HSSE/TestingController.cs
index 320375dc..bab6c1bc 100644
--- a/SGGL/WebAPI/Controllers/HSSE/TestingController.cs
+++ b/SGGL/WebAPI/Controllers/HSSE/TestingController.cs
@@ -298,7 +298,16 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
- APITestRecordService.getTestRecordItemAnswerBySelectedItem(testRecordItemId, selectedItem);
+ if (!string.IsNullOrEmpty(testRecordItemId) && !string.IsNullOrEmpty(selectedItem))
+ {
+ APITestRecordService.getTestRecordItemAnswerBySelectedItem(testRecordItemId, selectedItem);
+ }
+ else
+ {
+ responeData.code = 0;
+ responeData.message = "绛旈涓虹┖閫夐」锛";
+ }
+
}
catch (Exception ex)
{