Commit 70693ca3 authored by liudong1993's avatar liudong1993

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

parents 208134d3 6c6618d1
......@@ -87,18 +87,6 @@ namespace Mall.Model.Entity.Product
/// </summary>
public int? CommentScore { get; set; }
/// <summary>
/// 评分 1-5分
/// </summary>
public int? GuideScore { get; set; }
/// <summary>
/// 评分 1-5分
/// </summary>
public int? CarScore { get; set; }
/// <summary>
/// 评论内容
......
......@@ -38,15 +38,11 @@ namespace Mall.Model.Extend.Product
/// </summary>
public int CommentNum { get; set; }
/// <summary>
/// 评论总分
/// </summary>
public decimal TotalCarScore { get; set; }
/// <summary>
/// 评论总分
/// </summary>
public decimal TotalGuideScore { get; set; }
public decimal TotalScore { get; set; }
}
}
......@@ -243,5 +243,72 @@ namespace Mall.Model.Extend.Product
/// </summary>
public int FinanceCreateBy { get; set; }
#region 司导信息
/// <summary>
/// 站点名称
/// </summary>
public string SiteName { get; set; }
/// <summary>
/// 导游名称
/// </summary>
public string GuideName { get; set; }
/// <summary>
/// 从业年限
/// </summary>
public decimal GuideWorkYears { get; set; }
/// <summary>
/// 用户评分
/// </summary>
public decimal GuideScore { get; set; }
/// <summary>
/// 联系电话
/// </summary>
public string GuideTelephone { get; set; }
/// <summary>
/// 头像
/// </summary>
public string GuidePhoto { get; set; }
/// <summary>
/// 车辆名称
/// </summary>
public string CarName { get; set; }
/// <summary>
/// 车辆颜色
/// </summary>
public string CarColorName { get; set; }
/// <summary>
/// 车辆类型
/// </summary>
public int? CarClass { get; set; }
/// <summary>
/// 车辆品牌
/// </summary>
public string CarBrandName { get; set; }
/// <summary>
/// 乘坐人数
/// </summary>
public int RideNum { get; set; }
/// <summary>
/// 车辆类型
/// </summary>
public string GuideCarType { get; set; }
#endregion
}
}
This diff is collapsed.
......@@ -173,7 +173,7 @@ where {where} order by c.Id desc";
{
where += $@" and c.{nameof(RB_Goods_Comment.GuideId)}={guideId}";
}
string sql = $@"SELECT COUNT(0) as CommentNum,SUM(c.CarScore) as TotalCarScore,SUM(c.GuideScore) as TotalGuideScore FROM RB_Goods_Comment c
string sql = $@"SELECT COUNT(0) as CommentNum,SUM(c.CommentScore) as TotalScore FROM RB_Goods_Comment c
where {where} ";
return Get<RB_Goods_Comment_Extend>(sql).ToList();
}
......
......@@ -587,5 +587,68 @@ left join rb_goods_order o on a.OrderId = o.OrderId
where {where} order by a.Id desc";
return GetPage<RB_Goods_OrderDetail_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
/// <summary>
/// 获取司导订单明细列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_OrderDetail_Extend> GetGuideCarOrderDetailList(RB_Goods_OrderDetail_Extend dmodel)
{
string where = $" 1=1 ";
if (dmodel.TenantId > 0)
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.OrderDetailIds))
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.Id)} in({dmodel.OrderDetailIds})";
}
if (dmodel.OrderId > 0)
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderId)}={dmodel.OrderId}";
}
if (dmodel.OrderType > 0)
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderType)}={(int)dmodel.OrderType}";
}
if (dmodel.IsComment > 0)
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.IsComment)}={(int)dmodel.IsComment}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsName))
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
}
if (!string.IsNullOrEmpty(dmodel.ProductCode))
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
}
if (!string.IsNullOrEmpty(dmodel.OrderIds))
{
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderId)} in({dmodel.OrderIds})";
}
string sql = $@"SELECT a.*,b.`Name` as SupplierName,e.`Name` as CarName,e.CarType as GuideCarType,e.CarClass,f.ColorName as CarColorName,cb.`Name` as CarBrandName,g.RideNum,gcg.Name as GuideName,gcg.GuidePhoto,gcg.WorkYears as GuideWorkYears,gcg.Score as GuideScore,gcg.Telephone as GuideTelephone FROM rb_goods_orderdetail as a
LEFT JOIN rb_supplier as b on a.SupplierId=b.ID
LEFT JOIN rb_guidecar_car as e on e.ID=a.CarId
LEFT JOIN rb_guidecar_carbrand as cb on e.CarBrandId=cb.ID
LEFT JOIN rb_guidecar_carcolor as f on f.ID=a.CarColorId
LEFT JOIN rb_guidecar_guide as gcg on gcg.ID=a.GuideId
LEFT JOIN rb_goods as g on g.ID=a.GoodsId
where {where} order by a.Id asc";
return Get<RB_Goods_OrderDetail_Extend>(sql).ToList();
}
}
}
......@@ -1586,10 +1586,10 @@ where {where} group by o.OrderId order by o.CreateDate desc";
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_Order_Extend> GetGuidecarOrderPageList(int pageIndex, int pageSize, out long count, RB_Goods_Order_Extend dmodel)
public List<RB_Goods_Order_Extend> GetGuideCarOrderPageList(int pageIndex, int pageSize, out long count, RB_Goods_Order_Extend dmodel)
{
var parameters = new DynamicParameters();
string where = $" 1=1 and o.{nameof(RB_Goods_Order.Status)}=0";
string where = $" 1=1 and o.{nameof(RB_Goods_Order.Status)}=0 and o.{nameof(RB_Goods_Order.OrderClassify)}=1";
if (dmodel.TenantId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.TenantId)}={dmodel.TenantId}";
......
......@@ -98,31 +98,32 @@ namespace Mall.WebApi.Controllers.Product
{
var req = RequestParm;
var userInfo = AppletUserInfo;
RB_Goods_Comment_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Comment_Extend>(req.msg.ToString());
if ((demodel.OrderDetailId ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请传递订单明细OrderDetailId");
}
if ((demodel.GoodsId ?? 0) <= 0)
List<RB_Goods_Comment_Extend> list = JsonConvert.DeserializeObject<List<RB_Goods_Comment_Extend>>(req.msg.ToString());
if (list != null && list.Any())
{
return ApiResult.ParamIsNull("请传递商品");
}
if ((demodel.GuideId ?? 0) <= 0)
if (list.Where(x => (x.GuideId ?? 0) > 0).Count() == 0)
{
return ApiResult.ParamIsNull("请传递导游");
}
if ((demodel.CarId ?? 0) <= 0)
if (list.Where(x => (x.CarId ?? 0) > 0).Count() == 0)
{
return ApiResult.ParamIsNull("请传递车辆");
}
if ((demodel.GuideScore ?? 0) <= 0)
}
else
{
return ApiResult.ParamIsNull("请您对导游评分");
return ApiResult.ParamIsNull("请选择您要评论的信息");
}
if ((demodel.CarScore ?? 0) <= 0)
foreach (var demodel in list)
{
return ApiResult.ParamIsNull("请您对车辆评分");
if ((demodel.OrderDetailId ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请传递订单明细OrderDetailId");
}
if ((demodel.GoodsId ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请传递商品");
}
if (string.IsNullOrEmpty(demodel.Content))
{
......@@ -143,7 +144,6 @@ namespace Mall.WebApi.Controllers.Product
{
demodel.CommentGrade = Common.Enum.Goods.GoodsCommentTypeEnum.Negative;
}
demodel.UserPhoto ??= 0;
demodel.Is_Top ??= 2;
demodel.Is_Show ??= 1;
......@@ -158,8 +158,9 @@ namespace Mall.WebApi.Controllers.Product
demodel.Status = 0;
demodel.CreateDate = DateTime.Now;
demodel.UpdateDate = DateTime.Now;
}
bool flag = guideCarModule.SetGoodsCommentInfo(demodel);
bool flag = guideCarModule.SetGoodsCommentInfo(list);
if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); }
}
......@@ -187,7 +188,7 @@ namespace Mall.WebApi.Controllers.Product
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppletGoodsMyOrderPageList()
public ApiResult GetAppletGoodsGuidecarOrderPageList()
{
var parms = RequestParm;
var userInfo = AppletUserInfo;
......@@ -203,6 +204,8 @@ namespace Mall.WebApi.Controllers.Product
demodel.OrderStatusIds = "2,6";//待处理也是待发货状态才有的
demodel.OrderStatus = 0;
}
// demodel.OrderType = 11;//固定变成11,司导订单
demodel.OrderClassify = 1;
var list = guideCarModule.GetAppletGoodsMyOrderPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
//获取订阅消息
var miniModel = programModule.GetMiniProgramModule(new RB_MiniProgram_Extend { TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId });
......@@ -246,20 +249,51 @@ namespace Mall.WebApi.Controllers.Product
y.ProductCode,
y.Final_Price,
y.Number,
y.UseDay,
y.IsSpell,
y.CarNumber,
y.LineName,
y.IsComment,
TripSTime = y.TripSTime.HasValue ? y.TripSTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
TripETime = y.TripETime.HasValue ? y.TripETime.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
}),
x.OrderStatus,
OrderStatusName = x.OrderStatus.GetEnumName(),
OrderStatusName = ((GuidCarOrderStatusEnum)x.OrderStatus).GetEnumName(),
x.GuideName,
x.GuidePhoto,
x.GuideTelephone,
x.TenantId,
x.MallBaseId,
x.PresentFXGrade,
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 获取我的订单详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppletGuidecarOrderOrderInfo()
{
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 guideCarModule.GetAppletMyOrderInfo(OrderId, userInfo.UserId, userInfo.TenantId, userInfo.MallBaseId);
}
#endregion
}
......
......@@ -1521,35 +1521,36 @@ namespace Mall.WebApi.Controllers.MallBase
public ApiResult SetGuideCarCommentInfo()
{
var req = RequestParm;
RB_Goods_Comment_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Comment_Extend>(req.msg.ToString());
if (string.IsNullOrEmpty(demodel.UserName))
List<RB_Goods_Comment_Extend> list = JsonConvert.DeserializeObject<List<RB_Goods_Comment_Extend>>(req.msg.ToString());
if (list != null && list.Any())
{
return ApiResult.ParamIsNull("请输入用户名称");
}
if (!demodel.CreateDate.HasValue)
if (list.Where(x => (x.GuideId ?? 0) > 0).Count() == 0)
{
return ApiResult.ParamIsNull("请输入评论时间");
return ApiResult.ParamIsNull("请传递导游");
}
if ((demodel.GoodsId ?? 0) <= 0)
if (list.Where(x => (x.CarId ?? 0) > 0).Count() == 0)
{
return ApiResult.ParamIsNull("请选择商品");
return ApiResult.ParamIsNull("请传递车辆");
}
if ((demodel.GuideId ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请选择导游");
}
if ((demodel.CarId ?? 0) <= 0)
else {
return ApiResult.ParamIsNull("请传递您要评论的信息");
}
foreach (var demodel in list)
{
if (string.IsNullOrEmpty(demodel.UserName))
{
return ApiResult.ParamIsNull("请选择车辆");
return ApiResult.ParamIsNull("请输入用户名称");
}
if ((demodel.GuideScore ?? 0) <= 0)
if (!demodel.CreateDate.HasValue)
{
return ApiResult.ParamIsNull("请您对导游评分");
return ApiResult.ParamIsNull("请输入评论时间");
}
if ((demodel.CarScore ?? 0) <= 0)
if ((demodel.GoodsId ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请您对车辆评分");
return ApiResult.ParamIsNull("请选择商品");
}
if (string.IsNullOrEmpty(demodel.Content))
{
......@@ -1571,13 +1572,14 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.Is_Anonymity ??= 2;
demodel.UserId ??= 0;
demodel.Reply ??= "";
demodel.TenantId = req.TenantId;
demodel.MallBaseId = req.MallBaseId;
demodel.Status = 0;
demodel.UpdateDate = DateTime.Now;
bool flag = guideCarModule.SetGoodsCommentInfo(demodel);
}
bool flag = guideCarModule.SetGoodsCommentInfo(list);
if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); }
}
#endregion
......
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