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
58472ea7
Commit
58472ea7
authored
Sep 03, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
into sdzq-ld
parents
4bfdcc7a
3d2ca414
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
57 deletions
+68
-57
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+24
-20
FirstShopListModule.cs
Mall.Module.TradePavilion/FirstShopListModule.cs
+43
-35
AppletGoodsController.cs
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
+1
-2
No files found.
Mall.Module.Product/ProductModule.cs
View file @
58472ea7
...
...
@@ -1646,8 +1646,12 @@ namespace Mall.Module.Product
}
}
}
MaxSellMoney
=
model
.
SpecificationPriceList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
model
.
SellingPrice
=
model
.
SpecificationPriceList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
if
(
model
.
SpecificationPriceList
!=
null
&&
model
.
SpecificationPriceList
.
Count
>
0
)
{
MaxSellMoney
=
model
.
SpecificationPriceList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
model
.
SellingPrice
=
model
.
SpecificationPriceList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
}
decimal
MaxPrice
=
MaxSellMoney
+
Math
.
Ceiling
(
MaxSellMoney
/
10
);
if
(
MaxPrice
>
model
.
OriginalPrice
)
{
...
...
@@ -2141,8 +2145,8 @@ namespace Mall.Module.Product
{
attr_group_name
=
smodel
.
Name
,
attr_group_id
=
smodel
.
Sort
,
attr_id
=
svmodel
.
Id
,
attr_name
=
svmodel
.
Name
attr_id
=
svmodel
?.
Id
??
0
,
attr_name
=
svmodel
?.
Name
??
""
});
}
decimal
price_member
=
item
.
SellingPrice
??
0
;
//未设会员价格的话 就为销售价格
...
...
@@ -2352,11 +2356,14 @@ namespace Mall.Module.Product
}
else
{
if
(
model
.
IsCustomSpecification
==
1
&&
model
.
SpecificationPriceList
!=
null
&&
model
.
SpecificationPriceList
.
Count
>
0
)
{
price_member_min
=
price_min
=
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
).
Min
(
x
=>
x
.
SellingPrice
??
0
);
price_member_max
=
price_max
=
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
).
Max
(
x
=>
x
.
SellingPrice
??
0
);
var
tempList
=
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
)?.
ToList
()
??
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
if
(
tempList
!=
null
&&
tempList
.
Count
>
0
)
{
price_member_min
=
price_min
=
tempList
?.
Min
(
x
=>
x
.
SellingPrice
??
0
)
??
0
;
price_member_max
=
price_max
=
tempList
?.
Max
(
x
=>
x
.
SellingPrice
??
0
)
??
0
;
}
}
else
{
...
...
@@ -2458,9 +2465,6 @@ namespace Mall.Module.Product
}
}
List
<
RB_Goods_Preferential_Extend
>
goodsPreferentialList
=
new
List
<
RB_Goods_Preferential_Extend
>();
goodsPreferentialList
=
RB_Goods_PreferentialRepository
.
GetGoodsPreferentialListRepostory
(
new
RB_Goods_Preferential_Extend
{
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
GoodsId
=
model
.
Id
});
...
...
@@ -2476,9 +2480,9 @@ namespace Mall.Module.Product
categoryIdList
=
model
?.
CategoryList
?.
Select
(
x
=>
x
.
CategoryId
??
0
).
ToList
(),
status
=
model
.
GoodsStatus
,
isAllowShare
=
IsAllowShare
,
//是否可以分享
advertising
=
model
.
Advertising
,
//广告词
advertising
=
model
?.
Advertising
??
""
,
//广告词
price
=
model
.
SellingPrice
,
sendArea
=
model
.
SendArea
,
sendArea
=
model
?.
SendArea
??
""
,
use_attr
=
model
.
IsCustomSpecification
,
attr_groups
=
model
.
SpecificationList
.
Select
(
x
=>
new
{
...
...
@@ -2508,8 +2512,8 @@ namespace Mall.Module.Product
is_level_alone
=
model
.
SeparateSetMember
,
//是否单独设置会员价
share_type
=
model
.
SeparateDistributionMoneyType
,
//分销佣金类型
//sign = "",
app_share_pic
=
model
.
CustomShareImagePath
,
app_share_title
=
model
.
CustomShareTitles
,
app_share_pic
=
model
?.
CustomShareImagePath
??
""
,
app_share_title
=
model
?.
CustomShareTitles
??
""
,
is_default_services
=
model
.
IsDefaultService
,
sort
=
model
.
Sort
,
created_at
=
model
.
CreateDate
.
HasValue
?
model
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
...
...
@@ -2530,12 +2534,12 @@ namespace Mall.Module.Product
form_id
=
model
.
FormsId
,
sales
=
(
model
.
SalesNum
??
0
)
+
payment_num
,
//已售出数量 + 订单商品数量//
name
=
model
.
Name
,
subname
=
model
.
SubName
,
subname
=
model
?.
SubName
??
""
,
original_price
=
model
.
OriginalPrice
,
cover_pic
=
model
.
CoverImage
,
unit
=
model
.
Unit
,
detail
=
model
.
GoodsDetails
,
video_url
=
model
.
VideoAddress
,
video_url
=
model
?.
VideoAddress
??
""
,
level_show
=
(
userModel
?.
MemberGrade
??
0
)
>
0
?
1
:
2
,
//是否显示会员价
is_sales
=
model
.
GoodsStatus
==
1
&&
model
.
InventoryNum
>
0
?
1
:
2
,
//是否可购买
attr
=
priceList
,
...
...
@@ -2594,10 +2598,10 @@ namespace Mall.Module.Product
is_quick_shop
=
model
.
IsQuickBuy
,
is_sell_well
=
model
.
IsSellWell
,
is_negotiable
=
model
.
IsGoodsNegotiable
,
freeShippingName
=
model
.
FreeShippingModel
.
Name
,
fullMoneyPinkage
=
model
.
FreeShippingModel
.
FullMoneyPinkage
??
0
,
fullNumPinkage
=
model
.
FreeShippingModel
.
FullNumPinkage
??
0
,
freeShippingUrl
=
model
.
FreeShippingModel
.
FreeShippingUrl
,
freeShippingName
=
model
.
FreeShippingModel
?.
Name
??
""
,
fullMoneyPinkage
=
model
.
FreeShippingModel
?
.
FullMoneyPinkage
??
0
,
fullNumPinkage
=
model
?.
FreeShippingModel
?
.
FullNumPinkage
??
0
,
freeShippingUrl
=
model
?.
FreeShippingModel
?
.
FreeShippingUrl
,
marketingLogo
=
JsonHelper
.
Serialize
(
tempLogo
),
//分类
cats
=
model
.
CategoryList
.
Select
(
x
=>
new
...
...
Mall.Module.TradePavilion/FirstShopListModule.cs
View file @
58472ea7
...
...
@@ -1056,26 +1056,33 @@ namespace Mall.Module.TradePavilion
string
tempFoldr
=
""
;
#
region
解析表单内容
foreach
(
var
listItem
in
listModel
)
foreach
(
var
enrollItem
in
enrollList
.
GroupBy
(
x
=>
x
.
UserId
)
)
{
foreach
(
var
enrollModel
in
enrollList
.
Where
(
x
=>
x
.
ListId
==
listItem
.
Id
))
//榜单下面的公司
var
companyName
=
clist
.
Where
(
x
=>
x
.
CreateBy
==
enrollItem
.
Key
).
FirstOrDefault
()?.
CompanyName
??
System
.
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
var
nowEnroList
=
enrollList
.
Where
(
x
=>
x
.
UserId
==
enrollItem
.
Key
);
var
templistPath
=
Path
.
Combine
(
tempPath
+
"file\\"
+
timeStr
+
"\\"
+
companyName
+
"\\"
);
//路径
if
(!
Directory
.
Exists
(
templistPath
))
{
if
(
string
.
IsNullOrEmpty
(
enrollModel
.
Content
))
{
errorMsg
=
"报名内容不存在,请核实后再试"
;
return
""
;
}
List
<
FormDataItem
>
elist
=
JsonHelper
.
DeserializeObject
<
List
<
FormDataItem
>>(
enrollModel
.
Content
);
elist
=
elist
.
Where
(
x
=>
x
.
CompKey
==
"ImageUploadComp"
||
x
.
CompKey
==
"VideoUploadComp"
).
ToList
();
if
(
elist
.
Any
())
Directory
.
CreateDirectory
(
templistPath
);
}
foreach
(
var
item
in
nowEnroList
)
{
var
enrollModel
=
listModel
.
Where
(
x
=>
x
.
Id
==
item
.
ListId
).
FirstOrDefault
();
if
(
enrollModel
!=
null
&&
enrollModel
.
Id
>
0
)
{
var
companyName
=
clist
.
Where
(
x
=>
x
.
CreateBy
==
enrollModel
.
UserId
).
FirstOrDefault
()?.
CompanyName
??
System
.
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
var
templistPath
=
Path
.
Combine
(
tempPath
+
"file\\"
+
timeStr
+
"\\"
+
listItem
.
ListName
+
"\\"
+
companyName
+
"\\"
);
//路径
if
(!
Directory
.
Exists
(
templistPath
))
if
(
string
.
IsNullOrEmpty
(
item
.
Content
))
{
errorMsg
=
"报名内容不存在,请核实后再试"
;
return
""
;
}
List
<
FormDataItem
>
elist
=
JsonHelper
.
DeserializeObject
<
List
<
FormDataItem
>>(
item
.
Content
);
elist
=
elist
.
Where
(
x
=>
x
.
CompKey
==
"ImageUploadComp"
||
x
.
CompKey
==
"VideoUploadComp"
||
x
.
CompKey
==
"CommonUploadComp"
).
ToList
();
var
templistnowPath
=
Path
.
Combine
(
templistPath
+
enrollModel
.
ListName
+
"\\"
);
//路径
if
(!
Directory
.
Exists
(
templistnowPath
))
{
Directory
.
CreateDirectory
(
templistPath
);
Directory
.
CreateDirectory
(
templist
now
Path
);
}
//开始下载图片视频至临时文件
foreach
(
var
itemFile
in
elist
)
{
...
...
@@ -1096,7 +1103,7 @@ namespace Mall.Module.TradePavilion
{
Bitmap
bitmap
=
new
Bitmap
(
webResponse
.
GetResponseStream
());
bitmap
.
Save
(
templistPath
+
Path
.
GetFileName
(
qitem
),
System
.
Drawing
.
Imaging
.
ImageFormat
.
Jpeg
);
bitmap
.
Save
(
templist
now
Path
+
Path
.
GetFileName
(
qitem
),
System
.
Drawing
.
Imaging
.
ImageFormat
.
Jpeg
);
}
}
catch
(
Exception
ex
)
...
...
@@ -1105,12 +1112,11 @@ namespace Mall.Module.TradePavilion
}
}
}
else
if
(
itemFile
.
CompKey
==
"VideoUploadComp"
)
else
if
(
itemFile
.
CompKey
==
"VideoUploadComp"
||
itemFile
.
CompKey
==
"CommonUploadComp"
)
{
//视频处理
foreach
(
var
qitem
in
obj
.
FileList
)
{
try
{
HttpWebRequest
request
=
(
HttpWebRequest
)
WebRequest
.
Create
(
qitem
);
...
...
@@ -1133,7 +1139,7 @@ namespace Mall.Module.TradePavilion
stmMemory
.
Write
(
buffer
,
0
,
i
);
}
fileBytes
=
stmMemory
.
ToArray
();
//文件流Byte
FileStream
fs
=
new
FileStream
(
templistPath
+
Path
.
GetFileName
(
qitem
),
FileMode
.
OpenOrCreate
);
FileStream
fs
=
new
FileStream
(
templist
now
Path
+
Path
.
GetFileName
(
qitem
),
FileMode
.
OpenOrCreate
);
stmMemory
.
WriteTo
(
fs
);
stmMemory
.
Close
();
fs
.
Close
();
...
...
@@ -1149,6 +1155,7 @@ namespace Mall.Module.TradePavilion
}
}
}
#
endregion
var
templistZipPath
=
Path
.
Combine
(
tempPath
+
"zip\\"
+
timeStr
+
"\\"
);
//路径
if
(!
Directory
.
Exists
(
templistZipPath
))
{
...
...
@@ -1184,7 +1191,7 @@ namespace Mall.Module.TradePavilion
{
return
""
;
}
#
endregion
}
...
...
@@ -1201,18 +1208,19 @@ namespace Mall.Module.TradePavilion
{
//存储的临时文件地址
string
rootBook
=
AppDomain
.
CurrentDomain
.
BaseDirectory
;
string
tempPath
=
Path
.
Combine
(
rootBook
+
Url
.
TrimStart
(
'/'
));
#
region
解析表单内容
string
timeStr
=
Url
.
TrimStart
(
'/'
).
Split
(
"/"
)[
4
];
if
(!
File
.
Exists
(
tempPath
))
try
{
return
true
;
}
else
{
try
string
tempPath
=
Path
.
Combine
(
rootBook
+
Url
.
TrimStart
(
'/'
));
#
region
解析表单内容
string
timeStr
=
Url
.
TrimStart
(
'/'
).
Split
(
"/"
)[
4
];
if
(!
File
.
Exists
(
tempPath
))
{
return
true
;
}
else
{
DirectoryInfo
dir
=
new
DirectoryInfo
(
Path
.
Combine
(
rootBook
+
"upfile\\temporary\\firstshopenrollzip\\"
+
"zip\\"
));
DirectoryInfo
[]
dirArr
=
dir
.
GetDirectories
();
foreach
(
DirectoryInfo
item
in
dirArr
)
...
...
@@ -1227,15 +1235,15 @@ namespace Mall.Module.TradePavilion
}
}
return
true
;
}
catch
(
Exception
ex
)
{
return
false
;
}
}
}
catch
(
Exception
ex
)
{
return
false
;
}
#
endregion
...
...
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
View file @
58472ea7
...
...
@@ -444,7 +444,6 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
ParamIsNull
();
}
int
UserId
=
req
.
UserId
;
var
Robj
=
new
object
();
try
{
...
...
@@ -452,7 +451,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"GetAppletGoodsInfo
:{0}"
,
Common
.
Plugin
.
JsonHelper
.
Serialize
(
requestMsg
)
));
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"GetAppletGoodsInfo
_GoodsId:{0}"
,
GoodsId
));
}
return
ApiResult
.
Success
(
""
,
Robj
);
}
...
...
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