Commit 71e4b417 authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents 4e1e1440 771e5b59
...@@ -263,6 +263,36 @@ namespace Mall.Common ...@@ -263,6 +263,36 @@ namespace Mall.Common
return timeStr; return timeStr;
} }
/// <summary>
/// 格式化时间【yyyy-MM-dd】
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
public static string FormatDate2(this object time)
{
string timeStr = "";
if (time != null)
{
try
{
timeStr = Convert.ToDateTime(time.ToString()).ToString("yyyy-MM-dd");
if (timeStr == "0001-01-01")
{
timeStr = "";
}
else
{
timeStr= Convert.ToDateTime(time.ToString()).ToString("yyyy-MM-dd HH:mm");
}
}
catch
{
}
}
return timeStr;
}
/// <summary> /// <summary>
/// 字符串转List /// 字符串转List
/// </summary> /// </summary>
......
...@@ -18,8 +18,6 @@ namespace Mall.Common.Plugin ...@@ -18,8 +18,6 @@ namespace Mall.Common.Plugin
/// </summary> /// </summary>
public class HttpHelper public class HttpHelper
{ {
/// <summary> /// <summary>
/// Post提交数据 /// Post提交数据
/// </summary> /// </summary>
...@@ -29,7 +27,6 @@ namespace Mall.Common.Plugin ...@@ -29,7 +27,6 @@ namespace Mall.Common.Plugin
/// <returns></returns> /// <returns></returns>
public static string HttpPost(string url, string body, string contenttype = "") public static string HttpPost(string url, string body, string contenttype = "")
{ {
LogHelper.Write("测试超时S:" + DateTime.Now);
try try
{ {
Encoding encoding = Encoding.UTF8; Encoding encoding = Encoding.UTF8;
...@@ -45,10 +42,9 @@ namespace Mall.Common.Plugin ...@@ -45,10 +42,9 @@ namespace Mall.Common.Plugin
byte[] buffer = encoding.GetBytes(body); byte[] buffer = encoding.GetBytes(body);
request.ContentLength = buffer.Length; request.ContentLength = buffer.Length;
request.GetRequestStream().Write(buffer, 0, buffer.Length); request.GetRequestStream().Write(buffer, 0, buffer.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); HttpWebResponse response = (HttpWebResponse)request.GetResponse();
using (StreamReader reader = new StreamReader(response.GetResponseStream(), encoding)) using (StreamReader reader = new StreamReader(response.GetResponseStream(), encoding))
{ {
LogHelper.Write("测试超时E:" + DateTime.Now);
return reader.ReadToEnd(); return reader.ReadToEnd();
} }
} }
...@@ -70,7 +66,7 @@ namespace Mall.Common.Plugin ...@@ -70,7 +66,7 @@ namespace Mall.Common.Plugin
/// <param name="encode">编码方式</param> /// <param name="encode">编码方式</param>
/// <param name="Source">来源</param> /// <param name="Source">来源</param>
/// <returns></returns> /// <returns></returns>
public static string HttpGet(string url, Encoding encode, string Source, string cookie="") public static string HttpGet(string url, Encoding encode, string Source, string cookie = "")
{ {
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url); HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
if (!string.IsNullOrEmpty(Source)) if (!string.IsNullOrEmpty(Source))
...@@ -138,7 +134,7 @@ namespace Mall.Common.Plugin ...@@ -138,7 +134,7 @@ namespace Mall.Common.Plugin
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "POST"; req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded"; req.ContentType = "application/x-www-form-urlencoded";
//req.Headers.Add("Accept", "application/json"); //req.Headers.Add("Accept", "application/json");
//req.Headers.Add("Content-Type", "application/json"); //req.Headers.Add("Content-Type", "application/json");
byte[] data = Encoding.UTF8.GetBytes(postDataStr); byte[] data = Encoding.UTF8.GetBytes(postDataStr);
...@@ -151,7 +147,7 @@ namespace Mall.Common.Plugin ...@@ -151,7 +147,7 @@ namespace Mall.Common.Plugin
reqStream.Close(); reqStream.Close();
} }
HttpWebResponse rsp = (HttpWebResponse)req.GetResponse(); HttpWebResponse rsp = (HttpWebResponse)req.GetResponse();
if (string.IsNullOrWhiteSpace(rsp.CharacterSet)) if (string.IsNullOrWhiteSpace(rsp.CharacterSet))
...@@ -255,8 +251,9 @@ namespace Mall.Common.Plugin ...@@ -255,8 +251,9 @@ namespace Mall.Common.Plugin
/// </summary> /// </summary>
/// <param name="latlng"></param> /// <param name="latlng"></param>
/// <returns></returns> /// <returns></returns>
public static string GetGeocoderAddress(string latlng) { public static string GetGeocoderAddress(string latlng)
string apiKey = "7d9fbeb43e975cd1e9477a7e5d5e192a"; {
string apiKey = "7d9fbeb43e975cd1e9477a7e5d5e192a";
HttpClient client = new HttpClient(); HttpClient client = new HttpClient();
string url = "http://api.map.baidu.com/geocoder?location=" + latlng + "&output=json&key=" + apiKey; string url = "http://api.map.baidu.com/geocoder?location=" + latlng + "&output=json&key=" + apiKey;
try try
...@@ -311,7 +308,7 @@ namespace Mall.Common.Plugin ...@@ -311,7 +308,7 @@ namespace Mall.Common.Plugin
/// <param name="url">请求地址</param> /// <param name="url">请求地址</param>
/// <param name="postDataStr">请求地址</param> /// <param name="postDataStr">请求地址</param>
/// <returns>HTTP响应</returns> /// <returns>HTTP响应</returns>
public static string HttpPostForGetWXQRCodePath(string url, string postDataStr,string path) public static string HttpPostForGetWXQRCodePath(string url, string postDataStr, string path)
{ {
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "POST"; req.Method = "POST";
...@@ -341,7 +338,7 @@ namespace Mall.Common.Plugin ...@@ -341,7 +338,7 @@ namespace Mall.Common.Plugin
/// <param name="postDataStr"></param> /// <param name="postDataStr"></param>
/// <param name="path"></param> /// <param name="path"></param>
/// <returns></returns> /// <returns></returns>
public static string HttpPostForGetWXQRCodePathSmallShops(string url, string postDataStr, string path,string ssPhoto) public static string HttpPostForGetWXQRCodePathSmallShops(string url, string postDataStr, string path, string ssPhoto)
{ {
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "POST"; req.Method = "POST";
...@@ -407,7 +404,7 @@ namespace Mall.Common.Plugin ...@@ -407,7 +404,7 @@ namespace Mall.Common.Plugin
stream = rsp.GetResponseStream(); stream = rsp.GetResponseStream();
return ReadImageForStream_V2(stream, path); return ReadImageForStream_V2(stream, path);
} }
catch(Exception ex) catch (Exception ex)
{ {
LogHelper.Write(ex, "GetResponseAsStringBase64_V2"); LogHelper.Write(ex, "GetResponseAsStringBase64_V2");
return ""; return "";
...@@ -426,7 +423,7 @@ namespace Mall.Common.Plugin ...@@ -426,7 +423,7 @@ namespace Mall.Common.Plugin
/// <param name="rsp"></param> /// <param name="rsp"></param>
/// <param name="encoding"></param> /// <param name="encoding"></param>
/// <returns></returns> /// <returns></returns>
private static string GetResponseAsStringBase64_V3(HttpWebResponse rsp, Encoding encoding, string path,string ssPhoto) private static string GetResponseAsStringBase64_V3(HttpWebResponse rsp, Encoding encoding, string path, string ssPhoto)
{ {
System.IO.Stream stream = null; System.IO.Stream stream = null;
try try
...@@ -453,7 +450,7 @@ namespace Mall.Common.Plugin ...@@ -453,7 +450,7 @@ namespace Mall.Common.Plugin
/// </summary> /// </summary>
/// <param name="imgstream"></param> /// <param name="imgstream"></param>
/// <returns></returns> /// <returns></returns>
public static string ReadImageForStream_V2(Stream imgstream,string path) public static string ReadImageForStream_V2(Stream imgstream, string path)
{ {
System.Drawing.Image result = System.Drawing.Image.FromStream(imgstream); System.Drawing.Image result = System.Drawing.Image.FromStream(imgstream);
System.Drawing.Bitmap bit = new System.Drawing.Bitmap(result); System.Drawing.Bitmap bit = new System.Drawing.Bitmap(result);
...@@ -507,7 +504,8 @@ namespace Mall.Common.Plugin ...@@ -507,7 +504,8 @@ namespace Mall.Common.Plugin
public static string ReadImageForStream_V3(Stream imgstream, string path, string ssPhoto) public static string ReadImageForStream_V3(Stream imgstream, string path, string ssPhoto)
{ {
System.Drawing.Image result = System.Drawing.Image.FromStream(imgstream); System.Drawing.Image result = System.Drawing.Image.FromStream(imgstream);
if (!string.IsNullOrEmpty(ssPhoto)) { if (!string.IsNullOrEmpty(ssPhoto))
{
WebRequest wreq = WebRequest.Create(ssPhoto); WebRequest wreq = WebRequest.Create(ssPhoto);
HttpWebResponse wresp = (HttpWebResponse)wreq.GetResponse(); HttpWebResponse wresp = (HttpWebResponse)wreq.GetResponse();
Stream s = wresp.GetResponseStream(); Stream s = wresp.GetResponseStream();
......
...@@ -170,5 +170,10 @@ namespace Mall.Model.Entity.Education ...@@ -170,5 +170,10 @@ namespace Mall.Model.Entity.Education
/// 活动总结 /// 活动总结
/// </summary> /// </summary>
public string Summary { get; set; } public string Summary { get; set; }
/// <summary>
/// 教师编号
/// </summary>
public int TeacherId { get; set; }
} }
} }
...@@ -201,5 +201,10 @@ namespace Mall.Model.Extend.Education ...@@ -201,5 +201,10 @@ namespace Mall.Model.Extend.Education
/// 是否查询有封面图的活动 /// 是否查询有封面图的活动
/// </summary> /// </summary>
public string IsQueryCoverImage { get; set; } public string IsQueryCoverImage { get; set; }
/// <summary>
/// 关联老师名称
/// </summary>
public string TeacherName { get; set; }
} }
} }
...@@ -283,6 +283,8 @@ namespace Mall.Module.Education ...@@ -283,6 +283,8 @@ namespace Mall.Module.Education
if (list != null && isQuerySignup) if (list != null && isQuerySignup)
{ {
string ids = string.Join(",", list.Select(qitem => qitem.Id)); string ids = string.Join(",", list.Select(qitem => qitem.Id));
string tids = string.Join(",", list.Select(qitem => qitem.TeacherId));
var employeeList = RB_AccountRepository.GetEmployeeListRepository(new Employee_ViewModel { School_Id = -1, AccountTypeStr = "2", }).ToList();
List<RB_Education_Consult_Extend> joinList = new List<RB_Education_Consult_Extend>(); List<RB_Education_Consult_Extend> joinList = new List<RB_Education_Consult_Extend>();
if (!string.IsNullOrEmpty(ids)) if (!string.IsNullOrEmpty(ids))
{ {
...@@ -291,6 +293,7 @@ namespace Mall.Module.Education ...@@ -291,6 +293,7 @@ namespace Mall.Module.Education
foreach (var item in list) foreach (var item in list)
{ {
item.EducationConsultList = joinList?.Where(qitem => qitem.ActivityId == item.Id)?.ToList() ?? new List<RB_Education_Consult_Extend>(); item.EducationConsultList = joinList?.Where(qitem => qitem.ActivityId == item.Id)?.ToList() ?? new List<RB_Education_Consult_Extend>();
item.TeacherName = employeeList?.FirstOrDefault(qitem => qitem.AccountId == item.TeacherId)?.EmployeeName ?? "";
} }
} }
return list; return list;
...@@ -367,6 +370,7 @@ namespace Mall.Module.Education ...@@ -367,6 +370,7 @@ namespace Mall.Module.Education
{nameof(RB_Education_Activity_Extend.LonLat),model.LonLat }, {nameof(RB_Education_Activity_Extend.LonLat),model.LonLat },
{nameof(RB_Education_Activity_Extend.LocationName),model.LocationName }, {nameof(RB_Education_Activity_Extend.LocationName),model.LocationName },
{nameof(RB_Education_Activity_Extend.LnsideLimit),model.LnsideLimit }, {nameof(RB_Education_Activity_Extend.LnsideLimit),model.LnsideLimit },
{nameof(RB_Education_Activity_Extend.TeacherId),model.TeacherId },
}; };
flag = education_ActivityRepository.Update(fileds, new WhereHelper(nameof(RB_Education_Activity_Extend.Id), model.Id), trans); flag = education_ActivityRepository.Update(fileds, new WhereHelper(nameof(RB_Education_Activity_Extend.Id), model.Id), trans);
if (flag) if (flag)
......
...@@ -84,17 +84,17 @@ namespace Mall.Repository.Product ...@@ -84,17 +84,17 @@ namespace Mall.Repository.Product
if (!string.IsNullOrEmpty(dmodel.OrderNo)) if (!string.IsNullOrEmpty(dmodel.OrderNo))
{ {
where += $@" and o.{nameof(RB_Goods_Order.OrderNo)} like @OrderNo "; where += $@" and o.{nameof(RB_Goods_Order.OrderNo)} like @OrderNo ";
parameters.Add("OrderNo", "%" + dmodel.OrderNo.Trim() + "%"); parameters.Add("OrderNo", "%" + Common.Plugin.StringHelper.ReplaceEmoji(dmodel.OrderNo.Trim())+ "%");
} }
if (!string.IsNullOrEmpty(dmodel.MerchantsNo)) if (!string.IsNullOrEmpty(dmodel.MerchantsNo))
{ {
where += $@" and o.{nameof(RB_Goods_Order.MerchantsNo)} like @MerchantsNo "; where += $@" and o.{nameof(RB_Goods_Order.MerchantsNo)} like @MerchantsNo ";
parameters.Add("MerchantsNo", "%" + dmodel.MerchantsNo.Trim() + "%"); parameters.Add("MerchantsNo", "%" + Common.Plugin.StringHelper.ReplaceEmoji(dmodel.MerchantsNo.Trim()) + "%");
} }
if (!string.IsNullOrEmpty(dmodel.UserName)) if (!string.IsNullOrEmpty(dmodel.UserName))
{ {
where += $@" and u.{nameof(RB_Member_User.Name)} like @UserName "; where += $@" and u.{nameof(RB_Member_User.Name)} like @UserName ";
parameters.Add("UserName", "%" + dmodel.UserName.Trim() + "%"); parameters.Add("UserName", "%" + Common.Plugin.StringHelper.ReplaceEmoji(dmodel.UserName.Trim()) + "%");
} }
if (dmodel.UserId > 0) if (dmodel.UserId > 0)
{ {
...@@ -103,12 +103,12 @@ namespace Mall.Repository.Product ...@@ -103,12 +103,12 @@ namespace Mall.Repository.Product
if (!string.IsNullOrEmpty(dmodel.GoodsName)) if (!string.IsNullOrEmpty(dmodel.GoodsName))
{ {
where += $@" and od.{nameof(RB_Goods_OrderDetail.GoodsName)} like @GoodsName "; where += $@" and od.{nameof(RB_Goods_OrderDetail.GoodsName)} like @GoodsName ";
parameters.Add("GoodsName", "%" + dmodel.GoodsName.Trim() + "%"); parameters.Add("GoodsName", "%" + Common.Plugin.StringHelper.ReplaceEmoji(dmodel.GoodsName.Trim()) + "%");
} }
if (!string.IsNullOrEmpty(dmodel.Consignee)) if (!string.IsNullOrEmpty(dmodel.Consignee))
{ {
where += $@" and o.{nameof(RB_Goods_Order.Consignee)} like @Consignee "; where += $@" and o.{nameof(RB_Goods_Order.Consignee)} like @Consignee ";
parameters.Add("Consignee", "%" + dmodel.Consignee.Trim() + "%"); parameters.Add("Consignee", "%" + Common.Plugin.StringHelper.ReplaceEmoji(dmodel.Consignee.Trim()) + "%");
} }
if (!string.IsNullOrEmpty(dmodel.Mobile)) if (!string.IsNullOrEmpty(dmodel.Mobile))
{ {
......
...@@ -1708,7 +1708,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -1708,7 +1708,8 @@ namespace Mall.WebApi.Controllers.Education
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetActivityTypeList(object requestMsg) public ApiResult GetActivityTypeList(object requestMsg)
{ {
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString()); var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
...@@ -1730,7 +1731,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -1730,7 +1731,8 @@ namespace Mall.WebApi.Controllers.Education
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetActivityPage() public ApiResult GetActivityPage()
{ {
var req = RequestParm; var req = RequestParm;
...@@ -1857,7 +1859,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -1857,7 +1859,8 @@ namespace Mall.WebApi.Controllers.Education
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetActivityDetial() public ApiResult GetActivityDetial()
{ {
var req = RequestParm; var req = RequestParm;
...@@ -2379,7 +2382,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2379,7 +2382,8 @@ namespace Mall.WebApi.Controllers.Education
return ApiResult.Failed("未查询到您正在学习的课程,无法绑定信息"); return ApiResult.Failed("未查询到您正在学习的课程,无法绑定信息");
} }
} }
else { else
{
return ApiResult.Failed("类型错误"); return ApiResult.Failed("类型错误");
} }
...@@ -2473,15 +2477,12 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2473,15 +2477,12 @@ namespace Mall.WebApi.Controllers.Education
#region 甲小鹤活动 #region 甲小鹤活动
/// <summary> /// <summary>
/// 获取商会活动分页列表 /// 获取商会活动分页列表
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetActivityPageJXH() public ApiResult GetActivityPageJXH()
{ {
...@@ -2497,19 +2498,27 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2497,19 +2498,27 @@ namespace Mall.WebApi.Controllers.Education
EduStudentId = RequestParm.EduStudentId EduStudentId = RequestParm.EduStudentId
}; };
} }
JObject jObj = JObject.Parse(req.msg.ToString()); ResultPageModel pageModel = new ResultPageModel();
ResultPageModel pageModel = new ResultPageModel() var query = new RB_Education_Activity_Extend();
try
{ {
pageSize = jObj.GetInt("pageSize"), JObject jObj = JObject.Parse(req.msg.ToString());
pageIndex=jObj.GetInt("pageIndex"), pageModel = new ResultPageModel()
}; {
pageSize = jObj.GetInt("pageSize"),
var query = new RB_Education_Activity_Extend() pageIndex = jObj.GetInt("pageIndex"),
};
query = new RB_Education_Activity_Extend()
{
SelectIsEnd = jObj.GetInt("SelectIsEnd", 0),
ActivityName = jObj.GetStringValue("ActivityName"),
ActivityType = jObj.GetInt("ActivityType", 0),
};
}
catch
{ {
SelectIsEnd = jObj.GetInt("SelectIsEnd", 0),
ActivityName = jObj.GetStringValue("ActivityName"), }
ActivityType = jObj.GetInt("ActivityType", 0),
};
query.IsQueryCoverImage = "1"; query.IsQueryCoverImage = "1";
query.SelectStartTimeStr = System.DateTime.Now.ToString("yyyy-MM-dd"); query.SelectStartTimeStr = System.DateTime.Now.ToString("yyyy-MM-dd");
query.SelectEndTimeStr = System.DateTime.Now.AddDays(60).ToString("yyyy-MM-dd"); query.SelectEndTimeStr = System.DateTime.Now.AddDays(60).ToString("yyyy-MM-dd");
...@@ -2528,7 +2537,6 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2528,7 +2537,6 @@ namespace Mall.WebApi.Controllers.Education
} }
} }
} }
pageModel.count = Convert.ToInt32(rowsCount); pageModel.count = Convert.ToInt32(rowsCount);
var result = list.Select(x => new var result = list.Select(x => new
{ {
...@@ -2556,18 +2564,15 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2556,18 +2564,15 @@ namespace Mall.WebApi.Controllers.Education
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
} }
/// <summary> /// <summary>
/// 获取商会活动分页列表 /// 获取商会活动分页列表
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetUserActivityListJXH() public ApiResult GetUserActivityListJXH()
{ {
// var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
var req = RequestParm; var req = RequestParm;
var userInfo = AppletUserInfo; var userInfo = AppletUserInfo;
if (userInfo == null) if (userInfo == null)
...@@ -2587,9 +2592,6 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2587,9 +2592,6 @@ namespace Mall.WebApi.Controllers.Education
ActivityName = jObj.GetStringValue("ActivityName"), ActivityName = jObj.GetStringValue("ActivityName"),
ActivityType = jObj.GetInt("ActivityType", 0), ActivityType = jObj.GetInt("ActivityType", 0),
}; };
// query.SelectStartTimeStr = System.DateTime.Now.ToString("yyyy-MM-dd");
// query.SelectEndTimeStr = System.DateTime.Now.AddDays(60).ToString("yyyy-MM-dd");
// query.OrderByStr = "StartTime";
query.TenantId = userInfo.TenantId; query.TenantId = userInfo.TenantId;
query.MallBaseId = userInfo.MallBaseId; query.MallBaseId = userInfo.MallBaseId;
query.EduStudentId = userInfo.EduStudentId; query.EduStudentId = userInfo.EduStudentId;
...@@ -2626,7 +2628,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2626,7 +2628,8 @@ namespace Mall.WebApi.Controllers.Education
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetActivityDetialJXH() public ApiResult GetActivityDetialJXH()
{ {
var req = RequestParm; var req = RequestParm;
...@@ -2641,8 +2644,16 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2641,8 +2644,16 @@ namespace Mall.WebApi.Controllers.Education
EduStudentId = RequestParm.EduStudentId EduStudentId = RequestParm.EduStudentId
}; };
} }
JObject parm = JObject.Parse(req.msg.ToString()); int Id = 0;
int Id = parm.GetInt("Id"); try
{
JObject parm = JObject.Parse(req.msg.ToString());
Id = parm.GetInt("Id");
}
catch
{
}
if (Id == 0) if (Id == 0)
{ {
return ApiResult.Failed("活动id不为空"); return ApiResult.Failed("活动id不为空");
...@@ -2679,7 +2690,6 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2679,7 +2690,6 @@ namespace Mall.WebApi.Controllers.Education
fileGroup.Add(new fileGroup.Add(new
{ {
Key = i, Key = i,
// groupList = group.Where(x => x.Type == item.Key).ToList(),
groupList = fileObjectList groupList = fileObjectList
}); });
} }
...@@ -2741,14 +2751,13 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2741,14 +2751,13 @@ namespace Mall.WebApi.Controllers.Education
} }
} }
/// <summary> /// <summary>
/// 取消报名 /// 取消报名
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult CancelCommerceConsultJXH() public ApiResult CancelCommerceConsultJXH()
{ {
bool flag = false; bool flag = false;
...@@ -2816,19 +2825,20 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2816,19 +2825,20 @@ namespace Mall.WebApi.Controllers.Education
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetUserJoinActivityPageListJXH() public ApiResult GetUserJoinActivityPageListJXH()
{ {
JObject jObj = JObject.Parse(RequestParm.msg.ToString()); JObject jObj = JObject.Parse(RequestParm.msg.ToString());
ResultPageModel pageModel = new ResultPageModel() ResultPageModel pageModel = new ResultPageModel()
{ {
pageSize= jObj.GetInt("pageSize"), pageSize = jObj.GetInt("pageSize"),
pageIndex = jObj.GetInt("pageIndex"), pageIndex = jObj.GetInt("pageIndex"),
}; };
RB_Education_Consult_Extend dmodel = new RB_Education_Consult_Extend() RB_Education_Consult_Extend dmodel = new RB_Education_Consult_Extend()
{ {
EnrollState = jObj.GetInt("EnrollState"), EnrollState = jObj.GetInt("EnrollState"),
LinkMan=jObj.GetStringValue("LinkMan"), LinkMan = jObj.GetStringValue("LinkMan"),
}; };
var userInfo = AppletUserInfo; var userInfo = AppletUserInfo;
if (userInfo == null) if (userInfo == null)
...@@ -2912,7 +2922,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2912,7 +2922,8 @@ namespace Mall.WebApi.Controllers.Education
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult GetEduReceiptInfo() { public ApiResult GetEduReceiptInfo()
{
var userInfo = base.AppletUserInfo; var userInfo = base.AppletUserInfo;
JObject parms = JObject.Parse(base.RequestParm.msg.ToString()); JObject parms = JObject.Parse(base.RequestParm.msg.ToString());
int FinanceId = parms.GetInt("FinanceId", 0); int FinanceId = parms.GetInt("FinanceId", 0);
...@@ -2943,15 +2954,18 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2943,15 +2954,18 @@ namespace Mall.WebApi.Controllers.Education
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult SetEduReceiptClaim() { public ApiResult SetEduReceiptClaim()
{
var userInfo = base.AppletUserInfo; var userInfo = base.AppletUserInfo;
JObject parms = JObject.Parse(base.RequestParm.msg.ToString()); JObject parms = JObject.Parse(base.RequestParm.msg.ToString());
int ReceiptId = parms.GetInt("ReceiptId", 0);//收据ID int ReceiptId = parms.GetInt("ReceiptId", 0);//收据ID
int ClaimCode = parms.GetInt("ClaimCode", 0);//认领码 int ClaimCode = parms.GetInt("ClaimCode", 0);//认领码
if (ReceiptId <= 0) { if (ReceiptId <= 0)
{
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
if (ClaimCode <= 0) { if (ClaimCode <= 0)
{
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
...@@ -2960,7 +2974,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2960,7 +2974,8 @@ namespace Mall.WebApi.Controllers.Education
{ {
return ApiResult.Success(); return ApiResult.Success();
} }
else { else
{
return ApiResult.Failed(msg); return ApiResult.Failed(msg);
} }
} }
......
...@@ -2147,6 +2147,7 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2147,6 +2147,7 @@ namespace Mall.WebApi.Controllers.Education
LonLat = jObj.GetStringValue("LonLat"), LonLat = jObj.GetStringValue("LonLat"),
LocationName = jObj.GetStringValue("LocationName"), LocationName = jObj.GetStringValue("LocationName"),
LnsideLimit = jObj.GetInt("LnsideLimit", 0), LnsideLimit = jObj.GetInt("LnsideLimit", 0),
TeacherId=jObj.GetInt("TeacherId")
}; };
try try
{ {
......
...@@ -6,6 +6,8 @@ using System.Text; ...@@ -6,6 +6,8 @@ using System.Text;
using Dnc.Api.Throttle; using Dnc.Api.Throttle;
using Mall.CacheManager.User; using Mall.CacheManager.User;
using Mall.Common.API; using Mall.Common.API;
using Mall.Common.Enum;
using Mall.Common.Enum.TradePavilion;
using Mall.Common.Plugin; using Mall.Common.Plugin;
using Mall.Model.Extend.TradePavilion; using Mall.Model.Extend.TradePavilion;
using Mall.Module.TradePavilion; using Mall.Module.TradePavilion;
...@@ -1459,7 +1461,7 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1459,7 +1461,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
x.Address, x.Address,
x.LatAndLon, x.LatAndLon,
x.Developers, x.Developers,
OpenTime = x.OpenTime.HasValue ? x.OpenTime.Value.ToString("yyyy-MM-dd HH:mm") : "", OpenTime = Common.ConvertHelper.FormatDate2(x.OpenTime),
x.ProjectType, x.ProjectType,
ProjectTypeName = x.ProjectType.GetEnumName(), ProjectTypeName = x.ProjectType.GetEnumName(),
x.CarrierSize, x.CarrierSize,
...@@ -1474,7 +1476,7 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1474,7 +1476,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
x.UserName, x.UserName,
x.UserIcon, x.UserIcon,
x.CarrierMetroList x.CarrierMetroList
}); });
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
} }
...@@ -1506,8 +1508,87 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1506,8 +1508,87 @@ namespace Mall.WebApi.Controllers.TradePavilion
[HttpPost] [HttpPost]
public ApiResult GetSetCarrier() public ApiResult GetSetCarrier()
{ {
RB_Carrier_Extend query = JsonConvert.DeserializeObject<RB_Carrier_Extend>(RequestParm.msg.ToString()); JObject parms = JObject.Parse(RequestParm.msg.ToString());
RB_Carrier_Extend query = new RB_Carrier_Extend()
{
ID = parms.GetInt("ID"),
CarrierName = parms.GetStringValue("CarrierName"),
Logo = parms.GetStringValue("Logo"),
VideoUrl = parms.GetStringValue("VideoUrl"),
Address = parms.GetStringValue("Address"),
LatAndLon = parms.GetStringValue("LatAndLon"),
Developers = parms.GetStringValue("Developers"),
OpenTime = parms.GetDateTime("OpenTime"),
ProjectType = (ProjectTypeEnum)parms.GetInt("ProjectType"),
CarrierSize = parms.GetDecimal("CarrierSize"),
LayersNum = parms.GetStringValue("LayersNum"),
CarNum = parms.GetInt("CarNum"),
CarrierPlan = parms.GetStringValue("CarrierPlan"),
CarrierTarget = parms.GetStringValue("CarrierTarget"),
Location = parms.GetStringValue("Location"),
Crowd = parms.GetStringValue("Crowd"),
Discount = parms.GetStringValue("Discount"),
StartingInfo = parms.GetStringValue("StartingInfo"),
ShopNum = parms.GetInt("ShopNum"),
BuiltUpArea = parms.GetDecimal("BuiltUpArea"),
AreaRequirement = parms.GetDecimal("AreaRequirement"),
YeJi = parms.GetDecimal("YeJi"),
OpeningStatus = parms.GetInt("OpeningStatus"),
};
string BannerList=parms.GetStringValue("BannerList");
if (!string.IsNullOrEmpty(BannerList))
{
query.BannerList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(BannerList);
}
string CarrierMetroList = parms.GetStringValue("CarrierMetroList");
query.CarrierMetroList = new List<RB_CarrierMetro_Extend>();
if (!string.IsNullOrEmpty(CarrierMetroList))
{
JArray jarray = JArray.Parse(CarrierMetroList);
if (jarray != null && jarray.Count > 0)
{
foreach (var jItem in jarray)
{
var sObj = JObject.Parse(jItem.ToString());
query.CarrierMetroList.Add(new RB_CarrierMetro_Extend()
{
ID = sObj.GetInt("ID"),
MetroNum = sObj.GetStringValue("MetroNum"),
MetroName = sObj.GetStringValue("MetroName"),
Distance = sObj.GetStringValue("Distance"),
CarrierId = sObj.GetInt("CarrierId"),
TenantId = sObj.GetInt("TenantId"),
MallBaseId = sObj.GetInt("MallBaseId"),
Status = (DateStateEnum)sObj.GetInt("Status"),
CarrierIds = sObj.GetStringValue("CarrierIds"),
});
}
}
}
string FirstShopNumList = parms.GetStringValue("FirstShopNumList");
query.FirstShopNumList = new List<FirstShopNumModel>();
if (!string.IsNullOrEmpty(FirstShopNumList))
{
JArray jarray = JArray.Parse(FirstShopNumList);
if (jarray != null && jarray.Count > 0)
{
foreach (var jItem in jarray)
{
var sObj = JObject.Parse(jItem.ToString());
query.FirstShopNumList.Add(new FirstShopNumModel()
{
Id = sObj.GetInt("Id"),
Name = sObj.GetStringValue("Name"),
Num = sObj.GetInt("Num")
});
}
}
}
string HonorList = parms.GetStringValue("HonorList");
if (!string.IsNullOrEmpty(HonorList))
{
query.HonorList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(HonorList);
}
if (string.IsNullOrWhiteSpace(query.CarrierName)) if (string.IsNullOrWhiteSpace(query.CarrierName))
{ {
return ApiResult.Failed("请输入载体名称"); return ApiResult.Failed("请输入载体名称");
...@@ -1541,10 +1622,10 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1541,10 +1622,10 @@ namespace Mall.WebApi.Controllers.TradePavilion
{ {
return ApiResult.Failed("请上传介绍图"); return ApiResult.Failed("请上传介绍图");
} }
if (!query.OpenTime.HasValue) //if (!query.OpenTime.HasValue)
{ //{
return ApiResult.Failed("请输入开业时间"); // return ApiResult.Failed("请输入开业时间");
} //}
if (!query.ProjectType.HasValue) if (!query.ProjectType.HasValue)
{ {
return ApiResult.Failed("请选择项目类型"); return ApiResult.Failed("请选择项目类型");
......
@echo off @echo off
echo ASPNETCORE_ENVIRONMENT=Development echo ASPNETCORE_ENVIRONMENT=Development
dotnet build dotnet build
start "Mall.WebApi" dotnet bin\Debug\netcoreapp3.0\Mall.WebApi.dll start "Mall.WebApi" dotnet bin\Debug\netcoreapp3.0\Mall.WebApi.dll --urls http://0.0.0.0:5000 --ip="127.0.0.1" --port=5000
exit exit
\ No newline at end of file
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