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
1980c6b3
Commit
1980c6b3
authored
Jan 30, 2024
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
0293d2a6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
241 additions
and
26 deletions
+241
-26
Mall.Education.csproj
Mall.Education/Mall.Education.csproj
+3
-2
RB_Goods_OrderDetail.cs
Mall.Model/Entity/Product/RB_Goods_OrderDetail.cs
+5
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+233
-24
No files found.
Mall.Education/Mall.Education.csproj
View file @
1980c6b3
...
...
@@ -51,8 +51,9 @@
<Reference
Include=
"Aliyun.OSS, Version=2.11.0.0, Culture=neutral, PublicKeyToken=0ad4175f0dac0b9b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Aliyun.OSS.SDK.2.11.0\lib\net45\Aliyun.OSS.dll
</HintPath>
</Reference>
<Reference
Include=
"Aspose.Pdf, Version=17.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Aspose.Pdf.17.1.0\lib\net40-client\Aspose.Pdf.dll
</HintPath>
<Reference
Include=
"Aspose.PDF, Version=23.4.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Aspose.PDF.23.4.0\lib\net4.0\Aspose.PDF.dll
</HintPath>
<Private>
True
</Private>
</Reference>
<Reference
Include=
"Aspose.Slides, Version=17.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Aspose.Slides.NET.17.1\lib\net4.0-client\Aspose.Slides.dll
</HintPath>
...
...
Mall.Model/Entity/Product/RB_Goods_OrderDetail.cs
View file @
1980c6b3
...
...
@@ -419,5 +419,10 @@ namespace Mall.Model.Entity.Product
/// 耗材对应的ID
/// </summary>
public
int
MaterialId
{
get
;
set
;
}
/// <summary>
/// 和平商旅下单自定义表单内容
/// </summary>
public
string
CustomFormInfo
{
get
;
set
;
}
}
}
Mall.Module.Product/ProductModule.cs
View file @
1980c6b3
...
...
@@ -221,6 +221,13 @@ namespace Mall.Module.Product
/// </summary>
private
readonly
RB_Goods_RelevanceRepository
goods_RelevanceRepository
=
new
RB_Goods_RelevanceRepository
();
/// <summary>
/// 关联商品仓储层对象
/// </summary>
private
readonly
Repository
.
TradePavilion
.
RB_Custom_FormRepository
custom_FormRepository
=
new
Repository
.
TradePavilion
.
RB_Custom_FormRepository
();
#
region
教育咖啡劵
/// <summary>
/// 教育商品
...
...
@@ -1477,6 +1484,195 @@ namespace Mall.Module.Product
#
endregion
#
region
自定义表单解析
/// <summary>
/// 解析表单组件
/// </summary>
/// <param name="formData"></param>
/// <param name="isGetAnswer"></param>
/// <returns></returns>
public
List
<
Model
.
Extend
.
TradePavilion
.
FormDataItem
>
AnalyzeFormComponent
(
string
formData
,
bool
isGetAnswer
=
false
)
{
List
<
Model
.
Extend
.
TradePavilion
.
FormDataItem
>
dataList
=
new
List
<
Model
.
Extend
.
TradePavilion
.
FormDataItem
>();
if
(!
string
.
IsNullOrEmpty
(
formData
))
{
JArray
jArray
=
JArray
.
Parse
(
formData
);
if
(
jArray
!=
null
&&
jArray
.
Count
>
0
)
{
foreach
(
var
jItem
in
jArray
)
{
JObject
jObj
=
JObject
.
Parse
(
jItem
.
ToString
());
Model
.
Extend
.
TradePavilion
.
FormDataItem
dataItem
=
new
Model
.
Extend
.
TradePavilion
.
FormDataItem
()
{
CompKey
=
jObj
.
GetStringValue
(
"CompKey"
),
CompData
=
new
object
(),
isCked
=
false
,
};
if
(!
string
.
IsNullOrEmpty
(
dataItem
.
CompKey
))
{
string
compData
=
jObj
.
GetStringValue
(
"CompData"
);
switch
(
dataItem
.
CompKey
)
{
//单行文本
case
"SingleLineText"
:
Model
.
Extend
.
TradePavilion
.
TextItem
txtItem
=
GetTextItem
(
compData
);
if
(!
isGetAnswer
)
{
txtItem
.
TextValue
=
""
;
}
dataItem
.
CompData
=
txtItem
;
break
;
//多行文本
case
"MultiLineText"
:
Model
.
Extend
.
TradePavilion
.
TextItem
multiItem
=
GetTextItem
(
compData
);
if
(!
isGetAnswer
)
{
multiItem
.
TextValue
=
""
;
}
dataItem
.
CompData
=
multiItem
;
break
;
//下拉框
case
"DorpDownList"
:
Model
.
Extend
.
TradePavilion
.
SelectItem
selectItem
=
GetSelectItem
(
compData
);
if
(!
isGetAnswer
)
{
selectItem
.
OptionValue
=
""
;
}
dataItem
.
CompData
=
selectItem
;
break
;
//图片上传组件
case
"ImageUploadComp"
:
Model
.
Extend
.
TradePavilion
.
UploadItem
imgItem
=
GetUploadItem
(
compData
);
if
(!
isGetAnswer
)
{
imgItem
.
FileList
=
new
List
<
string
>();
}
dataItem
.
CompData
=
imgItem
;
break
;
//视频上传组件
case
"VideoUploadComp"
:
Model
.
Extend
.
TradePavilion
.
UploadItem
videoItem
=
GetUploadItem
(
compData
);
if
(!
isGetAnswer
)
{
videoItem
.
FileList
=
new
List
<
string
>();
}
dataItem
.
CompData
=
videoItem
;
break
;
//通用上传组件
case
"CommonUploadComp"
:
Model
.
Extend
.
TradePavilion
.
UploadItem
commonUpload
=
GetUploadItem
(
compData
);
if
(!
isGetAnswer
)
{
commonUpload
.
FileList
=
new
List
<
string
>();
}
dataItem
.
CompData
=
commonUpload
;
break
;
}
dataList
.
Add
(
dataItem
);
}
}
}
}
return
dataList
;
}
/// <summary>
/// 获取文本框信息
/// </summary>
/// <param name="CompData"></param>
/// <returns></returns>
private
Model
.
Extend
.
TradePavilion
.
TextItem
GetTextItem
(
string
CompData
)
{
JObject
textObj
=
JObject
.
Parse
(
CompData
);
Model
.
Extend
.
TradePavilion
.
TextItem
txtItem
=
new
Model
.
Extend
.
TradePavilion
.
TextItem
()
{
Name
=
textObj
.
GetStringValue
(
"Name"
),
WordsLength
=
textObj
.
GetInt
(
"WordsLength"
),
IsRequire
=
textObj
.
GetBoolValue
(
"IsRequire"
),
Remark
=
textObj
.
GetStringValue
(
"Remark"
),
TextValue
=
textObj
.
GetStringValue
(
"TextValue"
),
};
return
txtItem
;
}
/// <summary>
/// 获取下拉框信息
/// </summary>
/// <param name="CompData"></param>
/// <returns></returns>
private
Model
.
Extend
.
TradePavilion
.
SelectItem
GetSelectItem
(
string
CompData
)
{
JObject
dropdownObj
=
JObject
.
Parse
(
CompData
);
Model
.
Extend
.
TradePavilion
.
SelectItem
selectItem
=
new
Model
.
Extend
.
TradePavilion
.
SelectItem
()
{
Name
=
dropdownObj
.
GetStringValue
(
"Name"
),
IsMultiple
=
dropdownObj
.
GetBoolValue
(
"IsMultiple"
),
IsRequire
=
dropdownObj
.
GetBoolValue
(
"IsRequire"
),
OptionList
=
new
List
<
Model
.
Extend
.
TradePavilion
.
SelectOption
>(),
Remark
=
dropdownObj
.
GetStringValue
(
"Remark"
),
};
if
(
selectItem
.
IsMultiple
)
{
List
<
int
>
valueList
=
Common
.
ConvertHelper
.
StringToList
(
dropdownObj
.
GetStringValue
(
"OptionValue"
).
Split
(
','
));
if
(
valueList
!=
null
&&
valueList
.
Count
>
0
)
{
selectItem
.
OptionValue
=
string
.
Join
(
","
,
valueList
);
}
}
else
{
selectItem
.
OptionValue
=
dropdownObj
.
GetStringValue
(
"OptionValue"
);
}
var
optionList
=
JArray
.
Parse
(
dropdownObj
.
GetStringValue
(
"OptionList"
));
if
(
optionList
!=
null
&&
optionList
.
Count
>
0
)
{
foreach
(
var
oItem
in
optionList
)
{
JObject
optionObj
=
JObject
.
Parse
(
oItem
.
ToString
());
Model
.
Extend
.
TradePavilion
.
SelectOption
option
=
new
Model
.
Extend
.
TradePavilion
.
SelectOption
()
{
Id
=
optionObj
.
GetInt
(
"Id"
),
Name
=
optionObj
.
GetStringValue
(
"Name"
),
};
selectItem
.
OptionList
.
Add
(
option
);
}
}
return
selectItem
;
}
/// <summary>
/// 获取上传配置信息
/// </summary>
/// <param name="CompData"></param>
/// <returns></returns>
private
Model
.
Extend
.
TradePavilion
.
UploadItem
GetUploadItem
(
string
CompData
)
{
JObject
uploadObj
=
JObject
.
Parse
(
CompData
);
Model
.
Extend
.
TradePavilion
.
UploadItem
uploadItem
=
new
Model
.
Extend
.
TradePavilion
.
UploadItem
()
{
Name
=
uploadObj
.
GetStringValue
(
"Name"
),
FileCount
=
uploadObj
.
GetInt
(
"FileCount"
),
FileType
=
uploadObj
.
GetStringValue
(
"FileType"
),
FileSizeLimit
=
uploadObj
.
GetInt
(
"FileSizeLimit"
),
Remark
=
uploadObj
.
GetStringValue
(
"Remark"
),
FileList
=
new
List
<
string
>(),
};
if
(!
string
.
IsNullOrEmpty
(
uploadObj
.
GetStringValue
(
"FileList"
)))
{
try
{
uploadItem
.
FileList
=
JsonHelper
.
DeserializeObject
<
List
<
string
>>(
uploadObj
.
GetStringValue
(
"FileList"
));
}
catch
{
}
}
return
uploadItem
;
}
#
endregion
/// <summary>
/// 获取小程序商品详情
/// </summary>
...
...
@@ -2175,8 +2371,8 @@ namespace Mall.Module.Product
{
attr_group_name
=
smodel
.
Name
,
attr_group_id
=
smodel
.
Sort
,
attr_id
=
svmodel
?.
Id
??
0
,
attr_name
=
svmodel
?.
Name
??
""
attr_id
=
svmodel
?.
Id
??
0
,
attr_name
=
svmodel
?.
Name
??
""
});
}
decimal
price_member
=
item
.
SellingPrice
??
0
;
//未设会员价格的话 就为销售价格
...
...
@@ -2430,6 +2626,15 @@ namespace Mall.Module.Product
GetGoodsOrderPeopleInfo
(
out
decimal
payment_amount
,
out
int
payment_num
,
out
int
payment_order
,
out
int
payment_people
,
goodsId
);
#
endregion
#
region
获取商品的自定义表单
Model
.
Entity
.
TradePavilion
.
RB_Custom_Form
customFormModel
=
new
Model
.
Entity
.
TradePavilion
.
RB_Custom_Form
();
if
(
model
.
FormsId
>
1
)
{
customFormModel
=
custom_FormRepository
.
GetEntity
(
model
.
FormsId
);
var
dataList
=
AnalyzeFormComponent
(
customFormModel
.
FormData
,
isGetAnswer
:
false
);
}
#
endregion
#
region
返回参数
string
shipping
=
""
;
...
...
@@ -2494,9 +2699,9 @@ namespace Mall.Module.Product
var
goodsRelevanceList
=
goods_RelevanceRepository
.
GetGoodsRelevanceListRepository
(
new
RB_Goods_Relevance_Extend
()
{
MallBaseId
=
model
.
MallBaseId
,
TenantId
=
model
.
TenantId
,
GoodsId
=
model
.
Id
MallBaseId
=
model
.
MallBaseId
,
TenantId
=
model
.
TenantId
,
GoodsId
=
model
.
Id
});
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
});
...
...
@@ -2520,13 +2725,13 @@ namespace Mall.Module.Product
use_attr
=
model
.
IsCustomSpecification
,
remark
=
model
?.
Remark
??
""
,
edu_data
=
eduDataJson
,
EduTeacherId
=
model
?.
EduTeacherId
??
0
,
EduTeacherId
=
model
?.
EduTeacherId
??
0
,
attr_groups
=
model
.
SpecificationList
.
Select
(
x
=>
new
{
attr_group_id
=
x
.
Sort
,
attr_group_name
=
x
.
Name
,
//购买次数(进阶小课堂使用)
service_time
=
model
.
ServiceTime
,
service_time
=
model
.
ServiceTime
,
attr_list
=
x
.
SpecificationValueList
.
Select
(
z
=>
new
{
attr_id
=
z
.
Sort
,
...
...
@@ -2560,7 +2765,7 @@ namespace Mall.Module.Product
//sign = "",
//model?.CustomShareImagePath??"",HK 2021-10-15修改
app_share_pic
=
""
,
app_share_title
=
model
?.
CustomShareTitles
??
""
,
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"
)
:
""
,
...
...
@@ -2579,15 +2784,16 @@ namespace Mall.Module.Product
area_type
=
x
.
AreaType
})
}
},
form_id
=
model
.
FormsId
,
//form_data_json= new { formData = !string.IsNullOrWhiteSpace(customFormModel.FormData)?JsonConvert.DeserializeObject<List<Model.Extend.TradePavilion.FormDataItem>>(customFormModel.FormData):new List<Model.Extend.TradePavilion.FormDataItem>(), formType=customFormModel.FormType },
sales
=
(
model
.
SalesNum
??
0
)
+
payment_num
,
//已售出数量 + 订单商品数量//
name
=
model
.
Name
,
subname
=
model
?.
SubName
??
""
,
subname
=
model
?.
SubName
??
""
,
original_price
=
model
.
OriginalPrice
,
jjxkt_original_price
=
oldOriginalPrice
,
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
,
...
...
@@ -2646,7 +2852,7 @@ namespace Mall.Module.Product
is_quick_shop
=
model
.
IsQuickBuy
,
is_sell_well
=
model
.
IsSellWell
,
is_negotiable
=
model
.
IsGoodsNegotiable
,
freeShippingName
=
model
.
FreeShippingModel
?.
Name
??
""
,
freeShippingName
=
model
.
FreeShippingModel
?.
Name
??
""
,
fullMoneyPinkage
=
model
.
FreeShippingModel
?.
FullMoneyPinkage
??
0
,
fullNumPinkage
=
model
?.
FreeShippingModel
?.
FullNumPinkage
??
0
,
freeShippingUrl
=
model
?.
FreeShippingModel
?.
FreeShippingUrl
,
...
...
@@ -7871,9 +8077,11 @@ namespace Mall.Module.Product
#
endregion
#
region
修改咖啡劵商品
if
(
goodsModel
.
GoodsEduType
==
1
||
goodsModel
.
GoodsEduType
==
2
)
{
if
(
goodsModel
.
GoodsEduType
==
1
||
goodsModel
.
GoodsEduType
==
2
)
{
var
eduGoodsMdoel
=
eduGoodsRepository
.
GetList
(
new
Model
.
Extend
.
Education
.
RB_Goods_ViewModel
()
{
MallBaseId
=
goodsModel
.
MallBaseId
,
MallGoodsId
=
goodsModel
.
Id
}).
FirstOrDefault
();
if
(
eduGoodsMdoel
!=
null
)
{
if
(
eduGoodsMdoel
!=
null
)
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
Model
.
Extend
.
Education
.
RB_Goods_ViewModel
.
CoverImage
),
demodel
.
CarouselImageList
.
Where
(
x
=>
x
.
Type
==
0
).
FirstOrDefault
()?.
Path
??
""
},
{
nameof
(
Model
.
Extend
.
Education
.
RB_Goods_ViewModel
.
GoodsName
),
demodel
.
Name
},
...
...
@@ -7939,7 +8147,7 @@ namespace Mall.Module.Product
Sort
=
item
.
Sort
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
IsDateFormat
=
item
.
IsDateFormat
,
IsDateFormat
=
item
.
IsDateFormat
,
});
if
(
sid
>
0
)
{
...
...
@@ -8041,7 +8249,8 @@ namespace Mall.Module.Product
}
}
if
(
demodel
.
GoodsEduType
==
1
||
demodel
.
GoodsEduType
==
2
)
{
if
(
demodel
.
GoodsEduType
==
1
||
demodel
.
GoodsEduType
==
2
)
{
//咖啡劵商品 (分布式事务 无法跨服保存)
eduGoodsRepository
.
Insert
(
new
Model
.
Entity
.
Coffee
.
RB_Goods
()
{
...
...
@@ -8120,8 +8329,8 @@ namespace Mall.Module.Product
{
SName
=
smodel
.
Name
,
SId
=
smodel
.
Id
,
SVId
=
svmodel
?.
Sort
??
0
,
SVName
=
svmodel
?.
Name
??
""
,
SVId
=
svmodel
?.
Sort
??
0
,
SVName
=
svmodel
?.
Name
??
""
,
});
}
item
.
AttrList
=
AttrList
;
...
...
@@ -8410,7 +8619,7 @@ namespace Mall.Module.Product
{
model
.
FormsName
=
"默认表单"
;
}
model
.
RelevanceList
=
goods_RelevanceRepository
.
GetGoodsRelevanceListRepository
(
new
RB_Goods_Relevance_Extend
()
model
.
RelevanceList
=
goods_RelevanceRepository
.
GetGoodsRelevanceListRepository
(
new
RB_Goods_Relevance_Extend
()
{
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
...
...
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