Commit 3c95394c authored by 吴春's avatar 吴春

提交代码

parent 3fedab6e
......@@ -22,6 +22,12 @@ namespace Mall.Model.Entity.Miai
set;
}
/// <summary>
/// 真实姓名
/// </summary>
public string RealName { get; set; }
/// <summary>
/// 微信号
/// </summary>
......
......@@ -522,10 +522,15 @@ namespace Mall.Module.Education
public List<Rb_Education_Dynamic_Extend> MiAiDynamicList(int pageIndex, int pageSize, out long count, Rb_Education_Dynamic_Extend model)
{
List<Rb_Education_Dynamic_Extend> articleList = new List<Rb_Education_Dynamic_Extend>();
if (model.UserId > 0)//关注并公开
if (model.CreateBy > 0 && model.UserId > 0)
{
articleList = articleRepository.MiAiDynamicOpenList(pageIndex, pageSize, out count, model);
}
else if (model.UserId > 0)
{
articleList = articleRepository.MiAiDynamicOpenList_V2(pageIndex, pageSize, out count, model);
}
else
{//公开的
articleList = articleRepository.MiAiDynamicList(pageIndex, pageSize, out count, model);
......
......@@ -1343,6 +1343,38 @@ namespace Mall.Module.Miai
return miai_BaseInfoRepository.Update(keyValues, wheres);
}
/// <summary>
/// 更新用户发帖状态
/// </summary>
/// <param name="UserId"></param>
/// <param name="IsFaTie"></param>
/// <returns></returns>
public bool UpdateIDCardInfo(RB_MiAi_BaseInfo_Extend model)
{
bool flag = false;
if (model.Id == 0)
{
flag = miai_BaseInfoRepository.Insert(model) > 0;
}
else {
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_MiAi_BaseInfo_Extend.IDCardNo),model.IDCardNo},
{ nameof(RB_MiAi_BaseInfo_Extend.RealName),model.RealName}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_MiAi_BaseInfo_Extend.UserId),
FiledValue=model.UserId,
OperatorEnum=OperatorEnum.Equal
}
};
flag= miai_BaseInfoRepository.Update(keyValues, wheres);
}
return flag;
}
/// <summary>
/// 新增用户的基础信息
/// </summary>
......@@ -1391,6 +1423,7 @@ namespace Mall.Module.Miai
{ nameof(RB_MiAi_BaseInfo_Extend.IDCard),model.IDCard},
{ nameof(RB_MiAi_BaseInfo_Extend.IDCardBack),model.IDCardBack},
{ nameof(RB_MiAi_BaseInfo_Extend.IDCardNo),model.IDCardNo},
{ nameof(RB_MiAi_BaseInfo_Extend.RealName),model.RealName},
{ nameof(RB_MiAi_BaseInfo_Extend.ActivityRegion),model.ActivityRegion},
{ nameof(RB_MiAi_BaseInfo_Extend.IsFaTie),model.IsFaTie},
{ nameof(RB_MiAi_BaseInfo_Extend.WechatNo),model.WechatNo},
......
......@@ -4865,7 +4865,7 @@ namespace Mall.Module.User
Completed = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.Received).FirstOrDefault()?.OrderNum ?? 0,
},
isShowDistributionCenter = IsShowDistributionCenter,
isAttestation = (oldBaseInfo != null && oldBaseInfo.Id > 0 && !string.IsNullOrWhiteSpace(oldBaseInfo.IDCard) && !string.IsNullOrWhiteSpace(oldBaseInfo.IDCardBack)) ? 1 : ((oldBaseInfo != null && oldBaseInfo.Id > 0) ? 2 : 0),// 0-未认证,1-已认证
isAttestation = (oldBaseInfo != null && oldBaseInfo.Id > 0 && !string.IsNullOrWhiteSpace(oldBaseInfo.IDCardNo) && !string.IsNullOrWhiteSpace(oldBaseInfo.RealName)) ? 1 : ((oldBaseInfo != null && oldBaseInfo.Id > 0) ? 2 : 0),// 0-未认证,1-已认证
isFaTie = (oldBaseInfo != null && oldBaseInfo.Id > 0) ? oldBaseInfo.IsFaTie : 0,// 0-没发帖权限,1-有发帖权限
Sex = (oldBaseInfo != null && oldBaseInfo.Id > 0) ? oldBaseInfo.Sex : 0,//0-未认证,1-男-2女
myFollowNum = (oldBaseInfo != null && oldBaseInfo.Id > 0) ? oldBaseInfo.FollowNum : 0,//关注我的
......
......@@ -315,6 +315,7 @@ LEFT JOIN rb_education_talk as talk on talk.id=t.tid and talk.`Status`= 0
string likeWhere = "";
string followWhere = "";
string talkWhere = "";
string otherWhere = "";
if (model != null)
{
if (model.TenantId > 0)
......@@ -330,15 +331,17 @@ LEFT JOIN rb_education_talk as talk on talk.id=t.tid and talk.`Status`= 0
where += $@" and a.Id = {model.Id} ";
}
if (model.CreateBy > 0)
if (model.CreateBy > 0 && model.UserId > 0)
{
where += $@" and a.CreateBy = {model.CreateBy} ";
otherWhere += $@" and b.CreateBy={model.CreateBy} and b.UserId={model.UserId} and b.`Status`=0 ";
}
if (model.UserId > 0)
else if (model.UserId > 0)
{
likeWhere += $@" and l.UserId = {model.UserId} ";
followWhere += $@" and (b.UserId = {model.UserId} and b.`Status`=0 or a.CreateBy = {model.UserId} ) ";
}
if (model.TalkId > 0)
{
talkWhere = $"and talk.Id = {model.TalkId} ";
......@@ -348,7 +351,7 @@ LEFT JOIN rb_education_talk as talk on talk.id=t.tid and talk.`Status`= 0
from (SELECT a.TenantId,a.MallBaseId,a.CreateBy,a.id,a.UserTeacher,a.Content,a.Files,a.LatAndLong,a.Address,a.CreateTime,a.CoverPhoto,a.FileType,a.IsOpen,a.`Status`,a.TalkId as tid from
Rb_Education_Dynamic a where a.IsOpen=1 {where}
union all SELECT a.TenantId,a.MallBaseId,a.CreateBy,a.id,a.UserTeacher,a.Content,a.Files,a.LatAndLong,a.Address,a.CreateTime,a.CoverPhoto,a.FileType,a.IsOpen,a.`Status`,a.TalkId as tid from
Rb_Education_Dynamic a LEFT JOIN RB_MiAi_FollowMember as b on a.CreateBy=b.UserId where a.IsOpen=2 {where} {followWhere} ) as t
Rb_Education_Dynamic a LEFT JOIN RB_MiAi_FollowMember as b on a.CreateBy=b.UserId {otherWhere} where a.IsOpen=2 {where} {followWhere} ) as t
LEFT JOIN rb_education_dynamiclike l on l.ArticleId = t.id {likeWhere}
LEFT JOIN rb_member_user e on e.Id = t.CreateBy
LEFT JOIN rb_education_talk as talk on talk.id=t.tid and talk.`Status`= 0 where 1=1 {talkWhere}
......@@ -357,6 +360,66 @@ LEFT JOIN rb_education_talk as talk on talk.id=t.tid and talk.`Status`= 0 where
}
/// <summary>
/// 动态列表(除教育外)
/// </summary>
/// <param name="empId">员工id</param>
/// <param name="groupId">集团id</param>
/// <param name="pageIndex">当前页</param>
/// <param name="pageSize">分页大小</param>
/// <param name="count">总条数</param>
/// <returns></returns>
public List<Rb_Education_Dynamic_Extend> MiAiDynamicOpenList_V2(int pageIndex, int pageSize, out long count, Rb_Education_Dynamic_Extend model)
{
string where = " and a.`Status`=0 ";
string likeWhere = "";
string followWhere = "";
string talkWhere = "";
string otherWhere = "";
if (model != null)
{
if (model.TenantId > 0)
{
where += $@" and a.TenantId = {model.TenantId} ";
}
if (model.MallBaseId > 0)
{
where += $@" and a.MallBaseId = {model.MallBaseId} ";
}
if (model.Id > 0)
{
where += $@" and a.Id = {model.Id} ";
}
if (model.CreateBy > 0 && model.UserId > 0)
{
where += $@" and a.CreateBy = {model.CreateBy} ";
otherWhere += $@" and b.CreateBy={model.CreateBy} and b.UserId={model.UserId} and b.`Status`=0 ";
}
else if (model.UserId > 0)
{
otherWhere += $@" and b.CreateBy={model.UserId} and b.`Status`=0 ";
likeWhere += $@" and l.UserId = {model.UserId} ";
// followWhere += $@" and (b.UserId = {model.UserId} and b.`Status`=0 or a.CreateBy = {model.UserId} ) ";
}
if (model.TalkId > 0)
{
talkWhere = $"and talk.Id = {model.TalkId} ";
}
}
string sql = $@"SELECT t.*,if(l.Id>0,1,0) as HasLike,talk.Id as TalkId,talk.Content as TalkContent,e.`Name` as CreateByName,e.Photo as CrearteByPhoto
from (SELECT a.TenantId,a.MallBaseId,a.CreateBy,a.id,a.UserTeacher,a.Content,a.Files,a.LatAndLong,a.Address,a.CreateTime,a.CoverPhoto,a.FileType,a.IsOpen,a.`Status`,a.TalkId as tid from
Rb_Education_Dynamic a where 1=1 and (a.IsOpen=1 or (a.IsOpen=2 and a.CreateBy={model.UserId})) {where} {followWhere}
union all SELECT a.TenantId,a.MallBaseId,a.CreateBy,a.id,a.UserTeacher,a.Content,a.Files,a.LatAndLong,a.Address,a.CreateTime,a.CoverPhoto,a.FileType,a.IsOpen,a.`Status`,a.TalkId as tid from
Rb_Education_Dynamic a LEFT JOIN RB_MiAi_FollowMember as b on a.CreateBy=b.UserId {otherWhere} where a.IsOpen=2 and a.CreateBy !={model.UserId} {where} {followWhere} ) as t
LEFT JOIN rb_education_dynamiclike l on l.ArticleId = t.id {likeWhere}
LEFT JOIN rb_member_user e on e.Id = t.CreateBy
LEFT JOIN rb_education_talk as talk on talk.id=t.tid and talk.`Status`= 0 where 1=1 {talkWhere}
ORDER BY t.CreateTime DESC";
return GetPage<Rb_Education_Dynamic_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
......
......@@ -156,9 +156,9 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.Failed("请先实名认证");
}
if (string.IsNullOrWhiteSpace(oldBaseInfo.IDCard) || string.IsNullOrWhiteSpace(oldBaseInfo.IDCardBack))
if (string.IsNullOrWhiteSpace(oldBaseInfo.IDCardNo) || string.IsNullOrWhiteSpace(oldBaseInfo.RealName))
{
return ApiResult.Failed("请上传身份证信息");
return ApiResult.Failed("请先通过身份证认证");
}
JObject jobj = JObject.Parse(parms.msg.ToString());
......@@ -1091,8 +1091,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
oldBaseInfo.AlbumList = new List<string>();
}
IsAttestation = 2;//认证
if (!string.IsNullOrWhiteSpace(oldBaseInfo.IDCard) && !string.IsNullOrWhiteSpace(oldBaseInfo.IDCardBack))
IsAttestation = 2;//基础信息认证
if (!string.IsNullOrWhiteSpace(oldBaseInfo.IDCardNo) && !string.IsNullOrWhiteSpace(oldBaseInfo.RealName))
{
IsAttestation = 1;//已认证
}
......@@ -1159,6 +1159,7 @@ namespace Mall.WebApi.Controllers.MallBase
IDCardBack = oldBaseInfo.IDCardBack ?? "",
IDCard = oldBaseInfo.IDCard ?? "",
IDCardNo = oldBaseInfo.IDCardNo ?? "",
RealName = oldBaseInfo.RealName ?? "",
ActivityRegion = oldBaseInfo.ActivityRegion ?? "",
DWCName = oldBaseInfo.DWCName ?? "",
DWDName = oldBaseInfo.DWDName ?? "",
......@@ -1387,55 +1388,55 @@ namespace Mall.WebApi.Controllers.MallBase
var dayQueryModel = new RB_MiAi_BaseInfoDayQuery();
//if (demodel.UserId > 0)//说明用户登录了的
//{
try
try
{
if (demodel.Sex == 0 && demodel.UserId > 0)
{
if (demodel.Sex == 0&& demodel.UserId > 0)
var oldBaseInfo = miaiModule.GetBaseInfoModel(new RB_MiAi_BaseInfo_Extend { UserId = demodel.UserId, TenantId = RequestParm.TenantId, MallBaseId = RequestParm.MallBaseId });
if (oldBaseInfo != null && oldBaseInfo.Id > 0 && demodel.Sex == 0)
{
var oldBaseInfo = miaiModule.GetBaseInfoModel(new RB_MiAi_BaseInfo_Extend { UserId = demodel.UserId, TenantId = RequestParm.TenantId, MallBaseId = RequestParm.MallBaseId });
if (oldBaseInfo != null && oldBaseInfo.Id > 0 && demodel.Sex == 0)
{
demodel.Sex = oldBaseInfo.Sex == 1 ? 2 : 1;
}
demodel.Sex = oldBaseInfo.Sex == 1 ? 2 : 1;
}
dayQueryModel = miaiModule.GetBaseInfoQueryList(new RB_MiAi_BaseInfoDayQuery
{
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
UserId = demodel.UserId,
Sex = demodel.Sex,
CreateDate = System.DateTime.Now
}).FirstOrDefault();
if (dayQueryModel == null || (dayQueryModel?.Id ?? 0) == 0)
}
dayQueryModel = miaiModule.GetBaseInfoQueryList(new RB_MiAi_BaseInfoDayQuery
{
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
UserId = demodel.UserId,
Sex = demodel.Sex,
CreateDate = System.DateTime.Now
}).FirstOrDefault();
if (dayQueryModel == null || (dayQueryModel?.Id ?? 0) == 0)
{
var oldList = miaiModule.GetDailyRandomList(demodel, pagelist.pageSize);
if (oldList != null && oldList.Any())
{
var oldList = miaiModule.GetDailyRandomList(demodel, pagelist.pageSize);
if (oldList != null && oldList.Any())
string ids = string.Join(",", oldList.Select(x => x.UserId));
dayQueryModel = new RB_MiAi_BaseInfoDayQuery
{
string ids = string.Join(",", oldList.Select(x => x.UserId));
dayQueryModel = new RB_MiAi_BaseInfoDayQuery
{
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
UserId = demodel.UserId,
Sex = demodel.Sex,
CreateDate = System.DateTime.Now,
Status = 0,
Id = 0,
BaseInfoIds = ids
};
var queryResult = miaiModule.SetMiAiBaseInfoDayQuery(dayQueryModel);
}
}
if (!string.IsNullOrWhiteSpace(dayQueryModel.BaseInfoIds))
{
demodel.UserIds = dayQueryModel.BaseInfoIds;
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
UserId = demodel.UserId,
Sex = demodel.Sex,
CreateDate = System.DateTime.Now,
Status = 0,
Id = 0,
BaseInfoIds = ids
};
var queryResult = miaiModule.SetMiAiBaseInfoDayQuery(dayQueryModel);
}
}
catch (Exception ex)
if (!string.IsNullOrWhiteSpace(dayQueryModel.BaseInfoIds))
{
demodel.UserIds = dayQueryModel.BaseInfoIds;
}
// }
}
catch (Exception ex)
{
}
// }
var list = miaiModule.GetFirstBaseInfoPageList_V2(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
List<Model.Extend.MarketingCenter.miaiUserDetail> newGoodsList = new List<Model.Extend.MarketingCenter.miaiUserDetail>();
......@@ -1653,10 +1654,10 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.Failed("请先实名认证");
}
if (string.IsNullOrWhiteSpace(oldBaseInfo.IDCard) || string.IsNullOrWhiteSpace(oldBaseInfo.IDCardBack))
if (string.IsNullOrWhiteSpace(oldBaseInfo.IDCardNo) || string.IsNullOrWhiteSpace(oldBaseInfo.RealName))
{
return ApiResult.Failed("请上传身份证信息");
return ApiResult.Failed("请先通过身份证认证");
}
......
......@@ -629,6 +629,7 @@ namespace Mall.WebApi.Controllers.MallBase
AppointmentAddress = oldBaseInfo.AppointmentAddress ?? "",
oldBaseInfo.AlbumList,
IDCardNo = oldBaseInfo.IDCardNo ?? "",
RealName = oldBaseInfo.RealName ?? "",
IDCard = oldBaseInfo.IDCard ?? "",
IDCardBack = oldBaseInfo.IDCardBack ?? "",
ActivityRegion = oldBaseInfo.ActivityRegion ?? "",
......@@ -1059,6 +1060,7 @@ namespace Mall.WebApi.Controllers.MallBase
IDCardBack = oldBaseInfo.IDCardBack ?? "",
IDCard = oldBaseInfo.IDCard ?? "",
IDCardNo = oldBaseInfo.IDCardNo ?? "",
RealName = oldBaseInfo.RealName ?? "",
ActivityRegion = oldBaseInfo.ActivityRegion ?? "",
BaseInfoId = oldBaseInfo?.Id ?? 0,
IsFaTie = oldBaseInfo?.IsFaTie ?? 0,
......
......@@ -417,7 +417,6 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
{
msg = sign,
};
string apiResult = Mall.Common.Plugin.HttpHelper.HttpPost(Config.IncomeFinanceApi, JsonHelper.Serialize(resultInfo), "");
JObject parmsJob = JObject.Parse(apiResult);
string resultCode = parmsJob.GetStringValue("resultCode");
......
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