Commit fcc6e899 authored by 黄奎's avatar 黄奎

页面修改

parent f07a1611
......@@ -25,34 +25,34 @@ namespace Edu.ThirdCore.TenCloud
/// <returns></returns>
public async Task<(bool result, string message)> SetUserToCCCUser(Employee_ViewModel employee)
{
CreateStaffRequest req = new CreateStaffRequest();
req.SdkAppId = SDKAPPID;
SeatUserInfo seatUserInfo1 = new SeatUserInfo();
seatUserInfo1.Name = employee.EmployeeName;
seatUserInfo1.Mail = employee.Email;
seatUserInfo1.Phone = employee.EmployeeTel;
seatUserInfo1.Nick = employee.EmployeeName.ToCharArray()[0] + "老师";
seatUserInfo1.UserId = employee.Id.ToString();
seatUserInfo1.StaffNumber = employee.Id.ToString();
CreateStaffRequest req = new CreateStaffRequest
{
SdkAppId = SDKAPPID
};
SeatUserInfo seatUserInfo1 = new SeatUserInfo
{
Name = employee.EmployeeName,
Mail = employee.Email,
Phone = employee.EmployeeTel,
Nick = employee.EmployeeName.ToCharArray()[0] + "老师",
UserId = employee.Id.ToString(),
StaffNumber = employee.Id.ToString()
};
req.Staffs = new SeatUserInfo[] { seatUserInfo1 };
var credential = TenCloudCredential._instance;
CreateStaffResponse resp = credential.CreateStaffSync(req);
//JObject result = JObject.Parse(AbstractModel.ToJsonString(resp));
if (resp.ErrorStaffList!=null && resp.ErrorStaffList.Length>0)
if (resp.ErrorStaffList != null && resp.ErrorStaffList.Length > 0)
{
return (false, resp.ErrorStaffList[0].Message);
}
else
else
{
var groupId = QueryDescribeSkillGroup();
if (groupId == null)
{
return (false, "电话客服添加成功,但是关联技能组失败");
}
else
else
{
SetTenUserStaffSkillGroupList(employee.Email, groupId);
}
......@@ -63,10 +63,12 @@ namespace Edu.ThirdCore.TenCloud
public void SetTenUserStaffSkillGroupList(string mail, long?[] list)
{
var credential = TenCloudCredential._instance;
BindStaffSkillGroupListRequest req = new BindStaffSkillGroupListRequest();
req.SdkAppId = SDKAPPID;
req.StaffEmail = mail;
req.SkillGroupList = list;
BindStaffSkillGroupListRequest req = new BindStaffSkillGroupListRequest
{
SdkAppId = SDKAPPID,
StaffEmail = mail,
SkillGroupList = list
};
BindStaffSkillGroupListResponse resp = credential.BindStaffSkillGroupListSync(req);
}
......@@ -74,19 +76,21 @@ namespace Edu.ThirdCore.TenCloud
/// 获取技能组数组
/// </summary>
/// <returns></returns>
public long?[] QueryDescribeSkillGroup()
public long?[] QueryDescribeSkillGroup()
{
var credential = TenCloudCredential._instance;
DescribeSkillGroupInfoListRequest req = new DescribeSkillGroupInfoListRequest();
req.SdkAppId = SDKAPPID;
req.PageSize = 1;
req.PageNumber = 100;
DescribeSkillGroupInfoListRequest req = new DescribeSkillGroupInfoListRequest
{
SdkAppId = SDKAPPID,
PageSize = 1,
PageNumber = 100
};
DescribeSkillGroupInfoListResponse resp = credential.DescribeSkillGroupInfoListSync(req);
if (resp.SkillGroupList != null && resp.SkillGroupList.Length > 0)
{
return resp.SkillGroupList.Select(x => x.SkillGroupId).ToArray();
}
else
else
{
return null;
}
......@@ -100,11 +104,12 @@ namespace Edu.ThirdCore.TenCloud
public async Task<(bool result, string message)> DelUserToCCCUser(Employee_ViewModel employee)
{
var credential = TenCloudCredential._instance;
DeleteStaffRequest req = new DeleteStaffRequest();
req.SdkAppId = SDKAPPID;
req.StaffList = new string[] { employee.Email };
DeleteStaffRequest req = new DeleteStaffRequest
{
SdkAppId = SDKAPPID,
StaffList = new string[] { employee.Email }
};
DeleteStaffResponse resp = credential.DeleteStaffSync(req);
return (resp.OnlineStaffList == null, "");
}
......@@ -116,14 +121,15 @@ namespace Edu.ThirdCore.TenCloud
{
var credential = TenCloudCredential._instance;
var tenCccTokenItem = new TenCccTokenItem();
CreateSDKLoginTokenRequest req = new CreateSDKLoginTokenRequest();
req.SdkAppId = SDKAPPID;
req.SeatUserId = mail;
CreateSDKLoginTokenRequest req = new CreateSDKLoginTokenRequest
{
SdkAppId = SDKAPPID,
SeatUserId = mail
};
CreateSDKLoginTokenResponse resp = credential.CreateSDKLoginTokenSync(req);
tenCccTokenItem.SdkURL = resp.SdkURL;
tenCccTokenItem.Token = resp.Token;
return tenCccTokenItem;
}
}
}
......@@ -47,7 +47,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
int Type = parms.GetInt("Type", 0);//平台类型
if (Type <= 0) {
if (Type <= 0)
{
return ApiResult.ParamIsNull();
}
......@@ -68,16 +69,20 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetContributeConfigInfo() {
public ApiResult SetContributeConfigInfo()
{
var userInfo = base.UserInfo;
RB_Contribute_Config_ViewModel demodel = JsonHelper.DeserializeObject<RB_Contribute_Config_ViewModel>(base.RequestParm.Msg.ToString());
if (string.IsNullOrEmpty(demodel.Name)) {
if (string.IsNullOrEmpty(demodel.Name))
{
return ApiResult.ParamIsNull("请传递对象名称");
}
if (string.IsNullOrEmpty(demodel.AppId)) {
if (string.IsNullOrEmpty(demodel.AppId))
{
return ApiResult.ParamIsNull("请传递对象appid");
}
if (string.IsNullOrEmpty(demodel.AppSecret)) {
if (string.IsNullOrEmpty(demodel.AppSecret))
{
return ApiResult.ParamIsNull("请传递对象秘钥");
}
......@@ -92,7 +97,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed(msg);
}
}
......@@ -265,7 +271,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetContributeMediumInfo() {
public ApiResult SetContributeMediumInfo()
{
var userInfo = base.UserInfo;
RB_Contribute_Medium_ViewModel demodel = JsonHelper.DeserializeObject<RB_Contribute_Medium_ViewModel>(base.RequestParm.Msg.ToString());
if (demodel.Id <= 0)
......@@ -289,10 +296,6 @@ namespace Edu.WebApi.Controllers.QYWeChat
if (demodel.Type == ContributeMediumTypeEnum.Video)
{
return ApiResult.ParamIsNull("视频暂无法上传");
//if (string.IsNullOrEmpty(demodel.VideoImage) && string.IsNullOrEmpty(demodel.VideoWXImage))
//{
// return ApiResult.ParamIsNull("请传递视频封面图");
//}
}
if (demodel.Type != ContributeMediumTypeEnum.Image)
{
......@@ -302,13 +305,17 @@ namespace Edu.WebApi.Controllers.QYWeChat
}
}
}
else {
else
{
//修改 图片 音频只能修改标题 视频可修改封面图 + 介绍 + 标题
if (string.IsNullOrEmpty(demodel.MediaName)) {
if (string.IsNullOrEmpty(demodel.MediaName))
{
return ApiResult.ParamIsNull("请传递标题");
}
if (demodel.Type == ContributeMediumTypeEnum.Video) {
if (string.IsNullOrEmpty(demodel.VideoWXImage)) {
if (demodel.Type == ContributeMediumTypeEnum.Video)
{
if (string.IsNullOrEmpty(demodel.VideoWXImage))
{
return ApiResult.ParamIsNull("请传递视频封面图");
}
}
......@@ -325,7 +332,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed(msg);
}
}
......@@ -348,15 +356,18 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetContributeMediumMoveGroup() {
public ApiResult SetContributeMediumMoveGroup()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
string MediumIds = parms.GetStringValue("MediumIds");// 素材Ids 英文逗号分隔
int MediumGroupId = parms.GetInt("MediumGroupId", 0);//新分组的ID
if (string.IsNullOrEmpty(MediumIds)) {
if (string.IsNullOrEmpty(MediumIds))
{
return ApiResult.ParamIsNull("请传递素材ID");
}
if (MediumGroupId <= 0) {
if (MediumGroupId <= 0)
{
return ApiResult.ParamIsNull("请传递素材分组ID");
}
......@@ -365,7 +376,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed(msg);
}
}
......@@ -375,7 +387,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult DelContributeMediumBatch() {
public ApiResult DelContributeMediumBatch()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
string MediumIds = parms.GetStringValue("MediumIds");// 素材Ids 英文逗号分隔
......@@ -415,11 +428,13 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetContributeImageText() {
public ApiResult SetContributeImageText()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
string filePath = parms.GetStringValue("filePath");//临时文件路径
if (string.IsNullOrEmpty(filePath)) {
if (string.IsNullOrEmpty(filePath))
{
return ApiResult.Failed("请传递文件路径");
}
......@@ -567,7 +582,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetMyContributeInfoPageList() {
public ApiResult GetMyContributeInfoPageList()
{
var userInfo = base.UserInfo;
ResultPageModel pmodel = JsonHelper.DeserializeObject<ResultPageModel>(base.RequestParm.Msg.ToString());
RB_Contribute_Info_ViewModel demodel = JsonHelper.DeserializeObject<RB_Contribute_Info_ViewModel>(base.RequestParm.Msg.ToString());
......@@ -600,7 +616,7 @@ namespace Edu.WebApi.Controllers.QYWeChat
x.IsSendCommission,
x.CommissionMoney,
x.UpdateBy,
UpdateByName = Cache.User.UserReidsCache.GetUserLoginInfo(x.UpdateBy)?.AccountName??"",
UpdateByName = Cache.User.UserReidsCache.GetUserLoginInfo(x.UpdateBy)?.AccountName ?? "",
UpdateTime = x.UpdateTime.ToString("yyyy-MM-dd HH:mm")
});
return ApiResult.Success("", pmodel);
......@@ -611,11 +627,13 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetContributeInfo() {
public ApiResult GetContributeInfo()
{
var userInfo = base.UserInfo;
JObject prams = JObject.Parse(base.RequestParm.Msg.ToString());
int ContributeId = prams.GetInt("ContributeId", 0);//投稿ID
if (ContributeId <= 0) {
if (ContributeId <= 0)
{
return ApiResult.ParamIsNull();
}
......@@ -660,55 +678,46 @@ namespace Edu.WebApi.Controllers.QYWeChat
{
return ApiResult.ParamIsNull("状态不正确");
}
if (demodel.Type == ContributeInfoTypeEnum.Video)
{
return ApiResult.ParamIsNull("视频暂无法发布");
}
switch (demodel.Type)
{
case ContributeInfoTypeEnum.ImgText:
if (string.IsNullOrEmpty(demodel.Title)) {
if (string.IsNullOrEmpty(demodel.Title))
{
return ApiResult.ParamIsNull("请输入标题");
}
if (string.IsNullOrEmpty(demodel.Description)) {
if (string.IsNullOrEmpty(demodel.Description))
{
return ApiResult.ParamIsNull("请输入摘要");
}
if (demodel.CoverImageId <= 0) {
if (demodel.CoverImageId <= 0)
{
return ApiResult.ParamIsNull("请选择封面图");
}
break;
case ContributeInfoTypeEnum.Video:
return ApiResult.ParamIsNull("视频暂无法发布");
//if (string.IsNullOrEmpty(demodel.Title))
//{
// return ApiResult.ParamIsNull("请输入标题");
//}
//if (string.IsNullOrEmpty(demodel.Description))
//{
// return ApiResult.ParamIsNull("请输入推荐语");
//}
//if (demodel.VideoMediumId <= 0) {
// return ApiResult.ParamIsNull("请选择视频");
//}
break;
case ContributeInfoTypeEnum.Audio:
if (string.IsNullOrEmpty(demodel.Title))
{
return ApiResult.ParamIsNull("请输入标题");
}
//if (string.IsNullOrEmpty(demodel.Description))
//{
// return ApiResult.ParamIsNull("请输入推荐语");
//}
if (demodel.VideoMediumId <= 0)
{
return ApiResult.ParamIsNull("请选择音频");
}
break;
case ContributeInfoTypeEnum.Image:
if (demodel.ImageList == null || !demodel.ImageList.Any()) {
if (demodel.ImageList == null || !demodel.ImageList.Any())
{
return ApiResult.ParamIsNull("请选择图片列表");
}
demodel.ImageMediumIds = string.Join(",", demodel.ImageList.Select(x => x.Id));
break;
case ContributeInfoTypeEnum.Text:
if (string.IsNullOrEmpty(demodel.Description)) {
if (string.IsNullOrEmpty(demodel.Description))
{
return ApiResult.ParamIsNull("请输入文本内容");
}
break;
......@@ -727,7 +736,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed(msg);
}
}
......@@ -737,12 +747,14 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetContributeInfoState() {
public ApiResult SetContributeInfoState()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
int ContributeId = parms.GetInt("ContributeId", 0);//投稿ID
int Type = parms.GetInt("Type", 1);//类型 1提交审核 2删除
if (ContributeId <= 0) {
if (ContributeId <= 0)
{
return ApiResult.ParamIsNull("请传递投稿ID");
}
......@@ -751,7 +763,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed(msg);
}
}
......@@ -795,7 +808,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetContributeInfoAuditedPageList() {
public ApiResult GetContributeInfoAuditedPageList()
{
var userInfo = base.UserInfo;
ResultPageModel pmodel = JsonHelper.DeserializeObject<ResultPageModel>(base.RequestParm.Msg.ToString());
RB_Contribute_Info_ViewModel demodel = JsonHelper.DeserializeObject<RB_Contribute_Info_ViewModel>(base.RequestParm.Msg.ToString());
......@@ -892,13 +906,17 @@ namespace Edu.WebApi.Controllers.QYWeChat
break;
}
if (demodel.IsPreview > 0) {
if (demodel.IsPreview == 1) {
if (string.IsNullOrEmpty(demodel.TagId)) {
if (demodel.IsPreview > 0)
{
if (demodel.IsPreview == 1)
{
if (string.IsNullOrEmpty(demodel.TagId))
{
return ApiResult.ParamIsNull("请传递微信账号");
}
}
if (demodel.PlatformId <= 0) {
if (demodel.PlatformId <= 0)
{
return ApiResult.ParamIsNull("请选择平台");
}
}
......@@ -927,7 +945,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetContributeInfoPublish() {
public ApiResult SetContributeInfoPublish()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
int ContributeId = parms.GetInt("ContributeId", 0);//投稿ID
......@@ -935,13 +954,16 @@ namespace Edu.WebApi.Controllers.QYWeChat
int IsPreview = parms.GetInt("IsPreview", 1);// 1预览 2发布
string TagId = parms.GetStringValue("TagId");//预览微信号 发布标签ID
if (ContributeId <= 0) {
if (ContributeId <= 0)
{
return ApiResult.ParamIsNull("请传递投稿");
}
if (PlatformId <= 0) {
if (PlatformId <= 0)
{
return ApiResult.ParamIsNull("请传递平台");
}
if (IsPreview != 0 && IsPreview != 1 && IsPreview != 2) {
if (IsPreview != 0 && IsPreview != 1 && IsPreview != 2)
{
return ApiResult.ParamIsNull("请传递类型");
}
......@@ -950,7 +972,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed(msg);
}
}
......@@ -960,7 +983,8 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetGZHUserTagList() {
public ApiResult GetGZHUserTagList()
{
var userInfo = base.UserInfo;
var list = contributeModule.GetGZHUserTagList(userInfo, out bool flag);
......@@ -979,11 +1003,13 @@ namespace Edu.WebApi.Controllers.QYWeChat
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetContributeInfoPublishLogList() {
public ApiResult GetContributeInfoPublishLogList()
{
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
int ContributeId = parms.GetInt("ContributeId", 0);//投稿ID
if (ContributeId <= 0) {
if (ContributeId <= 0)
{
return ApiResult.ParamIsNull();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment