Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
order-group-application
order-group
Commits
23b82cf7
Commit
23b82cf7
authored
Jan 12, 2021
by
chongfu.liang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构
parent
310d40ea
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
523 additions
and
149 deletions
+523
-149
shopping-cart-application-service/pom.xml
+6
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/adapter/manager/ProductDTO2BOAdapter.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/demo/adapter/service/AddGoodsBOAdapter.java
+0
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/CartGoodsExtra.java
+17
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/McoffeeComboxGoodsBO.java
+82
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/McoffeeMaterialBO.java
+22
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/McoffeeProductBO.java
+55
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/PlatformComboxGoodsBO.java
+42
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/PlatformMaterialBO.java
+19
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/PlatformProductBO.java
+11
-5
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/ShoppingCartGoodsBO.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/add/BaseAddGoodsBO.java
+34
-31
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/add/MCoffeeAddGoodsBO.java
+5
-49
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/add/MallAddGoodsBO.java
+0
-4
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/add/PlatformAddGoodsBO.java
+37
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/dto/goods/add/AddGoodsRequestDTO.java
+15
-21
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/dto/goods/add/BaseAddGoodsVO.java
+109
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/dto/goods/add/MCoffeeAddGoodsVO.java
+23
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/dto/goods/add/MallAddGoodsVO.java
+0
-7
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/dto/goods/add/PlatformAddGoodsVO.java
+12
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/product/KgdProductServiceImpl.java
+4
-5
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/product/ProductManager.java
+3
-9
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/product/ProductService.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/AbstractAddGoodsService.java
+14
-4
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/MCoffeeAddGoodsService.java
+2
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/PlatformAddGoodsService.java
+2
-7
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ComboxGoodsRequestVo.java
+2
-0
No files found.
shopping-cart-application-service/pom.xml
View file @
23b82cf7
...
@@ -297,6 +297,12 @@
...
@@ -297,6 +297,12 @@
<artifactId>
apm-toolkit-logback-1.x
</artifactId>
<artifactId>
apm-toolkit-logback-1.x
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
ma.glasnost.orika
</groupId>
<artifactId>
orika-core
</artifactId>
<version>
1.5.2
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/adapter/manager/ProductDTO2BOAdapter.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
adapter
.
manager
;
package
cn
.
freemud
.
demo
.
adapter
.
manager
;
import
cn.freemud.demo.entities.bo.goods.ProductBO
;
import
cn.freemud.demo.entities.bo.goods.P
latformP
roductBO
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
@Component
@Component
public
class
ProductDTO2BOAdapter
{
public
class
ProductDTO2BOAdapter
{
public
ProductBO
convert2ProductBO
(
ProductBeanDTO
productBeanDTO
)
{
public
P
latformP
roductBO
convert2ProductBO
(
ProductBeanDTO
productBeanDTO
)
{
return
null
;
return
null
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/adapter/service/AddGoodsBOAdapter.java
View file @
23b82cf7
This diff is collapsed.
Click to expand it.
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/CartGoodsExtra.java
0 → 100644
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
;
import
lombok.Data
;
@Data
public
class
CartGoodsExtra
{
/**
* 属性Id
*/
private
String
attributeId
;
/**
* 属性名
*/
private
String
attributeName
;
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/McoffeeComboxGoodsBO.java
0 → 100644
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
;
import
cn.freemud.entities.vo.CartGoods
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
McoffeeComboxGoodsBO
{
/**
* 麦咖啡多规格商品spuid
*/
private
String
spuId
;
private
String
skuId
;
private
Integer
qty
;
private
String
goodsId
;
/**
* 商品组Id
*/
private
Long
productGroupId
;
/**
* 第三方商品编号
*/
private
String
customerCode
;
/**
* 购物车一行商品的名称
*/
private
String
name
;
/**
* 商品的spuName
*/
private
String
spuName
;
/**
* 商品的skuName
*/
private
String
skuName
;
/**
* 购物车一行商品的现单价
*/
private
Long
finalPrice
;
/**
* 购物车一行商品的原单机
*/
private
Long
originalPrice
;
/**
* 购物车一行商品的原价
*/
private
Long
originalAmount
;
/**
* 购物车一行商品的现价
*/
private
Long
amount
;
/**
* 麦咖啡空键位
*/
private
String
emptyKey
;
/**
* 商品额外的属性
*/
List
<
CartGoodsExtra
>
extra
;
/**
* 商品额外的属性
*/
List
<
CartGoodsExtra
>
specialExtra
;
/**
* 麦咖啡多规格商品加料
*/
private
List
<
McoffeeMaterialBO
>
productMaterialList
;
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/McoffeeMaterialBO.java
0 → 100644
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
;
import
lombok.Data
;
@Data
public
class
McoffeeMaterialBO
{
/**
* 加料商品ID
*/
private
String
spuId
;
/**
* 加料商品组ID
*/
private
String
groupId
;
/**
* 麦咖啡入机键位
*/
private
String
customerCode
;
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/McoffeeProductBO.java
0 → 100644
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
McoffeeProductBO
{
private
String
spuId
;
private
String
skuId
;
private
String
goodsId
;
private
String
nodeId
;
private
Integer
goodsType
;
/**
* 数量
*/
private
Integer
qty
;
/**
* 分类名
*/
private
String
categoryName
;
/**
* 商品额外的属性
*/
private
List
<
CartGoodsExtra
>
extra
;
/**
* 商品额外的属性
*/
List
<
CartGoodsExtra
>
specialExtra
;;
/**
* 套餐固定商品
*/
private
List
<
McoffeeComboxGoodsBO
>
productComboList
;
/**
* 套餐可选商品
*/
private
List
<
McoffeeComboxGoodsBO
>
productGroupList
;
/**
* 加料
*/
private
List
<
McoffeeMaterialBO
>
productMaterialList
;
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/PlatformComboxGoodsBO.java
0 → 100644
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.MaterialRequestVo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
PlatformComboxGoodsBO
{
/**
* 麦咖啡多规格商品spuid
*/
private
String
spuId
;
private
String
skuId
;
private
Integer
qty
;
private
String
goodsId
;
/**
* 商品组Id
*/
private
String
productGroupId
;
/**
* 麦咖啡空键位
*/
private
String
emptyKey
;
/**
* 商品额外的属性
*/
List
<
CartGoodsExtra
>
extra
;
/**
* 麦咖啡多规格商品加料
*/
private
List
<
PlatformMaterialBO
>
productMaterialList
;
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/PlatformMaterialBO.java
0 → 100644
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
;
import
lombok.Data
;
@Data
public
class
PlatformMaterialBO
{
/**
* 加料商品ID
*/
private
String
spuId
;
/**
* 加料商品组ID
*/
private
String
groupId
;
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/ProductBO.java
→
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/P
latformP
roductBO.java
View file @
23b82cf7
...
@@ -9,12 +9,18 @@ import org.hibernate.validator.constraints.NotEmpty;
...
@@ -9,12 +9,18 @@ import org.hibernate.validator.constraints.NotEmpty;
import
java.util.List
;
import
java.util.List
;
@Data
@Data
public
class
ProductBO
{
public
class
P
latformP
roductBO
{
private
String
spuId
;
private
String
spuId
;
private
String
skuId
;
private
String
skuId
;
private
String
goodsId
;
private
String
nodeId
;
private
Integer
goodsType
;
/**
/**
* 数量
* 数量
*/
*/
...
@@ -28,21 +34,21 @@ public class ProductBO {
...
@@ -28,21 +34,21 @@ public class ProductBO {
/**
/**
* 商品额外的属性
* 商品额外的属性
*/
*/
private
List
<
CartGoods
.
CartGoods
Extra
>
extra
;
private
List
<
CartGoodsExtra
>
extra
;
/**
/**
* 套餐固定商品
* 套餐固定商品
*/
*/
private
List
<
ComboxGoodsRequestVo
>
productComboList
;
private
List
<
PlatformComboxGoodsBO
>
productComboList
;
/**
/**
* 套餐可选商品
* 套餐可选商品
*/
*/
private
List
<
ComboxGoodsRequestVo
>
productGroupList
;
private
List
<
PlatformComboxGoodsBO
>
productGroupList
;
/**
/**
* 加料
* 加料
*/
*/
private
List
<
MaterialRequestVo
>
productMaterialList
;
private
List
<
PlatformMaterialBO
>
productMaterialList
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/ShoppingCartGoodsBO.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
;
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
;
import
lombok.Data
;
@Data
public
class
ShoppingCartGoodsBO
{
public
class
ShoppingCartGoodsBO
{
}
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/add/BaseAddGoodsBO.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
.
add
;
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
.
add
;
import
cn.freemud.demo.entities.ManagerServiceBO
;
import
cn.freemud.demo.entities.ManagerServiceBO
;
import
cn.freemud.demo.entities.bo.goods.ProductBO
;
import
cn.freemud.demo.entities.bo.goods.PlatformProductBO
;
import
cn.freemud.demo.entities.bo.goods.ShoppingCartGoodsBO
;
import
lombok.Data
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.NotEmpty
;
@Data
@Data
public
class
BaseAddGoodsBO
{
public
class
BaseAddGoodsBO
{
...
@@ -16,6 +16,20 @@ public class BaseAddGoodsBO {
...
@@ -16,6 +16,20 @@ public class BaseAddGoodsBO {
private
String
shopId
;
private
String
shopId
;
@NotEmpty
(
message
=
"spuId不能为空"
)
private
String
spuId
;
private
String
skuId
;
private
ManagerServiceBO
managerService
;
/**
* 微信appId
*/
@NotEmpty
(
message
=
"appId不能为空"
)
private
String
appId
;
/**
/**
* 收货地址ID、svc卡支付外卖订单必传
* 收货地址ID、svc卡支付外卖订单必传
*/
*/
...
@@ -31,41 +45,30 @@ public class BaseAddGoodsBO {
...
@@ -31,41 +45,30 @@ public class BaseAddGoodsBO {
*/
*/
private
String
couponCode
;
private
String
couponCode
;
private
ProductBO
addGoods
;
private
String
wxappid
;
private
ShoppingCartGoodsBO
oldShoppingCartGoods
;
private
ShoppingCartGoodsBO
newShoppingCartGoods
;
/**
* 下单类型 CreateOrderType 外卖、到店、商城
private
ManagerServiceBO
managerService
;
*/
private
Integer
orderType
;
@Data
public
final
static
class
Property
{
private
String
wxappid
;
/**
/**
* 下单类型 CreateOrderType 外卖、到店、商城
* 渠道类型 OrderChannelType
*/
*/
private
Integer
order
Type
;
private
String
channel
Type
;
/**
/**
* 渠道类型 OrderChannelType
* 购物车版本号(拼单)
*/
*/
private
String
channelType
;
private
Integer
carVer
;
/**
/**
* 购物车版本号(拼单)
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
*/
private
Integer
carVer
;
private
String
menuType
;
/**
private
String
tableNumber
;
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
private
String
menuType
;
private
String
tableNumber
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/add/MCoffeeAddGoodsBO.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
.
add
;
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
.
add
;
import
cn.freemud.demo.entities.bo.goods.McoffeeProductBO
;
import
cn.freemud.demo.entities.bo.goods.PlatformProductBO
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.ComboxGoodsRequestVo
;
import
cn.freemud.entities.vo.ComboxGoodsRequestVo
;
import
cn.freemud.entities.vo.MaterialRequestVo
;
import
cn.freemud.entities.vo.MaterialRequestVo
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.NotEmpty
;
import
org.hibernate.validator.constraints.NotEmpty
;
import
java.util.List
;
import
java.util.List
;
@Data
public
class
MCoffeeAddGoodsBO
extends
BaseAddGoodsBO
{
public
class
MCoffeeAddGoodsBO
extends
BaseAddGoodsBO
{
@NotEmpty
(
message
=
"sessionId不能为空"
)
private
McoffeeProductBO
addGoods
;
private
String
sessionId
;
/**
* 商户Id
*/
@NotEmpty
(
message
=
"partnerId不能为空"
)
private
String
partnerId
;
/**
* 微信appId
*/
@NotEmpty
(
message
=
"appId不能为空"
)
private
String
appId
;
/**
* 门店Id
* 商城没有门店id,如果需要门店id必传在业务中进行校验
*/
// @NotEmpty(message = "shopId不能为空")
private
String
shopId
;
/**
* 下单类型 CreateOrderType 外卖、到店、商城
*/
private
Integer
orderType
;
/**
* 渠道类型 OrderChannelType
*/
private
String
channelType
;
@NotEmpty
(
message
=
"spuId不能为空"
)
private
String
spuId
;
private
String
skuId
;
private
String
version
;
private
String
version
;
...
@@ -80,26 +51,11 @@ public class MCoffeeAddGoodsBO extends BaseAddGoodsBO {
...
@@ -80,26 +51,11 @@ public class MCoffeeAddGoodsBO extends BaseAddGoodsBO {
private
String
appType
;
private
String
appType
;
private
String
tableNumber
;
/**
/**
* 数量
* 数量
*/
*/
private
Integer
qty
;
private
Integer
qty
;
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
private
String
menuType
;
/**
* 收货地址ID、svc卡支付外卖订单必传
*/
private
String
receiveId
;
/**
* 操作类型 1= 添加商品券 2=加价购
*/
private
Integer
operationType
;
/**
/**
* 券类型 0:商品券
* 券类型 0:商品券
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/add/MallAddGoodsBO.java
deleted
100644 → 0
View file @
310d40ea
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
.
add
;
public
class
MallAddGoodsBO
extends
BaseAddGoodsBO
{
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/goods/add/PlatformAddGoodsBO.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
.
add
;
package
cn
.
freemud
.
demo
.
entities
.
bo
.
goods
.
add
;
import
cn.freemud.demo.entities.bo.goods.McoffeeProductBO
;
import
cn.freemud.demo.entities.bo.goods.PlatformProductBO
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.ComboxGoodsRequestVo
;
import
cn.freemud.entities.vo.ComboxGoodsRequestVo
;
import
cn.freemud.entities.vo.MaterialRequestVo
;
import
cn.freemud.entities.vo.MaterialRequestVo
;
...
@@ -11,6 +13,40 @@ import java.util.List;
...
@@ -11,6 +13,40 @@ import java.util.List;
@Data
@Data
public
class
PlatformAddGoodsBO
extends
BaseAddGoodsBO
{
public
class
PlatformAddGoodsBO
extends
BaseAddGoodsBO
{
private
PlatformProductBO
addGoods
;
private
String
version
;
/**
* 数量
*/
private
Integer
qty
;
/**
* 1.6.0 版本增加 节点ID
*/
private
String
nodeId
;
/**
* 1.6.0 版本增加 分类名
*/
private
String
categoryName
;
/**
* 商品额外的属性
*/
private
List
<
CartGoods
.
CartGoodsExtra
>
extra
;
/**
* 套餐固定商品
*/
private
List
<
ComboxGoodsRequestVo
>
productComboList
;
/**
* 套餐可选商品
*/
private
List
<
ComboxGoodsRequestVo
>
productGroupList
;
/**
* 加料
*/
private
List
<
MaterialRequestVo
>
productMaterialList
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/dto/goods/add/AddGoodsRequestDTO.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
dto
.
goods
.
add
;
package
cn
.
freemud
.
demo
.
entities
.
dto
.
goods
.
add
;
import
cn.freemud.demo.entities.bo.goods.CartGoodsExtra
;
import
cn.freemud.demo.entities.dto.BaseRequestDTO
;
import
cn.freemud.demo.entities.dto.BaseRequestDTO
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.ComboxGoodsRequestVo
;
import
cn.freemud.entities.vo.ComboxGoodsRequestVo
;
...
@@ -13,16 +14,6 @@ import java.util.List;
...
@@ -13,16 +14,6 @@ import java.util.List;
public
class
AddGoodsRequestDTO
extends
BaseRequestDTO
{
public
class
AddGoodsRequestDTO
extends
BaseRequestDTO
{
/**
/**
* 拼单发起人userId(拼单)
*/
private
String
createCollageUserId
;
/**
* 购物车版本号(拼单)
*/
private
Integer
carVer
;
/**
* 微信appId
* 微信appId
*/
*/
@NotEmpty
(
message
=
"appId不能为空"
)
@NotEmpty
(
message
=
"appId不能为空"
)
...
@@ -35,19 +26,9 @@ public class AddGoodsRequestDTO extends BaseRequestDTO {
...
@@ -35,19 +26,9 @@ public class AddGoodsRequestDTO extends BaseRequestDTO {
/**
/**
* 商品额外的属性
* 商品额外的属性
*/
*/
private
List
<
CartGoods
.
CartGoodsExtra
>
extra
;
private
List
<
CartGoodsExtra
>
extra
;
private
String
version
;
/**
/**
* 1.6.0 版本增加 节点ID
*/
private
String
nodeId
;
/**
* 1.6.0 版本增加 分类名
*/
private
String
categoryName
;
/**
* 套餐固定商品
* 套餐固定商品
*/
*/
private
List
<
ComboxGoodsRequestVo
>
productComboList
;
private
List
<
ComboxGoodsRequestVo
>
productComboList
;
...
@@ -60,6 +41,19 @@ public class AddGoodsRequestDTO extends BaseRequestDTO {
...
@@ -60,6 +41,19 @@ public class AddGoodsRequestDTO extends BaseRequestDTO {
* 加料
* 加料
*/
*/
private
List
<
MaterialRequestVo
>
productMaterialList
;
private
List
<
MaterialRequestVo
>
productMaterialList
;
private
String
version
;
/**
* 1.6.0 版本增加 节点ID
*/
private
String
nodeId
;
/**
* 1.6.0 版本增加 分类名
*/
private
String
categoryName
;
private
String
appType
;
private
String
appType
;
private
String
tableNumber
;
private
String
tableNumber
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/dto/goods/add/BaseAddGoodsVO.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
dto
.
goods
.
add
;
package
cn
.
freemud
.
demo
.
entities
.
dto
.
goods
.
add
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.ComboxGoodsRequestVo
;
import
cn.freemud.entities.vo.MaterialRequestVo
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.NotEmpty
;
import
java.util.List
;
@Data
public
class
BaseAddGoodsVO
{
public
class
BaseAddGoodsVO
{
@NotEmpty
(
message
=
"sessionId不能为空"
)
private
String
sessionId
;
/**
* 商户Id
*/
@NotEmpty
(
message
=
"partnerId不能为空"
)
private
String
partnerId
;
/**
* 微信appId
*/
@NotEmpty
(
message
=
"appId不能为空"
)
private
String
appId
;
@NotEmpty
(
message
=
"spuId不能为空"
)
private
String
spuId
;
private
String
skuId
;
/**
* 商品额外的属性
*/
private
List
<
CartGoods
.
CartGoodsExtra
>
extra
;
private
String
version
;
/**
* 1.6.0 版本增加 节点ID
*/
private
String
nodeId
;
/**
* 1.6.0 版本增加 分类名
*/
private
String
categoryName
;
/**
* 套餐固定商品
*/
private
List
<
ComboxGoodsRequestVo
>
productComboList
;
/**
* 套餐可选商品
*/
private
List
<
ComboxGoodsRequestVo
>
productGroupList
;
/**
* 加料
*/
private
List
<
MaterialRequestVo
>
productMaterialList
;
/**
* 门店Id
* 商城没有门店id,如果需要门店id必传在业务中进行校验
*/
//@NotEmpty(message = "shopId不能为空")
private
String
shopId
;
/**
* 下单类型 CreateOrderType 外卖、到店、商城
*/
private
Integer
orderType
;
/**
* 渠道类型 OrderChannelType
*/
private
String
channelType
;
private
String
appType
;
private
String
tableNumber
;
/**
* 数量
*/
private
Integer
qty
;
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
private
String
menuType
;
/**
* 收货地址ID、svc卡支付外卖订单必传
*/
private
String
receiveId
;
/**
* 操作类型 1= 添加商品券 2=加价购
*/
private
Integer
operationType
;
/**
* 优惠券号
*/
private
String
couponCode
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/dto/goods/add/MCoffeeAddGoodsVO.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
dto
.
goods
.
add
;
package
cn
.
freemud
.
demo
.
entities
.
dto
.
goods
.
add
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.ComboxGoodsRequestVo
;
import
cn.freemud.entities.vo.MaterialRequestVo
;
import
lombok.Data
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.NotEmpty
;
import
java.util.List
;
@Data
@Data
public
class
MCoffeeAddGoodsVO
extends
BaseAddGoodsVO
{
public
class
MCoffeeAddGoodsVO
extends
BaseAddGoodsVO
{
/**
* 麦咖啡定制属性
*/
private
List
<
CartGoods
.
SpecialExtra
>
specialExtra
;
/**
* 券类型 0:商品券
*/
private
Integer
couponType
;
/**
* 套餐名称
*/
private
String
groupName
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/dto/goods/add/MallAddGoodsVO.java
deleted
100644 → 0
View file @
310d40ea
package
cn
.
freemud
.
demo
.
entities
.
dto
.
goods
.
add
;
public
class
MallAddGoodsVO
extends
BaseAddGoodsVO
{
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/dto/goods/add/PlatformAddGoodsVO.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
entities
.
dto
.
goods
.
add
;
package
cn
.
freemud
.
demo
.
entities
.
dto
.
goods
.
add
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.ComboxGoodsRequestVo
;
import
cn.freemud.entities.vo.MaterialRequestVo
;
import
lombok.Data
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.NotEmpty
;
import
java.util.List
;
@Data
@Data
public
class
PlatformAddGoodsVO
extends
BaseAddGoodsVO
{
public
class
PlatformAddGoodsVO
extends
BaseAddGoodsVO
{
}
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/product/KgdProductServiceImpl.java
View file @
23b82cf7
...
@@ -2,9 +2,8 @@ package cn.freemud.demo.manager.product;
...
@@ -2,9 +2,8 @@ package cn.freemud.demo.manager.product;
import
cn.freemud.demo.adapter.manager.ProductDTO2BOAdapter
;
import
cn.freemud.demo.adapter.manager.ProductDTO2BOAdapter
;
import
cn.freemud.demo.entities.bo.goods.GetProductBO
;
import
cn.freemud.demo.entities.bo.goods.GetProductBO
;
import
cn.freemud.demo.entities.bo.goods.ProductBO
;
import
cn.freemud.demo.entities.bo.goods.P
latformP
roductBO
;
import
cn.freemud.service.impl.AssortmentSdkService
;
import
cn.freemud.service.impl.AssortmentSdkService
;
import
cn.freemud.service.thirdparty.CustomerApplicationClient
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -23,15 +22,15 @@ public class KgdProductServiceImpl implements ProductService {
...
@@ -23,15 +22,15 @@ public class KgdProductServiceImpl implements ProductService {
private
ProductDTO2BOAdapter
productDTO2BOAdapter
;
private
ProductDTO2BOAdapter
productDTO2BOAdapter
;
@Override
@Override
public
ProductBO
getProductInfo
(
GetProductBO
getProductBO
)
{
public
P
latformP
roductBO
getProductInfo
(
GetProductBO
getProductBO
)
{
// 获取添加商品的详细信息
// 获取添加商品的详细信息
List
<
ProductBeanDTO
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfoSdk
(
getProductBO
.
getPartnerId
(),
List
<
ProductBeanDTO
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfoSdk
(
getProductBO
.
getPartnerId
(),
getProductBO
.
getStoreId
(),
Collections
.
singletonList
(
getProductBO
.
getSkuid
()),
getProductBO
.
getMenuType
(),
null
);
getProductBO
.
getStoreId
(),
Collections
.
singletonList
(
getProductBO
.
getSkuid
()),
getProductBO
.
getMenuType
(),
null
);
ProductBeanDTO
productBeanDTO
=
productBeanListSpuClass
.
get
(
0
);
ProductBeanDTO
productBeanDTO
=
productBeanListSpuClass
.
get
(
0
);
P
roductBO
p
roductBO
=
productDTO2BOAdapter
.
convert2ProductBO
(
productBeanDTO
);
P
latformProductBO
platformP
roductBO
=
productDTO2BOAdapter
.
convert2ProductBO
(
productBeanDTO
);
return
productBO
;
return
p
latformP
roductBO
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/product/ProductManager.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
manager
.
product
;
package
cn
.
freemud
.
demo
.
manager
.
product
;
import
cn.freemud.demo.entities.bo.goods.GetProductBO
;
import
cn.freemud.demo.entities.bo.goods.GetProductBO
;
import
cn.freemud.demo.entities.bo.goods.ProductBO
;
import
cn.freemud.demo.entities.bo.goods.PlatformProductBO
;
import
cn.freemud.service.impl.AssortmentSdkService
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Collections
;
import
java.util.List
;
@Service
@Service
public
class
ProductManager
{
public
class
ProductManager
{
...
@@ -17,9 +11,9 @@ public class ProductManager {
...
@@ -17,9 +11,9 @@ public class ProductManager {
*
*
* @return
* @return
*/
*/
public
ProductBO
getProductsInfo
(
GetProductBO
getProductBO
,
ProductService
productService
){
public
P
latformP
roductBO
getProductsInfo
(
GetProductBO
getProductBO
,
ProductService
productService
){
ProductBO
productInfo
=
productService
.
getProductInfo
(
getProductBO
);
P
latformP
roductBO
productInfo
=
productService
.
getProductInfo
(
getProductBO
);
return
productInfo
;
return
productInfo
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/manager/product/ProductService.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
manager
.
product
;
package
cn
.
freemud
.
demo
.
manager
.
product
;
import
cn.freemud.demo.entities.bo.goods.GetProductBO
;
import
cn.freemud.demo.entities.bo.goods.GetProductBO
;
import
cn.freemud.demo.entities.bo.goods.ProductBO
;
import
cn.freemud.demo.entities.bo.goods.P
latformP
roductBO
;
public
interface
ProductService
{
public
interface
ProductService
{
ProductBO
getProductInfo
(
GetProductBO
getProductBO
);
P
latformP
roductBO
getProductInfo
(
GetProductBO
getProductBO
);
}
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/AbstractAddGoodsService.java
View file @
23b82cf7
...
@@ -4,7 +4,6 @@ import cn.freemud.base.entity.BaseResponse;
...
@@ -4,7 +4,6 @@ import cn.freemud.base.entity.BaseResponse;
import
cn.freemud.demo.constant.ResponseConstant
;
import
cn.freemud.demo.constant.ResponseConstant
;
import
cn.freemud.demo.entities.*
;
import
cn.freemud.demo.entities.*
;
import
cn.freemud.demo.entities.bo.goods.GetProductBO
;
import
cn.freemud.demo.entities.bo.goods.GetProductBO
;
import
cn.freemud.demo.entities.bo.goods.ProductBO
;
import
cn.freemud.demo.entities.bo.goods.add.BaseAddGoodsBO
;
import
cn.freemud.demo.entities.bo.goods.add.BaseAddGoodsBO
;
import
cn.freemud.demo.manager.product.ProductManager
;
import
cn.freemud.demo.manager.product.ProductManager
;
import
cn.freemud.demo.manager.customer.CustomerManager
;
import
cn.freemud.demo.manager.customer.CustomerManager
;
...
@@ -104,15 +103,26 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -104,15 +103,26 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
baseRequestBO
.
setUserId
(
userId
);
baseRequestBO
.
setUserId
(
userId
);
GetProductBO
getProductBO
=
new
GetProductBO
();
GetProductBO
getProductBO
=
convert2ProductBO
(
baseRequestBO
);
ProductBO
productBO
=
productManager
.
getProductsInfo
(
getProductBO
,
baseRequestBO
.
getManagerService
().
getProductService
());
productManager
.
getProductsInfo
(
getProductBO
,
baseRequestBO
.
getManagerService
().
getProductService
());
baseRequestBO
.
setAddGoods
(
productBO
);
return
bo
;
return
bo
;
}
}
private
GetProductBO
convert2ProductBO
(
BaseAddGoodsBO
baseRequestBO
)
{
GetProductBO
getProductBO
=
new
GetProductBO
();
getProductBO
.
setMenuType
(
baseRequestBO
.
getMenuType
());
getProductBO
.
setPartnerId
(
baseRequestBO
.
getPartnerId
());
getProductBO
.
setSkuid
(
baseRequestBO
.
getSkuId
());
getProductBO
.
setSpuid
(
baseRequestBO
.
getSpuId
());
getProductBO
.
setStoreId
(
baseRequestBO
.
getShopId
());
return
getProductBO
;
}
/**
/**
* 具体业务逻辑校验, 例如商品数量,库存等校验
* 具体业务逻辑校验, 例如商品数量,库存等校验
*
*
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/MCoffeeAddGoodsService.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
service
;
package
cn
.
freemud
.
demo
.
service
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.demo.entities.ResponseBuilder
;
import
cn.freemud.demo.entities.bo.goods.add.BaseAddGoodsBO
;
import
cn.freemud.demo.entities.bo.goods.add.BaseAddGoodsBO
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.interceptor.ServiceException
;
...
@@ -17,7 +18,7 @@ public class MCoffeeAddGoodsService extends AbstractAddGoodsService {
...
@@ -17,7 +18,7 @@ public class MCoffeeAddGoodsService extends AbstractAddGoodsService {
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_SHOP_ID_NOT_EMPTY
);
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_SHOP_ID_NOT_EMPTY
);
}
}
return
this
.
checkCustomParams
(
baseRequestDTO
);
return
ResponseBuilder
.
success
(
);
}
}
}
}
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/PlatformAddGoodsService.java
View file @
23b82cf7
package
cn
.
freemud
.
demo
.
service
;
package
cn
.
freemud
.
demo
.
service
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.demo.entities.ResponseBuilder
;
import
cn.freemud.demo.entities.bo.goods.add.BaseAddGoodsBO
;
import
cn.freemud.demo.entities.bo.goods.add.BaseAddGoodsBO
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.interceptor.ServiceException
;
...
@@ -17,13 +18,7 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService {
...
@@ -17,13 +18,7 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService {
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_SHOP_ID_NOT_EMPTY
);
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_SHOP_ID_NOT_EMPTY
);
}
}
return
null
;
return
ResponseBuilder
.
success
()
;
}
}
@Override
public
BaseResponse
checkCustomBusinessRules
(
BaseAddGoodsBO
baseRequestDTO
)
{
return
null
;
}
}
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ComboxGoodsRequestVo.java
View file @
23b82cf7
...
@@ -26,6 +26,8 @@ public class ComboxGoodsRequestVo {
...
@@ -26,6 +26,8 @@ public class ComboxGoodsRequestVo {
private
String
skuId
;
private
String
skuId
;
private
Integer
qty
;
private
Integer
qty
;
private
String
goodsId
;
/**
/**
* 商品组Id
* 商品组Id
*/
*/
...
...
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