Commit 7185f65a authored by liudong1993's avatar liudong1993

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

parents 29fba29b 2afba2e5
......@@ -78,6 +78,8 @@ namespace Mall.Model.Entity.User
get;
set;
}
/// <summary>
/// 退款费用
/// </summary>
......@@ -98,6 +100,16 @@ namespace Mall.Model.Entity.User
/// 运杂费用id
/// </summary>
public int? ExpensesCostTypeId { get; set; }
/// <summary>
/// 保险成本费用
/// </summary>
public int? InsuranceCostTypeId
{
get;
set;
}
/// <summary>
/// RemitCostTypeId
/// </summary>
......
......@@ -113,5 +113,9 @@ namespace Mall.Model.Entity.Finance
set;
}
/// <summary>
/// 保险成本价格
/// </summary>
public decimal? InsuranceCostMoney { get; set; }
}
}
......@@ -216,6 +216,11 @@ namespace Mall.Model.Entity.Product
/// </summary>
public int FreightFinanceId { get; set; }
/// <summary>
/// 保险成本单据id
/// </summary>
public int InsuranceFinanceId { get; set; }
/// <summary>
/// 积分赠送
/// </summary>
......
......@@ -159,7 +159,7 @@ namespace Mall.Model.Extend.Product
/// <summary>
/// 1-商品,2-运费
/// 1-商品,2-运费,3-保险
/// </summary>
public int FinanceType { get; set; }
#endregion
......@@ -192,10 +192,16 @@ namespace Mall.Model.Extend.Product
/// <summary>
/// 是否查询所有,0-全部,1-成本,2-运费
/// 是否查询所有,0-全部,1-成本,2-运费,3-保险成本
/// </summary>
public int IsSelectAll { get; set; }
/// <summary>
/// 订单分类 0正常订单 1司导订单
/// </summary>
public int OrderClassify { get; set; }
/// <summary>
/// 规格key(出库的规格),没有修改为
/// </summary>
......
......@@ -1711,7 +1711,7 @@ namespace Mall.Module.Product
string SiteName = SiteRepository.GetGuideCarSiteList(new RB_GuideCar_Site_Extend() { ID = model.SiteId ?? 0 }).FirstOrDefault()?.SiteName ?? "";
var guideModel = GuideRepository.GetGuideCarGuideList(new RB_GuideCar_Guide_Extend() { ID = model.GuideId ?? 0 }).FirstOrDefault();
model.GuideName = guideModel?.Name ?? "";
model.GuidePhoto= guideModel?.GuidePhoto ?? "";
model.GuidePhoto = guideModel?.GuidePhoto ?? "";
model.GuideScore = guideModel?.Score ?? 5;
model.Introduction = guideModel?.Introduction ?? "";
model.GuideWorkYears = guideModel?.WorkYears ?? 1;
......@@ -2383,7 +2383,7 @@ namespace Mall.Module.Product
date_enable = false;
}
var targetModel = targetList.FirstOrDefault();
if (targetModel.ReserveNum + (item.Number ?? 0) > (gmodel.RideNum ?? 0))
if (targetModel.ReserveNum + (item.Number ?? 0) > (gmodel.RideNum ?? 0))
{
date_enable = false;
}
......@@ -2964,6 +2964,17 @@ namespace Mall.Module.Product
return flag;
}
/// <summary>
/// 获取站点地区列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_GuideCar_SiteRegion_Extend> GetListRepository(RB_GuideCar_SiteRegion_Extend query)
{
return SiteRegionRepository.GetListRepository(query);
}
#endregion
#region 导游信息
......@@ -3552,7 +3563,91 @@ namespace Mall.Module.Product
decimal carScore = 0;
if (carScoreList != null && carScoreList.Any())
{
carScore = (carScoreList.FirstOrDefault().TotalScore + (Convert.ToDecimal(list.Where(x => x.CarId == dmodel.CarId).FirstOrDefault().CommentScore ?? 0))) / (carScoreList.FirstOrDefault().CommentNum + 1);
carScore = carScoreList.FirstOrDefault().TotalScore / carScoreList.FirstOrDefault().CommentNum;
//carScore = (carScoreList.FirstOrDefault().TotalScore + (Convert.ToDecimal(list.Where(x => x.CarId == dmodel.CarId).FirstOrDefault().CommentScore ?? 0))) / (carScoreList.FirstOrDefault().CommentNum + 1);
}
else
{
carScore = Convert.ToDecimal(list.Where(x => x.CarId == dmodel.CarId).FirstOrDefault().CommentScore);
}
if (carScore > 0)//更新车辆的评分
{
//更新订单商品为已评价
Dictionary<string, object> keyValuesCar = new Dictionary<string, object>() {
{ nameof(RB_GuideCar_Car.Score),Math.Round(carScore,1, MidpointRounding.AwayFromZero)}
};
List<WhereHelper> wheresCar = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_GuideCar_Car.ID),
FiledValue=dmodel.CarId,
OperatorEnum=OperatorEnum.Equal
}
};
GuideCarRepository.Update(keyValuesCar, wheresCar);
}
}
if (dmodel.GuideId.HasValue && dmodel.GuideId.Value > 0)
{
decimal guidScore = 0;
var guideScoreList = goods_CommentRepository.GetAppletGoodsCommentscore(0, dmodel.GuideId.Value, dmodel.TenantId, dmodel.MallBaseId);
if (guideScoreList != null && guideScoreList.Any())
{
guidScore = guideScoreList.FirstOrDefault().TotalScore / guideScoreList.FirstOrDefault().CommentNum;
//guidScore = (guideScoreList.FirstOrDefault().TotalScore + (Convert.ToDecimal(list.Where(x => x.GuideId == dmodel.GuideId).FirstOrDefault().CommentScore ?? 0))) / (guideScoreList.FirstOrDefault().CommentNum + 1);
}
else
{
guidScore = Convert.ToDecimal(list.Where(x => x.GuideId == dmodel.GuideId).FirstOrDefault().CommentScore);
}
if (guidScore > 0)//更新车辆的评分
{
//更新订单商品为已评价
Dictionary<string, object> keyValuesCar = new Dictionary<string, object>() {
{ nameof(RB_GuideCar_Guide.Score),Math.Round(guidScore,1, MidpointRounding.AwayFromZero)}
};
List<WhereHelper> wheresCar = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_GuideCar_Guide.ID),
FiledValue=dmodel.GuideId,
OperatorEnum=OperatorEnum.Equal
}
};
GuideRepository.Update(keyValuesCar, wheresCar);
}
}
}
}
return flag;
}
/// <summary>
/// 管理新增评论
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public bool SetGoodsCommentInfo_V2(List<RB_Goods_Comment_Extend> list)
{
RB_Goods_OrderDetail dmodel = new RB_Goods_OrderDetail();
dmodel.CarId = list.Where(x => x.CarId > 0).FirstOrDefault()?.CarId;
dmodel.GuideId = list.Where(x => x.GuideId > 0).FirstOrDefault()?.GuideId;
dmodel.TenantId = list.FirstOrDefault()?.TenantId ?? 0;
dmodel.MallBaseId = list.FirstOrDefault()?.MallBaseId ?? 0;
bool flag = goods_CommentRepository.InsertBatch(list);
if (flag)
{
if (list.FirstOrDefault().OrderDetailId > 0)
{
//更新订单对应对应的车辆和导游评分
//先查找已评论的车辆信息
if (dmodel.CarId.HasValue && dmodel.CarId.Value > 0)
{
var carScoreList = goods_CommentRepository.GetAppletGoodsCommentscore(dmodel.CarId.Value, 0, dmodel.TenantId, dmodel.MallBaseId);
decimal carScore = 0;
if (carScoreList != null && carScoreList.Any())
{
carScore = carScoreList.FirstOrDefault().TotalScore / carScoreList.FirstOrDefault().CommentNum;
}
else
{
......@@ -3580,7 +3675,7 @@ namespace Mall.Module.Product
var guideScoreList = goods_CommentRepository.GetAppletGoodsCommentscore(0, dmodel.GuideId.Value, dmodel.TenantId, dmodel.MallBaseId);
if (guideScoreList != null && guideScoreList.Any())
{
guidScore = (guideScoreList.FirstOrDefault().TotalScore + (Convert.ToDecimal(list.Where(x => x.GuideId == dmodel.GuideId).FirstOrDefault().CommentScore ?? 0))) / (guideScoreList.FirstOrDefault().CommentNum + 1);
guidScore = guideScoreList.FirstOrDefault().TotalScore / guideScoreList.FirstOrDefault().CommentNum;
}
else
{
......@@ -3801,14 +3896,15 @@ namespace Mall.Module.Product
var list = goods_CommentRepository.GetGoodsDetailPageList(pageIndex, pageSize, out count, dmodel);
if (list != null && list.Any())
{
string goodsIds = string.Join(",", list.Select(x => x.GoodsId));
string orderDetailIds = string.Join(",", list.Select(x => x.OrderDetailId));
var carCommentList = goods_CommentRepository.GetCarCommentByOrderDetailId(orderDetailIds, dmodel.TenantId, dmodel.MallBaseId);
var carCommentList = goods_CommentRepository.GetCarCommentByOrderDetailId(orderDetailIds, goodsIds, dmodel.TenantId, dmodel.MallBaseId);
var guideCommentList = goods_CommentRepository.GetGuideCommentByOrderDetailId(orderDetailIds, dmodel.TenantId, dmodel.MallBaseId);
List<RB_Member_User_Extend> userList = new List<RB_Member_User_Extend>();
if (list.Where(x => x.UserId > 0).Any())
{
string uids = string.Join(",", list.Where(x => x.UserId > 0).Select(x => x.UserId ));
string uids = string.Join(",", list.Where(x => x.UserId > 0).Select(x => x.UserId));
userList = member_UserRepository.GetList(new RB_Member_User_Extend() { UserIds = uids, TenantId = dmodel.TenantId, MallBaseId = dmodel.MallBaseId });
}
foreach (var item in list)
......@@ -3841,7 +3937,7 @@ namespace Mall.Module.Product
}
/// <summary>
/// 获取商品评论统计
......
......@@ -4060,10 +4060,10 @@ namespace Mall.Module.User
/// <param name="demodel"></param>
/// <param name="NewUserId"></param>
/// <returns></returns>
public object GetUserMyTeamPageListForFX(int pageIndex, int pageSize, out long count, RB_Distributor_Info_Extend demodel,int NewUserId=0)
public object GetUserMyTeamPageListForFX(int pageIndex, int pageSize, out long count, RB_Distributor_Info_Extend demodel, int NewUserId = 0)
{
string UserIds = member_UserRepository.GetMemberChildIdStr(demodel.UserId ?? 0);
var list = member_UserRepository.GetPageListForFX(pageIndex, pageSize, out count,
new RB_Member_User_Extend()
{
......@@ -4073,8 +4073,8 @@ namespace Mall.Module.User
TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId,
SortNum = demodel.SortNum,
IsDirect=demodel.IsDirect,
Id=(demodel.UserId ?? 0)
IsDirect = demodel.IsDirect,
Id = (demodel.UserId ?? 0)
});
List<object> RList = new List<object>();
if (list.Any())
......@@ -4399,6 +4399,8 @@ namespace Mall.Module.User
List<RB_Goods_Order_Extend> olist = goods_OrderRepository.GetAppletGoodsOrderNumStatistics(umodel.Id, umodel.TenantId, umodel.MallBaseId);
//待评价
int WaitCommentNum = goods_OrderRepository.GetAppletGoodsOrderWaitCommentNum(umodel.Id, umodel.TenantId, umodel.MallBaseId);
//司导订单待评价
int GuideCarWaitCommentNum = goods_OrderRepository.GetAppletGoodsOrderWaitCommentNum(umodel.Id, umodel.TenantId, umodel.MallBaseId, 1);
//售后处理中
int AfterSaleNum = goods_OrderRepository.GetAppletGoodsOrderAfterSaleNum(umodel.Id, umodel.TenantId, umodel.MallBaseId);
string parent_name = "";
......@@ -4494,12 +4496,20 @@ namespace Mall.Module.User
},
MyOrder = new
{
NonPayment = olist.Where(x => x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.NonPayment).FirstOrDefault()?.OrderNum ?? 0,
WaitSendGoods = olist.Where(x => x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitSendGoods).FirstOrDefault()?.OrderNum ?? 0,
WaitReceiving = olist.Where(x => x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitReceiving).FirstOrDefault()?.OrderNum ?? 0,
NonPayment = olist.Where(x => x.OrderClassify == 0 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.NonPayment).FirstOrDefault()?.OrderNum ?? 0,
WaitSendGoods = olist.Where(x => x.OrderClassify == 0 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitSendGoods).FirstOrDefault()?.OrderNum ?? 0,
WaitReceiving = olist.Where(x => x.OrderClassify == 0 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitReceiving).FirstOrDefault()?.OrderNum ?? 0,
WaitCommentNum,
AfterSaleNum
},
MyGuideCarOrder = new
{
NonPayment = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.NonPayment).FirstOrDefault()?.OrderNum ?? 0,
WaitSendGoods = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitSendGoods).FirstOrDefault()?.OrderNum ?? 0,
WaitReceiving = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.WaitReceiving).FirstOrDefault()?.OrderNum ?? 0,
GuideCarWaitCommentNum,
Completed = olist.Where(x => x.OrderClassify == 1 && x.OrderStatus == Common.Enum.Goods.OrderStatusEnum.Completed).FirstOrDefault()?.OrderNum ?? 0,
},
isShowDistributionCenter = IsShowDistributionCenter
};
}
......
......@@ -20,7 +20,7 @@ namespace Mall.Repository.GuideCar
public string DestinationTableName { get { return nameof(RB_Destination); } }
/// <summary>
/// 获取物流地区列表
/// 获取站点地区列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
......
......@@ -186,7 +186,7 @@ where {where} ";
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public List<RB_Goods_Comment_Extend> GetCarCommentByOrderDetailId(string orderDetailIds, int tenantId, int mallBaseId)
public List<RB_Goods_Comment_Extend> GetCarCommentByOrderDetailId(string orderDetailIds, string goodsIds, int tenantId, int mallBaseId)
{
string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Status)}=0 and c.{nameof(RB_Goods_Comment.Is_Show)}=1 and c.{nameof(RB_Goods_Comment.CarId)}>0 ";
if (tenantId > 0)
......@@ -197,9 +197,9 @@ where {where} ";
{
where += $@" and c.{nameof(RB_Goods_Comment.MallBaseId)}={mallBaseId}";
}
if (!string.IsNullOrWhiteSpace(orderDetailIds))
if (!string.IsNullOrWhiteSpace(goodsIds))
{
where += $@" and c.{nameof(RB_Goods_Comment.OrderDetailId)}in({orderDetailIds}) ";
where += $@" and b.ID in({goodsIds}) ";
}
string sql = $@"SELECT c.*,a.`Name` as CarName,d.ColorName as CarColorName,cb.`Name` as CarBrandName FROM RB_Goods_Comment c
LEFT JOIN rb_guidecar_car as a on c.CarId=a.ID
......@@ -217,7 +217,7 @@ LEFT JOIN rb_guidecar_carbrand as cb on cb.ID=a.CarBrandId where {where} ";
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public List<RB_Goods_Comment_Extend> GetGuideCommentByOrderDetailId(string orderDetailIds, int tenantId, int mallBaseId)
public List<RB_Goods_Comment_Extend> GetGuideCommentByOrderDetailId(string orderDetailIds, int tenantId, int mallBaseId)
{
string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Status)}=0 and c.{nameof(RB_Goods_Comment.Is_Show)}=1 and c.{nameof(RB_Goods_Comment.GuideId)}>0 ";
if (tenantId > 0)
......@@ -230,8 +230,9 @@ LEFT JOIN rb_guidecar_carbrand as cb on cb.ID=a.CarBrandId where {where} ";
}
if (!string.IsNullOrWhiteSpace(orderDetailIds))
{
where += $@" and c.{nameof(RB_Goods_Comment.OrderDetailId)}in({orderDetailIds}) ";
where += $@" and c.{nameof(RB_Goods_Comment.OrderDetailId)} in ({orderDetailIds}) ";
}
string sql = $@"SELECT c.*,a.`Name` as GuideName FROM RB_Goods_Comment c LEFT JOIN rb_guidecar_guide as a on c.GuideId=a.ID where {where} ";
return Get<RB_Goods_Comment_Extend>(sql).ToList();
}
......@@ -291,7 +292,7 @@ LEFT JOIN rb_guidecar_carbrand as cb on cb.ID=a.CarBrandId where {where} ";
{
whereGrade += $@" and t.TotalScore>3 and t.TotalScore<=6";
}
else
else if (dmodel.CommentGrade.Value == Common.Enum.Goods.GoodsCommentTypeEnum.Negative)
{
whereGrade += $@" and t.TotalScore>=1 and t.TotalScore<=3";
}
......@@ -303,7 +304,7 @@ LEFT JOIN rb_guidecar_carbrand as cb on cb.ID=a.CarBrandId where {where} ";
when SUM(CommentScore)>6 then 1
ELSE 0
end as CommentGrade
from rb_goods_comment where {where} GROUP BY OrderDetailId order by CreateDate ) as t {whereGrade}";
from rb_goods_comment where {where} GROUP BY OrderDetailId order by CreateDate desc ) as t {whereGrade}";
return GetPage<GoodsComment_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
......
......@@ -196,6 +196,10 @@ where {where} order by o.CreateDate desc";
{
where += $@" and o.{nameof(RB_Goods_Order.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.OrderClassify > -1)
{
where += $@" and o.{nameof(RB_Goods_Order.OrderClassify)}={dmodel.OrderClassify}";
}
if (dmodel.OrderType > 0)
{
......
......@@ -117,11 +117,12 @@ namespace Mall.Repository.Product
{
where += $@" and o.{nameof(RB_Goods_Order.Recycled)}={(int)dmodel.Recycled}";
}
if (dmodel.SmallShopsId.HasValue&& dmodel.SmallShopsId > 0)
if (dmodel.SmallShopsId.HasValue && dmodel.SmallShopsId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.SmallShopsId)}={dmodel.SmallShopsId}";
}
if (dmodel.IsSelectPayMoney == 1) {
if (dmodel.IsSelectPayMoney == 1)
{
where += $@" and o.{nameof(RB_Goods_Order.PaymentTime)} IS NOT NULL";
}
......@@ -543,7 +544,7 @@ where {where} group by o.OrderId order by o.CreateDate desc";
{
where += $@" and oc.{nameof(RB_SmallShops_Commission.UserId)}={dmodel.DistributionUserId}";
}
if (dmodel.SmallShopsId > 0)
if (dmodel.SmallShopsId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.SmallShopsId)}={(int)dmodel.SmallShopsId}";
}
......@@ -636,7 +637,7 @@ WHERE od.GoodsId in({goodsIds}) and o.`Status`=0 and o.OrderStatus <> 7 group by
/// <returns></returns>
public List<RB_Goods_Order_Extend> GetAppletGoodsOrderNumStatistics(int userId, int tenantId, int mallBaseId)
{
string sql = $" SELECT OrderStatus,COUNT(0) as OrderNum FROM rb_goods_order WHERE `Status`=0 and OrderStatus in (1,2,3) and UserId={userId} and TenantId={tenantId} and MallBaseId={mallBaseId} GROUP BY OrderStatus";
string sql = $" SELECT OrderStatus,COUNT(0) as OrderNum,OrderClassify FROM rb_goods_order WHERE `Status`=0 and OrderStatus in (1,2,3,5) and UserId={userId} and TenantId={tenantId} and MallBaseId={mallBaseId} GROUP BY OrderStatus,OrderClassify";
return Get<RB_Goods_Order_Extend>(sql).ToList();
}
......@@ -647,12 +648,12 @@ WHERE od.GoodsId in({goodsIds}) and o.`Status`=0 and o.OrderStatus <> 7 group by
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public int GetAppletGoodsOrderWaitCommentNum(int userId, int tenantId, int mallBaseId)
public int GetAppletGoodsOrderWaitCommentNum(int userId, int tenantId, int mallBaseId, int OrderClassify = 0)
{
string sql = $@"SELECT COUNT(0) as OrderNum FROM(
SELECT o.OrderId FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
WHERE o.`Status`=0 and o.OrderStatus =4 and od.IsComment=2 and o.UserId={userId} and o.TenantId={tenantId} and o.MallBaseId={mallBaseId}
WHERE o.`Status`=0 and o.OrderStatus =4 and od.IsComment=2 and o.UserId={userId} and o.TenantId={tenantId} and o.MallBaseId={mallBaseId} and o.OrderClassify={OrderClassify}
GROUP BY o.OrderId)t";
var obj = ExecuteScalar(sql);
if (obj != null)
......
......@@ -393,6 +393,32 @@ namespace Mall.WebApi.Controllers.Product
return ApiResult.Success("", oldLogisticsModel);
}
/// <summary>
/// 获取站点地区列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetSiteRegionList(object requestMsg)
{
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
var query = JsonConvert.DeserializeObject<RB_GuideCar_SiteRegion_Extend>(parms.msg.ToString());
query.TenantId = parms.TenantId;
query.MallBaseId = parms.MallBaseId;
query.SiteType = 1;
var siteRegionList = guideCarModule.GetListRepository(query);
if (siteRegionList == null)
{
siteRegionList = new List<RB_GuideCar_SiteRegion_Extend>();
}
var result = siteRegionList.Select(x => new
{
x.ID,
x.SiteId,
x.RegionId,
x.RegionName
});
return ApiResult.Success("", result);
}
/// <summary>
......@@ -452,7 +478,9 @@ namespace Mall.WebApi.Controllers.Product
y.CarBrandName,
y.CarColorName,
y.CarName,
CreateDate = y.CreateDate.HasValue ? y.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
CreateDate = y.CreateDate.HasValue ? y.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
y.CarId,
y.GuideId
})
});
return ApiResult.Success("", pagelist);
......@@ -467,7 +495,7 @@ namespace Mall.WebApi.Controllers.Product
public ApiResult GetAppletGoodsCommentStatistics(object requestMsg)
{
var req = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
JObject parms = JObject.Parse(req.msg.ToString());
int GoodsId = parms.GetInt("GoodsId", 0);
......
......@@ -1657,16 +1657,21 @@ namespace Mall.WebApi.Controllers.MallBase
{
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.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;
......@@ -1680,7 +1685,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
bool flag = guideCarModule.SetGoodsCommentInfo(list);
bool flag = guideCarModule.SetGoodsCommentInfo_V2(list);
if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); }
}
#endregion
......
......@@ -298,9 +298,6 @@ namespace Mall.WebApi.Controllers.User
{
if (orderGoodsItem.CostMoney > 0 && orderGoodsItem.CostFinanceId <= 0)
{
//var newOrderGoods = new RB_Goods_OrderDetail_Extend();
//newOrderGoods = orderGoodsItem;
//newOrderGoods.FinanceType = 1;
var newOrderGoods = new RB_Goods_OrderDetail_Extend
{
FinanceType = 1,
......@@ -311,7 +308,8 @@ namespace Mall.WebApi.Controllers.User
OrderNo = orderGoodsItem.OrderNo,
Id = orderGoodsItem.Id,
CostMoney = orderGoodsItem.CostMoney,
FreightCostMoney = orderGoodsItem.FreightCostMoney
FreightCostMoney = orderGoodsItem.FreightCostMoney,
InsuranceCostMoney = orderGoodsItem.InsuranceCostMoney
};
OrderDetailPaid += ((orderGoodsItem.CostMoney ?? 0) * (orderGoodsItem.Number ?? 0));
result.Add(newOrderGoods);
......@@ -319,11 +317,9 @@ namespace Mall.WebApi.Controllers.User
}
if (demodel.IsSelectAll == 0 || demodel.IsSelectAll == 2)
{
if (orderGoodsItem.FreightCostMoney.HasValue && orderGoodsItem.FreightCostMoney.Value > 0 && orderGoodsItem.FreightFinanceId <= 0)
{
//var newOrderGoods = new RB_Goods_OrderDetail_Extend();
//newOrderGoods = orderGoodsItem;
//newOrderGoods.FinanceType = 2;
var newOrderGoods = new RB_Goods_OrderDetail_Extend
{
FinanceType = 2,
......@@ -334,12 +330,38 @@ namespace Mall.WebApi.Controllers.User
OrderNo = orderGoodsItem.OrderNo,
Id = orderGoodsItem.Id,
CostMoney = orderGoodsItem.CostMoney,
FreightCostMoney = orderGoodsItem.FreightCostMoney
FreightCostMoney = orderGoodsItem.FreightCostMoney,
InsuranceCostMoney = orderGoodsItem.InsuranceCostMoney
};
OrderDetailPaid += (orderGoodsItem.FreightCostMoney ?? 0);
result.Add(newOrderGoods);
}
}
if (demodel.IsSelectAll == 0 || demodel.IsSelectAll == 3)
{
if (orderGoodsItem.InsuranceCostMoney.HasValue && orderGoodsItem.InsuranceCostMoney.Value > 0 && orderGoodsItem.InsuranceFinanceId <= 0)
{
var newOrderGoods = new RB_Goods_OrderDetail_Extend
{
FinanceType = 3,
Final_Price = orderGoodsItem.Final_Price,
Number = 1,
FreightMoney = orderGoodsItem.FreightMoney,
GoodsName = orderGoodsItem.GoodsName,
OrderNo = orderGoodsItem.OrderNo,
Id = orderGoodsItem.Id,
CostMoney = orderGoodsItem.CostMoney,
FreightCostMoney = orderGoodsItem.FreightCostMoney,
InsuranceCostMoney = orderGoodsItem.InsuranceCostMoney
};
OrderDetailPaid += ((orderGoodsItem.InsuranceCostMoney ?? 0) * (orderGoodsItem.Number ?? 0));
result.Add(newOrderGoods);
}
}
RB_Finance_RecordDetail_Extend financeRecordDetail = new RB_Finance_RecordDetail_Extend
{
......@@ -358,6 +380,7 @@ namespace Mall.WebApi.Controllers.User
Unit_Price = orderGoodsItem.CostMoney,
Number = orderGoodsItem.Number,
OrderDetailPaid = OrderDetailPaid,
InsuranceCostMoney = ((orderGoodsItem.InsuranceCostMoney ?? 0) * (orderGoodsItem.Number ?? 0)),
};
record.RecordDetailList.Add(financeRecordDetail);
......@@ -370,17 +393,25 @@ namespace Mall.WebApi.Controllers.User
ECList = ECList.Distinct().ToList();
var detailList = result.Select(x => new
{
CostTypeId = x.FinanceType == 1 ? financeConfigurineModel.CBCostTypeId : financeConfigurineModel.ExpensesCostTypeId,
Number = x.FinanceType == 1 ? x.Number : 1,
OriginalMoney = x.FinanceType == 1 ? ((x.CostMoney ?? 0) * (x.Number ?? 0)) : x.FreightCostMoney,
UnitPrice = x.FinanceType == 1 ? ((x.CostMoney ?? 0)) : x.FreightCostMoney,
CostTypeId = x.FinanceType == 1 ? financeConfigurineModel.CBCostTypeId : (x.FinanceType == 2 ? financeConfigurineModel.ExpensesCostTypeId : financeConfigurineModel.InsuranceCostTypeId),
// CostTypeId = x.FinanceType == 1 ? financeConfigurineModel.CBCostTypeId : financeConfigurineModel.ExpensesCostTypeId,
Number = (x.FinanceType == 1 || x.FinanceType == 3) ? x.Number : 1,
OriginalMoney = x.FinanceType == 1 ? ((x.CostMoney ?? 0) * (x.Number ?? 0)) : (x.FinanceType == 2 ? x.FreightCostMoney : ((x.InsuranceCostMoney ?? 0) * (x.Number ?? 0))),
UnitPrice = x.FinanceType == 1 ? ((x.CostMoney ?? 0)) : (x.FinanceType == 2 ? x.FreightCostMoney : (x.InsuranceCostMoney ?? 0)),
Remark = x.GoodsName + x.Specification + x.OrderNo
});
decimal totalMonry = 0;
if (demodel.IsSelectAll == 0)
{
totalMonry = (result.Where(x => x.FinanceType == 1).Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)))) + (result.Where(x => x.FinanceType == 2).Sum(x => x.FreightCostMoney ?? 0));
if (demodel.OrderClassify == 0)
{
totalMonry = (result.Where(x => x.FinanceType == 1).Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)))) + (result.Where(x => x.FinanceType == 2).Sum(x => x.FreightCostMoney ?? 0));
}
else
{
totalMonry = (result.Where(x => x.FinanceType == 1).Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)))) + (result.Where(x => x.FinanceType == 3).Sum(x => ((x.InsuranceCostMoney ?? 0) * (x.Number ?? 0))));
}
}
else if (demodel.IsSelectAll == 1)
{
......@@ -390,10 +421,14 @@ namespace Mall.WebApi.Controllers.User
{
totalMonry = result.Where(x => x.FinanceType == 2).Sum(x => (x.FreightCostMoney ?? 0));
}
else if (demodel.IsSelectAll == 3)
{
totalMonry = result.Where(x => x.FinanceType == 2).Sum(x => ((x.InsuranceCostMoney ?? 0) * (x.Number ?? 0)));
}
var financeObj = new
{
CreateBy = demodel.FinanceCreateBy == 0 ? Config.ExpendDirector : demodel.FinanceCreateBy.ToString(),
IsPublic = demodel.IsPublic,// supplierModel.ClientBankAccount.AccountType, //financeConfigurineModel.AccountType,
IsPublic = demodel.IsPublic,
ClientType = supplierModel.ClientBankAccount.Type,
ClientID = supplierModel.BankAccountId,
CurrencyId = financeConfigurineModel.CurrencyId,
......
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