Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
enterprise-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
enterprise-platform
Commits
06abac86
Commit
06abac86
authored
Dec 26, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品增加上下架属性
parent
d291d231
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1455 additions
and
1179 deletions
+1455
-1179
db/add.sql
db/add.sql
+4
-0
doc/企业服务平台 .docx
doc/企业服务平台 .docx
+0
-0
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/ProductApiController.java
...m/mortals/xhx/busiz/applets/web/ProductApiController.java
+1
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/product/model/ProductEntity.java
...a/com/mortals/xhx/module/product/model/ProductEntity.java
+51
-46
enterprise-manager/src/main/java/com/mortals/xhx/module/product/model/ProductQuery.java
...va/com/mortals/xhx/module/product/model/ProductQuery.java
+674
-524
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
...s/xhx/module/product/service/impl/ProductServiceImpl.java
+4
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/product/web/ProductController.java
...com/mortals/xhx/module/product/web/ProductController.java
+1
-0
enterprise-manager/src/main/resources/sqlmap/module/product/ProductMapper.xml
...rc/main/resources/sqlmap/module/product/ProductMapper.xml
+720
-609
No files found.
db/add.sql
View file @
06abac86
...
...
@@ -116,3 +116,7 @@ PRIMARY KEY (`id`)
ALTER
TABLE
mortals_xhx_company
ADD
COLUMN
`background`
varchar
(
256
)
default
''
COMMENT
'背景图片'
;
ALTER
TABLE
`mortals_xhx_favorites_businesscard`
CHANGE
`staffId`
`bussinesscardId`
bigint
(
20
)
NOT
NULL
COMMENT
'名片ID, 关联到名片表中的ID,表示这是哪个名片的收藏'
;
-- ----------------------------
-- 2024-12-26
-- ----------------------------
ALTER
TABLE
`mortals_xhx_product`
ADD
COLUMN
`shelves`
tinyint
(
1
)
DEFAULT
'1'
COMMENT
'是否上架(0.否,1.是)'
;
doc/企业服务平台 .docx
View file @
06abac86
No preview for this file type
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/ProductApiController.java
View file @
06abac86
...
...
@@ -85,6 +85,7 @@ public class ProductApiController extends AbstractBaseController<ProductReq>{
query
.
setCategoryId
(
String
.
valueOf
(
productReq
.
getCategoryId
()));
}
query
.
setHot
(
productReq
.
getHot
());
query
.
setShelves
(
1
);
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"publishTime"
,
OrderCol
.
DESCENDING
)));
Result
<
ProductEntity
>
result
=
productService
.
find
(
query
,
pageInfo
,
context
);
List
<
ProductEntity
>
collect
=
result
.
getList
().
stream
().
map
(
item
->
{
...
...
enterprise-manager/src/main/java/com/mortals/xhx/module/product/model/ProductEntity.java
View file @
06abac86
...
...
@@ -13,70 +13,74 @@ import com.mortals.xhx.module.product.model.vo.ProductVo;
import
com.mortals.xhx.module.product.model.ProductQuestionEntity
;
import
lombok.Data
;
/**
* 产品实体对象
*
* @author zxfei
* @date 2023-09-18
*/
* 产品实体对象
*
* @author zxfei
* @date 2024-12-26
*/
@Data
public
class
ProductEntity
extends
ProductVo
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 产品名称,名称唯一
*/
* 产品名称,名称唯一
*/
@Excel
(
name
=
"产品名称,名称唯一"
)
private
String
productName
;
/**
* 产品编码
*/
* 产品编码
*/
private
String
productCode
;
/**
* 产品slogan
*/
* 产品slogan
*/
private
String
productSlogan
;
/**
* 产品图标
*/
* 产品图标
*/
private
String
productLogoPath
;
/**
* 产品封面图片
*/
* 产品封面图片
*/
private
String
productFacePath
;
/**
* 产品视频,多个视频逗号分割
*/
* 产品视频,多个视频逗号分割
*/
private
String
productVideoPath
;
/**
* 产品宣传图片,多个视频逗号分割
*/
* 产品宣传图片,多个视频逗号分割
*/
private
String
productPicPath
;
/**
* 产品介绍
*/
* 产品介绍
*/
private
String
productIntroduction
;
/**
* 产品详情
*/
* 产品详情
*/
private
String
productDetail
;
/**
* 发布时间
*/
* 发布时间
*/
private
Date
publishTime
;
/**
* 是否热门(0.否,1.是)
*/
* 是否热门(0.否,1.是)
*/
private
Integer
hot
;
/**
* 备注
*/
* 备注
*/
private
String
productRemark
;
/**
* 产品常见问题信息
*/
* 是否上架(0.否,1.是)
*/
private
Integer
shelves
;
/**
* 产品常见问题信息
*/
private
List
<
ProductQuestionEntity
>
productQuestionList
=
new
ArrayList
<>();;
public
List
<
ProductQuestionEntity
>
getProductQuestionList
(){
return
productQuestionList
;
return
productQuestionList
;
}
public
void
setProductQuestionList
(
List
<
ProductQuestionEntity
>
productQuestionList
){
...
...
@@ -84,7 +88,7 @@ public class ProductEntity extends ProductVo {
}
@Override
public
int
hashCode
()
{
return
this
.
getId
().
hashCode
();
return
this
.
getId
().
hashCode
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
...
...
@@ -92,24 +96,25 @@ public class ProductEntity extends ProductVo {
if
(
obj
instanceof
ProductEntity
)
{
ProductEntity
tmp
=
(
ProductEntity
)
obj
;
if
(
this
.
getId
()
==
tmp
.
getId
())
{
return
true
;
return
true
;
}
}
return
false
;
}
public
void
initAttrValue
(){
this
.
productName
=
""
;
this
.
productCode
=
""
;
this
.
productSlogan
=
""
;
this
.
productLogoPath
=
""
;
this
.
productFacePath
=
""
;
this
.
productVideoPath
=
""
;
this
.
productPicPath
=
""
;
this
.
productIntroduction
=
""
;
this
.
productDetail
=
""
;
this
.
publishTime
=
new
Date
();
this
.
hot
=
0
;
this
.
productRemark
=
""
;
this
.
productName
=
""
;
this
.
productCode
=
""
;
this
.
productSlogan
=
""
;
this
.
productLogoPath
=
""
;
this
.
productFacePath
=
""
;
this
.
productVideoPath
=
""
;
this
.
productPicPath
=
""
;
this
.
productIntroduction
=
""
;
this
.
productDetail
=
""
;
this
.
publishTime
=
new
Date
();
this
.
hot
=
0
;
this
.
productRemark
=
""
;
this
.
shelves
=
1
;
}
}
\ No newline at end of file
enterprise-manager/src/main/java/com/mortals/xhx/module/product/model/ProductQuery.java
View file @
06abac86
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
View file @
06abac86
...
...
@@ -76,6 +76,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
//过滤热门与非热门
productList
=
productList
.
stream
().
filter
(
f
->
f
.
getHot
()
==
hot
).
collect
(
Collectors
.
toList
());
}
productList
=
productList
.
stream
().
filter
(
f
->
f
.
getShelves
()
==
1
).
collect
(
Collectors
.
toList
());
productList
=
productList
.
stream
().
sorted
(
Comparator
.
comparing
(
ProductEntity:
:
getPublishTime
).
reversed
())
.
collect
(
Collectors
.
toList
());
productEntityResult
.
setList
(
productList
);
...
...
@@ -91,6 +92,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
//过滤热门与非热门
productList
=
productList
.
stream
().
filter
(
f
->
f
.
getHot
()
==
hot
).
collect
(
Collectors
.
toList
());
}
productList
=
productList
.
stream
().
filter
(
f
->
f
.
getShelves
()
==
1
).
collect
(
Collectors
.
toList
());
productList
=
productList
.
stream
().
sorted
(
Comparator
.
comparing
(
ProductEntity:
:
getPublishTime
).
reversed
())
.
collect
(
Collectors
.
toList
());
productEntityResult
.
setList
(
productList
);
...
...
@@ -111,6 +113,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
//过滤热门与非热门
collect
=
collect
.
stream
().
filter
(
f
->
f
.
getHot
()
==
hot
).
collect
(
Collectors
.
toList
());
}
collect
=
collect
.
stream
().
filter
(
f
->
f
.
getShelves
()
==
1
).
collect
(
Collectors
.
toList
());
collect
=
collect
.
stream
().
sorted
(
Comparator
.
comparing
(
ProductEntity:
:
getPublishTime
).
reversed
())
.
collect
(
Collectors
.
toList
());
productEntityResult
.
setList
(
collect
);
...
...
@@ -155,6 +158,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
}
});
}
productList
=
productList
.
stream
().
filter
(
f
->
f
.
getShelves
()
==
1
).
collect
(
Collectors
.
toList
());
productList
=
productList
.
stream
().
sorted
(
Comparator
.
comparing
(
ProductEntity:
:
getPublishTime
).
reversed
())
.
collect
(
Collectors
.
toList
());
return
productList
;
...
...
enterprise-manager/src/main/java/com/mortals/xhx/module/product/web/ProductController.java
View file @
06abac86
...
...
@@ -74,6 +74,7 @@ public class ProductController extends BaseCRUDJsonBodyMappingController<Product
this
.
addDict
(
model
,
"hot"
,
YesNoEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"categoryId"
,
categoryService
.
find
(
new
CategoryQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getName
(),
(
o
,
n
)
->
n
)));
this
.
addDict
(
model
,
"companyId"
,
companyService
.
find
(
new
CompanyQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getCompanyName
(),
(
o
,
n
)
->
n
)));
this
.
addDict
(
model
,
"shelves"
,
YesNoEnum
.
getEnumMap
());
super
.
init
(
model
,
context
);
}
...
...
enterprise-manager/src/main/resources/sqlmap/module/product/ProductMapper.xml
View file @
06abac86
This diff is collapsed.
Click to expand it.
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