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
ffa5db4d
Commit
ffa5db4d
authored
Sep 10, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release-zhangfeng' into 'release'
礼品兑换网点属性改为提货点(仓库) See merge request
!17
parents
1f93d161
920f3bee
Changes
12
Show 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 @
ffa5db4d
...
@@ -42,5 +42,5 @@ public interface WarehouseConvert {
...
@@ -42,5 +42,5 @@ public interface WarehouseConvert {
List
<
WarehouseTreeRegionVO
>
convertTreeRegion
(
List
<
WarehouseTreeRegionVO
>
list
);
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 @
ffa5db4d
...
@@ -176,5 +176,7 @@ public interface WarehouseService {
...
@@ -176,5 +176,7 @@ public interface WarehouseService {
List
<
WarehouseTreeVO
>
getWarehouseTreeList
(
Integer
tradeType
);
List
<
WarehouseTreeVO
>
getWarehouseTreeList
(
Integer
tradeType
);
List
<
WarehouseDO
>
getWarehouseListSimple
(
String
title
);
WarehouseListVO
getGuojiaAndShiAndWarehouseList
(
Integer
tradeType
);
WarehouseListVO
getGuojiaAndShiAndWarehouseList
(
Integer
tradeType
);
}
}
yudao-module-depository/yudao-module-depository-core/src/main/java/cn/iocoder/yudao/module/depository/service/warehouse/impl/WarehouseServiceImpl.java
View file @
ffa5db4d
...
@@ -622,4 +622,16 @@ public class WarehouseServiceImpl implements WarehouseService {
...
@@ -622,4 +622,16 @@ public class WarehouseServiceImpl implements WarehouseService {
warehouseMapper
.
getRegionList
(
type
,
regionId
,
destCountryId
,
objectiveId
,
destWarehouseId
);
warehouseMapper
.
getRegionList
(
type
,
regionId
,
destCountryId
,
objectiveId
,
destWarehouseId
);
return
list
;
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 @
ffa5db4d
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 @
ffa5db4d
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 @
ffa5db4d
...
@@ -2,40 +2,39 @@ package cn.iocoder.yudao.module.depository.controller.admin.warehouse;
...
@@ -2,40 +2,39 @@ package cn.iocoder.yudao.module.depository.controller.admin.warehouse;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.iocoder.yudao.framework.apollo.core.event.QueryChannelInfoEvent
;
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.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.DeptWarehouseBaseVO
;
import
cn.iocoder.yudao.module.depository.vo.dept.DeptWarehouseRequestVo
;
import
cn.iocoder.yudao.module.depository.vo.dept.DeptWarehouseRequestVo
;
import
cn.iocoder.yudao.module.depository.vo.warehouse.*
;
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.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
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.beans.BeanUtils
;
import
org.springframework.context.ApplicationContext
;
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
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.
annotation.Resource
;
import
javax.servlet.http.
*
;
import
javax.servlet.http.
HttpServletResponse
;
import
java
.util.*
;
import
java
x.validation.Valid
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
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
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
operatelog
.
core
.
enums
.
OperateTypeEnum
.
EXPORT
;
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
;
@Api
(
tags
=
"管理后台 - 仓库"
)
@Api
(
tags
=
"管理后台 - 仓库"
)
@RestController
@RestController
...
@@ -334,6 +333,13 @@ public class WarehouseController {
...
@@ -334,6 +333,13 @@ public class WarehouseController {
}
}
return
success
(
resultList
);
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
)
{
private
static
<
T
>
List
<
T
>
pagination
(
List
<
T
>
records
,
int
pageNum
,
int
pageSize
)
{
if
(
CollectionUtil
.
isEmpty
(
records
))
{
if
(
CollectionUtil
.
isEmpty
(
records
))
{
...
...
yudao-module-reward/yudao-module-reward-impl/pom.xml
View file @
ffa5db4d
...
@@ -44,7 +44,13 @@
...
@@ -44,7 +44,13 @@
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
cn.iocoder.boot
</groupId>
<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>
<version>
${revision}
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/controller/admin/reward/RewardController.java
View file @
ffa5db4d
...
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletResponse;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
...
@@ -75,7 +76,6 @@ public class RewardController {
...
@@ -75,7 +76,6 @@ public class RewardController {
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
@ApiOperation
(
"获得礼品列表"
)
@ApiOperation
(
"获得礼品列表"
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"编号列表"
,
required
=
true
,
example
=
"1024,2048"
,
dataTypeClass
=
List
.
class
)
@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
)
{
public
CommonResult
<
List
<
RewardBackVO
>>
getList
(
@RequestParam
(
"ids"
)
Collection
<
Long
>
ids
)
{
List
<
RewardDO
>
list
=
rewardService
.
getList
(
ids
);
List
<
RewardDO
>
list
=
rewardService
.
getList
(
ids
);
List
<
RewardBackVO
>
rewardBackVOS
=
RewardConvert
.
INSTANCE
.
convertList
(
list
);
List
<
RewardBackVO
>
rewardBackVOS
=
RewardConvert
.
INSTANCE
.
convertList
(
list
);
...
@@ -84,12 +84,15 @@ public class RewardController {
...
@@ -84,12 +84,15 @@ public class RewardController {
@PostMapping
(
"/page"
)
@PostMapping
(
"/page"
)
@ApiOperation
(
"获得礼品分页"
)
@ApiOperation
(
"获得礼品分页"
)
//@PreAuthorize("@ss.hasPermission('reward::query')")
public
CommonResult
<
PageResult
<
RewardBackVO
>>
getPage
(
@Valid
@RequestBody
RewardQueryVO
query
,
PageVO
page
)
{
public
CommonResult
<
PageResult
<
RewardBackVO
>>
getPage
(
@Valid
@RequestBody
RewardQueryVO
query
,
PageVO
page
)
{
PageResult
<
RewardDO
>
pageResult
=
rewardService
.
getPage
(
query
,
page
);
PageResult
<
RewardDO
>
pageResult
=
rewardService
.
getPage
(
query
,
page
);
PageResult
<
RewardBackVO
>
rewardBackVOPageResult
=
RewardConvert
.
INSTANCE
.
convertPage
(
pageResult
);
PageResult
<
RewardBackVO
>
rewardBackVOPageResult
=
RewardConvert
.
INSTANCE
.
convertPage
(
pageResult
);
// 转换nodeId和points
// 转换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
);
return
success
(
rewardBackVOPageResult
);
}
}
...
@@ -119,7 +122,7 @@ public class RewardController {
...
@@ -119,7 +122,7 @@ public class RewardController {
@GetMapping
(
"/export-excel"
)
@GetMapping
(
"/export-excel"
)
@ApiOperation
(
"导出礼品 Excel"
)
@ApiOperation
(
"导出礼品 Excel"
)
//
@PreAuthorize("@ss.hasPermission('reward::export')")
@PreAuthorize
(
"@ss.hasPermission('reward::export')"
)
@OperateLog
(
type
=
EXPORT
)
@OperateLog
(
type
=
EXPORT
)
public
void
exportExcel
(
@Valid
RewardQueryVO
query
,
public
void
exportExcel
(
@Valid
RewardQueryVO
query
,
HttpServletResponse
response
)
throws
IOException
{
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 @
ffa5db4d
...
@@ -5,10 +5,13 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
...
@@ -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.dto.DictDataRespDTO
;
import
cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils
;
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.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.service.AbstractService
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.module.ecw.api.node.NodeApi
;
import
cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseDO
;
import
cn.iocoder.yudao.module.ecw.api.node.dto.NodeRespDTO
;
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.MemberUserApi
;
import
cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO
;
import
cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO
;
import
cn.iocoder.yudao.module.reward.controller.app.reward.vo.AppRewardBackVO
;
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;
...
@@ -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.QuantitativeRelationSymbolEnum
;
import
cn.iocoder.yudao.module.reward.enums.RewardPickMethedEnum
;
import
cn.iocoder.yudao.module.reward.enums.RewardPickMethedEnum
;
import
cn.iocoder.yudao.module.reward.enums.RewardStatusEnum
;
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
cn.iocoder.yudao.module.reward.vo.reward.*
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
cn.iocoder.yudao.module.reward.util.RewardGenCodeUtils
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.time.Instant
;
import
java.time.Instant
;
...
@@ -48,31 +52,42 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
...
@@ -48,31 +52,42 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
@Resource
@Resource
private
RewardMapper
rewardMapper
;
private
RewardMapper
rewardMapper
;
@Resource
@Resource
private
NodeApi
nodeApi
;
private
WarehouseMapper
warehouseMapper
;
@Resource
private
RegionService
regionService
;
@Resource
@Resource
private
MemberUserApi
memberUserApi
;
private
MemberUserApi
memberUserApi
;
@Resource
@Resource
private
RewardGenCodeUtils
rewardGenCodeUtils
;
private
RewardGenCodeUtils
rewardGenCodeUtils
;
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Long
>
create
(
RewardCreateReqVO
createReqVO
)
{
public
List
<
Long
>
create
(
RewardCreateReqVO
createReqVO
)
{
verifyCreateVO
(
createReqVO
);
verifyCreateVO
(
createReqVO
);
// 插入
// 插入
RewardDO
rewardDO
=
RewardConvert
.
INSTANCE
.
convert
(
createReqVO
);
RewardDO
rewardDO
=
RewardConvert
.
INSTANCE
.
convert
(
createReqVO
);
ArrayList
<
Long
>
ids
=
new
ArrayList
<>();
for
(
RewardCreateReqVO
.
NodeAndPoints
wareHouses
:
createReqVO
.
getNodeIds
())
{
rewardDO
.
setPointsRequire
(
wareHouses
.
getPoints
());
// 剩余数量若没传给默认值0
// 剩余数量若没传给默认值0
if
(
rewardDO
.
getQuantityRemain
()
==
null
)
{
if
(
wareHouses
.
getQuantityRemain
()
==
null
)
{
rewardDO
.
setQuantityRemain
(
0
);
}
else
if
(
wareHouses
.
getQuantityRemain
()
>
0
)
{
rewardDO
.
setQuantityRemain
(
wareHouses
.
getQuantityRemain
());
}
else
{
rewardDO
.
setQuantityRemain
(
0
);
rewardDO
.
setQuantityRemain
(
0
);
}
}
ArrayList
<
Long
>
ids
=
new
ArrayList
<>();
for
(
Integer
wareHouse
:
wareHouses
.
getWareHouses
())
{
for
(
RewardCreateReqVO
.
NodeAndPoints
nodeId
:
createReqVO
.
getNodeIds
())
{
if
(
wareHouse
==
null
||
wareHouse
<
0
)
{
rewardDO
.
setNodeId
(
nodeId
.
getNodeId
());
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
rewardDO
.
setPointsRequire
(
nodeId
.
getPoints
());
}
rewardDO
.
setNodeId
(
wareHouse
);
rewardDO
.
setCode
(
rewardGenCodeUtils
.
generateRewardCode
());
rewardDO
.
setCode
(
rewardGenCodeUtils
.
generateRewardCode
());
rewardMapper
.
insert
(
rewardDO
);
rewardMapper
.
insert
(
rewardDO
);
ids
.
add
(
rewardDO
.
getId
());
ids
.
add
(
rewardDO
.
getId
());
rewardDO
.
setId
(
null
);
rewardDO
.
setId
(
null
);
}
}
}
// 返回
// 返回
return
ids
;
return
ids
;
}
}
...
@@ -102,10 +117,10 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
...
@@ -102,10 +117,10 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
else
{
}
else
{
for
(
RewardCreateReqVO
.
NodeAndPoints
nodeId
:
nodeIds
)
{
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
);
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
);
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
}
}
}
...
@@ -218,7 +233,7 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
...
@@ -218,7 +233,7 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
.
eq
(
query
.
getPointsRequireSymbol
()
==
QuantitativeRelationSymbolEnum
.
EQ
.
getValue
(),
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
())
.
eq
(
query
.
getPointsRequireSymbol
()
==
QuantitativeRelationSymbolEnum
.
EQ
.
getValue
(),
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
())
.
lt
(
query
.
getPointsRequireSymbol
()
==
QuantitativeRelationSymbolEnum
.
LT
.
getValue
(),
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
());
.
lt
(
query
.
getPointsRequireSymbol
()
==
QuantitativeRelationSymbolEnum
.
LT
.
getValue
(),
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
());
}
}
//
兑换网
点id,领取方式,状态
//
提货
点id,领取方式,状态
lambdaQuery
.
eqIfPresent
(
RewardDO:
:
getNodeId
,
query
.
getNodeId
())
lambdaQuery
.
eqIfPresent
(
RewardDO:
:
getNodeId
,
query
.
getNodeId
())
.
eq
(
StringUtils
.
isNotBlank
(
query
.
getPickMethod
()),
RewardDO:
:
getPickMethod
,
query
.
getPickMethod
())
.
eq
(
StringUtils
.
isNotBlank
(
query
.
getPickMethod
()),
RewardDO:
:
getPickMethod
,
query
.
getPickMethod
())
.
eqIfPresent
(
RewardDO:
:
getStatus
,
query
.
getStatus
());
.
eqIfPresent
(
RewardDO:
:
getStatus
,
query
.
getStatus
());
...
@@ -340,22 +355,22 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
...
@@ -340,22 +355,22 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
rewardDOLambdaQuery
.
eq
(
RewardDO:
:
getNodeId
,
reqVO
.
getNodeId
());
rewardDOLambdaQuery
.
eq
(
RewardDO:
:
getNodeId
,
reqVO
.
getNodeId
());
}
else
{
}
else
{
UserRespDTO
user
=
memberUserApi
.
getUser
(
reqVO
.
getMemberId
());
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
.
setCity
(
user
.
getCity
().
longValue
());
appRewardListBackVO
.
setCountry
(
user
.
getCountry
().
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
);
appRewardListBackVO
.
setCity
(
null
);
}
}
// 国家和城市都获取不到
// 国家和城市都获取不到
if
(
CollectionUtil
.
isEmpty
(
nodes
))
{
if
(
CollectionUtil
.
isEmpty
(
warehouseList
))
{
nodes
=
nodeApi
.
getNodesByCity
(
null
,
130L
);
warehouseList
=
warehouseMapper
.
selectList
(
new
LambdaQueryWrapperX
<
WarehouseDO
>().
eq
(
WarehouseDO:
:
getGuojia
,
130L
)
);
appRewardListBackVO
.
setCountry
(
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
))
{
if
(
CollectionUtil
.
isNotEmpty
(
nodeIds
))
{
rewardDOLambdaQuery
.
in
(
RewardDO:
:
getNodeId
,
nodeIds
);
rewardDOLambdaQuery
.
in
(
RewardDO:
:
getNodeId
,
nodeIds
);
}
}
...
@@ -377,10 +392,12 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
...
@@ -377,10 +392,12 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
AppRewardBackVO
appRewardBackVO
=
new
AppRewardBackVO
();
AppRewardBackVO
appRewardBackVO
=
new
AppRewardBackVO
();
BeanUtils
.
copyProperties
(
rewardDO
,
appRewardBackVO
);
BeanUtils
.
copyProperties
(
rewardDO
,
appRewardBackVO
);
setPickMethod
(
appRewardBackVO
);
setPickMethod
(
appRewardBackVO
);
NodeRespDTO
nodesById
=
nodeApi
.
getNodesById
(
Long
.
valueOf
(
rewardDO
.
getNodeId
()));
WarehouseDO
warehouse
=
warehouseMapper
.
selectById
(
Long
.
valueOf
(
rewardDO
.
getNodeId
()));
if
(
nodesById
!=
null
)
{
if
(
warehouse
!=
null
)
{
appRewardBackVO
.
setNodeZh
(
nodesById
.
getGuojiaZh
()
+
"、"
+
nodesById
.
getShiZh
()
+
"、"
+
nodesById
.
getTitleZh
());
RegionDO
country
=
regionService
.
getRegion
(
warehouse
.
getGuojia
());
appRewardBackVO
.
setNodeEn
(
nodesById
.
getGuojiaEn
()
+
"、"
+
nodesById
.
getShiEn
()
+
"、"
+
nodesById
.
getTitleEn
());
RegionDO
city
=
regionService
.
getRegion
(
warehouse
.
getShi
());
appRewardBackVO
.
setNodeZh
(
country
.
getTitleZh
()
+
"、"
+
city
.
getTitleZh
()
+
"、"
+
warehouse
.
getTitleZh
());
appRewardBackVO
.
setNodeEn
(
country
.
getTitleEn
()
+
"、"
+
city
.
getTitleEn
()
+
"、"
+
warehouse
.
getTitleEn
());
}
}
return
appRewardBackVO
;
return
appRewardBackVO
;
}
}
...
@@ -422,22 +439,22 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
...
@@ -422,22 +439,22 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
*/
*/
private
List
<
Long
>
getMemberCityNodes
(
Long
memberId
)
{
private
List
<
Long
>
getMemberCityNodes
(
Long
memberId
)
{
UserRespDTO
user
=
memberUserApi
.
getUser
(
memberId
);
UserRespDTO
user
=
memberUserApi
.
getUser
(
memberId
);
List
<
NodeRespDTO
>
nodes
;
List
<
WarehouseDO
>
warehouseList
;
// 如果用户没有填写国家或城市默认展示中国的礼品
// 如果用户没有填写国家或城市默认展示中国的礼品
if
(
user
.
getCity
()
==
null
||
user
.
getCountry
()
==
null
)
{
if
(
user
.
getCity
()
==
null
||
user
.
getCountry
()
==
null
)
{
nodes
=
nodeApi
.
getNodesByCity
(
null
,
130L
);
warehouseList
=
warehouseMapper
.
selectList
(
new
LambdaQueryWrapperX
<
WarehouseDO
>().
eq
(
WarehouseDO:
:
getGuojia
,
130L
)
);
}
else
{
}
else
{
// 根据用户城市获取
// 根据用户城市获取
nodes
=
nodeApi
.
getNodesByCity
(
user
.
getCity
().
longValue
(),
null
);
warehouseList
=
warehouseMapper
.
selectList
(
new
LambdaQueryWrapperX
<
WarehouseDO
>().
eq
(
WarehouseDO:
:
getShi
,
user
.
getCity
().
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
()
));
}
}
}
}
// 国家和城市都获取不到
// 国家和城市都获取不到
if
(
CollectionUtil
.
isEmpty
(
nodes
))
{
if
(
CollectionUtil
.
isEmpty
(
warehouseList
))
{
nodes
=
nodeApi
.
getNodesByCity
(
null
,
130L
);
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 @
ffa5db4d
...
@@ -9,7 +9,6 @@ import lombok.Data;
...
@@ -9,7 +9,6 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.NotNull
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -60,11 +59,11 @@ public class RewardBackVO {
...
@@ -60,11 +59,11 @@ public class RewardBackVO {
@ApiModelProperty
(
value
=
"兑换所需积分"
,
required
=
true
)
@ApiModelProperty
(
value
=
"兑换所需积分"
,
required
=
true
)
private
Integer
pointsRequire
;
private
Integer
pointsRequire
;
@ExcelProperty
(
"
兑换网
点"
)
@ExcelProperty
(
"
提货
点"
)
@ApiModelProperty
(
value
=
"
兑换网
点"
,
required
=
true
)
@ApiModelProperty
(
value
=
"
提货
点"
,
required
=
true
)
private
Integer
nodeId
;
private
Integer
nodeId
;
@ApiModelProperty
(
value
=
"
兑换网点和积分
列表"
,
required
=
true
)
@ApiModelProperty
(
value
=
"
提货点,积分,剩余数量
列表"
,
required
=
true
)
private
List
<
RewardBackVO
.
NodeAndPoints
>
nodeIds
=
new
ArrayList
<>();
private
List
<
RewardBackVO
.
NodeAndPoints
>
nodeIds
=
new
ArrayList
<>();
@ExcelProperty
(
"已兑换次数"
)
@ExcelProperty
(
"已兑换次数"
)
...
@@ -122,9 +121,11 @@ public class RewardBackVO {
...
@@ -122,9 +121,11 @@ public class RewardBackVO {
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
public
static
class
NodeAndPoints
{
public
static
class
NodeAndPoints
{
@ApiModelProperty
(
value
=
"
兑换网
点"
)
@ApiModelProperty
(
value
=
"
提货
点"
)
private
Integer
nodeId
;
private
List
<
Integer
>
wareHouses
;
@ApiModelProperty
(
value
=
"
兑换网
点对应积分"
)
@ApiModelProperty
(
value
=
"
提货
点对应积分"
)
private
Integer
points
;
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 @
ffa5db4d
...
@@ -49,14 +49,14 @@ public class RewardCreateReqVO {
...
@@ -49,14 +49,14 @@ public class RewardCreateReqVO {
//@NotNull(message = "兑换网点不能为空")
//@NotNull(message = "兑换网点不能为空")
//private Integer nodeId;
//private Integer nodeId;
@ApiModelProperty
(
value
=
"
兑换网点和积分
列表"
,
required
=
true
)
@ApiModelProperty
(
value
=
"
提货点,积分,剩余数量
列表"
,
required
=
true
)
@NotNull
(
message
=
"兑换网点列表不能为空"
)
@NotNull
(
message
=
"兑换网点列表不能为空"
)
private
List
<
NodeAndPoints
>
nodeIds
;
private
List
<
NodeAndPoints
>
nodeIds
;
@ApiModelProperty
(
value
=
"剩余数量"
,
required
=
true
)
//
@ApiModelProperty(value = "剩余数量", required = true)
@NotNull
(
message
=
"剩余数量不能为空"
)
//
@NotNull(message = "剩余数量不能为空")
@Min
(
value
=
0
)
//
@Min(value = 0)
private
Integer
quantityRemain
;
//
private Integer quantityRemain;
@ApiModelProperty
(
value
=
"活动开始时间"
)
@ApiModelProperty
(
value
=
"活动开始时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
...
@@ -93,9 +93,11 @@ public class RewardCreateReqVO {
...
@@ -93,9 +93,11 @@ public class RewardCreateReqVO {
@Data
@Data
public
static
class
NodeAndPoints
{
public
static
class
NodeAndPoints
{
@ApiModelProperty
(
value
=
"
兑换网
点"
)
@ApiModelProperty
(
value
=
"
提货
点"
)
private
Integer
nodeId
;
private
List
<
Integer
>
wareHouses
;
@ApiModelProperty
(
value
=
"
兑换网
点对应积分"
)
@ApiModelProperty
(
value
=
"
提货
点对应积分"
)
private
Integer
points
;
private
Integer
points
;
@ApiModelProperty
(
value
=
"剩余数量"
)
private
Integer
quantityRemain
;
}
}
}
}
yudao-server/src/main/resources/i18n/messages_zh.properties
View file @
ffa5db4d
...
@@ -1028,7 +1028,7 @@ reward.score.not.enough = \u79EF\u5206\u4E0D\u8DB3
...
@@ -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.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.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.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
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
redeem.import.no.record
=
\u8868\u
683C
\u
4E2D
\u
65E0
\u
8BB0
\u
5F55
order.cargo.control.limit.update.consignee.error
=
\u
5F53
\u
524D
\u
63A7
\u
8D27
\u
8BA2
\u5355\u9650\u5236\u
4FEE
\u6539\u6536\u
8D27
\u
4EBA
\u
FF0C
\u
672A
\u
67E5
\u
8BE2
\u5230\u9650\u5236\u
65F6
\u
95F4
order.cargo.control.limit.update.consignee.error
=
\u
5F53
\u
524D
\u
63A7
\u
8D27
\u
8BA2
\u5355\u9650\u5236\u
4FEE
\u6539\u6536\u
8D27
\u
4EBA
\u
FF0C
\u
672A
\u
67E5
\u
8BE2
\u5230\u9650\u5236\u
65F6
\u
95F4
...
...
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