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
03a7d578
Commit
03a7d578
authored
Aug 12, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/feature_member_score' into dev
parents
3e7053ff
a7340da0
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
402 additions
and
103 deletions
+402
-103
AppUserController.java
.../module/member/controller/app/user/AppUserController.java
+31
-0
AppUserInfoRespVO.java
...dule/member/controller/app/user/vo/AppUserInfoRespVO.java
+11
-0
ScoreRuleRedisDao.java
.../module/member/dal/redis/scoreRule/ScoreRuleRedisDao.java
+2
-1
OrderVStrategy.java
.../module/member/mq/consumer/score/core/OrderVStrategy.java
+182
-82
ScoreRuleServiceImpl.java
...module/member/service/scoreRule/ScoreRuleServiceImpl.java
+7
-15
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/controller/app/user/AppUserController.java
View file @
03a7d578
...
@@ -10,9 +10,12 @@ import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
...
@@ -10,9 +10,12 @@ import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO
;
import
cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService
;
import
cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService
;
import
cn.iocoder.yudao.module.ecw.api.paramValid.ParamValidatorApi
;
import
cn.iocoder.yudao.module.ecw.api.paramValid.ParamValidatorApi
;
import
cn.iocoder.yudao.module.ecw.dal.dataobject.region.RegionDO
;
import
cn.iocoder.yudao.module.ecw.service.internalMessage.InternalMessageService
;
import
cn.iocoder.yudao.module.ecw.service.internalMessage.InternalMessageService
;
import
cn.iocoder.yudao.module.ecw.service.internalMessage.WebInternalMessageService
;
import
cn.iocoder.yudao.module.ecw.service.internalMessage.WebInternalMessageService
;
import
cn.iocoder.yudao.module.ecw.service.region.RegionService
;
import
cn.iocoder.yudao.module.member.controller.app.auth.vo.AppEmailUpdateReqVO
;
import
cn.iocoder.yudao.module.member.controller.app.auth.vo.AppEmailUpdateReqVO
;
import
cn.iocoder.yudao.module.member.service.level.MemberUserLevelConfigService
;
import
cn.iocoder.yudao.module.member.vo.member.MemberUpdateReqVO
;
import
cn.iocoder.yudao.module.member.vo.member.MemberUpdateReqVO
;
import
cn.iocoder.yudao.module.member.controller.app.user.vo.*
;
import
cn.iocoder.yudao.module.member.controller.app.user.vo.*
;
import
cn.iocoder.yudao.module.member.convert.user.UserConvert
;
import
cn.iocoder.yudao.module.member.convert.user.UserConvert
;
...
@@ -35,6 +38,8 @@ import cn.iocoder.yudao.module.member.vo.userEnterprise.UserEnterpriseCreateReqV
...
@@ -35,6 +38,8 @@ import cn.iocoder.yudao.module.member.vo.userEnterprise.UserEnterpriseCreateReqV
import
cn.iocoder.yudao.module.member.vo.userEnterprise.UserEnterpriseUpdateReqVO
;
import
cn.iocoder.yudao.module.member.vo.userEnterprise.UserEnterpriseUpdateReqVO
;
import
cn.iocoder.yudao.module.member.vo.userEnterpriseAuth.UserEnterpriseAuthBackVO
;
import
cn.iocoder.yudao.module.member.vo.userEnterpriseAuth.UserEnterpriseAuthBackVO
;
import
cn.iocoder.yudao.module.member.vo.userEnterpriseAuth.UserEnterpriseAuthCreateReqVO
;
import
cn.iocoder.yudao.module.member.vo.userEnterpriseAuth.UserEnterpriseAuthCreateReqVO
;
import
cn.iocoder.yudao.module.member.vo.userLevel.MemberUserLevelConfigBaseRespVO
;
import
cn.iocoder.yudao.module.member.vo.userLevel.MemberUserScoreLevelVO
;
import
cn.iocoder.yudao.module.product.service.coupon.CouponService
;
import
cn.iocoder.yudao.module.product.service.coupon.CouponService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -98,6 +103,12 @@ public class AppUserController {
...
@@ -98,6 +103,12 @@ public class AppUserController {
@Resource
@Resource
private
PasswordEncoder
passwordEncoder
;
private
PasswordEncoder
passwordEncoder
;
@Resource
private
MemberUserLevelConfigService
memberUserLevelConfigService
;
@Resource
private
RegionService
regionService
;
@PutMapping
(
"/update-nickname"
)
@PutMapping
(
"/update-nickname"
)
@ApiOperation
(
"修改用户昵称"
)
@ApiOperation
(
"修改用户昵称"
)
...
@@ -146,6 +157,26 @@ public class AppUserController {
...
@@ -146,6 +157,26 @@ public class AppUserController {
if
(
passwordEncoder
.
matches
(
"88888888"
,
user
.
getPassword
()))
{
if
(
passwordEncoder
.
matches
(
"88888888"
,
user
.
getPassword
()))
{
respVO
.
setIsSimplePassword
(
Boolean
.
TRUE
);
respVO
.
setIsSimplePassword
(
Boolean
.
TRUE
);
}
}
MemberUserLevelConfigBaseRespVO
userScoreLevelVO
=
memberUserLevelConfigService
.
getLevelByCount
(
user
.
getTotalScore
());
MemberUserScoreLevelVO
scoreLevelVO
=
MemberUserScoreLevelVO
.
builder
().
memberId
(
user
.
getId
())
.
memberCode
(
user
.
getMemberCode
())
.
holdScore
(
user
.
getHoldScore
())
.
expiredScore
(
user
.
getExpiredScore
())
.
usedScore
(
user
.
getUsedScore
())
.
levelIcon
(
userScoreLevelVO
.
getIcon
())
.
levelName
(
userScoreLevelVO
.
getName
())
.
build
();
respVO
.
setUserScoreLevelInfo
(
scoreLevelVO
);
if
(
user
.
getCountry
()
!=
null
)
{
RegionDO
region
=
regionService
.
getRegion
(
Long
.
valueOf
(
user
.
getCountry
()));
respVO
.
setCountryTitleEn
(
region
.
getTitleEn
());
respVO
.
setCountryTitleZh
(
region
.
getTitleZh
());
}
if
(
user
.
getCity
()
!=
null
)
{
RegionDO
region
=
regionService
.
getRegion
(
Long
.
valueOf
(
user
.
getCity
()));
respVO
.
setCityTitleEn
(
region
.
getTitleEn
());
respVO
.
setCityTitleZh
(
region
.
getTitleZh
());
}
return
success
(
respVO
);
return
success
(
respVO
);
}
}
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserInfoRespVO.java
View file @
03a7d578
package
cn
.
iocoder
.
yudao
.
module
.
member
.
controller
.
app
.
user
.
vo
;
package
cn
.
iocoder
.
yudao
.
module
.
member
.
controller
.
app
.
user
.
vo
;
import
cn.iocoder.yudao.module.member.vo.userLevel.MemberUserScoreLevelVO
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -67,4 +68,14 @@ public class AppUserInfoRespVO {
...
@@ -67,4 +68,14 @@ public class AppUserInfoRespVO {
@ApiModelProperty
(
value
=
"是否简单密码"
,
example
=
"false"
)
@ApiModelProperty
(
value
=
"是否简单密码"
,
example
=
"false"
)
private
Boolean
isSimplePassword
=
Boolean
.
FALSE
;
private
Boolean
isSimplePassword
=
Boolean
.
FALSE
;
@ApiModelProperty
(
value
=
"会员积分信息"
)
private
MemberUserScoreLevelVO
userScoreLevelInfo
;
@ApiModelProperty
(
value
=
"会员国家中文"
)
private
String
countryTitleZh
;
@ApiModelProperty
(
value
=
"会员国家英文"
)
private
String
countryTitleEn
;
@ApiModelProperty
(
value
=
"会员城市中文"
)
private
String
cityTitleZh
;
@ApiModelProperty
(
value
=
"会员国家英文"
)
private
String
cityTitleEn
;
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/redis/scoreRule/ScoreRuleRedisDao.java
View file @
03a7d578
...
@@ -10,6 +10,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
...
@@ -10,6 +10,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.concurrent.TimeUnit
;
/**
/**
* 会员积分规则 Redis DAO
* 会员积分规则 Redis DAO
...
@@ -57,7 +58,7 @@ public class ScoreRuleRedisDao {
...
@@ -57,7 +58,7 @@ public class ScoreRuleRedisDao {
ScoreRuleOrderVExtraVO
scoreRuleOrderVExtraVO
=
JsonUtils
.
parseObject
(
scoreRuleDO
.
getExtra
(),
ScoreRuleOrderVExtraVO
.
class
);
ScoreRuleOrderVExtraVO
scoreRuleOrderVExtraVO
=
JsonUtils
.
parseObject
(
scoreRuleDO
.
getExtra
(),
ScoreRuleOrderVExtraVO
.
class
);
stringRedisTemplate
.
opsForValue
().
set
(
formatKey
(
scoreRuleDO
.
getType
(),
scoreRuleOrderVExtraVO
.
getTransportType
()),
JsonUtils
.
toJsonString
(
scoreRuleDO
));
stringRedisTemplate
.
opsForValue
().
set
(
formatKey
(
scoreRuleDO
.
getType
(),
scoreRuleOrderVExtraVO
.
getTransportType
()),
JsonUtils
.
toJsonString
(
scoreRuleDO
));
}
}
stringRedisTemplate
.
opsForValue
().
set
(
formatKey
(
scoreRuleDO
.
getType
(),
null
),
JsonUtils
.
toJsonString
(
scoreRuleDO
));
stringRedisTemplate
.
opsForValue
().
set
(
formatKey
(
scoreRuleDO
.
getType
(),
null
),
JsonUtils
.
toJsonString
(
scoreRuleDO
)
,
24L
,
TimeUnit
.
HOURS
);
}
}
public
void
deleteEnableScoreRule
(
Integer
type
)
{
public
void
deleteEnableScoreRule
(
Integer
type
)
{
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/mq/consumer/score/core/OrderVStrategy.java
View file @
03a7d578
This diff is collapsed.
Click to expand it.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/scoreRule/ScoreRuleServiceImpl.java
View file @
03a7d578
...
@@ -415,16 +415,12 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
...
@@ -415,16 +415,12 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
if
(
enableScoreRule
==
null
)
{
if
(
enableScoreRule
==
null
)
{
return
null
;
return
null
;
}
}
scoreRuleRedisDao
.
setEnableScoreRule
(
enableScoreRule
);
// 校验一下活动开始结束时间
// 校验一下活动开始结束时间
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
return
null
;
}
}
scoreRuleRedisDao
.
setEnableScoreRule
(
enableScoreRule
);
}
else
{
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
return
null
;
return
null
;
}
}
}
return
enableScoreRule
;
return
enableScoreRule
;
}
}
...
@@ -439,15 +435,11 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
...
@@ -439,15 +435,11 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
if
(
enableScoreRule
==
null
)
{
if
(
enableScoreRule
==
null
)
{
return
null
;
return
null
;
}
}
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
return
null
;
}
scoreRuleRedisDao
.
setEnableScoreRule
(
enableScoreRule
);
scoreRuleRedisDao
.
setEnableScoreRule
(
enableScoreRule
);
}
else
{
}
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
return
null
;
return
null
;
}
}
}
return
enableScoreRule
;
return
enableScoreRule
;
case
RECOMMEND:
case
RECOMMEND:
case
REGISTER:
case
REGISTER:
...
...
yudao-module-order/yudao-module-order-api/src/main/java/cn/iocoder/boot/module/order/api/OrderApi.java
View file @
03a7d578
package
cn
.
iocoder
.
boot
.
module
.
order
.
api
;
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
cn.iocoder.boot.module.order.api.dto.OrderRespDTO
;
import
java.util.List
;
/**
/**
* 订单 api
* 订单 api
*/
*/
...
@@ -14,4 +17,8 @@ public interface OrderApi {
...
@@ -14,4 +17,8 @@ public interface OrderApi {
* 判断是否用户首单
* 判断是否用户首单
*/
*/
boolean
isFirstOrder
(
Long
userId
);
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 @
03a7d578
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 @
03a7d578
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 @
03a7d578
...
@@ -278,6 +278,11 @@ public class OrderRespDTO {
...
@@ -278,6 +278,11 @@ public class OrderRespDTO {
@NotNull
(
message
=
"目的地信息不能为空"
)
@NotNull
(
message
=
"目的地信息不能为空"
)
private
OrderObjectiveApiDO
orderObjectiveDO
;
private
OrderObjectiveApiDO
orderObjectiveDO
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"收货人信息"
)
@NotNull
(
message
=
"收货人信息不能为空"
)
private
OrderConsigneeApiDO
orderConsigneeDO
;
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"目的地ID"
)
@ApiModelProperty
(
value
=
"目的地ID"
)
private
Long
objectiveId
;
private
Long
objectiveId
;
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/api/OrderApiImpl.java
View file @
03a7d578
package
cn
.
iocoder
.
yudao
.
module
.
order
.
api
;
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.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.OrderObjectiveApiDO
;
import
cn.iocoder.boot.module.order.api.dto.OrderRespDTO
;
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.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.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.OrderObjectiveService
;
import
cn.iocoder.yudao.module.order.service.order.OrderService
;
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
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
@Service
@Validated
@Validated
...
@@ -21,6 +30,10 @@ public class OrderApiImpl implements OrderApi {
...
@@ -21,6 +30,10 @@ public class OrderApiImpl implements OrderApi {
private
OrderService
orderService
;
private
OrderService
orderService
;
@Resource
@Resource
private
OrderObjectiveService
objectiveService
;
private
OrderObjectiveService
objectiveService
;
@Resource
private
OrderConsigneeService
orderConsigneeService
;
@Resource
private
OrderItemServiceImpl
orderItemService
;
@Override
@Override
public
OrderRespDTO
getOrder
(
Long
id
,
String
orderNo
)
{
public
OrderRespDTO
getOrder
(
Long
id
,
String
orderNo
)
{
...
@@ -36,13 +49,22 @@ public class OrderApiImpl implements OrderApi {
...
@@ -36,13 +49,22 @@ public class OrderApiImpl implements OrderApi {
OrderRespDTO
orderRespDTO
=
new
OrderRespDTO
();
OrderRespDTO
orderRespDTO
=
new
OrderRespDTO
();
BeanUtils
.
copyProperties
(
orderDO
,
orderRespDTO
);
BeanUtils
.
copyProperties
(
orderDO
,
orderRespDTO
);
// 设置目的地信息
OrderObjectiveDO
orderObjectiveDO
=
objectiveService
.
getByOrderId
(
id
);
OrderObjectiveDO
orderObjectiveDO
=
objectiveService
.
getByOrderId
(
id
);
if
(
orderObjectiveDO
==
null
)
{
if
(
orderObjectiveDO
!=
null
)
{
return
orderRespDTO
;
}
OrderObjectiveApiDO
orderObjectiveApiDO
=
new
OrderObjectiveApiDO
();
OrderObjectiveApiDO
orderObjectiveApiDO
=
new
OrderObjectiveApiDO
();
BeanUtils
.
copyProperties
(
orderObjectiveDO
,
orderObjectiveApiDO
);
BeanUtils
.
copyProperties
(
orderObjectiveDO
,
orderObjectiveApiDO
);
orderRespDTO
.
setOrderObjectiveDO
(
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
;
return
orderRespDTO
;
}
}
...
@@ -51,4 +73,13 @@ public class OrderApiImpl implements OrderApi {
...
@@ -51,4 +73,13 @@ public class OrderApiImpl implements OrderApi {
Long
count
=
orderService
.
selectCount
(
new
LambdaQueryWrapper
<
OrderDO
>().
eq
(
OrderDO:
:
getUserId
,
userId
));
Long
count
=
orderService
.
selectCount
(
new
LambdaQueryWrapper
<
OrderDO
>().
eq
(
OrderDO:
:
getUserId
,
userId
));
return
count
<=
0
;
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