Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
adc0eb3d
Commit
adc0eb3d
authored
Aug 09, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单V值规则触发
parent
a1e8bcbe
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
351 additions
and
87 deletions
+351
-87
OrderVStrategy.java
.../module/member/mq/consumer/score/core/OrderVStrategy.java
+182
-82
OrderApi.java
.../main/java/cn/iocoder/boot/module/order/api/OrderApi.java
+7
-0
OrderConsigneeApiDO.java
...ocoder/boot/module/order/api/dto/OrderConsigneeApiDO.java
+103
-0
OrderItemRespDTO.java
...n/iocoder/boot/module/order/api/dto/OrderItemRespDTO.java
+18
-0
OrderRespDTO.java
...va/cn/iocoder/boot/module/order/api/dto/OrderRespDTO.java
+5
-0
OrderApiImpl.java
.../java/cn/iocoder/yudao/module/order/api/OrderApiImpl.java
+36
-5
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/mq/consumer/score/core/OrderVStrategy.java
View file @
adc0eb3d
This diff is collapsed.
Click to expand it.
yudao-module-order/yudao-module-order-api/src/main/java/cn/iocoder/boot/module/order/api/OrderApi.java
View file @
adc0eb3d
package
cn
.
iocoder
.
boot
.
module
.
order
.
api
;
import
cn.iocoder.boot.module.order.api.dto.OrderItemRespDTO
;
import
cn.iocoder.boot.module.order.api.dto.OrderRespDTO
;
import
java.util.List
;
/**
* 订单 api
*/
...
...
@@ -14,4 +17,8 @@ public interface OrderApi {
* 判断是否用户首单
*/
boolean
isFirstOrder
(
Long
userId
);
/**
* 根据订单id获取所有订单项
*/
List
<
OrderItemRespDTO
>
getOrderItemsByOrderId
(
Long
orderId
);
}
yudao-module-order/yudao-module-order-api/src/main/java/cn/iocoder/boot/module/order/api/dto/OrderConsigneeApiDO.java
0 → 100644
View file @
adc0eb3d
package
cn
.
iocoder
.
boot
.
module
.
order
.
api
.
dto
;
import
cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.*
;
import
org.apache.commons.lang3.StringUtils
;
/**
* 订单收货人信息 DO
*
* @author 系统管理员
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
public
class
OrderConsigneeApiDO
extends
BaseDO
{
/**
* 主键ID
*/
@TableId
private
Long
id
;
/**
* 下单用户id
*/
private
Long
relationId
;
/**
* 订单id
*/
private
Long
orderId
;
/**
* 收货人姓名
*/
private
String
name
;
/**
* 收货人姓名(英文)
*/
private
String
nameEn
;
/**
* 手机
*/
private
String
phone
;
/**
* 邮箱
*/
private
String
email
;
/**
* 公司
*/
private
String
company
;
/**
* 公司(英文)
*/
private
String
companyEn
;
@ApiModelProperty
(
value
=
"收获方式:1 自提 2 送货上门 "
)
private
Integer
harvestMethod
;
@ApiModelProperty
(
value
=
"送货时间"
,
required
=
true
)
private
String
deliveryDate
;
/**
* 地址
*/
private
String
address
;
@ApiModelProperty
(
value
=
"国家"
)
private
Long
country
;
@ApiModelProperty
(
value
=
"省"
)
private
Long
province
;
@ApiModelProperty
(
value
=
"市"
)
private
Long
city
;
/**
* 国家简称
*/
private
String
countryAbbreviation
;
/**
* 国家区号
*/
private
String
countryCode
;
/**
* 客户id
*/
private
Long
customerId
;
/**
* 客户联系人id
*/
private
Long
customerContactsId
;
public
void
setCountryCode
(
String
countryCode
)
{
if
(
StringUtils
.
isNotBlank
(
countryCode
))
{
this
.
countryCode
=
countryCode
.
replace
(
"+"
,
""
);
}
else
{
this
.
countryCode
=
countryCode
;
}
}
}
yudao-module-order/yudao-module-order-api/src/main/java/cn/iocoder/boot/module/order/api/dto/OrderItemRespDTO.java
0 → 100644
View file @
adc0eb3d
package
cn
.
iocoder
.
boot
.
module
.
order
.
api
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.math.BigDecimal
;
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
OrderItemRespDTO
{
@ApiModelProperty
(
value
=
"收费重量"
)
private
BigDecimal
chargeWeight
;
@ApiModelProperty
(
value
=
"收费体积"
)
private
BigDecimal
chargeVolume
;
}
yudao-module-order/yudao-module-order-api/src/main/java/cn/iocoder/boot/module/order/api/dto/OrderRespDTO.java
View file @
adc0eb3d
...
...
@@ -278,6 +278,11 @@ public class OrderRespDTO {
@NotNull
(
message
=
"目的地信息不能为空"
)
private
OrderObjectiveApiDO
orderObjectiveDO
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"收货人信息"
)
@NotNull
(
message
=
"收货人信息不能为空"
)
private
OrderConsigneeApiDO
orderConsigneeDO
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"目的地ID"
)
private
Long
objectiveId
;
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/api/OrderApiImpl.java
View file @
adc0eb3d
package
cn
.
iocoder
.
yudao
.
module
.
order
.
api
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.iocoder.boot.module.order.api.OrderApi
;
import
cn.iocoder.boot.module.order.api.dto.OrderConsigneeApiDO
;
import
cn.iocoder.boot.module.order.api.dto.OrderItemRespDTO
;
import
cn.iocoder.boot.module.order.api.dto.OrderObjectiveApiDO
;
import
cn.iocoder.boot.module.order.api.dto.OrderRespDTO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderConsignee.OrderConsigneeDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderObjective.OrderObjectiveDO
;
import
cn.iocoder.yudao.module.order.service.order.OrderConsigneeService
;
import
cn.iocoder.yudao.module.order.service.order.OrderObjectiveService
;
import
cn.iocoder.yudao.module.order.service.order.OrderService
;
import
cn.iocoder.yudao.module.order.service.order.impl.OrderItemServiceImpl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.annotation.Validated
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
@Validated
...
...
@@ -21,6 +30,10 @@ public class OrderApiImpl implements OrderApi {
private
OrderService
orderService
;
@Resource
private
OrderObjectiveService
objectiveService
;
@Resource
private
OrderConsigneeService
orderConsigneeService
;
@Resource
private
OrderItemServiceImpl
orderItemService
;
@Override
public
OrderRespDTO
getOrder
(
Long
id
,
String
orderNo
)
{
...
...
@@ -36,13 +49,22 @@ public class OrderApiImpl implements OrderApi {
OrderRespDTO
orderRespDTO
=
new
OrderRespDTO
();
BeanUtils
.
copyProperties
(
orderDO
,
orderRespDTO
);
// 设置目的地信息
OrderObjectiveDO
orderObjectiveDO
=
objectiveService
.
getByOrderId
(
id
);
if
(
orderObjectiveDO
==
null
)
{
return
orderRespDTO
;
if
(
orderObjectiveDO
!=
null
)
{
OrderObjectiveApiDO
orderObjectiveApiDO
=
new
OrderObjectiveApiDO
();
BeanUtils
.
copyProperties
(
orderObjectiveDO
,
orderObjectiveApiDO
);
orderRespDTO
.
setOrderObjectiveDO
(
orderObjectiveApiDO
);
}
OrderObjectiveApiDO
orderObjectiveApiDO
=
new
OrderObjectiveApiDO
();
BeanUtils
.
copyProperties
(
orderObjectiveDO
,
orderObjectiveApiDO
);
orderRespDTO
.
setOrderObjectiveDO
(
orderObjectiveApiDO
);
// 设置收货人信息
OrderConsigneeDO
orderConsigneeByOrderId
=
orderConsigneeService
.
getOrderConsigneeByOrderId
(
id
);
if
(
orderConsigneeByOrderId
!=
null
)
{
OrderConsigneeApiDO
orderConsigneeApiDO
=
new
OrderConsigneeApiDO
();
BeanUtils
.
copyProperties
(
orderConsigneeByOrderId
,
orderConsigneeApiDO
);
orderRespDTO
.
setOrderConsigneeDO
(
orderConsigneeApiDO
);
}
return
orderRespDTO
;
}
...
...
@@ -51,4 +73,13 @@ public class OrderApiImpl implements OrderApi {
Long
count
=
orderService
.
selectCount
(
new
LambdaQueryWrapper
<
OrderDO
>().
eq
(
OrderDO:
:
getUserId
,
userId
));
return
count
<=
0
;
}
@Override
public
List
<
OrderItemRespDTO
>
getOrderItemsByOrderId
(
Long
orderId
)
{
List
<
OrderItemDO
>
orderItemDOS
=
orderItemService
.
selectList
(
"order_id"
,
orderId
);
if
(
CollectionUtil
.
isNotEmpty
(
orderItemDOS
))
{
return
orderItemDOS
.
stream
().
map
(
orderItemDO
->
new
OrderItemRespDTO
(
orderItemDO
.
getChargeWeight
(),
orderItemDO
.
getChargeVolume
())).
collect
(
Collectors
.
toList
());
}
return
null
;
}
}
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