|
|
|
@ -1,8 +1,4 @@ |
|
|
|
|
using Google.Protobuf.WellKnownTypes; |
|
|
|
|
using MathNet.Numerics.Distributions; |
|
|
|
|
using Tiobon.Core.Common; |
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 问卷调查 (服务) |
|
|
|
@ -391,4 +387,34 @@ public class Ghre_SurveyServices : BaseServices<Ghre_Survey, Ghre_SurveyDto, Ins |
|
|
|
|
return ServiceResult.OprateSuccess("提交成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult> Publish(long id) |
|
|
|
|
{ |
|
|
|
|
var entity = await base.QueryById(id); |
|
|
|
|
|
|
|
|
|
await Db.Updateable<Ghre_Survey>() |
|
|
|
|
.SetColumns(it => new Ghre_Survey() { Status = "Publish" }) |
|
|
|
|
.Where(x => x.Id == id) |
|
|
|
|
.ExecuteCommandAsync(); |
|
|
|
|
|
|
|
|
|
var deptIds = new List<int>(); |
|
|
|
|
var staffIds = new List<int>(); |
|
|
|
|
|
|
|
|
|
if (entity.DeptId.IsNotEmptyOrNull()) |
|
|
|
|
deptIds = JsonHelper.JsonToObj<List<int>>(entity.DeptId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (entity.StaffId.IsNotEmptyOrNull()) |
|
|
|
|
staffIds = JsonHelper.JsonToObj<List<int>>(entity.StaffId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var staffIds1 = await Db.Queryable<Ghra_Staff>().Where(x => x.DeptID != null && deptIds.Contains(x.DeptID.Value)).Select(x => x.StaffID).ToListAsync(); |
|
|
|
|
staffIds.AddRange(staffIds1); |
|
|
|
|
staffIds = staffIds.Distinct().ToList(); |
|
|
|
|
|
|
|
|
|
var userId = await Db.Queryable<Ghrs_User>().Where(x => x.UserStaffID != null && staffIds.Contains(x.UserStaffID.Value)).Select(x => x.UserId).ToListAsync(); |
|
|
|
|
|
|
|
|
|
return ServiceResult.OprateSuccess("发布成功!"); |
|
|
|
|
} |
|
|
|
|
} |