Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-product
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-product
Commits
285a9c18
Commit
285a9c18
authored
Dec 16, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
d33f8040
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
19 deletions
+62
-19
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiProductLaunchServiceImpl.java
+47
-17
yd-product-feign/src/main/java/com/yd/product/feign/dto/ApiProductLaunchDto.java
+2
-2
yd-product-feign/src/main/java/com/yd/product/feign/request/productlaunch/ApiProductLaunchSaveRequest.java
+8
-0
yd-product-feign/src/main/java/com/yd/product/feign/response/productlaunch/ApiProductLaunchCategoryAddResponse.java
+5
-0
No files found.
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiProductLaunchServiceImpl.java
View file @
285a9c18
...
...
@@ -142,6 +142,7 @@ public class ApiProductLaunchServiceImpl implements ApiProductLaunchService {
addRequest
.
setObjectType
(
CommonEnum
.
UID_TYPE_PRODUCT_LAUNCH
.
getCode
());
apiRelObjectCategoryFeignClient
.
addRelObjectCategoryList
(
addRequest
);
response
.
setId
(
productLaunch
.
getId
());
response
.
setProductBizId
(
productBizId
);
response
.
setProductLaunchBizId
(
productLaunch
.
getProductLaunchBizId
());
return
Result
.
success
(
response
);
...
...
@@ -245,25 +246,54 @@ public class ApiProductLaunchServiceImpl implements ApiProductLaunchService {
*/
@Override
public
Result
save
(
ApiProductLaunchSaveRequest
request
)
{
ApiProductLaunchDto
apiProductLaunchDto
=
request
.
getApiProductLaunchDto
();
//校验产品上架信息是否存在
Result
<
ProductLaunch
>
result
=
checkProductLaunchIsExist
(
apiProductLaunchDto
.
getProductLaunchBizId
());
ProductLaunch
productLaunch
=
result
.
getData
();
//更新产品上架主信息
BeanUtils
.
copyProperties
(
apiProductLaunchDto
,
productLaunch
);
productLaunch
.
setMainUrls
(!
CollectionUtils
.
isEmpty
(
apiProductLaunchDto
.
getMainUrlsList
())
?
String
.
join
(
";"
,
apiProductLaunchDto
.
getMainUrlsList
())
:
""
);
productLaunch
.
setDetailUrls
(!
CollectionUtils
.
isEmpty
(
apiProductLaunchDto
.
getDetailUrlsList
())
?
String
.
join
(
";"
,
apiProductLaunchDto
.
getDetailUrlsList
())
:
""
);
productLaunch
.
setProjectBizIdList
(!
CollectionUtils
.
isEmpty
(
apiProductLaunchDto
.
getProjectBizIdList
())
?
String
.
join
(
";"
,
apiProductLaunchDto
.
getProjectBizIdList
())
:
""
);
iProductLaunchService
.
saveOrUpdate
(
productLaunch
);
//设置产品上架信息参数列表
apiAttributeSettingService
.
save
(
request
.
getApiAttributeSettingDtoList
(),
productLaunch
.
getProductLaunchBizId
());
if
(
request
.
getSource
()
==
1
)
{
//复制来源
//添加-产品上架类目信息
ApiProductLaunchCategoryAddRequest
addRequest
=
new
ApiProductLaunchCategoryAddRequest
();
addRequest
.
setCategoryBizIdList
(
request
.
getApiProductLaunchDto
().
getCategoryBizIdList
());
addRequest
.
setMainUrlsList
(
request
.
getApiProductLaunchDto
().
getMainUrlsList
());
addRequest
.
setProductBizId
(
request
.
getApiProductLaunchDto
().
getProductBizId
());
addRequest
.
setProductName
(
request
.
getApiProductLaunchDto
().
getTitle
());
Result
<
ApiProductLaunchCategoryAddResponse
>
result
=
addCategory
(
addRequest
);
ApiProductLaunchCategoryAddResponse
addResponse
=
result
.
getData
();
ApiProductLaunchDto
apiProductLaunchDto
=
request
.
getApiProductLaunchDto
();
ProductLaunch
productLaunch
=
new
ProductLaunch
();
//更新产品上架主信息
BeanUtils
.
copyProperties
(
apiProductLaunchDto
,
productLaunch
);
productLaunch
.
setId
(
addResponse
.
getId
());
productLaunch
.
setProductLaunchBizId
(
addResponse
.
getProductLaunchBizId
());
productLaunch
.
setMainUrls
(!
CollectionUtils
.
isEmpty
(
apiProductLaunchDto
.
getMainUrlsList
())
?
String
.
join
(
";"
,
apiProductLaunchDto
.
getMainUrlsList
())
:
""
);
productLaunch
.
setDetailUrls
(!
CollectionUtils
.
isEmpty
(
apiProductLaunchDto
.
getDetailUrlsList
())
?
String
.
join
(
";"
,
apiProductLaunchDto
.
getDetailUrlsList
())
:
""
);
productLaunch
.
setProjectBizIdList
(!
CollectionUtils
.
isEmpty
(
apiProductLaunchDto
.
getProjectBizIdList
())
?
String
.
join
(
";"
,
apiProductLaunchDto
.
getProjectBizIdList
())
:
""
);
iProductLaunchService
.
saveOrUpdate
(
productLaunch
);
//保存产品上架规格配置列表
apiSpeciesSettingService
.
save
(
request
.
getApiSpeciesSettingDtoList
(),
productLaunch
.
getProductLaunchBizId
());
//设置产品上架信息参数列表
apiAttributeSettingService
.
save
(
request
.
getApiAttributeSettingDtoList
(),
productLaunch
.
getProductLaunchBizId
());
//保存产品上架规格配置列表
apiSpeciesSettingService
.
save
(
request
.
getApiSpeciesSettingDtoList
(),
productLaunch
.
getProductLaunchBizId
());
//保存规格价格配置列表
apiSpeciesPriceService
.
save
(
request
.
getApiSpeciesPriceDtoList
(),
productLaunch
.
getProductLaunchBizId
());
}
else
{
//其他来源
ApiProductLaunchDto
apiProductLaunchDto
=
request
.
getApiProductLaunchDto
();
//校验产品上架信息是否存在
Result
<
ProductLaunch
>
result
=
checkProductLaunchIsExist
(
apiProductLaunchDto
.
getProductLaunchBizId
());
ProductLaunch
productLaunch
=
result
.
getData
();
//更新产品上架主信息
BeanUtils
.
copyProperties
(
apiProductLaunchDto
,
productLaunch
);
productLaunch
.
setMainUrls
(!
CollectionUtils
.
isEmpty
(
apiProductLaunchDto
.
getMainUrlsList
())
?
String
.
join
(
";"
,
apiProductLaunchDto
.
getMainUrlsList
())
:
""
);
productLaunch
.
setDetailUrls
(!
CollectionUtils
.
isEmpty
(
apiProductLaunchDto
.
getDetailUrlsList
())
?
String
.
join
(
";"
,
apiProductLaunchDto
.
getDetailUrlsList
())
:
""
);
productLaunch
.
setProjectBizIdList
(!
CollectionUtils
.
isEmpty
(
apiProductLaunchDto
.
getProjectBizIdList
())
?
String
.
join
(
";"
,
apiProductLaunchDto
.
getProjectBizIdList
())
:
""
);
iProductLaunchService
.
saveOrUpdate
(
productLaunch
);
//保存规格价格配置列表
apiSpeciesPriceService
.
save
(
request
.
getApiSpeciesPriceDtoList
(),
productLaunch
.
getProductLaunchBizId
());
//设置产品上架信息参数列表
apiAttributeSettingService
.
save
(
request
.
getApiAttributeSettingDtoList
(),
productLaunch
.
getProductLaunchBizId
());
//保存产品上架规格配置列表
apiSpeciesSettingService
.
save
(
request
.
getApiSpeciesSettingDtoList
(),
productLaunch
.
getProductLaunchBizId
());
//保存规格价格配置列表
apiSpeciesPriceService
.
save
(
request
.
getApiSpeciesPriceDtoList
(),
productLaunch
.
getProductLaunchBizId
());
}
return
Result
.
success
();
}
...
...
yd-product-feign/src/main/java/com/yd/product/feign/dto/ApiProductLaunchDto.java
View file @
285a9c18
...
...
@@ -14,13 +14,13 @@ public class ApiProductLaunchDto {
/**
* 产品上架信息表唯一业务ID
*/
@NotBlank
(
message
=
"产品上架信息表唯一业务ID不能为空"
)
//
@NotBlank(message = "产品上架信息表唯一业务ID不能为空")
private
String
productLaunchBizId
;
/**
* 关联产品表唯一业务ID(上架的产品)
*/
@NotBlank
(
message
=
"关联产品表唯一业务ID不能为空"
)
//
@NotBlank(message = "关联产品表唯一业务ID不能为空")
private
String
productBizId
;
/**
...
...
yd-product-feign/src/main/java/com/yd/product/feign/request/productlaunch/ApiProductLaunchSaveRequest.java
View file @
285a9c18
...
...
@@ -6,14 +6,22 @@ import com.yd.product.feign.dto.ApiSpeciesSettingDto;
import
com.yd.product.feign.response.productlaunch.ApiAttributeSettingDto
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
@Data
public
class
ApiProductLaunchSaveRequest
{
/**
* 来源 1-复制 null-其他
*/
private
Integer
source
;
/**
* 产品上架主信息
*/
@NotEmpty
(
message
=
"产品上架主信息不能为空"
)
private
ApiProductLaunchDto
apiProductLaunchDto
;
/**
...
...
yd-product-feign/src/main/java/com/yd/product/feign/response/productlaunch/ApiProductLaunchCategoryAddResponse.java
View file @
285a9c18
...
...
@@ -6,6 +6,11 @@ import lombok.Data;
public
class
ApiProductLaunchCategoryAddResponse
{
/**
* 主键ID
*/
private
Long
id
;
/**
* 产品上架信息表唯一业务ID
*/
private
String
productLaunchBizId
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment