Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
317c12fa
提交
317c12fa
authored
8月 01, 2023
作者:
zhenjie
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop'
上级
efc83179
c461414e
显示空白字符变更
内嵌
并排
正在显示
43 个修改的文件
包含
2560 行增加
和
92 行删除
+2560
-92
kustomization.yaml
kustomization/overlays/dev/kustomization.yaml
+1
-1
LoginSuccessDTO.java
src/main/java/com/mmc/pms/auth/dto/LoginSuccessDTO.java
+3
-1
ResultEnum.java
src/main/java/com/mmc/pms/common/ResultEnum.java
+5
-2
BackstageGoodsManageController.java
...om/mmc/pms/controller/BackstageGoodsManageController.java
+2
-2
CategoryController.java
...a/com/mmc/pms/controller/category/CategoryController.java
+111
-0
AppMallGoodsController.java
...a/com/mmc/pms/controller/mall/AppMallGoodsController.java
+51
-0
MallGoodsController.java
...java/com/mmc/pms/controller/mall/MallGoodsController.java
+90
-0
GoodsInfoDao.java
src/main/java/com/mmc/pms/dao/GoodsInfoDao.java
+1
-1
CategoryDao.java
src/main/java/com/mmc/pms/dao/category/CategoryDao.java
+60
-0
AppMallGoodsDao.java
src/main/java/com/mmc/pms/dao/mall/AppMallGoodsDao.java
+17
-0
MallGoodsDao.java
src/main/java/com/mmc/pms/dao/mall/MallGoodsDao.java
+66
-0
CategoryPrimaryDO.java
...n/java/com/mmc/pms/entity/category/CategoryPrimaryDO.java
+88
-0
CategorySubDO.java
src/main/java/com/mmc/pms/entity/category/CategorySubDO.java
+78
-0
GoodsSpecDO.java
src/main/java/com/mmc/pms/entity/mall/GoodsSpecDO.java
+64
-0
GoodsSpecValuesDO.java
src/main/java/com/mmc/pms/entity/mall/GoodsSpecValuesDO.java
+81
-0
MallGoodsDO.java
src/main/java/com/mmc/pms/entity/mall/MallGoodsDO.java
+112
-0
MallGoodsResourcesDO.java
...in/java/com/mmc/pms/entity/mall/MallGoodsResourcesDO.java
+49
-0
CategoryPrimaryDTO.java
...va/com/mmc/pms/model/category/dto/CategoryPrimaryDTO.java
+62
-0
CategorySubDTO.java
...n/java/com/mmc/pms/model/category/dto/CategorySubDTO.java
+55
-0
CategoryQO.java
src/main/java/com/mmc/pms/model/category/qo/CategoryQO.java
+40
-0
CategoryPrimaryVO.java
...java/com/mmc/pms/model/category/vo/CategoryPrimaryVO.java
+43
-0
CategorySubVO.java
...ain/java/com/mmc/pms/model/category/vo/CategorySubVO.java
+38
-0
GoodsResourcesVO.java
src/main/java/com/mmc/pms/model/mall/GoodsResourcesVO.java
+25
-0
GoodsSpecVO.java
src/main/java/com/mmc/pms/model/mall/GoodsSpecVO.java
+35
-0
GoodsSpecValuesVO.java
src/main/java/com/mmc/pms/model/mall/GoodsSpecValuesVO.java
+39
-0
MallGoodsVO.java
src/main/java/com/mmc/pms/model/mall/MallGoodsVO.java
+73
-0
RoleInfoDTO.java
src/main/java/com/mmc/pms/model/other/dto/RoleInfoDTO.java
+9
-23
MallGoodsInfoQO.java
src/main/java/com/mmc/pms/model/sale/qo/MallGoodsInfoQO.java
+52
-0
MallGoodsQO.java
src/main/java/com/mmc/pms/model/sale/qo/MallGoodsQO.java
+0
-1
GoodsSpecVO.java
src/main/java/com/mmc/pms/model/sale/vo/GoodsSpecVO.java
+0
-56
GoodsInfoService.java
src/main/java/com/mmc/pms/service/GoodsInfoService.java
+0
-0
CategoryService.java
...in/java/com/mmc/pms/service/category/CategoryService.java
+39
-0
CategoryServiceImpl.java
...om/mmc/pms/service/category/impl/CategoryServiceImpl.java
+166
-0
GoodsInfoServiceImpl.java
...n/java/com/mmc/pms/service/impl/GoodsInfoServiceImpl.java
+12
-5
AppMallGoodsService.java
...in/java/com/mmc/pms/service/mall/AppMallGoodsService.java
+17
-0
MallGoodsService.java
src/main/java/com/mmc/pms/service/mall/MallGoodsService.java
+31
-0
AppMallGoodsServiceImpl.java
...om/mmc/pms/service/mall/impl/AppMallGoodsServiceImpl.java
+44
-0
MallGoodsServiceImpl.java
...a/com/mmc/pms/service/mall/impl/MallGoodsServiceImpl.java
+259
-0
SnowFlake.java
src/main/java/com/mmc/pms/util/SnowFlake.java
+105
-0
CategoryDao.xml
src/main/resources/mapper/category/CategoryDao.xml
+229
-0
AppMallGoodsDao.xml
src/main/resources/mapper/mall/AppMallGoodsDao.xml
+40
-0
MallGoodsDao.xml
src/main/resources/mapper/mall/MallGoodsDao.xml
+262
-0
not-check.yml
src/main/resources/not-check.yml
+6
-0
没有找到文件。
kustomization/overlays/dev/kustomization.yaml
浏览文件 @
317c12fa
...
@@ -18,4 +18,4 @@ patches:
...
@@ -18,4 +18,4 @@ patches:
images
:
images
:
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag
:
37582a668837033ad61d64321c6fa7620ea17d45
newTag
:
2e525557874dabcb58b6516aefc612e98bf6e76e
src/main/java/com/mmc/pms/auth/dto/LoginSuccessDTO.java
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
auth
.
dto
;
package
com
.
mmc
.
pms
.
auth
.
dto
;
import
com.mmc.pms.model.other.dto.RoleInfoDTO
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -27,5 +28,6 @@ public class LoginSuccessDTO implements Serializable {
...
@@ -27,5 +28,6 @@ public class LoginSuccessDTO implements Serializable {
private
String
userName
;
private
String
userName
;
private
String
nickName
;
private
String
nickName
;
private
CompanyInfoVO
companyInfoVO
;
private
CompanyInfoVO
companyInfoVO
;
// private RoleInfoDTO roleInfo;
private
RoleInfoDTO
roleInfo
;
private
Integer
appUserAccountId
;
}
}
src/main/java/com/mmc/pms/common/ResultEnum.java
浏览文件 @
317c12fa
...
@@ -339,7 +339,7 @@ public enum ResultEnum implements BaseErrorInfoInterface {
...
@@ -339,7 +339,7 @@ public enum ResultEnum implements BaseErrorInfoInterface {
GOODS_ON_SHELF_SUCCESS
(
"30905"
,
"商品上架成功"
),
GOODS_ON_SHELF_SUCCESS
(
"30905"
,
"商品上架成功"
),
GOODS_DOWN_SHELF_SUCCESS
(
"30906"
,
"商品下架成功"
),
GOODS_DOWN_SHELF_SUCCESS
(
"30906"
,
"商品下架成功"
),
GOODS_SKU_IS_NOT_NULL
(
"30907"
,
"商品规格不能为空"
),
GOODS_SKU_IS_NOT_NULL
(
"30907"
,
"商品规格不能为空"
),
GOODS_PIC_IS_NOT_NULL
(
"30908"
,
"
主图不能为空"
),
GOODS_PIC_IS_NOT_NULL
(
"30908"
,
"商品
主图不能为空"
),
GOODS_DESC_IS_NOT_NULL
(
"30910"
,
"商品描述不能为空"
),
GOODS_DESC_IS_NOT_NULL
(
"30910"
,
"商品描述不能为空"
),
GOODS_GROUP_IS_NOT_NULL
(
"30911"
,
"商品类型不能为空"
),
GOODS_GROUP_IS_NOT_NULL
(
"30911"
,
"商品类型不能为空"
),
GROUP_DONT_DELETE_BY_CHILD
(
"30912"
,
"该分类下尚有子分类存在"
),
GROUP_DONT_DELETE_BY_CHILD
(
"30912"
,
"该分类下尚有子分类存在"
),
...
@@ -407,7 +407,10 @@ public enum ResultEnum implements BaseErrorInfoInterface {
...
@@ -407,7 +407,10 @@ 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"
,
"默认目录不可删除或修改名称!"
),
THE_NAME_OF_A_CLASS_MUST_BE_UNIQUE
(
"3002"
,
"一级分类名称重复"
),
THE_CURRENT_CATEGORY_IS_ASSOCIATED_WITH_GOODS
(
"3004"
,
"当前分类已经关联商品请先删除商品"
),
THE_NAME_OF_THE_SECONDARY_CLASS_MUST_BE_UNIQUE
(
"3003"
,
"同一级分类下面二级分类不能重复"
);
/**
/**
* 错误码
* 错误码
*
*
...
...
src/main/java/com/mmc/pms/controller/BackstageGoodsManageController.java
浏览文件 @
317c12fa
...
@@ -22,14 +22,14 @@ import java.util.List;
...
@@ -22,14 +22,14 @@ import java.util.List;
/**
/**
* @Author LW
* @Author LW
*
* @date 2023/3/14 13:22 概要:
* @date 2023/3/14 13:22 概要:
*/
*/
@RestController
@RestController
@RequestMapping
(
"/goods"
)
@RequestMapping
(
"/goods"
)
@Api
(
tags
=
{
"后台-商品管理-相关接口"
})
@Api
(
tags
=
{
"后台-商品管理-相关接口"
})
public
class
BackstageGoodsManageController
extends
BaseController
{
public
class
BackstageGoodsManageController
extends
BaseController
{
@Resource
private
GoodsInfoService
goodsInfoService
;
@Resource
private
GoodsInfoService
goodsInfoService
;
@ApiOperation
(
value
=
"新增(租赁/销售)商品"
)
@ApiOperation
(
value
=
"新增(租赁/销售)商品"
)
@PostMapping
(
"addGoodsInfo"
)
@PostMapping
(
"addGoodsInfo"
)
...
...
src/main/java/com/mmc/pms/controller/category/CategoryController.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
controller
.
category
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.category.dto.CategoryPrimaryDTO
;
import
com.mmc.pms.model.category.dto.CategorySubDTO
;
import
com.mmc.pms.model.category.qo.CategoryQO
;
import
com.mmc.pms.model.category.vo.CategoryPrimaryVO
;
import
com.mmc.pms.model.category.vo.CategorySubVO
;
import
com.mmc.pms.model.group.Create
;
import
com.mmc.pms.model.group.Others
;
import
com.mmc.pms.model.group.Update
;
import
com.mmc.pms.service.category.CategoryService
;
import
io.swagger.annotations.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/20 16:17
* @Version 1.0
* <p>
* 新版本分类管理
*/
@RestController
@RequestMapping
(
"/category"
)
@Api
(
tags
=
{
"后台-新版-分类管理"
})
public
class
CategoryController
{
@Autowired
private
CategoryService
categoryService
;
@ApiOperation
(
value
=
"一级分类————新增"
)
@PostMapping
(
"/addPrimaryCategory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
addPrimaryCategory
(
HttpServletRequest
request
,
@RequestBody
@Validated
(
value
=
{
Create
.
class
})
CategoryPrimaryVO
primaryVO
)
{
return
categoryService
.
addPrimaryCategory
(
primaryVO
);
}
@ApiOperation
(
value
=
"一级分类————编辑"
)
@PostMapping
(
"/updatePrimaryCategory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
updatePrimaryCategory
(
HttpServletRequest
request
,
@RequestBody
@Validated
(
value
=
{
Update
.
class
})
CategoryPrimaryVO
primaryVO
)
{
return
categoryService
.
updatePrimaryCategory
(
primaryVO
);
}
@ApiOperation
(
value
=
"一级分类————删除"
)
@GetMapping
(
"/deletePrimaryCategory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
deletePrimaryCategory
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"id"
,
required
=
true
)
Integer
id
)
{
return
categoryService
.
deletePrimaryCategory
(
id
);
}
@ApiOperation
(
value
=
"一级分类————列表/包含二级分类"
)
@PostMapping
(
"/categoryList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
<
CategoryPrimaryDTO
>
categoryList
(
HttpServletRequest
request
,
@Validated
(
value
=
{
Page
.
class
})
@ApiParam
(
value
=
"角色查询QO"
,
required
=
true
)
@RequestBody
CategoryQO
param
)
{
return
ResultBody
.
success
(
categoryService
.
categoryList
(
param
));
}
@ApiOperation
(
value
=
"二级分类————新增"
)
@PostMapping
(
"/addSubCategory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
addSubCategory
(
HttpServletRequest
request
,
@RequestBody
@Validated
(
value
=
{
Create
.
class
})
CategorySubVO
subVO
)
{
return
categoryService
.
addSubCategory
(
subVO
);
}
@ApiOperation
(
value
=
"二级分类————编辑"
)
@PostMapping
(
"/updateSubCategory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
updateSubCategory
(
HttpServletRequest
request
,
@RequestBody
@Validated
(
value
=
{
Update
.
class
})
CategorySubVO
subVO
)
{
return
categoryService
.
updateSubCategory
(
subVO
);
}
@ApiOperation
(
value
=
"二级分类————删除"
)
@GetMapping
(
"/deleteSubCategory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
deleteSubCategory
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"id"
,
required
=
true
)
Integer
id
)
{
return
categoryService
.
deleteSubCategory
(
id
);
}
@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
id
)
{
return
categoryService
.
detailSubCategory
(
id
);
}
@ApiOperation
(
value
=
"一级分类——排序交换"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"exchange"
)
public
ResultBody
exchangeBannerInfo
(
@Validated
(
Others
.
class
)
@RequestBody
List
<
CategoryPrimaryVO
>
list
)
{
return
categoryService
.
exchange
(
list
);
}
@ApiOperation
(
value
=
"小程序分类信息--含一二级分类"
)
@GetMapping
(
"/appCategoryInfo"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
CategoryPrimaryDTO
.
class
)})
public
ResultBody
<
CategoryPrimaryDTO
>
appCategoryInfo
()
{
return
categoryService
.
appCategoryInfo
();
}
}
src/main/java/com/mmc/pms/controller/mall/AppMallGoodsController.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
controller
.
mall
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.controller.BaseController
;
import
com.mmc.pms.model.mall.MallGoodsVO
;
import
com.mmc.pms.service.mall.AppMallGoodsService
;
import
com.mmc.pms.service.mall.MallGoodsService
;
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.*
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @Author LW
* @date 2023/7/26 14:26
* 概要:
*/
@RestController
@RequestMapping
(
"/app/goods"
)
@Api
(
tags
=
{
"V1.0.3-小程序商城商品-相关接口"
})
public
class
AppMallGoodsController
extends
BaseController
{
@Resource
private
MallGoodsService
mallGoodsService
;
@Resource
private
AppMallGoodsService
appMallGoodsService
;
@ApiOperation
(
value
=
"小程序商品详情"
)
@GetMapping
(
"appMallGoodsDetails"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
MallGoodsVO
.
class
)})
public
ResultBody
<
MallGoodsVO
>
appMallGoodsDetails
(
@RequestParam
Integer
id
)
{
return
mallGoodsService
.
mallGoodsDetails
(
id
);
}
@ApiOperation
(
value
=
"查询品牌方的商品"
)
@GetMapping
(
"queryBrandGoods"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
MallGoodsVO
.
class
)})
public
ResultBody
<
MallGoodsVO
>
queryBrandGoods
(
@RequestParam
Integer
userAccountId
)
{
return
appMallGoodsService
.
queryBrandGoods
(
userAccountId
);
}
@ApiOperation
(
value
=
"根据子分类查询商品信息"
)
@PostMapping
(
"queryGoodsInfoByCategorySub"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
MallGoodsVO
.
class
)})
public
ResultBody
<
MallGoodsVO
>
queryGoodsInfoByCategorySub
(
@RequestBody
List
<
Integer
>
categorySubIds
)
{
return
appMallGoodsService
.
queryGoodsInfoByCategorySub
(
categorySubIds
);
}
}
src/main/java/com/mmc/pms/controller/mall/MallGoodsController.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
controller
.
mall
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.controller.BaseController
;
import
com.mmc.pms.model.mall.MallGoodsVO
;
import
com.mmc.pms.model.sale.dto.SkuUnitDTO
;
import
com.mmc.pms.model.sale.qo.MallGoodsInfoQO
;
import
com.mmc.pms.service.mall.MallGoodsService
;
import
io.swagger.annotations.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @Author LW
* @date 2023/7/24 16:56 概要:
*/
@RestController
@RequestMapping
(
"/mall/goods"
)
@Api
(
tags
=
{
"V1.0.3-商城商品-相关接口"
})
public
class
MallGoodsController
extends
BaseController
{
@Resource
private
MallGoodsService
mallGoodsService
;
@ApiOperation
(
value
=
"新增商城商品"
)
@PostMapping
(
"addMallGoods"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
addMallGoods
(
@RequestBody
MallGoodsVO
mallGoodsVO
,
HttpServletRequest
request
)
{
return
mallGoodsService
.
addMallGoods
(
mallGoodsVO
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
}
@ApiOperation
(
value
=
"商城商品详情"
)
@GetMapping
(
"mallGoodsDetails"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
MallGoodsVO
.
class
)})
public
ResultBody
<
MallGoodsVO
>
mallGoodsDetails
(
@RequestParam
Integer
id
)
{
return
mallGoodsService
.
mallGoodsDetails
(
id
);
}
@ApiOperation
(
value
=
"编辑商城商品"
)
@PostMapping
(
"editMallGoods"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
editMallGoods
(
@RequestBody
MallGoodsVO
mallGoodsVO
,
HttpServletRequest
request
)
{
return
mallGoodsService
.
editMallGoods
(
mallGoodsVO
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
}
@ApiOperation
(
value
=
"单位信息"
)
@GetMapping
(
"getSkuUnit"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
SkuUnitDTO
.
class
)})
public
ResultBody
getSkuUnit
()
{
return
mallGoodsService
.
getSkuUnit
();
}
@ApiOperation
(
value
=
"商品列表-分页"
)
@PostMapping
(
"listPageGoodsInfo"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
MallGoodsVO
.
class
)})
public
ResultBody
<
MallGoodsVO
>
listPageGoodsInfo
(
@ApiParam
(
"商品查询条件QO"
)
@RequestBody
MallGoodsInfoQO
param
,
HttpServletRequest
request
)
{
return
ResultBody
.
success
(
mallGoodsService
.
listPageGoodsInfo
(
param
,
this
.
getUserLoginInfoFromRedis
(
request
)));
}
@ApiOperation
(
value
=
"商品列表-排序"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"exchange"
)
public
ResultBody
exchange
(
@ApiParam
(
value
=
"第一个商品id"
,
required
=
true
)
@RequestParam
(
value
=
"firstId"
)
Integer
firstId
,
@ApiParam
(
value
=
"第二个商品id"
,
required
=
true
)
@RequestParam
(
value
=
"secondId"
)
Integer
secondId
)
{
return
mallGoodsService
.
exchange
(
firstId
,
secondId
);
}
@ApiOperation
(
value
=
"商品列表-上架或下架"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"upOrDownShelf"
)
public
ResultBody
upOrDownShelf
(
@ApiParam
(
value
=
"商品id"
,
required
=
true
)
@RequestParam
(
value
=
"id"
)
Integer
id
,
@ApiParam
(
value
=
"状态 0:下架 1: 上架"
,
required
=
true
)
@RequestParam
(
value
=
"status"
)
Integer
status
)
{
return
mallGoodsService
.
upOrDownShelf
(
id
,
status
);
}
@ApiOperation
(
value
=
"商品列表-删除"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"removeMallGoods"
)
public
ResultBody
removeMallGoods
(
@ApiParam
(
value
=
"商品id"
,
required
=
true
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
return
mallGoodsService
.
removeMallGoods
(
id
);
}
@ApiOperation
(
value
=
"删除用户时对应的商品也删除"
,
hidden
=
true
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"feignRemoveGoodsByBackUserAccountId"
)
public
ResultBody
feignRemoveGoodsByUserAccountId
(
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
return
mallGoodsService
.
feignRemoveGoodsByBackUserAccountId
(
id
);
}
}
src/main/java/com/mmc/pms/dao/GoodsInfoDao.java
浏览文件 @
317c12fa
...
@@ -89,7 +89,7 @@ public interface GoodsInfoDao {
...
@@ -89,7 +89,7 @@ public interface GoodsInfoDao {
List
<
MallGoodsProductDO
>
listIndustryProductList
(
List
<
Integer
>
industrySpecIds
);
List
<
MallGoodsProductDO
>
listIndustryProductList
(
List
<
Integer
>
industrySpecIds
);
List
<
GoodsInfo
>
ListGoodsInfoByCategoryId
(
Integer
pageNo
,
Integer
pageSize
,
Integer
id
,
int
type
);
List
<
GoodsInfo
>
ListGoodsInfoByCategoryId
(
Integer
pageNo
,
Integer
pageSize
,
Integer
id
,
int
type
);
List
<
MallProdSkuInfoSpecDO
>
getMallProSkuInfoSpec
(
Integer
goodsInfoId
);
List
<
MallProdSkuInfoSpecDO
>
getMallProSkuInfoSpec
(
Integer
goodsInfoId
);
...
...
src/main/java/com/mmc/pms/dao/category/CategoryDao.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
dao
.
category
;
import
com.mmc.pms.entity.ServiceDO
;
import
com.mmc.pms.entity.category.CategoryPrimaryDO
;
import
com.mmc.pms.entity.category.CategorySubDO
;
import
com.mmc.pms.model.category.qo.CategoryQO
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/21 10:20
* @Version 1.0
*/
@Mapper
public
interface
CategoryDao
{
int
getCountName
(
String
name
);
void
addPrimaryCategory
(
CategoryPrimaryDO
primaryDO
);
void
updateSort
(
Integer
id
);
void
deletePrimaryCategory
(
Integer
id
);
Integer
categoryCount
(
CategoryPrimaryDO
primaryDO
);
void
updatePrimaryCategory
(
CategoryPrimaryDO
primaryDO
);
int
getCountSubName
(
String
name
,
Integer
categoryPrimaryId
);
void
addSubCategory
(
CategorySubDO
subDO
);
Integer
categorySubCount
(
CategorySubDO
subDO
);
void
updateSubCategory
(
CategorySubDO
subDO
);
void
deleteSubCategory
(
Integer
id
);
CategorySubDO
detailSubCategory
(
Integer
id
);
List
<
CategoryPrimaryDO
>
categoryList
(
CategoryQO
param
);
List
<
CategorySubDO
>
selectSubList
(
Integer
id
);
int
categoryListCount
(
CategoryQO
param
);
void
exchange
(
ServiceDO
serviceDO
);
List
<
CategoryPrimaryDO
>
selectPrimaryList
();
List
<
CategorySubDO
>
selectCategorySubList
(
List
<
Integer
>
ids
);
Integer
selectSubMallGoods
(
Integer
id
);
Integer
selectPrimary
(
Integer
id
);
}
src/main/java/com/mmc/pms/dao/mall/AppMallGoodsDao.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
dao
.
mall
;
import
com.mmc.pms.entity.mall.MallGoodsDO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Author LW
* @date 2023/7/26 14:57
* 概要:
*/
@Mapper
public
interface
AppMallGoodsDao
{
List
<
MallGoodsDO
>
queryGoodsInfo
(
@Param
(
"userAccountId"
)
Integer
userAccountId
,
@Param
(
"categorySubIds"
)
List
<
Integer
>
categorySubIds
);
}
src/main/java/com/mmc/pms/dao/mall/MallGoodsDao.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
dao
.
mall
;
import
com.mmc.pms.entity.SkuUnitDO
;
import
com.mmc.pms.entity.mall.GoodsSpecDO
;
import
com.mmc.pms.entity.mall.GoodsSpecValuesDO
;
import
com.mmc.pms.entity.mall.MallGoodsDO
;
import
com.mmc.pms.entity.mall.MallGoodsResourcesDO
;
import
com.mmc.pms.model.mall.MallGoodsVO
;
import
com.mmc.pms.model.sale.qo.MallGoodsInfoQO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @Author LW
* @date 2023/7/24 17:38 概要:
*/
@Mapper
public
interface
MallGoodsDao
{
int
countMallGoodsByName
(
@Param
(
"mallGoodsVO"
)
MallGoodsVO
mallGoodsVO
,
@Param
(
"userAccountId"
)
Integer
userAccountId
);
int
countMallGoods
(
Integer
userAccountId
);
void
insertMallGoodsBaseInfo
(
MallGoodsDO
mallGoodsDO
);
void
insertGoodsSpec
(
GoodsSpecDO
goodsSpecDO
);
void
batchInsertSpecValues
(
List
<
GoodsSpecValuesDO
>
goodsSpecValuesList
);
void
batchInsertMallGoodsResources
(
List
<
MallGoodsResourcesDO
>
mallGoodsResourcesList
);
MallGoodsDO
getMallGoodsBaseInfo
(
Integer
id
);
List
<
MallGoodsResourcesDO
>
getMallGoodsResources
(
Integer
id
);
List
<
GoodsSpecDO
>
getMallGoodsSpec
(
Integer
id
);
List
<
GoodsSpecValuesDO
>
getMallGoodsSpecValues
(
List
<
Integer
>
ids
);
void
updateMallGoods
(
@Param
(
"mallGoodsDO"
)
MallGoodsDO
mallGoodsDO
);
void
deleteMallGoodsResources
(
Integer
id
);
void
deleteGoodsSpec
(
List
<
Integer
>
deleteSpec
);
void
updateGoodsSpec
(
GoodsSpecDO
goodsSpecDO
);
void
deleteGoodsSpecValues
(
List
<
Integer
>
deleteSpecValueId
);
void
updateGoodsSpecValue
(
GoodsSpecValuesDO
goodsSpecValuesDO
);
List
<
SkuUnitDO
>
getSkuUnit
();
int
countListMallGoods
(
MallGoodsInfoQO
param
);
List
<
MallGoodsDO
>
listMallGoods
(
MallGoodsInfoQO
param
);
int
updateMallGoodsSort
(
Integer
id
,
Integer
sort
);
void
updateMallGoodsByShelf
(
Integer
id
,
Integer
status
);
void
removeMallGoods
(
Integer
id
);
void
feignRemoveGoodsByBackUserAccountId
(
Integer
id
);
}
src/main/java/com/mmc/pms/entity/category/CategoryPrimaryDO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
entity
.
category
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.mmc.pms.model.category.dto.CategoryPrimaryDTO
;
import
com.mmc.pms.model.category.vo.CategoryPrimaryVO
;
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
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.util.Date
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/21 10:15
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
CategoryPrimaryDO
{
@ApiModelProperty
(
value
=
"id"
)
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
@Min
(
value
=
1
,
groups
=
{
Update
.
class
})
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@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
;
@ApiModelProperty
(
value
=
"描述"
)
@Size
(
max
=
70
,
message
=
"分类描述不能超过70个字"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
String
description
;
@ApiModelProperty
(
value
=
"icon图标"
)
private
String
icon
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"2023-07-14 10:13:12"
,
required
=
true
)
private
Date
createTime
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新时间"
,
example
=
"2023-07-14 10:13:12"
,
required
=
true
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"子分类"
)
private
List
<
CategorySubDO
>
subDOList
;
@ApiModelProperty
(
value
=
"顺序"
)
private
Integer
sort
;
public
CategoryPrimaryDO
(
CategoryPrimaryVO
primaryVO
)
{
this
.
id
=
primaryVO
.
getId
();
this
.
name
=
primaryVO
.
getName
();
this
.
description
=
primaryVO
.
getDescription
();
this
.
icon
=
primaryVO
.
getIcon
();
}
public
CategoryPrimaryDTO
buildCategoryPrimaryDTO
()
{
return
CategoryPrimaryDTO
.
builder
()
.
id
(
this
.
id
)
.
name
(
this
.
name
)
.
description
(
this
.
description
)
.
icon
(
this
.
icon
)
.
createTime
(
this
.
createTime
)
.
updateTime
(
this
.
updateTime
)
.
subDTOList
(
this
.
subDOList
)
.
sort
(
this
.
sort
)
.
build
();
}
}
src/main/java/com/mmc/pms/entity/category/CategorySubDO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
entity
.
category
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.mmc.pms.model.category.dto.CategorySubDTO
;
import
com.mmc.pms.model.category.vo.CategorySubVO
;
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
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.util.Date
;
/**
* @Author small
* @Date 2023/7/21 10:16
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
CategorySubDO
{
@ApiModelProperty
(
value
=
"id"
)
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
@Min
(
value
=
1
,
groups
=
{
Update
.
class
})
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@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
;
@ApiModelProperty
(
value
=
"描述"
)
@Size
(
max
=
70
,
message
=
"分类描述不能超过70个字"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
String
description
;
@ApiModelProperty
(
value
=
"一级id不能为空"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"一级id不能为空"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
Integer
categoryPrimaryId
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"2023-07-14 10:13:12"
,
required
=
true
)
private
Date
createTime
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新时间"
,
example
=
"2023-07-14 10:13:12"
,
required
=
true
)
private
Date
updateTime
;
public
CategorySubDO
(
CategorySubVO
subVO
)
{
this
.
id
=
subVO
.
getId
();
this
.
name
=
subVO
.
getName
();
this
.
description
=
subVO
.
getDescription
();
this
.
categoryPrimaryId
=
subVO
.
getCategoryPrimaryId
();
}
public
CategorySubDTO
buildCategorySubDTO
()
{
return
CategorySubDTO
.
builder
()
.
id
(
this
.
id
)
.
name
(
this
.
name
)
.
description
(
this
.
description
)
.
categoryPrimaryId
(
this
.
categoryPrimaryId
)
.
createTime
(
this
.
createTime
)
.
updateTime
(
this
.
updateTime
)
.
build
();
}
}
src/main/java/com/mmc/pms/entity/mall/GoodsSpecDO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
entity
.
mall
;
import
com.mmc.pms.model.mall.GoodsSpecVO
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* (GoodsSpecDO)实体类
*
* @author makejava
* @since 2023-07-24 21:16:41
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
GoodsSpecDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
381669128695968475L
;
private
Integer
id
;
/**
* 商品id
*/
private
Integer
mallGoodsId
;
/**
* 规格名称
*/
private
String
specName
;
/**
* 0单选,1多选
*/
private
Integer
chooseType
;
/**
* 0 非必选 1 必选
*/
private
Integer
must
;
/**
* 单位id
*/
private
Integer
skuUnitId
;
private
Date
createTime
;
private
Date
updateTime
;
public
GoodsSpecDO
(
GoodsSpecVO
goodsSpecVO
)
{
this
.
id
=
goodsSpecVO
.
getId
();
this
.
mallGoodsId
=
goodsSpecVO
.
getMallGoodsId
();
this
.
specName
=
goodsSpecVO
.
getSpecName
();
this
.
chooseType
=
goodsSpecVO
.
getChooseType
();
this
.
must
=
goodsSpecVO
.
getMust
();
this
.
skuUnitId
=
goodsSpecVO
.
getSkuUnitId
();
}
public
GoodsSpecVO
buildGoodsSpecVO
()
{
return
GoodsSpecVO
.
builder
().
id
(
id
).
mallGoodsId
(
mallGoodsId
).
specName
(
specName
)
.
chooseType
(
chooseType
).
must
(
must
).
skuUnitId
(
skuUnitId
).
build
();
}
}
src/main/java/com/mmc/pms/entity/mall/GoodsSpecValuesDO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
entity
.
mall
;
import
com.mmc.pms.model.mall.GoodsSpecValuesVO
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* (GoodsSpecValuesDO)实体类
*
* @author makejava
* @since 2023-07-24 21:18:28
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
GoodsSpecValuesDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
35192084826222973L
;
private
Integer
id
;
/**
* 规格id
*/
private
Integer
goodsSpecId
;
/**
* 选项名称
*/
private
String
specValueName
;
/**
* 料号
*/
private
String
partNo
;
/**
* 规格图片
*/
private
String
specValueImage
;
/**
* 销售价是否显示 0:否 1:是
*/
private
Integer
showPrice
;
/**
* 库存
*/
private
Integer
stock
;
/**
* 销售价格
*/
private
BigDecimal
salePrice
;
/**
* 渠道价格
*/
private
BigDecimal
channelPrice
;
private
Date
createTime
;
private
Date
updateTime
;
public
GoodsSpecValuesDO
(
GoodsSpecValuesVO
d
)
{
this
.
id
=
d
.
getId
();
this
.
goodsSpecId
=
d
.
getGoodsSpecId
();
this
.
specValueName
=
d
.
getSpecValueName
();
this
.
partNo
=
d
.
getPartNo
();
this
.
specValueImage
=
d
.
getSpecValueImage
();
this
.
showPrice
=
d
.
getShowPrice
();
this
.
channelPrice
=
d
.
getChannelPrice
();
this
.
salePrice
=
d
.
getSalePrice
();
this
.
stock
=
d
.
getStock
();
}
public
GoodsSpecValuesVO
buildGoodsSpecValuesVO
()
{
return
GoodsSpecValuesVO
.
builder
().
id
(
id
).
goodsSpecId
(
goodsSpecId
)
.
specValueName
(
specValueName
).
specValueImage
(
specValueImage
)
.
partNo
(
partNo
).
showPrice
(
showPrice
).
stock
(
stock
)
.
salePrice
(
salePrice
).
channelPrice
(
channelPrice
).
build
();
}
}
src/main/java/com/mmc/pms/entity/mall/MallGoodsDO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
entity
.
mall
;
import
com.mmc.pms.model.mall.GoodsResourcesVO
;
import
com.mmc.pms.model.mall.MallGoodsVO
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* 商品基本信息(MallGoodsDO)实体类
*
* @author makejava
* @since 2023-07-24 21:10:02
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
MallGoodsDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
709941898403563905L
;
private
Integer
id
;
/**
* 商品编号(ID12345678)
*/
private
String
goodsNo
;
/**
* 商品名称
*/
private
String
tradeName
;
/**
* 商品描述
*/
private
String
description
;
/**
* 商品一级分类
*/
private
Integer
categoryPrimaryId
;
/**
* 商品二级分类
*/
private
Integer
categorySubId
;
/**
* 状态:0: 下架 1:上架
*/
private
Integer
shelfStatus
;
/**
* 商品标签
*/
private
String
goodsLabel
;
/**
* 标签是否显示0:否1:是
*/
private
Integer
labelShow
;
/**
* 商品详情图 富文本
*/
private
String
goodsDetails
;
/**
* 创建商品用户id
*/
private
Integer
userAccountId
;
/**
* 排序字段
*/
private
Integer
sort
;
private
Date
createTime
;
private
Date
updateTime
;
private
Integer
deleted
;
private
String
url
;
private
Integer
type
;
private
Integer
imgId
;
public
MallGoodsDO
(
MallGoodsVO
mallGoodsVO
)
{
this
.
id
=
mallGoodsVO
.
getId
();
this
.
tradeName
=
mallGoodsVO
.
getTradeName
();
this
.
description
=
mallGoodsVO
.
getDescription
();
this
.
categoryPrimaryId
=
mallGoodsVO
.
getCategoryPrimaryId
();
this
.
categorySubId
=
mallGoodsVO
.
getCategorySubId
();
this
.
shelfStatus
=
mallGoodsVO
.
getShelfStatus
();
this
.
goodsLabel
=
mallGoodsVO
.
getGoodsLabel
();
this
.
labelShow
=
mallGoodsVO
.
getLabelShow
();
this
.
goodsDetails
=
mallGoodsVO
.
getGoodsDetails
();
}
public
MallGoodsVO
buildMallGoodsVO
()
{
return
MallGoodsVO
.
builder
().
id
(
id
).
userAccountId
(
userAccountId
).
tradeName
(
tradeName
).
description
(
description
)
.
categoryPrimaryId
(
categoryPrimaryId
).
categorySubId
(
categorySubId
).
shelfStatus
(
shelfStatus
)
.
goodsLabel
(
goodsLabel
).
labelShow
(
labelShow
).
goodsDetails
(
goodsDetails
).
build
();
}
public
MallGoodsVO
buildListMallGoodsVO
()
{
List
<
GoodsResourcesVO
>
resourcesList
=
new
ArrayList
<>();
GoodsResourcesVO
goodsResourcesVO
=
new
GoodsResourcesVO
();
goodsResourcesVO
.
setId
(
imgId
);
goodsResourcesVO
.
setUrl
(
url
);
goodsResourcesVO
.
setType
(
type
);
resourcesList
.
add
(
goodsResourcesVO
);
return
MallGoodsVO
.
builder
().
id
(
id
).
userAccountId
(
userAccountId
).
tradeName
(
tradeName
).
resourcesList
(
resourcesList
)
.
categoryPrimaryId
(
categoryPrimaryId
).
labelShow
(
labelShow
).
goodsLabel
(
goodsLabel
).
categorySubId
(
categorySubId
)
.
shelfStatus
(
shelfStatus
).
createTime
(
createTime
).
description
(
description
).
build
();
}
}
src/main/java/com/mmc/pms/entity/mall/MallGoodsResourcesDO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
entity
.
mall
;
import
com.mmc.pms.model.mall.GoodsResourcesVO
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* (MallGoodsResourcesDO)实体类
*
* @author makejava
* @since 2023-07-24 21:13:15
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
MallGoodsResourcesDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
98370711703270379L
;
private
Integer
id
;
private
Integer
mallGoodsId
;
/**
* 资源url
*/
private
String
url
;
/**
* 类型:0主图 1副图 2视频
*/
private
Integer
type
;
private
Date
createTime
;
private
Date
updateTime
;
public
MallGoodsResourcesDO
(
GoodsResourcesVO
d
)
{
this
.
type
=
d
.
getType
();
this
.
id
=
d
.
getId
();
this
.
url
=
d
.
getUrl
();
}
public
GoodsResourcesVO
buildGoodsResourcesVO
()
{
return
GoodsResourcesVO
.
builder
().
id
(
id
).
url
(
url
).
type
(
type
).
build
();
}
}
src/main/java/com/mmc/pms/model/category/dto/CategoryPrimaryDTO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
model
.
category
.
dto
;
import
com.mmc.pms.entity.category.CategorySubDO
;
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
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.util.Date
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/20 16:35
* @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public
class
CategoryPrimaryDTO
{
@ApiModelProperty
(
value
=
"id"
)
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
@Min
(
value
=
1
,
groups
=
{
Update
.
class
})
private
Integer
id
;
@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
;
@ApiModelProperty
(
value
=
"描述"
)
@Size
(
max
=
70
,
message
=
"分类描述不能超过70个字"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
String
description
;
@ApiModelProperty
(
value
=
"icon图标"
)
private
String
icon
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"2023-07-14 10:13:12"
,
required
=
true
)
private
Date
createTime
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新时间"
,
example
=
"2023-07-14 10:13:12"
,
required
=
true
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"二级分类"
)
private
List
<
CategorySubDO
>
subDTOList
;
@ApiModelProperty
(
value
=
"顺序"
)
private
Integer
sort
;
}
src/main/java/com/mmc/pms/model/category/dto/CategorySubDTO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
model
.
category
.
dto
;
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
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.util.Date
;
/**
* @Author small
* @Date 2023/7/21 10:10
* @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public
class
CategorySubDTO
{
@ApiModelProperty
(
value
=
"id"
)
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
@Min
(
value
=
1
,
groups
=
{
Update
.
class
})
private
Integer
id
;
@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
;
@ApiModelProperty
(
value
=
"描述"
)
@Size
(
max
=
70
,
message
=
"分类描述不能超过70个字"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
String
description
;
@ApiModelProperty
(
value
=
"一级id不能为空"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"一级id不能为空"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
Integer
categoryPrimaryId
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"创建时间"
,
example
=
"2023-07-14 10:13:12"
,
required
=
true
)
private
Date
createTime
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新时间"
,
example
=
"2023-07-14 10:13:12"
,
required
=
true
)
private
Date
updateTime
;
}
src/main/java/com/mmc/pms/model/category/qo/CategoryQO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
model
.
category
.
qo
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.model.group.Freeze
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
/**
* @Author small
* @Date 2023/7/21 15:22
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
CategoryQO
{
private
static
final
long
serialVersionUID
=
-
3729786590325257669L
;
@ApiModelProperty
(
value
=
"一级分类id"
,
required
=
false
,
example
=
"1"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"当前页"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"当前页不能为空"
,
groups
=
{
Page
.
class
,
Freeze
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"页大小"
,
required
=
true
,
example
=
"10"
)
@NotNull
(
message
=
"页大小不能为空"
,
groups
=
{
Page
.
class
,
Freeze
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
src/main/java/com/mmc/pms/model/category/vo/CategoryPrimaryVO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
model
.
category
.
vo
;
import
com.mmc.pms.model.group.Create
;
import
com.mmc.pms.model.group.Others
;
import
com.mmc.pms.model.group.Update
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
/**
* @Author small
* @Date 2023/7/20 16:34
* @Version 1.0
*/
@Data
public
class
CategoryPrimaryVO
{
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
,
Others
.
class
})
@Min
(
value
=
1
,
groups
=
{
Update
.
class
})
private
Integer
id
;
@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
;
@ApiModelProperty
(
value
=
"描述"
,
example
=
"描述一下"
)
@Size
(
max
=
70
,
message
=
"分类描述不能超过70个字"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
String
description
;
@ApiModelProperty
(
value
=
"icon图标"
,
example
=
"http://"
)
private
String
icon
;
@ApiModelProperty
(
value
=
"顺序"
)
@NotNull
(
message
=
"sort不能为空"
,
groups
=
{
Others
.
class
})
private
Integer
sort
;
}
src/main/java/com/mmc/pms/model/category/vo/CategorySubVO.java
0 → 100644
浏览文件 @
317c12fa
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.Data
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
/**
* @Author small
* @Date 2023/7/21 10:10
* @Version 1.0
*/
@Data
public
class
CategorySubVO
{
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
@Min
(
value
=
1
,
groups
=
{
Update
.
class
})
private
Integer
id
;
@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
;
@ApiModelProperty
(
value
=
"描述"
,
example
=
"描述001"
)
@Size
(
max
=
70
,
message
=
"分类描述不能超过70个字"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
String
description
;
@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/mall/GoodsResourcesVO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
model
.
mall
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @Author LW
* @date 2023/7/24 17:57
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
GoodsResourcesVO
{
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"url"
)
private
String
url
;
@ApiModelProperty
(
value
=
"类型:0主图 1副图 2视频"
)
private
Integer
type
;
}
src/main/java/com/mmc/pms/model/mall/GoodsSpecVO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
model
.
mall
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @Author LW
* @date 2023/7/24 20:16
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public
class
GoodsSpecVO
{
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"商品id"
)
private
Integer
mallGoodsId
;
@ApiModelProperty
(
value
=
"规格名称"
,
example
=
"规格名称"
,
required
=
true
)
private
String
specName
;
@ApiModelProperty
(
value
=
"选择方式 :0单选,1多选"
,
example
=
"1"
,
required
=
true
)
private
Integer
chooseType
;
@ApiModelProperty
(
value
=
"是否必选 : 0 非必选 1 必选"
,
example
=
"0"
,
required
=
true
)
private
Integer
must
;
@ApiModelProperty
(
value
=
"单位id"
,
example
=
"1"
,
required
=
true
)
private
Integer
skuUnitId
;
@ApiModelProperty
(
value
=
"规格值信息"
,
required
=
true
)
private
List
<
GoodsSpecValuesVO
>
goodsSpecValuesList
;
}
src/main/java/com/mmc/pms/model/mall/GoodsSpecValuesVO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
model
.
mall
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.math.BigDecimal
;
/**
* @Author LW
* @date 2023/7/24 20:26
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public
class
GoodsSpecValuesVO
{
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"规格id"
,
example
=
"1"
)
private
Integer
goodsSpecId
;
@ApiModelProperty
(
value
=
"选项名称"
,
example
=
"规格值名称"
,
required
=
true
)
private
String
specValueName
;
@ApiModelProperty
(
value
=
"料号"
,
example
=
"料号"
,
required
=
true
)
private
String
partNo
;
@ApiModelProperty
(
value
=
"规格值图片url"
,
example
=
"1.jpg"
,
required
=
true
)
private
String
specValueImage
;
@ApiModelProperty
(
value
=
"是否展示销售价格 0:否 1:是"
,
example
=
"1"
,
required
=
true
)
private
Integer
showPrice
;
@ApiModelProperty
(
value
=
"库存数量"
,
example
=
"100"
)
private
Integer
stock
;
@ApiModelProperty
(
value
=
"销售价格"
,
example
=
"100.00"
,
required
=
true
)
private
BigDecimal
salePrice
;
@ApiModelProperty
(
value
=
"渠道价格"
,
example
=
"50.00"
)
private
BigDecimal
channelPrice
;
}
src/main/java/com/mmc/pms/model/mall/MallGoodsVO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
model
.
mall
;
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.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
import
java.util.List
;
/**
* @Author LW
* @date 2023/7/24 17:44
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
MallGoodsVO
{
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
private
Integer
id
;
@ApiModelProperty
(
value
=
"商品名称"
,
example
=
"这是商品名称"
,
required
=
true
)
@NotBlank
(
message
=
"商品名称不能为空"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
String
tradeName
;
@ApiModelProperty
(
value
=
"商品描述"
,
example
=
"商品描述"
,
required
=
true
)
@NotBlank
(
message
=
"商品描述不能为空"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
String
description
;
@ApiModelProperty
(
value
=
"商品资源:图片or视频及其他"
)
@NotEmpty
(
message
=
"图片不能为空"
)
private
List
<
GoodsResourcesVO
>
resourcesList
;
@ApiModelProperty
(
value
=
"一级分类id"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"一级分类id不能为空"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
Integer
categoryPrimaryId
;
@ApiModelProperty
(
value
=
"二级分类id"
,
example
=
"2"
,
required
=
true
)
@NotNull
(
message
=
"二级分类id不能为空"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
Integer
categorySubId
;
@ApiModelProperty
(
value
=
"商品状态"
,
example
=
"1"
,
required
=
true
)
@NotNull
(
message
=
"商品状态不能为空"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
Integer
shelfStatus
;
@ApiModelProperty
(
value
=
"商品标签"
)
private
String
goodsLabel
;
@ApiModelProperty
(
value
=
"标签是否显示 0否 1是"
)
private
Integer
labelShow
;
@ApiModelProperty
(
value
=
"规格"
)
@NotEmpty
(
message
=
"规格不能为空"
,
groups
=
{
Update
.
class
,
Create
.
class
})
private
List
<
GoodsSpecVO
>
goodsSpecList
;
@ApiModelProperty
(
value
=
"商品详情 富文本"
)
private
String
goodsDetails
;
@ApiModelProperty
(
value
=
"创建时间 用作列表回显"
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"店铺id 小程序用"
)
private
Integer
userAccountId
;
}
src/main/java/com/mmc/pms/model/other/dto/RoleInfoDTO.java
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
model
.
other
.
dto
;
package
com
.
mmc
.
pms
.
model
.
other
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
...
@@ -10,40 +9,27 @@ import lombok.NoArgsConstructor;
...
@@ -10,40 +9,27 @@ import lombok.NoArgsConstructor;
import
java.io.Serializable
;
import
java.io.Serializable
;
/**
/**
* @Author small @Date 2023/5/25 9:57 @Version 1.0
* @Author small
* @Date 2023/7/10 16:03
* @Version 1.0
*/
*/
@Builder
@Builder
@Data
@Data
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
@ApiModel
(
description
=
"角色信息DTO"
)
public
class
RoleInfoDTO
implements
Serializable
{
public
class
RoleInfoDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
4791023169682602298L
;
private
static
final
long
serialVersionUID
=
-
4791023169682602298L
;
@ApiModelProperty
(
value
=
"角色ID"
)
@ApiModelProperty
(
value
=
"角色ID"
)
private
Integer
id
;
private
Integer
id
;
@ApiModelProperty
(
value
=
"角色编号"
)
@ApiModelProperty
(
value
=
"角色编号"
)
private
String
roleNo
;
private
String
roleNo
;
@ApiModelProperty
(
value
=
"角色名称/权限角色"
)
@ApiModelProperty
(
value
=
"角色名称"
)
private
String
roleName
;
private
String
roleName
;
@ApiModelProperty
(
value
=
"是否为管理角色:0否 1是"
)
private
Integer
admin
;
// 是否为管理角色
@ApiModelProperty
(
value
=
"是否为运营角色:0否 1是"
)
private
Integer
operate
;
@ApiModelProperty
(
value
=
"是否为系统角色:0否 1是"
)
private
Integer
system
;
@ApiModelProperty
(
value
=
"是否为PMC发货角色:0否 1是"
)
private
Integer
pmc
;
// PMC发货角色
@ApiModelProperty
(
value
=
"是否可用:0否 1是"
)
private
Integer
roleStatus
;
@ApiModelProperty
(
value
=
"备注"
)
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
private
String
remark
;
@ApiModelProperty
(
value
=
"账号名称/创建人"
)
private
String
userName
;
@ApiModelProperty
(
value
=
"0不是超级管理员 1是超级管理员"
)
private
Integer
superAdmin
;
}
}
src/main/java/com/mmc/pms/model/sale/qo/MallGoodsInfoQO.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
model
.
sale
.
qo
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.model.group.Freeze
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
/**
* @Author LW
* @date 2022/3/22 9:44 概要:商品列表查询QO
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
MallGoodsInfoQO
{
@ApiModelProperty
(
value
=
"商品名称"
,
example
=
"商品名称"
)
private
String
tradeName
;
@ApiModelProperty
(
value
=
"商品一级分类"
,
example
=
"1"
)
private
Integer
categoryPrimaryId
;
@ApiModelProperty
(
value
=
"用户id"
,
hidden
=
true
)
private
Integer
userAccountId
;
@ApiModelProperty
(
value
=
"商品状态 0:下架 1:上架"
)
private
Integer
shelfStatus
;
@ApiModelProperty
(
value
=
"页码"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"页码不能为空"
,
groups
=
{
Page
.
class
,
Freeze
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageNo
;
@ApiModelProperty
(
value
=
"每页显示数"
,
required
=
true
,
example
=
"10"
)
@NotNull
(
message
=
"每页显示数不能为空"
,
groups
=
{
Page
.
class
,
Freeze
.
class
})
@Min
(
value
=
1
,
groups
=
Page
.
class
)
private
Integer
pageSize
;
public
void
buildCurrentPage
()
{
this
.
pageNo
=
(
pageNo
-
1
)
*
pageSize
;
}
}
src/main/java/com/mmc/pms/model/sale/qo/MallGoodsQO.java
浏览文件 @
317c12fa
...
@@ -13,7 +13,6 @@ import javax.validation.constraints.NotNull;
...
@@ -13,7 +13,6 @@ import javax.validation.constraints.NotNull;
/**
/**
* @Author LW
* @Author LW
*
* @date 2022/3/22 9:44 概要:商品列表查询QO
* @date 2022/3/22 9:44 概要:商品列表查询QO
*/
*/
@Builder
@Builder
...
...
src/main/java/com/mmc/pms/model/sale/vo/GoodsSpecVO.java
deleted
100644 → 0
浏览文件 @
efc83179
package
com
.
mmc
.
pms
.
model
.
sale
.
vo
;
import
com.mmc.pms.model.sale.dto.ProductSpecVO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @Author small @Date 2023/5/16 15:27 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
GoodsSpecVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8681372139970849591L
;
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"规格名称"
)
private
String
goodsSpecName
;
@ApiModelProperty
(
value
=
"产品类型"
)
private
Integer
goodsTypeId
;
@ApiModelProperty
(
value
=
"产品:自定义时此字段可不用填写"
)
private
Integer
skuId
;
@ApiModelProperty
(
value
=
"规格来源 0:获取 1:自定义"
)
private
Integer
flag
;
@ApiModelProperty
(
value
=
"产品名称(自定义的时候才需要传值)"
)
private
String
productName
;
@ApiModelProperty
(
value
=
"选项来源"
)
private
List
<
MallProductSpecVO
>
specIds
;
@ApiModelProperty
(
value
=
"选择方式"
)
private
Integer
chooseType
;
@ApiModelProperty
(
value
=
"规格单位"
)
private
Integer
skuUnitId
;
@ApiModelProperty
(
value
=
"是否必选"
)
private
Integer
must
;
@ApiModelProperty
(
value
=
"自定义的信息填充"
)
private
List
<
ProductSpecVO
>
customizeInfo
;
@ApiModelProperty
(
value
=
"删除的自定义规格id"
)
private
List
<
Integer
>
delProductSpecId
;
}
src/main/java/com/mmc/pms/service/GoodsInfoService.java
浏览文件 @
317c12fa
src/main/java/com/mmc/pms/service/category/CategoryService.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
service
.
category
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.category.dto.CategoryPrimaryDTO
;
import
com.mmc.pms.model.category.qo.CategoryQO
;
import
com.mmc.pms.model.category.vo.CategoryPrimaryVO
;
import
com.mmc.pms.model.category.vo.CategorySubVO
;
import
com.mmc.pms.page.PageResult
;
import
java.util.List
;
/**
* @Author small
* @Date 2023/7/20 16:26
* @Version 1.0
*/
public
interface
CategoryService
{
ResultBody
addPrimaryCategory
(
CategoryPrimaryVO
primaryVO
);
ResultBody
deletePrimaryCategory
(
Integer
id
);
ResultBody
updatePrimaryCategory
(
CategoryPrimaryVO
primaryVO
);
ResultBody
addSubCategory
(
CategorySubVO
subVO
);
ResultBody
updateSubCategory
(
CategorySubVO
subVO
);
ResultBody
deleteSubCategory
(
Integer
id
);
ResultBody
detailSubCategory
(
Integer
id
);
PageResult
<
CategoryPrimaryDTO
>
categoryList
(
CategoryQO
param
);
ResultBody
exchange
(
List
<
CategoryPrimaryVO
>
list
);
ResultBody
<
CategoryPrimaryDTO
>
appCategoryInfo
();
}
src/main/java/com/mmc/pms/service/category/impl/CategoryServiceImpl.java
0 → 100644
浏览文件 @
317c12fa
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.CategoryDao
;
import
com.mmc.pms.entity.ServiceDO
;
import
com.mmc.pms.entity.category.CategoryPrimaryDO
;
import
com.mmc.pms.entity.category.CategorySubDO
;
import
com.mmc.pms.model.category.dto.CategoryPrimaryDTO
;
import
com.mmc.pms.model.category.dto.CategorySubDTO
;
import
com.mmc.pms.model.category.qo.CategoryQO
;
import
com.mmc.pms.model.category.vo.CategoryPrimaryVO
;
import
com.mmc.pms.model.category.vo.CategorySubVO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.category.CategoryService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @Author small
* @Date 2023/7/20 16:26
* @Version 1.0
*/
@Service
public
class
CategoryServiceImpl
implements
CategoryService
{
@Autowired
private
CategoryDao
categoryDao
;
@Override
public
ResultBody
addPrimaryCategory
(
CategoryPrimaryVO
primaryVO
)
{
int
count
=
categoryDao
.
getCountName
(
primaryVO
.
getName
());
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
THE_NAME_OF_A_CLASS_MUST_BE_UNIQUE
);
}
CategoryPrimaryDO
primaryDO
=
new
CategoryPrimaryDO
(
primaryVO
);
categoryDao
.
addPrimaryCategory
(
primaryDO
);
Integer
id
=
primaryDO
.
getId
();
categoryDao
.
updateSort
(
id
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
deletePrimaryCategory
(
Integer
id
)
{
Integer
integer
=
categoryDao
.
selectPrimary
(
id
);
if
(
integer
!=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
THE_CURRENT_CATEGORY_IS_ASSOCIATED_WITH_GOODS
);
}
categoryDao
.
deletePrimaryCategory
(
id
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
updatePrimaryCategory
(
CategoryPrimaryVO
primaryVO
)
{
CategoryPrimaryDO
primaryDO
=
new
CategoryPrimaryDO
(
primaryVO
);
Integer
count
=
categoryDao
.
categoryCount
(
primaryDO
);
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
THE_NAME_OF_A_CLASS_MUST_BE_UNIQUE
);
}
categoryDao
.
updatePrimaryCategory
(
primaryDO
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
addSubCategory
(
CategorySubVO
subVO
)
{
int
count
=
categoryDao
.
getCountSubName
(
subVO
.
getName
(),
subVO
.
getCategoryPrimaryId
());
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
THE_NAME_OF_THE_SECONDARY_CLASS_MUST_BE_UNIQUE
);
}
CategorySubDO
subDO
=
new
CategorySubDO
(
subVO
);
int
number
=
(
int
)
(
Math
.
random
()
*
90
+
10
);
subDO
.
setId
(
subVO
.
getCategoryPrimaryId
()
+
1
+
number
);
categoryDao
.
addSubCategory
(
subDO
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
updateSubCategory
(
CategorySubVO
subVO
)
{
CategorySubDO
subDO
=
new
CategorySubDO
(
subVO
);
Integer
count
=
categoryDao
.
categorySubCount
(
subDO
);
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
THE_NAME_OF_THE_SECONDARY_CLASS_MUST_BE_UNIQUE
);
}
categoryDao
.
updateSubCategory
(
subDO
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
deleteSubCategory
(
Integer
id
)
{
Integer
integer
=
categoryDao
.
selectSubMallGoods
(
id
);
if
(
integer
!=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
THE_CURRENT_CATEGORY_IS_ASSOCIATED_WITH_GOODS
);
}
categoryDao
.
deleteSubCategory
(
id
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
<
CategorySubDTO
>
detailSubCategory
(
Integer
id
)
{
CategorySubDO
subDO
=
categoryDao
.
detailSubCategory
(
id
);
CategorySubDTO
categorySubDTO
=
null
;
if
(
subDO
!=
null
)
{
categorySubDTO
=
subDO
.
buildCategorySubDTO
();
}
return
ResultBody
.
success
(
categorySubDTO
);
}
@Override
public
PageResult
<
CategoryPrimaryDTO
>
categoryList
(
CategoryQO
param
)
{
int
count
=
categoryDao
.
categoryListCount
(
param
);
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
);
}
param
.
buildCurrentPage
();
List
<
CategoryPrimaryDO
>
categoryPrimaryDOS
=
categoryDao
.
categoryList
(
param
);
List
<
CategoryPrimaryDTO
>
collect
=
categoryPrimaryDOS
.
stream
().
map
(
t
->
t
.
buildCategoryPrimaryDTO
()).
collect
(
Collectors
.
toList
());
return
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
,
collect
);
}
@Transactional
@Override
public
ResultBody
exchange
(
List
<
CategoryPrimaryVO
>
list
)
{
Integer
sort
=
list
.
get
(
0
).
getSort
();
ServiceDO
serviceDO
=
new
ServiceDO
();
serviceDO
.
setId
(
list
.
get
(
0
).
getId
());
serviceDO
.
setSort
(
list
.
get
(
1
).
getSort
());
categoryDao
.
exchange
(
serviceDO
);
ServiceDO
serviceDO1
=
new
ServiceDO
();
serviceDO1
.
setId
(
list
.
get
(
1
).
getId
());
serviceDO1
.
setSort
(
sort
);
categoryDao
.
exchange
(
serviceDO1
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
<
CategoryPrimaryDTO
>
appCategoryInfo
()
{
// 获取所有以及分类
List
<
CategoryPrimaryDO
>
categoryPrimaryList
=
categoryDao
.
selectPrimaryList
();
if
(
CollectionUtils
.
isEmpty
(
categoryPrimaryList
))
{
return
ResultBody
.
success
();
}
List
<
CategoryPrimaryDTO
>
primaryList
=
categoryPrimaryList
.
stream
()
.
map
(
CategoryPrimaryDO:
:
buildCategoryPrimaryDTO
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
ids
=
primaryList
.
stream
().
map
(
CategoryPrimaryDTO:
:
getId
).
collect
(
Collectors
.
toList
());
// 批量查找二级分类
List
<
CategorySubDO
>
categorySubList
=
categoryDao
.
selectCategorySubList
(
ids
);
if
(
CollectionUtils
.
isNotEmpty
(
categorySubList
))
{
Map
<
Integer
,
List
<
CategorySubDO
>>
subMap
=
categorySubList
.
stream
().
collect
(
Collectors
.
groupingBy
(
CategorySubDO:
:
getCategoryPrimaryId
));
for
(
CategoryPrimaryDTO
categoryPrimaryDTO
:
primaryList
)
{
List
<
CategorySubDO
>
categorySubDOList
=
subMap
.
get
(
categoryPrimaryDTO
.
getId
());
categoryPrimaryDTO
.
setSubDTOList
(
categorySubDOList
);
}
}
return
ResultBody
.
success
(
primaryList
);
}
}
src/main/java/com/mmc/pms/service/impl/GoodsInfoServiceImpl.java
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
service
.
impl
;
package
com
.
mmc
.
pms
.
service
.
impl
;
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.dao.GoodsInfoDao
;
import
com.mmc.pms.dao.GoodsInfoDao
;
...
@@ -34,13 +35,17 @@ import java.util.stream.Collectors;
...
@@ -34,13 +35,17 @@ import java.util.stream.Collectors;
@Service
@Service
public
class
GoodsInfoServiceImpl
implements
GoodsInfoService
{
public
class
GoodsInfoServiceImpl
implements
GoodsInfoService
{
@Resource
private
GoodsInfoDao
goodsInfoDao
;
@Resource
private
GoodsInfoDao
goodsInfoDao
;
@Resource
private
ProductDao
productDao
;
@Resource
private
ProductDao
productDao
;
@Resource
private
ProductServiceImpl
productSkuService
;
@Resource
private
ProductServiceImpl
productSkuService
;
@Resource
private
IndustrySpecDao
industrySpecDao
;
@Resource
private
IndustrySpecDao
industrySpecDao
;
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -81,7 +86,9 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
...
@@ -81,7 +86,9 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
return
ResultBody
.
success
();
return
ResultBody
.
success
();
}
}
/** 插入行业sku及规格信息 */
/**
* 插入行业sku及规格信息
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
industrySkuSpecOperation
(
GoodsInfo
goodsInfo
,
List
<
GoodsProdSpecVO
>
productSpec
)
{
public
void
industrySkuSpecOperation
(
GoodsInfo
goodsInfo
,
List
<
GoodsProdSpecVO
>
productSpec
)
{
for
(
GoodsProdSpecVO
goodsSpecVO
:
productSpec
)
{
for
(
GoodsProdSpecVO
goodsSpecVO
:
productSpec
)
{
...
...
src/main/java/com/mmc/pms/service/mall/AppMallGoodsService.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
service
.
mall
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.mall.MallGoodsVO
;
import
java.util.List
;
/**
* @Author LW
* @date 2023/7/26 14:55
* 概要:
*/
public
interface
AppMallGoodsService
{
ResultBody
<
MallGoodsVO
>
queryBrandGoods
(
Integer
userAccountId
);
ResultBody
<
MallGoodsVO
>
queryGoodsInfoByCategorySub
(
List
<
Integer
>
categorySubIds
);
}
src/main/java/com/mmc/pms/service/mall/MallGoodsService.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
service
.
mall
;
import
com.mmc.pms.auth.dto.LoginSuccessDTO
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.mall.MallGoodsVO
;
import
com.mmc.pms.model.sale.qo.MallGoodsInfoQO
;
import
com.mmc.pms.page.PageResult
;
/**
* @Author LW
* @date 2023/7/24 17:37 概要:
*/
public
interface
MallGoodsService
{
ResultBody
addMallGoods
(
MallGoodsVO
mallGoodsVO
,
Integer
userAccountId
);
ResultBody
<
MallGoodsVO
>
mallGoodsDetails
(
Integer
id
);
ResultBody
editMallGoods
(
MallGoodsVO
mallGoodsVO
,
Integer
userAccountId
);
ResultBody
getSkuUnit
();
PageResult
listPageGoodsInfo
(
MallGoodsInfoQO
param
,
LoginSuccessDTO
loginSuccessDTO
);
ResultBody
exchange
(
Integer
firstId
,
Integer
secondId
);
ResultBody
upOrDownShelf
(
Integer
id
,
Integer
status
);
ResultBody
removeMallGoods
(
Integer
id
);
ResultBody
feignRemoveGoodsByBackUserAccountId
(
Integer
id
);
}
src/main/java/com/mmc/pms/service/mall/impl/AppMallGoodsServiceImpl.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
service
.
mall
.
impl
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.dao.mall.AppMallGoodsDao
;
import
com.mmc.pms.entity.mall.MallGoodsDO
;
import
com.mmc.pms.model.mall.MallGoodsVO
;
import
com.mmc.pms.service.mall.AppMallGoodsService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @Author LW
* @date 2023/7/26 14:55
* 概要:
*/
@Service
public
class
AppMallGoodsServiceImpl
implements
AppMallGoodsService
{
@Resource
private
AppMallGoodsDao
appMallGoodsDao
;
@Override
public
ResultBody
<
MallGoodsVO
>
queryBrandGoods
(
Integer
userAccountId
)
{
List
<
MallGoodsDO
>
mallGoodsList
=
appMallGoodsDao
.
queryGoodsInfo
(
userAccountId
,
null
);
return
checkGoodsInfo
(
mallGoodsList
);
}
@Override
public
ResultBody
<
MallGoodsVO
>
queryGoodsInfoByCategorySub
(
List
<
Integer
>
categorySubIds
)
{
List
<
MallGoodsDO
>
mallGoodsList
=
appMallGoodsDao
.
queryGoodsInfo
(
null
,
categorySubIds
);
return
checkGoodsInfo
(
mallGoodsList
);
}
private
ResultBody
<
MallGoodsVO
>
checkGoodsInfo
(
List
<
MallGoodsDO
>
mallGoodsList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
mallGoodsList
))
{
return
ResultBody
.
success
(
mallGoodsList
.
stream
().
map
(
MallGoodsDO:
:
buildListMallGoodsVO
).
collect
(
Collectors
.
toList
()));
}
return
ResultBody
.
success
();
}
}
src/main/java/com/mmc/pms/service/mall/impl/MallGoodsServiceImpl.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
service
.
mall
.
impl
;
import
com.mmc.pms.auth.dto.LoginSuccessDTO
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultEnum
;
import
com.mmc.pms.dao.mall.MallGoodsDao
;
import
com.mmc.pms.entity.SkuUnitDO
;
import
com.mmc.pms.entity.mall.GoodsSpecDO
;
import
com.mmc.pms.entity.mall.GoodsSpecValuesDO
;
import
com.mmc.pms.entity.mall.MallGoodsDO
;
import
com.mmc.pms.entity.mall.MallGoodsResourcesDO
;
import
com.mmc.pms.model.mall.GoodsResourcesVO
;
import
com.mmc.pms.model.mall.GoodsSpecVO
;
import
com.mmc.pms.model.mall.GoodsSpecValuesVO
;
import
com.mmc.pms.model.mall.MallGoodsVO
;
import
com.mmc.pms.model.sale.dto.SkuUnitDTO
;
import
com.mmc.pms.model.sale.qo.MallGoodsInfoQO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.mall.MallGoodsService
;
import
com.mmc.pms.util.CodeUtil
;
import
com.mmc.pms.util.TDateUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
/**
* @Author LW
* @date 2023/7/24 17:37 概要:
*/
@Service
public
class
MallGoodsServiceImpl
implements
MallGoodsService
{
@Resource
private
MallGoodsDao
mallGoodsDao
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultBody
addMallGoods
(
MallGoodsVO
mallGoodsVO
,
Integer
userAccountId
)
{
ResultBody
resultError
=
checkInformation
(
mallGoodsVO
,
userAccountId
);
if
(
resultError
!=
null
)
return
resultError
;
int
count
=
mallGoodsDao
.
countMallGoods
(
userAccountId
);
MallGoodsDO
mallGoodsDO
=
new
MallGoodsDO
(
mallGoodsVO
);
mallGoodsDO
.
setGoodsNo
(
"MG"
+
TDateUtil
.
getDateStr
(
new
Date
(),
"yyyyMMddHHmmss"
)
+
CodeUtil
.
getRandomNum
(
4
));
mallGoodsDO
.
setUserAccountId
(
userAccountId
);
mallGoodsDO
.
setSort
(
count
+
1
);
// 将基础信息存储入库
mallGoodsDao
.
insertMallGoodsBaseInfo
(
mallGoodsDO
);
// 将商品图片等资源存入数据库中
insertMallGoodsResources
(
mallGoodsVO
,
mallGoodsDO
.
getId
());
// 将商品规格存入数据库
insertMallGoodsSpec
(
mallGoodsVO
.
getGoodsSpecList
(),
mallGoodsDO
.
getId
());
return
ResultBody
.
success
();
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
insertMallGoodsSpec
(
List
<
GoodsSpecVO
>
goodsSpecList
,
Integer
id
)
{
// 获取输入的规格信息
for
(
GoodsSpecVO
goodsSpecVO
:
goodsSpecList
)
{
goodsSpecVO
.
setMallGoodsId
(
id
);
GoodsSpecDO
goodsSpecDO
=
new
GoodsSpecDO
(
goodsSpecVO
);
// 插入规格信息
mallGoodsDao
.
insertGoodsSpec
(
goodsSpecDO
);
List
<
GoodsSpecValuesDO
>
goodsSpecValuesList
=
goodsSpecVO
.
getGoodsSpecValuesList
().
stream
().
map
(
d
->
{
d
.
setGoodsSpecId
(
goodsSpecDO
.
getId
());
return
new
GoodsSpecValuesDO
(
d
);
}).
collect
(
Collectors
.
toList
());
// 批量插入规格值的信息
mallGoodsDao
.
batchInsertSpecValues
(
goodsSpecValuesList
);
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
insertMallGoodsResources
(
MallGoodsVO
mallGoodsVO
,
Integer
id
)
{
List
<
MallGoodsResourcesDO
>
mallGoodsResourcesList
=
mallGoodsVO
.
getResourcesList
().
stream
().
map
(
d
->
{
MallGoodsResourcesDO
mallGoodsResourcesDO
=
new
MallGoodsResourcesDO
(
d
);
mallGoodsResourcesDO
.
setMallGoodsId
(
id
);
return
mallGoodsResourcesDO
;
}).
collect
(
Collectors
.
toList
());
mallGoodsDao
.
batchInsertMallGoodsResources
(
mallGoodsResourcesList
);
}
private
ResultBody
checkInformation
(
MallGoodsVO
mallGoodsVO
,
Integer
userAccountId
)
{
// 查询该账账号下是否有相同的商品名称存在
if
(
mallGoodsDao
.
countMallGoodsByName
(
mallGoodsVO
,
userAccountId
)
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
GOODS_CATEGORY_NAME_EXIST_ERROR
);
}
// 判断主图是否为空
List
<
GoodsResourcesVO
>
resourcesList
=
mallGoodsVO
.
getResourcesList
()
.
stream
().
filter
(
d
->
d
.
getType
().
equals
(
0
))
.
collect
(
Collectors
.
toList
());
if
(
resourcesList
.
size
()
==
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
GOODS_PIC_IS_NOT_NULL
);
}
return
null
;
}
@Override
public
ResultBody
<
MallGoodsVO
>
mallGoodsDetails
(
Integer
id
)
{
MallGoodsDO
mallGoodsDO
=
mallGoodsDao
.
getMallGoodsBaseInfo
(
id
);
if
(
mallGoodsDO
==
null
)
{
return
ResultBody
.
error
(
"商品不存在或已删除!"
);
}
MallGoodsVO
mallGoodsVO
=
mallGoodsDO
.
buildMallGoodsVO
();
// 获取图片及其他资源信息
List
<
MallGoodsResourcesDO
>
mallGoodsResourcesList
=
mallGoodsDao
.
getMallGoodsResources
(
id
);
mallGoodsVO
.
setResourcesList
(
mallGoodsResourcesList
.
stream
()
.
map
(
MallGoodsResourcesDO:
:
buildGoodsResourcesVO
).
collect
(
Collectors
.
toList
()));
// 获取规格信息
List
<
GoodsSpecDO
>
goodsSpecList
=
mallGoodsDao
.
getMallGoodsSpec
(
id
);
List
<
GoodsSpecVO
>
goodsSpec
=
goodsSpecList
.
stream
().
map
(
GoodsSpecDO:
:
buildGoodsSpecVO
)
.
collect
(
Collectors
.
toList
());
// 获取规格值信息
List
<
GoodsSpecValuesDO
>
goodsSpecValuesList
=
mallGoodsDao
.
getMallGoodsSpecValues
(
goodsSpec
.
stream
().
map
(
GoodsSpecVO:
:
getId
).
collect
(
Collectors
.
toList
()));
List
<
GoodsSpecValuesVO
>
goodsSpecValues
=
goodsSpecValuesList
.
stream
().
map
(
GoodsSpecValuesDO:
:
buildGoodsSpecValuesVO
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
List
<
GoodsSpecValuesVO
>>
goodsSpecValuesVO
=
goodsSpecValues
.
stream
().
collect
(
Collectors
.
groupingBy
(
GoodsSpecValuesVO:
:
getGoodsSpecId
));
for
(
GoodsSpecVO
goodsSpecVO
:
goodsSpec
)
{
goodsSpecVO
.
setGoodsSpecValuesList
(
goodsSpecValuesVO
.
get
(
goodsSpecVO
.
getId
()));
}
mallGoodsVO
.
setGoodsSpecList
(
goodsSpec
);
return
ResultBody
.
success
(
mallGoodsVO
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultBody
editMallGoods
(
MallGoodsVO
mallGoodsVO
,
Integer
userAccountId
)
{
ResultBody
resultError
=
checkInformation
(
mallGoodsVO
,
userAccountId
);
if
(
resultError
!=
null
)
return
resultError
;
MallGoodsDO
mallGoodsDO
=
new
MallGoodsDO
(
mallGoodsVO
);
// 修改商城商品的基本信息
mallGoodsDao
.
updateMallGoods
(
mallGoodsDO
);
// 修改商城商品的图片等资源信息,先删除后新增
mallGoodsDao
.
deleteMallGoodsResources
(
mallGoodsVO
.
getId
());
this
.
insertMallGoodsResources
(
mallGoodsVO
,
mallGoodsVO
.
getId
());
// 从数据库获取商品规格信息
List
<
GoodsSpecDO
>
dbGoodsSpec
=
mallGoodsDao
.
getMallGoodsSpec
(
mallGoodsVO
.
getId
());
List
<
Integer
>
specIds
=
mallGoodsVO
.
getGoodsSpecList
().
stream
().
map
(
GoodsSpecVO:
:
getId
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
// 对比要删除的规格
List
<
Integer
>
deleteSpec
=
dbGoodsSpec
.
stream
().
map
(
GoodsSpecDO:
:
getId
).
filter
(
id
->
!
specIds
.
contains
(
id
)).
collect
(
Collectors
.
toList
());
if
(
deleteSpec
.
size
()
!=
0
)
{
mallGoodsDao
.
deleteGoodsSpec
(
deleteSpec
);
}
// 获取规格值信息
Map
<
Integer
,
List
<
GoodsSpecValuesDO
>>
specValuesMap
=
mallGoodsDao
.
getMallGoodsSpecValues
(
specIds
).
stream
()
.
collect
(
Collectors
.
groupingBy
(
GoodsSpecValuesDO:
:
getGoodsSpecId
));
// 修改规格信息
for
(
GoodsSpecVO
goodsSpecVO
:
mallGoodsVO
.
getGoodsSpecList
())
{
if
(
goodsSpecVO
.
getId
()
!=
null
)
{
GoodsSpecDO
goodsSpecDO
=
new
GoodsSpecDO
(
goodsSpecVO
);
mallGoodsDao
.
updateGoodsSpec
(
goodsSpecDO
);
// 数据库获取到的规格值信息
List
<
GoodsSpecValuesDO
>
dbSpecValues
=
specValuesMap
.
get
(
goodsSpecVO
.
getId
());
List
<
Integer
>
specValuesId
=
goodsSpecVO
.
getGoodsSpecValuesList
().
stream
().
map
(
GoodsSpecValuesVO:
:
getId
).
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
deleteSpecValueId
=
dbSpecValues
.
stream
().
map
(
GoodsSpecValuesDO:
:
getId
).
filter
(
id
->
!
specValuesId
.
contains
(
id
)).
collect
(
Collectors
.
toList
());
if
(
deleteSpecValueId
.
size
()
!=
0
)
{
mallGoodsDao
.
deleteGoodsSpecValues
(
deleteSpecValueId
);
}
// 修改规格值的信息
List
<
GoodsSpecValuesVO
>
updateSpecValue
=
goodsSpecVO
.
getGoodsSpecValuesList
().
stream
().
filter
(
d
->
d
.
getId
()
!=
null
).
collect
(
Collectors
.
toList
());
for
(
GoodsSpecValuesVO
goodsSpecValuesVO
:
updateSpecValue
)
{
GoodsSpecValuesDO
goodsSpecValuesDO
=
new
GoodsSpecValuesDO
(
goodsSpecValuesVO
);
goodsSpecValuesDO
.
setGoodsSpecId
(
goodsSpecVO
.
getId
());
mallGoodsDao
.
updateGoodsSpecValue
(
goodsSpecValuesDO
);
}
// 新增id为空的规格值
List
<
GoodsSpecValuesVO
>
newGoodsSpecValues
=
goodsSpecVO
.
getGoodsSpecValuesList
().
stream
().
filter
(
d
->
d
.
getId
()
==
null
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
newGoodsSpecValues
))
{
List
<
GoodsSpecValuesDO
>
goodsSpecValuesList
=
newGoodsSpecValues
.
stream
().
map
(
d
->
{
d
.
setGoodsSpecId
(
goodsSpecVO
.
getId
());
return
new
GoodsSpecValuesDO
(
d
);
}).
collect
(
Collectors
.
toList
());
// 批量插入规格值的信息
mallGoodsDao
.
batchInsertSpecValues
(
goodsSpecValuesList
);
}
}
}
// 新增id为空的规格
List
<
GoodsSpecVO
>
newGoodsSpec
=
mallGoodsVO
.
getGoodsSpecList
().
stream
().
filter
(
d
->
d
.
getId
()
==
null
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
newGoodsSpec
))
{
this
.
insertMallGoodsSpec
(
newGoodsSpec
,
mallGoodsVO
.
getId
());
}
return
ResultBody
.
success
();
}
@Override
public
ResultBody
getSkuUnit
()
{
List
<
SkuUnitDO
>
skuUnitList
=
mallGoodsDao
.
getSkuUnit
();
List
<
SkuUnitDTO
>
list
=
skuUnitList
.
stream
().
map
(
SkuUnitDO:
:
buildSkuUnitDTO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
list
);
}
@Override
public
PageResult
listPageGoodsInfo
(
MallGoodsInfoQO
param
,
LoginSuccessDTO
loginSuccessDTO
)
{
if
(
loginSuccessDTO
.
getRoleInfo
().
getSuperAdmin
().
equals
(
1
))
{
// 超级管理员获取所有商品信息
return
getMallGoodsInfo
(
param
);
}
else
{
// 非超级管理员获取自家的商品信息
param
.
setUserAccountId
(
loginSuccessDTO
.
getUserAccountId
());
return
getMallGoodsInfo
(
param
);
}
}
private
PageResult
getMallGoodsInfo
(
MallGoodsInfoQO
param
)
{
int
count
;
List
<
MallGoodsDO
>
mallGoodsList
;
count
=
mallGoodsDao
.
countListMallGoods
(
param
);
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
);
}
Integer
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
mallGoodsList
=
mallGoodsDao
.
listMallGoods
(
param
);
List
<
MallGoodsVO
>
pageList
=
mallGoodsList
.
stream
().
map
(
MallGoodsDO:
:
buildListMallGoodsVO
).
collect
(
Collectors
.
toList
());
return
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultBody
exchange
(
Integer
firstId
,
Integer
secondId
)
{
MallGoodsDO
firstMallGoodsBaseInfo
=
mallGoodsDao
.
getMallGoodsBaseInfo
(
firstId
);
MallGoodsDO
secondMallGoodsBaseInfo
=
mallGoodsDao
.
getMallGoodsBaseInfo
(
secondId
);
int
updateCount1
=
mallGoodsDao
.
updateMallGoodsSort
(
firstId
,
secondMallGoodsBaseInfo
.
getSort
());
int
updateCount2
=
mallGoodsDao
.
updateMallGoodsSort
(
secondId
,
firstMallGoodsBaseInfo
.
getSort
());
if
(
updateCount1
==
updateCount2
)
{
return
ResultBody
.
success
();
}
else
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
ResultBody
.
error
(
"排序失败"
);
}
}
@Override
public
ResultBody
upOrDownShelf
(
Integer
id
,
Integer
status
)
{
mallGoodsDao
.
updateMallGoodsByShelf
(
id
,
status
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
removeMallGoods
(
Integer
id
)
{
mallGoodsDao
.
removeMallGoods
(
id
);
return
ResultBody
.
success
();
}
@Override
public
ResultBody
feignRemoveGoodsByBackUserAccountId
(
Integer
id
)
{
mallGoodsDao
.
feignRemoveGoodsByBackUserAccountId
(
id
);
return
ResultBody
.
success
();
}
}
src/main/java/com/mmc/pms/util/SnowFlake.java
0 → 100644
浏览文件 @
317c12fa
package
com
.
mmc
.
pms
.
util
;
/**
* @author 作者 geDuo
* @version 创建时间:2022年2月21日 下午3:55:10
* https://www.cnblogs.com/sgh1023/p/14094592.html
* @explain 雪花算法-分布式id
*/
public
class
SnowFlake
{
/**
* 起始的时间戳
*/
private
final
static
long
START_STMP
=
1480166465631L
;
/**
* 每一部分占用的位数
*/
private
final
static
long
SEQUENCE_BIT
=
12
;
// 序列号占用的位数
private
final
static
long
MACHINE_BIT
=
5
;
// 机器标识占用的位数
private
final
static
long
DATACENTER_BIT
=
5
;
// 数据中心占用的位数
/**
* 每一部分的最大值
*/
private
final
static
long
MAX_DATACENTER_NUM
=
-
1L
^
(-
1L
<<
DATACENTER_BIT
);
private
final
static
long
MAX_MACHINE_NUM
=
-
1L
^
(-
1L
<<
MACHINE_BIT
);
private
final
static
long
MAX_SEQUENCE
=
-
1L
^
(-
1L
<<
SEQUENCE_BIT
);
/**
* 每一部分向左的位移
*/
private
final
static
long
MACHINE_LEFT
=
SEQUENCE_BIT
;
private
final
static
long
DATACENTER_LEFT
=
SEQUENCE_BIT
+
MACHINE_BIT
;
private
final
static
long
TIMESTMP_LEFT
=
DATACENTER_LEFT
+
DATACENTER_BIT
;
private
long
datacenterId
;
// 数据中心
private
long
machineId
;
// 机器标识
private
long
sequence
=
0L
;
// 序列号
private
long
lastStmp
=
-
1L
;
// 上一次时间戳
public
SnowFlake
(
long
datacenterId
,
long
machineId
)
{
if
(
datacenterId
>
MAX_DATACENTER_NUM
||
datacenterId
<
0
)
{
throw
new
IllegalArgumentException
(
"datacenterId can't be greater than MAX_DATACENTER_NUM or less than 0"
);
}
if
(
machineId
>
MAX_MACHINE_NUM
||
machineId
<
0
)
{
throw
new
IllegalArgumentException
(
"machineId can't be greater than MAX_MACHINE_NUM or less than 0"
);
}
this
.
datacenterId
=
datacenterId
;
this
.
machineId
=
machineId
;
}
/**
* 产生下一个ID
*
* @return
*/
public
synchronized
long
nextId
()
{
long
currStmp
=
getNewstmp
();
if
(
currStmp
<
lastStmp
)
{
throw
new
RuntimeException
(
"Clock moved backwards. Refusing to generate id"
);
}
if
(
currStmp
==
lastStmp
)
{
// 相同毫秒内,序列号自增
sequence
=
(
sequence
+
1
)
&
MAX_SEQUENCE
;
// 同一毫秒的序列数已经达到最大
if
(
sequence
==
0L
)
{
currStmp
=
getNextMill
();
}
}
else
{
// 不同毫秒内,序列号置为0
sequence
=
0L
;
}
lastStmp
=
currStmp
;
return
(
currStmp
-
START_STMP
)
<<
TIMESTMP_LEFT
// 时间戳部分
|
datacenterId
<<
DATACENTER_LEFT
// 数据中心部分
|
machineId
<<
MACHINE_LEFT
// 机器标识部分
|
sequence
;
// 序列号部分
}
private
long
getNextMill
()
{
long
mill
=
getNewstmp
();
while
(
mill
<=
lastStmp
)
{
mill
=
getNewstmp
();
}
return
mill
;
}
private
long
getNewstmp
()
{
return
System
.
currentTimeMillis
();
}
public
static
void
main
(
String
[]
args
)
{
SnowFlake
snowFlake
=
new
SnowFlake
(
2
,
3
);
for
(
int
i
=
0
;
i
<
(
1
<<
12
);
i
++)
{
System
.
out
.
println
(
snowFlake
.
nextId
());
}
}
}
src/main/resources/mapper/category/CategoryDao.xml
0 → 100644
浏览文件 @
317c12fa
<?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.CategoryDao"
>
<resultMap
id=
"CategoryList"
type=
"com.mmc.pms.entity.category.CategoryPrimaryDO"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"description"
column=
"description"
/>
<result
property=
"icon"
column=
"icon"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<collection
property=
"subDOList"
ofType=
"com.mmc.pms.entity.category.CategorySubDO"
select=
"selectSubList"
column=
"{categoryPrimaryId=id}"
>
</collection>
</resultMap>
<select
id=
"selectSubList"
resultType=
"com.mmc.pms.entity.category.CategorySubDO"
>
select id,
`name`,
description,
category_primary_id AS categoryPrimaryId,
create_time AS createTime,
update_time AS updateTime
from category_sub
where category_primary_id = #{categoryPrimaryId}
order by create_time desc
</select>
<select
id=
"categoryListCount"
resultType=
"int"
parameterType=
"com.mmc.pms.model.category.qo.CategoryQO"
>
SELECT count(*)
FROM
category_primary
WHERE 1=1
<if
test=
" id != null and id != '' "
>
and id=#{id}
</if>
</select>
<select
id=
"getCountName"
resultType=
"java.lang.Integer"
>
select count(*)
from category_primary
where 1=1
<if
test=
" name != null and name != '' "
>
and `name` = #{name}
</if>
</select>
<update
id=
"exchange"
parameterType=
"com.mmc.pms.entity.ServiceDO"
>
update category_primary
<set>
<if
test=
" sort != null "
>
sort = #{sort}
</if>
</set>
where id = #{id}
</update>
<insert
id=
"addPrimaryCategory"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.mmc.pms.entity.category.CategoryPrimaryDO"
>
insert into category_primary(`name`, description, create_time, update_time, icon)
values (#{name}, #{description}, NOW(), NOW(), #{icon})
</insert>
<update
id=
"updateSort"
>
update category_primary
<set>
<if
test=
"id!=null"
>
sort = #{id}
</if>
</set>
where id=#{id}
</update>
<delete
id=
"deletePrimaryCategory"
>
delete
from category_primary
where id = #{id}
</delete>
<select
id=
"categoryCount"
resultType=
"java.lang.Integer"
>
select count(*)
from category_primary
where 1=1
<if
test=
" name != null and name != '' "
>
and `name` = #{name}
</if>
<if
test=
" id != null and id != '' "
>
and id != #{id}
</if>
</select>
<update
id=
"updatePrimaryCategory"
parameterType=
"com.mmc.pms.entity.category.CategoryPrimaryDO"
>
UPDATE category_primary
<set>
<if
test=
" name != null and name != '' "
>
`name` = #{name},
</if>
<if
test=
" description != null and description != '' "
>
description = #{description},
</if>
<if
test=
" icon != null and icon != '' "
>
icon = #{icon},
</if>
update_time=NOW()
</set>
where id = #{id}
</update>
<select
id=
"getCountSubName"
resultType=
"java.lang.Integer"
>
select count(*)
from category_sub
where 1=1
<if
test=
" name != null and name != '' "
>
and `name` = #{name}
</if>
<if
test=
" categoryPrimaryId != null and categoryPrimaryId != '' "
>
and category_primary_id = #{categoryPrimaryId}
</if>
</select>
<insert
id=
"addSubCategory"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.mmc.pms.entity.category.CategorySubDO"
>
insert into category_sub(id, `name`, description, create_time, update_time, category_primary_id)
values (#{id}, #{name}, #{description}, NOW(), NOW(), #{categoryPrimaryId})
</insert>
<select
id=
"categorySubCount"
resultType=
"java.lang.Integer"
>
select count(*)
from category_sub
where 1=1
<if
test=
" name != null and name != '' "
>
and `name` = #{name}
</if>
<if
test=
" id != null and id != '' "
>
and id != #{id}
</if>
<if
test=
" categoryPrimaryId != null and categoryPrimaryId != '' "
>
and category_primary_id != #{categoryPrimaryId}
</if>
</select>
<update
id=
"updateSubCategory"
parameterType=
"com.mmc.pms.entity.category.CategorySubDO"
>
UPDATE category_sub
<set>
<if
test=
" name != null and name != '' "
>
`name` = #{name},
</if>
<if
test=
" description != null and description != '' "
>
description = #{description},
</if>
update_time=NOW()
</set>
where id = #{id}
</update>
<delete
id=
"deleteSubCategory"
>
delete
from category_sub
where id = #{id}
</delete>
<select
id=
"detailSubCategory"
resultType=
"com.mmc.pms.entity.category.CategorySubDO"
>
select id,
`name`,
description,
create_time AS createTime,
update_time AS updateTime,
category_primary_id AS categoryPrimaryId
from category_sub
where id = #{id}
</select>
<select
id=
"categoryList"
resultMap=
"CategoryList"
>
select id, `name`, description, create_time, update_time, icon,sort
from category_primary where 1=1
<if
test=
" id != null and id != '' "
>
and id =#{id}
</if>
order by sort desc, update_time desc, create_time desc
limit #{pageNo},#{pageSize}
</select>
<select
id=
"selectPrimaryList"
resultType=
"com.mmc.pms.entity.category.CategoryPrimaryDO"
>
select id,
`name`,
description,
create_time,
icon,
sort
from category_primary
order by sort desc, update_time desc, create_time desc
</select>
<select
id=
"selectCategorySubList"
resultType=
"com.mmc.pms.entity.category.CategorySubDO"
>
select id,
`name`,
description,
create_time,
update_time,
category_primary_id
from category_sub
<where>
<foreach
collection=
"list"
separator=
","
item=
"item"
open=
"category_primary_id in ("
close=
")"
>
#{item}
</foreach>
</where>
</select>
<select
id=
"selectSubMallGoods"
resultType=
"java.lang.Integer"
>
select count(*)
from mall_goods
where category_sub_id = #{id}
</select>
<select
id=
"selectPrimary"
resultType=
"java.lang.Integer"
>
select count(*)
from mall_goods
where category_primary_id = #{id}
</select>
</mapper>
src/main/resources/mapper/mall/AppMallGoodsDao.xml
0 → 100644
浏览文件 @
317c12fa
<?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.mall.AppMallGoodsDao"
>
<select
id=
"queryGoodsInfo"
resultType=
"com.mmc.pms.entity.mall.MallGoodsDO"
>
SELECT mg.id,
mg.trade_name,
mg.shelf_status,
mg.create_time,
mg.description,
mg.category_primary_id,
mg.user_account_id,
mg.goods_label,
mg.label_show,
mg.category_sub_id,
mg.goods_label,
img.id as imgId, img.url,
img.type
FROM mall_goods mg
INNER JOIN mall_goods_resources img ON mg.id = img.mall_goods_id
AND img.type = 0
<where>
mg.is_deleted = 0 and mg.shelf_status = 1
<if
test=
"userAccountId != null"
>
and mg.user_account_id = #{userAccountId}
</if>
<if
test=
"categorySubIds != null"
>
<foreach
collection=
"categorySubIds"
item=
"item"
open=
"and mg.category_sub_id in ("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</where>
ORDER BY
mg.sort DESC,mg.create_time DESC
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/mall/MallGoodsDao.xml
0 → 100644
浏览文件 @
317c12fa
<?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.mall.MallGoodsDao"
>
<insert
id=
"insertMallGoodsBaseInfo"
keyProperty=
"id"
useGeneratedKeys=
"true"
parameterType=
"com.mmc.pms.entity.mall.MallGoodsDO"
>
insert into mall_goods(goods_no,
trade_name,
description,
category_primary_id,
category_sub_id,
shelf_status,
goods_label,
label_show,
goods_details,
user_account_id,
sort)
values ( #{goodsNo}, #{tradeName}, #{description}, #{categoryPrimaryId}, #{categorySubId}
, #{shelfStatus}, #{goodsLabel}, #{labelShow}, #{goodsDetails}, #{userAccountId}, #{sort})
</insert>
<insert
id=
"insertGoodsSpec"
parameterType=
"com.mmc.pms.entity.mall.GoodsSpecDO"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into goods_spec (mall_goods_id,
spec_name,
choose_type,
must,
sku_unit_id)
values (#{mallGoodsId}, #{specName}, #{chooseType}, #{must}, #{skuUnitId})
</insert>
<insert
id=
"batchInsertSpecValues"
parameterType=
"list"
>
insert into goods_spec_values (goods_spec_id,
spec_value_name,
part_no,
spec_value_image,
show_price,
stock,
sale_price,
channel_price)
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.goodsSpecId},#{item.specValueName},#{item.partNo},#{item.specValueImage}
,#{item.showPrice},#{item.stock},#{item.salePrice},#{item.channelPrice})
</foreach>
</insert>
<insert
id=
"batchInsertMallGoodsResources"
>
insert into mall_goods_resources (mall_goods_id,
url,
`type`
)
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.mallGoodsId},#{item.url},#{item.type})
</foreach>
</insert>
<update
id=
"updateMallGoods"
>
UPDATE mall_goods
SET trade_name = #{mallGoodsDO.tradeName},
description = #{mallGoodsDO.description},
category_primary_id = #{mallGoodsDO.categoryPrimaryId},
category_sub_id = #{mallGoodsDO.categorySubId},
shelf_status = #{mallGoodsDO.shelfStatus},
goods_label = #{mallGoodsDO.goodsLabel},
label_show = #{mallGoodsDO.labelShow},
goods_details = #{mallGoodsDO.goodsDetails}
WHERE id = #{mallGoodsDO.id}
</update>
<update
id=
"updateGoodsSpec"
>
update goods_spec
set spec_name = #{specName},
choose_type = #{chooseType},
must = #{must},
sku_unit_id = #{skuUnitId}
where id = #{id}
</update>
<update
id=
"updateGoodsSpecValue"
>
update goods_spec_values
set goods_spec_id = #{goodsSpecId},
spec_value_name = #{specValueName},
part_no =#{partNo},
spec_value_image = #{specValueImage},
show_price = #{showPrice},
stock = #{stock},
sale_price = #{salePrice},
channel_price =#{channelPrice}
where id = #{id}
</update>
<update
id=
"updateMallGoodsSort"
>
update mall_goods
set sort = #{sort}
where id = #{id}
</update>
<update
id=
"updateMallGoodsByShelf"
>
update mall_goods
set shelf_status = #{status}
where id = #{id}
</update>
<update
id=
"removeMallGoods"
>
update mall_goods
set is_deleted = 1
where id = #{id}
</update>
<update
id=
"feignRemoveGoodsByBackUserAccountId"
>
update mall_goods
set is_deleted = 1
where user_account_id = #{id}
</update>
<delete
id=
"deleteMallGoodsResources"
>
delete
from mall_goods_resources
where mall_goods_id = #{id}
</delete>
<delete
id=
"deleteGoodsSpec"
>
delete
from goods_spec
<where>
<foreach
collection=
"list"
open=
"id in ("
close=
")"
item=
"item"
separator=
","
>
#{item}
</foreach>
</where>
</delete>
<delete
id=
"deleteGoodsSpecValues"
>
delete
from goods_spec_values
<where>
<foreach
collection=
"list"
open=
"id in ("
close=
")"
item=
"item"
separator=
","
>
#{item}
</foreach>
</where>
</delete>
<select
id=
"countMallGoodsByName"
resultType=
"java.lang.Integer"
>
select count(*)
from mall_goods
where is_deleted = 0
and trade_name = #{mallGoodsVO.tradeName}
and user_account_id = #{userAccountId}
<if
test=
"mallGoodsVO.id!=null"
>
and id
<![CDATA[<>]]>
#{mallGoodsVO.id}
</if>
</select>
<select
id=
"countMallGoods"
resultType=
"java.lang.Integer"
>
select count(*)
from mall_goods
where user_account_id = #{userAccountId}
</select>
<select
id=
"getMallGoodsBaseInfo"
resultType=
"com.mmc.pms.entity.mall.MallGoodsDO"
>
SELECT id,
goods_no,
trade_name,
description,
category_primary_id,
category_sub_id,
shelf_status,
goods_label,
label_show,
goods_details,
user_account_id,
sort
FROM mall_goods
WHERE id = #{id}
and is_deleted = 0
</select>
<select
id=
"getMallGoodsResources"
resultType=
"com.mmc.pms.entity.mall.MallGoodsResourcesDO"
>
SELECT id,
mall_goods_id,
url,
`type`
from mall_goods_resources
where mall_goods_id = #{id}
</select>
<select
id=
"getMallGoodsSpec"
resultType=
"com.mmc.pms.entity.mall.GoodsSpecDO"
>
select id,
mall_goods_id,
spec_name,
choose_type,
must,
sku_unit_id
from goods_spec
where mall_goods_id = #{id}
</select>
<select
id=
"getMallGoodsSpecValues"
resultType=
"com.mmc.pms.entity.mall.GoodsSpecValuesDO"
>
select id,
goods_spec_id,
spec_value_name,
part_no,
spec_value_image,
show_price,
stock,
sale_price,
channel_price
from goods_spec_values
<where>
<foreach
collection=
"list"
separator=
","
item=
"item"
open=
"goods_spec_id in ("
close=
")"
>
#{item}
</foreach>
</where>
</select>
<select
id=
"getSkuUnit"
resultType=
"com.mmc.pms.entity.SkuUnitDO"
>
SELECT id,
unit_name unitName,
create_time createTime
FROM sku_unit
WHERE is_deleted = 0
</select>
<select
id=
"countListMallGoods"
resultType=
"java.lang.Integer"
>
SELECT
count(*)
FROM
mall_goods
<where>
is_deleted = 0
<if
test=
"tradeName != null and tradeName !=''"
>
AND (trade_name LIKE CONCAT('%',#{tradeName},'%'))
</if>
<if
test=
"categoryPrimaryId != null"
>
and category_primary_id = #{categoryPrimaryId}
</if>
<if
test=
"userAccountId != null"
>
and user_account_id = #{userAccountId}
</if>
<if
test=
"shelfStatus != null"
>
and shelf_status = #{shelfStatus}
</if>
</where>
</select>
<select
id=
"listMallGoods"
resultType=
"com.mmc.pms.entity.mall.MallGoodsDO"
>
SELECT
mg.id,
mg.trade_name,
mg.shelf_status,
mg.create_time,
mg.category_primary_id,
mg.category_sub_id,
mg.user_account_id,
mg.description,
img.id as imgId,
img.url,
img.type
FROM
mall_goods mg
INNER JOIN mall_goods_resources img ON mg.id = img.mall_goods_id
AND img.type = 0
<where>
mg.is_deleted = 0
<if
test=
"tradeName != null and tradeName !=''"
>
AND (mg.trade_name LIKE CONCAT('%',#{tradeName},'%'))
</if>
<if
test=
"categoryPrimaryId != null"
>
and mg.category_primary_id = #{categoryPrimaryId}
</if>
<if
test=
"userAccountId != null"
>
and mg.user_account_id = #{userAccountId}
</if>
<if
test=
"shelfStatus != null"
>
and mg.shelf_status = #{shelfStatus}
</if>
</where>
ORDER BY
mg.shelf_status DESC , mg.sort DESC,mg.create_time DESC
limit #{pageNo},#{pageSize}
</select>
</mapper>
src/main/resources/not-check.yml
浏览文件 @
317c12fa
...
@@ -18,3 +18,8 @@ data-filter:
...
@@ -18,3 +18,8 @@ data-filter:
-
/pms/webDevice/getSecondDistrictInfo
-
/pms/webDevice/getSecondDistrictInfo
-
/pms/webDevice/ad
-
/pms/webDevice/ad
-
/pms/actuator/health/readiness
-
/pms/actuator/health/readiness
-
/pms/app/goods/appMallGoodsDetails
-
/pms/category/appCategoryInfo
-
/pms/app/goods/queryBrandGoods
-
/pms/app/goods/queryGoodsInfoByCategorySub
-
/pms/mall/goods/feignRemoveGoodsByBackUserAccountId
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论