Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
pms-ci-test
Commits
f2a1432b
提交
f2a1432b
authored
6月 09, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增:商品列表
上级
1a012e0e
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
543 行增加
和
433 行删除
+543
-433
BackstageCategoriesController.java
...com/mmc/pms/controller/BackstageCategoriesController.java
+103
-96
BackstageGoodsManageController.java
...om/mmc/pms/controller/BackstageGoodsManageController.java
+8
-0
WebDeviceController.java
...main/java/com/mmc/pms/controller/WebDeviceController.java
+15
-76
GoodsInfoDao.java
src/main/java/com/mmc/pms/dao/GoodsInfoDao.java
+5
-0
ProductDao.java
src/main/java/com/mmc/pms/dao/ProductDao.java
+0
-2
GoodsInfo.java
src/main/java/com/mmc/pms/entity/GoodsInfo.java
+64
-43
MallGoodsQO.java
src/main/java/com/mmc/pms/model/sale/qo/MallGoodsQO.java
+59
-0
GoodsInfoService.java
src/main/java/com/mmc/pms/service/GoodsInfoService.java
+4
-0
GoodsInfoServiceImpl.java
...n/java/com/mmc/pms/service/Impl/GoodsInfoServiceImpl.java
+16
-0
MiniProgramProductMallServiceImpl.java
...c/pms/service/Impl/MiniProgramProductMallServiceImpl.java
+173
-202
WebProductMallServiceImpl.java
...a/com/mmc/pms/service/Impl/WebProductMallServiceImpl.java
+24
-0
MiniProgramProductMallService.java
...va/com/mmc/pms/service/MiniProgramProductMallService.java
+0
-3
GoodsInfoDao.xml
src/main/resources/mapper/GoodsInfoDao.xml
+62
-1
MiniProgramProductMallDao.xml
src/main/resources/mapper/MiniProgramProductMallDao.xml
+6
-6
ProductDao.xml
src/main/resources/mapper/ProductDao.xml
+3
-3
WebProductMallDao.xml
src/main/resources/mapper/WebProductMallDao.xml
+1
-1
没有找到文件。
src/main/java/com/mmc/pms/controller/BackstageCategoriesController.java
浏览文件 @
f2a1432b
package
com
.
mmc
.
pms
.
controller
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.entity.Categories
;
import
com.mmc.pms.model.categories.dto.AllCategoryDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyDetailsDTO
;
import
com.mmc.pms.model.categories.dto.ClassifyInfoDTO
;
import
com.mmc.pms.model.categories.vo.CategoriesInfoVO
;
import
com.mmc.pms.model.categories.vo.ClassifyInfoVO
;
import
com.mmc.pms.model.categories.vo.DirectoryInfoVO
;
import
com.mmc.pms.model.categories.vo.RelevantBusinessVO
;
...
...
@@ -17,10 +15,8 @@ import io.swagger.annotations.*;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.validation.constraints.Min
;
import
java.util.List
;
/**
* @Author lw @Date 2023/5/15 13:24 @Version 1.0
...
...
@@ -29,96 +25,107 @@ import java.util.List;
@RestController
@RequestMapping
(
"/classify"
)
public
class
BackstageCategoriesController
{
@Autowired
private
CategoriesService
categoriesService
;
@ApiOperation
(
value
=
"新增or修改目录"
)
@PostMapping
(
"addOrEditDirectory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
addOrEditDirectory
(
@RequestBody
DirectoryInfoVO
param
)
{
return
categoriesService
.
addOrEditDirectory
(
param
);
}
@ApiOperation
(
value
=
"目录列表"
)
@GetMapping
(
"directoryList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
DirectoryInfoVO
.
class
)})
public
ResultBody
directoryList
(
@RequestParam
Integer
pageNo
,
@RequestParam
Integer
pageSize
,
@RequestParam
(
required
=
false
)
Integer
type
)
{
return
ResultBody
.
success
(
categoriesService
.
directoryList
(
pageNo
,
pageSize
,
type
));
}
@ApiOperation
(
value
=
"删除目录"
)
@GetMapping
(
"removeDirectory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
removeDirectory
(
@ApiParam
(
value
=
"id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
return
categoriesService
.
removeDirectory
(
id
);
}
@ApiOperation
(
value
=
"分类新增"
)
@PostMapping
(
"addClassification"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
addClassification
(
@Validated
(
Create
.
class
)
@RequestBody
ClassifyInfoVO
classifyInfoVO
)
{
return
categoriesService
.
addClassification
(
classifyInfoVO
);
}
@ApiOperation
(
value
=
"分类修改"
)
@PostMapping
(
"updateClassification"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
updateClassification
(
@Validated
(
Update
.
class
)
@RequestBody
ClassifyInfoVO
classifyInfoVO
)
{
return
categoriesService
.
updateClassification
(
classifyInfoVO
);
}
@ApiOperation
(
value
=
"分类信息-排序"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"exchangeSortType"
)
public
ResultBody
exchangeSortType
(
@ApiParam
(
value
=
"第一个分类id"
,
required
=
true
)
@RequestParam
(
value
=
"firstId"
)
Integer
firstId
,
@ApiParam
(
value
=
"第二个分类id"
,
required
=
true
)
@RequestParam
(
value
=
"secondId"
)
Integer
secondId
)
{
return
categoriesService
.
exchangeSortType
(
firstId
,
secondId
);
}
@ApiOperation
(
value
=
"分类信息-列表"
)
@PostMapping
(
"getClassificationList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ClassifyInfoDTO
.
class
)})
public
ResultBody
getClassificationList
(
@RequestBody
QueryClassifyVO
queryClassifyVO
)
{
return
ResultBody
.
success
(
categoriesService
.
getClassificationList
(
queryClassifyVO
));
}
@ApiOperation
(
value
=
"分类详情"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ClassifyDetailsDTO
.
class
)})
@GetMapping
(
"getClassifyDetails"
)
public
ResultBody
getClassifyDetails
(
@ApiParam
(
value
=
"分类id"
,
required
=
true
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
return
categoriesService
.
getClassifyDetails
(
id
);
}
@ApiOperation
(
value
=
"分类详情"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
RelevantBusinessVO
.
class
)})
@GetMapping
(
"queryRelevantBusiness"
)
public
ResultBody
queryRelevantBusiness
(
@ApiParam
(
value
=
"分类id"
,
required
=
true
)
@RequestParam
(
value
=
"id"
)
Integer
id
,
@ApiParam
(
value
=
"业务类型"
,
required
=
true
)
@Min
(
value
=
0
)
@RequestParam
(
value
=
"type"
)
Integer
type
)
{
return
categoriesService
.
queryRelevantBusiness
(
id
,
type
);
}
@ApiOperation
(
value
=
"分类删除"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
RelevantBusinessVO
.
class
)})
@GetMapping
(
"deleteRelevantBusiness"
)
public
ResultBody
deleteRelevantBusiness
(
@ApiParam
(
value
=
"分类id"
,
required
=
true
)
@Min
(
value
=
1
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
return
categoriesService
.
deleteRelevantBusiness
(
id
);
}
@ApiOperation
(
value
=
"目录列表不含分页"
)
@GetMapping
(
"getDirectoryList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
DirectoryInfoVO
.
class
)})
public
ResultBody
getDirectoryList
(
Integer
type
)
{
return
categoriesService
.
getDirectoryList
(
type
);
}
@ApiOperation
(
value
=
"根据类型获取各个目录及分类信息"
)
@GetMapping
(
"queryCategoryInfoByType"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
AllCategoryDTO
.
class
)})
public
ResultBody
queryCategoryInfoByType
(
@ApiParam
(
value
=
"类型:1:作业服务 2:设备 3:培训 4:产品商城"
,
required
=
true
)
@RequestParam
(
value
=
"type"
)
Integer
type
)
{
return
categoriesService
.
queryCategoryInfoByType
(
type
);
}
@Autowired
private
CategoriesService
categoriesService
;
@ApiOperation
(
value
=
"新增or修改目录"
)
@PostMapping
(
"addOrEditDirectory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
addOrEditDirectory
(
@RequestBody
DirectoryInfoVO
param
)
{
return
categoriesService
.
addOrEditDirectory
(
param
);
}
@ApiOperation
(
value
=
"目录列表"
)
@GetMapping
(
"directoryList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
DirectoryInfoVO
.
class
)})
public
ResultBody
directoryList
(
@RequestParam
Integer
pageNo
,
@RequestParam
Integer
pageSize
,
@RequestParam
(
required
=
false
)
Integer
type
)
{
return
ResultBody
.
success
(
categoriesService
.
directoryList
(
pageNo
,
pageSize
,
type
));
}
@ApiOperation
(
value
=
"删除目录"
)
@GetMapping
(
"removeDirectory"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
removeDirectory
(
@ApiParam
(
value
=
"id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
return
categoriesService
.
removeDirectory
(
id
);
}
@ApiOperation
(
value
=
"分类新增"
)
@PostMapping
(
"addClassification"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
addClassification
(
@Validated
(
Create
.
class
)
@RequestBody
ClassifyInfoVO
classifyInfoVO
)
{
return
categoriesService
.
addClassification
(
classifyInfoVO
);
}
@ApiOperation
(
value
=
"分类修改"
)
@PostMapping
(
"updateClassification"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
updateClassification
(
@Validated
(
Update
.
class
)
@RequestBody
ClassifyInfoVO
classifyInfoVO
)
{
return
categoriesService
.
updateClassification
(
classifyInfoVO
);
}
@ApiOperation
(
value
=
"分类信息-排序"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"exchangeSortType"
)
public
ResultBody
exchangeSortType
(
@ApiParam
(
value
=
"第一个分类id"
,
required
=
true
)
@RequestParam
(
value
=
"firstId"
)
Integer
firstId
,
@ApiParam
(
value
=
"第二个分类id"
,
required
=
true
)
@RequestParam
(
value
=
"secondId"
)
Integer
secondId
)
{
return
categoriesService
.
exchangeSortType
(
firstId
,
secondId
);
}
@ApiOperation
(
value
=
"分类信息-列表"
)
@PostMapping
(
"getClassificationList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ClassifyInfoDTO
.
class
)})
public
ResultBody
getClassificationList
(
@RequestBody
QueryClassifyVO
queryClassifyVO
)
{
return
ResultBody
.
success
(
categoriesService
.
getClassificationList
(
queryClassifyVO
));
}
@ApiOperation
(
value
=
"分类详情"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ClassifyDetailsDTO
.
class
)})
@GetMapping
(
"getClassifyDetails"
)
public
ResultBody
getClassifyDetails
(
@ApiParam
(
value
=
"分类id"
,
required
=
true
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
return
categoriesService
.
getClassifyDetails
(
id
);
}
@ApiOperation
(
value
=
"分类详情下关联业务列表"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
RelevantBusinessVO
.
class
)})
@GetMapping
(
"queryRelevantBusiness"
)
public
ResultBody
queryRelevantBusiness
(
@ApiParam
(
value
=
"分类id"
,
required
=
true
)
@RequestParam
(
value
=
"id"
)
Integer
id
,
@ApiParam
(
value
=
"业务类型"
,
required
=
true
)
@Min
(
value
=
0
)
@RequestParam
(
value
=
"type"
)
Integer
type
)
{
return
categoriesService
.
queryRelevantBusiness
(
id
,
type
);
}
@ApiOperation
(
value
=
"分类删除"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
RelevantBusinessVO
.
class
)})
@GetMapping
(
"deleteRelevantBusiness"
)
public
ResultBody
deleteRelevantBusiness
(
@ApiParam
(
value
=
"分类id"
,
required
=
true
)
@Min
(
value
=
1
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
return
categoriesService
.
deleteRelevantBusiness
(
id
);
}
@ApiOperation
(
value
=
"目录列表不含分页"
)
@GetMapping
(
"getDirectoryList"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
DirectoryInfoVO
.
class
)})
public
ResultBody
getDirectoryList
(
Integer
type
)
{
return
categoriesService
.
getDirectoryList
(
type
);
}
@ApiOperation
(
value
=
"根据类型获取各个目录及分类信息"
)
@GetMapping
(
"queryCategoryInfoByType"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
AllCategoryDTO
.
class
)})
public
ResultBody
queryCategoryInfoByType
(
@ApiParam
(
value
=
"类型:1:作业服务 2:设备 3:培训 4:产品商城"
,
required
=
true
)
@RequestParam
(
value
=
"type"
)
Integer
type
)
{
return
categoriesService
.
queryCategoryInfoByType
(
type
);
}
}
src/main/java/com/mmc/pms/controller/BackstageGoodsManageController.java
浏览文件 @
f2a1432b
...
...
@@ -8,6 +8,7 @@ import com.mmc.pms.model.order.dto.OrderGoodsProdDTO;
import
com.mmc.pms.model.qo.MallOrderGoodsInfoQO
;
import
com.mmc.pms.model.qo.ProductSpecPriceQO
;
import
com.mmc.pms.model.sale.dto.*
;
import
com.mmc.pms.model.sale.qo.MallGoodsQO
;
import
com.mmc.pms.model.sale.vo.GoodsAddVO
;
import
com.mmc.pms.service.GoodsInfoService
;
import
io.swagger.annotations.*
;
...
...
@@ -51,6 +52,13 @@ public class BackstageGoodsManageController {
return
goodsInfoService
.
getGoodsInfoDetail
(
goodsInfoId
);
}
@ApiOperation
(
value
=
"商品列表-分页"
)
@PostMapping
(
"listPageGoodsInfo"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
GoodsInfoListDTO
.
class
)})
public
ResultBody
listPageGoodsInfo
(
@ApiParam
(
"商品查询条件QO"
)
@RequestBody
MallGoodsQO
param
)
{
return
ResultBody
.
success
(
goodsInfoService
.
listPageGoodsInfo
(
param
));
}
@ApiOperation
(
value
=
"单位信息"
)
@GetMapping
(
"getSkuUnit"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
SkuUnitDTO
.
class
)})
...
...
src/main/java/com/mmc/pms/controller/WebDeviceController.java
浏览文件 @
f2a1432b
package
com
.
mmc
.
pms
.
controller
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultEnum
;
import
com.mmc.pms.model.lease.dto.BrandDTO
;
import
com.mmc.pms.model.lease.dto.DeviceCategoryDTO
;
import
com.mmc.pms.model.lease.dto.WareInfoDTO
;
import
com.mmc.pms.model.lease.vo.LeaseVo
;
import
com.mmc.pms.model.other.dto.AdDTO
;
import
com.mmc.pms.model.other.dto.DistrictInfoDTO
;
import
com.mmc.pms.model.other.dto.ModelDTO
;
import
com.mmc.pms.service.WebDeviceService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @Author small @Date 2023/5/15 13:25 @Version 1.0
...
...
@@ -25,75 +21,18 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping
(
"/webDevice"
)
public
class
WebDeviceController
{
@Autowired
private
WebDeviceService
webDeviceService
;
@Autowired
private
WebDeviceService
webDeviceService
;
@ApiOperation
(
value
=
"地域"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"/getSecondDistrictInfo"
)
public
ResultBody
<
DistrictInfoDTO
>
getSecondDistrictInfo
()
{
return
webDeviceService
.
listSecondDistrict
();
}
@ApiOperation
(
"设备类目"
)
@GetMapping
(
"/category"
)
public
ResultBody
<
DeviceCategoryDTO
>
category
()
{
return
webDeviceService
.
category
();
}
@ApiOperation
(
"品牌"
)
@GetMapping
(
"/brand"
)
public
ResultBody
<
BrandDTO
>
brand
()
{
return
webDeviceService
.
brand
();
}
@ApiOperation
(
"型号"
)
@GetMapping
(
"/model"
)
public
ResultBody
<
ModelDTO
>
model
()
{
return
webDeviceService
.
model
();
}
@ApiOperation
(
"设备品牌"
)
@GetMapping
(
"/deviceBrand"
)
public
ResultBody
<
BrandDTO
>
deviceBrand
()
{
return
webDeviceService
.
deviceBrand
();
}
@ApiOperation
(
"设备型号"
)
@GetMapping
(
"/deviceModel"
)
public
ResultBody
<
ModelDTO
>
deviceModel
()
{
return
webDeviceService
.
deviceModel
();
}
@ApiOperation
(
value
=
"设备详情"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"/detail"
)
public
ResultBody
<
WareInfoDTO
>
detail
(
@RequestParam
(
value
=
"id"
,
required
=
true
)
Integer
id
)
{
WareInfoDTO
wareInfoDTO
=
webDeviceService
.
getWareInfoById
(
id
);
return
wareInfoDTO
==
null
?
ResultBody
.
error
(
ResultEnum
.
NOT_FOUND
)
:
ResultBody
.
success
(
wareInfoDTO
);
}
@ApiOperation
(
value
=
"立即租赁"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"/update"
)
public
ResultBody
update
(
@RequestBody
LeaseVo
param
)
{
return
webDeviceService
.
update
(
param
);
}
@ApiOperation
(
"设备广告位"
)
@GetMapping
(
"/ad"
)
public
ResultBody
<
AdDTO
>
ad
()
{
return
webDeviceService
.
ad
();
}
//
// @ApiOperation(value = "设备列表筛选")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = WareInfoItemDTO.class)})
// @PostMapping("/deviceList")
// public ResultBody<WareInfoItemDTO> listWareInfoPage(
// @RequestBody @Validated(Page.class) WareInfoQO param) {
// return webDeviceService.listWareInfoPage(param, request);
// }
@ApiOperation
(
value
=
"地域"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"/getSecondDistrictInfo"
)
public
ResultBody
<
DistrictInfoDTO
>
getSecondDistrictInfo
()
{
return
webDeviceService
.
listSecondDistrict
();
}
@ApiOperation
(
"设备广告位"
)
@GetMapping
(
"/ad"
)
public
ResultBody
<
AdDTO
>
ad
()
{
return
webDeviceService
.
ad
();
}
}
src/main/java/com/mmc/pms/dao/GoodsInfoDao.java
浏览文件 @
f2a1432b
package
com
.
mmc
.
pms
.
dao
;
import
com.mmc.pms.entity.*
;
import
com.mmc.pms.model.sale.qo.MallGoodsQO
;
import
com.mmc.pms.model.sale.vo.GoodsAddVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -96,4 +97,8 @@ public interface GoodsInfoDao {
List
<
MallProdSkuInfoSpecDO
>
listMallprodSpecById
(
List
<
Integer
>
goodsIds
);
List
<
SaleServiceDO
>
listSaleServiceInfo
();
int
countListGoodsInfo
(
MallGoodsQO
param
);
List
<
GoodsInfo
>
listGoodsInfo
(
MallGoodsQO
param
);
}
src/main/java/com/mmc/pms/dao/ProductDao.java
浏览文件 @
f2a1432b
...
...
@@ -82,8 +82,6 @@ public interface ProductDao {
void
removeProductSku
(
Integer
id
);
List
<
MallProdInfoDO
>
listMallProdInfo
(
String
id
);
void
removeProductSpec
(
Integer
id
);
List
<
IndustrySpecDO
>
listIndustrySpec
(
@Param
(
"industrySpecIds"
)
Set
<
Integer
>
industrySpecIds
);
...
...
src/main/java/com/mmc/pms/entity/GoodsInfo.java
浏览文件 @
f2a1432b
...
...
@@ -2,6 +2,7 @@ package com.mmc.pms.entity;
import
com.mmc.pms.model.categories.vo.RelevanceGoodsInfoVO
;
import
com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO
;
import
com.mmc.pms.model.sale.dto.GoodsInfoListDTO
;
import
com.mmc.pms.model.sale.vo.GoodsAddVO
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
...
...
@@ -11,73 +12,94 @@ import java.io.Serializable;
import
java.util.Date
;
/**
* @author 23214
* @TableName goods_info
* @author 23214 @TableName goods_info
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
GoodsInfo
implements
Serializable
{
private
Integer
id
;
private
Integer
id
;
private
Integer
pid
;
private
Integer
pid
;
private
String
goodsNo
;
private
String
goodsNo
;
private
String
goodsName
;
private
String
goodsName
;
private
Integer
directoryId
;
private
Integer
directoryId
;
private
Integer
addGoodsUserId
;
private
Integer
addGoodsUserId
;
private
Integer
categoryByOne
;
private
Integer
categoryByOne
;
private
Integer
categoryByTwo
;
private
Integer
categoryByTwo
;
private
String
ecoLabel
;
private
String
ecoLabel
;
private
Integer
shelfStatus
;
private
Integer
shelfStatus
;
private
Integer
showCode
;
private
Integer
showCode
;
private
Integer
sort
;
private
Integer
sort
;
private
Date
createTime
;
private
Date
createTime
;
private
Integer
goodsType
;
private
Integer
goodsType
;
private
Date
updateTime
;
private
Date
updateTime
;
private
Integer
deleted
;
private
Integer
deleted
;
private
Integer
goodsVideoId
;
private
Integer
goodsVideoId
;
private
String
videoUrl
;
private
String
videoUrl
;
private
String
mainImg
;
private
String
mainImg
;
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
isCoupons
;
public
GoodsInfo
(
GoodsAddVO
goodsAddVO
)
{
this
.
id
=
goodsAddVO
.
getId
();
this
.
goodsName
=
goodsAddVO
.
getGoodsName
();
this
.
shelfStatus
=
goodsAddVO
.
getShelfStatus
();
this
.
categoryByOne
=
goodsAddVO
.
getCategoryByOne
();
this
.
categoryByTwo
=
goodsAddVO
.
getCategoryByTwo
();
this
.
directoryId
=
goodsAddVO
.
getDirectoryId
();
this
.
ecoLabel
=
goodsAddVO
.
getTag
();
this
.
goodsType
=
goodsAddVO
.
getGoodsType
();
}
private
String
directoryName
;
public
GoodsInfo
(
Integer
id
)
{
this
.
id
=
id
;
}
private
static
final
long
serialVersionUID
=
1L
;
public
RelevanceGoodsInfoVO
buildRelevanceGoodsInfoVO
()
{
return
RelevanceGoodsInfoVO
.
builder
().
id
(
id
).
goodsName
(
goodsName
).
shelf
(
shelfStatus
).
mainImage
(
mainImg
).
build
();
}
public
GoodsInfo
(
GoodsAddVO
goodsAddVO
)
{
this
.
id
=
goodsAddVO
.
getId
();
this
.
goodsName
=
goodsAddVO
.
getGoodsName
();
this
.
shelfStatus
=
goodsAddVO
.
getShelfStatus
();
this
.
categoryByOne
=
goodsAddVO
.
getCategoryByOne
();
this
.
categoryByTwo
=
goodsAddVO
.
getCategoryByTwo
();
this
.
directoryId
=
goodsAddVO
.
getDirectoryId
();
this
.
ecoLabel
=
goodsAddVO
.
getTag
();
this
.
goodsType
=
goodsAddVO
.
getGoodsType
();
}
public
LeaseGoodsInfoDTO
buildLeaseGoodsInfoDTO
()
{
return
LeaseGoodsInfoDTO
.
builder
().
id
(
id
).
goodsName
(
goodsName
).
images
(
mainImg
).
build
();
}
}
\ No newline at end of file
public
GoodsInfo
(
Integer
id
)
{
this
.
id
=
id
;
}
public
RelevanceGoodsInfoVO
buildRelevanceGoodsInfoVO
()
{
return
RelevanceGoodsInfoVO
.
builder
()
.
id
(
id
)
.
goodsName
(
goodsName
)
.
shelf
(
shelfStatus
)
.
mainImage
(
mainImg
)
.
build
();
}
public
LeaseGoodsInfoDTO
buildLeaseGoodsInfoDTO
()
{
return
LeaseGoodsInfoDTO
.
builder
().
id
(
id
).
goodsName
(
goodsName
).
images
(
mainImg
).
build
();
}
public
GoodsInfoListDTO
buildGoodsInfoListDTO
()
{
return
GoodsInfoListDTO
.
builder
()
.
id
(
id
)
.
goodsName
(
goodsName
)
.
directoryName
(
directoryName
)
.
directoryId
(
directoryId
)
.
createTime
(
createTime
)
.
imgUrl
(
mainImg
)
.
status
(
shelfStatus
)
.
isCoupons
(
this
.
isCoupons
)
.
build
();
}
}
src/main/java/com/mmc/pms/model/sale/qo/MallGoodsQO.java
0 → 100644
浏览文件 @
f2a1432b
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
MallGoodsQO
{
@ApiModelProperty
(
value
=
"商品名称"
,
example
=
"商品名称"
)
private
String
goodsName
;
@ApiModelProperty
(
value
=
"商品类型 0:销售 1:租赁"
,
example
=
"0"
)
private
Integer
goodsType
;
@ApiModelProperty
(
value
=
"开始时间"
,
example
=
"2023-06-09 00:00:00"
)
private
String
startTime
;
@ApiModelProperty
(
value
=
"结束时间"
,
example
=
"2023-06-11 23:59:59"
)
private
String
endTime
;
@ApiModelProperty
(
value
=
"状态 0:下架(仓库中)1:上架"
,
example
=
"1"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"目录id"
,
example
=
"1"
)
private
Integer
directoryId
;
@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/service/GoodsInfoService.java
浏览文件 @
f2a1432b
...
...
@@ -8,7 +8,9 @@ import com.mmc.pms.model.qo.ProductSpecPriceQO;
import
com.mmc.pms.model.sale.dto.MallGoodsShopCarDTO
;
import
com.mmc.pms.model.sale.dto.MallProductSpecPriceDTO
;
import
com.mmc.pms.model.sale.dto.ProductSpecPriceDTO
;
import
com.mmc.pms.model.sale.qo.MallGoodsQO
;
import
com.mmc.pms.model.sale.vo.GoodsAddVO
;
import
com.mmc.pms.page.PageResult
;
import
java.util.List
;
...
...
@@ -38,4 +40,6 @@ public interface GoodsInfoService {
List
<
OrderGoodsProdDTO
>
feignListProdGoodsSkuInfo
(
MallOrderGoodsInfoQO
mallOrderGoodsInfoQO
);
List
<
OrderGoodsIndstDTO
>
feignListIndstGoodsSkuInfo
(
MallOrderGoodsInfoQO
mallOrderGoodsInfoQO
);
PageResult
listPageGoodsInfo
(
MallGoodsQO
param
);
}
src/main/java/com/mmc/pms/service/Impl/GoodsInfoServiceImpl.java
浏览文件 @
f2a1432b
...
...
@@ -12,7 +12,9 @@ import com.mmc.pms.model.order.dto.OrderGoodsProdDetailDTO;
import
com.mmc.pms.model.qo.MallOrderGoodsInfoQO
;
import
com.mmc.pms.model.qo.ProductSpecPriceQO
;
import
com.mmc.pms.model.sale.dto.*
;
import
com.mmc.pms.model.sale.qo.MallGoodsQO
;
import
com.mmc.pms.model.sale.vo.*
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.GoodsInfoService
;
import
com.mmc.pms.util.CodeUtil
;
import
com.mmc.pms.util.TDateUtil
;
...
...
@@ -1102,4 +1104,18 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
}
return
mallGoodsInfoSimpleDOS
;
}
@Override
public
PageResult
listPageGoodsInfo
(
MallGoodsQO
param
)
{
int
count
=
goodsInfoDao
.
countListGoodsInfo
(
param
);
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
);
}
Integer
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
List
<
GoodsInfo
>
goodsInfo
=
goodsInfoDao
.
listGoodsInfo
(
param
);
List
<
GoodsInfoListDTO
>
pageList
=
goodsInfo
.
stream
().
map
(
GoodsInfo:
:
buildGoodsInfoListDTO
).
collect
(
Collectors
.
toList
());
return
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
);
}
}
src/main/java/com/mmc/pms/service/Impl/MiniProgramProductMallServiceImpl.java
浏览文件 @
f2a1432b
...
...
@@ -3,12 +3,9 @@ package com.mmc.pms.service.Impl;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultEnum
;
import
com.mmc.pms.dao.MiniProgramProductMallDao
;
import
com.mmc.pms.dao.WebDeviceDao
;
import
com.mmc.pms.entity.*
;
import
com.mmc.pms.model.qo.GoodsInfoQO
;
import
com.mmc.pms.model.sale.dto.*
;
import
com.mmc.pms.model.sale.vo.GoodsProductSkuVO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.MiniProgramProductMallService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -26,210 +23,184 @@ import java.util.stream.Collectors;
@Service
public
class
MiniProgramProductMallServiceImpl
implements
MiniProgramProductMallService
{
@Autowired
private
MiniProgramProductMallDao
goodsInfoDao
;
@Autowired
private
WebDeviceDao
webDeviceDao
;
@Autowired
private
MiniProgramProductMallDao
goodsInfoDao
;
@Override
public
ResultBody
getAppGoodsInfoDetail
(
Integer
goodsId
)
{
// 查询此商品是否下架或删除
GoodsInfoDO
goodsInfoDO
=
goodsInfoDao
.
getGoodsInfoByGoodsId
(
goodsId
);
if
(
goodsInfoDO
==
null
||
goodsInfoDO
.
getShelfStatus
().
equals
(
0
))
{
return
ResultBody
.
error
(
ResultEnum
.
SHOP_GOODS_NOT_ERROR
);
}
AppGoodsInfoDetailDTO
appGoodsInfoDetailDTO
=
new
AppGoodsInfoDetailDTO
();
appGoodsInfoDetailDTO
.
setId
(
goodsInfoDO
.
getId
())
.
setGoodsName
(
goodsInfoDO
.
getGoodsName
())
.
setGoodsVideoId
(
goodsInfoDO
.
getGoodsVideoId
())
.
setMasterTypeId
(
goodsInfoDO
.
getMasterTypeId
())
.
setRepoId
(
goodsInfoDO
.
getRepoId
())
.
setSortTypeId
(
goodsInfoDO
.
getSortTypeId
())
.
setShelfStatus
(
goodsInfoDO
.
getShelfStatus
())
.
setSlaveTypeId
(
goodsInfoDO
.
getSlaveTypeId
())
.
setShareFlyServiceId
(
goodsInfoDO
.
getShareFlyServiceId
())
.
setGoodsVideo
(
goodsInfoDO
.
getVideoUrl
())
.
setTag
(
goodsInfoDO
.
getTag
())
.
setPid
(
goodsInfoDO
.
getPid
());
// 获取商品图片信息
List
<
GoodsImgDO
>
goodsImgDO
=
goodsInfoDao
.
listGoodsInfoByGoodsId
(
goodsId
);
appGoodsInfoDetailDTO
.
setImages
(
goodsImgDO
.
stream
().
map
(
GoodsImgDO:
:
buildGoodsImgDTO
).
collect
(
Collectors
.
toList
()));
// 获取商品详情信息
GoodsDetailDO
goodsDetailDO
=
goodsInfoDao
.
getGoodsDetailByGoodsId
(
goodsId
);
appGoodsInfoDetailDTO
.
setGoodsDetail
(
goodsDetailDO
.
buildGoodsDetailInfoDTO
());
// 获取其他服务信息
List
<
GoodsServiceDO
>
goodsServiceDO
=
goodsInfoDao
.
listGoodsServiceByGoodsId
(
goodsId
);
appGoodsInfoDetailDTO
.
setOtherService
(
goodsServiceDO
.
stream
()
.
map
(
GoodsServiceDO:
:
buildGoodsOtherServiceDTO
)
.
collect
(
Collectors
.
toList
()));
// 判断商品是什么类型
if
(!
goodsInfoDO
.
getSortTypeId
().
equals
(
2
))
{
// 获取该商品绑定的sku信息
List
<
MallProdInfoDO
>
mallProdSkuInfo
=
goodsInfoDao
.
getMallProdInfoByGoodsId
(
goodsId
);
// 获取该商品绑定的规格信息
List
<
MallProdSkuInfoSpecDO
>
mallProdSkuInfoSpecList
=
goodsInfoDao
.
listMallProdSkuInfoSpec
(
goodsId
);
Map
<
Integer
,
List
<
MallProdSkuInfoSpecDO
>>
specMap
=
mallProdSkuInfoSpecList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
MallProdSkuInfoSpecDO:
:
getMallProdSkuInfoId
));
List
<
GoodsSpecDTO
>
list
=
mallProdSkuInfo
.
stream
()
.
map
(
d
->
{
// 获取sku下规格信息
List
<
MallProdSkuInfoSpecDO
>
mallProdSkuInfoSpecDOList
=
specMap
.
get
(
d
.
getId
());
List
<
ProductSpecDO
>
productSpecList
=
goodsInfoDao
.
listProductSpecInfo
(
mallProdSkuInfoSpecDOList
.
stream
()
.
map
(
MallProdSkuInfoSpecDO:
:
getProductSpecId
)
.
collect
(
Collectors
.
toList
()));
List
<
MallProductSpecDTO
>
collect
=
productSpecList
.
stream
()
.
map
(
ProductSpecDO:
:
buildMallProductSpecDTO
)
.
collect
(
Collectors
.
toList
());
collect
.
stream
()
.
peek
(
m
->
{
for
(
MallProdSkuInfoSpecDO
mallProdSkuInfoSpecDO
:
mallProdSkuInfoSpecDOList
)
{
if
(
m
.
getProductSpec
()
.
equals
(
mallProdSkuInfoSpecDO
.
getProductSpecId
()))
{
m
.
setId
(
mallProdSkuInfoSpecDO
.
getId
());
break
;
}
}
})
.
collect
(
Collectors
.
toList
());
GoodsSpecDTO
goodsSpecDTO
=
new
GoodsSpecDTO
();
goodsSpecDTO
.
setId
(
d
.
getId
())
.
setSkuId
(
d
.
getProdSkuId
())
.
setGoodsSpecName
(
d
.
getProdSkuSpecName
())
.
setSkuName
(
d
.
getProductSkuName
())
.
setBrandInfoId
(
d
.
getBrandInfoId
())
.
setCategoryId
(
d
.
getCategoriesId
())
.
setTypeName
(
d
.
getTypeName
())
.
setChooseType
(
d
.
getChooseType
())
.
setSkuUnitId
(
d
.
getSkuUnitId
())
.
setUnitName
(
d
.
getUnitName
())
.
setMust
(
d
.
getMust
())
.
setProductSpecList
(
collect
);
return
goodsSpecDTO
;
})
@Override
public
ResultBody
getAppGoodsInfoDetail
(
Integer
goodsId
)
{
// 查询此商品是否下架或删除
GoodsInfoDO
goodsInfoDO
=
goodsInfoDao
.
getGoodsInfoByGoodsId
(
goodsId
);
if
(
goodsInfoDO
==
null
||
goodsInfoDO
.
getShelfStatus
().
equals
(
0
))
{
return
ResultBody
.
error
(
ResultEnum
.
SHOP_GOODS_NOT_ERROR
);
}
AppGoodsInfoDetailDTO
appGoodsInfoDetailDTO
=
new
AppGoodsInfoDetailDTO
();
appGoodsInfoDetailDTO
.
setId
(
goodsInfoDO
.
getId
())
.
setGoodsName
(
goodsInfoDO
.
getGoodsName
())
.
setGoodsVideoId
(
goodsInfoDO
.
getGoodsVideoId
())
.
setMasterTypeId
(
goodsInfoDO
.
getMasterTypeId
())
.
setRepoId
(
goodsInfoDO
.
getRepoId
())
.
setSortTypeId
(
goodsInfoDO
.
getSortTypeId
())
.
setShelfStatus
(
goodsInfoDO
.
getShelfStatus
())
.
setSlaveTypeId
(
goodsInfoDO
.
getSlaveTypeId
())
.
setShareFlyServiceId
(
goodsInfoDO
.
getShareFlyServiceId
())
.
setGoodsVideo
(
goodsInfoDO
.
getVideoUrl
())
.
setTag
(
goodsInfoDO
.
getTag
())
.
setPid
(
goodsInfoDO
.
getPid
());
// 获取商品图片信息
List
<
GoodsImgDO
>
goodsImgDO
=
goodsInfoDao
.
listGoodsInfoByGoodsId
(
goodsId
);
appGoodsInfoDetailDTO
.
setImages
(
goodsImgDO
.
stream
().
map
(
GoodsImgDO:
:
buildGoodsImgDTO
).
collect
(
Collectors
.
toList
()));
// 获取商品详情信息
GoodsDetailDO
goodsDetailDO
=
goodsInfoDao
.
getGoodsDetailByGoodsId
(
goodsId
);
appGoodsInfoDetailDTO
.
setGoodsDetail
(
goodsDetailDO
.
buildGoodsDetailInfoDTO
());
// 获取其他服务信息
List
<
GoodsServiceDO
>
goodsServiceDO
=
goodsInfoDao
.
listGoodsServiceByGoodsId
(
goodsId
);
appGoodsInfoDetailDTO
.
setOtherService
(
goodsServiceDO
.
stream
()
.
map
(
GoodsServiceDO:
:
buildGoodsOtherServiceDTO
)
.
collect
(
Collectors
.
toList
()));
// 判断商品是什么类型
if
(!
goodsInfoDO
.
getSortTypeId
().
equals
(
2
))
{
// 获取该商品绑定的sku信息
List
<
MallProdInfoDO
>
mallProdSkuInfo
=
goodsInfoDao
.
getMallProdInfoByGoodsId
(
goodsId
);
// 获取该商品绑定的规格信息
List
<
MallProdSkuInfoSpecDO
>
mallProdSkuInfoSpecList
=
goodsInfoDao
.
listMallProdSkuInfoSpec
(
goodsId
);
Map
<
Integer
,
List
<
MallProdSkuInfoSpecDO
>>
specMap
=
mallProdSkuInfoSpecList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
MallProdSkuInfoSpecDO:
:
getMallProdSkuInfoId
));
List
<
GoodsSpecDTO
>
list
=
mallProdSkuInfo
.
stream
()
.
map
(
d
->
{
// 获取sku下规格信息
List
<
MallProdSkuInfoSpecDO
>
mallProdSkuInfoSpecDOList
=
specMap
.
get
(
d
.
getId
());
List
<
ProductSpecDO
>
productSpecList
=
goodsInfoDao
.
listProductSpecInfo
(
mallProdSkuInfoSpecDOList
.
stream
()
.
map
(
MallProdSkuInfoSpecDO:
:
getProductSpecId
)
.
collect
(
Collectors
.
toList
()));
List
<
MallProductSpecDTO
>
collect
=
productSpecList
.
stream
()
.
map
(
ProductSpecDO:
:
buildMallProductSpecDTO
)
.
collect
(
Collectors
.
toList
());
appGoodsInfoDetailDTO
.
setGoodsSpec
(
list
);
}
else
{
appGoodsInfoDetailDTO
.
setGoodsSpec
(
getIndustrySpecInfo
(
goodsId
));
}
return
ResultBody
.
success
(
appGoodsInfoDetailDTO
);
collect
.
stream
()
.
peek
(
m
->
{
for
(
MallProdSkuInfoSpecDO
mallProdSkuInfoSpecDO
:
mallProdSkuInfoSpecDOList
)
{
if
(
m
.
getProductSpec
()
.
equals
(
mallProdSkuInfoSpecDO
.
getProductSpecId
()))
{
m
.
setId
(
mallProdSkuInfoSpecDO
.
getId
());
break
;
}
}
})
.
collect
(
Collectors
.
toList
());
GoodsSpecDTO
goodsSpecDTO
=
new
GoodsSpecDTO
();
goodsSpecDTO
.
setId
(
d
.
getId
())
.
setSkuId
(
d
.
getProdSkuId
())
.
setGoodsSpecName
(
d
.
getProdSkuSpecName
())
.
setSkuName
(
d
.
getProductSkuName
())
.
setBrandInfoId
(
d
.
getBrandInfoId
())
.
setCategoryId
(
d
.
getCategoriesId
())
.
setTypeName
(
d
.
getTypeName
())
.
setChooseType
(
d
.
getChooseType
())
.
setSkuUnitId
(
d
.
getSkuUnitId
())
.
setUnitName
(
d
.
getUnitName
())
.
setMust
(
d
.
getMust
())
.
setProductSpecList
(
collect
);
return
goodsSpecDTO
;
})
.
collect
(
Collectors
.
toList
());
appGoodsInfoDetailDTO
.
setGoodsSpec
(
list
);
}
else
{
appGoodsInfoDetailDTO
.
setGoodsSpec
(
getIndustrySpecInfo
(
goodsId
));
}
return
ResultBody
.
success
(
appGoodsInfoDetailDTO
);
}
@Override
public
ResultBody
listGoodsByQO
(
GoodsInfoQO
param
)
{
int
count
=
goodsInfoDao
.
countListGoodsByQO
(
param
);
if
(
count
==
0
)
{
return
ResultBody
.
success
(
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
));
}
int
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
List
<
GoodsInfoDO
>
list
=
goodsInfoDao
.
listGoodsByQO
(
param
);
// 找出行业对应的序号
List
<
GoodsTypeDO
>
ids
=
goodsInfoDao
.
listIndustryIdBySort
();
int
order
=
0
;
/*if (param.getMasterTypeId() != null) {
for (int i = 0; i < ids.size(); i++) {
if (param.getMasterTypeId().toString().equals(ids.get(i).getId().toString())) {
order = i + 1;
break;
}
}
}*/
List
<
AppGoodsInfoDTO
>
pageList
=
new
ArrayList
<>();
for
(
GoodsInfoDO
d
:
list
)
{
AppGoodsInfoDTO
appGoodsInfoDTO
=
d
.
buildAppGoodsInfoDTO
();
// 直接看该服务在当前行业对应所有服务中在第几个
for
(
int
j
=
0
;
j
<
list
.
size
();
j
++)
{
if
(
appGoodsInfoDTO
.
getId
().
toString
().
equals
(
list
.
get
(
j
).
getId
().
toString
()))
{
if
(
j
<
9
)
{
appGoodsInfoDTO
.
setCode
(
order
+
"0"
+
(
j
+
1
));
}
else
{
appGoodsInfoDTO
.
setCode
(
order
+
""
+
(
j
+
1
));
private
List
<
GoodsSpecDTO
>
getIndustrySpecInfo
(
Integer
goodsInfoId
)
{
// 获取商品对应绑定的行业sku信息
List
<
MallIndustrySkuInfoDO
>
mallIndustrySkuInfoList
=
goodsInfoDao
.
getMallIndustrySkuInfo
(
goodsInfoId
);
List
<
GoodsSpecDTO
>
list
=
mallIndustrySkuInfoList
.
stream
()
.
map
(
MallIndustrySkuInfoDO:
:
buildGoodsSpecDTO
)
.
collect
(
Collectors
.
toList
());
// 根据商品id查出该商品下绑定的规格信息
List
<
MallIndustrySkuInfoSpecDO
>
mallIndustrySkuInfoSpec
=
goodsInfoDao
.
getIndustrySkuInfoSpec
(
goodsInfoId
);
list
=
list
.
stream
()
.
peek
(
d
->
{
List
<
MallIndustrySpecDTO
>
industrySpec
=
new
ArrayList
<>();
for
(
MallIndustrySkuInfoSpecDO
e
:
mallIndustrySkuInfoSpec
)
{
if
(
d
.
getId
().
equals
(
e
.
getMallIndustrySkuInfoId
()))
{
IndustrySpecDO
industrySpecDO
=
e
.
getIndustrySpecDO
();
// 获取商品清单信息
List
<
IndustryProductInventoryDO
>
industryProdInventory
=
goodsInfoDao
.
getIndustryProductInventory
(
e
.
getIndustrySpecId
());
List
<
ProductInventoryVO
>
productInventoryList
=
new
ArrayList
<>();
// 获取行业规格绑定的产品规格信息
List
<
InventorySpecDO
>
inventorySpecDOList
=
goodsInfoDao
.
listInventorySpec
(
industryProdInventory
.
stream
()
.
map
(
IndustryProductInventoryDO:
:
getId
)
.
collect
(
Collectors
.
toList
()));
Map
<
Integer
,
List
<
InventorySpecDO
>>
inventoryMap
=
inventorySpecDOList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
InventorySpecDO:
:
getIndustryProductInventoryId
));
getIndustrySpecOnProdSpecInfo
(
industryProdInventory
,
productInventoryList
,
inventoryMap
);
MallIndustrySpecDTO
industrySpecDTO
=
industrySpecDO
.
buildMallIndustrySpecDTO
();
industrySpecDTO
.
setId
(
e
.
getId
());
industrySpecDTO
.
setIndustrySpecId
(
e
.
getIndustrySpecId
());
industrySpecDTO
.
setIndustrySkuId
(
d
.
getSkuId
());
industrySpecDTO
.
setProductInventoryList
(
productInventoryList
);
industrySpec
.
add
(
industrySpecDTO
);
}
break
;
}
}
if
(
appGoodsInfoDTO
.
getShelfStatus
()
==
1
)
{
pageList
.
add
(
appGoodsInfoDTO
);
}
}
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
));
}
}
d
.
setIndustrySpecList
(
industrySpec
);
})
.
collect
(
Collectors
.
toList
());
return
list
;
}
private
List
<
GoodsSpecDTO
>
getIndustrySpecInfo
(
Integer
goodsInfoId
)
{
// 获取商品对应绑定的行业sku信息
List
<
MallIndustrySkuInfoDO
>
mallIndustrySkuInfoList
=
goodsInfoDao
.
getMallIndustrySkuInfo
(
goodsInfoId
);
List
<
GoodsSpecDTO
>
list
=
mallIndustrySkuInfoList
.
stream
().
map
(
MallIndustrySkuInfoDO:
:
buildGoodsSpecDTO
).
collect
(
Collectors
.
toList
());
// 根据商品id查出该商品下绑定的规格信息
List
<
MallIndustrySkuInfoSpecDO
>
mallIndustrySkuInfoSpec
=
goodsInfoDao
.
getIndustrySkuInfoSpec
(
goodsInfoId
);
list
=
list
.
stream
().
peek
(
d
->
{
List
<
MallIndustrySpecDTO
>
industrySpec
=
new
ArrayList
<>();
for
(
MallIndustrySkuInfoSpecDO
e
:
mallIndustrySkuInfoSpec
)
{
if
(
d
.
getId
().
equals
(
e
.
getMallIndustrySkuInfoId
()))
{
IndustrySpecDO
industrySpecDO
=
e
.
getIndustrySpecDO
();
// 获取商品清单信息
List
<
IndustryProductInventoryDO
>
industryProdInventory
=
goodsInfoDao
.
getIndustryProductInventory
(
e
.
getIndustrySpecId
());
List
<
ProductInventoryVO
>
productInventoryList
=
new
ArrayList
<>();
// 获取行业规格绑定的产品规格信息
List
<
InventorySpecDO
>
inventorySpecDOList
=
goodsInfoDao
.
listInventorySpec
(
industryProdInventory
.
stream
().
map
(
IndustryProductInventoryDO:
:
getId
).
collect
(
Collectors
.
toList
()));
Map
<
Integer
,
List
<
InventorySpecDO
>>
inventoryMap
=
inventorySpecDOList
.
stream
().
collect
(
Collectors
.
groupingBy
(
InventorySpecDO:
:
getIndustryProductInventoryId
));
getIndustrySpecOnProdSpecInfo
(
industryProdInventory
,
productInventoryList
,
inventoryMap
);
MallIndustrySpecDTO
industrySpecDTO
=
industrySpecDO
.
buildMallIndustrySpecDTO
();
industrySpecDTO
.
setId
(
e
.
getId
());
industrySpecDTO
.
setIndustrySpecId
(
e
.
getIndustrySpecId
());
industrySpecDTO
.
setIndustrySkuId
(
d
.
getSkuId
());
industrySpecDTO
.
setProductInventoryList
(
productInventoryList
);
industrySpec
.
add
(
industrySpecDTO
);
}
}
d
.
setIndustrySpecList
(
industrySpec
);
}).
collect
(
Collectors
.
toList
());
return
list
;
}
private
void
getIndustrySpecOnProdSpecInfo
(
List
<
IndustryProductInventoryDO
>
industryProdInventory
,
List
<
ProductInventoryVO
>
productInventoryList
,
Map
<
Integer
,
List
<
InventorySpecDO
>>
inventoryMap
)
{
for
(
IndustryProductInventoryDO
industryProductInventoryDO
:
industryProdInventory
)
{
List
<
InventorySpecDO
>
inventorySpec
=
inventoryMap
.
get
(
industryProductInventoryDO
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
inventorySpec
))
{
List
<
ProductSpecVO
>
productSpecList
=
inventorySpec
.
stream
()
.
map
(
in
->
{
ProductSpecDO
productSpecDetail
=
goodsInfoDao
.
getProductSpecDetail
(
in
.
getProductSpecId
());
ProductSpecVO
productSpecVO
=
new
ProductSpecVO
();
BeanUtils
.
copyProperties
(
productSpecDetail
,
productSpecVO
);
return
productSpecVO
;
})
.
collect
(
Collectors
.
toList
());
ProductSkuDO
productSkuDetail
=
goodsInfoDao
.
getProductSkuDetail
(
industryProductInventoryDO
.
getProductSkuId
());
GoodsProductSkuVO
goodsProductSkuVO
=
new
GoodsProductSkuVO
();
BeanUtils
.
copyProperties
(
productSkuDetail
,
goodsProductSkuVO
);
// 添加数据
ProductInventoryVO
productInventoryVO
=
new
ProductInventoryVO
();
productInventoryVO
.
setSelect
(
industryProductInventoryDO
.
getSelected
());
productInventoryVO
.
setProductSku
(
goodsProductSkuVO
);
productInventoryVO
.
setProductSpecList
(
productSpecList
);
productInventoryList
.
add
(
productInventoryVO
);
}
}
private
void
getIndustrySpecOnProdSpecInfo
(
List
<
IndustryProductInventoryDO
>
industryProdInventory
,
List
<
ProductInventoryVO
>
productInventoryList
,
Map
<
Integer
,
List
<
InventorySpecDO
>>
inventoryMap
)
{
for
(
IndustryProductInventoryDO
industryProductInventoryDO
:
industryProdInventory
)
{
List
<
InventorySpecDO
>
inventorySpec
=
inventoryMap
.
get
(
industryProductInventoryDO
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
inventorySpec
))
{
List
<
ProductSpecVO
>
productSpecList
=
inventorySpec
.
stream
()
.
map
(
in
->
{
ProductSpecDO
productSpecDetail
=
goodsInfoDao
.
getProductSpecDetail
(
in
.
getProductSpecId
());
ProductSpecVO
productSpecVO
=
new
ProductSpecVO
();
BeanUtils
.
copyProperties
(
productSpecDetail
,
productSpecVO
);
return
productSpecVO
;
})
.
collect
(
Collectors
.
toList
());
ProductSkuDO
productSkuDetail
=
goodsInfoDao
.
getProductSkuDetail
(
industryProductInventoryDO
.
getProductSkuId
());
GoodsProductSkuVO
goodsProductSkuVO
=
new
GoodsProductSkuVO
();
BeanUtils
.
copyProperties
(
productSkuDetail
,
goodsProductSkuVO
);
// 添加数据
ProductInventoryVO
productInventoryVO
=
new
ProductInventoryVO
();
productInventoryVO
.
setSelect
(
industryProductInventoryDO
.
getSelected
());
productInventoryVO
.
setProductSku
(
goodsProductSkuVO
);
productInventoryVO
.
setProductSpecList
(
productSpecList
);
productInventoryList
.
add
(
productInventoryVO
);
}
}
}
}
src/main/java/com/mmc/pms/service/Impl/WebProductMallServiceImpl.java
浏览文件 @
f2a1432b
...
...
@@ -3,9 +3,13 @@ package com.mmc.pms.service.Impl;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.dao.WebProductMallDao
;
import
com.mmc.pms.entity.AdDO
;
import
com.mmc.pms.entity.GoodsInfoDO
;
import
com.mmc.pms.entity.ProductCategory
;
import
com.mmc.pms.model.other.dto.AdDTO
;
import
com.mmc.pms.model.qo.GoodsInfoQO
;
import
com.mmc.pms.model.sale.dto.GoodsInfoListDTO
;
import
com.mmc.pms.model.sale.dto.ProductCategoryDTO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.WebProductMallService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -72,4 +76,24 @@ public class WebProductMallServiceImpl implements WebProductMallService {
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
PageResult
listPageGoodsInfo
(
GoodsInfoQO
param
)
{
int
count
=
webProductMallDao
.
countListGoodsInfo
(
param
);
if
(
count
==
0
)
{
return
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
);
}
Integer
pageNo
=
param
.
getPageNo
();
param
.
buildCurrentPage
();
List
<
GoodsInfoDO
>
goodsInfo
=
webProductMallDao
.
listGoodsInfo
(
param
);
goodsInfo
.
stream
()
.
forEach
(
t
->
{
Integer
product
=
webProductMallDao
.
findProduct
(
t
.
getId
());
t
.
setIsCoupons
(
product
);
});
List
<
GoodsInfoListDTO
>
pageList
=
goodsInfo
.
stream
().
map
(
GoodsInfoDO:
:
buildGoodsInfoListDTO
).
collect
(
Collectors
.
toList
());
return
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
);
}
}
src/main/java/com/mmc/pms/service/MiniProgramProductMallService.java
浏览文件 @
f2a1432b
package
com
.
mmc
.
pms
.
service
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.qo.GoodsInfoQO
;
/**
* @Author small @Date 2023/5/16 15:08 @Version 1.0
*/
public
interface
MiniProgramProductMallService
{
ResultBody
getAppGoodsInfoDetail
(
Integer
id
);
ResultBody
listGoodsByQO
(
GoodsInfoQO
param
);
}
src/main/resources/mapper/GoodsInfoDao.xml
浏览文件 @
f2a1432b
...
...
@@ -114,7 +114,7 @@
<foreach
collection=
"list"
item=
"d"
separator=
";"
>
update mall_prod_info
<set>
prod
_sku
_id = #{d.prodSkuId},
prod
uct
_id = #{d.prodSkuId},
categories_id = #{d.categoriesId},
prod_spec_name = #{d.prodSkuSpecName},
choose_type = #{d.chooseType},
...
...
@@ -487,4 +487,65 @@
FROM sale_service
WHERE is_deleted = 0
</select>
<select
id=
"countListGoodsInfo"
resultType=
"java.lang.Integer"
>
SELECT
count(*)
FROM
goods_info gi
<where>
gi.is_deleted = 0 and gi.goods_type = #{goodsType}
<if
test=
"goodsName != null and goodsName !=''"
>
AND (gi.goods_name LIKE CONCAT('%',#{goodsName},'%'))
</if>
<if
test=
"status != null"
>
AND (gi.shelf_status = #{status})
</if>
<if
test=
"startTime != null and startTime != '' "
>
and gi.create_time
>
= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
</if>
<if
test=
"endTime != null and endTime != '' "
>
and gi.create_time
<
= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
<if
test=
"directoryId != null"
>
and (gi.directory_id = #{directoryId})
</if>
</where>
</select>
<select
id=
"listGoodsInfo"
resultType=
"com.mmc.pms.entity.GoodsInfo"
>
SELECT
gi.id,
gi.goods_name,
gi.shelf_status,
gi.create_time,
gi.directory_id,
img.img_url mainImg,
d.directory_name
FROM
goods_info gi
LEFT JOIN goods_img img ON gi.id = img.goods_info_id
AND img.img_type = 0
AND img.is_deleted = 0
INNER JOIN `directory` d ON gi.directory_id = d.id
<where>
gi.is_deleted = 0 and gi.goods_type = #{goodsType}
<if
test=
"goodsName != null and goodsName !=''"
>
AND (gi.goods_name LIKE CONCAT('%',#{goodsName},'%'))
</if>
<if
test=
"status != null"
>
AND (gi.shelf_status = #{status})
</if>
<if
test=
"startTime != null and startTime != '' "
>
and gi.create_time
>
= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
</if>
<if
test=
"endTime != null and endTime != '' "
>
and gi.create_time
<
= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
<if
test=
"directoryId != null"
>
and (gi.directory_id = #{directoryId})
</if>
</where>
ORDER BY
gi.shelf_status DESC , gi.create_time DESC
limit #{pageNo},#{pageSize}
</select>
</mapper>
src/main/resources/mapper/MiniProgramProductMallDao.xml
浏览文件 @
f2a1432b
...
...
@@ -123,7 +123,7 @@
<select
id=
"getMallProdInfoByGoodsId"
resultType=
"com.mmc.pms.entity.MallProdInfoDO"
>
SELECT mp.id,
mp.prod
_sku_id
prodSkuId,
mp.prod
uct_id
prodSkuId,
mp.prod_spec_name prodSkuSpecName,
mp.goods_type_id goodsTypeId,
mp.choose_type chooseType,
...
...
@@ -133,9 +133,9 @@
ps.product_name productSkuName,
ps.brand_info_id brandInfoId,
gt.type_name typeName
FROM mall_prod_
sku_
info mp
FROM mall_prod_info mp
INNER JOIN sku_unit su ON su.id = mp.sku_unit_id
INNER JOIN product ps ON ps.id = mp.prod
_sku
_id
INNER JOIN product ps ON ps.id = mp.prod
uct
_id
LEFT JOIN goods_type gt ON mp.goods_type_id = gt.id
WHERE mp.goods_info_id = #{goodsId}
AND mp.is_deleted = 0
...
...
@@ -143,9 +143,9 @@
<select
id=
"listMallProdSkuInfoSpec"
resultType=
"com.mmc.pms.entity.MallProdSkuInfoSpecDO"
>
SELECT id,
mall_prod_
sku_
info_id mallProdSkuInfoId,
product_spec_id
productSpecId
FROM mall_prod_
sku_
info_spec
mall_prod_info_id mallProdSkuInfoId,
product_spec_id productSpecId
FROM mall_prod_info_spec
WHERE goods_info_id = #{goodsId}
AND is_deleted = 0
</select>
...
...
src/main/resources/mapper/ProductDao.xml
浏览文件 @
f2a1432b
...
...
@@ -30,9 +30,9 @@
</insert>
<insert
id=
"insertMallProdSkuInfo"
parameterType=
"com.mmc.pms.entity.MallProdInfoDO"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into mall_prod_info (goods_info_id, prod
_sku_id, prod_spec_name, category
_id, choose_type,
sku_unit_id, is_must,
product_spec_id_list,
flag)
values (#{goodsInfoId}, #{prodSkuId}, #{prodSkuSpecName}, #{categor
y
Id}, #{chooseType}, #{skuUnitId}, #{must},
insert into mall_prod_info (goods_info_id, prod
uct_id, prod_spec_name, categories
_id, choose_type,
sku_unit_id, is_must, flag)
values (#{goodsInfoId}, #{prodSkuId}, #{prodSkuSpecName}, #{categor
ies
Id}, #{chooseType}, #{skuUnitId}, #{must},
#{flag})
</insert>
<update
id=
"updateProductSku"
>
...
...
src/main/resources/mapper/WebProductMallDao.xml
浏览文件 @
f2a1432b
...
...
@@ -167,7 +167,7 @@
SELECT count(1)
FROM goods_info gi
INNER JOIN mall_prod_sku_info mpsi ON mpsi.goods_info_id = gi.id
INNER JOIN product ps ON mpsi.prod
_sku
_id = ps.id
INNER JOIN product ps ON mpsi.prod
uct
_id = ps.id
AND ps.is_deleted = 0
INNER JOIN brand_info bi ON ps.brand_info_id = bi.id
AND bi.is_delete = 0
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论