Commit 129a259c authored by 吴春's avatar 吴春

解决冲突

parents 24e8e159 a53b41be
...@@ -364,5 +364,10 @@ namespace Mall.Model.Entity.Product ...@@ -364,5 +364,10 @@ namespace Mall.Model.Entity.Product
/// 服务时间 /// 服务时间
/// </summary> /// </summary>
public string ServiceTime { get; set; } public string ServiceTime { get; set; }
/// <summary>
/// 商品服务时长
/// </summary>
public decimal GoodServiceTime { get; set; }
} }
} }
...@@ -344,5 +344,10 @@ namespace Mall.Model.Extend.Product ...@@ -344,5 +344,10 @@ namespace Mall.Model.Extend.Product
public string UserPhoto { get; set; } public string UserPhoto { get; set; }
#endregion #endregion
/// <summary>
/// 服务人员姓名
/// </summary>
public string ServicepersonalName { get; set; }
} }
} }
...@@ -299,6 +299,16 @@ namespace Mall.Model.Extend.Product ...@@ -299,6 +299,16 @@ namespace Mall.Model.Extend.Product
#endregion #endregion
/// <summary>
/// 门店名称
/// </summary>
public string StoreName { get; set; }
/// <summary>
/// 门店地址
/// </summary>
public string StoresAddress { get; set; }
} }
/// <summary> /// <summary>
...@@ -322,6 +332,5 @@ namespace Mall.Model.Extend.Product ...@@ -322,6 +332,5 @@ namespace Mall.Model.Extend.Product
/// 优惠券金额 /// 优惠券金额
/// </summary> /// </summary>
public decimal CouponMoney { get; set; } public decimal CouponMoney { get; set; }
} }
} }
...@@ -14,6 +14,11 @@ namespace Mall.Model.Extend.Reserve ...@@ -14,6 +14,11 @@ namespace Mall.Model.Extend.Reserve
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_Reserve_ServicePersonal_Extend : RB_Reserve_ServicePersonal public class RB_Reserve_ServicePersonal_Extend : RB_Reserve_ServicePersonal
{ {
/// <summary>
/// 服务人员编号【查询使用】
/// </summary>
public string QIds { get; set; }
/// <summary> /// <summary>
/// 标签 /// 标签
/// </summary> /// </summary>
......
...@@ -12,6 +12,7 @@ using Mall.Common.Enum.User; ...@@ -12,6 +12,7 @@ using Mall.Common.Enum.User;
using Mall.Common.Plugin; using Mall.Common.Plugin;
using Mall.Model.Entity.Finance; using Mall.Model.Entity.Finance;
using Mall.Model.Entity.Product; using Mall.Model.Entity.Product;
using Mall.Model.Entity.User;
using Mall.Model.Extend.BaseSetUp; using Mall.Model.Extend.BaseSetUp;
using Mall.Model.Extend.Education; using Mall.Model.Extend.Education;
using Mall.Model.Extend.Finance; using Mall.Model.Extend.Finance;
...@@ -25,6 +26,7 @@ using Mall.Repository.Finance; ...@@ -25,6 +26,7 @@ using Mall.Repository.Finance;
using Mall.Repository.GuideCar; using Mall.Repository.GuideCar;
using Mall.Repository.MarketingCenter; using Mall.Repository.MarketingCenter;
using Mall.Repository.Product; using Mall.Repository.Product;
using Mall.Repository.Reserve;
using Mall.Repository.User; using Mall.Repository.User;
using Mall.ThirdCore.Message; using Mall.ThirdCore.Message;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
...@@ -317,6 +319,17 @@ namespace Mall.Module.Product ...@@ -317,6 +319,17 @@ namespace Mall.Module.Product
/// 教育对应的订单课程卡 /// 教育对应的订单课程卡
/// </summary> /// </summary>
private Mall.Repository.Education.RB_Education_MemberCouponRepository educationMemberCouponRepository = new Mall.Repository.Education.RB_Education_MemberCouponRepository(); private Mall.Repository.Education.RB_Education_MemberCouponRepository educationMemberCouponRepository = new Mall.Repository.Education.RB_Education_MemberCouponRepository();
/// <summary>
/// 服务人员仓储层对象
/// </summary>
private readonly RB_Reserve_ServicePersonalRepository reserve_ServicePersonalRepository = new RB_Reserve_ServicePersonalRepository();
/// <summary>
/// 门店仓储层对象
/// </summary>
private readonly RB_StoresRepository storesRepository = new RB_StoresRepository();
#region 购物车 #region 购物车
/// <summary> /// <summary>
...@@ -921,6 +934,133 @@ namespace Mall.Module.Product ...@@ -921,6 +934,133 @@ namespace Mall.Module.Product
}); });
} }
/// <summary>
/// 获取线下服务我的订单详情
/// </summary>
/// <param name="orderId"></param>
/// <param name="userId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public ApiResult GetOfflineMyOrderModule(int orderId, int userId, int tenantId, int mallBaseId)
{
var model = goods_OrderRepository.GetEntity(orderId).RefMapperTo<RB_Goods_Order_Extend>();
if (model == null || model.UserId != userId)
{
return ApiResult.Failed("订单信息不存在,请核实后再试");
}
//门店实体信息
var storeModel = new RB_Stores();
if (model.StoresId > 0)
{
storeModel= storesRepository.GetEntity(model.StoresId);
}
//查询订单明细
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = orderId });
if (dlist.Any())
{
string orderDetailIds = string.Join(",", dlist.Select(x => x.Id));
var oasList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetailIds = orderDetailIds, TenantId = tenantId, MallBaseId = mallBaseId }, false);
string servicePersions = string.Join(",", dlist.Select(x => x.ServicepersonalId));
var serviceList= reserve_ServicePersonalRepository.GetServicePersonalList(new Model.Extend.Reserve.RB_Reserve_ServicePersonal_Extend()
{
QIds = servicePersions
});
foreach (var item in dlist)
{
item.CoverImagePath = item.CoverImage;
item.IsApplyForAfterSale = 2;
if (oasList.Where(x => x.OrderDetialId == item.Id).Any())
{
item.IsApplyForAfterSale = 1;
}
if (item.PresentFXGrade > 0)
{
model.PresentFXGrade = 1;
}
item.ServicepersonalName = serviceList?.Where(qitem => qitem.ID == item.ServicepersonalId)?.FirstOrDefault()?.Name ?? "";
}
}
model.DetailList = dlist;
//是否可以申请售后
var mallModel = mallBaseRepository.GetEntity(mallBaseId);
model.IsCanApplyForAfterSale = 2;
if (model.OrderStatus == OrderStatusEnum.WaitReceiving)
{
model.IsCanApplyForAfterSale = 1;
}
else if (model.OrderStatus == OrderStatusEnum.Received || model.OrderStatus == OrderStatusEnum.Completed)
{
if (mallModel != null && mallModel.AfterTime > 0 && model.ReceivingTime.HasValue)
{
if (model.ReceivingTime.Value.AddDays(mallModel.AfterTime) > DateTime.Now)
{
model.IsCanApplyForAfterSale = 1;
}
}
}
//获取订阅消息
var miniModel = miniProgramRepository.GetListRepository(new RB_MiniProgram_Extend { TenantId = model.TenantId, MallBaseId = model.MallBaseId }).FirstOrDefault();
List<string> template_message_list = new List<string>();
if (miniModel != null)
{
if (!string.IsNullOrWhiteSpace(miniModel.RefundTpl))
{
template_message_list.Add(miniModel.RefundTpl);
}
if (!string.IsNullOrWhiteSpace(miniModel.OrderCancelTpl))
{
template_message_list.Add(miniModel.OrderCancelTpl);
}
}
return ApiResult.Success("", new
{
template_message_list,
model.OrderId,
model.OrderNo,
model.OrderStatus,
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.PreferPrice,
model.Income,
model.CouponMoney,
model.Consignee,
model.Mobile,
model.ShoppingAddress,
DetailList = model.DetailList.Select(x => new
{
DetailId = x.Id,
x.GoodsId,
x.GoodsName,
x.CoverImagePath,
x.Number,
x.Final_Price,
x.IsComment,
x.IsApplyForAfterSale,
x.FreeShippingRemarks,
x.ServiceDate,
x.ServiceTime,
x.GoodServiceTime,
x.ServicepersonalName,
}),
model.IsApplyForCancel,
model.RejectRemark,
model.IsCanApplyForAfterSale,
model.PresentFXGrade,
model.BuyerMessage,
model.Remark,
model.CancelRemark,
storeName=storeModel?.Name,
storeAddress= storeModel?.Address
});
}
/// <summary> /// <summary>
/// 获取我的订单快递信息 /// 获取我的订单快递信息
/// </summary> /// </summary>
...@@ -4626,6 +4766,7 @@ namespace Mall.Module.Product ...@@ -4626,6 +4766,7 @@ namespace Mall.Module.Product
disList.Add(demodel.City ?? 0); disList.Add(demodel.City ?? 0);
disList.Add(demodel.District ?? 0); disList.Add(demodel.District ?? 0);
var goodModel = goodsRepository.GetEntity(demodel.GoodsId);
decimal TotalExpress = 0; decimal TotalExpress = 0;
decimal TotalMoney = 0; decimal TotalMoney = 0;
...@@ -5212,6 +5353,7 @@ namespace Mall.Module.Product ...@@ -5212,6 +5353,7 @@ namespace Mall.Module.Product
TotalMoney += (item.Final_Price ?? 0); TotalMoney += (item.Final_Price ?? 0);
item.OrderType = OrderTypeEnum.OfflineService; item.OrderType = OrderTypeEnum.OfflineService;
item.GoodServiceTime = goodModel?.ServiceTime ?? 0;
item.GoodsName = gmodel.Name; item.GoodsName = gmodel.Name;
item.CoverImage = ""; item.CoverImage = "";
if (!string.IsNullOrEmpty(gmodel.CarouselImage) && gmodel.CarouselImage != "[]") if (!string.IsNullOrEmpty(gmodel.CarouselImage) && gmodel.CarouselImage != "[]")
...@@ -7179,6 +7321,7 @@ namespace Mall.Module.Product ...@@ -7179,6 +7321,7 @@ namespace Mall.Module.Product
ServiceDate = item.ServiceDate, ServiceDate = item.ServiceDate,
ServicepersonalId = item.ServicepersonalId, ServicepersonalId = item.ServicepersonalId,
ServiceTime = item.ServiceTime, ServiceTime = item.ServiceTime,
GoodServiceTime=item.GoodServiceTime,
}, trans); }, trans);
item.Id = detailId; item.Id = detailId;
if (detailId > 0 && SatisfiedGoodsList.Any()) if (detailId > 0 && SatisfiedGoodsList.Any())
...@@ -8453,27 +8596,22 @@ namespace Mall.Module.Product ...@@ -8453,27 +8596,22 @@ namespace Mall.Module.Product
//剑鱼兄需求 2020=07-30 再查询一次商品表 //剑鱼兄需求 2020=07-30 再查询一次商品表
string GoodsIds = string.Join(",", dlist.Select(x => x.GoodsId).Distinct()); string GoodsIds = string.Join(",", dlist.Select(x => x.GoodsId).Distinct());
var GList = goodsRepository.GetSingleListForGoodsSubName(new RB_Goods_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, GoodsIds = GoodsIds }, true); var GList = goodsRepository.GetSingleListForGoodsSubName(new RB_Goods_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, GoodsIds = GoodsIds }, true);
//查询订单对应的老师
var teacherList = goodsWKTeacherRepository.GetList(new RB_Goods_WK_Teacher_Extend { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, GoodsIds = GoodsIds }); //获取服务人员
//查询订单详情对应的课程卡信息 string persionIds= string.Join(",", dlist.Select(x => x.ServicepersonalId).Distinct());
string educationCouponIds = string.Join(",", dlist.Where(x => x.EducationCouponId > 0).Select(x => x.EducationCouponId).Distinct()); var persionList = reserve_ServicePersonalRepository.GetServicePersonalList(new Model.Extend.Reserve.RB_Reserve_ServicePersonal_Extend()
List<RB_Education_MemberCoupon_Extend> educationCouponList = new List<RB_Education_MemberCoupon_Extend>();
if (!string.IsNullOrWhiteSpace(educationCouponIds))
{ {
educationCouponList = educationMemberCouponRepository.GetList(new RB_Education_MemberCoupon_Extend { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, Ids = educationCouponIds }); QIds = persionIds
} });
foreach (var item in dlist) foreach (var item in dlist)
{ {
item.CoverImagePath = item.CoverImage; item.CoverImagePath = item.CoverImage;
item.GoodsSubName = GList.Where(x => x.Id == item.GoodsId).FirstOrDefault()?.SubName ?? ""; item.GoodsSubName = GList.Where(x => x.Id == item.GoodsId).FirstOrDefault()?.SubName ?? "";
item.FinanceList = flist.Where(x => x.ECOrderDetailId == item.Id).ToList();// 2020-08-19 新增财务单据列表 item.FinanceList = flist.Where(x => x.ECOrderDetailId == item.Id).ToList();// 2020-08-19 新增财务单据列表
item.TeacherList = teacherList.Where(x => x.GoodsId == item.GoodsId).ToList();// 2020-10-11 订单对应的老师 item.ServicepersonalName = persionList?.Where(qitem => qitem.ID == item.ServicepersonalId)?.FirstOrDefault()?.Name ?? "";
item.MemberEducationCouponList = educationCouponList.Where(x => x.Id == item.EducationCouponId).ToList();// 2020-10-11 订单详情对应的课程卡
} }
} }
//2020-08-25 Add By:W Start
//2020-08-25 Add By:W Start
List<RB_Member_DiscountCoupon_Extend> memberCouponList = new List<RB_Member_DiscountCoupon_Extend>(); List<RB_Member_DiscountCoupon_Extend> memberCouponList = new List<RB_Member_DiscountCoupon_Extend>();
if (list.Any(x => !string.IsNullOrWhiteSpace(x.CouponsIds))) if (list.Any(x => !string.IsNullOrWhiteSpace(x.CouponsIds)))
{ {
...@@ -8486,7 +8624,6 @@ namespace Mall.Module.Product ...@@ -8486,7 +8624,6 @@ namespace Mall.Module.Product
item.MemberDiscountCouponList = new List<RB_Member_DiscountCoupon_Extend>(); item.MemberDiscountCouponList = new List<RB_Member_DiscountCoupon_Extend>();
if (!string.IsNullOrWhiteSpace(item.CouponsIds)) if (!string.IsNullOrWhiteSpace(item.CouponsIds))
{ {
foreach (var itemCoupons in item.CouponsIds.Split(',')) foreach (var itemCoupons in item.CouponsIds.Split(','))
{ {
item.MemberDiscountCouponList.AddRange(memberCouponList.Where(x => itemCoupons == x.Id.ToString())); item.MemberDiscountCouponList.AddRange(memberCouponList.Where(x => itemCoupons == x.Id.ToString()));
......
...@@ -3546,7 +3546,7 @@ namespace Mall.Module.Product ...@@ -3546,7 +3546,7 @@ namespace Mall.Module.Product
var storeDateModel = new StoreReserveDate() var storeDateModel = new StoreReserveDate()
{ {
DayDate = Convert.ToDateTime(DateTime.Now.AddDays(i).ToString("yyyy-MM-dd")), DayDate = Convert.ToDateTime(DateTime.Now.AddDays(i).ToString("yyyy-MM-dd")),
DayDateStr = DateTime.Now.AddDays(i).ToString("MM-dd"), DayDateStr = DateTime.Now.AddDays(i).ToString("yyyy-MM-dd"),
WeekDayStr = (i == 0 ? "今天" : "周" + Common.Plugin.CommonHelper.GetWeekDay(DateTime.Now.AddDays(i))), WeekDayStr = (i == 0 ? "今天" : "周" + Common.Plugin.CommonHelper.GetWeekDay(DateTime.Now.AddDays(i))),
TimeList = new List<string>() TimeList = new List<string>()
}; };
......
...@@ -2209,11 +2209,13 @@ where {where} group by o.OrderId order by o.CreateDate desc"; ...@@ -2209,11 +2209,13 @@ where {where} group by o.OrderId order by o.CreateDate desc";
} }
string sql = $@" string sql = $@"
SELECT o.*,u.Name as UserName,sshop.`Name` as SmallShopsName FROM rb_goods_order o SELECT o.*,u.Name as UserName,sshop.`Name` as SmallShopsName,s.`Name` AS StoreName,s.Address AS StoresAddress
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId FROM rb_goods_order o
INNER JOIN rb_member_user u on o.UserId=u.Id INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
LEFT JOIN rb_smallshops_info as sshop on o.SmallShopsId=sshop.Id INNER JOIN rb_member_user u on o.UserId=u.Id
where {where} group by o.OrderId order by o.CreateDate desc "; LEFT JOIN rb_smallshops_info as sshop on o.SmallShopsId=sshop.Id
LEFT JOIN rb_stores AS s ON O.StoresId=s.Id
WHERE {where} GROUP BY o.OrderId ORDER BY o.CreateDate DESC ";
return GetPage<RB_Goods_Order_Extend>(pageIndex, pageSize, out count, sql, parameters).ToList(); return GetPage<RB_Goods_Order_Extend>(pageIndex, pageSize, out count, sql, parameters).ToList();
} }
#endregion #endregion
......
...@@ -276,10 +276,16 @@ ORDER BY t.orderNum desc "; ...@@ -276,10 +276,16 @@ ORDER BY t.orderNum desc ";
builder.Append($" AND a.{nameof(RB_Reserve_ServicePersonal_Extend.Name)} like '%{query.Name}%'"); builder.Append($" AND a.{nameof(RB_Reserve_ServicePersonal_Extend.Name)} like '%{query.Name}%'");
} }
if (!string.IsNullOrWhiteSpace(query.WorkDate)) if (!string.IsNullOrWhiteSpace(query.WorkDate))
{ {
builder.Append($" and DATE_FORMAT(b.Date,'%Y-%m-%d' )=DATE_FORMAT('{query.WorkDate}','%Y-%m-%d'"); builder.Append($" and DATE_FORMAT(b.Date,'%Y-%m-%d' )=DATE_FORMAT('{query.WorkDate}','%Y-%m-%d'");
} }
if (!string.IsNullOrEmpty(query.QIds))
{
builder.Append($" AND a.{nameof(RB_Reserve_ServicePersonal_Extend.ID)} IN({query.QIds}) ");
}
} }
builder.Append($" order by a.{nameof(RB_Reserve_ServicePersonal_Extend.ID)} desc"); builder.Append($" order by a.{nameof(RB_Reserve_ServicePersonal_Extend.ID)} desc");
return Get<RB_Reserve_ServicePersonal_Extend>(builder.ToString()).ToList(); return Get<RB_Reserve_ServicePersonal_Extend>(builder.ToString()).ToList();
...@@ -299,7 +305,7 @@ ORDER BY t.orderNum desc "; ...@@ -299,7 +305,7 @@ ORDER BY t.orderNum desc ";
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT DISTINCT A.* SELECT DISTINCT A.*,IFNULL(orderTab.OrderNum,0) AS OrderNum
FROM RB_Reserve_ServicePersonal AS A FROM RB_Reserve_ServicePersonal AS A
INNER JOIN INNER JOIN
( (
...@@ -309,6 +315,13 @@ INNER JOIN ...@@ -309,6 +315,13 @@ INNER JOIN
UNION UNION
SELECT * FROM rb_reserve_servicepersonalproduct WHERE ServiceType=1 AND `Status`=0 AND ProductId IN({1}) SELECT * FROM rb_reserve_servicepersonalproduct WHERE ServiceType=1 AND `Status`=0 AND ProductId IN({1})
) AS B ON A.ID=B.ServiceId ) AS B ON A.ID=B.ServiceId
LEFT JOIN
(
SELECT detailB.ServicepersonalId,COUNT(1) AS OrderNum
FROM rb_goods_order AS orderA INNER JOIN rb_goods_orderdetail AS detailB ON orderA.OrderId=detailB.OrderId
WHERE 1=1 AND orderA.OrderStatus NOT IN(7)
GROUP BY detailB.ServicepersonalId
) AS orderTab ON A.ID=orderTab.OrderNum
WHERE A.Status=0 AND A.StoreId={2} WHERE A.Status=0 AND A.StoreId={2}
", productId, categoryIds, storeId); ", productId, categoryIds, storeId);
return Get<RB_Reserve_ServicePersonal_Extend>(builder.ToString()).ToList(); return Get<RB_Reserve_ServicePersonal_Extend>(builder.ToString()).ToList();
......
...@@ -1857,7 +1857,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1857,7 +1857,7 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.OrderClassify = 3; demodel.OrderClassify = 3;
var list = orderModule.GetOfflineServiceOrderPageListModule(pagelist.pageIndex, pagelist.pageSize, out long count, demodel); var list = orderModule.GetOfflineServiceOrderPageListModule(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count); pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new var obj = list.Select(x => new
{ {
x.OrderId, x.OrderId,
x.OrderNo, x.OrderNo,
...@@ -1886,9 +1886,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1886,9 +1886,7 @@ namespace Mall.WebApi.Controllers.MallBase
y.DiscountsPrice y.DiscountsPrice
}), }),
DetailList = x.DetailList.Select(y => new DetailList = x.DetailList.Select(y => new
{ {
y.SupplierId,
y.SupplierName,
y.FreightCostMoney, y.FreightCostMoney,
y.FreightMoney, y.FreightMoney,
y.CostMoney, y.CostMoney,
...@@ -1898,12 +1896,9 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1898,12 +1896,9 @@ namespace Mall.WebApi.Controllers.MallBase
y.OrderType, y.OrderType,
OrderTypeName = y.OrderType.GetEnumName(), OrderTypeName = y.OrderType.GetEnumName(),
y.GoodsName, y.GoodsName,
SpecificationList = y.TeacherList.Select(x => x.Name),
y.ProductCode, y.ProductCode,
y.Final_Price, y.Final_Price,
y.Number, y.Number,
y.IsBindExpress,
y.FreeShippingRemarks,
y.SmallShopsCostPrice, y.SmallShopsCostPrice,
y.YSMoney, y.YSMoney,
y.RealMoney, y.RealMoney,
...@@ -1912,12 +1907,6 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1912,12 +1907,6 @@ namespace Mall.WebApi.Controllers.MallBase
CouponMoney = y.CouponMoney ?? 0, CouponMoney = y.CouponMoney ?? 0,
InsuranceMoney = y.InsuranceMoney ?? 0, InsuranceMoney = y.InsuranceMoney ?? 0,
InsuranceCostMoney = y.InsuranceCostMoney ?? 0, InsuranceCostMoney = y.InsuranceCostMoney ?? 0,
IntegralMoney = y.IntegralMoney ?? 0,
IntegralNumber = y.IntegralNumber ?? 0,
MemberEducationCouponList = y.MemberEducationCouponList.Select(z => new
{
z.Name,
}),
SFinanceList = y.FinanceList.Where(z => z.Type == 1).Select(z => new SFinanceList = y.FinanceList.Where(z => z.Type == 1).Select(z => new
{ {
z.FrID, z.FrID,
...@@ -1929,7 +1918,11 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1929,7 +1918,11 @@ namespace Mall.WebApi.Controllers.MallBase
z.FrID, z.FrID,
z.Status, z.Status,
z.Is_Cashier z.Is_Cashier
}) }),
y.ServiceDate,
y.ServiceTime,
y.GoodServiceTime,
y.ServicepersonalName
}), }),
x.Consignee, x.Consignee,
x.Mobile, x.Mobile,
...@@ -1951,8 +1944,11 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1951,8 +1944,11 @@ namespace Mall.WebApi.Controllers.MallBase
x.MallBaseId, x.MallBaseId,
x.SmallShopsId, x.SmallShopsId,
x.SmallShopsName, x.SmallShopsName,
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "" CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
x.StoreName,
x.StoresAddress,
}); });
pagelist.pageData = obj;
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
#endregion #endregion
......
...@@ -64,10 +64,6 @@ namespace Mall.WebApi.Controllers.Reserve ...@@ -64,10 +64,6 @@ namespace Mall.WebApi.Controllers.Reserve
JObject parm = JObject.Parse(parms.msg.ToString()); JObject parm = JObject.Parse(parms.msg.ToString());
var position = parm.GetStringValue("position"); var position = parm.GetStringValue("position");
int storeId = parm.GetInt("storeId"); int storeId = parm.GetInt("storeId");
if (userInfo == null)
{
userInfo = new Common.AppletUserInfo() { UserId = 106259 };
}
var storeModel = contentModule.GetStoresListModule(new RB_Stores_Extend() var storeModel = contentModule.GetStoresListModule(new RB_Stores_Extend()
{ {
CurrentPosition = position, CurrentPosition = position,
......
...@@ -7,8 +7,11 @@ using Mall.Common.API; ...@@ -7,8 +7,11 @@ using Mall.Common.API;
using Mall.Common.Enum.Goods; using Mall.Common.Enum.Goods;
using Mall.Common.Plugin; using Mall.Common.Plugin;
using Mall.Model.Extend.Product; using Mall.Model.Extend.Product;
using Mall.Model.Extend.User;
using Mall.Module.Product; using Mall.Module.Product;
using Mall.Module.User;
using Mall.WebApi.Filter; using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
...@@ -31,6 +34,10 @@ namespace Mall.WebApi.Controllers.Reserve ...@@ -31,6 +34,10 @@ namespace Mall.WebApi.Controllers.Reserve
/// </summary> /// </summary>
private readonly OfflineGoodsModule offlineGoodsModule = AOPHelper.CreateAOPObject<OfflineGoodsModule>(); private readonly OfflineGoodsModule offlineGoodsModule = AOPHelper.CreateAOPObject<OfflineGoodsModule>();
private readonly OrderModule orderModule = new OrderModule();
private readonly Module.User.MiniProgramModule programModule = new Module.User.MiniProgramModule();
private readonly UserModule userModule = new UserModule();
/// <summary> /// <summary>
/// 商品后台分页列表 /// 商品后台分页列表
/// </summary> /// </summary>
...@@ -77,6 +84,7 @@ namespace Mall.WebApi.Controllers.Reserve ...@@ -77,6 +84,7 @@ namespace Mall.WebApi.Controllers.Reserve
} }
/// <summary> /// <summary>
/// 商品导出 /// 商品导出
/// </summary> /// </summary>
...@@ -622,5 +630,104 @@ namespace Mall.WebApi.Controllers.Reserve ...@@ -622,5 +630,104 @@ namespace Mall.WebApi.Controllers.Reserve
bool flag = offlineGoodsModule.SetGoodsBatchStatusInfo(GoodsIds, Type, req.TenantId, req.MallBaseId); bool flag = offlineGoodsModule.SetGoodsBatchStatusInfo(GoodsIds, Type, req.TenantId, req.MallBaseId);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
/// <summary>
/// 我的线下服务订单分页列表【小程序】
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOfflineGoodsMyOrderPageList()
{
var parms = RequestParm;
var userInfo = AppletUserInfo;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
RB_Goods_Order_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Order_Extend>(parms.msg.ToString());
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.UserId = userInfo.UserId;
demodel.Recycled = 2;
demodel.OrderClassify = 3;
if (demodel.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitSendGoods)
{
demodel.OrderStatusIds = "2,6";//待处理也是待发货状态才有的
demodel.OrderStatus = 0;
}
var list = orderModule.GetOfflineServiceOrderPageListModule(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
//获取订阅消息
var miniModel = programModule.GetMiniProgramModule(new RB_MiniProgram_Extend { TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId });
List<string> template_message_list = new List<string>();
if (miniModel != null)
{
if (!string.IsNullOrWhiteSpace(miniModel.RefundTpl))
{
template_message_list.Add(miniModel.RefundTpl);
}
if (!string.IsNullOrWhiteSpace(miniModel.OrderCancelTpl))
{
template_message_list.Add(miniModel.OrderCancelTpl);
}
}
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
template_message_list,
x.OrderId,
x.OrderNo,
x.Income,
x.CouponMoney,
x.PaymentWay,
PaymentWayName = x.PaymentWay.GetEnumName(),
DetailList = x.DetailList.Select(y => new
{
y.Id,
y.GoodsId,
y.CoverImagePath,
y.OrderType,
OrderTypeName = y.OrderType.GetEnumName(),
y.GoodsName,
y.ProductCode,
y.Final_Price,
y.Number,
y.IsComment,
y.ServiceDate,
y.ServiceTime,
y.GoodServiceTime,
y.ServicepersonalName
}),
x.OrderStatus,
OrderStatusName = x.OrderStatus.GetEnumName(),
x.TenantId,
x.MallBaseId,
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
x.StoreName,
x.StoresAddress,
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 获取我的订单详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetOfflineOrderInfo()
{
var req = RequestParm;
var userInfo = AppletUserInfo;
JObject parms = JObject.Parse(req.msg.ToString());
int OrderId = parms.GetInt("OrderId", 0);
//HK2020-08-08新增
if (parms.GetInt("NewUserId") > 0)
{
userInfo.UserId = parms.GetInt("NewUserId");
}
if (OrderId <= 0)
{
return ApiResult.ParamIsNull();
}
return orderModule.GetOfflineMyOrderModule(OrderId, userInfo.UserId, userInfo.TenantId, userInfo.MallBaseId);
}
} }
} }
...@@ -8,6 +8,7 @@ using Mall.Common.Enum.Reserve; ...@@ -8,6 +8,7 @@ using Mall.Common.Enum.Reserve;
using Mall.Common.Plugin; using Mall.Common.Plugin;
using Mall.Model.Entity.Product; using Mall.Model.Entity.Product;
using Mall.Model.Entity.Reserve; using Mall.Model.Entity.Reserve;
using Mall.Model.Entity.User;
using Mall.Model.Extend.Reserve; using Mall.Model.Extend.Reserve;
using Mall.Model.Extend.User; using Mall.Model.Extend.User;
using Mall.Module.Reserve; using Mall.Module.Reserve;
...@@ -26,12 +27,14 @@ namespace Mall.WebApi.Controllers.Reserve ...@@ -26,12 +27,14 @@ namespace Mall.WebApi.Controllers.Reserve
[EnableCors("AllowCors")] [EnableCors("AllowCors")]
public class ReserveController : BaseController public class ReserveController : BaseController
{ {
private readonly ReserveModule reserveModule = new ReserveModule(); private readonly ReserveModule reserveModule = new ReserveModule();
private Module.User.UserModule UserModule = new Module.User.UserModule(); private Module.User.UserModule UserModule = new Module.User.UserModule();
/// <summary> /// <summary>
/// 门店处理类对象 /// 门店处理类对象
/// </summary> /// </summary>
private readonly Module.User.ContentModule contentModule = AOPHelper.CreateAOPObject<Module.User.ContentModule>(); private readonly Module.User.ContentModule contentModule = AOPHelper.CreateAOPObject<Module.User.ContentModule>();
/// <summary> /// <summary>
/// 线下服务商品处理类对象 /// 线下服务商品处理类对象
/// </summary> /// </summary>
...@@ -999,7 +1002,7 @@ namespace Mall.WebApi.Controllers.Reserve ...@@ -999,7 +1002,7 @@ namespace Mall.WebApi.Controllers.Reserve
} }
if (day == nowStartTime) if (day == nowStartTime)
{ {
if (isAddTime) if (isAddTime)
...@@ -1031,12 +1034,10 @@ namespace Mall.WebApi.Controllers.Reserve ...@@ -1031,12 +1034,10 @@ namespace Mall.WebApi.Controllers.Reserve
LogHelper.WriteInfo("门店时间转换错误" + ex.ToString()); LogHelper.WriteInfo("门店时间转换错误" + ex.ToString());
} }
} }
return ApiResult.Success("", oldLogisticsModel); return ApiResult.Success("", oldLogisticsModel);
} }
#endregion #endregion
} }
} }
\ No newline at end of file
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