Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
d3b85f6d
提交
d3b85f6d
authored
4月 20, 2024
作者:
刘明祎-运维用途
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop'
上级
6ba7bc02
66ff6e5b
流水线
#8930
已通过 于阶段
in 2 分 25 秒
变更
9
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
106 行增加
和
5 行删除
+106
-5
kustomization.yaml
kustomization/overlays/dev/kustomization.yaml
+1
-1
MallGoodsDao.java
src/main/java/com/mmc/pms/dao/mall/MallGoodsDao.java
+6
-0
GoodsCurriculumDO.java
src/main/java/com/mmc/pms/entity/mall/GoodsCurriculumDO.java
+20
-0
MallGoodsDO.java
src/main/java/com/mmc/pms/entity/mall/MallGoodsDO.java
+6
-1
ImsAppApi.java
src/main/java/com/mmc/pms/feign/ImsAppApi.java
+3
-0
ImsApiHystrix.java
src/main/java/com/mmc/pms/feign/hystrix/ImsApiHystrix.java
+6
-0
MallGoodsVO.java
src/main/java/com/mmc/pms/model/mall/MallGoodsVO.java
+7
-0
MallGoodsServiceImpl.java
...a/com/mmc/pms/service/mall/impl/MallGoodsServiceImpl.java
+35
-0
MallGoodsDao.xml
src/main/resources/mapper/mall/MallGoodsDao.xml
+22
-3
没有找到文件。
kustomization/overlays/dev/kustomization.yaml
浏览文件 @
d3b85f6d
...
...
@@ -18,4 +18,4 @@ patches:
images
:
-
name
:
REGISTRY/NAMESPACE/IMAGE:TAG
newName
:
mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag
:
f0a64b8bb399c8732fd24c1725cbfe50366fb6aa
newTag
:
e9b5e8130a5d80588e4bcc6bb1c031b38873ca1e
src/main/java/com/mmc/pms/dao/mall/MallGoodsDao.java
浏览文件 @
d3b85f6d
...
...
@@ -70,4 +70,10 @@ public interface MallGoodsDao {
List
<
MallGoodsDO
>
recommendMallGoods
();
MallGoodsDO
getMallGoodsInfoByGambitId
(
Integer
gambitId
);
void
insertGoodsAndCurriculum
(
Integer
goodsId
,
Integer
curriculumId
);
void
deleteCurriculum
(
Integer
goodsId
);
List
<
GoodsCurriculumDO
>
selectCurriculumIdsByGoodsId
(
Integer
goodsId
);
}
src/main/java/com/mmc/pms/entity/mall/GoodsCurriculumDO.java
0 → 100644
浏览文件 @
d3b85f6d
package
com
.
mmc
.
pms
.
entity
.
mall
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
GoodsCurriculumDO
implements
Serializable
{
private
Integer
id
;
private
Integer
goodsId
;
private
Integer
curriculumId
;
}
src/main/java/com/mmc/pms/entity/mall/MallGoodsDO.java
浏览文件 @
d3b85f6d
...
...
@@ -98,6 +98,10 @@ public class MallGoodsDO implements Serializable {
* 关联话题id
*/
private
Integer
gambitId
;
/**
* 关于产品使用说明
*/
private
String
instructionsUrl
;
public
MallGoodsDO
(
MallGoodsVO
mallGoodsVO
)
{
this
.
id
=
mallGoodsVO
.
getId
();
...
...
@@ -112,13 +116,14 @@ public class MallGoodsDO implements Serializable {
this
.
recommend
=
mallGoodsVO
.
getRecommend
()
==
null
?
0
:
mallGoodsVO
.
getRecommend
();
this
.
goodsDetails
=
mallGoodsVO
.
getGoodsDetails
();
this
.
gambitId
=
mallGoodsVO
.
getGambitId
();
this
.
instructionsUrl
=
mallGoodsVO
.
getInstructionsUrl
();
}
public
MallGoodsVO
buildMallGoodsVO
()
{
return
MallGoodsVO
.
builder
().
id
(
id
).
userAccountId
(
userAccountId
).
tradeName
(
tradeName
)
.
description
(
description
).
categoryPrimaryId
(
categoryPrimaryId
).
categorySubId
(
categorySubId
)
.
shelfStatus
(
shelfStatus
).
priceShow
(
priceShow
).
goodsLabel
(
goodsLabel
).
labelShow
(
labelShow
).
gambitId
(
gambitId
)
.
createTime
(
createTime
).
goodsDetails
(
goodsDetails
).
recommend
(
recommend
).
build
();
.
createTime
(
createTime
).
goodsDetails
(
goodsDetails
).
recommend
(
recommend
).
instructionsUrl
(
instructionsUrl
).
build
();
}
public
MallGoodsVO
buildListMallGoodsVO
()
{
...
...
src/main/java/com/mmc/pms/feign/ImsAppApi.java
浏览文件 @
d3b85f6d
...
...
@@ -22,4 +22,7 @@ public interface ImsAppApi {
@GetMapping
(
"/release/curriculum/getCurriculumCount"
)
Integer
getCurriculumCount
();
// @GetMapping("/release/curriculum/selectCurriculuInfoById")
// List<CurriculumInfoVO> queryCurriculumInfoById(@RequestParam List<Integer> ids);
}
src/main/java/com/mmc/pms/feign/hystrix/ImsApiHystrix.java
浏览文件 @
d3b85f6d
...
...
@@ -29,4 +29,10 @@ public class ImsApiHystrix implements ImsAppApi {
log
.
error
(
"熔断:ImsApiHystrix.feignCountCurriculumInfo"
);
return
0
;
}
// @Override
// public List<CurriculumInfoVO> queryCurriculumInfoById(List<Integer> ids) {
// log.error("熔断:ImsApiHystrix.queryCurriculumInfoById");
// return null;
// }
}
src/main/java/com/mmc/pms/model/mall/MallGoodsVO.java
浏览文件 @
d3b85f6d
package
com
.
mmc
.
pms
.
model
.
mall
;
import
com.mmc.pms.model.categories.vo.CurriculumInfoVO
;
import
com.mmc.pms.model.group.Create
;
import
com.mmc.pms.model.group.Update
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -87,4 +88,10 @@ public class MallGoodsVO implements Serializable {
@ApiModelProperty
(
value
=
"关联话题id"
)
private
Integer
gambitId
;
@ApiModelProperty
(
value
=
"关联课程ids"
)
private
List
<
Integer
>
curriculumIds
;
@ApiModelProperty
(
value
=
"关于产品使用说明"
)
private
String
instructionsUrl
;
}
src/main/java/com/mmc/pms/service/mall/impl/MallGoodsServiceImpl.java
浏览文件 @
d3b85f6d
...
...
@@ -11,7 +11,9 @@ import com.mmc.pms.entity.lease.LeasePriceStockDO;
import
com.mmc.pms.entity.lease.LeaseSpecAttrDO
;
import
com.mmc.pms.entity.lease.LeaseSpecAttrValueDO
;
import
com.mmc.pms.entity.mall.*
;
import
com.mmc.pms.feign.ImsAppApi
;
import
com.mmc.pms.feign.UserAppApi
;
import
com.mmc.pms.model.categories.vo.CurriculumInfoVO
;
import
com.mmc.pms.model.lease.vo.LeaseGoodsVO
;
import
com.mmc.pms.model.lease.vo.LeasePriceStockVO
;
import
com.mmc.pms.model.mall.GoodsResourcesVO
;
...
...
@@ -52,6 +54,9 @@ public class MallGoodsServiceImpl implements MallGoodsService {
@Autowired
private
UserAppApi
userAppApi
;
@Autowired
private
ImsAppApi
imsAppApi
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultBody
addMallGoods
(
MallGoodsVO
mallGoodsVO
,
Integer
userAccountId
)
{
...
...
@@ -68,6 +73,14 @@ public class MallGoodsServiceImpl implements MallGoodsService {
insertMallGoodsResources
(
null
,
mallGoodsVO
,
mallGoodsDO
.
getId
());
// 将商品规格存入数据库
addMallGoodsSpec
(
mallGoodsVO
.
getSpecAttrList
(),
mallGoodsDO
.
getId
(),
mallGoodsVO
.
getPriceStock
(),
null
,
0
);
// 将商品id和对应的课程ids 存入到中间表中
Integer
goodsId
=
mallGoodsVO
.
getId
();
List
<
Integer
>
curriculumIds
=
mallGoodsVO
.
getCurriculumIds
();
if
(
CollectionUtils
.
isNotEmpty
(
curriculumIds
))
{
for
(
Integer
curriculumId
:
curriculumIds
){
mallGoodsDao
.
insertGoodsAndCurriculum
(
goodsId
,
curriculumId
);
}
}
return
ResultBody
.
success
();
}
...
...
@@ -200,6 +213,16 @@ public class MallGoodsServiceImpl implements MallGoodsService {
// 获取价格库存排列组合
List
<
PriceStockDO
>
priceStockDOList
=
mallGoodsDao
.
listPriceStock
(
id
);
mallGoodsVO
.
setPriceStock
(
priceStockDOList
.
stream
().
map
(
PriceStockDO:
:
buildPriceStockVO
).
collect
(
Collectors
.
toList
()));
//TODO 根据商品id 调用远程接口 查询课程名称
//商品id 获取课程id列表
List
<
GoodsCurriculumDO
>
goodsCurriculumDOS
=
mallGoodsDao
.
selectCurriculumIdsByGoodsId
(
id
);
if
(
goodsCurriculumDOS
!=
null
){
List
<
Integer
>
curriculumIds
=
goodsCurriculumDOS
.
stream
().
map
(
GoodsCurriculumDO:
:
getCurriculumId
).
collect
(
Collectors
.
toList
());
mallGoodsVO
.
setCurriculumIds
(
curriculumIds
);
// List<CurriculumInfoVO> curriculumInfoVOS = imsAppApi.queryCurriculumInfoById(curriculumIds);
// mallGoodsVO.setCurriculumInfoVOS(curriculumInfoVOS);
}
return
ResultBody
.
success
(
mallGoodsVO
);
}
...
...
@@ -219,6 +242,18 @@ public class MallGoodsServiceImpl implements MallGoodsService {
this
.
insertMallGoodsResources
(
null
,
mallGoodsVO
,
mallGoodsVO
.
getId
());
// 修改规格
updateSpecInfo
(
mallGoodsVO
,
null
);
// TODO 判断课程信息是否修改
// 修改商品 绑定课程信息 在中间表修改商品id 对应的课程id
Integer
goodsId
=
mallGoodsVO
.
getId
();
List
<
Integer
>
curriculumIds
=
mallGoodsVO
.
getCurriculumIds
();
if
(
CollectionUtils
.
isNotEmpty
(
curriculumIds
))
{
//先删除数据库 在重新添加
mallGoodsDao
.
deleteCurriculum
(
goodsId
);
for
(
Integer
curriculumId
:
curriculumIds
)
{
mallGoodsDao
.
insertGoodsAndCurriculum
(
goodsId
,
curriculumId
);
}
}
return
ResultBody
.
success
();
}
...
...
src/main/resources/mapper/mall/MallGoodsDao.xml
浏览文件 @
d3b85f6d
...
...
@@ -18,10 +18,11 @@
recommend,
price_show,
sort,
gambit_id)
gambit_id,
instructions_url)
values ( #{goodsNo}, #{tradeName}, #{description}, #{categoryPrimaryId}, #{categorySubId}
, #{shelfStatus}, #{goodsLabel}, #{labelShow}, #{goodsDetails}
, #{userAccountId}, #{recommend}, #{priceShow}, #{sort}, #{gambitId})
, #{userAccountId}, #{recommend}, #{priceShow}, #{sort}, #{gambitId}
, #{instructionsUrl}
)
</insert>
<insert
id=
"batchInsertMallGoodsResources"
>
...
...
@@ -62,6 +63,19 @@
spec_name)
values (#{mallGoodsId}, #{specName})
</insert>
<insert
id=
"insertGoodsAndCurriculum"
>
insert into mall_goods_curriculum (goods_id,
curriculum_id,
create_time)
values (#{goodsId}, #{curriculumId}, NOW())
</insert>
<delete
id=
"deleteCurriculum"
>
delete
from mall_goods_curriculum
where goods_id = #{goodsId}
</delete>
<update
id=
"updateMallGoods"
>
UPDATE mall_goods
SET trade_name = #{mallGoodsDO.tradeName},
...
...
@@ -74,7 +88,8 @@
goods_details = #{mallGoodsDO.goodsDetails},
price_show = #{mallGoodsDO.priceShow},
recommend = #{mallGoodsDO.recommend},
gambit_id = #{mallGoodsDO.gambitId}
gambit_id = #{mallGoodsDO.gambitId},
instructions_url = #{mallGoodsDO.instructionsUrl}
WHERE id = #{mallGoodsDO.id}
</update>
<update
id=
"updateMallGoodsSort"
>
...
...
@@ -166,6 +181,7 @@
recommend,
sort,
gambit_id,
instructions_url,
create_time
FROM mall_goods
WHERE id = #{id}
...
...
@@ -350,5 +366,8 @@
WHERE gambit_id = #{gambitId}
and is_deleted = 0
</select>
<select
id=
"selectCurriculumIdsByGoodsId"
resultType=
"com.mmc.pms.entity.mall.GoodsCurriculumDO"
>
select * from mall_goods_curriculum where goods_id = #{goodsId}
</select>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论