Commit fca9d00e authored by 黄奎's avatar 黄奎

页面修改

parent 8fd0bae0
......@@ -175,25 +175,6 @@ namespace Edu.Common.Plugin
return "";
}
/// <summary>
/// 时间戳转换为时间
/// </summary>
/// <param name="ticks"></param>
/// <returns></returns>
public static DateTime GetDateTimeByTicks(string ticks)
{
try
{
DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区
DateTime dt = startTime.AddMilliseconds(long.Parse(ticks));
return dt;
}
catch (Exception)
{
return new DateTime(1970, 1, 1);
}
}
/// <summary>
/// 获取年份月份中的最后一天
/// </summary>
......@@ -205,25 +186,6 @@ namespace Edu.Common.Plugin
return new DateTime(year, month, 1).AddMonths(1).AddDays(-1);
}
/// <summary>
/// 是否为日期+时间型字符串
/// </summary>
/// <param name="StrSource"></param>
/// <returns></returns>
public static bool IsDateTime(object StrSource)
{
DateTime dt = DateTime.Now;
if (DateTime.TryParse(StrSource.ToString(), out dt))
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 时间
/// </summary>
......@@ -620,17 +582,6 @@ namespace Edu.Common.Plugin
return Encoding.Default.GetString(Byt);
}
/// <summary>
/// 截取指定长度HTML内容 (该方法未完成)
/// </summary>
/// <param name="html"></param>
/// <param name="len"></param>
/// <returns></returns>
public static string SubstringHTML(string html, int len)
{
return "";
}
/// <summary>
/// 截取指定长度字符
/// </summary>
......@@ -1170,77 +1121,6 @@ namespace Edu.Common.Plugin
#endregion
#region Url获取Get参数
/// <summary>
/// 将查询字符串解析转换为名值集合.
/// </summary>
/// <param name="queryString"></param>
/// <returns></returns>
public static NameValueCollection GetQueryString(string queryString)
{
return GetQueryString(queryString, null, true);
}
/// <summary>
/// 将查询字符串解析转换为名值集合.
/// </summary>
/// <param name="queryString"></param>
/// <param name="encoding"></param>
/// <param name="isEncoded"></param>
/// <returns></returns>
public static NameValueCollection GetQueryString(string queryString, Encoding encoding, bool isEncoded)
{
queryString = queryString.TrimStart('?');
NameValueCollection result = new NameValueCollection(StringComparer.OrdinalIgnoreCase);
if (!string.IsNullOrEmpty(queryString))
{
int count = queryString.Length;
for (int i = 0; i < count; i++)
{
int startIndex = i;
int index = -1;
while (i < count)
{
char item = queryString[i];
if (item == '=')
{
if (index < 0)
{
index = i;
}
}
else if (item == '&')
{
break;
}
i++;
}
string key = null;
string value = null;
if (index >= 0)
{
key = queryString.Substring(startIndex, index - startIndex);
value = queryString.Substring(index + 1, (i - index) - 1);
}
else
{
key = queryString.Substring(startIndex, i - startIndex);
}
if (isEncoded)
{
result[MyUrlDeCode(key, encoding)] = MyUrlDeCode(value, encoding);
}
else
{
result[key] = value;
}
if ((i == (count - 1)) && (queryString[i] == '&'))
{
result[key] = string.Empty;
}
}
}
return result;
}
/// <summary>
/// 解码URL.
......@@ -1384,7 +1264,7 @@ namespace Edu.Common.Plugin
/// <returns></returns>
public static string GetStarString(string Input)
{
string Output = "";
string Output;
switch (Input.Length)
{
case 1:
......@@ -1433,31 +1313,6 @@ namespace Edu.Common.Plugin
return str;
}
/// <summary>
/// 获取缓存时间
/// </summary>
/// <returns></returns>
public static string GetCacheDateTime()
{
string str = DateTime.Now.ToString("yyyyMMddHHmm");
int lastM = Convert.ToInt32(str.Substring(str.Length - 1, 1));
string mType = "0";
if (lastM >= 0 && lastM <= 3)
{
mType = "0";
}
if (lastM >= 4 && lastM <= 6)
{
mType = "1";
}
if (lastM >= 7 && lastM <= 9)
{
mType = "2";
}
string newStr = str.Substring(0, str.Length - 1) + mType;
return newStr;
}
/// <summary>
/// 繁体字转简体
/// </summary>
......
......@@ -23,6 +23,11 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public int ParentId { get; set; }
/// <summary>
/// 校区编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 下级部门列表
......
......@@ -107,7 +107,16 @@ namespace Edu.Module.Course
/// <returns></returns>
public RB_Course_ViewModel GetCourseModule(object CourseId)
{
return courseRepository.GetEntity<RB_Course_ViewModel>(CourseId);
var extModel= courseRepository.GetEntity<RB_Course_ViewModel>(CourseId);
if (extModel != null && extModel.CourseId > 0)
{
var stepPriceList = course_StepPriceRepository.GetCourseStepPriceListRepository(new RB_Course_StepPrice_ViewModel()
{
CourseId = extModel.CourseId
});
extModel.StepPriceList = stepPriceList ?? new List<RB_Course_StepPrice_ViewModel>();
}
return extModel;
}
/// <summary>
......@@ -117,6 +126,12 @@ namespace Edu.Module.Course
public virtual bool SetCourseModule(RB_Course_ViewModel model)
{
bool flag;
if (model.IsRenew == 0)
{
model.RenewOgPrice = 0;
model.RenewSlPrice = 0;
}
if (model.CourseId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -146,19 +161,18 @@ namespace Edu.Module.Course
model.CourseId = newId;
flag = newId > 0;
}
//没有设置阶梯价格,删除原来的价格
course_StepPriceRepository.DeleteStepPriceRepository(model.CourseId);
if (model.IsOpenStepPrice == 1)
{
if (model.StepPriceList != null && model.StepPriceList.Count > 0)
{
foreach (var item in model.StepPriceList)
{
item.CourseId = model.CourseId;
course_StepPriceRepository.Insert(item);
}
}
}
else
{
}
return flag;
}
......
......@@ -28,8 +28,6 @@ namespace Edu.Module.System
/// </summary>
private readonly RB_Msg_BaseTemplateRepository msgBaseTemplateRepository = new RB_Msg_BaseTemplateRepository();
#region 短信记录
/// <summary>
/// 获取发送短信记录信息
......@@ -120,7 +118,6 @@ namespace Edu.Module.System
}
#endregion
#region 短信模板配置
/// <summary>
/// 获取短信模板配置列表
......@@ -200,8 +197,6 @@ namespace Edu.Module.System
#region 发送短信统一方法
public void SendMsg(object PhoneMessage, Common.Enum.System.BaseTemplateTypeEnum BaseTemplateType, RB_Msg_Log msgLogModel)
{
//查询当前集团的短信基础配置
var msgBaseList = msgBaseRepository.GetListRepository(new RB_Msg_Base_Function_ViewModel { Group_Id = msgLogModel.Group_Id });
//查询当前下面是否有模板
......@@ -224,18 +219,13 @@ namespace Edu.Module.System
msgLogModel.StoreType = model.StoreType;
msgLogModel.MsgConfigure = model.MsgConfigure;
int id = msgLogRepository.Insert(msgLogModel);
model.MsgBase = Common.Plugin.JsonHelper.DeserializeObject<RB_Msg_Base_ViewModel>(model.MsgConfigure);
var msgBaseTemplateList = allMsgBaseTemplateList.Where(x => x.BaseTemplateType == BaseTemplateType);
if (!string.IsNullOrWhiteSpace(model.MsgBase.AccessKeyId) && !string.IsNullOrWhiteSpace(model.MsgBase.AccessSecret) && !string.IsNullOrWhiteSpace(model.MsgBase.Domain) && !string.IsNullOrWhiteSpace(model.MsgBase.RegionId))
{
if (msgBaseTemplateList != null && msgBaseTemplateList.Any(x => x.TemplateStaus == 0))
{
var msgBaseTemplateModel = msgBaseTemplateList.Where(x => x.TemplateStaus == 0).FirstOrDefault();
if (Common.Config.IsSendMsg == 1)
{
ThirdCore.Message.SMSService.SendMsg(msgLogModel.ReceiverPhone, PhoneMessage, msgBaseTemplateModel.TemplateId, msgBaseTemplateModel.Sign, model.MsgBase.Domain, model.MsgBase.AccessKeyId, model.MsgBase.AccessSecret, model.MsgBase.RegionId, id.ToString());
......@@ -244,10 +234,8 @@ namespace Edu.Module.System
}
}
}
}
}
// ThirdCore.Message.SMSService.SendMsg("13551132417", PhoneMessage, "SMS_201722097", "印象之旅", "dysmsapi.aliyuncs.com", "LTAIwE7l9dImZSa3", "j47Ajn0d0WzUCIX8Biyj3P2r8QDltI", "cn-hangzhou");
}
......@@ -281,13 +269,12 @@ namespace Edu.Module.System
{
sendStatus = (int)(modelSmsSendDetailDTO.SendStatus ?? 1);
}
if (sendStatus > 1)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Msg_Log.SendStatus),sendStatus}
};
{
{ nameof(RB_Msg_Log.SendStatus),sendStatus}
};
msgLogRepository.Update(fileds, new WhereHelper(nameof(RB_Msg_Log.ID), Convert.ToInt32(modelSmsSendDetailDTO.OutId)));
}
}
......@@ -296,17 +283,11 @@ namespace Edu.Module.System
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "UpdateMsgSendStatus");
}
}
}
}
#endregion
}
}
......@@ -158,9 +158,10 @@ namespace Edu.Module.User
{
DepartmentTree_ViewModel tModel = new DepartmentTree_ViewModel()
{
DeptId = item.SId,
DeptId = item.SId+10000,
DeptName = item.SName,
ParentId = item.Dept_Id,
School_Id=item.SId,
ChildList = new List<DepartmentTree_ViewModel>()
};
#region 添加员工信息
......@@ -171,9 +172,10 @@ namespace Edu.Module.User
{
tModel.ChildList.Add(new DepartmentTree_ViewModel()
{
DeptId = 0,
DeptId = empModel.Id,
DeptName = empModel.EmployeeName,
ParentId = 0
ParentId = 0,
School_Id=empModel.School_Id,
});
}
}
......@@ -201,7 +203,8 @@ namespace Edu.Module.User
DeptId = fItem.DeptId,
DeptName = fItem.DeptName,
ParentId = fItem.ParentId,
ChildList = new List<DepartmentTree_ViewModel>()
ChildList = new List<DepartmentTree_ViewModel>(),
School_Id=fItem.School_Id
};
#region 添加员工信息
......@@ -214,10 +217,11 @@ namespace Edu.Module.User
{
tModel.ChildList.Add(new DepartmentTree_ViewModel()
{
DeptId = 0,
DeptId = eItem.Id,
DeptName = eItem.EmployeeName,
ParentId = 0,
ChildList = new List<DepartmentTree_ViewModel>()
ChildList = new List<DepartmentTree_ViewModel>(),
School_Id=eItem.School_Id
});
}
}
......@@ -225,14 +229,14 @@ namespace Edu.Module.User
#endregion
tModel.ChildList = GetDeptTreeList(fItem.DeptId, deptList.Where(qitem => qitem.School_Id == 0).ToList(), SchoolId: 0, schoolDeptList: schoolDeptList, empList: empList);
if (schoolDeptList != null)
{
var newSchoolDeptList = schoolDeptList.Where(qitem => qitem.DeptId == fItem.DeptId)?.ToList();
if (newSchoolDeptList != null && newSchoolDeptList.Count>0)
{
tModel.ChildList.AddRange(newSchoolDeptList);
}
}
//if (schoolDeptList != null)
//{
// var newSchoolDeptList = schoolDeptList.Where(qitem => qitem.DeptId == fItem.DeptId)?.ToList();
// if (newSchoolDeptList != null && newSchoolDeptList.Count>0)
// {
// tModel.ChildList.AddRange(newSchoolDeptList);
// }
//}
list.Add(tModel);
}
}
......@@ -260,6 +264,7 @@ namespace Edu.Module.User
DeptName = item.DeptName,
ParentId = item.ParentId,
ChildList = new List<DepartmentTree_ViewModel>(),
School_Id=item.School_Id
};
#region 添加员工信息
if (empList != null && empList.Count > 0)
......@@ -271,9 +276,10 @@ namespace Edu.Module.User
{
model.ChildList.Add(new DepartmentTree_ViewModel()
{
DeptId = 0,
DeptId = eItem.Id,
DeptName = eItem.EmployeeName,
ParentId = 0,
School_Id=eItem.School_Id,
ChildList = new List<DepartmentTree_ViewModel>()
});
}
......
......@@ -14,6 +14,10 @@
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Edu.Common\Edu.Common.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="aliyun-net-sdk-core">
<HintPath>lib\aliyun-net-sdk-core.dll</HintPath>
......
This diff is collapsed.
......@@ -17,7 +17,7 @@ namespace Edu.ThirdCore.Message
/// <summary>
/// 线程锁
/// </summary>
private static object locker = new object();
private static readonly object locker = new object();
/// <summary>
/// 添加消息到队列
......
......@@ -20,16 +20,18 @@ namespace Edu.ThirdCore.Message
/// <param name="code">验证码</param>
public static void SendCode(string phoneNumber, string code, string templateCode, string SignName, string Domain, string AccessKeyId, string AccessKeySecret, string RegionId, string OutId)
{
JObject obj = new JObject();
obj["cmd"] = "sms";
obj["phoneNumber"] = phoneNumber;
obj["templateCode"] = templateCode;
obj["SignName"] = SignName;
obj["Domain"] = Domain;
obj["AccessKeyId"] = AccessKeyId;
obj["AccessKeySecret"] = AccessKeySecret;
obj["RegionId"] = RegionId;
var TemplateParam = new { code = code };
JObject obj = new JObject
{
["cmd"] = "sms",
["phoneNumber"] = phoneNumber,
["templateCode"] = templateCode,
["SignName"] = SignName,
["Domain"] = Domain,
["AccessKeyId"] = AccessKeyId,
["AccessKeySecret"] = AccessKeySecret,
["RegionId"] = RegionId
};
var TemplateParam = new { code };
obj["OutId"] = OutId;
obj["templateParam"] = JsonConvert.SerializeObject(TemplateParam);
QueueHelper.EnqueueTask(JsonConvert.SerializeObject(obj));
......@@ -43,15 +45,17 @@ namespace Edu.ThirdCore.Message
/// <param name="templateCode"></param>
public static void SendMsg(string phoneNumber, string content, string templateCode, string SignName, string Domain, string AccessKeyId, string AccessKeySecret, string RegionId, string OutId)
{
JObject obj = new JObject();
obj["cmd"] = "sms";
obj["phoneNumber"] = phoneNumber;
obj["templateCode"] = templateCode;
obj["SignName"] = SignName;
obj["Domain"] = Domain;
obj["AccessKeyId"] = AccessKeyId;
obj["RegionId"] = RegionId;
obj["AccessKeySecret"] = AccessKeySecret;
JObject obj = new JObject
{
["cmd"] = "sms",
["phoneNumber"] = phoneNumber,
["templateCode"] = templateCode,
["SignName"] = SignName,
["Domain"] = Domain,
["AccessKeyId"] = AccessKeyId,
["RegionId"] = RegionId,
["AccessKeySecret"] = AccessKeySecret
};
var TemplateParam = new { content };
obj["OutId"] = OutId;
obj["templateParam"] = JsonConvert.SerializeObject(TemplateParam);
......@@ -67,10 +71,12 @@ namespace Edu.ThirdCore.Message
/// <param name="templateCode"></param>
public static void SendMsg(string phoneNumber, object templateParam, string templateCode, string SignName, string Domain, string AccessKeyId, string AccessKeySecret, string RegionId,string OutId)
{
JObject obj = new JObject();
obj["cmd"] = "sms";
obj["phoneNumber"] = phoneNumber;
obj["templateCode"] = templateCode;
JObject obj = new JObject
{
["cmd"] = "sms",
["phoneNumber"] = phoneNumber,
["templateCode"] = templateCode
};
var TemplateParam = templateParam;
obj["SignName"] = SignName;
obj["Domain"] = Domain;
......
......@@ -116,12 +116,14 @@ namespace Edu.WebApi.Controllers.Public
public ApiResult SetMsgBase()
{
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Msg_Base_Function_ViewModel>(RequestParm.Msg.ToString());
var model = new RB_Msg_Base();
model.CreateDate = DateTime.Now;
model.CreateBy = UserInfo.Id;
model.Group_Id = base.UserInfo.Group_Id;
model.ID = extModel.ID;
model.StoreType = extModel.StoreType;
var model = new RB_Msg_Base
{
CreateDate = DateTime.Now,
CreateBy = UserInfo.Id,
Group_Id = base.UserInfo.Group_Id,
ID = extModel.ID,
StoreType = extModel.StoreType
};
if (extModel.MsgBase != null)
{
model.MsgConfigure = Common.Plugin.JsonHelper.Serialize(extModel.MsgBase);
......
......@@ -775,7 +775,6 @@ namespace Edu.WebApi.Controllers.User
{
return ApiResult.ParamIsNull(message: "请选择部门编号!");
}
var groupId = base.UserInfo.Group_Id;
var list = departmentModule.GetCurrentAndChildDepartmentListModule(DeptId);
return ApiResult.Success(data: list);
}
......
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