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
6ae54181
Commit
6ae54181
authored
Sep 09, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
礼品兑换网点属性改为提货点(仓库)
parent
3778bd30
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
167 additions
and
80 deletions
+167
-80
WarehouseConvert.java
...module/depository/convert/warehouse/WarehouseConvert.java
+1
-1
WarehouseService.java
...module/depository/service/warehouse/WarehouseService.java
+2
-0
WarehouseServiceImpl.java
...pository/service/warehouse/impl/WarehouseServiceImpl.java
+12
-0
WarehouseSimpleReqVO.java
.../module/depository/vo/warehouse/WarehouseSimpleReqVO.java
+16
-0
WarehouseSimpleRespVO.java
...module/depository/vo/warehouse/WarehouseSimpleRespVO.java
+22
-0
WarehouseController.java
...itory/controller/admin/warehouse/WarehouseController.java
+26
-20
pom.xml
yudao-module-reward/yudao-module-reward-impl/pom.xml
+7
-1
RewardController.java
...dule/reward/controller/admin/reward/RewardController.java
+7
-4
RewardServiceImpl.java
...yudao/module/reward/service/reward/RewardServiceImpl.java
+55
-38
RewardBackVO.java
...n/iocoder/yudao/module/reward/vo/reward/RewardBackVO.java
+8
-7
RewardCreateReqVO.java
...oder/yudao/module/reward/vo/reward/RewardCreateReqVO.java
+10
-8
messages_zh.properties
yudao-server/src/main/resources/i18n/messages_zh.properties
+1
-1
No files found.
yudao-module-depository/yudao-module-depository-core/src/main/java/cn/iocoder/yudao/module/depository/convert/warehouse/WarehouseConvert.java
View file @
6ae54181
...
...
@@ -42,5 +42,5 @@ public interface WarehouseConvert {
List
<
WarehouseTreeRegionVO
>
convertTreeRegion
(
List
<
WarehouseTreeRegionVO
>
list
);
List
<
WarehouseSimpleRespVO
>
convertListSimple
(
List
<
WarehouseDO
>
list
);
}
yudao-module-depository/yudao-module-depository-core/src/main/java/cn/iocoder/yudao/module/depository/service/warehouse/WarehouseService.java
View file @
6ae54181
...
...
@@ -172,4 +172,6 @@ public interface WarehouseService {
List
<
WarehouseTreeRegionVO
>
getWarehouseTreeRegionList
(
Integer
tradeType
);
List
<
WarehouseTreeRegionVO
>
getRegionList
(
Integer
type
,
String
regionId
,
String
destCountryId
,
String
objectiveId
,
String
destWarehouseId
);
List
<
WarehouseDO
>
getWarehouseListSimple
(
String
title
);
}
yudao-module-depository/yudao-module-depository-core/src/main/java/cn/iocoder/yudao/module/depository/service/warehouse/impl/WarehouseServiceImpl.java
View file @
6ae54181
...
...
@@ -536,4 +536,16 @@ public class WarehouseServiceImpl implements WarehouseService {
warehouseMapper
.
getRegionList
(
type
,
regionId
,
destCountryId
,
objectiveId
,
destWarehouseId
);
return
list
;
}
@Override
public
List
<
WarehouseDO
>
getWarehouseListSimple
(
String
title
)
{
if
(
StringUtils
.
isBlank
(
title
))
{
return
warehouseMapper
.
selectList
();
}
// 模糊搜索中文名和英文名
return
warehouseMapper
.
selectList
(
new
LambdaQueryWrapperX
<
WarehouseDO
>()
.
like
(
WarehouseDO:
:
getTitleZh
,
title
)
.
or
()
.
like
(
WarehouseDO:
:
getTitleEn
,
title
));
}
}
yudao-module-depository/yudao-module-depository-core/src/main/java/cn/iocoder/yudao/module/depository/vo/warehouse/WarehouseSimpleReqVO.java
0 → 100644
View file @
6ae54181
package
cn
.
iocoder
.
yudao
.
module
.
depository
.
vo
.
warehouse
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
@ApiModel
(
"仓库精简信息 Req VO"
)
@Data
public
class
WarehouseSimpleReqVO
{
@ApiModelProperty
(
value
=
"模糊搜标题"
)
private
String
title
;
}
yudao-module-depository/yudao-module-depository-core/src/main/java/cn/iocoder/yudao/module/depository/vo/warehouse/WarehouseSimpleRespVO.java
0 → 100644
View file @
6ae54181
package
cn
.
iocoder
.
yudao
.
module
.
depository
.
vo
.
warehouse
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@ApiModel
(
"仓库精简信息 Response VO"
)
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
WarehouseSimpleRespVO
{
@ApiModelProperty
(
value
=
""
,
required
=
true
)
private
Long
id
;
@ApiModelProperty
(
value
=
"中文标题"
)
private
String
titleZh
;
@ApiModelProperty
(
value
=
"英文标题"
)
private
String
titleEn
;
}
yudao-module-depository/yudao-module-depository-rest/src/main/java/cn/iocoder/yudao/module/depository/controller/admin/warehouse/WarehouseController.java
View file @
6ae54181
...
...
@@ -2,40 +2,39 @@ package cn.iocoder.yudao.module.depository.controller.admin.warehouse;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.iocoder.yudao.framework.apollo.core.event.QueryChannelInfoEvent
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.excel.util.ExcelUtils
;
import
cn.iocoder.yudao.module.depository.dal.mysql.warehouse.WarehouseLineMapper
;
import
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog
;
import
cn.iocoder.yudao.module.depository.convert.warehouse.DeptWarehouseConvert
;
import
cn.iocoder.yudao.module.depository.convert.warehouse.WarehouseConvert
;
import
cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.DeptWarehouseDO
;
import
cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseDO
;
import
cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseLineDO
;
import
cn.iocoder.yudao.module.depository.service.warehouse.WarehouseService
;
import
cn.iocoder.yudao.module.depository.vo.dept.DeptWarehouseBaseVO
;
import
cn.iocoder.yudao.module.depository.vo.dept.DeptWarehouseRequestVo
;
import
cn.iocoder.yudao.module.depository.vo.warehouse.*
;
import
cn.iocoder.yudao.module.depository.convert.warehouse.DeptWarehouseConvert
;
import
cn.iocoder.yudao.module.ecw.dal.dataobject.region.RegionDO
;
import
cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.DeptWarehouseDO
;
import
cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseLineDO
;
import
cn.iocoder.yudao.module.ecw.service.region.RegionService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
io.swagger.annotations.*
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.
validation.*
;
import
javax.servlet.http.
*
;
import
java
.util.*
;
import
javax.
annotation.Resource
;
import
javax.servlet.http.
HttpServletResponse
;
import
java
x.validation.Valid
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
operatelog
.
core
.
enums
.
OperateTypeEnum
.*;
import
cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseDO
;
import
cn.iocoder.yudao.module.depository.convert.warehouse.WarehouseConvert
;
import
cn.iocoder.yudao.module.depository.service.warehouse.WarehouseService
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
operatelog
.
core
.
enums
.
OperateTypeEnum
.
EXPORT
;
@Api
(
tags
=
"管理后台 - 仓库"
)
@RestController
...
...
@@ -317,6 +316,13 @@ public class WarehouseController {
}
return
success
(
resultList
);
}
@PostMapping
(
"/list-all-simple"
)
@ApiOperation
(
value
=
"获得仓库精简信息列表"
,
notes
=
"主要用于前端的下拉选项"
)
public
CommonResult
<
List
<
WarehouseSimpleRespVO
>>
getWarehouseListSimple
(
@RequestBody
WarehouseSimpleReqVO
reqVO
)
{
List
<
WarehouseDO
>
list
=
warehouseService
.
getWarehouseListSimple
(
reqVO
.
getTitle
());
return
success
(
WarehouseConvert
.
INSTANCE
.
convertListSimple
(
list
));
}
private
static
<
T
>
List
<
T
>
pagination
(
List
<
T
>
records
,
int
pageNum
,
int
pageSize
)
{
if
(
CollectionUtil
.
isEmpty
(
records
))
{
...
...
yudao-module-reward/yudao-module-reward-impl/pom.xml
View file @
6ae54181
...
...
@@ -44,7 +44,13 @@
</dependency>
<dependency>
<groupId>
cn.iocoder.boot
</groupId>
<artifactId>
yudao-module-ecw-api
</artifactId>
<artifactId>
yudao-module-ecw-impl
</artifactId>
<version>
${revision}
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
cn.iocoder.boot
</groupId>
<artifactId>
yudao-module-depository-core
</artifactId>
<version>
${revision}
</version>
<scope>
compile
</scope>
</dependency>
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/controller/admin/reward/RewardController.java
View file @
6ae54181
...
...
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletResponse;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotNull
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
...
...
@@ -75,7 +76,6 @@ public class RewardController {
@GetMapping
(
"/list"
)
@ApiOperation
(
"获得礼品列表"
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"编号列表"
,
required
=
true
,
example
=
"1024,2048"
,
dataTypeClass
=
List
.
class
)
//@PreAuthorize("@ss.hasPermission('reward::query')")
public
CommonResult
<
List
<
RewardBackVO
>>
getList
(
@RequestParam
(
"ids"
)
Collection
<
Long
>
ids
)
{
List
<
RewardDO
>
list
=
rewardService
.
getList
(
ids
);
List
<
RewardBackVO
>
rewardBackVOS
=
RewardConvert
.
INSTANCE
.
convertList
(
list
);
...
...
@@ -84,12 +84,15 @@ public class RewardController {
@PostMapping
(
"/page"
)
@ApiOperation
(
"获得礼品分页"
)
//@PreAuthorize("@ss.hasPermission('reward::query')")
public
CommonResult
<
PageResult
<
RewardBackVO
>>
getPage
(
@Valid
@RequestBody
RewardQueryVO
query
,
PageVO
page
)
{
PageResult
<
RewardDO
>
pageResult
=
rewardService
.
getPage
(
query
,
page
);
PageResult
<
RewardBackVO
>
rewardBackVOPageResult
=
RewardConvert
.
INSTANCE
.
convertPage
(
pageResult
);
// 转换nodeId和points
rewardBackVOPageResult
.
getList
().
forEach
(
rewardBackVO
->
rewardBackVO
.
getNodeIds
().
add
(
new
RewardBackVO
.
NodeAndPoints
(
rewardBackVO
.
getNodeId
(),
rewardBackVO
.
getPointsRequire
())));
rewardBackVOPageResult
.
getList
().
forEach
(
rewardBackVO
->
{
List
<
Integer
>
nodeId
=
new
ArrayList
<>();
nodeId
.
add
(
rewardBackVO
.
getNodeId
());
rewardBackVO
.
getNodeIds
().
add
(
new
RewardBackVO
.
NodeAndPoints
(
nodeId
,
rewardBackVO
.
getPointsRequire
(),
rewardBackVO
.
getQuantityRemain
()));
});
return
success
(
rewardBackVOPageResult
);
}
...
...
@@ -119,7 +122,7 @@ public class RewardController {
@GetMapping
(
"/export-excel"
)
@ApiOperation
(
"导出礼品 Excel"
)
//
@PreAuthorize("@ss.hasPermission('reward::export')")
@PreAuthorize
(
"@ss.hasPermission('reward::export')"
)
@OperateLog
(
type
=
EXPORT
)
public
void
exportExcel
(
@Valid
RewardQueryVO
query
,
HttpServletResponse
response
)
throws
IOException
{
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/service/reward/RewardServiceImpl.java
View file @
6ae54181
...
...
@@ -5,10 +5,13 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import
cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO
;
import
cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.module.ecw.api.node.NodeApi
;
import
cn.iocoder.yudao.module.ecw.api.node.dto.NodeRespDTO
;
import
cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseDO
;
import
cn.iocoder.yudao.module.depository.dal.mysql.warehouse.WarehouseMapper
;
import
cn.iocoder.yudao.module.ecw.dal.dataobject.region.RegionDO
;
import
cn.iocoder.yudao.module.ecw.service.region.RegionService
;
import
cn.iocoder.yudao.module.member.api.user.MemberUserApi
;
import
cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO
;
import
cn.iocoder.yudao.module.reward.controller.app.reward.vo.AppRewardBackVO
;
...
...
@@ -20,13 +23,14 @@ import cn.iocoder.yudao.module.reward.dal.mysql.reward.RewardMapper;
import
cn.iocoder.yudao.module.reward.enums.QuantitativeRelationSymbolEnum
;
import
cn.iocoder.yudao.module.reward.enums.RewardPickMethedEnum
;
import
cn.iocoder.yudao.module.reward.enums.RewardStatusEnum
;
import
cn.iocoder.yudao.module.reward.util.RewardGenCodeUtils
;
import
cn.iocoder.yudao.module.reward.vo.reward.*
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
cn.iocoder.yudao.module.reward.util.RewardGenCodeUtils
;
import
javax.annotation.Resource
;
import
java.time.Instant
;
...
...
@@ -48,30 +52,41 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
@Resource
private
RewardMapper
rewardMapper
;
@Resource
private
NodeApi
nodeApi
;
private
WarehouseMapper
warehouseMapper
;
@Resource
private
RegionService
regionService
;
@Resource
private
MemberUserApi
memberUserApi
;
@Resource
private
RewardGenCodeUtils
rewardGenCodeUtils
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Long
>
create
(
RewardCreateReqVO
createReqVO
)
{
verifyCreateVO
(
createReqVO
);
// 插入
RewardDO
rewardDO
=
RewardConvert
.
INSTANCE
.
convert
(
createReqVO
);
// 剩余数量若没传给默认值0
if
(
rewardDO
.
getQuantityRemain
()
==
null
)
{
rewardDO
.
setQuantityRemain
(
0
);
}
ArrayList
<
Long
>
ids
=
new
ArrayList
<>();
for
(
RewardCreateReqVO
.
NodeAndPoints
nodeId
:
createReqVO
.
getNodeIds
())
{
rewardDO
.
setNodeId
(
nodeId
.
getNodeId
());
rewardDO
.
setPointsRequire
(
nodeId
.
getPoints
());
rewardDO
.
setCode
(
rewardGenCodeUtils
.
generateRewardCode
());
rewardMapper
.
insert
(
rewardDO
);
ids
.
add
(
rewardDO
.
getId
());
rewardDO
.
setId
(
null
);
for
(
RewardCreateReqVO
.
NodeAndPoints
wareHouses
:
createReqVO
.
getNodeIds
())
{
rewardDO
.
setPointsRequire
(
wareHouses
.
getPoints
());
// 剩余数量若没传给默认值0
if
(
wareHouses
.
getQuantityRemain
()
==
null
)
{
rewardDO
.
setQuantityRemain
(
0
);
}
else
if
(
wareHouses
.
getQuantityRemain
()
>
0
)
{
rewardDO
.
setQuantityRemain
(
wareHouses
.
getQuantityRemain
());
}
else
{
rewardDO
.
setQuantityRemain
(
0
);
}
for
(
Integer
wareHouse
:
wareHouses
.
getWareHouses
())
{
if
(
wareHouse
==
null
||
wareHouse
<
0
)
{
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
rewardDO
.
setNodeId
(
wareHouse
);
rewardDO
.
setCode
(
rewardGenCodeUtils
.
generateRewardCode
());
rewardMapper
.
insert
(
rewardDO
);
ids
.
add
(
rewardDO
.
getId
());
rewardDO
.
setId
(
null
);
}
}
// 返回
return
ids
;
...
...
@@ -102,10 +117,10 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
else
{
for
(
RewardCreateReqVO
.
NodeAndPoints
nodeId
:
nodeIds
)
{
if
(
nodeId
.
getPoints
()
==
null
||
nodeId
.
get
NodeId
()
==
null
)
{
if
(
nodeId
.
getPoints
()
==
null
||
nodeId
.
get
WareHouses
()
==
null
)
{
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
if
(
nodeId
.
getPoints
()
<=
0
||
nodeId
.
getNodeId
()
<=
0
)
{
if
(
nodeId
.
getPoints
()
<=
0
)
{
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
}
...
...
@@ -218,7 +233,7 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
.
eq
(
query
.
getPointsRequireSymbol
()
==
QuantitativeRelationSymbolEnum
.
EQ
.
getValue
(),
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
())
.
lt
(
query
.
getPointsRequireSymbol
()
==
QuantitativeRelationSymbolEnum
.
LT
.
getValue
(),
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
());
}
//
兑换网
点id,领取方式,状态
//
提货
点id,领取方式,状态
lambdaQuery
.
eqIfPresent
(
RewardDO:
:
getNodeId
,
query
.
getNodeId
())
.
eq
(
StringUtils
.
isNotBlank
(
query
.
getPickMethod
()),
RewardDO:
:
getPickMethod
,
query
.
getPickMethod
())
.
eqIfPresent
(
RewardDO:
:
getStatus
,
query
.
getStatus
());
...
...
@@ -340,22 +355,22 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
rewardDOLambdaQuery
.
eq
(
RewardDO:
:
getNodeId
,
reqVO
.
getNodeId
());
}
else
{
UserRespDTO
user
=
memberUserApi
.
getUser
(
reqVO
.
getMemberId
());
List
<
NodeRespDTO
>
nodes
;
List
<
WarehouseDO
>
warehouseList
;
// 根据用户城市获取
nodes
=
nodeApi
.
getNodesByCity
(
user
.
getCity
().
longValue
(),
null
);
warehouseList
=
warehouseMapper
.
selectList
(
new
LambdaQueryWrapperX
<
WarehouseDO
>().
eq
(
WarehouseDO:
:
getShi
,
user
.
getCity
().
longValue
())
);
appRewardListBackVO
.
setCity
(
user
.
getCity
().
longValue
());
appRewardListBackVO
.
setCountry
(
user
.
getCountry
().
longValue
());
if
(
CollectionUtil
.
isEmpty
(
nodes
))
{
if
(
CollectionUtil
.
isEmpty
(
warehouseList
))
{
// 根据用户国家获取
nodes
=
nodeApi
.
getNodesByCity
(
null
,
user
.
getCountry
().
longValue
(
));
warehouseList
=
warehouseMapper
.
selectList
(
new
LambdaQueryWrapperX
<
WarehouseDO
>().
eq
(
WarehouseDO:
:
getGuojia
,
user
.
getCountry
().
longValue
()
));
appRewardListBackVO
.
setCity
(
null
);
}
// 国家和城市都获取不到
if
(
CollectionUtil
.
isEmpty
(
nodes
))
{
nodes
=
nodeApi
.
getNodesByCity
(
null
,
130L
);
if
(
CollectionUtil
.
isEmpty
(
warehouseList
))
{
warehouseList
=
warehouseMapper
.
selectList
(
new
LambdaQueryWrapperX
<
WarehouseDO
>().
eq
(
WarehouseDO:
:
getGuojia
,
130L
)
);
appRewardListBackVO
.
setCountry
(
130L
);
}
List
<
Long
>
nodeIds
=
nodes
.
stream
().
map
(
NodeRespDT
O:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
nodeIds
=
warehouseList
.
stream
().
map
(
WarehouseD
O:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
nodeIds
))
{
rewardDOLambdaQuery
.
in
(
RewardDO:
:
getNodeId
,
nodeIds
);
}
...
...
@@ -377,10 +392,12 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
AppRewardBackVO
appRewardBackVO
=
new
AppRewardBackVO
();
BeanUtils
.
copyProperties
(
rewardDO
,
appRewardBackVO
);
setPickMethod
(
appRewardBackVO
);
NodeRespDTO
nodesById
=
nodeApi
.
getNodesById
(
Long
.
valueOf
(
rewardDO
.
getNodeId
()));
if
(
nodesById
!=
null
)
{
appRewardBackVO
.
setNodeZh
(
nodesById
.
getGuojiaZh
()
+
"、"
+
nodesById
.
getShiZh
()
+
"、"
+
nodesById
.
getTitleZh
());
appRewardBackVO
.
setNodeEn
(
nodesById
.
getGuojiaEn
()
+
"、"
+
nodesById
.
getShiEn
()
+
"、"
+
nodesById
.
getTitleEn
());
WarehouseDO
warehouse
=
warehouseMapper
.
selectById
(
Long
.
valueOf
(
rewardDO
.
getNodeId
()));
if
(
warehouse
!=
null
)
{
RegionDO
country
=
regionService
.
getRegion
(
warehouse
.
getGuojia
());
RegionDO
city
=
regionService
.
getRegion
(
warehouse
.
getShi
());
appRewardBackVO
.
setNodeZh
(
country
.
getTitleZh
()
+
"、"
+
city
.
getTitleZh
()
+
"、"
+
warehouse
.
getTitleZh
());
appRewardBackVO
.
setNodeEn
(
country
.
getTitleEn
()
+
"、"
+
city
.
getTitleEn
()
+
"、"
+
warehouse
.
getTitleEn
());
}
return
appRewardBackVO
;
}
...
...
@@ -422,22 +439,22 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
*/
private
List
<
Long
>
getMemberCityNodes
(
Long
memberId
)
{
UserRespDTO
user
=
memberUserApi
.
getUser
(
memberId
);
List
<
NodeRespDTO
>
nodes
;
List
<
WarehouseDO
>
warehouseList
;
// 如果用户没有填写国家或城市默认展示中国的礼品
if
(
user
.
getCity
()
==
null
||
user
.
getCountry
()
==
null
)
{
nodes
=
nodeApi
.
getNodesByCity
(
null
,
130L
);
warehouseList
=
warehouseMapper
.
selectList
(
new
LambdaQueryWrapperX
<
WarehouseDO
>().
eq
(
WarehouseDO:
:
getGuojia
,
130L
)
);
}
else
{
// 根据用户城市获取
nodes
=
nodeApi
.
getNodesByCity
(
user
.
getCity
().
longValue
(),
null
);
if
(
CollectionUtil
.
isEmpty
(
nodes
))
{
warehouseList
=
warehouseMapper
.
selectList
(
new
LambdaQueryWrapperX
<
WarehouseDO
>().
eq
(
WarehouseDO:
:
getShi
,
user
.
getCity
().
longValue
())
);
if
(
CollectionUtil
.
isEmpty
(
warehouseList
))
{
// 根据用户国家获取
nodes
=
nodeApi
.
getNodesByCity
(
null
,
user
.
getCountry
().
longValue
(
));
warehouseList
=
warehouseMapper
.
selectList
(
new
LambdaQueryWrapperX
<
WarehouseDO
>().
eq
(
WarehouseDO:
:
getGuojia
,
user
.
getCountry
().
longValue
()
));
}
}
// 国家和城市都获取不到
if
(
CollectionUtil
.
isEmpty
(
nodes
))
{
nodes
=
nodeApi
.
getNodesByCity
(
null
,
130L
);
if
(
CollectionUtil
.
isEmpty
(
warehouseList
))
{
warehouseList
=
warehouseMapper
.
selectList
(
new
LambdaQueryWrapperX
<
WarehouseDO
>().
eq
(
WarehouseDO:
:
getGuojia
,
130L
)
);
}
return
nodes
.
stream
().
map
(
NodeRespDT
O:
:
getId
).
collect
(
Collectors
.
toList
());
return
warehouseList
.
stream
().
map
(
WarehouseD
O:
:
getId
).
collect
(
Collectors
.
toList
());
}
}
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/vo/reward/RewardBackVO.java
View file @
6ae54181
...
...
@@ -9,7 +9,6 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.NotNull
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -60,11 +59,11 @@ public class RewardBackVO {
@ApiModelProperty
(
value
=
"兑换所需积分"
,
required
=
true
)
private
Integer
pointsRequire
;
@ExcelProperty
(
"
兑换网
点"
)
@ApiModelProperty
(
value
=
"
兑换网
点"
,
required
=
true
)
@ExcelProperty
(
"
提货
点"
)
@ApiModelProperty
(
value
=
"
提货
点"
,
required
=
true
)
private
Integer
nodeId
;
@ApiModelProperty
(
value
=
"
兑换网点和积分
列表"
,
required
=
true
)
@ApiModelProperty
(
value
=
"
提货点,积分,剩余数量
列表"
,
required
=
true
)
private
List
<
RewardBackVO
.
NodeAndPoints
>
nodeIds
=
new
ArrayList
<>();
@ExcelProperty
(
"已兑换次数"
)
...
...
@@ -122,9 +121,11 @@ public class RewardBackVO {
@AllArgsConstructor
@NoArgsConstructor
public
static
class
NodeAndPoints
{
@ApiModelProperty
(
value
=
"
兑换网
点"
)
private
Integer
nodeId
;
@ApiModelProperty
(
value
=
"
兑换网
点对应积分"
)
@ApiModelProperty
(
value
=
"
提货
点"
)
private
List
<
Integer
>
wareHouses
;
@ApiModelProperty
(
value
=
"
提货
点对应积分"
)
private
Integer
points
;
@ApiModelProperty
(
value
=
"剩余数量"
)
private
Integer
quantityRemain
;
}
}
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/vo/reward/RewardCreateReqVO.java
View file @
6ae54181
...
...
@@ -49,14 +49,14 @@ public class RewardCreateReqVO {
//@NotNull(message = "兑换网点不能为空")
//private Integer nodeId;
@ApiModelProperty
(
value
=
"
兑换网点和积分
列表"
,
required
=
true
)
@ApiModelProperty
(
value
=
"
提货点,积分,剩余数量
列表"
,
required
=
true
)
@NotNull
(
message
=
"兑换网点列表不能为空"
)
private
List
<
NodeAndPoints
>
nodeIds
;
@ApiModelProperty
(
value
=
"剩余数量"
,
required
=
true
)
@NotNull
(
message
=
"剩余数量不能为空"
)
@Min
(
value
=
0
)
private
Integer
quantityRemain
;
//
@ApiModelProperty(value = "剩余数量", required = true)
//
@NotNull(message = "剩余数量不能为空")
//
@Min(value = 0)
//
private Integer quantityRemain;
@ApiModelProperty
(
value
=
"活动开始时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
...
...
@@ -93,9 +93,11 @@ public class RewardCreateReqVO {
@Data
public
static
class
NodeAndPoints
{
@ApiModelProperty
(
value
=
"
兑换网
点"
)
private
Integer
nodeId
;
@ApiModelProperty
(
value
=
"
兑换网
点对应积分"
)
@ApiModelProperty
(
value
=
"
提货
点"
)
private
List
<
Integer
>
wareHouses
;
@ApiModelProperty
(
value
=
"
提货
点对应积分"
)
private
Integer
points
;
@ApiModelProperty
(
value
=
"剩余数量"
)
private
Integer
quantityRemain
;
}
}
yudao-server/src/main/resources/i18n/messages_zh.properties
View file @
6ae54181
...
...
@@ -1028,7 +1028,7 @@ reward.score.not.enough = \u79EF\u5206\u4E0D\u8DB3
reward.count.not.enough
=
\u
793C
\u
54C1
\u6570\u
91CF
\u
4E0D
\u
8DB3
reward.redeem.count.not.allow
=
\u6279\u
91CF
\u5151\u6362\u
6BCF
\u
6B21
\u6700\u
591A
\u5341\u6761
reward.redeem.allow.count.error
=
\u
5DF2
\u
8D85
\u
51FA
\u
4E2A
\u
4EBA
\u5141\u
8BB8
\u5151\u6362\u
6B21
\u6570
reward.node.and.points.list.error
=
\u
521B
\u
5EFA
\u
793C
\u
54C1
\u
7F51
\u
70B9
\u6216\u6240\u9700\u
79EF
\u5206\u9519\u
8BEF
reward.node.and.points.list.error
=
\u
521B
\u
5EFA
\u
793C
\u
54C1
\u
63D0
\u
8D27
\u
70B9
\u6216\u6240\u9700\u
79EF
\u5206\u9519\u
8BEF
reward.redeem.recipient.error
=
\u
793C
\u
54C1
\u6536\u
8D27
\u
4EBA
\u
4FE1
\u
606F
\u
4E0D
\u5168
redeem.import.no.record
=
\u8868\u
683C
\u
4E2D
\u
65E0
\u
8BB0
\u
5F55
...
...
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