考试调整

This commit is contained in:
2024-03-31 11:01:00 +08:00
parent 53473b9f66
commit 49283a7433
5 changed files with 84 additions and 50 deletions
@@ -101,14 +101,31 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
if (CommonService.IsMainUnitOrAdmin(trainingPlan.DesignerId))
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
APITrainingPlanService.SaveTrainingPlan(trainingPlan);
}
else
{
responeData.code = 0;
responeData.message = "非本单位用户,不能制定培训计划!";
bool result = false;
if (trainingPlan.DesignerId == Const.sysglyId || trainingPlan.DesignerId == Const.hfnbdId)
{
result = true;
}
else
{
var user = db.Sys_User.FirstOrDefault(e => e.UserId == trainingPlan.DesignerId);
if (user != null && user.UnitId == Const.UnitId_CD)
{
result = true;
}
}
if (result)
// if (CommonService.IsMainUnitOrAdmin(trainingPlan.DesignerId))
{
APITrainingPlanService.SaveTrainingPlan(trainingPlan);
}
else
{
responeData.code = 0;
responeData.message = "非本单位用户,不能制定培训计划!";
}
}
}
catch (Exception ex)