Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
badaf34f
Commit
badaf34f
authored
Sep 07, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
司导下单
parent
973ee4d4
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
431 additions
and
121 deletions
+431
-121
RB_Goods_Order.cs
Mall.Model/Entity/Product/RB_Goods_Order.cs
+0
-12
RB_Goods_OrderDetail.cs
Mall.Model/Entity/Product/RB_Goods_OrderDetail.cs
+45
-0
RB_Goods_OrderDetail_Extend.cs
Mall.Model/Extend/Product/RB_Goods_OrderDetail_Extend.cs
+4
-0
RB_Goods_Order_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Order_Extend.cs
+12
-0
RB_Goods_TargetDate_Extend.cs
Mall.Model/Extend/Product/RB_Goods_TargetDate_Extend.cs
+8
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+352
-105
RB_Goods_TargetDateRepository.cs
Mall.Repository/Product/RB_Goods_TargetDateRepository.cs
+6
-0
appsettings.json
Mall.WebApi/appsettings.json
+4
-4
No files found.
Mall.Model/Entity/Product/RB_Goods_Order.cs
View file @
badaf34f
...
@@ -308,17 +308,5 @@ namespace Mall.Model.Entity.Product
...
@@ -308,17 +308,5 @@ namespace Mall.Model.Entity.Product
/// 微店id
/// 微店id
/// </summary>
/// </summary>
public
int
?
SmallShopsId
{
get
;
set
;
}
public
int
?
SmallShopsId
{
get
;
set
;
}
/// <summary>
/// 司导服务类型
/// </summary>
public
GuideCarGoodsTypeEnum
?
CarType
{
get
;
set
;
}
/// <summary>
/// 司导预约开始时间
/// </summary>
public
DateTime
?
TripSTime
{
get
;
set
;
}
/// <summary>
/// 司导预约结束时间
/// </summary>
public
DateTime
?
TripETime
{
get
;
set
;
}
}
}
}
}
Mall.Model/Entity/Product/RB_Goods_OrderDetail.cs
View file @
badaf34f
...
@@ -281,5 +281,50 @@ namespace Mall.Model.Entity.Product
...
@@ -281,5 +281,50 @@ namespace Mall.Model.Entity.Product
/// 手续费
/// 手续费
/// </summary>
/// </summary>
public
decimal
ServiceCharge
{
get
;
set
;
}
public
decimal
ServiceCharge
{
get
;
set
;
}
/// <summary>
/// 司导服务类型
/// </summary>
public
GuideCarGoodsTypeEnum
?
CarType
{
get
;
set
;
}
/// <summary>
/// 司导预约开始时间
/// </summary>
public
DateTime
?
TripSTime
{
get
;
set
;
}
/// <summary>
/// 司导预约结束时间
/// </summary>
public
DateTime
?
TripETime
{
get
;
set
;
}
/// <summary>
/// 使用天数
/// </summary>
public
decimal
?
UseDay
{
get
;
set
;
}
/// <summary>
/// 是否拼座 1是 2否
/// </summary>
public
int
?
IsSpell
{
get
;
set
;
}
/// <summary>
/// 站点id
/// </summary>
public
int
?
SiteId
{
get
;
set
;
}
/// <summary>
/// 导游id
/// </summary>
public
int
?
GuideId
{
get
;
set
;
}
/// <summary>
/// 车辆id
/// </summary>
public
int
?
CarId
{
get
;
set
;
}
/// <summary>
/// 车辆颜色id
/// </summary>
public
int
?
CarColorId
{
get
;
set
;
}
/// <summary>
/// 车牌号
/// </summary>
public
string
CarNumber
{
get
;
set
;
}
/// <summary>
/// 线路名称
/// </summary>
public
string
LineName
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/Product/RB_Goods_OrderDetail_Extend.cs
View file @
badaf34f
...
@@ -19,6 +19,10 @@ namespace Mall.Model.Extend.Product
...
@@ -19,6 +19,10 @@ namespace Mall.Model.Extend.Product
/// </summary>
/// </summary>
public
int
?
UserId
{
get
;
set
;
}
public
int
?
UserId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 商品乘坐人数
/// </summary>
public
int
?
GoodsRideNum
{
get
;
set
;
}
/// <summary>
/// 订单财务单据列表
/// 订单财务单据列表
/// </summary>
/// </summary>
public
List
<
RB_Finance_Extend
>
FinanceList
{
get
;
set
;
}
public
List
<
RB_Finance_Extend
>
FinanceList
{
get
;
set
;
}
...
...
Mall.Model/Extend/Product/RB_Goods_Order_Extend.cs
View file @
badaf34f
...
@@ -15,6 +15,18 @@ namespace Mall.Model.Extend.Product
...
@@ -15,6 +15,18 @@ namespace Mall.Model.Extend.Product
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Goods_Order_Extend
:
RB_Goods_Order
public
class
RB_Goods_Order_Extend
:
RB_Goods_Order
{
{
/// <summary>
/// 司导服务类型
/// </summary>
public
GuideCarGoodsTypeEnum
?
CarType
{
get
;
set
;
}
/// <summary>
/// 司导预约开始时间
/// </summary>
public
DateTime
?
TripSTime
{
get
;
set
;
}
/// <summary>
/// 司导预约结束时间
/// </summary>
public
DateTime
?
TripETime
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 赠送的会员等级
/// 赠送的会员等级
/// </summary>
/// </summary>
...
...
Mall.Model/Extend/Product/RB_Goods_TargetDate_Extend.cs
View file @
badaf34f
...
@@ -27,5 +27,13 @@ namespace Mall.Model.Extend.Product
...
@@ -27,5 +27,13 @@ namespace Mall.Model.Extend.Product
/// 月份
/// 月份
/// </summary>
/// </summary>
public
string
Month
{
get
;
set
;
}
public
string
Month
{
get
;
set
;
}
/// <summary>
/// 开始时间
/// </summary>
public
string
StartTime
{
get
;
set
;
}
/// <summary>
/// 结束时间
/// </summary>
public
string
EndTime
{
get
;
set
;
}
}
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
badaf34f
...
@@ -3811,7 +3811,7 @@ namespace Mall.Module.Product
...
@@ -3811,7 +3811,7 @@ namespace Mall.Module.Product
integralModel = integral_SettingsRepository.GetIntegralSettingsList(new Model.Entity.MarketingCenter.RB_Integral_Settings() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
integralModel = integral_SettingsRepository.GetIntegralSettingsList(new Model.Entity.MarketingCenter.RB_Integral_Settings() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
}
}
GoodsIds = string.Join(",", demodel.DetailList.Select(x => x.GoodsId));
GoodsIds = string.Join(",", demodel.DetailList.Select(x => x.GoodsId));
var
gList
=
goodsRepository
.
GetList
(
new
RB_Goods_Extend
()
{
GoodsIds
=
GoodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var gList = goodsRepository.GetList
ForCar
(new RB_Goods_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var mpriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var mpriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var mallbaseModel = mallBaseRepository.GetListRepository(new Model.Extend.BaseSetUp.RB_MallBase_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
var mallbaseModel = mallBaseRepository.GetListRepository(new Model.Extend.BaseSetUp.RB_MallBase_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
...
@@ -3837,20 +3837,57 @@ namespace Mall.Module.Product
...
@@ -3837,20 +3837,57 @@ namespace Mall.Module.Product
{
{
return ApiResult.Failed("商品服务类型不一致");
return ApiResult.Failed("商品服务类型不一致");
}
}
int uday = Convert.ToInt32((gmodel.UseDay ?? 0).Equals(0.5) ? 1 : (gmodel.UseDay ?? 0));
var
targetList
=
goods_TargetDateRepository
.
GetList
(
new
RB_Goods_TargetDate_Extend
()
{
GoodsId
=
gmodel
.
Id
,
IsReserve
=
1
,
DateTime
=
demodel
.
TripSTime
.
Value
.
ToString
(
"yyyy-MM-dd"
)
});
if (demodel.TripSTime.Value.AddDays(uday - 1) != demodel.TripETime)
{
return ApiResult.Failed("预定日期与商品使用天数不一致");
}
item.CarType = gmodel.CarType;
item.UseDay = gmodel.UseDay;
item.TripSTime = demodel.TripSTime;
item.TripETime = demodel.TripETime;
item.IsSpell = gmodel.IsSpell;
item.GoodsRideNum = gmodel.RideNum;
item.SiteId = gmodel.SiteId;
item.GuideId = gmodel.GuideId;
item.CarId = gmodel.CarId;
item.CarColorId = gmodel.CarColorId;
item.CarNumber = gmodel.CarNumber;
item.LineName = gmodel.LineName;
var tdlist = goods_TargetDateRepository.GetList(new RB_Goods_TargetDate_Extend() { GoodsId = item.GoodsId ?? 0, StartTime = item.TripSTime.Value.ToString("yyyy-MM-dd"), EndTime = item.TripETime.Value.ToString("yyyy-MM-dd") });
var targetList = tdlist.Where(x => x.IsReserve == 1 && x.Date == Convert.ToDateTime(demodel.TripSTime.Value.ToString("yyyy-MM-dd"))).ToList();
if (gmodel.AdvanceDay > 0)
if (gmodel.AdvanceDay > 0)
{
{
DateTime Mindate = Convert.ToDateTime(DateTime.Now.AddDays(gmodel.AdvanceDay ?? 0).ToString("yyyy-MM-dd"));
DateTime Mindate = Convert.ToDateTime(DateTime.Now.AddDays(gmodel.AdvanceDay ?? 0).ToString("yyyy-MM-dd"));
targetList = targetList.Where(x => x.Date >= Mindate).ToList();
targetList = targetList.Where(x => x.Date >= Mindate).ToList();
}
}
if (!targetList.Any()) {
if (!targetList.Any()) {
return
ApiResult
.
Failed
(
"
商品已被他人购买
,无法下单"
);
return ApiResult.Failed("
不在预定时间范围
,无法下单");
}
}
if (gmodel.CarType == GuideCarGoodsTypeEnum.Line && gmodel.IsSpell == 1)
{
var targetModel = targetList.FirstOrDefault();
var targetModel = targetList.FirstOrDefault();
if
((
gmodel
.
RideNum
??
0
)
-
(
targetModel
.
ReserveNum
)
<
(
item
.
Number
??
0
))
{
if ((gmodel.RideNum ?? 0) - (targetModel.ReserveNum) < (item.Number ?? 0))
{
return ApiResult.Failed("商品剩余座位数不足,剩余:" + ((gmodel.RideNum ?? 0) - (targetModel.ReserveNum)));
return ApiResult.Failed("商品剩余座位数不足,剩余:" + ((gmodel.RideNum ?? 0) - (targetModel.ReserveNum)));
}
}
}
else
{
foreach (var qitem in tdlist)
{
if (qitem.IsReserve == 2)
{
return ApiResult.Failed(qitem.Date.Value.ToString("yyyy-MM-dd") + "已被预定,无法下单");
}
//验证座位数量
if ((gmodel.RideNum ?? 0) - (qitem.ReserveNum) < (item.Number ?? 0))
{
return ApiResult.Failed(qitem.Date.Value.ToString("yyyy-MM-dd") + "剩余座位数不足,剩余:" + ((gmodel.RideNum ?? 0) - (qitem.ReserveNum)));
}
}
}
var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList();
var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList();
...
@@ -4274,7 +4311,7 @@ namespace Mall.Module.Product
...
@@ -4274,7 +4311,7 @@ namespace Mall.Module.Product
}
}
#endregion
#endregion
//插入订单明细+ 商品库存更新
//插入订单明细+ 商品库存更新
InsertOrderDetail
(
demodel
,
trans
,
OrderId
,
new
List
<
FreeShippingGoodsDetail
>());
InsertOrderDetail(demodel, trans, OrderId, new List<FreeShippingGoodsDetail>()
, true
);
//用户订单数增加
//用户订单数增加
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
...
@@ -5790,7 +5827,18 @@ namespace Mall.Module.Product
...
@@ -5790,7 +5827,18 @@ namespace Mall.Module.Product
YSMoney = 0,
YSMoney = 0,
CompanyId = demodel.CompanyId,
CompanyId = demodel.CompanyId,
CompanyProfitRate = demodel.CompanyProfitRate,
CompanyProfitRate = demodel.CompanyProfitRate,
ServiceCharge
=
item
.
ServiceCharge
ServiceCharge = item.ServiceCharge,
CarType = item.CarType,
LineName = item.LineName,
CarNumber = item.CarNumber,
CarColorId = item.CarColorId,
GuideId = item.GuideId,
SiteId = item.SiteId,
CarId = item.CarId,
IsSpell = item.IsSpell,
TripETime = item.TripETime,
TripSTime = item.TripSTime,
UseDay = item.UseDay
}, trans);
}, trans);
item.Id = detailId;
item.Id = detailId;
if (detailId > 0 && SatisfiedGoodsList.Any())
if (detailId > 0 && SatisfiedGoodsList.Any())
...
@@ -5886,7 +5934,70 @@ namespace Mall.Module.Product
...
@@ -5886,7 +5934,70 @@ namespace Mall.Module.Product
#region 更新司导商品预约时间
#region 更新司导商品预约时间
if (IsSDGoods) {
if (IsSDGoods) {
//通过下单时间范围 查询出所有的日期 线路的看是否可以拼车 增加人数 更新日期预定状态
//通过下单时间范围 查询出所有的日期 线路的看是否可以拼车 增加人数 更新日期预定状态
goods_TargetDateRepository
.
GetList
(
new
RB_Goods_TargetDate_Extend
()
{
GoodsId
=
item
.
GoodsId
??
0
,
});
var tdlist = goods_TargetDateRepository.GetList(new RB_Goods_TargetDate_Extend() { GoodsId = item.GoodsId ?? 0, StartTime = item.TripSTime.Value.ToString("yyyy-MM-dd"), EndTime = item.TripETime.Value.ToString("yyyy-MM-dd") });
if (tdlist.Any())
{
if (item.CarType == GuideCarGoodsTypeEnum.Line && item.IsSpell == 1)
{
//只调整第一天的 其他天 直接表示已预订了
var fristModel = tdlist.Where(x => x.Date == Convert.ToDateTime(item.TripSTime.Value.ToString("yyyy-MM-dd"))).FirstOrDefault();
//第一条更新数量 如果OK咯 更新已预定
if (fristModel != null) {
Dictionary<string, object> keyValues1 = new Dictionary<string, object>();
if ((item.GoodsRideNum ?? 0) - (fristModel.ReserveNum) <= (item.Number ?? 0))
{
keyValues1.Add(nameof(RB_Goods_TargetDate.IsReserve), 2);
keyValues1.Add(nameof(RB_Goods_TargetDate.ReserveNum), (fristModel.ReserveNum) + (item.Number ?? 0));
}
else {
keyValues1.Add(nameof(RB_Goods_TargetDate.IsReserve), 1);
keyValues1.Add(nameof(RB_Goods_TargetDate.ReserveNum), (fristModel.ReserveNum) + (item.Number ?? 0));
}
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_TargetDate.Id),
FiledValue=fristModel.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_TargetDateRepository.Update(keyValues1, wheres1, trans);
}
//其他的直接已预定
foreach (var qitem in tdlist.Where(x => x.Date != Convert.ToDateTime(item.TripSTime.Value.ToString("yyyy-MM-dd")) && x.IsReserve == 1))
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_TargetDate.IsReserve),2},
{ nameof(RB_Goods_TargetDate.ReserveNum),item.Number??0},
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_TargetDate.Id),
FiledValue=qitem.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_TargetDateRepository.Update(keyValues1, wheres1, trans);
}
}
else
{
//直接更新日期为已预订
foreach (var qitem in tdlist)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_TargetDate.IsReserve),2},
{ nameof(RB_Goods_TargetDate.ReserveNum),item.Number??0},
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_TargetDate.Id),
FiledValue=qitem
}
};
goods_TargetDateRepository.Update(keyValues1, wheres1, trans);
}
}
}
}
}
#endregion
#endregion
}
}
...
@@ -6037,6 +6148,74 @@ namespace Mall.Module.Product
...
@@ -6037,6 +6148,74 @@ namespace Mall.Module.Product
};
};
goods_SpecificationPriceRepository.Update(keyValues2, wheres2, trans);
goods_SpecificationPriceRepository.Update(keyValues2, wheres2, trans);
}
}
if (item.OrderType == OrderTypeEnum.SDGoods)
{
//更新商品可预定日期
var tdlist = goods_TargetDateRepository.GetList(new RB_Goods_TargetDate_Extend() { GoodsId = item.GoodsId ?? 0, StartTime = item.TripSTime.Value.ToString("yyyy-MM-dd"), EndTime = item.TripETime.Value.ToString("yyyy-MM-dd") });
if (item.CarType == GuideCarGoodsTypeEnum.Line && item.IsSpell == 1)
{
//只调整第一天的 其他天 直接表示已预订了
var fristModel = tdlist.Where(x => x.Date == Convert.ToDateTime(item.TripSTime.Value.ToString("yyyy-MM-dd"))).FirstOrDefault();
//第一条更新数量 如果OK咯 更新已预定
if (fristModel != null)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>
{
{ nameof(RB_Goods_TargetDate.IsReserve), 1 },
{ nameof(RB_Goods_TargetDate.ReserveNum), (fristModel.ReserveNum) - (item.Number ?? 0) }
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_TargetDate.Id),
FiledValue=fristModel.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_TargetDateRepository.Update(keyValues1, wheres1, trans);
if ((fristModel.ReserveNum) - (item.Number ?? 0) <= 0)
{
//其他的直接改未预定
foreach (var qitem in tdlist.Where(x => x.Date != Convert.ToDateTime(item.TripSTime.Value.ToString("yyyy-MM-dd")) && x.IsReserve == 2))
{
Dictionary<string, object> keyValues2 = new Dictionary<string, object>() {
{ nameof(RB_Goods_TargetDate.IsReserve),1},
{ nameof(RB_Goods_TargetDate.ReserveNum),0},
};
List<WhereHelper> wheres2 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_TargetDate.Id),
FiledValue=qitem.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_TargetDateRepository.Update(keyValues2, wheres2, trans);
}
}
}
}
else
{
//直接回滚所有的日期 为可预定
foreach (var qitem in tdlist)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_TargetDate.IsReserve),1},
{ nameof(RB_Goods_TargetDate.ReserveNum),0},
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_TargetDate.Id),
FiledValue=qitem.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_TargetDateRepository.Update(keyValues1, wheres1, trans);
}
}
}
else
{
//更新商品表库存
//更新商品表库存
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods.InventoryNum), (gmodel.InventoryNum??0)+(item.Number??0)}
{ nameof(RB_Goods.InventoryNum), (gmodel.InventoryNum??0)+(item.Number??0)}
...
@@ -6049,6 +6228,7 @@ namespace Mall.Module.Product
...
@@ -6049,6 +6228,7 @@ namespace Mall.Module.Product
}
}
};
};
goodsRepository.Update(keyValues1, wheres1, trans);
goodsRepository.Update(keyValues1, wheres1, trans);
}
goods_LogRepository.Insert(new RB_Goods_Log()
goods_LogRepository.Insert(new RB_Goods_Log()
{
{
Id = 0,
Id = 0,
...
@@ -8651,7 +8831,6 @@ namespace Mall.Module.Product
...
@@ -8651,7 +8831,6 @@ namespace Mall.Module.Product
string goodsIds = string.Join(",", detailList.Select(x => x.GoodsId ?? 0).Distinct());
string goodsIds = string.Join(",", detailList.Select(x => x.GoodsId ?? 0).Distinct());
var goodsList = goodsRepository.GetList(new RB_Goods_Extend() { GoodsIds = goodsIds, TenantId = tenantId, MallBaseId = mallBaseId });
var goodsList = goodsRepository.GetList(new RB_Goods_Extend() { GoodsIds = goodsIds, TenantId = tenantId, MallBaseId = mallBaseId });
var speciPList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = goodsIds, TenantId = tenantId, MallBaseId = mallBaseId });
var speciPList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = goodsIds, TenantId = tenantId, MallBaseId = mallBaseId });
foreach (var item in detailList)
foreach (var item in detailList)
{
{
var gmodel = goodsList.Where(x => x.Id == item.GoodsId).FirstOrDefault();
var gmodel = goodsList.Where(x => x.Id == item.GoodsId).FirstOrDefault();
...
@@ -8690,6 +8869,74 @@ namespace Mall.Module.Product
...
@@ -8690,6 +8869,74 @@ namespace Mall.Module.Product
};
};
goods_SpecificationPriceRepository.Update(keyValues2, wheres2, trans);
goods_SpecificationPriceRepository.Update(keyValues2, wheres2, trans);
}
}
if (item.OrderType == OrderTypeEnum.SDGoods)
{
//更新商品可预定日期
var tdlist = goods_TargetDateRepository.GetList(new RB_Goods_TargetDate_Extend() { GoodsId = item.GoodsId ?? 0, StartTime = item.TripSTime.Value.ToString("yyyy-MM-dd"), EndTime = item.TripETime.Value.ToString("yyyy-MM-dd") });
if (item.CarType == GuideCarGoodsTypeEnum.Line && item.IsSpell == 1)
{
//只调整第一天的 其他天 直接表示已预订了
var fristModel = tdlist.Where(x => x.Date == Convert.ToDateTime(item.TripSTime.Value.ToString("yyyy-MM-dd"))).FirstOrDefault();
//第一条更新数量 如果OK咯 更新已预定
if (fristModel != null)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>
{
{ nameof(RB_Goods_TargetDate.IsReserve), 1 },
{ nameof(RB_Goods_TargetDate.ReserveNum), (fristModel.ReserveNum) - (item.Number ?? 0) }
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_TargetDate.Id),
FiledValue=fristModel.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_TargetDateRepository.Update(keyValues1, wheres1, trans);
if ((fristModel.ReserveNum) - (item.Number ?? 0) <= 0)
{
//其他的直接改未预定
foreach (var qitem in tdlist.Where(x => x.Date != Convert.ToDateTime(item.TripSTime.Value.ToString("yyyy-MM-dd")) && x.IsReserve == 2))
{
Dictionary<string, object> keyValues2 = new Dictionary<string, object>() {
{ nameof(RB_Goods_TargetDate.IsReserve),1},
{ nameof(RB_Goods_TargetDate.ReserveNum),0},
};
List<WhereHelper> wheres2 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_TargetDate.Id),
FiledValue=qitem.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_TargetDateRepository.Update(keyValues2, wheres2, trans);
}
}
}
}
else
{
//直接回滚所有的日期 为可预定
foreach (var qitem in tdlist)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_TargetDate.IsReserve),1},
{ nameof(RB_Goods_TargetDate.ReserveNum),0},
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_TargetDate.Id),
FiledValue=qitem.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_TargetDateRepository.Update(keyValues1, wheres1, trans);
}
}
}
else
{
//更新商品表库存
//更新商品表库存
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods.InventoryNum), (gmodel.InventoryNum??0)+(item.Number??0)}
{ nameof(RB_Goods.InventoryNum), (gmodel.InventoryNum??0)+(item.Number??0)}
...
@@ -8702,6 +8949,7 @@ namespace Mall.Module.Product
...
@@ -8702,6 +8949,7 @@ namespace Mall.Module.Product
}
}
};
};
goodsRepository.Update(keyValues1, wheres1, trans);
goodsRepository.Update(keyValues1, wheres1, trans);
}
goods_LogRepository.Insert(new RB_Goods_Log()
goods_LogRepository.Insert(new RB_Goods_Log()
{
{
Id = 0,
Id = 0,
...
@@ -8718,8 +8966,6 @@ namespace Mall.Module.Product
...
@@ -8718,8 +8966,6 @@ namespace Mall.Module.Product
TotalIntegralNumber += (item.IntegralNumber ?? 0);
TotalIntegralNumber += (item.IntegralNumber ?? 0);
}
}
}
}
}
var umodel = member_UserRepository.GetEntity(omodel.UserId);
var umodel = member_UserRepository.GetEntity(omodel.UserId);
//积分抵扣回滚
//积分抵扣回滚
if (TotalIntegralNumber > 0)
if (TotalIntegralNumber > 0)
...
@@ -8835,6 +9081,7 @@ namespace Mall.Module.Product
...
@@ -8835,6 +9081,7 @@ namespace Mall.Module.Product
});
});
}
}
}
}
}
goods_OrderRepository.DBSession.Commit();
goods_OrderRepository.DBSession.Commit();
if (flag && tenantId == 1)
if (flag && tenantId == 1)
{
{
...
...
Mall.Repository/Product/RB_Goods_TargetDateRepository.cs
View file @
badaf34f
...
@@ -34,6 +34,12 @@ namespace Mall.Repository.Product
...
@@ -34,6 +34,12 @@ namespace Mall.Repository.Product
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
DateTime
))
{
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
DateTime
))
{
where
+=
$@" and
{
nameof
(
RB_Goods_TargetDate
.
Date
)}
='
{
dmodel
.
DateTime
}
'"
;
where
+=
$@" and
{
nameof
(
RB_Goods_TargetDate
.
Date
)}
='
{
dmodel
.
DateTime
}
'"
;
}
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StartTime
))
{
where
+=
$@" and
{
nameof
(
RB_Goods_TargetDate
.
Date
)}
>='
{
dmodel
.
StartTime
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
where
+=
$@" and
{
nameof
(
RB_Goods_TargetDate
.
Date
)}
<='
{
dmodel
.
EndTime
}
23:59:59'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Month
))
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Month
))
{
{
where
+=
$@" and DATE_FORMAT(Date,'%Y-%m') ='
{
dmodel
.
Month
}
'"
;
where
+=
$@" and DATE_FORMAT(Date,'%Y-%m') ='
{
dmodel
.
Month
}
'"
;
...
...
Mall.WebApi/appsettings.json
View file @
badaf34f
{
{
"ConnectionStrings"
:
{
"ConnectionStrings"
:
{
"DefaultConnection"
:
"server=192.168.
2
.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall_3;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"DefaultConnection"
:
"server=192.168.
1
.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall_3;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"DefaultConnectionPName"
:
"MySql.Data.MySqlClient"
,
"DefaultConnectionPName"
:
"MySql.Data.MySqlClient"
,
"FinanceConnection"
:
"server=192.168.
2
.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"FinanceConnection"
:
"server=192.168.
1
.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"FinanceConnectionPName"
:
"MySql.Data.MySqlClient"
,
"FinanceConnectionPName"
:
"MySql.Data.MySqlClient"
,
"UserConnection"
:
"server=192.168.
2
.214;user id=reborn;password=Reborn@2018;database=reborn_user;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"UserConnection"
:
"server=192.168.
1
.214;user id=reborn;password=Reborn@2018;database=reborn_user;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"UserConnectionPName"
:
"MySql.Data.MySqlClient"
,
"UserConnectionPName"
:
"MySql.Data.MySqlClient"
,
"PropertyConnection"
:
"server=192.168.
2
.214;user id=reborn;password=Reborn@2018;database=test_property;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"PropertyConnection"
:
"server=192.168.
1
.214;user id=reborn;password=Reborn@2018;database=test_property;CharSet=utf8mb4; Convert Zero Datetime=true; "
,
"PropertyConnectionPName"
:
"MySql.Data.MySqlClient"
"PropertyConnectionPName"
:
"MySql.Data.MySqlClient"
},
},
"Logging"
:
{
"Logging"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment