Commit 609f67f5 authored by 吴春's avatar 吴春

提交新人购买并付款发放优惠券 评价返积分

parent dbce75a9
......@@ -27,6 +27,13 @@ namespace Mall.Common.API
/// </summary>
public string couponMessage { get; set; }
/// <summary>
/// 0-一般,1-优惠券,2-积分
/// </summary>
public int msgType { get; set; }
/// <summary>
/// 返回数据
/// </summary>
......@@ -56,27 +63,54 @@ namespace Mall.Common.API
}
/// <summary>
/// 优惠券领取请求成功
/// 优惠券领取/积分获取请求成功
/// </summary>
/// <param name="message">提示信息</param>
/// <param name="data">返回数据</param>
/// <param name="couponResultCode"></param>
/// <param name="msgType">0-其他,1-优惠券,2-积分</param>
/// <param name="message"></param>
/// <param name="couponMessage"></param>
/// <param name="data"></param>
/// <returns></returns>
public static ApiResult CouponSuccess(ResultCode couponResultCode = ResultCode.Success, string message = null, string couponMessage = null, object data = null)
public static ApiResult CouponSuccess(ResultCode couponResultCode = ResultCode.Success, int msgType = 0, string message = null, string couponMessage = null, object data = null)
{
return new ApiResult() { resultCode = (int)ResultCode.Success, message = message ?? "操作成功!", couponResultCode = (int)couponResultCode, couponMessage = couponMessage ?? "优惠券领取成功!", data = data };
return new ApiResult() { resultCode = (int)ResultCode.Success, message = message ?? "操作成功!", msgType = msgType, couponResultCode = (int)couponResultCode, couponMessage = couponMessage ?? "优惠券领取成功!", data = data };
}
/// <summary>
/// 优惠券领取请求失败
/// </summary>
/// <param name="message">提示信息</param>
/// <param name="data">返回数据</param>
/// <param name="couponResultCode"></param>
/// <param name="msgType">0-其他,1-优惠券,2-积分</param>
/// <param name="message"></param>
/// <param name="couponMessage"></param>
/// <param name="data"></param>
/// <returns></returns>
public static ApiResult CouponFailed(ResultCode couponResultCode = ResultCode.Success, string message = null, string couponMessage = null, object data = null)
public static ApiResult CouponFailed(ResultCode couponResultCode = ResultCode.Success, int msgType = 0, string message = null, string couponMessage = null, object data = null)
{
return new ApiResult { resultCode = (int)ResultCode.Fail, message = message ?? "操作失败!", couponResultCode = (int)couponResultCode, couponMessage = couponMessage ?? "优惠券领取成功!", data = data };
return new ApiResult { resultCode = (int)ResultCode.Fail, message = message ?? "操作失败!", msgType = msgType, couponResultCode = (int)couponResultCode, couponMessage = couponMessage ?? "优惠券领取成功!", data = data };
}
///// <summary>
///// 优惠券领取请求成功
///// </summary>
///// <param name="message">提示信息</param>
///// <param name="data">返回数据</param>
///// <returns></returns>
//public static ApiResult IntegralSuccess(ResultCode integralResultCode = ResultCode.Success, string message = null, string integralMessage = null, string couponMessage = null, object data = null)
//{
// return new ApiResult() { resultCode = (int)ResultCode.Success, message = message ?? "操作成功!", integralResultCode = (int)integralResultCode, integralMessage = integralMessage ?? "积分获取成功!", couponResultCode = (int)ResultCode.Success, couponMessage = couponMessage ?? "操作成功!", data = data };
//}
///// <summary>
///// 优惠券领取请求失败
///// </summary>
///// <param name="message">提示信息</param>
///// <param name="data">返回数据</param>
///// <returns></returns>
//public static ApiResult IntegralFailed(ResultCode integralResultCode = ResultCode.Success, string message = null, string integralMessage = null, string couponMessage = null, object data = null)
//{
// return new ApiResult { resultCode = (int)ResultCode.Fail, message = message ?? "操作失败!", integralResultCode = (int)integralResultCode, integralMessage = integralMessage ?? "积分获取失败!", couponResultCode = (int)integralResultCode, couponMessage = couponMessage ?? "操作失败!", data = data };
//}
/// <summary>
......
......@@ -519,5 +519,15 @@ namespace Mall.Model.Entity.Product
/// 视频填充方式(0默认,1-填充)
/// </summary>
public int VideoType { get; set; }
/// <summary>
/// 评论积分赠送
/// </summary>
public int? IntegralComment { get; set; }
/// <summary>
/// 评论赠送类型 1固定值 2百分比
/// </summary>
public int? IntegralCommentType { get; set; }
}
}
......@@ -339,5 +339,11 @@ namespace Mall.Model.Entity.Product
/// 保险成本价格
/// </summary>
public decimal? InsuranceCostMoney { get; set; }
/// <summary>
/// 评论返积分
/// </summary>
public int CommentGiveIntegral { get; set; }
}
}
......@@ -203,7 +203,10 @@ namespace Mall.Module.Product
/// </summary>
private RB_GuideCar_CarBrandRepository carBrandRepository = new RB_GuideCar_CarBrandRepository();
/// <summary>
/// 用户积分
/// </summary>
private readonly RB_Member_IntegralRepository member_IntegralRepository = new RB_Member_IntegralRepository();
#region 基础配置
......@@ -1654,6 +1657,16 @@ namespace Mall.Module.Product
Integral = Convert.ToInt32(Math.Floor((model.SellingPrice ?? 0) * (model.IntegralPresent ?? 0) / 100));
}
}
int CommentIntegral = 0;
if (model.IntegralComment > 0)
{
CommentIntegral = model.IntegralComment ?? 0;
if (model.IntegralCommentType == 2)
{
CommentIntegral = Convert.ToInt32(Math.Floor((model.SellingPrice ?? 0) * (model.IntegralComment ?? 0) / 100));
}
}
#endregion
#region 会员价格
......@@ -1829,7 +1842,11 @@ namespace Mall.Module.Product
integral = new
{
title = Integral > 0 ? "购买可得" + Integral + "积分" : ""
}
},
commentIntegral = new
{
title = CommentIntegral > 0 ? "购买并评论可得" + Integral + "积分" : ""
}
},
extra_quick_share = new
{
......@@ -3974,5 +3991,33 @@ namespace Mall.Module.Product
#endregion
#region
/// <summary>
/// 获取订单明细实体
/// </summary>
/// <param name="OrderId"></param>
/// <returns></returns>
public RB_Goods_OrderDetail_Extend GetOrderDetailInfo(int OrderId)
{
return goods_OrderDetailRepository.GetEntity(OrderId).RefMapperTo<RB_Goods_OrderDetail_Extend>();
}
/// <summary>
/// 订单评论返积分
/// </summary>
/// <param name="memberIntegralModel"></param>
/// <returns></returns>
public bool AddMemberIntegral(Model.Entity.User.RB_Member_Integral memberIntegralModel)
{
if (memberIntegralModel.Id == 0)
{
return member_IntegralRepository.Insert(memberIntegralModel) > 0;
}
return false;
}
#endregion
}
}
......@@ -2882,10 +2882,12 @@ namespace Mall.Module.Product
return ApiResult.Failed("VIP商品不能与其他商品同时下单,请先购买VIP商品");
}
var disModel = distributor_InfoRepository.GetListForSingle(new RB_Distributor_Info_Extend() { UserId = umodel.Id }).FirstOrDefault();
if (disModel != null) {
if (disModel != null)
{
var fxgradeList = distributor_FXGradeRepository.GetList(new RB_Distributor_FXGrade_Extend() { TenantId = umodel.TenantId, MallBaseId = umodel.MallBaseId });
fxgradeList = fxgradeList.Where(x => x.IsGuest == 1 || x.IsGuest == 3).ToList();
if (!fxgradeList.Select(x => x.Id).Contains(disModel.FXGradeId ?? 0)) {
if (!fxgradeList.Select(x => x.Id).Contains(disModel.FXGradeId ?? 0))
{
return ApiResult.Failed("您当前等级无法购买VIP商品");
}
}
......@@ -3610,7 +3612,7 @@ namespace Mall.Module.Product
if (pUserId > 0)
{
var pumodel = member_UserRepository.GetEntity(pUserId);
demodel.CompanyProfitRate = (pumodel?.CompanyProfitRate??0);
demodel.CompanyProfitRate = (pumodel?.CompanyProfitRate ?? 0);
demodel.CompanyId = pUserId;
}
#endregion
......@@ -3876,11 +3878,11 @@ namespace Mall.Module.Product
foreach (var item in demodel.DetailList)
{
var gmodel = gList.Where(x => x.Id == item.GoodsId).FirstOrDefault();
if (gmodel == null || gmodel.GoodsStatus != 1 || gmodel.GoodsClassify !=1)
if (gmodel == null || gmodel.GoodsStatus != 1 || gmodel.GoodsClassify != 1)
{
return ApiResult.Failed("有商品不存在或者商品已失效");
}
if (gmodel.CarType != demodel.CarType)
if (gmodel.CarType != demodel.CarType)
{
return ApiResult.Failed("商品服务类型不一致");
}
......@@ -3912,7 +3914,8 @@ namespace Mall.Module.Product
DateTime Mindate = Convert.ToDateTime(DateTime.Now.AddDays(gmodel.AdvanceDay ?? 0).ToString("yyyy-MM-dd"));
targetList = targetList.Where(x => x.Date >= Mindate).ToList();
}
if (!targetList.Any()) {
if (!targetList.Any())
{
return ApiResult.Failed("不在预定时间范围,无法下单");
}
if (gmodel.CarType == GuideCarGoodsTypeEnum.Line && gmodel.IsSpell == 1)
......@@ -3945,7 +3948,7 @@ namespace Mall.Module.Product
item.CostMoney = gmodel.CostPrice ?? 0;
item.ProductCode = gmodel.GoodsNumbers;
item.CategoryIdList = categoryList.Select(x => x.CategoryId ?? 0).ToList();
item.CategoryIdList = categoryList.Select(x => x.CategoryId ?? 0).ToList();
#region 微店价格
item.SmallShopsCostPrice = gmodel.SellingPrice ?? 0;
......@@ -4276,7 +4279,7 @@ namespace Mall.Module.Product
}
}
}
foreach (var item in demodel.DetailList)
{
var gmodel = gList.Where(x => x.Id == item.GoodsId).FirstOrDefault();
......@@ -5819,7 +5822,7 @@ namespace Mall.Module.Product
/// <param name="demodel"></param>
/// <param name="trans"></param>
/// <param name="OrderId"></param>
private void InsertOrderDetail(RB_Goods_Order_Extend demodel, System.Data.IDbTransaction trans, int OrderId, List<FreeShippingGoodsDetail> SatisfiedGoodsList,bool IsSDGoods= false)
private void InsertOrderDetail(RB_Goods_Order_Extend demodel, System.Data.IDbTransaction trans, int OrderId, List<FreeShippingGoodsDetail> SatisfiedGoodsList, bool IsSDGoods = false)
{
Model.Extend.GuideCar.RB_GuideCar_Base_Extend guidebaseModel = new Model.Extend.GuideCar.RB_GuideCar_Base_Extend();
if (IsSDGoods)
......@@ -5994,7 +5997,8 @@ namespace Mall.Module.Product
}
#region 更新司导商品预约时间
if (IsSDGoods) {
if (IsSDGoods)
{
//通过下单时间范围 查询出所有的日期 线路的看是否可以拼车 增加人数 更新日期预定状态
var tdlist = goods_TargetDateRepository.GetList(new RB_Goods_TargetDate_Extend() { GoodsId = item.GoodsId ?? 0, StartTime = item.TripSTime.Value.ToString("yyyy-MM-dd"), EndTime = item.TripETime.Value.ToString("yyyy-MM-dd") });
if (tdlist.Any())
......@@ -6004,14 +6008,16 @@ namespace Mall.Module.Product
//只调整第一天的 其他天 直接表示已预订了
var fristModel = tdlist.Where(x => x.Date == Convert.ToDateTime(item.TripSTime.Value.ToString("yyyy-MM-dd"))).FirstOrDefault();
//第一条更新数量 如果OK咯 更新已预定
if (fristModel != null) {
if (fristModel != null)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>();
if ((item.GoodsRideNum ?? 0) - (fristModel.ReserveNum) <= (item.Number ?? 0))
{
keyValues1.Add(nameof(RB_Goods_TargetDate.IsReserve), 2);
keyValues1.Add(nameof(RB_Goods_TargetDate.ReserveNum), (fristModel.ReserveNum) + (item.Number ?? 0));
}
else {
else
{
keyValues1.Add(nameof(RB_Goods_TargetDate.IsReserve), 1);
keyValues1.Add(nameof(RB_Goods_TargetDate.ReserveNum), (fristModel.ReserveNum) + (item.Number ?? 0));
}
......@@ -6940,7 +6946,7 @@ namespace Mall.Module.Product
item.MemberDiscountCouponList = new List<RB_Member_DiscountCoupon_Extend>();
if (!string.IsNullOrWhiteSpace(item.CouponsIds))
{
foreach (var itemCoupons in item.CouponsIds.Split(','))
{
item.MemberDiscountCouponList.AddRange(memberCouponList.Where(x => itemCoupons == x.Id.ToString()));
......@@ -7899,14 +7905,14 @@ namespace Mall.Module.Product
if (model.Type == 2)
{
var oeModel = goods_OrderExpressRepository.GetList(new RB_Goods_OrderExpress_Extend() { AfterSaleOrderId = model.ReOrderId, TenantId = tenantId, MallBaseId = mallBaseId }).FirstOrDefault();
if (oeModel!=null&&oeModel.Type == 1)
if (oeModel != null && oeModel.Type == 1)
{
var leModel = logistics_ExpressRepository.GetEntity(oeModel.ExpressId);
ExpressList.Add(new
{
Name = uModel.Name ?? "",
ExpressName = leModel.Name ?? "",
ExpressNumber=oeModel?.ExpressNumber??"",
ExpressNumber = oeModel?.ExpressNumber ?? "",
Type = 1
});
}
......@@ -7916,7 +7922,7 @@ namespace Mall.Module.Product
{
Name = uModel.Name ?? "",
ExpressName = "",
ExpressNumber = oeModel?.Remark??"",
ExpressNumber = oeModel?.Remark ?? "",
Type = 2
});
}
......@@ -8624,7 +8630,7 @@ namespace Mall.Module.Product
/// <param name="transactionId">微信订单号</param>
/// <param name="refundid">微信退款单号</param>
/// <returns></returns>
public bool SetOrderApplyForCancelAudit(RB_Goods_Order_Extend omodel, int type, string remark, string RefundOrderNo, int tenantId, int mallBaseId, Common.Enum.Goods.OrderPayTypeEnum payType, string dPrice, string outTradeNo, string transactionId, string refundid,int empId)
public bool SetOrderApplyForCancelAudit(RB_Goods_Order_Extend omodel, int type, string remark, string RefundOrderNo, int tenantId, int mallBaseId, Common.Enum.Goods.OrderPayTypeEnum payType, string dPrice, string outTradeNo, string transactionId, string refundid, int empId)
{
var trans = goods_OrderRepository.DbTransaction;
try
......@@ -10823,7 +10829,7 @@ namespace Mall.Module.Product
/// <param name="orderId"></param>
/// <param name="empId"></param>
/// <returns></returns>
public bool SetSDOrderConfirm(int orderId,int Type, int empId, Microsoft.AspNetCore.Http.IHttpContextAccessor _accessor)
public bool SetSDOrderConfirm(int orderId, int Type, int empId, Microsoft.AspNetCore.Http.IHttpContextAccessor _accessor)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() { };
if (Type == 1)
......@@ -10836,7 +10842,8 @@ namespace Mall.Module.Product
keyValues.Add(nameof(RB_Goods_Order.OrderStatus), OrderStatusEnum.Received);
keyValues.Add(nameof(RB_Goods_Order.ReceivingTime), DateTime.Now);
}
else if (Type == 3) {
else if (Type == 3)
{
keyValues.Add(nameof(RB_Goods_Order.OrderStatus), OrderStatusEnum.Completed);
keyValues.Add(nameof(RB_Goods_Order.FinishTime), DateTime.Now);
}
......@@ -10885,7 +10892,8 @@ namespace Mall.Module.Product
}
}
}
else if (flag && Type == 3) {
else if (flag && Type == 3)
{
//返佣
bool IsUpdateCommission = true;
int mallBaseId = orderModel.MallBaseId;
......@@ -11254,7 +11262,8 @@ namespace Mall.Module.Product
}
}
}
if (flag) {
if (flag)
{
string content = "";
if (Type == 1)
{
......@@ -11264,7 +11273,8 @@ namespace Mall.Module.Product
{
content = "empId:" + empId + "司导设置订单出行";
}
else if (Type == 3) {
else if (Type == 3)
{
content = "empId:" + empId + "司导设置订单完成";
}
goods_LogRepository.Insert(new RB_Goods_Log()
......@@ -11429,7 +11439,8 @@ namespace Mall.Module.Product
public List<RB_Goods_OrderDetail_Extend> GetAppletGoodsWaitCommentPageList(int pageIndex, int pageSize, out long count, RB_Goods_OrderDetail_Extend demodel)
{
var list = goods_OrderDetailRepository.GetAppletGoodsWaitCommentPageList(pageIndex, pageSize, out count, demodel);
foreach (var item in list) {
foreach (var item in list)
{
item.SpecificationList = new List<string>();
if (!string.IsNullOrEmpty(item.Specification) && item.Specification != "[]")
{
......@@ -11488,9 +11499,10 @@ namespace Mall.Module.Product
{
var omodel = new RB_Goods_Order();
int OrderId = 0;
var dmodel = new RB_Goods_OrderDetail();
if (demodel.OrderDetailId > 0)
{
var dmodel = goods_OrderDetailRepository.GetEntity(demodel.OrderDetailId);
dmodel = goods_OrderDetailRepository.GetEntity(demodel.OrderDetailId);
if (dmodel == null) { return false; }
OrderId = dmodel.OrderId ?? 0;
if (dmodel.IsComment == 1) { return false; }
......@@ -11503,6 +11515,26 @@ namespace Mall.Module.Product
{
if (demodel.OrderDetailId > 0)
{
//if (dmodel.CommentGiveIntegral > 0 && demodel.UserId > 0)//评论返积分大于0,赠送积分
//{
// Model.Entity.User.RB_Member_Integral memberIntegralModel = new Model.Entity.User.RB_Member_Integral
// {
// UserId = demodel.UserId,
// Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income,
// PlatformType = demodel.PlatformSource,
// Integral = dmodel.CommentGiveIntegral,
// Description = "评论赠送" + dmodel.CommentGiveIntegral + "积分",
// TenantId = demodel.TenantId,
// MallBaseId = demodel.MallBaseId,
// Remarks = "评论商品" + dmodel.GoodsName + "赠送" + dmodel.CommentGiveIntegral + "积分",
// CreateDate = demodel.CreateDate,
// OrderId = dmodel.OrderId
// };
// member_IntegralRepository.Insert(memberIntegralModel);
//}
//更新订单商品为已评价
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderDetail.IsComment),1}
......@@ -12673,5 +12705,23 @@ namespace Mall.Module.Product
return list;
}
#endregion
#region 订单评论返积分
/// <summary>
/// 订单评论返积分
/// </summary>
/// <param name="memberIntegralModel"></param>
/// <returns></returns>
public bool AddMemberIntegral(Model.Entity.User.RB_Member_Integral memberIntegralModel)
{
if (memberIntegralModel.Id == 0)
{
return member_IntegralRepository.Insert(memberIntegralModel) > 0;
}
return false;
}
#endregion
}
}
......@@ -234,7 +234,7 @@ namespace Mall.Module.Product
/// <param name="demodel"></param>
/// <param name="IsGetShare">1-获取分销佣金</param>
/// <returns></returns>
public List<RB_Goods_Extend> GetAppletGoodsPageListForZY(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel,int IsGetShare=0)
public List<RB_Goods_Extend> GetAppletGoodsPageListForZY(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel, int IsGetShare = 0)
{
var list = goodsRepository.GetAppletGoodsPageList(pageIndex, pageSize, out count, demodel);
if (list.Any())
......@@ -2174,6 +2174,15 @@ namespace Mall.Module.Product
Integral = Convert.ToInt32(Math.Floor((model.SellingPrice ?? 0) * (model.IntegralPresent ?? 0) / 100));
}
}
int CommentIntegral = 0;
if (model.IntegralComment > 0)
{
CommentIntegral = model.IntegralComment ?? 0;
if (model.IntegralCommentType == 2)
{
CommentIntegral = Convert.ToInt32(Math.Floor((model.SellingPrice ?? 0) * (model.IntegralComment ?? 0) / 100));
}
}
#endregion
#region 赠送vip会员
......@@ -2406,6 +2415,10 @@ namespace Mall.Module.Product
{
title = Integral > 0 ? "购买可得" + Integral + "积分" : ""
},
commentIntegral = new
{
title = CommentIntegral > 0 ? "购买并评论可得" + Integral + "积分" : ""
},
PresentFXGradeMsg
},
//plugin_extra = new List<object>(),
......@@ -2437,7 +2450,7 @@ namespace Mall.Module.Product
x.CategoryId,
x.CategoryName
}),
video_type=model.VideoType,
video_type = model.VideoType,
},
delivery = ""
};
......@@ -6948,6 +6961,6 @@ namespace Mall.Module.Product
{
return goods_OrderRepository.GetOrderListByOrderStatus(dmodel);
}
#endregion
}
#endregion
}
}
......@@ -161,7 +161,42 @@ namespace Mall.WebApi.Controllers.Product
}
bool flag = guideCarModule.SetGoodsCommentInfo(list);
if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); }
if (flag)
{
var demodel = list.FirstOrDefault();
var dmodel = guideCarModule.GetOrderDetailInfo(demodel.OrderDetailId ?? 0);
if (dmodel != null && dmodel.CommentGiveIntegral > 0 && demodel.UserId > 0)
{
Model.Entity.User.RB_Member_Integral memberIntegralModel = new Model.Entity.User.RB_Member_Integral
{
UserId = demodel.UserId,
Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income,
PlatformType = demodel.PlatformSource,
Integral = dmodel.CommentGiveIntegral,
Description = "评论赠送" + dmodel.CommentGiveIntegral + "积分",
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
Remarks = "评论商品" + dmodel.GoodsName + "赠送" + dmodel.CommentGiveIntegral + "积分",
CreateDate = demodel.CreateDate,
OrderId = dmodel.OrderId
};
bool integralResult = guideCarModule.AddMemberIntegral(memberIntegralModel);
if (integralResult)
{
return ApiResult.CouponSuccess(ResultCode.Success, 2, "", dmodel.CommentGiveIntegral.ToString());
}
else
{
return ApiResult.CouponSuccess(ResultCode.Fail, 2, "", "");
}
}
return ApiResult.CouponSuccess(ResultCode.Fail, 2, "", "");
}
else { return ApiResult.CouponFailed(ResultCode.Fail, 2, "", ""); }
// if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); }
}
......
......@@ -539,7 +539,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.ParamIsNull("接送地址不能为空");
}
if (!demodel.TripSTime.HasValue)
if (!demodel.TripSTime.HasValue)
{
return ApiResult.ParamIsNull("请传递出发时间");
}
......@@ -697,10 +697,10 @@ namespace Mall.WebApi.Controllers.MallBase
JObject parms = JObject.Parse(req.msg.ToString());
RB_Goods_Order_Extend extModel = new RB_Goods_Order_Extend()
{
OrderId=parms.GetInt("OrderId"),
MerchantsNo=parms.GetStringValue("MerchantsNo"),
OrderStatus= OrderStatusEnum.WaitSendGoods,
PaymentTime=DateTime.Now,
OrderId = parms.GetInt("OrderId"),
MerchantsNo = parms.GetStringValue("MerchantsNo"),
OrderStatus = OrderStatusEnum.WaitSendGoods,
PaymentTime = DateTime.Now,
};
RB_Goods_Online_Trade_Extend tradeModel = new RB_Goods_Online_Trade_Extend()
......@@ -796,10 +796,12 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.ParamIsNull();
}
var omodel = orderModule.GetOrderInfo(OrderId);
if (omodel == null) {
if (omodel == null)
{
return ApiResult.Failed("订单不存在");
}
if (omodel.OrderClassify == 1) {
if (omodel.OrderClassify == 1)
{
//验证可提前取消时间
string msg = orderModule.ValidateSDOrderCanCancel(omodel);
if (msg != "")
......@@ -1083,7 +1085,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppletGoodsWaitCommentPageList() {
public ApiResult GetAppletGoodsWaitCommentPageList()
{
var parms = RequestParm;
var userInfo = AppletUserInfo;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
......@@ -1191,7 +1194,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
demodel.CommentGrade = Common.Enum.Goods.GoodsCommentTypeEnum.Medium;
}
else if (demodel.CommentScore == 1) {
else if (demodel.CommentScore == 1)
{
demodel.CommentGrade = Common.Enum.Goods.GoodsCommentTypeEnum.Negative;
}
......@@ -1212,7 +1216,41 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.UpdateDate = DateTime.Now;
bool flag = orderModule.SetGoodsCommentInfo(demodel);
if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); }
if (flag)
{
var dmodel = orderModule.GetOrderDetailInfo(demodel.OrderDetailId ?? 0);
if (dmodel != null && dmodel.CommentGiveIntegral > 0 && demodel.UserId > 0)
{
Model.Entity.User.RB_Member_Integral memberIntegralModel = new Model.Entity.User.RB_Member_Integral
{
UserId = demodel.UserId,
Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income,
PlatformType = demodel.PlatformSource,
Integral = dmodel.CommentGiveIntegral,
Description = "评论赠送" + dmodel.CommentGiveIntegral + "积分",
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
Remarks = "评论商品" + dmodel.GoodsName + "赠送" + dmodel.CommentGiveIntegral + "积分",
CreateDate = demodel.CreateDate,
OrderId = dmodel.OrderId
};
bool integralResult = orderModule.AddMemberIntegral(memberIntegralModel);
if (integralResult)
{
return ApiResult.CouponSuccess(ResultCode.Success,2, "", dmodel.CommentGiveIntegral.ToString());
}
else
{
return ApiResult.CouponSuccess(ResultCode.Fail, 2, "", "");
}
}
return ApiResult.CouponSuccess(ResultCode.Fail,2, "", "");
}
else { return ApiResult.CouponFailed(ResultCode.Fail, 2, "", ""); }
}
#endregion
......@@ -1232,7 +1270,7 @@ namespace Mall.WebApi.Controllers.MallBase
RB_Goods_OrderCommission_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_OrderCommission_Extend>(req.msg.ToString());
//HK 2020-08-27新增
JObject parms = JObject.Parse(req.msg.ToString());
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.UserId = userInfo.UserId;
......@@ -1241,13 +1279,13 @@ namespace Mall.WebApi.Controllers.MallBase
if (parms.GetInt("NewUserId") > 0)
{
demodel.UserId = parms.GetInt("NewUserId");
list = orderModule.GetDistributionOrdersPageListModule(pagelist.pageIndex, pagelist.pageSize, out count, demodel);
list = orderModule.GetDistributionOrdersPageListModule(pagelist.pageIndex, pagelist.pageSize, out count, demodel);
}
else
{
list = orderModule.GetDistributionOrdersPageList_V2(pagelist.pageIndex, pagelist.pageSize, out count, demodel);
list = orderModule.GetDistributionOrdersPageList_V2(pagelist.pageIndex, pagelist.pageSize, out count, demodel);
}
List<RB_Member_User_Extend> memberList = new List<RB_Member_User_Extend>();
if (list != null && list.Count > 0)
{
......
......@@ -192,17 +192,17 @@ namespace Mall.WebApi.Controllers.User
UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + UserId, appletUserInfo, Config.JwtExpirTime);
if (couponResult != null && couponResult.ID > 0)
{
return ApiResult.CouponSuccess(ResultCode.Success, "", couponResult.Name, appletUserInfo);
return ApiResult.CouponSuccess(ResultCode.Success,1, "", couponResult.Name, appletUserInfo);
}
else
{
return ApiResult.CouponSuccess(ResultCode.Fail, "", "", appletUserInfo);
return ApiResult.CouponSuccess(ResultCode.Fail, 1, "","", appletUserInfo);
}
}
return ApiResult.CouponFailed(ResultCode.Fail, "", "");
return ApiResult.CouponFailed(ResultCode.Fail,1, "");
// return ApiResult.Failed("注册失败,请联系管理员");
}
else
......@@ -211,7 +211,7 @@ namespace Mall.WebApi.Controllers.User
var umodel = userModule.GetMemberUserEntityModule(new RB_Member_User_Extend() { TenantId = requestParm.TenantId, MallBaseId = requestParm.MallBaseId, Source = demodel.Source, OpenId = demodel.OpenId });
if (umodel == null)
{
return ApiResult.CouponFailed(ResultCode.Fail, "", "");
return ApiResult.CouponFailed(ResultCode.Fail, 1, "");
// return ApiResult.Failed("未能查询到用户信息");
}
if (umodel.Blacklist == 1) {
......@@ -258,7 +258,7 @@ namespace Mall.WebApi.Controllers.User
UserSmallShopId = umodel.SmallShopId
};
UserReidsCache.AppletUserInfoSet(UserModuleCacheKeyConfig.Applet_Login_Info + umodel.Id, appletUserInfo, Config.JwtExpirTime);
return ApiResult.CouponSuccess(ResultCode.Fail, "", "", appletUserInfo);
return ApiResult.CouponSuccess(ResultCode.Fail, 1,"", "", appletUserInfo);
//return ApiResult.Success("", appletUserInfo);
}
}
......
......@@ -1268,11 +1268,11 @@ namespace Mall.WebApi.Controllers.User
}
if (resultModel != null && resultModel.ID > 0)
{
return ApiResult.CouponSuccess(ResultCode.Success, "", resultModel.Name);
return ApiResult.CouponSuccess(ResultCode.Success, 1, resultModel.Name);
}
else
{
return ApiResult.CouponFailed(ResultCode.Fail, "", "");
return ApiResult.CouponFailed(ResultCode.Fail, 1, "");
}
}
......
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