Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
31f94cd5
提交
31f94cd5
authored
7月 10, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
分类新增子分类返回数据,首页保险,软件数据返回
上级
0483baed
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
80 行增加
和
12 行删除
+80
-12
ProductMallController.java
...in/java/com/mmc/pms/controller/ProductMallController.java
+1
-1
CategoriesDao.java
src/main/java/com/mmc/pms/dao/CategoriesDao.java
+5
-1
CategoriesInfoListDTO.java
...m/mmc/pms/model/categories/dto/CategoriesInfoListDTO.java
+3
-0
CategoriesServiceImpl.java
.../java/com/mmc/pms/service/impl/CategoriesServiceImpl.java
+20
-3
WebDeviceServiceImpl.java
...n/java/com/mmc/pms/service/impl/WebDeviceServiceImpl.java
+25
-7
CategoriesDao.xml
src/main/resources/mapper/CategoriesDao.xml
+26
-0
没有找到文件。
src/main/java/com/mmc/pms/controller/ProductMallController.java
浏览文件 @
31f94cd5
...
...
@@ -61,7 +61,7 @@ public class ProductMallController extends BaseController {
@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
)
{
@ApiParam
(
value
=
"类型:1:作业服务 2:设备 3:培训 4:产品商城
5:无人机保险 6:无人机工具软件
"
)
@RequestParam
(
value
=
"type"
)
Integer
type
)
{
return
webDeviceService
.
getPageHomeCategories
(
type
);
}
...
...
src/main/java/com/mmc/pms/dao/CategoriesDao.java
浏览文件 @
31f94cd5
...
...
@@ -65,5 +65,9 @@ public interface CategoriesDao {
int
countChildById
(
Integer
id
);
List
<
Categories
>
getSubClassifyList
(
Integer
id
);
List
<
Categories
>
getSubClassifyList
(
Integer
id
);
List
<
Categories
>
listCategoryByInsurance
();
List
<
Categories
>
listCategoryBySoftware
();
}
src/main/java/com/mmc/pms/model/categories/dto/CategoriesInfoListDTO.java
浏览文件 @
31f94cd5
...
...
@@ -7,6 +7,7 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* Auto-generated: 2023-06-08 16:2:43
...
...
@@ -21,7 +22,9 @@ import java.io.Serializable;
public
class
CategoriesInfoListDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8381856228953745772L
;
private
Integer
id
;
private
Integer
pid
;
private
Integer
directoryId
;
private
String
name
;
private
String
icon
;
private
List
<
CategoriesInfoListDTO
>
children
;
}
src/main/java/com/mmc/pms/service/impl/CategoriesServiceImpl.java
浏览文件 @
31f94cd5
...
...
@@ -358,9 +358,26 @@ public class CategoriesServiceImpl implements CategoriesService {
.
map
(
AllCategoryDTO:
:
getDirectoryId
)
.
collect
(
Collectors
.
toList
());
List
<
Categories
>
categoriesList
=
categoriesDao
.
selectCategoryByDirectoryId
(
directoryIdIds
);
return
categoriesList
.
stream
()
.
map
(
Categories:
:
buildCategoriesInfoListDTO
)
.
collect
(
Collectors
.
groupingBy
(
CategoriesInfoListDTO:
:
getDirectoryId
));
List
<
CategoriesInfoListDTO
>
list
=
categoriesList
.
stream
()
.
map
(
Categories:
:
buildCategoriesInfoListDTO
)
.
collect
(
Collectors
.
toList
());
List
<
Integer
>
categoryId
=
list
.
stream
().
map
(
CategoriesInfoListDTO:
:
getId
).
collect
(
Collectors
.
toList
());
for
(
Integer
id
:
categoryId
)
{
List
<
Categories
>
subClassifyList
=
categoriesDao
.
getSubClassifyList
(
id
);
if
(
CollectionUtils
.
isNotEmpty
(
subClassifyList
)){
List
<
CategoriesInfoListDTO
>
childList
=
subClassifyList
.
stream
()
.
map
(
Categories:
:
buildCategoriesInfoListDTO
)
.
collect
(
Collectors
.
toList
());
for
(
CategoriesInfoListDTO
categories
:
list
)
{
if
(
id
.
equals
(
categories
.
getId
())){
categories
.
setChildren
(
childList
);
break
;
}
}
}
}
return
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
CategoriesInfoListDTO:
:
getDirectoryId
));
}
private
void
addSubCategories
(
...
...
src/main/java/com/mmc/pms/service/impl/WebDeviceServiceImpl.java
浏览文件 @
31f94cd5
...
...
@@ -179,14 +179,17 @@ public class WebDeviceServiceImpl implements WebDeviceService {
userIds
=
Collections
.
singletonList
(-
1
);
}
}
int
count
=
webDeviceDao
.
countListWareInfoPage
(
param
.
getCategoryId
(),
userIds
,
param
.
getType
(),
param
.
getGoodsName
());
int
count
=
webDeviceDao
.
countListWareInfoPage
(
param
.
getCategoryId
(),
userIds
,
param
.
getType
(),
param
.
getGoodsName
());
if
(
count
==
0
)
{
return
ResultBody
.
success
(
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
));
}
int
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
List
<
GoodsInfo
>
list
=
webDeviceDao
.
listWareInfoPage
(
param
,
userIds
,
param
.
getType
(),
param
.
getGoodsName
());
List
<
GoodsInfo
>
list
=
webDeviceDao
.
listWareInfoPage
(
param
,
userIds
,
param
.
getType
(),
param
.
getGoodsName
());
List
<
LeaseGoodsInfoDTO
>
pageList
=
list
.
stream
().
map
(
GoodsInfo:
:
buildLeaseGoodsInfoDTO
).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isBlank
(
request
.
getHeader
(
TokenConstant
.
TOKEN
)))
{
...
...
@@ -243,11 +246,26 @@ public class WebDeviceServiceImpl implements WebDeviceService {
@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
);
if
(!
type
.
equals
(
5
)
||
!
type
.
equals
(
6
))
{
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
()));
}
}
else
if
(
type
.
equals
(
5
))
{
List
<
Categories
>
categoriesList
=
categoriesDao
.
listCategoryByInsurance
();
return
ResultBody
.
success
(
categoriesList
.
stream
()
.
map
(
Categories:
:
buildCategoryTypeDTO
)
.
collect
(
Collectors
.
toList
()));
}
else
if
(
type
.
equals
(
6
))
{
List
<
Categories
>
categoriesList
=
categoriesDao
.
listCategoryBySoftware
();
return
ResultBody
.
success
(
categoriesList
.
stream
()
.
map
(
Categories:
:
buildCategoryTypeDTO
)
...
...
src/main/resources/mapper/CategoriesDao.xml
浏览文件 @
31f94cd5
...
...
@@ -235,6 +235,32 @@
from categories
where parent_id = #{id}
</select>
<select
id=
"listCategoryByInsurance"
resultType=
"com.mmc.pms.entity.Categories"
>
SELECT id,
parent_id,
directory_id,
`name`,
icon,
description,
remark,
create_time
FROM categories
WHERE (id = 56
OR parent_id = 56) and is deleted = 0
</select>
<select
id=
"listCategoryBySoftware"
resultType=
"com.mmc.pms.entity.Categories"
>
SELECT id,
parent_id,
directory_id,
`name`,
icon,
description,
remark,
create_time
FROM categories
WHERE (id = 55
OR parent_id = 55) and is deleted = 0
</select>
<update
id=
"deleteById"
>
UPDATE `categories`
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论