Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
pms-ci-test
Commits
a3d5f7a8
提交
a3d5f7a8
authored
6月 05, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
后台:商品管理
上级
1f2b28f2
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
391 行增加
和
35 行删除
+391
-35
BackstageGoodsManageController.java
...om/mmc/pms/controller/BackstageGoodsManageController.java
+17
-4
BackstageProductSpecController.java
...om/mmc/pms/controller/BackstageProductSpecController.java
+12
-0
GoodsInfoDao.java
src/main/java/com/mmc/pms/dao/GoodsInfoDao.java
+9
-0
IndustrySpecDao.java
src/main/java/com/mmc/pms/dao/IndustrySpecDao.java
+2
-0
ProductDao.java
src/main/java/com/mmc/pms/dao/ProductDao.java
+5
-0
GoodsInfo.java
src/main/java/com/mmc/pms/entity/GoodsInfo.java
+4
-0
MallProdInfoDO.java
src/main/java/com/mmc/pms/entity/MallProdInfoDO.java
+1
-1
SkuUnitDO.java
src/main/java/com/mmc/pms/entity/SkuUnitDO.java
+31
-0
GoodsSpecDTO.java
src/main/java/com/mmc/pms/model/dto/GoodsSpecDTO.java
+29
-29
MallGoodsDetailDTO.java
src/main/java/com/mmc/pms/model/dto/MallGoodsDetailDTO.java
+49
-0
SkuUnitDTO.java
src/main/java/com/mmc/pms/model/dto/SkuUnitDTO.java
+29
-0
PriceAcquisition.java
src/main/java/com/mmc/pms/model/vo/PriceAcquisition.java
+28
-0
GoodsInfoService.java
src/main/java/com/mmc/pms/service/GoodsInfoService.java
+5
-0
GoodsInfoServiceImpl.java
...n/java/com/mmc/pms/service/Impl/GoodsInfoServiceImpl.java
+102
-1
ProductServiceImpl.java
...ain/java/com/mmc/pms/service/Impl/ProductServiceImpl.java
+8
-0
ProductSkuService.java
src/main/java/com/mmc/pms/service/ProductSkuService.java
+5
-0
GoodsInfoDao.xml
src/main/resources/mapper/GoodsInfoDao.xml
+37
-0
IndustrySpecDao.xml
src/main/resources/mapper/IndustrySpecDao.xml
+12
-0
ProductDao.xml
src/main/resources/mapper/ProductDao.xml
+6
-0
没有找到文件。
src/main/java/com/mmc/pms/controller/BackstageGoodsManageController.java
浏览文件 @
a3d5f7a8
package
com
.
mmc
.
pms
.
controller
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.model.dto.MallGoodsDetailDTO
;
import
com.mmc.pms.model.dto.SkuUnitDTO
;
import
com.mmc.pms.model.vo.Create
;
import
com.mmc.pms.model.vo.GoodsAddVO
;
import
com.mmc.pms.model.vo.Update
;
import
com.mmc.pms.service.GoodsInfoService
;
import
io.swagger.annotations.*
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
...
...
@@ -39,4 +38,18 @@ public class BackstageGoodsManageController {
public
ResultBody
editGoodsInfo
(
@ApiParam
(
"商品信息VO"
)
@Validated
(
Update
.
class
)
@RequestBody
GoodsAddVO
goodsAddVO
)
{
return
goodsInfoService
.
editGoodsInfo
(
goodsAddVO
);
}
@ApiOperation
(
value
=
"PC端-商品详情"
)
@GetMapping
(
"getGoodsInfoDetail"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
MallGoodsDetailDTO
.
class
)})
public
ResultBody
getGoodsInfoDetail
(
@ApiParam
(
"商品id"
)
@RequestParam
Integer
goodsInfoId
)
{
return
goodsInfoService
.
getGoodsInfoDetail
(
goodsInfoId
);
}
@ApiOperation
(
value
=
"单位信息"
)
@GetMapping
(
"getSkuUnit"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
SkuUnitDTO
.
class
)})
public
ResultBody
getSkuUnit
()
{
return
goodsInfoService
.
getSkuUnit
();
}
}
src/main/java/com/mmc/pms/controller/BackstageProductSpecController.java
浏览文件 @
a3d5f7a8
...
...
@@ -4,6 +4,7 @@ import com.mmc.pms.common.ResultBody;
import
com.mmc.pms.model.dto.*
;
import
com.mmc.pms.model.qo.ProductSkuQO
;
import
com.mmc.pms.model.vo.Create
;
import
com.mmc.pms.model.vo.PriceAcquisition
;
import
com.mmc.pms.model.vo.ProductSpecCPQVO
;
import
com.mmc.pms.model.vo.Update
;
import
com.mmc.pms.service.ProductSkuService
;
...
...
@@ -11,6 +12,9 @@ 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
java.math.BigDecimal
;
/**
* @Author LW
...
...
@@ -127,4 +131,12 @@ public class BackstageProductSpecController {
// @RequestParam(value = "tagId")Integer tagId) {
// return productSpecService.feignGetUnitPriceByTag(specId,tagId);
// }
@ApiOperation
(
value
=
"feign根据渠道等级获取单价信息"
)
@GetMapping
(
"feignGetSpecLeaseUnitPrice"
)
@ApiIgnore
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
BigDecimal
feignGetUnitPriceByTag
(
@RequestBody
PriceAcquisition
priceAcquisition
)
{
return
productSkuService
.
feignGetUnitPriceByTag
(
priceAcquisition
);
}
}
src/main/java/com/mmc/pms/dao/GoodsInfoDao.java
浏览文件 @
a3d5f7a8
...
...
@@ -54,6 +54,15 @@ public interface GoodsInfoDao {
void
batchUpdateMallProdSkuInfo
(
List
<
MallProdInfoDO
>
mallProdSkuInfoList
);
List
<
MallIndustrySkuInfoDO
>
getMallIndustrySkuInfo
(
Integer
id
);
GoodsInfo
getGoodsSimpleInfo
(
Integer
goodsInfoId
);
GoodsDetailDO
getGoodsDetailByGoodsId
(
Integer
goodsInfoId
);
List
<
GoodsServiceDO
>
listGoodsServiceByGoodsId
(
Integer
goodsInfoId
);
List
<
SkuUnitDO
>
getSkuUnit
();
}
...
...
src/main/java/com/mmc/pms/dao/IndustrySpecDao.java
浏览文件 @
a3d5f7a8
...
...
@@ -93,4 +93,6 @@ public interface IndustrySpecDao {
void
removeInventorySpec
(
List
<
Integer
>
ids
);
void
removeIndustrySpec
(
Integer
id
);
List
<
MallIndustrySkuInfoSpecDO
>
getIndustrySkuInfoSpec
(
Integer
goodsInfoId
);
}
src/main/java/com/mmc/pms/dao/ProductDao.java
浏览文件 @
a3d5f7a8
...
...
@@ -4,10 +4,12 @@ import com.mmc.pms.entity.*;
import
com.mmc.pms.model.dto.ProductSkuVO
;
import
com.mmc.pms.model.dto.ProductSpecVO
;
import
com.mmc.pms.model.qo.ProductSkuQO
;
import
com.mmc.pms.model.vo.PriceAcquisition
;
import
com.mmc.pms.model.vo.ProductSpecCPQVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -82,6 +84,9 @@ public interface ProductDao {
List
<
IndustrySpecDO
>
listIndustrySpec
(
@Param
(
"industrySpecIds"
)
Set
<
Integer
>
industrySpecIds
);
List
<
InventorySpecDO
>
listInventorySpec
(
Integer
id
);
BigDecimal
feignGetUnitPriceByTag
(
PriceAcquisition
priceAcquisition
);
}
...
...
src/main/java/com/mmc/pms/entity/GoodsInfo.java
浏览文件 @
a3d5f7a8
...
...
@@ -48,6 +48,10 @@ public class GoodsInfo implements Serializable {
private
Integer
deleted
;
private
Integer
goodsVideoId
;
private
String
videoUrl
;
private
static
final
long
serialVersionUID
=
1L
;
public
GoodsInfo
(
GoodsAddVO
goodsAddVO
)
{
...
...
src/main/java/com/mmc/pms/entity/MallProdInfoDO.java
浏览文件 @
a3d5f7a8
...
...
@@ -58,7 +58,7 @@ public class MallProdInfoDO implements Serializable {
return
GoodsSpecDTO
.
builder
()
.
id
(
this
.
id
)
.
goodsSpecName
(
this
.
prodSkuSpecName
)
.
goodsType
Id
(
this
.
categoriesId
)
.
category
Id
(
this
.
categoriesId
)
.
chooseType
(
this
.
chooseType
)
.
skuUnitId
(
skuUnitId
)
.
unitName
(
this
.
unitName
)
...
...
src/main/java/com/mmc/pms/entity/SkuUnitDO.java
0 → 100644
浏览文件 @
a3d5f7a8
package
com
.
mmc
.
pms
.
entity
;
import
com.mmc.pms.model.dto.SkuUnitDTO
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @Author LW
* @date 2022/10/27 16:00
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
SkuUnitDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
4353340603217315101L
;
private
Integer
id
;
private
String
unitName
;
private
Integer
deleted
;
private
Date
createTime
;
private
Date
updateTime
;
public
SkuUnitDTO
buildSkuUnitDTO
()
{
return
SkuUnitDTO
.
builder
().
id
(
this
.
id
).
unitName
(
this
.
unitName
).
createTime
(
this
.
createTime
).
build
();
}
}
src/main/java/com/mmc/pms/model/dto/GoodsSpecDTO.java
浏览文件 @
a3d5f7a8
...
...
@@ -19,47 +19,47 @@ import java.util.List;
@Builder
@Accessors
(
chain
=
true
)
public
class
GoodsSpecDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8681372139970849591L
;
private
static
final
long
serialVersionUID
=
-
8681372139970849591L
;
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"规格名称"
)
private
String
goodsSpecName
;
@ApiModelProperty
(
value
=
"规格名称"
)
private
String
goodsSpecName
;
@ApiModelProperty
(
value
=
"产品或行业类型"
)
private
Integer
goodsType
Id
;
@ApiModelProperty
(
value
=
"产品或行业类型"
)
private
Integer
category
Id
;
@ApiModelProperty
(
value
=
"产品或行业类型名称"
)
private
String
typeName
;
@ApiModelProperty
(
value
=
"产品或行业类型名称"
)
private
String
typeName
;
@ApiModelProperty
(
value
=
"产品或行业skuId"
)
private
Integer
skuId
;
@ApiModelProperty
(
value
=
"产品或行业skuId"
)
private
Integer
skuId
;
@ApiModelProperty
(
value
=
"品牌id"
)
private
Integer
brandInfoId
;
@ApiModelProperty
(
value
=
"品牌id"
)
private
Integer
brandInfoId
;
@ApiModelProperty
(
value
=
"产品或行业sku名称"
)
private
String
skuName
;
@ApiModelProperty
(
value
=
"产品或行业sku名称"
)
private
String
skuName
;
@ApiModelProperty
(
value
=
"产品规格信息"
)
private
List
<
MallProductSpecDTO
>
productSpecList
;
@ApiModelProperty
(
value
=
"产品规格信息"
)
private
List
<
MallProductSpecDTO
>
productSpecList
;
@ApiModelProperty
(
value
=
"行业规格信息"
)
private
List
<
MallIndustrySpecDTO
>
industrySpecList
;
@ApiModelProperty
(
value
=
"行业规格信息"
)
private
List
<
MallIndustrySpecDTO
>
industrySpecList
;
@ApiModelProperty
(
value
=
"选择方式"
)
private
Integer
chooseType
;
@ApiModelProperty
(
value
=
"选择方式"
)
private
Integer
chooseType
;
@ApiModelProperty
(
value
=
"规格单位"
)
private
Integer
skuUnitId
;
@ApiModelProperty
(
value
=
"规格单位"
)
private
Integer
skuUnitId
;
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
unitName
;
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
unitName
;
@ApiModelProperty
(
value
=
"是否必选"
)
private
Integer
must
;
@ApiModelProperty
(
value
=
"是否必选"
)
private
Integer
must
;
@ApiModelProperty
(
value
=
"规格来源 0获取 1自定义"
)
private
Integer
flag
;
@ApiModelProperty
(
value
=
"规格来源 0获取 1自定义"
)
private
Integer
flag
;
}
src/main/java/com/mmc/pms/model/dto/MallGoodsDetailDTO.java
0 → 100644
浏览文件 @
a3d5f7a8
package
com
.
mmc
.
pms
.
model
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @Author LW
* @date 2022/10/14 11:30
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors
(
chain
=
true
)
public
class
MallGoodsDetailDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7041502536618388167L
;
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"商品图片"
)
private
List
<
GoodsImgDTO
>
images
;
@ApiModelProperty
(
value
=
"商品视频"
)
private
String
goodsVideo
;
@ApiModelProperty
(
value
=
"商品视频id"
)
private
Integer
goodsVideoId
;
@ApiModelProperty
(
value
=
"商品名称"
)
private
String
goodsName
;
@ApiModelProperty
(
value
=
"商品详情"
)
private
GoodsDetailInfoDTO
goodsDetail
;
@ApiModelProperty
(
value
=
"所属目录"
)
private
Integer
directoryId
;
@ApiModelProperty
(
value
=
"一级分类id"
)
private
Integer
categoryByOne
;
@ApiModelProperty
(
value
=
"二级分类id"
)
private
Integer
categoryByTwo
;
@ApiModelProperty
(
value
=
"商品标签"
)
private
String
tag
;
@ApiModelProperty
(
value
=
"商品状态 0:下架 1:上架"
)
private
Integer
shelfStatus
;
@ApiModelProperty
(
value
=
"规格信息"
)
private
List
<
GoodsSpecDTO
>
goodsSpec
;
@ApiModelProperty
(
value
=
"其他服务: 1:免费配送,2:专业飞手培训2日, 3:半年保修, 4:一年保修 "
)
private
List
<
GoodsOtherServiceDTO
>
otherService
;
}
src/main/java/com/mmc/pms/model/dto/SkuUnitDTO.java
0 → 100644
浏览文件 @
a3d5f7a8
package
com
.
mmc
.
pms
.
model
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* sku单位dto
*
* @author 23214
* @date 2022/10/27
*/
@Data
@AllArgsConstructor
@Builder
public
class
SkuUnitDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
141631308183969739L
;
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
unitName
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
}
src/main/java/com/mmc/pms/model/vo/PriceAcquisition.java
0 → 100644
浏览文件 @
a3d5f7a8
package
com
.
mmc
.
pms
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author 23214
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
PriceAcquisition
{
@ApiModelProperty
(
value
=
"用户id"
)
private
Integer
userId
;
@ApiModelProperty
(
value
=
"规格id"
)
private
Integer
specsId
;
@ApiModelProperty
(
value
=
"天数"
)
private
Integer
day
;
@ApiModelProperty
(
value
=
"渠道等级id"
)
private
Integer
channelLevelId
;
}
\ No newline at end of file
src/main/java/com/mmc/pms/service/GoodsInfoService.java
浏览文件 @
a3d5f7a8
...
...
@@ -13,4 +13,9 @@ public interface GoodsInfoService {
ResultBody
addGoods
(
GoodsAddVO
goodsAddVO
);
ResultBody
editGoodsInfo
(
GoodsAddVO
goodsAddVO
);
ResultBody
getGoodsInfoDetail
(
Integer
goodsInfoId
);
ResultBody
getSkuUnit
();
}
src/main/java/com/mmc/pms/service/Impl/GoodsInfoServiceImpl.java
浏览文件 @
a3d5f7a8
...
...
@@ -6,7 +6,7 @@ import com.mmc.pms.dao.GoodsInfoDao;
import
com.mmc.pms.dao.IndustrySpecDao
;
import
com.mmc.pms.dao.ProductDao
;
import
com.mmc.pms.entity.*
;
import
com.mmc.pms.model.dto.
ProductSpecVO
;
import
com.mmc.pms.model.dto.
*
;
import
com.mmc.pms.model.vo.*
;
import
com.mmc.pms.service.GoodsInfoService
;
import
com.mmc.pms.util.CodeUtil
;
...
...
@@ -368,6 +368,107 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
// 商品详情修改
goodsInfoDao
.
updateGoodsDetail
(
goodsDetailDO
);
}
@Override
public
ResultBody
getGoodsInfoDetail
(
Integer
goodsInfoId
)
{
// 判断此商品是否还存在
int
count
=
goodsInfoDao
.
countGoodsInfoById
(
goodsInfoId
);
if
(
count
<=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
GOODS_NOT_EXIST_OR_ALREADY_DOWN_SHELF
);
}
// 初始化商品返回信息的对象
MallGoodsDetailDTO
mallGoodsDetail
=
new
MallGoodsDetailDTO
();
// 获取商品基本信息
GoodsInfo
goodsInfo
=
goodsInfoDao
.
getGoodsSimpleInfo
(
goodsInfoId
);
mallGoodsDetail
.
setId
(
goodsInfo
.
getId
()).
setGoodsName
(
goodsInfo
.
getGoodsName
())
.
setCategoryByOne
(
goodsInfo
.
getCategoryByOne
()).
setGoodsVideo
(
goodsInfo
.
getVideoUrl
())
.
setDirectoryId
(
goodsInfo
.
getDirectoryId
()).
setCategoryByTwo
(
goodsInfo
.
getCategoryByTwo
())
.
setTag
(
goodsInfo
.
getEcoLabel
()).
setShelfStatus
(
goodsInfo
.
getShelfStatus
())
.
setGoodsVideoId
(
goodsInfo
.
getGoodsVideoId
());
// 获取商品图片信息
mallGoodsDetail
.
setImages
(
getGoodsImageInfo
(
goodsInfoId
));
// 获取商品详细信息
mallGoodsDetail
.
setGoodsDetail
(
getGoodsDetail
(
goodsInfoId
));
// 获取其他服务信息
mallGoodsDetail
.
setOtherService
(
getOtherServiceInfo
(
goodsInfoId
));
// 获取规格信息
if
(!
goodsInfo
.
getDirectoryId
().
equals
(
2
))
{
// 获取产品规格信息
mallGoodsDetail
.
setGoodsSpec
(
getProductSpecInfo
(
goodsInfoId
));
}
else
{
// 获取行业规格信息
mallGoodsDetail
.
setGoodsSpec
(
getIndustrySpecInfo
(
goodsInfoId
));
}
return
ResultBody
.
success
(
mallGoodsDetail
);
}
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
=
industrySpecDao
.
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
();
MallIndustrySpecDTO
industrySpecDTO
=
industrySpecDO
.
buildMallIndustrySpecDTO
();
industrySpecDTO
.
setId
(
e
.
getId
());
industrySpecDTO
.
setIndustrySpecId
(
e
.
getIndustrySpecId
());
industrySpecDTO
.
setIndustrySkuId
(
d
.
getSkuId
());
industrySpec
.
add
(
industrySpecDTO
);
}
}
d
.
setIndustrySpecList
(
industrySpec
);
}).
collect
(
Collectors
.
toList
());
return
list
;
}
private
List
<
GoodsSpecDTO
>
getProductSpecInfo
(
Integer
goodsInfoId
)
{
// 获取商品对应绑定sku的信息
List
<
MallProdInfoDO
>
mallProSkuInfo
=
goodsInfoDao
.
getMallProSkuInfo
(
goodsInfoId
);
// 获取该产品下的规格id
Map
<
Integer
,
String
>
specIdsMap
=
mallProSkuInfo
.
stream
().
collect
(
Collectors
.
toMap
(
MallProdInfoDO:
:
getId
,
MallProdInfoDO:
:
getProductSpecIdList
));
List
<
GoodsSpecDTO
>
list
=
mallProSkuInfo
.
stream
().
map
(
MallProdInfoDO:
:
buildGoodsSpecDTO
).
collect
(
Collectors
.
toList
());
for
(
GoodsSpecDTO
goodsSpecDTO
:
list
)
{
String
specIds
=
specIdsMap
.
get
(
goodsSpecDTO
.
getId
());
String
[]
ids
=
specIds
.
split
(
","
);
List
<
Integer
>
idList
=
new
ArrayList
<>();
for
(
String
id
:
ids
)
{
idList
.
add
(
Integer
.
parseInt
(
id
));
}
// 根据specIds集合找出spec的信息
List
<
ProductSpecDO
>
productSpecDOS
=
productDao
.
listProductSpecInfo
(
idList
);
List
<
MallProductSpecDTO
>
mallProductSpecList
=
productSpecDOS
.
stream
().
map
(
ProductSpecDO:
:
buildMallProductSpecDTO
).
collect
(
Collectors
.
toList
());
goodsSpecDTO
.
setProductSpecList
(
mallProductSpecList
);
}
return
list
;
}
private
List
<
GoodsOtherServiceDTO
>
getOtherServiceInfo
(
Integer
goodsInfoId
)
{
List
<
GoodsServiceDO
>
goodsServiceDO
=
goodsInfoDao
.
listGoodsServiceByGoodsId
(
goodsInfoId
);
return
goodsServiceDO
.
stream
().
map
(
GoodsServiceDO:
:
buildGoodsOtherServiceDTO
).
collect
(
Collectors
.
toList
());
}
private
GoodsDetailInfoDTO
getGoodsDetail
(
Integer
goodsInfoId
)
{
GoodsDetailDO
goodsDetail
=
goodsInfoDao
.
getGoodsDetailByGoodsId
(
goodsInfoId
);
return
goodsDetail
.
buildGoodsDetailInfoDTO
();
}
private
List
<
GoodsImgDTO
>
getGoodsImageInfo
(
Integer
goodsInfoId
)
{
List
<
GoodsImgDO
>
goodsImgList
=
goodsInfoDao
.
listGoodsInfoByGoodsId
(
goodsInfoId
);
return
goodsImgList
.
stream
().
map
(
GoodsImgDO:
:
buildGoodsImgDTO
).
collect
(
Collectors
.
toList
());
}
@Override
public
ResultBody
getSkuUnit
()
{
List
<
SkuUnitDO
>
skuUnitList
=
goodsInfoDao
.
getSkuUnit
();
List
<
SkuUnitDTO
>
list
=
skuUnitList
.
stream
().
map
(
SkuUnitDO:
:
buildSkuUnitDTO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
list
);
}
}
...
...
src/main/java/com/mmc/pms/service/Impl/ProductServiceImpl.java
浏览文件 @
a3d5f7a8
...
...
@@ -7,6 +7,7 @@ import com.mmc.pms.dao.ProductDao;
import
com.mmc.pms.entity.*
;
import
com.mmc.pms.model.dto.*
;
import
com.mmc.pms.model.qo.ProductSkuQO
;
import
com.mmc.pms.model.vo.PriceAcquisition
;
import
com.mmc.pms.model.vo.ProductSpecCPQVO
;
import
com.mmc.pms.page.PageResult
;
import
com.mmc.pms.service.ProductSkuService
;
...
...
@@ -14,6 +15,7 @@ import org.jetbrains.annotations.NotNull;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -245,6 +247,12 @@ public class ProductServiceImpl implements ProductSkuService {
return
ResultBody
.
success
();
}
}
@Override
public
BigDecimal
feignGetUnitPriceByTag
(
PriceAcquisition
priceAcquisition
)
{
BigDecimal
price
=
productDao
.
feignGetUnitPriceByTag
(
priceAcquisition
);
return
price
==
null
?
null
:
price
;
}
}
...
...
src/main/java/com/mmc/pms/service/ProductSkuService.java
浏览文件 @
a3d5f7a8
...
...
@@ -5,8 +5,10 @@ import com.mmc.pms.entity.ProductSpecPriceDO;
import
com.mmc.pms.model.dto.ProductSkuVO
;
import
com.mmc.pms.model.dto.ProductSpecVO
;
import
com.mmc.pms.model.qo.ProductSkuQO
;
import
com.mmc.pms.model.vo.PriceAcquisition
;
import
com.mmc.pms.model.vo.ProductSpecCPQVO
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
...
...
@@ -41,4 +43,7 @@ public interface ProductSkuService {
ResultBody
removeProductSku
(
Integer
id
);
ResultBody
removeProductSpec
(
Integer
id
);
BigDecimal
feignGetUnitPriceByTag
(
PriceAcquisition
priceAcquisition
);
}
src/main/resources/mapper/GoodsInfoDao.xml
浏览文件 @
a3d5f7a8
...
...
@@ -192,4 +192,41 @@
WHERE mi.goods_info_id = #{id}
AND mi.is_deleted = 0
</select>
<select
id=
"getGoodsSimpleInfo"
resultType=
"com.mmc.pms.entity.GoodsInfo"
>
SELECT gi.id,
gi.goods_no,
gi.goods_name,
gi.eco_label,
gi.directory_id,
gi.category_by_one,
gi.category_by_two,
gi.shelf_status,
gi.create_time,
gv.id goodsVideoId,
gv.video_url videoUrl
FROM goods_info gi
LEFT JOIN goods_video gv ON gi.id = gv.goods_info_id
AND gv.is_deleted = 0
WHERE gi.id = #{goodsInfoId}
</select>
<select
id=
"getGoodsDetailByGoodsId"
resultType=
"com.mmc.pms.entity.GoodsDetailDO"
>
select id, goods_desc goodsDesc, content, remark
from goods_detail
where goods_info_id = #{goodsInfoId}
</select>
<select
id=
"listGoodsServiceByGoodsId"
resultType=
"com.mmc.pms.entity.GoodsServiceDO"
>
SELECT gc.id,
gc.sale_service_id,
ss.service_name
FROM goods_service gc
LEFT JOIN sale_service ss ON gc.sale_service_id = ss.id
WHERE gc.goods_info_id = #{goodsInfoId}
</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>
</mapper>
src/main/resources/mapper/IndustrySpecDao.xml
浏览文件 @
a3d5f7a8
...
...
@@ -330,4 +330,15 @@
AND mi.is_deleted = 0
AND gi.is_deleted = 0
</select>
<select
id=
"getIndustrySkuInfoSpec"
resultType=
"com.mmc.pms.entity.MallIndustrySkuInfoSpecDO"
>
SELECT mi.id,
mi.mall_industry_sku_info_id,
mi.industry_spec_id,
ins.industry_sku_id,
ins.spec_image,
ins.spec_name
FROM mall_industry_sku_info_spec mi
INNER JOIN industry_spec ins ON ins.id = mi.industry_spec_id and mi.is_deleted = 0
WHERE goods_info_id = #{id}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/ProductDao.xml
浏览文件 @
a3d5f7a8
...
...
@@ -318,4 +318,10 @@
AND mp.is_deleted = 0
AND gi.is_deleted = 0
</select>
<select
id=
"feignGetUnitPriceByTag"
resultType=
"java.math.BigDecimal"
>
select price
from product_spec_price
where product_spec_id = #{specsId}
and cooperation_tag = #{channelLevelId}
</select>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论