Commit 885b5147 authored by 黄奎's avatar 黄奎

页面修改

parent f071dd20
......@@ -332,5 +332,10 @@ namespace Mall.Model.Extend.Product
#endregion
/// <summary>
/// 服务人员姓名
/// </summary>
public string ServicepersonalName { get; set; }
}
}
......@@ -299,6 +299,16 @@ namespace Mall.Model.Extend.Product
#endregion
/// <summary>
/// 门店名称
/// </summary>
public string StoreName { get; set; }
/// <summary>
/// 门店地址
/// </summary>
public string StoresAddress { get; set; }
}
/// <summary>
......@@ -322,6 +332,5 @@ namespace Mall.Model.Extend.Product
/// 优惠券金额
/// </summary>
public decimal CouponMoney { get; set; }
}
}
......@@ -14,6 +14,11 @@ namespace Mall.Model.Extend.Reserve
[DB(ConnectionName = "DefaultConnection")]
public class RB_Reserve_ServicePersonal_Extend : RB_Reserve_ServicePersonal
{
/// <summary>
/// 服务人员编号【查询使用】
/// </summary>
public string QIds { get; set; }
/// <summary>
/// 标签
/// </summary>
......
......@@ -25,6 +25,7 @@ using Mall.Repository.Finance;
using Mall.Repository.GuideCar;
using Mall.Repository.MarketingCenter;
using Mall.Repository.Product;
using Mall.Repository.Reserve;
using Mall.Repository.User;
using Mall.ThirdCore.Message;
using Microsoft.Extensions.Configuration;
......@@ -317,6 +318,12 @@ namespace Mall.Module.Product
/// 教育对应的订单课程卡
/// </summary>
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();
#region 购物车
/// <summary>
......@@ -8456,27 +8463,22 @@ namespace Mall.Module.Product
//剑鱼兄需求 2020=07-30 再查询一次商品表
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 teacherList = goodsWKTeacherRepository.GetList(new RB_Goods_WK_Teacher_Extend { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, GoodsIds = GoodsIds });
//查询订单详情对应的课程卡信息
string educationCouponIds = string.Join(",", dlist.Where(x => x.EducationCouponId > 0).Select(x => x.EducationCouponId).Distinct());
List<RB_Education_MemberCoupon_Extend> educationCouponList = new List<RB_Education_MemberCoupon_Extend>();
if (!string.IsNullOrWhiteSpace(educationCouponIds))
//获取服务人员
string persionIds= string.Join(",", dlist.Select(x => x.ServicepersonalId).Distinct());
var persionList = reserve_ServicePersonalRepository.GetServicePersonalList(new Model.Extend.Reserve.RB_Reserve_ServicePersonal_Extend()
{
educationCouponList = educationMemberCouponRepository.GetList(new RB_Education_MemberCoupon_Extend { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, Ids = educationCouponIds });
}
QIds = persionIds
});
foreach (var item in dlist)
{
item.CoverImagePath = item.CoverImage;
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.TeacherList = teacherList.Where(x => x.GoodsId == item.GoodsId).ToList();// 2020-10-11 订单对应的老师
item.MemberEducationCouponList = educationCouponList.Where(x => x.Id == item.EducationCouponId).ToList();// 2020-10-11 订单详情对应的课程卡
item.ServicepersonalName = persionList?.Where(qitem => qitem.ID == item.ServicepersonalId)?.FirstOrDefault()?.Name ?? "";
}
}
//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>();
if (list.Any(x => !string.IsNullOrWhiteSpace(x.CouponsIds)))
{
......@@ -8489,7 +8491,6 @@ 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()));
......
......@@ -3546,7 +3546,7 @@ namespace Mall.Module.Product
var storeDateModel = new StoreReserveDate()
{
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))),
TimeList = new List<string>()
};
......
......@@ -2209,11 +2209,13 @@ where {where} group by o.OrderId order by o.CreateDate desc";
}
string sql = $@"
SELECT o.*,u.Name as UserName,sshop.`Name` as SmallShopsName FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
INNER JOIN rb_member_user u on o.UserId=u.Id
LEFT JOIN rb_smallshops_info as sshop on o.SmallShopsId=sshop.Id
where {where} group by o.OrderId order by o.CreateDate desc ";
SELECT o.*,u.Name as UserName,sshop.`Name` as SmallShopsName,s.`Name` AS StoreName,s.Address AS StoresAddress
FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
INNER JOIN rb_member_user u on o.UserId=u.Id
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();
}
#endregion
......
......@@ -228,6 +228,10 @@ ORDER BY t.orderNum desc ";
{
builder.Append($" AND a.{nameof(RB_Reserve_ServicePersonal_Extend.Name)} like '%{query.Name}%'");
}
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");
return Get<RB_Reserve_ServicePersonal_Extend>(builder.ToString()).ToList();
......
......@@ -64,10 +64,6 @@ namespace Mall.WebApi.Controllers.Reserve
JObject parm = JObject.Parse(parms.msg.ToString());
var position = parm.GetStringValue("position");
int storeId = parm.GetInt("storeId");
if (userInfo == null)
{
userInfo = new Common.AppletUserInfo() { UserId = 106259 };
}
var storeModel = contentModule.GetStoresListModule(new RB_Stores_Extend()
{
CurrentPosition = position,
......
......@@ -7,8 +7,11 @@ using Mall.Common.API;
using Mall.Common.Enum.Goods;
using Mall.Common.Plugin;
using Mall.Model.Extend.Product;
using Mall.Model.Extend.User;
using Mall.Module.Product;
using Mall.Module.User;
using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
......@@ -31,6 +34,10 @@ namespace Mall.WebApi.Controllers.Reserve
/// </summary>
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>
......@@ -77,6 +84,7 @@ namespace Mall.WebApi.Controllers.Reserve
}
/// <summary>
/// 商品导出
/// </summary>
......@@ -622,5 +630,91 @@ namespace Mall.WebApi.Controllers.Reserve
bool flag = offlineGoodsModule.SetGoodsBatchStatusInfo(GoodsIds, Type, req.TenantId, req.MallBaseId);
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>
public ApiResult GetOfflineOrderInfo()
{
return ApiResult.Failed();
}
}
}
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