Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
fd4ccea0
Commit
fd4ccea0
authored
Aug 05, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
906983db
c95042c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
57 deletions
+68
-57
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+68
-57
No files found.
Edu.Module.Course/CourseModule.cs
View file @
fd4ccea0
...
...
@@ -1737,7 +1737,7 @@ namespace Edu.Module.Course
GoodsNumbers
=
item
.
ClassNo
,
GoodsWeight
=
0
,
InventoryNum
=
item
.
ClassPersion
-
item
.
OrderStudentCount
,
//暂
SellingPrice
=
item
.
SellPrice
,
SellingPrice
=
model
.
SellPrice
,
SpecificationSort
=
Sort
.
ToString
(),
//暂定
AttrList
=
new
object
()
};
...
...
@@ -2061,85 +2061,96 @@ namespace Edu.Module.Course
{
bool
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
if
(
courseModel
.
MallGoodsId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
SellingPrice
),
courseModel
.
SellPrice
},
{
nameof
(
RB_Goods
.
OriginalPrice
),
courseModel
.
OriginalPrice
},
};
flag
=
mallGoodsRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Goods
.
Id
),
courseModel
.
MallGoodsId
));
var
oldList
=
MallGoodsPreferentialRepository
.
GetGoodsPreferentialListRepostory
(
new
RB_Goods_Preferential_Extend
()
{
GoodsId
=
courseModel
.
MallGoodsId
});
flag
=
mallGoodsRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Goods
.
Id
),
courseModel
.
MallGoodsId
));
var
oldList
=
MallGoodsPreferentialRepository
.
GetGoodsPreferentialListRepostory
(
new
RB_Goods_Preferential_Extend
()
{
GoodsId
=
courseModel
.
MallGoodsId
});
List
<
RB_Goods_Preferential_Extend
>
goodsPreferentialLsit
=
new
List
<
RB_Goods_Preferential_Extend
>();
foreach
(
var
item
in
list
)
{
RB_Goods_Preferential_Extend
goodsPreferential
=
new
RB_Goods_Preferential_Extend
()
List
<
RB_Goods_Preferential_Extend
>
goodsPreferentialLsit
=
new
List
<
RB_Goods_Preferential_Extend
>();
foreach
(
var
item
in
list
)
{
Id
=
0
,
GoodsId
=
courseModel
.
MallGoodsId
,
PreferentialTerms
=
item
.
PreferentialTerms
,
SaleCommissionType
=
item
.
SaleCommissionType
,
SaleCommissionMoney
=
item
.
SaleCommissionMoney
,
B2BCommissionType
=
item
.
B2BCommissionType
,
B2BCommissionMoney
=
item
.
B2BCommissionMoney
,
PriceDiscountType
=
item
.
PriceDiscountType
,
BuyNum
=
item
.
BuyNum
,
SendNum
=
item
.
SendNum
,
PriceType
=
item
.
PriceType
,
PriceMoney
=
item
.
PriceMoney
,
TenantId
=
Convert
.
ToInt32
(
Config
.
JHTenantId
),
MallBaseId
=
Convert
.
ToInt32
(
Config
.
JHMallBaseId
),
Status
=
0
,
EduCommissionType
=
item
.
EduCommissionType
,
EduCommissionMoney
=
item
.
EduCommissionMoney
};
goodsPreferentialLsit
.
Add
(
goodsPreferential
);
}
RB_Goods_Preferential_Extend
goodsPreferential
=
new
RB_Goods_Preferential_Extend
()
{
Id
=
0
,
GoodsId
=
courseModel
.
MallGoodsId
,
PreferentialTerms
=
item
.
PreferentialTerms
,
SaleCommissionType
=
item
.
SaleCommissionType
,
SaleCommissionMoney
=
item
.
SaleCommissionMoney
,
B2BCommissionType
=
item
.
B2BCommissionType
,
B2BCommissionMoney
=
item
.
B2BCommissionMoney
,
PriceDiscountType
=
item
.
PriceDiscountType
,
BuyNum
=
item
.
BuyNum
,
SendNum
=
item
.
SendNum
,
PriceType
=
item
.
PriceType
,
PriceMoney
=
item
.
PriceMoney
,
TenantId
=
Convert
.
ToInt32
(
Config
.
JHTenantId
),
MallBaseId
=
Convert
.
ToInt32
(
Config
.
JHMallBaseId
),
Status
=
0
,
EduCommissionType
=
item
.
EduCommissionType
,
EduCommissionMoney
=
item
.
EduCommissionMoney
};
goodsPreferentialLsit
.
Add
(
goodsPreferential
);
}
if
(
oldList
==
null
||
!
oldList
.
Any
())
{
foreach
(
var
item
in
goodsPreferentialLsit
)
{
flag
=
MallGoodsPreferentialRepository
.
Insert
(
item
)
>
0
;
var
splist
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsId
=
courseModel
.
MallGoodsId
,
TenantId
=
Convert
.
ToInt32
(
Config
.
JHTenantId
),
MallBaseId
=
Convert
.
ToInt32
(
Config
.
JHMallBaseId
)
});
if
(
splist
!=
null
&&
splist
.
Any
())
{
splist
.
ForEach
(
x
=>
x
.
SellingPrice
=
courseModel
.
SellPrice
);
goods_SpecificationPriceRepository
.
UpdateBatch
(
splist
);
}
}
//原来有优惠数据
else
{
if
(
list
==
null
||
(
list
!=
null
&&
list
.
Count
==
0
))
if
(
oldList
==
null
||
!
oldList
.
Any
())
{
flag
=
MallGoodsPreferentialRepository
.
DeleteGoodsPreferentialRepostory
(
courseModel
.
MallGoodsId
);
foreach
(
var
item
in
goodsPreferentialLsit
)
{
flag
=
MallGoodsPreferentialRepository
.
Insert
(
item
)
>
0
;
}
}
//原来有优惠数据
else
{
//找出差异的数据
var
deleteList
=
oldList
.
Where
(
qitem
=>
!
goodsPreferentialLsit
.
Any
(
oldItem
=>
qitem
.
PriceDiscountType
==
oldItem
.
PriceDiscountType
)).
ToList
();
foreach
(
var
dItem
in
deleteList
)
if
(
list
==
null
||
(
list
!=
null
&&
list
.
Count
==
0
))
{
if
(
dItem
.
Id
>
0
)
{
flag
=
MallGoodsPreferentialRepository
.
Delete
(
dItem
.
Id
)
>
0
;
}
flag
=
MallGoodsPreferentialRepository
.
DeleteGoodsPreferentialRepostory
(
courseModel
.
MallGoodsId
);
}
foreach
(
var
priceItem
in
goodsPreferentialLsit
)
else
{
var
nowItem
=
oldList
.
Where
(
x
=>
x
.
PriceDiscountType
==
priceItem
.
PriceDiscountType
).
FirstOrDefault
();
if
(
nowItem
!=
null
&&
nowItem
.
Id
>
0
)
//找出差异的数据
var
deleteList
=
oldList
.
Where
(
qitem
=>
!
goodsPreferentialLsit
.
Any
(
oldItem
=>
qitem
.
PriceDiscountType
==
oldItem
.
PriceDiscountType
)).
ToList
();
foreach
(
var
dItem
in
deleteList
)
{
priceItem
.
Id
=
nowItem
.
Id
;
if
(
dItem
.
Id
>
0
)
{
flag
=
MallGoodsPreferentialRepository
.
Delete
(
dItem
.
Id
)
>
0
;
}
}
if
(
priceItem
.
Id
==
0
)
foreach
(
var
priceItem
in
goodsPreferentialLsit
)
{
flag
=
MallGoodsPreferentialRepository
.
Insert
(
priceItem
)
>
0
;
}
else
{
flag
=
MallGoodsPreferentialRepository
.
Update
(
priceItem
);
var
nowItem
=
oldList
.
Where
(
x
=>
x
.
PriceDiscountType
==
priceItem
.
PriceDiscountType
).
FirstOrDefault
();
if
(
nowItem
!=
null
&&
nowItem
.
Id
>
0
)
{
priceItem
.
Id
=
nowItem
.
Id
;
}
if
(
priceItem
.
Id
==
0
)
{
flag
=
MallGoodsPreferentialRepository
.
Insert
(
priceItem
)
>
0
;
}
else
{
flag
=
MallGoodsPreferentialRepository
.
Update
(
priceItem
);
}
}
}
}
}
return
flag
;
}
...
...
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