Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
d569bfda
提交
d569bfda
authored
6月 10, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增:web首页分类信息
上级
54b07385
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
96 行增加
和
23 行删除
+96
-23
ProductMallController.java
...in/java/com/mmc/pms/controller/ProductMallController.java
+20
-12
CategoriesDao.java
src/main/java/com/mmc/pms/dao/CategoriesDao.java
+2
-0
Categories.java
src/main/java/com/mmc/pms/entity/Categories.java
+5
-0
CategoryTypeDTO.java
...ava/com/mmc/pms/model/categories/dto/CategoryTypeDTO.java
+22
-0
GoodsInfoServiceImpl.java
...n/java/com/mmc/pms/service/Impl/GoodsInfoServiceImpl.java
+8
-8
WebDeviceServiceImpl.java
...n/java/com/mmc/pms/service/Impl/WebDeviceServiceImpl.java
+20
-0
WebDeviceService.java
src/main/java/com/mmc/pms/service/WebDeviceService.java
+3
-0
CategoriesDao.xml
src/main/resources/mapper/CategoriesDao.xml
+13
-0
WebDeviceDao.xml
src/main/resources/mapper/WebDeviceDao.xml
+2
-3
not-check.yml
src/main/resources/not-check.yml
+1
-0
没有找到文件。
src/main/java/com/mmc/pms/controller/ProductMallController.java
浏览文件 @
d569bfda
...
@@ -3,14 +3,12 @@ package com.mmc.pms.controller;
...
@@ -3,14 +3,12 @@ package com.mmc.pms.controller;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.constant.TokenConstant
;
import
com.mmc.pms.constant.TokenConstant
;
import
com.mmc.pms.model.categories.dto.CategoryTypeDTO
;
import
com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO
;
import
com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO
;
import
com.mmc.pms.model.qo.WareInfoQO
;
import
com.mmc.pms.model.qo.WareInfoQO
;
import
com.mmc.pms.model.sale.dto.MallGoodsDetailDTO
;
import
com.mmc.pms.model.sale.dto.MallGoodsDetailDTO
;
import
com.mmc.pms.service.WebDeviceService
;
import
com.mmc.pms.service.WebDeviceService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.*
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -33,11 +31,12 @@ public class ProductMallController extends BaseController {
...
@@ -33,11 +31,12 @@ public class ProductMallController extends BaseController {
@PostMapping
(
"/deviceList"
)
@PostMapping
(
"/deviceList"
)
public
ResultBody
<
LeaseGoodsInfoDTO
>
listWareInfoPage
(
public
ResultBody
<
LeaseGoodsInfoDTO
>
listWareInfoPage
(
@RequestBody
@Validated
(
Page
.
class
)
WareInfoQO
param
,
HttpServletRequest
request
)
{
@RequestBody
@Validated
(
Page
.
class
)
WareInfoQO
param
,
HttpServletRequest
request
)
{
if
(
request
.
getHeader
(
TokenConstant
.
TOKEN
)
==
null
)
{
return
webDeviceService
.
listWareInfoPage
(
param
,
null
,
null
);
}
return
webDeviceService
.
listWareInfoPage
(
return
webDeviceService
.
listWareInfoPage
(
param
,
request
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
param
,
request
,
request
.
getHeader
(
TokenConstant
.
TOKEN
)
==
null
?
null
:
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
}
}
@ApiOperation
(
value
=
"设备设备详情"
)
@ApiOperation
(
value
=
"设备设备详情"
)
...
@@ -45,10 +44,19 @@ public class ProductMallController extends BaseController {
...
@@ -45,10 +44,19 @@ public class ProductMallController extends BaseController {
@GetMapping
(
"/getLeaseGoodsDetail"
)
@GetMapping
(
"/getLeaseGoodsDetail"
)
public
ResultBody
<
MallGoodsDetailDTO
>
getLeaseGoodsDetail
(
public
ResultBody
<
MallGoodsDetailDTO
>
getLeaseGoodsDetail
(
Integer
goodsId
,
HttpServletRequest
request
)
{
Integer
goodsId
,
HttpServletRequest
request
)
{
if
(
request
.
getHeader
(
TokenConstant
.
TOKEN
)
==
null
)
{
return
webDeviceService
.
getLeaseGoodsDetail
(
goodsId
,
null
,
null
);
}
return
webDeviceService
.
getLeaseGoodsDetail
(
return
webDeviceService
.
getLeaseGoodsDetail
(
goodsId
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
(),
request
);
goodsId
,
request
.
getHeader
(
TokenConstant
.
TOKEN
)
==
null
?
null
:
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
(),
request
);
}
@ApiOperation
(
value
=
"web-首页分类数据-展示"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
CategoryTypeDTO
.
class
)})
@GetMapping
(
"/getPageHomeCategories"
)
public
ResultBody
<
CategoryTypeDTO
>
getPageHomeCategories
(
@ApiParam
(
value
=
"类型:1:作业服务 2:设备 3:培训 4:产品商城"
)
@RequestParam
(
value
=
"type"
)
Integer
type
)
{
return
webDeviceService
.
getPageHomeCategories
(
type
);
}
}
}
}
src/main/java/com/mmc/pms/dao/CategoriesDao.java
浏览文件 @
d569bfda
...
@@ -60,4 +60,6 @@ public interface CategoriesDao {
...
@@ -60,4 +60,6 @@ public interface CategoriesDao {
List
<
Categories
>
getCategoriesListByIds
(
@Param
(
"ids"
)
Set
<
Integer
>
ids
);
List
<
Categories
>
getCategoriesListByIds
(
@Param
(
"ids"
)
Set
<
Integer
>
ids
);
List
<
Categories
>
selectCategoryByDirectoryId
(
List
<
Integer
>
directoryIds
);
List
<
Categories
>
selectCategoryByDirectoryId
(
List
<
Integer
>
directoryIds
);
List
<
Categories
>
getCategoriesListByDirectoryIds
(
List
<
Integer
>
directoryIds
);
}
}
src/main/java/com/mmc/pms/entity/Categories.java
浏览文件 @
d569bfda
package
com
.
mmc
.
pms
.
entity
;
package
com
.
mmc
.
pms
.
entity
;
import
com.mmc.pms.model.categories.dto.CategoriesInfoListDTO
;
import
com.mmc.pms.model.categories.dto.CategoriesInfoListDTO
;
import
com.mmc.pms.model.categories.dto.CategoryTypeDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyDetailsDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyDetailsDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyInfoDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyInfoDTO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
...
@@ -83,4 +84,8 @@ public class Categories implements Serializable {
...
@@ -83,4 +84,8 @@ public class Categories implements Serializable {
.
name
(
name
)
.
name
(
name
)
.
build
();
.
build
();
}
}
public
CategoryTypeDTO
buildCategoryTypeDTO
()
{
return
CategoryTypeDTO
.
builder
().
id
(
id
).
categoryName
(
name
).
build
();
}
}
}
src/main/java/com/mmc/pms/model/categories/dto/CategoryTypeDTO.java
0 → 100644
浏览文件 @
d569bfda
package
com
.
mmc
.
pms
.
model
.
categories
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
/**
* @Author LW
*
* @date 2023/6/10 13:46 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
CategoryTypeDTO
implements
Serializable
{
private
Integer
id
;
private
String
categoryName
;
}
src/main/java/com/mmc/pms/service/Impl/GoodsInfoServiceImpl.java
浏览文件 @
d569bfda
...
@@ -474,14 +474,14 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
...
@@ -474,14 +474,14 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
}
}
}
}
}
}
// 2、对自定义的sku进行操作
}
List
<
GoodsProdSpecVO
>
zdySpecInfo
=
// 2、对自定义的sku进行操作
goodsAddVO
.
getProductSpec
().
stream
()
List
<
GoodsProdSpecVO
>
zdySpecInfo
=
.
filter
(
spec
->
spec
.
getFlag
().
equals
(
1
)
)
goodsAddVO
.
getProductSpec
().
stream
(
)
.
collect
(
Collectors
.
toList
());
.
filter
(
spec
->
spec
.
getFlag
().
equals
(
1
))
if
(
CollectionUtils
.
isNotEmpty
(
zdySpecInfo
))
{
.
collect
(
Collectors
.
toList
());
updateCustomize
(
goodsInfo
,
zdySpecInfo
,
goodsAddVO
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
zdySpecInfo
))
{
}
updateCustomize
(
goodsInfo
,
zdySpecInfo
,
goodsAddVO
.
getId
());
}
}
}
}
...
...
src/main/java/com/mmc/pms/service/Impl/WebDeviceServiceImpl.java
浏览文件 @
d569bfda
...
@@ -4,6 +4,7 @@ import com.mmc.pms.auth.dto.UserAccountSimpleDTO;
...
@@ -4,6 +4,7 @@ import com.mmc.pms.auth.dto.UserAccountSimpleDTO;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultEnum
;
import
com.mmc.pms.common.ResultEnum
;
import
com.mmc.pms.constant.TokenConstant
;
import
com.mmc.pms.constant.TokenConstant
;
import
com.mmc.pms.dao.CategoriesDao
;
import
com.mmc.pms.dao.GoodsInfoDao
;
import
com.mmc.pms.dao.GoodsInfoDao
;
import
com.mmc.pms.dao.ProductDao
;
import
com.mmc.pms.dao.ProductDao
;
import
com.mmc.pms.dao.WebDeviceDao
;
import
com.mmc.pms.dao.WebDeviceDao
;
...
@@ -19,6 +20,7 @@ import com.mmc.pms.model.sale.dto.MallGoodsDetailDTO;
...
@@ -19,6 +20,7 @@ import com.mmc.pms.model.sale.dto.MallGoodsDetailDTO;
import
com.mmc.pms.model.sale.dto.SkuInfoDTO
;
import
com.mmc.pms.model.sale.dto.SkuInfoDTO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.WebDeviceService
;
import
com.mmc.pms.service.WebDeviceService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -41,8 +43,11 @@ public class WebDeviceServiceImpl implements WebDeviceService {
...
@@ -41,8 +43,11 @@ public class WebDeviceServiceImpl implements WebDeviceService {
@Autowired
ProductDao
productDao
;
@Autowired
ProductDao
productDao
;
@Autowired
GoodsInfoDao
goodsInfoDao
;
@Autowired
GoodsInfoDao
goodsInfoDao
;
@Autowired
GoodsInfoServiceImpl
goodsInfoService
;
@Autowired
GoodsInfoServiceImpl
goodsInfoService
;
@Autowired
private
CategoriesDao
categoriesDao
;
@Override
@Override
public
ResultBody
listSecondDistrict
()
{
public
ResultBody
listSecondDistrict
()
{
List
<
DistrictDO
>
list
=
webDeviceDao
.
listSecondDistrict
();
List
<
DistrictDO
>
list
=
webDeviceDao
.
listSecondDistrict
();
...
@@ -246,6 +251,21 @@ public class WebDeviceServiceImpl implements WebDeviceService {
...
@@ -246,6 +251,21 @@ public class WebDeviceServiceImpl implements WebDeviceService {
}
}
@Override
@Override
public
ResultBody
getPageHomeCategories
(
Integer
type
)
{
List
<
DirectoryDO
>
directoryList
=
categoriesDao
.
getDirectoryList
(
type
);
if
(
CollectionUtils
.
isNotEmpty
(
directoryList
))
{
List
<
Integer
>
directoryIds
=
directoryList
.
stream
().
map
(
DirectoryDO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Categories
>
categoriesList
=
categoriesDao
.
getCategoriesListByDirectoryIds
(
directoryIds
);
return
ResultBody
.
success
(
categoriesList
.
stream
()
.
map
(
Categories:
:
buildCategoryTypeDTO
)
.
collect
(
Collectors
.
toList
()));
}
return
ResultBody
.
success
();
}
@Override
public
ResultBody
<
AdDTO
>
ad
()
{
public
ResultBody
<
AdDTO
>
ad
()
{
List
<
AdDO
>
ad
=
webDeviceDao
.
ad
();
List
<
AdDO
>
ad
=
webDeviceDao
.
ad
();
List
<
AdDTO
>
collect
=
List
<
AdDTO
>
collect
=
...
...
src/main/java/com/mmc/pms/service/WebDeviceService.java
浏览文件 @
d569bfda
package
com
.
mmc
.
pms
.
service
;
package
com
.
mmc
.
pms
.
service
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.categories.dto.CategoryTypeDTO
;
import
com.mmc.pms.model.lease.dto.WareInfoDTO
;
import
com.mmc.pms.model.lease.dto.WareInfoDTO
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.other.dto.AdDTO
;
import
com.mmc.pms.model.other.dto.AdDTO
;
...
@@ -42,4 +43,6 @@ public interface WebDeviceService {
...
@@ -42,4 +43,6 @@ public interface WebDeviceService {
ResultBody
getLeaseGoodsDetail
(
ResultBody
getLeaseGoodsDetail
(
Integer
goodsId
,
Integer
userAccountId
,
HttpServletRequest
request
);
Integer
goodsId
,
Integer
userAccountId
,
HttpServletRequest
request
);
ResultBody
<
CategoryTypeDTO
>
getPageHomeCategories
(
Integer
type
);
}
}
src/main/resources/mapper/CategoriesDao.xml
浏览文件 @
d569bfda
...
@@ -204,6 +204,19 @@
...
@@ -204,6 +204,19 @@
where id = #{id}
where id = #{id}
and is_default = 0
and is_default = 0
</select>
</select>
<select
id=
"getCategoriesListByDirectoryIds"
resultType=
"com.mmc.pms.entity.Categories"
>
SELECT
id,
`name`
FROM
categories
<where>
is_deleted = 0
<foreach
collection=
"list"
item=
"d"
index=
"index"
open=
"directory_id IN ("
close=
")"
separator=
","
>
#{d}
</foreach>
</where>
</select>
<update
id=
"deleteById"
>
<update
id=
"deleteById"
>
UPDATE `categories`
UPDATE `categories`
...
...
src/main/resources/mapper/WebDeviceDao.xml
浏览文件 @
d569bfda
...
@@ -155,9 +155,8 @@
...
@@ -155,9 +155,8 @@
<select
id=
"countListWareInfoPage"
parameterType=
"com.mmc.pms.entity.GoodsInfo"
resultType=
"int"
>
<select
id=
"countListWareInfoPage"
parameterType=
"com.mmc.pms.entity.GoodsInfo"
resultType=
"int"
>
SELECT count(*)
SELECT count(*)
FROM goods_info gi
FROM goods_info gi
INNER JOIN goods_img img ON gi.id = img.goods_info_id
<where>
<where>
gi.is_deleted = 0 and gi.shelf_status =
0
and gi.goods_type = #{type}
gi.is_deleted = 0 and gi.shelf_status =
1
and gi.goods_type = #{type}
<if
test=
"categoryIds != null and categoryIds.size != 0"
>
<if
test=
"categoryIds != null and categoryIds.size != 0"
>
<foreach
collection=
"categoryIds"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
<foreach
collection=
"categoryIds"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
separator=
","
>
separator=
","
>
...
@@ -180,7 +179,7 @@
...
@@ -180,7 +179,7 @@
goods_info gi
goods_info gi
INNER JOIN goods_img img ON gi.id = img.goods_info_id and img.img_type = 0
INNER JOIN goods_img img ON gi.id = img.goods_info_id and img.img_type = 0
<where>
<where>
gi.is_deleted = 0 and gi.shelf_status =
0
and gi.goods_type = #{type}
gi.is_deleted = 0 and gi.shelf_status =
1
and gi.goods_type = #{type}
<if
test=
"param.categoryId != null"
>
<if
test=
"param.categoryId != null"
>
<foreach
collection=
"param"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
<foreach
collection=
"param"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
separator=
","
>
separator=
","
>
...
...
src/main/resources/not-check.yml
浏览文件 @
d569bfda
...
@@ -10,3 +10,4 @@ data-filter:
...
@@ -10,3 +10,4 @@ data-filter:
-
/pms/product/mall/deviceList
-
/pms/product/mall/deviceList
-
/pms/classify/queryCategoryInfoByType
-
/pms/classify/queryCategoryInfoByType
-
/pms/product/mall/getLeaseGoodsDetail
-
/pms/product/mall/getLeaseGoodsDetail
-
/pms/product/mall/getPageHomeCategories
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论