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 ...@@ -87,18 +87,6 @@ namespace Mall.Model.Entity.Product
/// </summary> /// </summary>
public int? CommentScore { get; set; } public int? CommentScore { get; set; }
/// <summary>
/// 评分 1-5分
/// </summary>
public int? GuideScore { get; set; }
/// <summary>
/// 评分 1-5分
/// </summary>
public int? CarScore { get; set; }
/// <summary> /// <summary>
/// 评论内容 /// 评论内容
......
...@@ -38,15 +38,11 @@ namespace Mall.Model.Extend.Product ...@@ -38,15 +38,11 @@ namespace Mall.Model.Extend.Product
/// </summary> /// </summary>
public int CommentNum { get; set; } public int CommentNum { get; set; }
/// <summary>
/// 评论总分
/// </summary>
public decimal TotalCarScore { get; set; }
/// <summary> /// <summary>
/// 评论总分 /// 评论总分
/// </summary> /// </summary>
public decimal TotalGuideScore { get; set; } public decimal TotalScore { get; set; }
} }
} }
...@@ -243,5 +243,72 @@ namespace Mall.Model.Extend.Product ...@@ -243,5 +243,72 @@ namespace Mall.Model.Extend.Product
/// </summary> /// </summary>
public int FinanceCreateBy { get; set; } 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"; ...@@ -173,7 +173,7 @@ where {where} order by c.Id desc";
{ {
where += $@" and c.{nameof(RB_Goods_Comment.GuideId)}={guideId}"; 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} "; where {where} ";
return Get<RB_Goods_Comment_Extend>(sql).ToList(); return Get<RB_Goods_Comment_Extend>(sql).ToList();
} }
......
...@@ -587,5 +587,68 @@ left join rb_goods_order o on a.OrderId = o.OrderId ...@@ -587,5 +587,68 @@ left join rb_goods_order o on a.OrderId = o.OrderId
where {where} order by a.Id desc"; where {where} order by a.Id desc";
return GetPage<RB_Goods_OrderDetail_Extend>(pageIndex, pageSize, out count, sql).ToList(); 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"; ...@@ -1586,10 +1586,10 @@ where {where} group by o.OrderId order by o.CreateDate desc";
/// <param name="count"></param> /// <param name="count"></param>
/// <param name="dmodel"></param> /// <param name="dmodel"></param>
/// <returns></returns> /// <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(); 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) if (dmodel.TenantId > 0)
{ {
where += $@" and o.{nameof(RB_Goods_Order.TenantId)}={dmodel.TenantId}"; where += $@" and o.{nameof(RB_Goods_Order.TenantId)}={dmodel.TenantId}";
......
...@@ -98,68 +98,69 @@ namespace Mall.WebApi.Controllers.Product ...@@ -98,68 +98,69 @@ namespace Mall.WebApi.Controllers.Product
{ {
var req = RequestParm; var req = RequestParm;
var userInfo = AppletUserInfo; var userInfo = AppletUserInfo;
RB_Goods_Comment_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Comment_Extend>(req.msg.ToString()); List<RB_Goods_Comment_Extend> list = JsonConvert.DeserializeObject<List<RB_Goods_Comment_Extend>>(req.msg.ToString());
if ((demodel.OrderDetailId ?? 0) <= 0) if (list != null && list.Any())
{ {
return ApiResult.ParamIsNull("请传递订单明细OrderDetailId");
}
if ((demodel.GoodsId ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请传递商品");
}
if ((demodel.GuideId ?? 0) <= 0) if (list.Where(x => (x.GuideId ?? 0) > 0).Count() == 0)
{ {
return ApiResult.ParamIsNull("请传递导游"); return ApiResult.ParamIsNull("请传递导游");
} }
if ((demodel.CarId ?? 0) <= 0) if (list.Where(x => (x.CarId ?? 0) > 0).Count() == 0)
{ {
return ApiResult.ParamIsNull("请传递车辆"); return ApiResult.ParamIsNull("请传递车辆");
} }
if ((demodel.GuideScore ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请您对导游评分");
}
if ((demodel.CarScore ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请您对车辆评分");
}
if (string.IsNullOrEmpty(demodel.Content))
{
return ApiResult.ParamIsNull("请输入评价内容");
}
demodel.CommentImage = "";
if (demodel.CommentImgList != null && demodel.CommentImgList.Any())
{
demodel.CommentImage = JsonConvert.SerializeObject(demodel.CommentImgList);
} }
demodel.CommentGrade ??= Common.Enum.Goods.GoodsCommentTypeEnum.Praise; else
demodel.CommentScore ??= 5;
if (demodel.CommentScore == 3 || demodel.CommentScore == 2)
{ {
demodel.CommentGrade = Common.Enum.Goods.GoodsCommentTypeEnum.Medium; return ApiResult.ParamIsNull("请选择您要评论的信息");
} }
else if (demodel.CommentScore == 1) foreach (var demodel in list)
{ {
demodel.CommentGrade = Common.Enum.Goods.GoodsCommentTypeEnum.Negative; if ((demodel.OrderDetailId ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请传递订单明细OrderDetailId");
}
if ((demodel.GoodsId ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请传递商品");
}
if (string.IsNullOrEmpty(demodel.Content))
{
return ApiResult.ParamIsNull("请输入评价内容");
}
demodel.CommentImage = "";
if (demodel.CommentImgList != null && demodel.CommentImgList.Any())
{
demodel.CommentImage = JsonConvert.SerializeObject(demodel.CommentImgList);
}
demodel.CommentGrade ??= Common.Enum.Goods.GoodsCommentTypeEnum.Praise;
demodel.CommentScore ??= 5;
if (demodel.CommentScore == 3 || demodel.CommentScore == 2)
{
demodel.CommentGrade = Common.Enum.Goods.GoodsCommentTypeEnum.Medium;
}
else if (demodel.CommentScore == 1)
{
demodel.CommentGrade = Common.Enum.Goods.GoodsCommentTypeEnum.Negative;
}
demodel.UserPhoto ??= 0;
demodel.Is_Top ??= 2;
demodel.Is_Show ??= 1;
demodel.Is_Anonymity ??= 2;
demodel.UserId ??= 0;
demodel.Reply ??= "";
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.UserId = userInfo.UserId;
demodel.UserName = userInfo.Name;
demodel.PlatformSource = userInfo.Source;
demodel.Status = 0;
demodel.CreateDate = DateTime.Now;
demodel.UpdateDate = DateTime.Now;
} }
demodel.UserPhoto ??= 0; bool flag = guideCarModule.SetGoodsCommentInfo(list);
demodel.Is_Top ??= 2;
demodel.Is_Show ??= 1;
demodel.Is_Anonymity ??= 2;
demodel.UserId ??= 0;
demodel.Reply ??= "";
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.UserId = userInfo.UserId;
demodel.UserName = userInfo.Name;
demodel.PlatformSource = userInfo.Source;
demodel.Status = 0;
demodel.CreateDate = DateTime.Now;
demodel.UpdateDate = DateTime.Now;
bool flag = guideCarModule.SetGoodsCommentInfo(demodel);
if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); } if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); }
} }
...@@ -187,7 +188,7 @@ namespace Mall.WebApi.Controllers.Product ...@@ -187,7 +188,7 @@ namespace Mall.WebApi.Controllers.Product
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult GetAppletGoodsMyOrderPageList() public ApiResult GetAppletGoodsGuidecarOrderPageList()
{ {
var parms = RequestParm; var parms = RequestParm;
var userInfo = AppletUserInfo; var userInfo = AppletUserInfo;
...@@ -203,6 +204,8 @@ namespace Mall.WebApi.Controllers.Product ...@@ -203,6 +204,8 @@ namespace Mall.WebApi.Controllers.Product
demodel.OrderStatusIds = "2,6";//待处理也是待发货状态才有的 demodel.OrderStatusIds = "2,6";//待处理也是待发货状态才有的
demodel.OrderStatus = 0; demodel.OrderStatus = 0;
} }
// demodel.OrderType = 11;//固定变成11,司导订单
demodel.OrderClassify = 1;
var list = guideCarModule.GetAppletGoodsMyOrderPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel); 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 }); var miniModel = programModule.GetMiniProgramModule(new RB_MiniProgram_Extend { TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId });
...@@ -246,20 +249,51 @@ namespace Mall.WebApi.Controllers.Product ...@@ -246,20 +249,51 @@ namespace Mall.WebApi.Controllers.Product
y.ProductCode, y.ProductCode,
y.Final_Price, y.Final_Price,
y.Number, y.Number,
y.UseDay,
y.IsSpell,
y.CarNumber,
y.LineName,
y.IsComment, y.IsComment,
TripSTime = y.TripSTime.HasValue ? y.TripSTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "", 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") : "" TripETime = y.TripETime.HasValue ? y.TripETime.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
}), }),
x.OrderStatus, x.OrderStatus,
OrderStatusName = x.OrderStatus.GetEnumName(), OrderStatusName = ((GuidCarOrderStatusEnum)x.OrderStatus).GetEnumName(),
x.GuideName,
x.GuidePhoto,
x.GuideTelephone,
x.TenantId, x.TenantId,
x.MallBaseId, x.MallBaseId,
x.PresentFXGrade,
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") : ""
}); });
return ApiResult.Success("", pagelist); 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 #endregion
} }
......
...@@ -1521,63 +1521,65 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1521,63 +1521,65 @@ namespace Mall.WebApi.Controllers.MallBase
public ApiResult SetGuideCarCommentInfo() public ApiResult SetGuideCarCommentInfo()
{ {
var req = RequestParm; var req = RequestParm;
RB_Goods_Comment_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Comment_Extend>(req.msg.ToString()); List<RB_Goods_Comment_Extend> list = JsonConvert.DeserializeObject<List<RB_Goods_Comment_Extend>>(req.msg.ToString());
if (string.IsNullOrEmpty(demodel.UserName))
{
return ApiResult.ParamIsNull("请输入用户名称");
}
if (!demodel.CreateDate.HasValue)
{
return ApiResult.ParamIsNull("请输入评论时间");
}
if ((demodel.GoodsId ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请选择商品");
}
if ((demodel.GuideId ?? 0) <= 0) if (list != null && list.Any())
{
return ApiResult.ParamIsNull("请选择导游");
}
if ((demodel.CarId ?? 0) <= 0)
{ {
return ApiResult.ParamIsNull("请选择车辆");
} if (list.Where(x => (x.GuideId ?? 0) > 0).Count() == 0)
if ((demodel.GuideScore ?? 0) <= 0) {
{ return ApiResult.ParamIsNull("请传递导游");
return ApiResult.ParamIsNull("请您对导游评分"); }
} if (list.Where(x => (x.CarId ?? 0) > 0).Count() == 0)
if ((demodel.CarScore ?? 0) <= 0) {
{ return ApiResult.ParamIsNull("请传递车辆");
return ApiResult.ParamIsNull("请您对车辆评分"); }
}
if (string.IsNullOrEmpty(demodel.Content))
{
return ApiResult.ParamIsNull("请输入评价内容");
} }
if (!demodel.CommentGrade.HasValue) else {
{ return ApiResult.ParamIsNull("请传递您要评论的信息");
return ApiResult.ParamIsNull("请选择评分");
} }
demodel.CommentScore ??= 5; foreach (var demodel in list)
demodel.CommentImage = "";
if (demodel.CommentImgList != null && demodel.CommentImgList.Any())
{ {
demodel.CommentImage = JsonConvert.SerializeObject(demodel.CommentImgList); if (string.IsNullOrEmpty(demodel.UserName))
} {
demodel.UserPhoto ??= 0; return ApiResult.ParamIsNull("请输入用户名称");
demodel.Is_Top ??= 2; }
demodel.Is_Show ??= 1; if (!demodel.CreateDate.HasValue)
demodel.Is_Anonymity ??= 2; {
demodel.UserId ??= 0; return ApiResult.ParamIsNull("请输入评论时间");
demodel.Reply ??= ""; }
if ((demodel.GoodsId ?? 0) <= 0)
{
return ApiResult.ParamIsNull("请选择商品");
}
if (string.IsNullOrEmpty(demodel.Content))
{
return ApiResult.ParamIsNull("请输入评价内容");
}
if (!demodel.CommentGrade.HasValue)
{
return ApiResult.ParamIsNull("请选择评分");
}
demodel.CommentScore ??= 5;
demodel.CommentImage = "";
if (demodel.CommentImgList != null && demodel.CommentImgList.Any())
{
demodel.CommentImage = JsonConvert.SerializeObject(demodel.CommentImgList);
}
demodel.UserPhoto ??= 0;
demodel.Is_Top ??= 2;
demodel.Is_Show ??= 1;
demodel.Is_Anonymity ??= 2;
demodel.UserId ??= 0;
demodel.Reply ??= "";
demodel.TenantId = req.TenantId;
demodel.MallBaseId = req.MallBaseId;
demodel.Status = 0;
demodel.UpdateDate = DateTime.Now;
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(); } if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); }
} }
#endregion #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