Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
pms-ci-test
Commits
b3121cfe
提交
b3121cfe
authored
8月 05, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增:产品类型
上级
c461414e
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
416 行增加
和
0 行删除
+416
-0
ProductAttributeController.java
...c/pms/controller/category/ProductAttributeController.java
+63
-0
LeaseGoodsController.java
...va/com/mmc/pms/controller/lease/LeaseGoodsController.java
+43
-0
ProductAttributeDao.java
...in/java/com/mmc/pms/dao/category/ProductAttributeDao.java
+29
-0
LeaseGoodsDao.java
src/main/java/com/mmc/pms/dao/lease/LeaseGoodsDao.java
+12
-0
ProductTypeDO.java
src/main/java/com/mmc/pms/entity/category/ProductTypeDO.java
+37
-0
ProductTypeVO.java
...ain/java/com/mmc/pms/model/category/vo/ProductTypeVO.java
+37
-0
ProductAttributeService.java
...com/mmc/pms/service/category/ProductAttributeService.java
+46
-0
ProductAttributeServiceImpl.java
...ms/service/category/impl/ProductAttributeServiceImpl.java
+67
-0
LeaseGoodsService.java
...ain/java/com/mmc/pms/service/lease/LeaseGoodsService.java
+9
-0
LeaseGoodsServiceImpl.java
...com/mmc/pms/service/lease/impl/LeaseGoodsServiceImpl.java
+13
-0
ProductAttributeDao.xml
src/main/resources/mapper/category/ ProductAttributeDao.xml
+52
-0
LeaseGoodsDao.xml
src/main/resources/mapper/lease/LeaseGoodsDao.xml
+8
-0
没有找到文件。
src/main/java/com/mmc/pms/controller/category/ProductAttributeController.java
0 → 100644
浏览文件 @
b3121cfe
package
com
.
mmc
.
pms
.
controller
.
category
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.category.vo.ProductTypeVO
;
import
com.mmc.pms.model.group.Create
;
import
com.mmc.pms.model.group.Update
;
import
com.mmc.pms.service.category.ProductAttributeService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
/**
* @Author LW
* @date 2023/8/5 10:35
* 概要:
*/
@RestController
@RequestMapping
(
"/attribute"
)
@Api
(
tags
=
{
"V1.0.3-产品属性-相关接口"
})
public
class
ProductAttributeController
{
@Resource
ProductAttributeService
productAttributeService
;
@ApiOperation
(
value
=
"类型新增"
)
@PostMapping
(
"/addType"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
addType
(
@RequestBody
@Validated
(
value
=
{
Create
.
class
})
ProductTypeVO
param
)
{
return
productAttributeService
.
addType
(
param
);
}
@ApiOperation
(
value
=
"类型编辑"
)
@PostMapping
(
"/editType"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
editType
(
@RequestBody
@Validated
(
value
=
{
Update
.
class
})
ProductTypeVO
param
)
{
return
productAttributeService
.
editType
(
param
);
}
@ApiOperation
(
value
=
"类型删除"
)
@GetMapping
(
"/removeType"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
removeType
(
@RequestParam
Integer
id
)
{
return
productAttributeService
.
removeType
(
id
);
}
@ApiOperation
(
value
=
"类型详情"
)
@GetMapping
(
"/typeDetails"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductTypeVO
.
class
)})
public
ResultBody
<
ProductTypeVO
>
typeDetails
(
@RequestParam
Integer
id
)
{
return
productAttributeService
.
typeDetails
(
id
);
}
@ApiOperation
(
value
=
"类型列表"
)
@GetMapping
(
"/typeList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductTypeVO
.
class
)})
public
ResultBody
<
ProductTypeVO
>
typeList
(
@RequestParam
Integer
pageNo
,
@RequestParam
Integer
pageSize
)
{
return
ResultBody
.
success
(
productAttributeService
.
typeList
(
pageNo
,
pageSize
));
}
}
src/main/java/com/mmc/pms/controller/lease/LeaseGoodsController.java
0 → 100644
浏览文件 @
b3121cfe
package
com
.
mmc
.
pms
.
controller
.
lease
;
/**
* @Author LW
* @date 2023/8/4 10:35
* 概要:
*/
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.controller.BaseController
;
import
com.mmc.pms.model.mall.MallGoodsVO
;
import
com.mmc.pms.service.lease.LeaseGoodsService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @Author LW
* @date 2023/7/24 16:56 概要:
*/
@RestController
@RequestMapping
(
"/lease/goods"
)
@Api
(
tags
=
{
"V1.0.3-租赁商品-相关接口"
})
public
class
LeaseGoodsController
extends
BaseController
{
@Resource
LeaseGoodsService
leaseGoodsService
;
@ApiOperation
(
value
=
"新增商城商品"
)
@PostMapping
(
"addLeaseGoods"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
addLeaseGoods
(
@RequestBody
MallGoodsVO
mallGoodsVO
,
HttpServletRequest
request
)
{
return
null
;
// return leaseGoodsService.addLeaseGoods(mallGoodsVO, this.getUserLoginInfoFromRedis(request).getUserAccountId());
}
}
src/main/java/com/mmc/pms/dao/category/ProductAttributeDao.java
0 → 100644
浏览文件 @
b3121cfe
package
com
.
mmc
.
pms
.
dao
.
category
;
import
com.mmc.pms.entity.category.ProductTypeDO
;
import
com.mmc.pms.model.category.vo.ProductTypeVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* @Author LW
* @date 2023/8/5 10:44
* 概要:
*/
@Mapper
public
interface
ProductAttributeDao
{
int
countTypeByName
(
ProductTypeVO
param
);
void
addType
(
ProductTypeVO
param
);
void
editType
(
ProductTypeVO
param
);
void
removeType
(
Integer
id
);
ProductTypeDO
getType
(
Integer
id
);
int
countType
();
List
<
ProductTypeDO
>
listType
(
Integer
pageNo
,
Integer
pageSize
);
}
src/main/java/com/mmc/pms/dao/lease/LeaseGoodsDao.java
0 → 100644
浏览文件 @
b3121cfe
package
com
.
mmc
.
pms
.
dao
.
lease
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @Author LW
* @date 2023/8/4 10:38
* 概要:
*/
@Mapper
public
interface
LeaseGoodsDao
{
}
src/main/java/com/mmc/pms/entity/category/ProductTypeDO.java
0 → 100644
浏览文件 @
b3121cfe
package
com
.
mmc
.
pms
.
entity
.
category
;
import
com.mmc.pms.model.category.vo.ProductTypeVO
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* (ProductTypeDO)实体类
*
* @author makejava
* @since 2023-08-05 14:21:20
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
ProductTypeDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
18535389603045721L
;
private
Integer
id
;
private
String
name
;
private
String
url
;
private
Date
createTime
;
private
Date
updateTime
;
public
ProductTypeVO
buildProductType
()
{
return
ProductTypeVO
.
builder
().
id
(
id
).
name
(
name
).
url
(
url
).
build
();
}
}
src/main/java/com/mmc/pms/model/category/vo/ProductTypeVO.java
0 → 100644
浏览文件 @
b3121cfe
package
com
.
mmc
.
pms
.
model
.
category
.
vo
;
import
com.mmc.pms.model.group.Create
;
import
com.mmc.pms.model.group.Update
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
* @Author LW
* @date 2023/8/5 14:32
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
ProductTypeVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1466513739991843345L
;
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
@NotNull
(
groups
=
{
Update
.
class
},
message
=
"id不能为空"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"类型名称"
,
example
=
"航拍无人机"
)
@NotEmpty
(
groups
=
{
Create
.
class
,
Update
.
class
},
message
=
"类型名称不能为空"
)
private
String
name
;
@ApiModelProperty
(
value
=
"图标"
,
example
=
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/ad0e77b4-8518-4ecc-9b7f-19218f56b755.png"
)
@NotEmpty
(
groups
=
{
Create
.
class
,
Update
.
class
},
message
=
"图标不能为空"
)
private
String
url
;
}
src/main/java/com/mmc/pms/service/category/ProductAttributeService.java
0 → 100644
浏览文件 @
b3121cfe
package
com
.
mmc
.
pms
.
service
.
category
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.category.vo.ProductTypeVO
;
import
com.mmc.pms.page.PageResult
;
/**
* @Author LW
* @date 2023/8/5 10:43
* 概要:
*/
public
interface
ProductAttributeService
{
/**
* 添加类型
*
* @param param 参数
* @return {@link ResultBody}
*/
ResultBody
addType
(
ProductTypeVO
param
);
/**
* 编辑类型
*
* @param param 参数
* @return {@link ResultBody}
*/
ResultBody
editType
(
ProductTypeVO
param
);
/**
* 删除类型
*
* @param id id
* @return {@link ResultBody}
*/
ResultBody
removeType
(
Integer
id
);
/**
* 类型详情
*
* @param id id
* @return {@link ResultBody}<{@link ProductTypeVO}>
*/
ResultBody
<
ProductTypeVO
>
typeDetails
(
Integer
id
);
PageResult
typeList
(
Integer
pageNo
,
Integer
pageSize
);
}
src/main/java/com/mmc/pms/service/category/impl/ProductAttributeServiceImpl.java
0 → 100644
浏览文件 @
b3121cfe
package
com
.
mmc
.
pms
.
service
.
category
.
impl
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultEnum
;
import
com.mmc.pms.dao.category.ProductAttributeDao
;
import
com.mmc.pms.entity.category.ProductTypeDO
;
import
com.mmc.pms.model.category.vo.ProductTypeVO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.category.ProductAttributeService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @Author LW
* @date 2023/8/5 10:44
* 概要:
*/
@Service
public
class
ProductAttributeServiceImpl
implements
ProductAttributeService
{
@Resource
ProductAttributeDao
productAttributeDao
;
@Override
public
ResultBody
addType
(
ProductTypeVO
param
)
{
int
count
=
productAttributeDao
.
countTypeByName
(
param
);
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
GOODS_CATEGORY_NAME_EXIST_ERROR
);
}
productAttributeDao
.
addType
(
param
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
editType
(
ProductTypeVO
param
)
{
int
count
=
productAttributeDao
.
countTypeByName
(
param
);
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
GOODS_CATEGORY_NAME_EXIST_ERROR
);
}
productAttributeDao
.
editType
(
param
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
removeType
(
Integer
id
)
{
productAttributeDao
.
removeType
(
id
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
<
ProductTypeVO
>
typeDetails
(
Integer
id
)
{
ProductTypeDO
productType
=
productAttributeDao
.
getType
(
id
);
return
ResultBody
.
success
(
productType
==
null
?
null
:
productType
.
buildProductType
());
}
@Override
public
PageResult
typeList
(
Integer
pageNo
,
Integer
pageSize
)
{
int
count
=
productAttributeDao
.
countType
();
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
);
}
List
<
ProductTypeDO
>
productTypeList
=
productAttributeDao
.
listType
((
pageNo
-
1
)
*
pageSize
,
pageSize
);
return
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
,
productTypeList
.
stream
().
map
(
ProductTypeDO:
:
buildProductType
).
collect
(
Collectors
.
toList
()));
}
}
src/main/java/com/mmc/pms/service/lease/LeaseGoodsService.java
0 → 100644
浏览文件 @
b3121cfe
package
com
.
mmc
.
pms
.
service
.
lease
;
/**
* @Author LW
* @date 2023/8/4 10:37
* 概要:
*/
public
interface
LeaseGoodsService
{
}
src/main/java/com/mmc/pms/service/lease/impl/LeaseGoodsServiceImpl.java
0 → 100644
浏览文件 @
b3121cfe
package
com
.
mmc
.
pms
.
service
.
lease
.
impl
;
import
com.mmc.pms.service.lease.LeaseGoodsService
;
import
org.springframework.stereotype.Service
;
/**
* @Author LW
* @date 2023/8/4 10:37
* 概要:
*/
@Service
public
class
LeaseGoodsServiceImpl
implements
LeaseGoodsService
{
}
src/main/resources/mapper/category/ ProductAttributeDao.xml
0 → 100644
浏览文件 @
b3121cfe
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mmc.pms.dao.category.ProductAttributeDao"
>
<insert
id=
"addType"
>
insert into product_type(`name`, url)
values (#{name}, #{url})
</insert>
<update
id=
"editType"
>
update product_type
<set>
<if
test=
"name != null"
>
name = #{name},
</if>
<if
test=
"url != null"
>
url = #{url}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"removeType"
>
delete
from product_type
where id = #{id}
</delete>
<select
id=
"countTypeByName"
resultType=
"java.lang.Integer"
>
select count(*)
from product_type
where `name` = #{name}
<if
test=
"id != null"
>
and id
<![CDATA[<>]]>
#{id}
</if>
</select>
<select
id=
"getType"
resultType=
"com.mmc.pms.entity.category.ProductTypeDO"
>
select id, `name`, url
from product_type
where id = #{id}
</select>
<select
id=
"countType"
resultType=
"java.lang.Integer"
>
select count(*)
from product_type
</select>
<select
id=
"listType"
resultType=
"com.mmc.pms.entity.category.ProductTypeDO"
>
select id, `name`, url
from product_type
order by create_time desc
limit #{pageNo}, #{pageSize}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/lease/LeaseGoodsDao.xml
0 → 100644
浏览文件 @
b3121cfe
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mmc.pms.dao.lease.LeaseGoodsDao"
>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论