Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
pms-ci-test
Commits
b4b57917
提交
b4b57917
authored
7月 25, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CateGory(update)
上级
e8e25d6e
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
32 行增加
和
28 行删除
+32
-28
CategoryController.java
...a/com/mmc/pms/controller/category/CategoryController.java
+4
-4
CategoryDao.java
src/main/java/com/mmc/pms/dao/category/CategoryDao.java
+2
-2
CategorySubDO.java
src/main/java/com/mmc/pms/entity/category/CategorySubDO.java
+4
-3
CategorySubDTO.java
...n/java/com/mmc/pms/model/category/dto/CategorySubDTO.java
+3
-3
CategorySubVO.java
...ain/java/com/mmc/pms/model/category/vo/CategorySubVO.java
+1
-1
CategoryService.java
...in/java/com/mmc/pms/service/category/CategoryService.java
+2
-2
CategoryServiceImpl.java
...om/mmc/pms/service/category/impl/CategoryServiceImpl.java
+8
-5
CategoryDao.xml
src/main/resources/mapper/category/CategoryDao.xml
+8
-8
没有找到文件。
src/main/java/com/mmc/pms/controller/category/CategoryController.java
浏览文件 @
b4b57917
...
...
@@ -83,15 +83,15 @@ public class CategoryController {
@ApiOperation
(
value
=
"二级分类————删除"
)
@GetMapping
(
"/deleteSubCategory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
deleteSubCategory
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"
id"
,
required
=
true
)
Integer
i
d
)
{
return
categoryService
.
deleteSubCategory
(
i
d
);
public
ResultBody
deleteSubCategory
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"
subId"
,
required
=
true
)
Integer
subI
d
)
{
return
categoryService
.
deleteSubCategory
(
subI
d
);
}
@ApiOperation
(
value
=
"二级分类————详情"
)
@GetMapping
(
"/detailSubCategory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
<
CategorySubDTO
>
detailSubCategory
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"
id"
,
required
=
true
)
Integer
i
d
)
{
return
categoryService
.
detailSubCategory
(
i
d
);
public
ResultBody
<
CategorySubDTO
>
detailSubCategory
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"
subId"
,
required
=
true
)
Integer
subI
d
)
{
return
categoryService
.
detailSubCategory
(
subI
d
);
}
...
...
src/main/java/com/mmc/pms/dao/category/CategoryDao.java
浏览文件 @
b4b57917
...
...
@@ -34,9 +34,9 @@ public interface CategoryDao {
void
updateSubCategory
(
CategorySubDO
subDO
);
void
deleteSubCategory
(
Integer
i
d
);
void
deleteSubCategory
(
Integer
subI
d
);
CategorySubDO
detailSubCategory
(
Integer
i
d
);
CategorySubDO
detailSubCategory
(
Integer
subI
d
);
List
<
CategoryPrimaryDO
>
categoryList
(
CategoryQO
param
);
...
...
src/main/java/com/mmc/pms/entity/category/CategorySubDO.java
浏览文件 @
b4b57917
...
...
@@ -33,7 +33,8 @@ public class CategorySubDO {
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
@Min
(
value
=
1
,
groups
=
{
Update
.
class
})
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
Integer
subId
;
@ApiModelProperty
(
value
=
"分类名称"
,
required
=
true
,
example
=
"无人机"
)
@Size
(
max
=
15
,
message
=
"分类名称不能超过15个字"
,
groups
=
{
Update
.
class
,
Create
.
class
})
...
...
@@ -58,7 +59,7 @@ public class CategorySubDO {
private
Date
updateTime
;
public
CategorySubDO
(
CategorySubVO
subVO
)
{
this
.
id
=
subVO
.
get
Id
();
this
.
subId
=
subVO
.
getSub
Id
();
this
.
name
=
subVO
.
getName
();
this
.
description
=
subVO
.
getDescription
();
this
.
categoryPrimaryId
=
subVO
.
getCategoryPrimaryId
();
...
...
@@ -66,7 +67,7 @@ public class CategorySubDO {
public
CategorySubDTO
buildCategorySubDTO
()
{
return
CategorySubDTO
.
builder
()
.
id
(
this
.
i
d
)
.
subId
(
this
.
subI
d
)
.
name
(
this
.
name
)
.
description
(
this
.
description
)
.
categoryPrimaryId
(
this
.
categoryPrimaryId
)
...
...
src/main/java/com/mmc/pms/model/category/dto/CategorySubDTO.java
浏览文件 @
b4b57917
...
...
@@ -29,9 +29,9 @@ public class CategorySubDTO {
@ApiModelProperty
(
value
=
"id"
)
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
@Min
(
value
=
1
,
groups
=
{
Update
.
class
})
private
Integer
i
d
;
private
Integer
subI
d
;
@ApiModelProperty
(
value
=
"分类名称"
,
required
=
true
,
example
=
"无人机"
)
@ApiModelProperty
(
value
=
"分类名称"
,
required
=
true
,
example
=
"无人机"
)
@Size
(
max
=
15
,
message
=
"分类名称不能超过15个字"
,
groups
=
{
Update
.
class
,
Create
.
class
})
@NotBlank
(
message
=
"分类名称不能为空或空字符"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
String
name
;
...
...
@@ -40,7 +40,7 @@ public class CategorySubDTO {
@Size
(
max
=
70
,
message
=
"分类描述不能超过70个字"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
String
description
;
@ApiModelProperty
(
value
=
"一级id不能为空"
,
required
=
true
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"一级id不能为空"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"一级id不能为空"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
Integer
categoryPrimaryId
;
...
...
src/main/java/com/mmc/pms/model/category/vo/CategorySubVO.java
浏览文件 @
b4b57917
...
...
@@ -21,7 +21,7 @@ public class CategorySubVO {
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
@Min
(
value
=
1
,
groups
=
{
Update
.
class
})
private
Integer
i
d
;
private
Integer
subI
d
;
@ApiModelProperty
(
value
=
"分类名称"
,
required
=
true
,
example
=
"无人机"
)
@Size
(
max
=
15
,
message
=
"分类名称不能超过15个字"
,
groups
=
{
Update
.
class
,
Create
.
class
})
...
...
src/main/java/com/mmc/pms/service/category/CategoryService.java
浏览文件 @
b4b57917
...
...
@@ -24,9 +24,9 @@ public interface CategoryService {
ResultBody
updateSubCategory
(
CategorySubVO
subVO
);
ResultBody
deleteSubCategory
(
Integer
i
d
);
ResultBody
deleteSubCategory
(
Integer
subI
d
);
ResultBody
detailSubCategory
(
Integer
i
d
);
ResultBody
detailSubCategory
(
Integer
subI
d
);
PageResult
<
CategoryPrimaryDTO
>
categoryList
(
CategoryQO
param
);
}
src/main/java/com/mmc/pms/service/category/impl/CategoryServiceImpl.java
浏览文件 @
b4b57917
...
...
@@ -84,15 +84,18 @@ public class CategoryServiceImpl implements CategoryService {
}
@Override
public
ResultBody
deleteSubCategory
(
Integer
i
d
)
{
categoryDao
.
deleteSubCategory
(
i
d
);
public
ResultBody
deleteSubCategory
(
Integer
subI
d
)
{
categoryDao
.
deleteSubCategory
(
subI
d
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
<
CategorySubDTO
>
detailSubCategory
(
Integer
id
)
{
CategorySubDO
subDO
=
categoryDao
.
detailSubCategory
(
id
);
CategorySubDTO
categorySubDTO
=
subDO
.
buildCategorySubDTO
();
public
ResultBody
<
CategorySubDTO
>
detailSubCategory
(
Integer
subId
)
{
CategorySubDO
subDO
=
categoryDao
.
detailSubCategory
(
subId
);
CategorySubDTO
categorySubDTO
=
null
;
if
(
subDO
!=
null
)
{
categorySubDTO
=
subDO
.
buildCategorySubDTO
();
}
return
ResultBody
.
success
(
categorySubDTO
);
}
...
...
src/main/resources/mapper/category/CategoryDao.xml
浏览文件 @
b4b57917
...
...
@@ -18,7 +18,7 @@
</resultMap>
<select
id=
"selectSubList"
resultType=
"com.mmc.pms.entity.category.CategorySubDO"
>
select id,
select id
AS subId
,
`name`,
description,
category_primary_id AS categoryPrimaryId,
...
...
@@ -114,7 +114,7 @@
<insert
id=
"addSubCategory"
useGeneratedKeys=
"true"
keyProperty=
"
i
d"
parameterType=
"com.mmc.pms.entity.category.CategorySubDO"
>
keyProperty=
"
subI
d"
parameterType=
"com.mmc.pms.entity.category.CategorySubDO"
>
insert into category_sub(`name`, description, create_time, update_time, category_primary_id)
values (#{name}, #{description}, NOW(), NOW(), #{categoryPrimaryId})
</insert>
...
...
@@ -126,8 +126,8 @@
<if
test=
" name != null and name != '' "
>
and `name` = #{name}
</if>
<if
test=
"
id != null and i
d != '' "
>
and id != #{
i
d}
<if
test=
"
subId != null and subI
d != '' "
>
and id != #{
subI
d}
</if>
<if
test=
" categoryPrimaryId != null and categoryPrimaryId != '' "
>
and category_primary_id != #{categoryPrimaryId}
...
...
@@ -147,25 +147,25 @@
</if>
update_time=NOW()
</set>
where id = #{
i
d}
where id = #{
subI
d}
</update>
<delete
id=
"deleteSubCategory"
>
delete
from category_sub
where id = #{
i
d}
where id = #{
subI
d}
</delete>
<select
id=
"detailSubCategory"
resultType=
"com.mmc.pms.entity.category.CategorySubDO"
>
select id,
select id
AS subId
,
`name`,
description,
create_time AS createTime,
update_time AS updateTime,
category_primary_id AS categoryPrimaryId
from category_sub
where id = #{
i
d}
where id = #{
subI
d}
</select>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论