Commit 769ff89b authored by liudong1993's avatar liudong1993

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

parents 28705007 47c09fc1
...@@ -127,5 +127,10 @@ namespace Mall.Common ...@@ -127,5 +127,10 @@ namespace Mall.Common
/// 是否开启校园版(1-开启) /// 是否开启校园版(1-开启)
/// </summary> /// </summary>
public int IsOpenSchool { get; set; } public int IsOpenSchool { get; set; }
/// <summary>
/// 相亲项目-1已填写,0-未填写
/// </summary>
public int IsAddBaseInfo { get; set; }
} }
} }
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Plugin;
namespace Mall.Common.Enum.MiAi
{
public enum EducationTypeEnum
{
/// <summary>
/// 高中及以下
/// </summary>
[EnumField("高中及以下")]
HighSchool = 1,
/// <summary>
/// 大专
/// </summary>
[EnumField("大专")]
JuniorCollege = 2,
/// <summary>
/// 本科
/// </summary>
[EnumField("本科")]
Undergraduate = 3,
/// <summary>
/// 高中及以下
/// </summary>
[EnumField("硕士及以上")]
Master = 4,
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Plugin;
namespace Mall.Common.Enum.MiAi
{
public enum MarriageEnum
{
/// <summary>
/// 未婚
/// </summary>
[EnumField("未婚")]
Unmarried = 1,
/// <summary>
/// 离异
/// </summary>
[EnumField("离异")]
Divorce = 2,
/// <summary>
/// 丧偶
/// </summary>
[EnumField("丧偶")]
Widowed = 3,
}
}
using Mall.Common.Enum.GuideCar;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Model.Entity.Education
{
/// <summary>
/// 我的关注实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_MiAi_FollowMember
{
public int ID { get; set; }
/// <summary>
/// 商户id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 会员id(关注)
/// </summary>
public int UserId { get; set; }
public int Status { get; set; }
public DateTime CreateDate { get; set; }
public DateTime UpdateDate { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Education;
namespace Mall.Model.Extend.Miai
{
public class RB_MiAi_FollowMember_Extend : RB_MiAi_FollowMember
{
public string Name { get; set; }
public string Photo { get; set; }
/// <summary>
/// 是否互相关注-=没有,1-互相关注
/// </summary>
public int IsMutualFollow { get; set; }
public int MutualFollowId { get; set; }
public string UserIds { get; set; }
public string CreateByIds { get; set; }
}
}
...@@ -10,6 +10,7 @@ using Newtonsoft.Json.Linq; ...@@ -10,6 +10,7 @@ using Newtonsoft.Json.Linq;
using VT.FW.DB; using VT.FW.DB;
using Mall.Repository.Miai; using Mall.Repository.Miai;
using Mall.Model.Extend.Miai; using Mall.Model.Extend.Miai;
using Mall.Model.Entity.Education;
namespace Mall.Module.Miai namespace Mall.Module.Miai
{ {
...@@ -26,6 +27,9 @@ namespace Mall.Module.Miai ...@@ -26,6 +27,9 @@ namespace Mall.Module.Miai
private readonly RB_MiAi_BaseInfoRepository miai_BaseInfoRepository = new RB_MiAi_BaseInfoRepository(); private readonly RB_MiAi_BaseInfoRepository miai_BaseInfoRepository = new RB_MiAi_BaseInfoRepository();
private readonly RB_MiAi_FollowMemberRepository miai_FollowMemberRepository = new RB_MiAi_FollowMemberRepository();
#region 活动版块 #region 活动版块
/// <summary> /// <summary>
/// 获取活动版本分页列表 /// 获取活动版本分页列表
...@@ -443,5 +447,113 @@ namespace Mall.Module.Miai ...@@ -443,5 +447,113 @@ namespace Mall.Module.Miai
} }
#endregion #endregion
#region 我的粉丝/我的关注
/// <summary>
/// 新增/修改我关注的会员配置
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool AddOrUpdateFollowMember(RB_MiAi_FollowMember model)
{
bool flag = false;
try
{
if (model.ID == 0)
{
flag = miai_FollowMemberRepository.Insert(model) > 0;
}
else
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Education_FollowTeacher.UpdateDate),System.DateTime.Now},
{ nameof(RB_Education_FollowTeacher.Status),model.Status}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_MiAi_FollowMember.ID),
FiledValue=model.ID,
OperatorEnum=OperatorEnum.Equal
}
};
flag = miai_FollowMemberRepository.Update(keyValues, wheres);
}
}
catch (Exception ex)
{
LogHelper.Write(ex, "AddOrUpdateFollowMember");
return false;
}
return flag;
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_MiAi_FollowMember_Extend> GetFollowMemberList(RB_MiAi_FollowMember_Extend where)
{
return miai_FollowMemberRepository.GetFollowMemberList(where);
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_MiAi_FollowMember_Extend> GetFollowMemberPageList(int pageIndex, int pageSize, out long rowsCount, RB_MiAi_FollowMember_Extend where)
{
var list = miai_FollowMemberRepository.GetFollowMemberPageList(pageIndex, pageSize, out rowsCount, where);
if (list != null && list.Any())
{
string createByIds = string.Join(",", list.Select(x => x.UserId));
var fansList = miai_FollowMemberRepository.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { TenantId = where.TenantId, MallBaseId = where.MallBaseId, UserId = where.CreateBy, CreateByIds = createByIds });
foreach (var item in list)
{
item.IsMutualFollow = fansList.Where(x => x.CreateBy == item.UserId).Count();
if (item.IsMutualFollow > 0)
{
item.MutualFollowId = fansList.Where(x => x.CreateBy == item.UserId).FirstOrDefault().ID;
}
}
}
return list;
}
/// <summary>
/// 我的粉丝分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_MiAi_FollowMember_Extend> GetFollowFansPageList(int pageIndex, int pageSize, out long rowsCount, RB_MiAi_FollowMember_Extend where)
{
var list = miai_FollowMemberRepository.GetFollowFansPageList(pageIndex, pageSize, out rowsCount, where);
if (list != null && list.Any())
{
string createByIds = string.Join(",", list.Select(x => x.CreateBy));
var fansList = miai_FollowMemberRepository.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { TenantId = where.TenantId, MallBaseId = where.MallBaseId, CreateBy = where.UserId, UserIds = createByIds });
foreach (var item in list)
{
item.IsMutualFollow = fansList.Where(x => x.UserId == item.CreateBy).Count();
if (item.IsMutualFollow > 0)
{
item.MutualFollowId = fansList.Where(x => x.UserId == item.CreateBy).FirstOrDefault().ID;
}
}
}
return list;
}
#endregion
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Model.Entity.Education;
using Mall.Model.Extend.Miai;
namespace Mall.Repository.Miai
{
public class RB_MiAi_FollowMemberRepository : BaseRepository<RB_MiAi_FollowMember>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_MiAi_FollowMember); } }
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_MiAi_FollowMember_Extend> GetFollowMemberList(RB_MiAi_FollowMember_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from RB_MiAi_FollowMember where 1=1");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and MallBaseId={0}", where.MallBaseId);
}
if (where.ID > 0)
{
sb.AppendFormat(" and ID={0}", where.ID);
}
if (where.CreateBy > 0)
{
sb.AppendFormat(" and CreateBy={0}", where.CreateBy);
}
if (where.UserId > 0)
{
sb.AppendFormat(" and UserId={0}", where.UserId);
}
if (!string.IsNullOrWhiteSpace(where.CreateByIds))
{
sb.AppendFormat(" and CreateBy in ({0})", where.CreateByIds);
}
if (!string.IsNullOrWhiteSpace(where.UserIds))
{
sb.AppendFormat(" and UserId in ({0})", where.UserIds);
}
if (where.Status >= 0)
{
sb.AppendFormat($" AND {nameof(RB_MiAi_FollowMember.Status)}={where.Status}");
}
}
return Get<RB_MiAi_FollowMember_Extend>(sb.ToString()).ToList();
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_MiAi_FollowMember_Extend> GetFollowMemberPageList(int pageIndex, int pageSize, out long rowsCount, RB_MiAi_FollowMember_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT a.*,b.`Name`,b.Photo from RB_MiAi_FollowMember as a LEFT JOIN rb_member_user as b on a.createby=b.Id where a.`Status`=0");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and a.TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and a.MallBaseId={0}", where.MallBaseId);
}
if (where.ID > 0)
{
sb.AppendFormat(" and a.Id={0}", where.ID);
}
if (where.CreateBy > 0)
{
sb.AppendFormat(" and a.CreateBy={0}", where.CreateBy);
}
}
return GetPage<RB_MiAi_FollowMember_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
}
/// <summary>
/// 我的粉丝分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_MiAi_FollowMember_Extend> GetFollowFansPageList(int pageIndex, int pageSize, out long rowsCount, RB_MiAi_FollowMember_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT a.*,b.`Name`,b.Photo from RB_MiAi_FollowMember as a LEFT JOIN rb_member_user as b on a.createby=b.Id where a.Status=0");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and a.TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and a.MallBaseId={0}", where.MallBaseId);
}
if (where.ID > 0)
{
sb.AppendFormat(" and a.Id={0}", where.ID);
}
if (where.UserId > 0)
{
sb.AppendFormat(" and a.UserId={0}", where.UserId);
}
}
return GetPage<RB_MiAi_FollowMember_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
}
}
}
...@@ -14,6 +14,7 @@ using Mall.Common; ...@@ -14,6 +14,7 @@ using Mall.Common;
using Mall.AOP; using Mall.AOP;
using Mall.Module.Miai; using Mall.Module.Miai;
using Mall.Model.Extend.Miai; using Mall.Model.Extend.Miai;
using Mall.Model.Entity.Education;
namespace Mall.WebApi.Controllers.MallBase namespace Mall.WebApi.Controllers.MallBase
{ {
...@@ -408,16 +409,60 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -408,16 +409,60 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.Failed("已进入黑名单,无法访问"); return ApiResult.Failed("已进入黑名单,无法访问");
} }
RB_MiAi_BaseInfo_Extend comment = JsonConvert.DeserializeObject<RB_MiAi_BaseInfo_Extend>(req.msg.ToString()); RB_MiAi_BaseInfo_Extend baseInfo = JsonConvert.DeserializeObject<RB_MiAi_BaseInfo_Extend>(req.msg.ToString());
comment.Status = 0; baseInfo.Status = 0;
comment.CreateDate = DateTime.Now; baseInfo.CreateDate = DateTime.Now;
comment.UserId = userInfo.UserId; baseInfo.UserId = userInfo.UserId;
comment.TenantId = userInfo.TenantId; baseInfo.TenantId = userInfo.TenantId;
comment.MallBaseId = userInfo.MallBaseId; baseInfo.MallBaseId = userInfo.MallBaseId;
var oldBaseInfo = miaiModule.GetBaseInfoList(new RB_MiAi_BaseInfo_Extend { UserId = comment.UserId, TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId }).FirstOrDefault(); if (baseInfo.Sex == 0)
{
return ApiResult.Failed("请选择性别");
}
if (string.IsNullOrWhiteSpace(baseInfo.Birthday))
{
return ApiResult.Failed("请选择生日");
}
if (baseInfo.Weight == 0)
{
return ApiResult.Failed("请选择体重");
}
if (baseInfo.Height == 0)
{
return ApiResult.Failed("请选择身高");
}
if (baseInfo.Height == 0)
{
return ApiResult.Failed("请选择身高");
}
if (!baseInfo.EducationType.HasValue || (int)baseInfo.EducationType == 0)
{
return ApiResult.Failed("请选择学历");
}
if (!baseInfo.Marriage.HasValue || (int)baseInfo.Marriage == 0)
{
return ApiResult.Failed("请选择婚姻状况");
}
if (string.IsNullOrWhiteSpace(baseInfo.IDCardNo))
{
return ApiResult.Failed("请填写身份证号");
}
if (string.IsNullOrWhiteSpace(baseInfo.RealName))
{
return ApiResult.Failed("请填写姓名");
}
if (string.IsNullOrWhiteSpace(baseInfo.IDCard))
{
return ApiResult.Failed("请上传身份证头像面");
}
if (string.IsNullOrWhiteSpace(baseInfo.IDCardBack))
{
return ApiResult.Failed("请上传身份证国徽面");
}
var oldBaseInfo = miaiModule.GetBaseInfoList(new RB_MiAi_BaseInfo_Extend { UserId = baseInfo.UserId, TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId }).FirstOrDefault();
if (oldBaseInfo == null && oldBaseInfo.Id == 0) if (oldBaseInfo == null && oldBaseInfo.Id == 0)
{ {
if (miaiModule.SetMiAiBaseInfo(comment)) if (miaiModule.SetMiAiBaseInfo(baseInfo))
{ {
return ApiResult.Success("基础资料填写成功"); return ApiResult.Success("基础资料填写成功");
} }
...@@ -432,6 +477,180 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -432,6 +477,180 @@ namespace Mall.WebApi.Controllers.MallBase
} }
} }
/// <summary>
/// 获取教育枚举
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetEducationTypeEnumList()
{
var list = EnumHelper.GetEnumList(typeof(Common.Enum.MiAi.EducationTypeEnum));
return ApiResult.Success("", list.OrderBy(x => Convert.ToInt32(x.Value)).Select(x => new
{
Name = x.Key,
Id = Convert.ToInt32(x.Value)
}));
}
/// <summary>
/// 获取婚姻枚举
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetMarriageEnumList()
{
var list = EnumHelper.GetEnumList(typeof(Common.Enum.MiAi.MarriageEnum));
return ApiResult.Success("", list.OrderBy(x => Convert.ToInt32(x.Value)).Select(x => new
{
Name = x.Key,
Id = Convert.ToInt32(x.Value)
}));
}
#endregion
#region 我的粉丝/我的关注
/// <summary>
/// 我的关注
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetFollowTeacherPageList()
{
var req = RequestParm;
var userInfo = AppletUserInfo;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(req.msg.ToString());
RB_MiAi_FollowMember_Extend demodel = JsonConvert.DeserializeObject<RB_MiAi_FollowMember_Extend>(req.msg.ToString());
demodel.CreateBy = userInfo.UserId;
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
var list = miaiModule.GetFollowMemberPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.ID,
x.UserId,
x.Name,
x.Photo,
x.CreateBy,
x.IsMutualFollow,
x.MutualFollowId,
CreateDate = x.CreateDate.ToString("yyyy-MM-dd HH:ss:mm"),
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 我的粉丝
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetFollowFansPageList()
{
var req = RequestParm;
var userInfo = AppletUserInfo;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(req.msg.ToString());
RB_MiAi_FollowMember_Extend demodel = JsonConvert.DeserializeObject<RB_MiAi_FollowMember_Extend>(req.msg.ToString());
demodel.UserId = userInfo.UserId;
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
var list = miaiModule.GetFollowFansPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.ID,
x.UserId,
x.Name,
x.Photo,
x.CreateBy,
x.IsMutualFollow,
x.MutualFollowId,
CreateDate = x.CreateDate.ToString("yyyy-MM-dd HH:ss:mm"),
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 关注老师
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetFollowMember()
{
var parms = RequestParm;
var userInfo = AppletUserInfo;
var query = JsonConvert.DeserializeObject<RB_MiAi_FollowMember>(RequestParm.msg.ToString());
query.TenantId = userInfo.TenantId;
query.MallBaseId = userInfo.MallBaseId;
query.CreateBy = userInfo.UserId;
bool isUpdate = true;
if (query == null)
{
return ApiResult.Failed("请传入我关注的会员信息");
}
else
{
//判断是否已经关注过
var oldList = miaiModule.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { Status = -1, UserId = query.UserId, CreateBy = query.CreateBy, MallBaseId = query.MallBaseId, TenantId = query.TenantId }); ;
if (query.ID == 0)
{
isUpdate = false;
query.CreateDate = System.DateTime.Now;
query.UpdateDate = System.DateTime.Now;
if (query.UserId <= 0)
{
return ApiResult.Failed("请传入我关注的会员信息");
}
if (oldList != null && oldList.Any(x => x.Status == 0))
{
return ApiResult.Failed("您已关注,请勿重复操作");
}
else
{
if (oldList != null && oldList.Any())
{
query.ID = oldList.OrderByDescending(x => x.CreateDate).FirstOrDefault().ID;
}
query.Status = 0;
}
}
else
{
query.Status = 1;
}
bool result = miaiModule.AddOrUpdateFollowMember(query);
if (isUpdate)
{
if (result)
{
return ApiResult.Success("取消关注成功");
}
else
{
return ApiResult.Failed("取消关注成功");
}
}
else
{
if (result)
{
return ApiResult.Success("关注成功");
}
else
{
return ApiResult.Failed("关注成功");
}
}
}
}
#endregion #endregion
} }
} }
\ No newline at end of file
...@@ -109,5 +109,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -109,5 +109,7 @@ namespace Mall.WebApi.Controllers.MallBase
#endregion #endregion
} }
} }
\ No newline at end of file
...@@ -21,6 +21,7 @@ using Mall.Common.Enum; ...@@ -21,6 +21,7 @@ using Mall.Common.Enum;
using Mall.CacheKey; using Mall.CacheKey;
using Mall.Common.Pay.WeChatPat; using Mall.Common.Pay.WeChatPat;
using Mall.Module.MarketingCenter; using Mall.Module.MarketingCenter;
using Mall.Module.Miai;
namespace Mall.WebApi.Controllers.User namespace Mall.WebApi.Controllers.User
{ {
...@@ -33,6 +34,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -33,6 +34,7 @@ namespace Mall.WebApi.Controllers.User
private readonly UserModule userModule = new UserModule(); private readonly UserModule userModule = new UserModule();
private readonly CouponModule couponModule = new CouponModule(); private readonly CouponModule couponModule = new CouponModule();
private readonly MiaiModule miaiModule = new MiaiModule();
//private readonly Module.BaseSetUp.MallBaseModule MallBaseModule = new Module.BaseSetUp.MallBaseModule(); //private readonly Module.BaseSetUp.MallBaseModule MallBaseModule = new Module.BaseSetUp.MallBaseModule();
/// <summary> /// <summary>
/// 商户小程序处理类 /// 商户小程序处理类
...@@ -228,7 +230,8 @@ namespace Mall.WebApi.Controllers.User ...@@ -228,7 +230,8 @@ namespace Mall.WebApi.Controllers.User
UserSmallShopId = demodel.SmallShopId, UserSmallShopId = demodel.SmallShopId,
IsOpenSchool = mmodel.IsOpenSchool, IsOpenSchool = mmodel.IsOpenSchool,
UserPageType = mmodel.IsOpenSchool == 1 ? demodel.UserPageType : Common.Enum.Goods.GoodsPageTypeEnum.All, UserPageType = mmodel.IsOpenSchool == 1 ? demodel.UserPageType : Common.Enum.Goods.GoodsPageTypeEnum.All,
UserTeacher = 0 UserTeacher = 0,
IsAddBaseInfo = 0,
}; };
UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + UserId, appletUserInfo, Config.JwtExpirTime); UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + UserId, appletUserInfo, Config.JwtExpirTime);
if (isGiveCoupon) if (isGiveCoupon)
...@@ -312,14 +315,18 @@ namespace Mall.WebApi.Controllers.User ...@@ -312,14 +315,18 @@ namespace Mall.WebApi.Controllers.User
UserSmallShopId = umodel.SmallShopId, UserSmallShopId = umodel.SmallShopId,
IsOpenSchool = mmodel.IsOpenSchool, IsOpenSchool = mmodel.IsOpenSchool,
UserPageType = mmodel.IsOpenSchool == 1 ? umodel.UserPageType : Common.Enum.Goods.GoodsPageTypeEnum.All, UserPageType = mmodel.IsOpenSchool == 1 ? umodel.UserPageType : Common.Enum.Goods.GoodsPageTypeEnum.All,
UserTeacher = (teacher != null && teacher.ID > 0) ? teacher.ID : 0 UserTeacher = (teacher != null && teacher.ID > 0) ? teacher.ID : 0,
IsAddBaseInfo = 0,
}; };
var oldBaseInfo = miaiModule.GetBaseInfoList(new Model.Extend.Miai.RB_MiAi_BaseInfo_Extend { UserId = umodel.Id, TenantId = mmodel.TenantId, MallBaseId = mmodel.MallBaseId }).FirstOrDefault();
if (oldBaseInfo != null && oldBaseInfo.Id > 0)
{
appletUserInfo.IsAddBaseInfo = 1;
}
UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + umodel.Id, appletUserInfo, Config.JwtExpirTime); UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + umodel.Id, appletUserInfo, Config.JwtExpirTime);
if (isGiveCoupon) if (isGiveCoupon)
{ {
return ApiResult.CouponSuccess(ResultCode.Success, 1, "", couponName, appletUserInfo); return ApiResult.CouponSuccess(ResultCode.Success, 1, "", couponName, appletUserInfo);
} }
else else
{ {
......
...@@ -204,13 +204,17 @@ namespace Mall.WindowsService.Module ...@@ -204,13 +204,17 @@ namespace Mall.WindowsService.Module
addFinance = true; addFinance = true;
} }
} }
// Helper.LogHelper.Write("addFinance:" + addFinance.ToString());
DateTime endDate = startDate.AddDays(item.IntervalDay ?? 0);//结束时间 DateTime endDate = startDate.AddDays(item.IntervalDay ?? 0);//结束时间
if (addFinance)//满足今天执行的条件查询间隔周期的订单 if (addFinance)//满足今天执行的条件查询间隔周期的订单
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
// builder.AppendFormat($@" SELECT a.*,b.OrderNo,b.OrderClassify from rb_goods_orderdetail as a LEFT JOIN rb_goods_order as b on a.OrderId=b.OrderId
//where b.TenantId={item.TenantId} and b.MallBaseId={item.MallBaseId} and b.OrderSource!=6 and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')>= DATE_FORMAT('{startDate}','%y-%m-%d')
//and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND b.OrderStatus IN (2, 3, 4, 5, 6) ");
builder.AppendFormat($@" SELECT a.*,b.OrderNo,b.OrderClassify from rb_goods_orderdetail as a LEFT JOIN rb_goods_order as b on a.OrderId=b.OrderId builder.AppendFormat($@" SELECT a.*,b.OrderNo,b.OrderClassify from rb_goods_orderdetail as a LEFT JOIN rb_goods_order as b on a.OrderId=b.OrderId
where b.TenantId={item.TenantId} and b.MallBaseId={item.MallBaseId} and b.OrderSource!=6 and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')>= DATE_FORMAT('{startDate}','%y-%m-%d') where b.TenantId={item.TenantId} and b.MallBaseId={item.MallBaseId} and b.OrderSource!=6 and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')>= DATE_FORMAT('{startDate}','%y-%m-%d')
and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND b.OrderStatus IN (2, 3, 4, 5, 6) "); and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND (b.OrderStatus IN (2, 3, 4, 5, 6) or (b.OrderStatus=7 and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')< DATE_FORMAT(b.CancelTime,'%y-%m-%d')))");
// builder.AppendFormat($@" SELECT a.*,b.OrderNo from rb_goods_orderdetail as a LEFT JOIN rb_goods_order as b on a.OrderId=b.OrderId // builder.AppendFormat($@" SELECT a.*,b.OrderNo from rb_goods_orderdetail as a LEFT JOIN rb_goods_order as b on a.OrderId=b.OrderId
//where b.TenantId={item.TenantId} and b.MallBaseId={item.MallBaseId} and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')>= DATE_FORMAT('{startDate}','%y-%m-%d') //where b.TenantId={item.TenantId} and b.MallBaseId={item.MallBaseId} and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')>= DATE_FORMAT('{startDate}','%y-%m-%d')
//and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND ( //and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND (
...@@ -238,6 +242,9 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A ...@@ -238,6 +242,9 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
} }
else else
{ {
record.FinanceId = 0;
record.IsFinanceAll = 0;
financeRecordRepository.Insert(record);
Helper.LogHelper.Write("暂无数据"); Helper.LogHelper.Write("暂无数据");
return false; return false;
} }
...@@ -372,7 +379,7 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A ...@@ -372,7 +379,7 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
} }
var detailList = result.Select(x => new var detailList = result.Select(x => new
{ {
CostTypeId = x.FinanceType == 1 ? item.IncomeCostTypeId : (x.FinanceType==2? item.FreightCostTypeId: item.InsuranceTypeId), CostTypeId = x.FinanceType == 1 ? item.IncomeCostTypeId : (x.FinanceType == 2 ? item.FreightCostTypeId : item.InsuranceTypeId),
Number = x.FinanceType == 1 ? x.Number : 1, Number = x.FinanceType == 1 ? x.Number : 1,
OriginalMoney = x.FinanceType == 1 ? (x.Final_Price ?? 0) : (x.FinanceType == 2 ? (x.FreightMoney ?? 0) : (x.InsuranceMoney ?? 0)), OriginalMoney = x.FinanceType == 1 ? (x.Final_Price ?? 0) : (x.FinanceType == 2 ? (x.FreightMoney ?? 0) : (x.InsuranceMoney ?? 0)),
UnitPrice = x.FinanceType == 1 ? ((x.Final_Price ?? 0) / (x.Number ?? 0)) : (x.FinanceType == 2 ? (x.FreightMoney ?? 0) : (x.InsuranceMoney ?? 0)), UnitPrice = x.FinanceType == 1 ? ((x.Final_Price ?? 0) / (x.Number ?? 0)) : (x.FinanceType == 2 ? (x.FreightMoney ?? 0) : (x.InsuranceMoney ?? 0)),
...@@ -2222,7 +2229,8 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A ...@@ -2222,7 +2229,8 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
try try
{ {
var alist = goods_ActivityRepository.GetCanReceiveList(new RB_Goods_Activity_Extend() { TenantId = item.TenantId, MallBaseId = item.MallBaseId }); var alist = goods_ActivityRepository.GetCanReceiveList(new RB_Goods_Activity_Extend() { TenantId = item.TenantId, MallBaseId = item.MallBaseId });
foreach (var qitem in alist) { foreach (var qitem in alist)
{
//查询活动下所有满足的订单 //查询活动下所有满足的订单
var orderList = goods_OrderRepository.GetGoodsNumForCategoryOrGoods(qitem, 0, item.AfterTime); var orderList = goods_OrderRepository.GetGoodsNumForCategoryOrGoods(qitem, 0, item.AfterTime);
if (orderList.Any()) if (orderList.Any())
......
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