Commit 76e51646 authored by 吴春's avatar 吴春

提交代码

parent 35058cc3
......@@ -451,6 +451,12 @@ namespace Mall.Model.Entity.User
public int ViolationNum { get; set; }
/// <summary>
/// 孵化项目审核通知
/// </summary>
public string HatchExamineTpl { get; set; }
/// <summary>
/// 点数0-未开启,1-开启
/// </summary>
......
......@@ -961,7 +961,7 @@ namespace Mall.Module.User
},
thing2 = new
{
value = UserName.Length>20? UserName.Substring(0, 18): UserName
value = UserName.Length > 20 ? UserName.Substring(0, 18) : UserName
},
time4 = new
{
......@@ -1001,6 +1001,100 @@ namespace Mall.Module.User
}
return false;
}
/// <summary>
/// 审核首店/公司发送订阅消息
/// </summary>
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <param name="OpenId"></param>
/// <param name="Remark">退款原因</param>
/// <param name="OrderNo">订单号</param>
/// <param name="OrderMoney">退款金额</param>
/// <param name="GoodsName">商品名称</param>
/// <returns></returns>
public bool SendHatchExamineMsg(int TenantId, int MallBaseId, List<string> OpenIds, string result, string typeName, string CreateTime)
{
var appletWeChatModel = programRepository.GetListRepository(new RB_MiniProgram_Extend { TenantId = TenantId, MallBaseId = MallBaseId }).FirstOrDefault();
string token = WeiXinReidsCache.Get(appletWeChatModel.MiniAppId);
if (string.IsNullOrEmpty(token))
{
token = Mall.Common.Pay.WeChatPat.TokenHelper.GetLXYToken(token, appletWeChatModel.MiniAppId, appletWeChatModel.MiniAppSecret);
System.Threading.Tasks.Task.Run(() => WeiXinReidsCache.Set(appletWeChatModel.MiniAppId, token));
}
if (string.IsNullOrEmpty(token))
{
return false;
}
string wenXinResult = string.Empty;
int successCount = 0;
if (!string.IsNullOrWhiteSpace(token))
{
try
{
foreach (var item in OpenIds)
{
if (!string.IsNullOrWhiteSpace(item))
{
string Url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + token;
var postdata = new
{
touser = item,
template_id = appletWeChatModel.HatchExamineTpl,
page = "pages/order/index/index",
data = new
{
phrase1 = new
{
value = result
},
date7 = new
{
value = CreateTime
},
name8 = new
{
value = typeName
}
}
};
wenXinResult = HttpHelper.HttpPost(Url, JsonHelper.Serialize(postdata), "");
LogHelper.WriteInfo("首店审核/公司审核发送通知消息:" + wenXinResult);
JObject jo = (JObject)JsonConvert.DeserializeObject(wenXinResult);
int errcode = Convert.ToInt32(jo["errcode"].ToString());
if (errcode == 0)
{
successCount += 1;
}
else
{
LogHelper.Write(string.Format("SendHatchExamineMsg:wenXinResult:{0}", wenXinResult));
}
}
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "SendHatchExamineMsg");
LogHelper.Write(string.Format("SendHatchExamineMsg:wenXinResult:{0}", wenXinResult));
}
if (successCount == OpenIds.Count())
{
return true;
}
else
{
return false;
}
}
return false;
}
#endregion
#region 评论违规检测
......
......@@ -206,6 +206,9 @@ namespace Mall.Module.User
private readonly RB_MiAi_FollowMemberRepository miai_FollowMemberRepository = new RB_MiAi_FollowMemberRepository();
private readonly Repository.TradePavilion.RB_CompanyRepository companyRepository = new Repository.TradePavilion.RB_CompanyRepository();
#region 基础配置
/// <summary>
......@@ -4426,15 +4429,18 @@ namespace Mall.Module.User
List<string> DateList = new List<string>();
DateTime STime = Convert.ToDateTime(startTime);
DateTime ETime = Convert.ToDateTime(endTime);
while (true) {
while (true)
{
DateList.Add(STime.ToString("yyyy-MM-dd"));
STime = STime.AddDays(1);
if (STime > ETime) {
if (STime > ETime)
{
break;
}
}
List<object> Rlist = new List<object>();
foreach (var item in DateList) {
foreach (var item in DateList)
{
var mymodel = myList.Where(x => x.StartTime == item).FirstOrDefault();
var remodel = reList.Where(x => x.StartTime == item).FirstOrDefault();
var vipmodel = vipList.Where(x => x.CreateTimeStr == item).FirstOrDefault();
......@@ -4495,7 +4501,8 @@ namespace Mall.Module.User
var model = distributor_InfoRepository.GetList(new RB_Distributor_Info_Extend() { UserId = userInfo.UserId, TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId }).FirstOrDefault();
if (model == null)
{
return new {
return new
{
State = 2,
Msg = "分销商不存在"
};
......@@ -4508,7 +4515,8 @@ namespace Mall.Module.User
Msg = "分销商不存在"
};
}
if (model.IsOpenOfflineEarnings != 1) {
if (model.IsOpenOfflineEarnings != 1)
{
return new
{
State = 2,
......@@ -4771,8 +4779,20 @@ namespace Mall.Module.User
//消息数量
int MessageNum = miai_MessageRepository.GetMessageNum(new Model.Extend.Miai.RB_Miai_Message_Extend() { TenantId = umodel.TenantId, MallBaseId = umodel.MallBaseId, UserId = umodel.Id });
#region 2021-03-24 add by:W
var company = companyRepository.GetCompanyRepository(new Model.Extend.TradePavilion.RB_Company_Extend { TenantId = umodel.TenantId, MallBaseId = umodel.MallBaseId, CreateBy = umodel.Id });
#endregion
objData = new
{
//孵化公司
company = new
{
companyName = company?.CompanyName ?? "",
companyStatus = company?.CompanyStatus ?? -1
},
//昵称
nickname = umodel?.Name ?? "",
//电话
......@@ -6585,7 +6605,7 @@ namespace Mall.Module.User
#endregion
......
......@@ -74,7 +74,10 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// 认证对象
/// </summary>
private readonly AuthenticationModule authenticationModule = new AuthenticationModule();
/// <summary>
/// 小程序
/// </summary>
private readonly Module.User.MiniProgramModule programModule = new Module.User.MiniProgramModule();
#region 公司信息管理
......@@ -130,7 +133,24 @@ namespace Mall.WebApi.Controllers.TradePavilion
extModel.UpdateDate = DateTime.Now;
extModel.CompanyStatus = 0;
int ID = companyModule.SetCompanyModule(extModel);
return ID > 0 ? ApiResult.Success("", new { CompanyId = ID }) : ApiResult.Failed();
if (ID > 0)
{
//获取订阅消息
var miniModel = programModule.GetMiniProgramModule(new Model.Extend.User.RB_MiniProgram_Extend { TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId });
List<string> template_message_list = new List<string>();
if (miniModel != null)
{
if (!string.IsNullOrWhiteSpace(miniModel.HatchExamineTpl))
{
template_message_list.Add(miniModel.HatchExamineTpl);
}
}
return ApiResult.Success("", new { CompanyId = ID, template_message_list });
}
return ApiResult.Failed();
}
/// <summary>
......@@ -565,23 +585,29 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetAuthenticationInfo() {
public ApiResult SetAuthenticationInfo()
{
var parms = RequestParm;
var userInfo = AppletUserInfo;
RB_Authentication_Extend demodel = JsonConvert.DeserializeObject<RB_Authentication_Extend>(parms.msg.ToString());
if (string.IsNullOrEmpty(demodel.Name)) {
if (string.IsNullOrEmpty(demodel.Name))
{
return ApiResult.ParamIsNull("请传递首店名称");
}
if (string.IsNullOrEmpty(demodel.Address)) {
if (string.IsNullOrEmpty(demodel.Address))
{
return ApiResult.ParamIsNull("请输入地址");
}
if (string.IsNullOrEmpty(demodel.Description)) {
if (string.IsNullOrEmpty(demodel.Description))
{
return ApiResult.ParamIsNull("请输入简介");
}
if (string.IsNullOrEmpty(demodel.Contact)) {
if (string.IsNullOrEmpty(demodel.Contact))
{
return ApiResult.ParamIsNull("请输入联系人");
}
if (string.IsNullOrEmpty(demodel.ContactMobile)) {
if (string.IsNullOrEmpty(demodel.ContactMobile))
{
return ApiResult.ParamIsNull("请输入联系电话");
}
......@@ -596,7 +622,19 @@ namespace Mall.WebApi.Controllers.TradePavilion
bool flag = authenticationModule.SetActivityDiscussInfo(demodel);
if (flag)
{
return ApiResult.Success();
//获取订阅消息
var miniModel = programModule.GetMiniProgramModule(new Model.Extend.User.RB_MiniProgram_Extend { TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId });
List<string> template_message_list = new List<string>();
if (miniModel != null)
{
if (!string.IsNullOrWhiteSpace(miniModel.HatchExamineTpl))
{
template_message_list.Add(miniModel.HatchExamineTpl);
}
}
return ApiResult.Success("", template_message_list);
}
else
{
......@@ -609,7 +647,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAuthenticationPageList() {
public ApiResult GetAuthenticationPageList()
{
var parms = RequestParm;
var userInfo = AppletUserInfo;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
......@@ -655,17 +694,20 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAuthenticationInfo() {
public ApiResult GetAuthenticationInfo()
{
var userInfo = AppletUserInfo;
JObject parms = JObject.Parse(RequestParm.msg.ToString());
int AuthenticationId = parms.GetInt("AuthenticationId", 0);
if (AuthenticationId <= 0) {
if (AuthenticationId <= 0)
{
return ApiResult.ParamIsNull("请传递认证id");
}
var model = authenticationModule.GetAuthenticationInfo(AuthenticationId);
if (model == null) { return ApiResult.Failed("认证不存在"); }
if (userInfo.UserId != model.CreateBy) { return ApiResult.Failed("无法查看"); }
return ApiResult.Success("",new {
return ApiResult.Success("", new
{
model.Id,
model.Name,
model.CoverImage,
......@@ -699,7 +741,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult DelAuthenticationInfo() {
public ApiResult DelAuthenticationInfo()
{
var userInfo = AppletUserInfo;
JObject parms = JObject.Parse(RequestParm.msg.ToString());
int AuthenticationId = parms.GetInt("AuthenticationId", 0);
......@@ -712,7 +755,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed();
}
}
......
......@@ -65,6 +65,12 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
private readonly CommerceAskModule askModule = new CommerceAskModule();
/// <summary>
/// 会员信息
/// </summary>
private readonly Module.User.UserModule userModule = new Module.User.UserModule();
#region 联系人管理
/// <summary>
......@@ -318,12 +324,27 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
return ApiResult.Failed("公司信息不存在");
}
if (Status != 1 && Status != 2)
{
return ApiResult.Failed("状态有误");
}
if (model.CompanyStatus == 1)
{
return ApiResult.Failed("公司信息已审核通过,请勿重复审核");
}
var flag = companyModule.UpdateCompanyStatus(CompanyId, Status);
if (flag && Status > 0)//推送审核结果
{
//查询用户的信息
var umodel = userModule.GetMemberUserInfo(model.CreateBy);
if (umodel != null && !string.IsNullOrWhiteSpace(umodel.OpenId))
{
List<string> openidList = new List<string>();
openidList.Add(umodel.OpenId);
new Module.User.MiniProgramMsgModule().SendHatchExamineMsg(model.TenantId, model.MallBaseId, openidList, Status == 1 ? "企业认证通过" : "企业认证失败", "企业认证结果通知", System.DateTime.Now.ToString("yyyy年MM月dd日 HH:mm"));
}
}
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
......@@ -784,7 +805,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
[HttpPost]
public FileContentResult GetAuthenticationListToExcel()
{
{
var userInfo = this.UserInfo;
RB_Authentication_Extend demodel = JsonConvert.DeserializeObject<RB_Authentication_Extend>(RequestParm.msg.ToString());
string ExcelName = "首店申请" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
......@@ -828,7 +849,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
AuditState = "通过";
}
else if (item.AuditState == 3) {
else if (item.AuditState == 3)
{
AuditState = "不通过";
}
ExcelDataSource datarow = new ExcelDataSource()
......@@ -885,7 +907,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
return ApiResult.ParamIsNull("请传递认证id");
}
var model = authenticationModule.GetAuthenticationInfo(AuthenticationId);
if (model == null) { return ApiResult.Failed("认证不存在"); }
if (model == null) { return ApiResult.Failed("认证不存在"); }
return ApiResult.Success("", new
{
model.Id,
......@@ -921,7 +943,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetAuthenticationAudit() {
public ApiResult SetAuthenticationAudit()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
int AuthenticationId = parms.GetInt("AuthenticationId", 0);
int AuditState = parms.GetInt("AuditState", 0);//审核状态 2审核通过 3审核不通过
......@@ -937,9 +960,19 @@ namespace Mall.WebApi.Controllers.TradePavilion
bool flag = authenticationModule.SetAuthenticationAudit(AuthenticationId, AuditState, AuditRemark);
if (flag)
{
//查询用户的信息
var model = authenticationModule.GetAuthenticationInfo(AuthenticationId);
var umodel = userModule.GetMemberUserInfo(model.CreateBy);
if (umodel != null && !string.IsNullOrWhiteSpace(umodel.OpenId))
{
List<string> openidList = new List<string>();
openidList.Add(umodel.OpenId);
new Module.User.MiniProgramMsgModule().SendHatchExamineMsg(model.TenantId, model.MallBaseId, openidList, AuditState == 2 ? "首店认证通过" : "首店认证失败", "首店认证结果通知", System.DateTime.Now.ToString("yyyy年MM月dd日 HH:mm"));
}
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed();
}
}
......@@ -1038,10 +1071,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
return ApiResult.Failed("请输入开发商");
}
if (string.IsNullOrWhiteSpace(query.CarrierName))
{
return ApiResult.Failed("请输入载体名称");
}
if (query.BannerList != null && query.BannerList.Any())
{
query.Banner = JsonConvert.SerializeObject(query.BannerList);
......@@ -1130,10 +1160,10 @@ namespace Mall.WebApi.Controllers.TradePavilion
public ApiResult GetBrandClassList()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var query = new RB_BrandClass_Extend() ;
var query = new RB_BrandClass_Extend();
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var list = carrierModule.GetBrandClassList( query);
var list = carrierModule.GetBrandClassList(query);
return ApiResult.Success(data: list);
}
......@@ -1218,7 +1248,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
BrandName = parms.GetStringValue("BrandName"),
ProjectType = (Common.Enum.TradePavilion.ProjectTypeEnum)parms.GetInt("ProjectType", 0),
BrandClassId= parms.GetInt("BrandClassId",0),
BrandClassId = parms.GetInt("BrandClassId", 0),
RanQi = parms.GetInt("RanQi", -1),
KongTiao = parms.GetInt("KongTiao", -1),
XinFeng = parms.GetInt("XinFeng", -1),
......@@ -1259,7 +1289,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
var query = new RB_Brand_Extend()
{
ID = parms.GetInt("ID", 0),
};
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
......
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