Commit d639455e authored by 吴春's avatar 吴春

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

parents 170972ae cafe4aac
......@@ -519,15 +519,21 @@ namespace Mall.Model.Entity.Product
/// 视频填充方式(0默认,1-填充)
/// </summary>
public int VideoType { get; set; }
/// <summary>
/// 评论积分赠送
/// </summary>
public int? IntegralComment { get; set; }
/// </summary>
public int? IntegralComment
{
get;
set;
}
/// <summary>
/// 评论赠送类型 1固定值 2百分比
/// </summary>
public int? IntegralCommentType { get; set; }
/// 评论赠送类型 2固定值 1百分比
/// </summary>
public int? IntegralCommentType
{
get;
set;
}
}
}
......@@ -813,7 +813,8 @@ namespace Mall.Module.Product
{ nameof(RB_Goods.RideNum),demodel.RideNum },
{ nameof(RB_Goods.AdvanceDay),demodel.AdvanceDay },
{ nameof(RB_Goods.VideoType),demodel.VideoType },
{ nameof(RB_Goods.IntegralComment),demodel.IntegralComment },
{ nameof(RB_Goods.IntegralCommentType),demodel.IntegralCommentType },
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
......@@ -1652,7 +1653,7 @@ namespace Mall.Module.Product
if (model.IntegralPresent > 0)
{
Integral = model.IntegralPresent ?? 0;
if (model.IntegralPresentType == 2)
if (model.IntegralPresentType == 1)
{
Integral = Convert.ToInt32(Math.Floor((model.SellingPrice ?? 0) * (model.IntegralPresent ?? 0) / 100));
}
......@@ -1662,7 +1663,7 @@ namespace Mall.Module.Product
if (model.IntegralComment > 0)
{
CommentIntegral = model.IntegralComment ?? 0;
if (model.IntegralCommentType == 2)
if (model.IntegralCommentType == 1)
{
CommentIntegral = Convert.ToInt32(Math.Floor((model.SellingPrice ?? 0) * (model.IntegralComment ?? 0) / 100));
}
......@@ -1915,6 +1916,7 @@ namespace Mall.Module.Product
bool IsPointsDeduction = false;//是否有商品可使用积分抵扣
bool address_enable = true;//地址Ok
bool date_enable = true;//日期ok
string date_remark = "";//日期无法下单备注
List<object> goods_list = new List<object>();
var guidebaseModel = guideCar_BaseRepository.GetList(new RB_GuideCar_Base_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
if (demodel.DetailList.Any())
......@@ -2398,11 +2400,13 @@ namespace Mall.Module.Product
if (!targetList.Any())
{
date_enable = false;
date_remark = "出发日期不在可预定日期内,请重新选择出发日期";
}
var targetModel = targetList.FirstOrDefault();
if (targetModel.ReserveNum + (item.Number ?? 0) > (gmodel.RideNum ?? 0))
if (targetModel == null || targetModel.ReserveNum + (item.Number ?? 0) > (gmodel.RideNum ?? 0))
{
date_enable = false;
date_remark = "剩余座位数不足,请重新选择出发日期";
}
string SiteName = sitelist.Where(x => x.ID == gmodel.SiteId).FirstOrDefault()?.SiteName ?? "";
......@@ -2429,7 +2433,7 @@ namespace Mall.Module.Product
name = gmodel.Name,
categoryIdList = item.CategoryIdList,
num = item.Number,
surplus_num = (gmodel.RideNum ?? 0) - targetModel.ReserveNum,
surplus_num = (gmodel.RideNum ?? 0) - (targetModel?.ReserveNum ?? 0),
forehead_integral = gmodel.PointsDeduction,
forehead_integral_type = gmodel.PointsDeductionType,
accumulative = gmodel.IsMultipleDeduction,//累计多件抵扣
......@@ -2579,6 +2583,7 @@ namespace Mall.Module.Product
promptNoSuperiorFY = PromptNoSuperiorFY,
total_price = TotalGoodsMoney + InsuranceMoney,
date_enable,
date_remark,
insurance_description = guidebaseModel?.InsuranceDescription,
address = new
{
......
......@@ -3556,6 +3556,17 @@ namespace Mall.Module.Product
TotalExpress += Express;
#endregion
item.FreightMoney = Express;
item.CommentGiveIntegral = 0;
if (gmodel.IntegralComment > 0) {
if (gmodel.IntegralCommentType == 1)
{
item.CommentGiveIntegral = Convert.ToInt32(Math.Floor((gmodel.IntegralComment ?? 0) * (item.Final_Price ?? 0) / 100));
}
else {
item.CommentGiveIntegral = Convert.ToInt32((gmodel.IntegralComment ?? 0) * (item.Number ?? 0));
}
}
}
}
if (demodel.FreightMoney != TotalExpress)
......@@ -3750,7 +3761,7 @@ namespace Mall.Module.Product
});
}
goods_OrderRepository.DBSession.Commit();
return ApiResult.Success("", new { OrderId, demodel.OrderNo });
return ApiResult.Success("", new { OrderId });
}
catch (Exception ex)
{
......@@ -4326,6 +4337,19 @@ namespace Mall.Module.Product
item.InsuranceMoney = guidebaseModel?.SalePrice ?? 0;
item.InsuranceCostMoney = guidebaseModel?.CostPrice ?? 0;
InsuranceMoney += (item.InsuranceMoney ?? 0);
item.CommentGiveIntegral = 0;
if (gmodel.IntegralComment > 0)
{
if (gmodel.IntegralCommentType == 1)
{
item.CommentGiveIntegral = Convert.ToInt32(Math.Floor((gmodel.IntegralComment ?? 0) * (item.Final_Price ?? 0) / 100));
}
else
{
item.CommentGiveIntegral = Convert.ToInt32((gmodel.IntegralComment ?? 0) * (item.Number ?? 0));
}
}
}
}
if (CouponsMoney != demodel.CouponMoney)
......@@ -5921,7 +5945,8 @@ namespace Mall.Module.Product
UseDay = item.UseDay,
InsuranceMoney = item.InsuranceMoney,
InsuranceCostMoney = item.InsuranceCostMoney,
InsuranceFinanceId = 0
InsuranceFinanceId = 0,
CommentGiveIntegral = item.CommentGiveIntegral
}, trans);
item.Id = detailId;
if (detailId > 0 && SatisfiedGoodsList.Any())
......@@ -8146,6 +8171,13 @@ namespace Mall.Module.Product
if (financeConfigurineList != null && financeConfigurineList.Any())
{
var item = financeConfigurineList.FirstOrDefault();
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = dmodel.OrderId ?? 0 });
string Remark1 = "";
if (dlist.Any()) {
foreach (var qqitem in dlist) {
Remark1 += qqitem.GoodsName + " " + qqitem.Specification + " ";
}
}
var detailList = new List<object>() {
new
{
......@@ -8153,11 +8185,10 @@ namespace Mall.Module.Product
Number = 1,
OriginalMoney = Money,
UnitPrice = Money,
Remark = "订单号:" + omodel.OrderNo + "售后单号:" + (dmodel.ReOrderNo ?? "暂无") + " " + dstr
Remark = Remark1 + "单号:" + omodel.OrderNo + "售后单号:" + (dmodel.ReOrderNo ?? "暂无") + " " + dstr
}
};
List<RB_ECFinanceId_Relation> ECList = new List<RB_ECFinanceId_Relation>();
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = dmodel.OrderId ?? 0 });
foreach (var qitem in dlist)
{
ECList.Add(new RB_ECFinanceId_Relation()
......@@ -8181,7 +8212,7 @@ namespace Mall.Module.Product
TemplateId = item.WorkFlowId,
OrderSource = 16,
OtherType = 23,
ReFinanceId = dmodel.ReOrderId,
ReFinanceId = dmodel.OrderId ?? 0,
Remark = "名称:" + umodel.Name + "(" + umodel.Id + ")" + " " + System.DateTime.Now.ToString("yyyy年MM月dd日") + "自动生成财务单据(erp订单)",
detailList,
RB_Depart_Id = Config.ExpendDepartment,
......@@ -9366,6 +9397,13 @@ namespace Mall.Module.Product
if (financeConfigurineList != null && financeConfigurineList.Any())
{
var item = financeConfigurineList.FirstOrDefault();
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = omodel.OrderId });
string Remark1 = "";
if (dlist.Any()) {
foreach (var qqitem in dlist) {
Remark1 += qqitem.GoodsName + " " + qqitem.Specification + " ";
}
}
var detailList = new List<object>() {
new
{
......@@ -9373,7 +9411,7 @@ namespace Mall.Module.Product
Number = 1,
OriginalMoney = Money,
UnitPrice = Money,
Remark = "订单号:" + omodel.OrderNo + " " + dstr
Remark = Remark1 + "单号:" + omodel.OrderNo + " " + dstr
}
};
......@@ -9384,7 +9422,6 @@ namespace Mall.Module.Product
Remark = "后台强制取消该订单,用户名称:" + umodel.Name + "(" + umodel.Id + ")" + " " + System.DateTime.Now.ToString("yyyy年MM月dd日") + " 自动生成财务单据(ERP下单)";
}
List<RB_ECFinanceId_Relation> ECList = new List<RB_ECFinanceId_Relation>();
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = omodel.OrderId });
foreach (var qitem in dlist)
{
ECList.Add(new RB_ECFinanceId_Relation()
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Mall.Common;
using Mall.Common.API;
using Mall.Common.Enum;
using Mall.Common.Enum.Goods;
using Mall.Common.Enum.User;
using Mall.Common.Plugin;
using Mall.Model.Entity.Finance;
using Mall.Model.Entity.Product;
using Mall.Model.Extend.BaseSetUp;
using Mall.Model.Extend.Finance;
using Mall.Model.Extend.Product;
using Mall.Model.Extend.User;
using Mall.Module.User;
using Mall.Repository;
using Mall.Repository.BaseSetUp;
using Mall.Repository.Finance;
using Mall.Repository.GuideCar;
using Mall.Repository.MarketingCenter;
using Mall.Repository.Product;
using Mall.Repository.User;
using Mall.ThirdCore.Message;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NPOI.SS.Formula.Functions;
using VT.FW.DB;
namespace Mall.Module.Product
{
/// <summary>
/// 订单处理层 v2
/// </summary>
public class OrderModule_V2
{
/// <summary>
/// 订单商品
/// </summary>
private readonly RB_Goods_OrderRepository goods_OrderRepository = new RB_Goods_OrderRepository();
/// <summary>
/// 订单明细
/// </summary>
private readonly RB_Goods_OrderDetailRepository goods_OrderDetailRepository = new RB_Goods_OrderDetailRepository();
/// <summary>
/// 区域
/// </summary>
private readonly Rb_destinationRepository destinationRepository = new Rb_destinationRepository();
/// <summary>
/// 会员
/// </summary>
private readonly RB_Member_UserRepository member_UserRepository = new RB_Member_UserRepository();
/// <summary>
/// 找人代付 订单详情
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public ApiResult GetAppletMyOrderAgentInfo(int orderId)
{
var model = goods_OrderRepository.GetEntity(orderId).RefMapperTo<RB_Goods_Order_Extend>();
if (model == null)
{
return ApiResult.Failed("订单信息不存在,请核实后再试");
}
var umodel = member_UserRepository.GetEntity(model.UserId??0);
if (umodel == null) {
return ApiResult.Failed("订单用户不存在,请核实后再试");
}
//查询订单明细
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = orderId });
if (dlist.Any())
{
string orderDetailIds = string.Join(",", dlist.Select(x => x.Id));
foreach (var item in dlist)
{
item.CoverImagePath = item.CoverImage;
item.IsApplyForAfterSale = 2;
if (item.PresentFXGrade > 0)
{
model.PresentFXGrade = 1;
}
}
}
model.DetailList = dlist;
//地址
model.DistrictAddress = (destinationRepository.GetEntity(model.Province)?.Name ?? "") + " " + (destinationRepository.GetEntity(model.City)?.Name ?? "") + " " + (destinationRepository.GetEntity(model.District)?.Name ?? "");
model.IsCanApplyForAfterSale = 2;
return ApiResult.Success("", new
{
model.OrderId,
model.OrderNo,
model.OrderStatus,
UserInfo = new
{
UserId = umodel.Id,
umodel.Name,
umodel.Photo
},
OrderStatusName = model.OrderStatus.GetEnumName(),
CreateDate = model.CreateDate.HasValue ? model.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
CancelTime = model.CancelTime.HasValue ? model.CancelTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
model.PaymentWay,
PaymentWayName = model.PaymentWay.GetEnumName(),
model.DeliveryMethod,
DeliveryMethodName = model.DeliveryMethod.GetEnumName(),
model.PreferPrice,
model.Income,
model.CouponMoney,
model.FreightMoney,
model.Consignee,
model.Mobile,
model.DistrictAddress,
model.ShoppingAddress,
IsHaveExpress = 2,
DetailList = model.DetailList.Select(x => new
{
DetailId = x.Id,
x.GoodsId,
x.GoodsName,
x.CoverImagePath,
SpecificationList = JsonConvert.DeserializeObject<List<string>>(x.Specification),
x.Number,
x.Final_Price,
x.IsComment,
x.IsApplyForAfterSale,
x.FreeShippingRemarks
}),
model.IsApplyForCancel,
model.RejectRemark,
model.IsCanApplyForAfterSale,
model.PresentFXGrade
});
}
}
}
......@@ -2169,7 +2169,7 @@ namespace Mall.Module.Product
if (model.IntegralPresent > 0)
{
Integral = model.IntegralPresent ?? 0;
if (model.IntegralPresentType == 2)
if (model.IntegralPresentType == 1)
{
Integral = Convert.ToInt32(Math.Floor((model.SellingPrice ?? 0) * (model.IntegralPresent ?? 0) / 100));
}
......@@ -2178,7 +2178,7 @@ namespace Mall.Module.Product
if (model.IntegralComment > 0)
{
CommentIntegral = model.IntegralComment ?? 0;
if (model.IntegralCommentType == 2)
if (model.IntegralCommentType == 1)
{
CommentIntegral = Convert.ToInt32(Math.Floor((model.SellingPrice ?? 0) * (model.IntegralComment ?? 0) / 100));
}
......@@ -4531,7 +4531,8 @@ namespace Mall.Module.Product
{ nameof(RB_Goods.DownDate),demodel.DownDate },
{ nameof(RB_Goods.SendArea),demodel.SendArea },
{ nameof(RB_Goods.VideoType),demodel.VideoType },
{ nameof(RB_Goods.IntegralComment),demodel.IntegralComment },
{ nameof(RB_Goods.IntegralCommentType),demodel.IntegralCommentType },
};
if (goodsModel.IsProcurement == 1)
{
......
......@@ -1102,53 +1102,52 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
{
if (query.TenantId > 0)
{
where += string.Format(" AND TenantId={0} ", query.TenantId);
where += string.Format(" AND A.TenantId={0} ", query.TenantId);
}
if (query.MallBaseId > 0)
{
where += string.Format(" AND MallBaseId={0} ", query.MallBaseId);
where += string.Format(" AND A.MallBaseId={0} ", query.MallBaseId);
}
if (!string.IsNullOrWhiteSpace(query.UserIds))
{
where += string.Format(" AND UserId IN({0}) ", query.UserIds);
where += string.Format(" AND A.UserId IN({0}) ", query.UserIds);
}
if (query.Id > 0)
{
where += string.Format(" AND UserId IN({0}) ", query.Id);
where += string.Format(" AND A.UserId IN({0}) ", query.Id);
}
}
if (IsGetCurrentMonth)
{
where += string.Format(" AND DATE_FORMAT(CreateDate, '%Y/%m')=DATE_FORMAT('{0}','%Y/%m') ", DateTime.Now.ToString("yyyy-MM-dd"));
where += string.Format(" AND DATE_FORMAT(A.CreateDate, '%Y/%m')=DATE_FORMAT('{0}','%Y/%m') ", DateTime.Now.ToString("yyyy-MM-dd"));
}
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT UserId AS Id,IsRemit,SUM(A.Commission) AS Commission
FROM
(
SELECT UserId,SUM(Commission) AS Commission,IsRemit
FROM rb_goods_ordercommission
WHERE UserId>0 {0}
GROUP BY UserId
SELECT A.UserId,SUM(A.Commission) AS Commission,A.IsRemit
FROM rb_goods_ordercommission AS A LEFT JOIN rb_goods_order AS B ON A.OrderId=B.OrderId
WHERE B.OrderStatus<>7 AND A.OrderId NOT IN(select OrderId from rb_goods_orderaftersale where ReOrderStatus<>6) {0}
GROUP BY A.UserId
UNION ALL
SELECT UserId,SUM(Commission) AS Commission,RemitStatus AS IsRemit
FROM rb_goods_orderintroduction
WHERE UserId>0 {0}
GROUP BY UserId,RemitStatus
UNION ALL
SELECT UserId,SUM(Commission) AS Commission,IsRemit
FROM rb_vipbuy_commission
WHERE UserId>0 {0}
GROUP BY UserId,IsRemit
SELECT A.UserId,SUM(A.Commission) AS Commission,A.RemitStatus AS IsRemit
FROM rb_goods_orderintroduction AS A LEFT JOIN rb_goods_order AS B ON A.OrderId=B.OrderId
WHERE B.OrderStatus<>7 AND A.OrderId NOT IN(select OrderId from rb_goods_orderaftersale where ReOrderStatus<>6) {0}
GROUP BY A.UserId,A.RemitStatus
UNION ALL
SELECT UserId,SUM(Commission) AS Commission,IsRemit
FROM rb_smallshops_commission
WHERE UserId>0 {0}
GROUP BY UserId,IsRemit
SELECT A.UserId,SUM(A.Commission) AS Commission,IsRemit
FROM rb_vipbuy_commission AS A
WHERE 1=1 {0}
GROUP BY A.UserId,A.IsRemit
UNION ALL
SELECT A.UserId,SUM(A.Commission) AS Commission,A.IsRemit
FROM rb_smallshops_commission AS A LEFT JOIN rb_goods_order AS B ON A.OrderId=B.OrderId
WHERE B.OrderStatus<>7 AND A.OrderId NOT IN(select OrderId from rb_goods_orderaftersale where ReOrderStatus<>6) {0}
GROUP BY A.UserId,A.IsRemit
) AS A GROUP BY UserId,IsRemit
", where);
return Get<RB_Member_User_Extend>(builder.ToString()).ToList();
......
......@@ -27,6 +27,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
private readonly ProductModule productModule = new ProductModule();
private readonly OrderModule_V2 orderModule = new OrderModule_V2();
#region 商品分类
......@@ -597,7 +598,7 @@ namespace Mall.WebApi.Controllers.MallBase
if (model.IntegralPresent > 0)
{
Integral = model.IntegralPresent ?? 0;
if (model.IntegralPresentType == 2)
if (model.IntegralPresentType == 1)
{
Integral = Convert.ToInt32(Math.Floor((model.SellingPrice ?? 0) * (model.IntegralPresent ?? 0) / 100));
}
......@@ -1196,5 +1197,29 @@ namespace Mall.WebApi.Controllers.MallBase
}
#endregion
#region 订单代付
/// <summary>
/// 获取我的订单详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppletMyOrderAgentInfo(object requestMsg)
{
var req = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
if (req.MallBaseId <= 0)
{
return ApiResult.ParamIsNull();
}
JObject parms = JObject.Parse(req.msg.ToString());
int OrderId = parms.GetInt("OrderId", 0);
if (OrderId <= 0)
{
return ApiResult.ParamIsNull();
}
return orderModule.GetAppletMyOrderAgentInfo(OrderId);
}
#endregion
}
}
\ No newline at end of file
......@@ -375,7 +375,9 @@ namespace Mall.WebApi.Controllers.MallBase
model?.IsSpell,
model?.RideNum,
model?.AdvanceDay,
model?.TargetDateList
model?.TargetDateList,
model?.IntegralComment,
model?.IntegralCommentType,
});
}
......@@ -811,6 +813,8 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.IsLiveGoods ??= 2;//是否直播商品 1是 2否
demodel.SendArea ??= "";//发货地
demodel.GoodsClassify = 1;
demodel.IntegralComment ??= 0;//评论反积分
demodel.IntegralCommentType ??= 1;
bool flag = guideCarModule.SetProductGoodsInfo(demodel);
if (flag)
......
......@@ -1599,6 +1599,8 @@ namespace Mall.WebApi.Controllers.MallBase
model?.ShelvesDate,
model?.DownDate,
model?.VideoType,
model?.IntegralComment,
model?.IntegralCommentType,
};
}
return ApiResult.Success("", obj);
......@@ -2068,6 +2070,8 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.IsLiveGoods ??= 2;//是否直播商品 1是 2否
demodel.SendArea ??= "";//发货地
demodel.GoodsClassify = 0;
demodel.IntegralComment ??= 0;//评论反积分
demodel.IntegralCommentType ??= 1;
if (demodel.IsProxy == 1 && demodel.CostPrice > 0)
{
decimal ProxyMoney = 0;
......
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