|
|
|
@ -70,7 +70,7 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr |
|
|
|
|
if (editModel.StaffIdList != null) |
|
|
|
|
editModel.StaffIds = JsonHelper.ObjToJson(editModel.StaffIdList); |
|
|
|
|
|
|
|
|
|
var result = await base.Update(Id, editModel); |
|
|
|
|
var result = await base.Update(Id, editModel, null, ["Status"]); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -82,12 +82,14 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr |
|
|
|
|
result.result.DT_TableDataT1[0].StaffIdList = JsonConvert.DeserializeObject<List<int>>(StaffIds); |
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
public async Task<ServiceResult<long>> InsertByStatus(InsertGhre_RequestInput insertModel, string status) |
|
|
|
|
public async Task<ServiceResult<long>> InsertByStatus(InsertGhre_PlanInput insertModel, string status) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if (insertModel.StaffIdList != null) |
|
|
|
|
insertModel.StaffIds = JsonHelper.ObjToJson(insertModel.StaffIdList); |
|
|
|
|
var data = ServiceResult<long>.OprateSuccess("新增成功", 0); |
|
|
|
|
insertModel.Status = status; |
|
|
|
|
var id = await Add(insertModel); |
|
|
|
@ -96,30 +98,19 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr |
|
|
|
|
if (data.Success) |
|
|
|
|
data.Data = id; |
|
|
|
|
else |
|
|
|
|
return ServiceResult<long>.OprateFailed("发布成功!"); |
|
|
|
|
return ServiceResult<long>.OprateFailed("失败!"); |
|
|
|
|
|
|
|
|
|
return data; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override async Task<ServiceFormResult<Ghre_RequestDto>> QueryForm(QueryForm body) |
|
|
|
|
{ |
|
|
|
|
var result = await base.QueryForm(body); |
|
|
|
|
string trainStaffId = result.result.DT_TableDataT1[0].TrainStaffId; |
|
|
|
|
if (!string.IsNullOrWhiteSpace(trainStaffId)) |
|
|
|
|
result.result.DT_TableDataT1[0].TrainStaffIds = JsonHelper.JsonToObj<List<int>>(trainStaffId); |
|
|
|
|
else result.result.DT_TableDataT1[0].TrainStaffIds = new List<int>(); |
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult> UpdateStatus(InsertGhre_RequestInput input, string status) |
|
|
|
|
public async Task<ServiceResult> UpdateStatus(InsertGhre_PlanInput input, string status) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
HttpRequest request = UserContext.Context.Request; |
|
|
|
|
var api = request.Path.ObjToString().TrimEnd('/').ToLower(); |
|
|
|
|
var ip = GetUserIp(UserContext.Context); |
|
|
|
|
|
|
|
|
|
var entities = new List<Ghre_Request>(); |
|
|
|
|
var entities = new List<Ghre_Plan>(); |
|
|
|
|
foreach (var id in input.Ids) |
|
|
|
|
{ |
|
|
|
|
if (!BaseDal.Any(id)) |
|
|
|
@ -150,12 +141,6 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr |
|
|
|
|
|
|
|
|
|
var result = await BaseDal.Update(entities); |
|
|
|
|
return ServiceResult.OprateSuccess("执行成功!"); |
|
|
|
|
//if (status == Consts.DIC_COURSE_STATUS.RELEASED) |
|
|
|
|
// return ServiceResult.OprateSuccess("发布成功!"); |
|
|
|
|
//else if (status == Consts.DIC_COURSE_STATUS.DRAFT) |
|
|
|
|
// return ServiceResult.OprateSuccess("已启用成功,请进入草稿箱查看!"); |
|
|
|
|
//else |
|
|
|
|
// return ServiceResult.OprateSuccess("停用成功!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |