Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
lanbaoming
jiedao-api-boot-master
Commits
0745eae1
Commit
0745eae1
authored
Dec 02, 2024
by
zhengyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品列表返回值修正
parent
717846cc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
68 additions
and
10 deletions
+68
-10
ProductBaseVO.java
...ocoder/yudao/module/product/vo/product/ProductBaseVO.java
+6
-0
ProductMapper.java
...yudao/module/product/dal/mysql/product/ProductMapper.java
+1
-0
ProductService.java
.../yudao/module/product/service/product/ProductService.java
+1
-1
ProductServiceImpl.java
...dule/product/service/product/impl/ProductServiceImpl.java
+15
-4
ProductExportReqVO.java
...r/yudao/module/product/vo/product/ProductExportReqVO.java
+4
-0
ProductMapper.xml
...-core/src/main/resources/mapper/product/ProductMapper.xml
+37
-0
ProductController.java
...e/product/controller/admin/product/ProductController.java
+2
-3
AppProductController.java
.../product/controller/app/product/AppProductController.java
+2
-2
No files found.
yudao-module-product/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/vo/product/ProductBaseVO.java
View file @
0745eae1
...
@@ -17,6 +17,12 @@ public class ProductBaseVO {
...
@@ -17,6 +17,12 @@ public class ProductBaseVO {
@NotNull
(
message
=
"商品类型id不能为空"
)
@NotNull
(
message
=
"商品类型id不能为空"
)
private
Long
typeId
;
private
Long
typeId
;
@ApiModelProperty
(
value
=
"商品类型中文名称"
)
private
String
typeTitleZh
;
@ApiModelProperty
(
value
=
"商品类型英文名称"
)
private
String
typeTitleEn
;
@ApiModelProperty
(
value
=
"商品特效id"
,
required
=
true
)
@ApiModelProperty
(
value
=
"商品特效id"
,
required
=
true
)
@NotNull
(
message
=
"商品属性id不能为空"
)
@NotNull
(
message
=
"商品属性id不能为空"
)
private
String
attrId
;
private
String
attrId
;
...
...
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/product/ProductMapper.java
View file @
0745eae1
...
@@ -377,4 +377,5 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
...
@@ -377,4 +377,5 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
})
})
List
<
ProductDO
>
randomTemplateProdData
(
@Param
(
"num"
)
Integer
num
);
List
<
ProductDO
>
randomTemplateProdData
(
@Param
(
"num"
)
Integer
num
);
List
<
ProductRespVO
>
getProductList
(
@Param
(
"reqVO"
)
ProductExportReqVO
reqVO
);
}
}
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/service/product/ProductService.java
View file @
0745eae1
...
@@ -90,7 +90,7 @@ public interface ProductService {
...
@@ -90,7 +90,7 @@ public interface ProductService {
* @param exportReqVO 查询条件
* @param exportReqVO 查询条件
* @return 产品列表
* @return 产品列表
*/
*/
List
<
Product
DO
>
getProductList
(
ProductExportReqVO
exportR
eqVO
);
List
<
Product
RespVO
>
getProductList
(
ProductExportReqVO
r
eqVO
);
List
<
ProductTypeNumVO
>
getProductTypeNumList
(
List
<
Long
>
typeIdList
);
List
<
ProductTypeNumVO
>
getProductTypeNumList
(
List
<
Long
>
typeIdList
);
...
...
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/service/product/impl/ProductServiceImpl.java
View file @
0745eae1
...
@@ -437,11 +437,22 @@ public class ProductServiceImpl implements ProductService {
...
@@ -437,11 +437,22 @@ public class ProductServiceImpl implements ProductService {
}
}
@Override
@Override
public
List
<
Product
DO
>
getProductList
(
ProductExportReqVO
exportR
eqVO
)
{
public
List
<
Product
RespVO
>
getProductList
(
ProductExportReqVO
r
eqVO
)
{
if
(
exportR
eqVO
.
isFilter
())
{
if
(
r
eqVO
.
isFilter
())
{
exportR
eqVO
.
setAuditStatus
(
2
);
r
eqVO
.
setAuditStatus
(
2
);
}
}
return
productMapper
.
selectList
(
exportReqVO
);
reqVO
.
setStatus
(
0
);
String
ids
=
reqVO
.
getIds
();
List
<
Long
>
idList
=
null
;
if
(
StringUtils
.
isNotEmpty
(
ids
))
{
String
[]
idArray
=
ids
.
split
(
","
);
idList
=
Arrays
.
asList
(
idArray
).
stream
()
.
map
(
Long:
:
valueOf
)
.
collect
(
Collectors
.
toList
());
reqVO
.
setProdIds
(
idList
);
}
// return productMapper.selectList(reqVO);
return
productMapper
.
getProductList
(
reqVO
);
}
}
@Override
@Override
...
...
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/vo/product/ProductExportReqVO.java
View file @
0745eae1
...
@@ -78,6 +78,10 @@ public class ProductExportReqVO {
...
@@ -78,6 +78,10 @@ public class ProductExportReqVO {
@ApiModelProperty
(
value
=
"商品ID列表,多个以逗号分割"
)
@ApiModelProperty
(
value
=
"商品ID列表,多个以逗号分割"
)
private
String
ids
;
private
String
ids
;
@ApiModelProperty
(
value
=
"商品ID列表"
)
private
List
<
Long
>
prodIds
;
private
boolean
filter
=
true
;
private
boolean
filter
=
true
;
}
}
yudao-module-product/yudao-module-product-core/src/main/resources/mapper/product/ProductMapper.xml
View file @
0745eae1
...
@@ -13,5 +13,42 @@
...
@@ -13,5 +13,42 @@
and deleted=0
and deleted=0
GROUP BY type_id
GROUP BY type_id
</select>
</select>
<select
id=
"getProductList"
resultType=
"cn.iocoder.yudao.module.product.vo.product.ProductRespVO"
>
SELECT p.*
t.title_zh as type_title_zh,
t.title_en as type_title_en
from ecw_product p left join ecw_product_type t on p.type_id = t.id
where
p.deleted=0
<if
test=
"reqVO.typeId != null"
>
and p.type_id = #{reqVO.typeId}
</if>
<if
test=
"reqVO.auditStatus != null"
>
and p.audit_status = #{reqVO.auditStatus}
</if>
<if
test=
"reqVO.status != null"
>
and p.status = #{reqVO.status}
</if>
<if
test=
"reqVO.productCode != null and reqVO.productCode != '' "
>
and p.product_code like concat("%",concat(#{reqVO.productCode},"%"))
</if>
<if
test=
"reqVO.customsCode != null and reqVO.customsCode != '' "
>
and p.customs_code like concat("%",concat(#{reqVO.customsCode},"%"))
</if>
<if
test=
"reqVO.typeIds != null and reqVO.typeIds.size() > 0"
>
and p.type_id in
<foreach
item=
"typeId"
collection=
"reqVO.typeIds"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{typeId}
</foreach>
</if>
<if
test=
"reqVO.prodIds != null and reqVO.prodIds.size() > 0"
>
and p.id in
<foreach
item=
"id"
collection=
"reqVO.prodIds"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</if>
GROUP BY type_id
</select>
</mapper>
</mapper>
\ No newline at end of file
yudao-module-product/yudao-module-product-rest/src/main/java/cn/iocoder/yudao/module/product/controller/admin/product/ProductController.java
View file @
0745eae1
...
@@ -116,15 +116,14 @@ public class ProductController {
...
@@ -116,15 +116,14 @@ public class ProductController {
@ApiOperation
(
"获得商品列表"
)
@ApiOperation
(
"获得商品列表"
)
// @PreAuthorize("@ss.hasPermission('ecw:product:query')")
// @PreAuthorize("@ss.hasPermission('ecw:product:query')")
public
CommonResult
<
List
<
ProductRespVO
>>
getProductList
(
ProductExportReqVO
req
)
{
public
CommonResult
<
List
<
ProductRespVO
>>
getProductList
(
ProductExportReqVO
req
)
{
List
<
ProductDO
>
list
=
productService
.
getProductList
(
req
);
List
<
ProductRespVO
>
list
=
productService
.
getProductList
(
req
);
List
<
ProductRespVO
>
productList
=
ProductConvert
.
INSTANCE
.
convertList
(
list
);
// if(CollectionUtil.isNotEmpty(productList)) {
// if(CollectionUtil.isNotEmpty(productList)) {
// for (ProductRespVO productRespVO : productList) {
// for (ProductRespVO productRespVO : productList) {
// productRespVO.setCreatorName(adminUserApi.getUserName(productRespVO.getCreator()));
// productRespVO.setCreatorName(adminUserApi.getUserName(productRespVO.getCreator()));
// productRespVO.setUpdaterName(adminUserApi.getUserName(productRespVO.getUpdater()));
// productRespVO.setUpdaterName(adminUserApi.getUserName(productRespVO.getUpdater()));
// }
// }
// }
// }
return
success
(
productL
ist
);
return
success
(
l
ist
);
}
}
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
...
...
yudao-module-product/yudao-module-product-rest/src/main/java/cn/iocoder/yudao/module/product/controller/app/product/AppProductController.java
View file @
0745eae1
...
@@ -51,8 +51,8 @@ public class AppProductController {
...
@@ -51,8 +51,8 @@ public class AppProductController {
@ApiOperation
(
"获得商品列表"
)
@ApiOperation
(
"获得商品列表"
)
@PreAuthenticated
@PreAuthenticated
public
CommonResult
<
List
<
ProductRespVO
>>
getProductList
(
ProductExportReqVO
req
)
{
public
CommonResult
<
List
<
ProductRespVO
>>
getProductList
(
ProductExportReqVO
req
)
{
List
<
Product
D
O
>
list
=
productService
.
getProductList
(
req
);
List
<
Product
RespV
O
>
list
=
productService
.
getProductList
(
req
);
return
success
(
ProductConvert
.
INSTANCE
.
convertList
(
list
)
);
return
success
(
list
);
}
}
...
...
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