小程序接口修改

This commit is contained in:
2023-07-11 16:32:16 +08:00
parent ca5c3fe9a7
commit 4449a7754f
68 changed files with 4634 additions and 2984 deletions
+35 -28
View File
@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using EmitMapper;
using EmitMapper.MappingConfiguration;
using Newtonsoft.Json.Linq;
namespace BLL
{
@@ -36,7 +37,7 @@ namespace BLL
TestPlanName = x.PlanName,
ProjectId = x.ProjectId,
DepartIds = x.DepartIds,
DepartNames = WorkPostService.getDepartNamesByIds(x.DepartIds),
DepartNames = WorkPostService.getDepartNamesByIdsForApi(x.DepartIds),
TestPlanManId = x.PlanManId,
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
TestPalce = x.TestPalce,
@@ -60,7 +61,7 @@ namespace BLL
ProjectId = x.ProjectId,
TestPlanManId = x.PlanManId,
DepartIds = x.DepartIds,
DepartNames = WorkPostService.getDepartNamesByIds(x.DepartIds),
DepartNames = WorkPostService.getDepartNamesByIdsForApi(x.DepartIds),
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
TestPalce = x.TestPalce,
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
@@ -105,11 +106,11 @@ namespace BLL
QuestionCount = x.QuestionCount ?? 0,
TestPalce = x.TestPalce,
UnitIds = x.UnitIds,
UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds),
UnitNames = UnitService.getUnitNamesUnitIdsForApi(x.UnitIds),
WorkPostIds = x.WorkPostIds,
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostIds),
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIdsForApi(x.WorkPostIds),
DepartIds = x.DepartIds,
DepartNames = WorkPostService.getDepartNamesByIds(x.DepartIds),
DepartNames = WorkPostService.getDepartNamesByIdsForApi(x.DepartIds),
States = x.States,
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
TrainingPlanId = x.PlanId,
@@ -203,7 +204,7 @@ namespace BLL
db.Training_TestPlan.InsertOnSubmit(newTestPlan);
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectTestPlanMenuId, newTestPlan.ProjectId, null, newTestPlan.TestPlanId, newTestPlan.PlanDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectTestPlanMenuId, newTestPlan.ProjectId, null, newTestPlan.TestPlanId, newTestPlan.PlanDate);
}
else
{
@@ -223,6 +224,9 @@ namespace BLL
isUpdate.WorkPostIds = newTestPlan.WorkPostIds;
isUpdate.DepartIds = newTestPlan.DepartIds;
isUpdate.TrainTypeId = newTestPlan.TrainTypeId;
isUpdate.SValue = newTestPlan.SValue;
isUpdate.MValue = newTestPlan.MValue;
isUpdate.JValue = newTestPlan.JValue;
////删除 考生记录
var deleteRecords = from x in db.Training_TestRecord
where x.TestPlanId == isUpdate.TestPlanId
@@ -314,7 +318,7 @@ namespace BLL
{
foreach (var item in getTestPlan.TestPlanTrainingItems)
{
var trainingType = TestTrainingService.GetTestTrainingById(item.TrainingTypeId);
var trainingType = db.Training_TestTraining.FirstOrDefault(e => e.TrainingId == item.TrainingTypeId);
if (trainingType != null)
{
Model.Training_TestPlanTraining newPlanItem = new Model.Training_TestPlanTraining
@@ -341,24 +345,27 @@ namespace BLL
/// 新增 考试人员明细
/// </summary>
public static void AddTrainingTestRecord(List<Model.TestRecordItem> testRecords, Model.Training_TestPlan newTestPlan)
{
foreach (var item in testRecords)
{
var person = PersonService.GetPersonById(item.TestManId);
if (person != null)
{
Model.Training_TestRecord newTrainDetail = new Model.Training_TestRecord
{
TestRecordId = SQLHelper.GetNewID(),
ProjectId = newTestPlan.ProjectId,
TestPlanId = newTestPlan.TestPlanId,
TestManId = item.TestManId,
TestType = item.TestType,
Duration= newTestPlan.Duration,
};
TestRecordService.AddTestRecord(newTrainDetail);
}
}
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
foreach (var item in testRecords)
{
var person = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == item.TestManId);
if (person != null)
{
Model.Training_TestRecord newTrainDetail = new Model.Training_TestRecord
{
TestRecordId = SQLHelper.GetNewID(),
ProjectId = newTestPlan.ProjectId,
TestPlanId = newTestPlan.TestPlanId,
TestManId = item.TestManId,
TestType = item.TestType,
Duration = newTestPlan.Duration,
};
TestRecordService.AddTestRecordForApi(newTrainDetail);
}
}
}
}
/// <summary>
@@ -417,11 +424,11 @@ namespace BLL
TestStartTime = DateTime.Now,
TestPalce = getTrainingPlan.TeachAddress,
UnitIds = getTrainingPlan.UnitIds,
UnitNames = UnitService.getUnitNamesUnitIds(getTrainingPlan.UnitIds),
UnitNames = UnitService.getUnitNamesUnitIdsForApi(getTrainingPlan.UnitIds),
WorkPostIds = getTrainingPlan.WorkPostId,
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(getTrainingPlan.WorkPostId),
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIdsForApi(getTrainingPlan.WorkPostId),
DepartIds=getTrainingPlan.DepartIds,
DepartNames = WorkPostService.getDepartNamesByIds(getTrainingPlan.DepartIds),
DepartNames = WorkPostService.getDepartNamesByIdsForApi(getTrainingPlan.DepartIds),
PlanId = getTrainingPlan.PlanId,
States = "0",
};
@@ -477,7 +484,7 @@ namespace BLL
{
db.Training_TestPlan.InsertOnSubmit(newTestPlan);
db.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectTestPlanMenuId, newTestPlan.ProjectId, null, testPlanId, newTestPlan.PlanDate);
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitIdForApi(Const.ProjectTestPlanMenuId, newTestPlan.ProjectId, null, testPlanId, newTestPlan.PlanDate);
///培训人员
var getTrainingTask = (from x in db.Training_Task where x.PlanId == trainingPlanId select x).ToList();
foreach (var itemTask in getTrainingTask)