Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
pms-ci-test
Commits
ec82eb77
提交
ec82eb77
authored
6月 10, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改:目录分类信息
上级
5fcc43ba
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
34 行增加
和
34 行删除
+34
-34
ResultEnum.java
src/main/java/com/mmc/pms/common/ResultEnum.java
+1
-1
CategoriesDao.java
src/main/java/com/mmc/pms/dao/CategoriesDao.java
+2
-8
Categories.java
src/main/java/com/mmc/pms/entity/Categories.java
+6
-1
CategoriesServiceImpl.java
.../java/com/mmc/pms/service/Impl/CategoriesServiceImpl.java
+5
-4
CategoriesDao.xml
src/main/resources/mapper/CategoriesDao.xml
+20
-20
没有找到文件。
src/main/java/com/mmc/pms/common/ResultEnum.java
浏览文件 @
ec82eb77
...
@@ -407,7 +407,7 @@ public enum ResultEnum implements BaseErrorInfoInterface {
...
@@ -407,7 +407,7 @@ public enum ResultEnum implements BaseErrorInfoInterface {
ALREADY_DIVIDE_ERROR
(
"2011"
,
"订单已分成"
),
ALREADY_DIVIDE_ERROR
(
"2011"
,
"订单已分成"
),
DIVIDE_OBJ_NOT_EXIST
(
"2012"
,
"先点击确认添加分成对象"
),
DIVIDE_OBJ_NOT_EXIST
(
"2012"
,
"先点击确认添加分成对象"
),
DEFAULT_DIRECTORY
(
"3001"
,
"默认目录不可删除或修改!"
);
DEFAULT_DIRECTORY
(
"3001"
,
"默认目录不可删除或修改
名称
!"
);
/**
/**
* 错误码
* 错误码
*
*
...
...
src/main/java/com/mmc/pms/dao/CategoriesDao.java
浏览文件 @
ec82eb77
...
@@ -14,8 +14,7 @@ import java.util.Set;
...
@@ -14,8 +14,7 @@ import java.util.Set;
/**
/**
* @author 23214
* @author 23214
* @description 针对表【categories(通用分类表)】的数据库操作Mapper
* @description 针对表【categories(通用分类表)】的数据库操作Mapper
* @createDate 2023-05-24 10:29:28
* @createDate 2023-05-24 10:29:28 @Entity com.mmc.pms.entity.Categories
* @Entity com.mmc.pms.entity.Categories
*/
*/
@Mapper
@Mapper
public
interface
CategoriesDao
{
public
interface
CategoriesDao
{
...
@@ -50,7 +49,7 @@ public interface CategoriesDao {
...
@@ -50,7 +49,7 @@ public interface CategoriesDao {
int
countListClassification
(
QueryClassifyVO
queryClassifyVO
);
int
countListClassification
(
QueryClassifyVO
queryClassifyVO
);
int
selectDirectoryById
(
Integer
id
);
DirectoryDO
selectDirectoryById
(
Integer
id
);
int
deleteById
(
Integer
id
);
int
deleteById
(
Integer
id
);
...
@@ -61,9 +60,4 @@ public interface CategoriesDao {
...
@@ -61,9 +60,4 @@ 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
);
}
}
src/main/java/com/mmc/pms/entity/Categories.java
浏览文件 @
ec82eb77
...
@@ -76,6 +76,11 @@ public class Categories implements Serializable {
...
@@ -76,6 +76,11 @@ public class Categories implements Serializable {
}
}
public
CategoriesInfoListDTO
buildCategoriesInfoListDTO
()
{
public
CategoriesInfoListDTO
buildCategoriesInfoListDTO
()
{
return
CategoriesInfoListDTO
.
builder
().
id
(
id
).
icon
(
icon
).
name
(
name
).
build
();
return
CategoriesInfoListDTO
.
builder
()
.
id
(
id
)
.
directoryId
(
directoryId
)
.
icon
(
icon
)
.
name
(
name
)
.
build
();
}
}
}
}
src/main/java/com/mmc/pms/service/Impl/CategoriesServiceImpl.java
浏览文件 @
ec82eb77
...
@@ -49,8 +49,9 @@ public class CategoriesServiceImpl implements CategoriesService {
...
@@ -49,8 +49,9 @@ public class CategoriesServiceImpl implements CategoriesService {
if
(
param
.
getId
()
==
null
)
{
if
(
param
.
getId
()
==
null
)
{
categoriesDao
.
insertDirectory
(
directory
);
categoriesDao
.
insertDirectory
(
directory
);
}
else
{
}
else
{
int
count
=
categoriesDao
.
selectDirectoryById
(
param
.
getId
());
// 获取默认目录信息
if
(
count
>
0
)
{
DirectoryDO
directoryDO
=
categoriesDao
.
selectDirectoryById
(
param
.
getId
());
if
(!
directoryDO
.
getDirectoryName
().
equals
(
param
.
getDirectoryName
()))
{
return
ResultBody
.
error
(
ResultEnum
.
DEFAULT_DIRECTORY
);
return
ResultBody
.
error
(
ResultEnum
.
DEFAULT_DIRECTORY
);
}
}
categoriesDao
.
updateDirectory
(
directory
);
categoriesDao
.
updateDirectory
(
directory
);
...
@@ -78,8 +79,8 @@ public class CategoriesServiceImpl implements CategoriesService {
...
@@ -78,8 +79,8 @@ public class CategoriesServiceImpl implements CategoriesService {
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
THERE_ARE_CATEGORIES_IN_THE_DIRECTORY
);
return
ResultBody
.
error
(
ResultEnum
.
THERE_ARE_CATEGORIES_IN_THE_DIRECTORY
);
}
}
int
defaultCount
=
categoriesDao
.
selectDirectoryById
(
id
);
DirectoryDO
defaultCount
=
categoriesDao
.
selectDirectoryById
(
id
);
if
(
defaultCount
>
0
)
{
if
(
defaultCount
!=
null
)
{
return
ResultBody
.
error
(
ResultEnum
.
DEFAULT_DIRECTORY
);
return
ResultBody
.
error
(
ResultEnum
.
DEFAULT_DIRECTORY
);
}
}
categoriesDao
.
removeDirectory
(
id
);
categoriesDao
.
removeDirectory
(
id
);
...
...
src/main/resources/mapper/CategoriesDao.xml
浏览文件 @
ec82eb77
...
@@ -25,9 +25,9 @@
...
@@ -25,9 +25,9 @@
is_deleted
is_deleted
</sql>
</sql>
<insert
id=
"insertDirectory"
>
<insert
id=
"insertDirectory"
>
insert into directory(directory_name,
pid,
insert into directory(directory_name,
`type`)
`type`
, show
)
values (#{directoryName}, #{
pid}, #{type
})
values (#{directoryName}, #{
type}, #{show
})
</insert>
</insert>
<insert
id=
"insertClassification"
>
<insert
id=
"insertClassification"
>
insert into categories (parent_id,
insert into categories (parent_id,
...
@@ -42,8 +42,8 @@
...
@@ -42,8 +42,8 @@
<update
id=
"updateDirectory"
>
<update
id=
"updateDirectory"
>
update directory
update directory
set directory_name = #{directoryName},
set directory_name = #{directoryName},
pid = #{pid
},
`type` = #{type
},
`type` = #{type
}
show = #{show
}
where id = #{id}
where id = #{id}
</update>
</update>
<update
id=
"removeDirectory"
>
<update
id=
"removeDirectory"
>
...
@@ -87,12 +87,9 @@
...
@@ -87,12 +87,9 @@
<select
id=
"directoryList"
resultType=
"com.mmc.pms.entity.DirectoryDO"
>
<select
id=
"directoryList"
resultType=
"com.mmc.pms.entity.DirectoryDO"
>
SELECT d.id,
SELECT d.id,
d.directory_name,
d.directory_name,
d.pid,
d.`type`,
d.`type`,
d.create_time,
d.create_time
dt.directory_name relevanceName
FROM `directory` d
FROM `directory` d
LEFT JOIN `directory` dt ON dt.id = d.pid
<where>
<where>
d.is_deleted = 0
d.is_deleted = 0
<if
test=
"type != null"
>
<if
test=
"type != null"
>
...
@@ -162,23 +159,15 @@
...
@@ -162,23 +159,15 @@
AND directory_id = #{directoryId}
AND directory_id = #{directoryId}
AND `type` = #{type}
AND `type` = #{type}
</select>
</select>
<select
id=
"selectDirectoryById"
resultType=
"java.lang.Integer"
>
select count(*)
from directory
where id = #{id}
and is_default = 0
</select>
<select
id=
"getDirectoryList"
resultType=
"com.mmc.pms.entity.DirectoryDO"
>
<select
id=
"getDirectoryList"
resultType=
"com.mmc.pms.entity.DirectoryDO"
>
SELECT d.id,
SELECT d.id,
d.directory_name,
d.directory_name,
d.pid,
d.`type`,
d.`type`,
d.create_time
d.create_time
FROM `directory` d
FROM `directory` d
WHERE d.is_deleted = 0
WHERE d.is_deleted = 0
AND d.type = #{type}
AND d.type = #{type}
OR d.type = 0
or (type = 0 and `show` like CONCAT('%', #{type}, '%'))
AND d.pid IS NULL
ORDER BY create_time DESC
ORDER BY create_time DESC
</select>
</select>
<select
id=
"selectCategoryByDirectoryId"
resultType=
"com.mmc.pms.entity.Categories"
>
<select
id=
"selectCategoryByDirectoryId"
resultType=
"com.mmc.pms.entity.Categories"
>
...
@@ -192,8 +181,13 @@
...
@@ -192,8 +181,13 @@
</where>
</where>
</select>
</select>
<select
id=
"getCategoriesByDirectoryId"
resultType=
"com.mmc.pms.entity.Categories"
parameterType=
"java.lang.Integer"
>
<select
id=
"getCategoriesByDirectoryId"
resultType=
"com.mmc.pms.entity.Categories"
SELECT id,`name` from categories where directory_id = #{directoryId} and is_deleted = 0 order by create_time desc
parameterType=
"java.lang.Integer"
>
SELECT id, `name`
from categories
where directory_id = #{directoryId}
and is_deleted = 0
order by create_time desc
</select>
</select>
<select
id=
"getCategoriesListByIds"
resultType=
"com.mmc.pms.entity.Categories"
>
<select
id=
"getCategoriesListByIds"
resultType=
"com.mmc.pms.entity.Categories"
>
...
@@ -204,6 +198,12 @@
...
@@ -204,6 +198,12 @@
</foreach>
</foreach>
and is_deleted = 0
and is_deleted = 0
</select>
</select>
<select
id=
"selectDirectoryById"
resultType=
"com.mmc.pms.entity.DirectoryDO"
>
select id, directory_name
from directory
where id = #{id}
and is_default = 0
</select>
<update
id=
"deleteById"
>
<update
id=
"deleteById"
>
UPDATE `categories`
UPDATE `categories`
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论