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
9ccf9251
Commit
9ccf9251
authored
Aug 14, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/feature_member_score' into dev
parents
e7152b1b
8b70a7be
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
198 additions
and
3 deletions
+198
-3
NodeApi.java
...in/java/cn/iocoder/yudao/module/ecw/api/node/NodeApi.java
+2
-0
NodeTreeRegionDTO.java
...oder/yudao/module/ecw/api/node/dto/NodeTreeRegionDTO.java
+43
-0
NodeController.java
...udao/module/ecw/controller/admin/node/NodeController.java
+6
-0
NodeTreeRegionSimpleVO.java
.../ecw/controller/admin/node/vo/NodeTreeRegionSimpleVO.java
+54
-0
NodeMapper.java
...n/iocoder/yudao/module/ecw/dal/mysql/node/NodeMapper.java
+2
-0
NodeApiImpl.java
.../cn/iocoder/yudao/module/ecw/service/api/NodeApiImpl.java
+6
-0
NodeService.java
...cn/iocoder/yudao/module/ecw/service/node/NodeService.java
+1
-0
NodeServiceImpl.java
...ocoder/yudao/module/ecw/service/node/NodeServiceImpl.java
+55
-0
NodeMapper.xml
...le-ecw-impl/src/main/resources/mapper/node/NodeMapper.xml
+20
-0
ScoreRuleExpireTask.java
.../iocoder/yudao/module/member/job/ScoreRuleExpireTask.java
+9
-3
No files found.
yudao-module-ecw/yudao-module-ecw-api/src/main/java/cn/iocoder/yudao/module/ecw/api/node/NodeApi.java
View file @
9ccf9251
package
cn
.
iocoder
.
yudao
.
module
.
ecw
.
api
.
node
;
import
cn.iocoder.yudao.module.ecw.api.node.dto.NodeRespDTO
;
import
cn.iocoder.yudao.module.ecw.api.node.dto.NodeTreeRegionDTO
;
import
java.util.List
;
public
interface
NodeApi
{
List
<
NodeRespDTO
>
getNodesByCity
(
Long
cityId
,
Long
countryId
);
List
<
NodeTreeRegionDTO
>
getNodeTreeRegion
();
}
yudao-module-ecw/yudao-module-ecw-api/src/main/java/cn/iocoder/yudao/module/ecw/api/node/dto/NodeTreeRegionDTO.java
0 → 100644
View file @
9ccf9251
package
cn
.
iocoder
.
yudao
.
module
.
ecw
.
api
.
node
.
dto
;
import
lombok.Data
;
@Data
public
class
NodeTreeRegionDTO
{
/**
* 国家id
*/
private
Long
countryId
;
/**
* 国家中文
*/
private
String
countryZh
;
/**
* 国家英文
*/
private
String
countryEn
;
/**
* 城市id
*/
private
Long
cityId
;
/**
* 城市中文
*/
private
String
cityZh
;
/**
* 城市英文
*/
private
String
cityEn
;
/**
* 网点id
*/
private
Long
nodeId
;
/**
* 网点中文
*/
private
String
nodeZh
;
/**
* 网点英文
*/
private
String
nodeEn
;
}
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/controller/admin/node/NodeController.java
View file @
9ccf9251
...
...
@@ -104,6 +104,12 @@ public class NodeController {
return
success
(
NodeConvert
.
INSTANCE
.
convertPage
(
pageResult
));
}
@GetMapping
(
"/get-node-tree-region"
)
@ApiOperation
(
"获得网点树状列表"
)
public
CommonResult
<
List
<
NodeTreeRegionSimpleVO
>>
getNodeTreeRegion
()
{
return
success
(
nodeService
.
getNodeTreeRegion
());
}
@GetMapping
(
"/export-excel"
)
@ApiOperation
(
"导出服务网点 Excel"
)
@PreAuthorize
(
"@ss.hasPermission('ecw:node:export')"
)
...
...
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/controller/admin/node/vo/NodeTreeRegionSimpleVO.java
0 → 100644
View file @
9ccf9251
package
cn
.
iocoder
.
yudao
.
module
.
ecw
.
controller
.
admin
.
node
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.Objects
;
@Data
public
class
NodeTreeRegionSimpleVO
{
@ApiModelProperty
(
"国家id"
)
private
Long
id
;
@ApiModelProperty
(
"国家中文名"
)
private
String
labelZh
;
@ApiModelProperty
(
"国家英文名"
)
private
String
labelEn
;
@ApiModelProperty
(
"城市"
)
private
List
<
NodeCity
>
children
;
@Data
public
static
class
NodeCity
{
@ApiModelProperty
(
"城市id"
)
private
Long
id
;
@ApiModelProperty
(
"城市中文名"
)
private
String
labelZh
;
@ApiModelProperty
(
"城市英文名"
)
private
String
labelEn
;
@ApiModelProperty
(
"网点"
)
private
List
<
Node
>
children
;
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
NodeCity
that
=
(
NodeCity
)
o
;
return
Objects
.
equals
(
id
,
that
.
id
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hashCode
(
id
);
}
}
@Data
public
static
class
Node
{
@ApiModelProperty
(
"网点id"
)
private
Long
id
;
@ApiModelProperty
(
"网点中文名"
)
private
String
labelZh
;
@ApiModelProperty
(
"网点英文名"
)
private
String
labelEn
;
}
}
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/dal/mysql/node/NodeMapper.java
View file @
9ccf9251
...
...
@@ -5,6 +5,7 @@ import java.util.*;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX
;
import
cn.iocoder.yudao.module.ecw.api.node.dto.NodeTreeRegionDTO
;
import
cn.iocoder.yudao.module.ecw.dal.dataobject.node.NodeDO
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
@@ -81,4 +82,5 @@ public interface NodeMapper extends BaseMapperX<NodeDO> {
.
orderByDesc
(
NodeDO:
:
getId
));
}
List
<
NodeTreeRegionDTO
>
getNodeTreeRegionList
();
}
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/service/api/NodeApiImpl.java
View file @
9ccf9251
...
...
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.ecw.service.api;
import
cn.iocoder.yudao.module.ecw.api.node.NodeApi
;
import
cn.iocoder.yudao.module.ecw.api.node.dto.NodeRespDTO
;
import
cn.iocoder.yudao.module.ecw.api.node.dto.NodeTreeRegionDTO
;
import
cn.iocoder.yudao.module.ecw.dal.dataobject.node.NodeDO
;
import
cn.iocoder.yudao.module.ecw.dal.mysql.node.NodeMapper
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -35,4 +36,9 @@ public class NodeApiImpl implements NodeApi {
}
return
null
;
}
@Override
public
List
<
NodeTreeRegionDTO
>
getNodeTreeRegion
()
{
return
nodeMapper
.
getNodeTreeRegionList
();
}
}
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/service/node/NodeService.java
View file @
9ccf9251
...
...
@@ -76,4 +76,5 @@ public interface NodeService {
*/
List
<
NodeDO
>
getNodeList
(
NodeExportReqVO
exportReqVO
);
List
<
NodeTreeRegionSimpleVO
>
getNodeTreeRegion
();
}
yudao-module-ecw/yudao-module-ecw-impl/src/main/java/cn/iocoder/yudao/module/ecw/service/node/NodeServiceImpl.java
View file @
9ccf9251
package
cn
.
iocoder
.
yudao
.
module
.
ecw
.
service
.
node
;
import
cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils
;
import
cn.iocoder.yudao.module.ecw.api.node.dto.NodeTreeRegionDTO
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -86,6 +87,60 @@ public class NodeServiceImpl implements NodeService {
return
nodeMapper
.
selectList
(
exportReqVO
);
}
@Override
public
List
<
NodeTreeRegionSimpleVO
>
getNodeTreeRegion
()
{
List
<
NodeTreeRegionDTO
>
nodeList
=
nodeMapper
.
getNodeTreeRegionList
();
Map
<
Long
,
NodeTreeRegionSimpleVO
>
countryMap
=
new
LinkedHashMap
<>();
Map
<
Long
,
Map
<
Long
,
NodeTreeRegionSimpleVO
.
NodeCity
>>
cityMap
=
new
LinkedHashMap
<>();
for
(
NodeTreeRegionDTO
dto
:
nodeList
)
{
Long
countryId
=
dto
.
getCountryId
();
String
countryZh
=
dto
.
getCountryZh
();
String
countryEn
=
dto
.
getCountryEn
();
Long
cityId
=
dto
.
getCityId
();
String
cityZh
=
dto
.
getCityZh
();
String
cityEn
=
dto
.
getCityEn
();
Long
nodeId
=
dto
.
getNodeId
();
String
nodeZh
=
dto
.
getNodeZh
();
String
nodeEn
=
dto
.
getNodeEn
();
// 处理国家
NodeTreeRegionSimpleVO
countryVO
=
countryMap
.
computeIfAbsent
(
countryId
,
id
->
{
NodeTreeRegionSimpleVO
vo
=
new
NodeTreeRegionSimpleVO
();
vo
.
setId
(
id
);
vo
.
setLabelZh
(
countryZh
.
trim
());
vo
.
setLabelEn
(
countryEn
);
vo
.
setChildren
(
new
ArrayList
<>());
return
vo
;
});
// 处理城市
Map
<
Long
,
NodeTreeRegionSimpleVO
.
NodeCity
>
cities
=
cityMap
.
computeIfAbsent
(
countryId
,
k
->
new
LinkedHashMap
<>());
NodeTreeRegionSimpleVO
.
NodeCity
cityVO
=
cities
.
computeIfAbsent
(
cityId
,
id
->
{
NodeTreeRegionSimpleVO
.
NodeCity
city
=
new
NodeTreeRegionSimpleVO
.
NodeCity
();
city
.
setId
(
id
);
city
.
setLabelZh
(
cityZh
.
trim
());
city
.
setLabelEn
(
cityEn
);
city
.
setChildren
(
new
ArrayList
<>());
return
city
;
});
// 处理网点
NodeTreeRegionSimpleVO
.
Node
node
=
new
NodeTreeRegionSimpleVO
.
Node
();
node
.
setId
(
nodeId
);
node
.
setLabelZh
(
nodeZh
);
node
.
setLabelEn
(
nodeEn
);
cityVO
.
getChildren
().
add
(
node
);
if
(!
countryVO
.
getChildren
().
contains
(
cityVO
))
{
countryVO
.
getChildren
().
add
(
cityVO
);
}
}
return
new
ArrayList
<>(
countryMap
.
values
());
}
@Override
public
PageResult
<
NodeDO
>
getNodePageList
(
NodePageReqVO
pageReqVO
)
{
IPage
<
NodeDO
>
mpPage
=
MyBatisUtils
.
buildPage
(
pageReqVO
);
...
...
yudao-module-ecw/yudao-module-ecw-impl/src/main/resources/mapper/node/NodeMapper.xml
View file @
9ccf9251
...
...
@@ -32,6 +32,26 @@
order by node.aorder desc
</select>
<select
id=
"getNodeTreeRegionList"
resultType=
"cn.iocoder.yudao.module.ecw.api.node.dto.NodeTreeRegionDTO"
>
SELECT
n.guojia AS countryId,
c.title_zh AS countryZh,
c.title_en AS countryEn,
n.shi AS cityId,
p.title_zh AS cityZh,
p.title_en AS cityEn,
n.id AS nodeId,
n.title_zh AS nodeZh,
n.title_en AS nodeEn
FROM
ecw_node n
LEFT JOIN
ecw_region c ON n.guojia = c.id
LEFT JOIN
ecw_region p ON n.shi = p.id
ORDER BY
n.guojia, n.shi, n.id;
</select>
</mapper>
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/job/ScoreRuleExpireTask.java
View file @
9ccf9251
...
...
@@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery
;
import
cn.iocoder.yudao.framework.quartz.core.handler.JobHandler
;
import
cn.iocoder.yudao.module.member.dal.dataobject.scoreRule.ScoreRuleDO
;
import
cn.iocoder.yudao.module.member.dal.redis.scoreRule.ScoreRuleRedisDao
;
import
cn.iocoder.yudao.module.member.enums.ScoreRuleStatusEnum
;
import
cn.iocoder.yudao.module.member.service.scoreRule.ScoreRuleService
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
...
...
@@ -15,7 +16,7 @@ import java.util.Date;
import
java.util.List
;
/**
*
会员积分
过期定时任务
*
积分规则
过期定时任务
*/
@Component
@Slf4j
...
...
@@ -30,6 +31,8 @@ public class ScoreRuleExpireTask implements JobHandler {
@Resource
private
ScoreRuleService
scoreRuleService
;
@Resource
private
ScoreRuleRedisDao
scoreRuleRedisDao
;
@Override
public
String
execute
(
String
param
)
throws
Exception
{
...
...
@@ -42,8 +45,11 @@ public class ScoreRuleExpireTask implements JobHandler {
if
(
CollectionUtils
.
isEmpty
(
todoList
))
{
return
"success"
;
}
else
{
todoList
.
forEach
(
scoreRuleDO
->
scoreRuleDO
.
setStatus
(
ScoreRuleStatusEnum
.
EXPIRED
.
getValue
()));
scoreRuleService
.
updateBatch
(
todoList
);
todoList
.
forEach
(
scoreRuleDO
->
{
scoreRuleDO
.
setStatus
(
ScoreRuleStatusEnum
.
EXPIRED
.
getValue
());
scoreRuleRedisDao
.
deleteEnableScoreRule
(
scoreRuleDO
.
getType
());
scoreRuleService
.
updateById
(
scoreRuleDO
);
});
}
return
"success"
;
}
...
...
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