记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
董敬伟
liquidnet-bus-v1
Commits
e3d7f75b
Commit
e3d7f75b
authored
Sep 17, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计task
parent
37c1e094
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
213 additions
and
2 deletions
+213
-2
FeignSweetTaskActivityClient.java
...ervice/feign/sweet/task/FeignSweetTaskActivityClient.java
+19
-0
SweetCityVoteController.java
...net/service/sweet/controller/SweetCityVoteController.java
+6
-0
SweetCityVoteStatDto.java
...com/liquidnet/service/sweet/dto/SweetCityVoteStatDto.java
+39
-0
SweetCityVoteStat.java
...com/liquidnet/service/sweet/entity/SweetCityVoteStat.java
+63
-0
SweetCityVoteStatMapper.java
...quidnet/service/sweet/mapper/SweetCityVoteStatMapper.java
+20
-0
ISweetCityVoteService.java
...iquidnet/service/sweet/service/ISweetCityVoteService.java
+1
-0
SweetCityVoteServiceImpl.java
.../service/sweet/service/impl/SweetCityVoteServiceImpl.java
+24
-0
ObjectUtil.java
...in/java/com/liquidnet/service/sweet/utils/ObjectUtil.java
+6
-0
SweetCItyVoteStatVo.java
...a/com/liquidnet/service/sweet/vo/SweetCItyVoteStatVo.java
+16
-2
SweetCityVoteStatMapper.xml
...iquidnet/service/sweet/mapper/SweetCityVoteStatMapper.xml
+19
-0
No files found.
liquidnet-bus-feign/liquidnet-api-feign-sweet/src/main/java/com/liquidnet/service/feign/sweet/task/FeignSweetTaskActivityClient.java
0 → 100644
View file @
e3d7f75b
package
com
.
liquidnet
.
service
.
feign
.
sweet
.
task
;
import
com.liquidnet.service.base.ResponseDto
;
import
feign.hystrix.FallbackFactory
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.PostMapping
;
@Component
@FeignClient
(
name
=
"liquidnet-service-sweet"
,
contextId
=
"FeignSweetTaskActivityClient"
,
path
=
""
,
url
=
"${liquidnet.service.sweet.url}"
,
fallback
=
FallbackFactory
.
Default
.
class
)
public
interface
FeignSweetTaskActivityClient
{
@PostMapping
(
"sweet/sweetCityVote/setStatList"
)
ResponseDto
<
Boolean
>
setStatList
();
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetCityVoteController.java
View file @
e3d7f75b
...
@@ -41,4 +41,10 @@ public class SweetCityVoteController {
...
@@ -41,4 +41,10 @@ public class SweetCityVoteController {
return
sweetCityVoteService
.
createVote
(
param
);
return
sweetCityVoteService
.
createVote
(
param
);
}
}
@GetMapping
(
"setStatList"
)
@ApiOperation
(
"统计投票排名"
)
public
ResponseDto
setStatList
()
{
return
sweetCityVoteService
.
setStatList
();
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/dto/SweetCityVoteStatDto.java
0 → 100644
View file @
e3d7f75b
package
com
.
liquidnet
.
service
.
sweet
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
@ApiModel
public
class
SweetCityVoteStatDto
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
3159959399631688127L
;
@ApiModelProperty
(
"城市代码"
)
private
String
cityCode
;
@ApiModelProperty
(
"城市名称"
)
private
String
cityName
;
@ApiModelProperty
(
"真实投票数量"
)
private
Integer
voteNum
;
@ApiModelProperty
(
"手动增加投票数量"
)
private
Integer
manualVoteNum
;
@ApiModelProperty
(
"总投票数"
)
private
Integer
totalNum
;
private
static
final
SweetCityVoteStatDto
obj
=
new
SweetCityVoteStatDto
();
public
static
SweetCityVoteStatDto
getNew
()
{
try
{
return
(
SweetCityVoteStatDto
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
SweetCityVoteStatDto
();
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/entity/SweetCityVoteStat.java
0 → 100644
View file @
e3d7f75b
package
com
.
liquidnet
.
service
.
sweet
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
* 城市投票统计表
* </p>
*
* @author jiangxiulong
* @since 2021-09-15
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
SweetCityVoteStat
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"mid"
,
type
=
IdType
.
AUTO
)
private
Long
mid
;
/**
* stat_id
*/
private
String
statId
;
/**
* 城市代码
*/
private
String
cityCode
;
/**
* 城市名称
*/
private
String
cityName
;
/**
* 真实投票数量
*/
private
Integer
voteNum
;
/**
* 手动增加投票数量
*/
private
Integer
manualVoteNum
;
/**
* 创建时间
*/
private
LocalDateTime
createdAt
;
/**
* 更新时间
*/
private
LocalDateTime
updatedAt
;
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/mapper/SweetCityVoteStatMapper.java
0 → 100644
View file @
e3d7f75b
package
com
.
liquidnet
.
service
.
sweet
.
mapper
;
import
com.liquidnet.service.sweet.dto.SweetCityVoteStatDto
;
import
com.liquidnet.service.sweet.entity.SweetCityVoteStat
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
* <p>
* 城市投票统计表 Mapper 接口
* </p>
*
* @author jiangxiulong
* @since 2021-09-15
*/
public
interface
SweetCityVoteStatMapper
extends
BaseMapper
<
SweetCityVoteStat
>
{
List
<
SweetCityVoteStatDto
>
getStatList
();
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/ISweetCityVoteService.java
View file @
e3d7f75b
...
@@ -22,4 +22,5 @@ public interface ISweetCityVoteService extends IService<SweetCityVote> {
...
@@ -22,4 +22,5 @@ public interface ISweetCityVoteService extends IService<SweetCityVote> {
ResponseDto
createVote
(
SweetCityVoteParam
param
);
ResponseDto
createVote
(
SweetCityVoteParam
param
);
ResponseDto
setStatList
();
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetCityVoteServiceImpl.java
View file @
e3d7f75b
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.adam.dto.vo.AdamMemberOrderSimpleVo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.kylin.dto.vo.PerformanceOrderStatisticalVo
;
import
com.liquidnet.service.sweet.dto.SweetCityVoteStatDto
;
import
com.liquidnet.service.sweet.entity.SweetCityVote
;
import
com.liquidnet.service.sweet.entity.SweetCityVote
;
import
com.liquidnet.service.sweet.mapper.SweetCityVoteMapper
;
import
com.liquidnet.service.sweet.mapper.SweetCityVoteMapper
;
import
com.liquidnet.service.sweet.mapper.SweetCityVoteStatMapper
;
import
com.liquidnet.service.sweet.param.SweetCityVoteParam
;
import
com.liquidnet.service.sweet.param.SweetCityVoteParam
;
import
com.liquidnet.service.sweet.service.ISweetCityVoteService
;
import
com.liquidnet.service.sweet.service.ISweetCityVoteService
;
import
com.liquidnet.service.sweet.utils.ObjectUtil
;
import
com.liquidnet.service.sweet.utils.QueueUtils
;
import
com.liquidnet.service.sweet.utils.QueueUtils
;
import
com.liquidnet.service.sweet.utils.RedisDataUtils
;
import
com.liquidnet.service.sweet.utils.RedisDataUtils
;
import
com.liquidnet.service.sweet.vo.SweetCItyVoteStatVo
;
import
com.liquidnet.service.sweet.vo.SweetCItyVoteStatVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -36,6 +48,8 @@ public class SweetCityVoteServiceImpl extends ServiceImpl<SweetCityVoteMapper, S
...
@@ -36,6 +48,8 @@ public class SweetCityVoteServiceImpl extends ServiceImpl<SweetCityVoteMapper, S
private
RedisDataUtils
redisDataUtils
;
private
RedisDataUtils
redisDataUtils
;
@Autowired
@Autowired
QueueUtils
queueUtils
;
QueueUtils
queueUtils
;
@Autowired
private
SweetCityVoteStatMapper
sweetCityVoteStatMapper
;
@Override
@Override
public
ResponseDto
<
List
<
SweetCItyVoteStatVo
>>
getList
()
{
public
ResponseDto
<
List
<
SweetCItyVoteStatVo
>>
getList
()
{
...
@@ -85,4 +99,14 @@ public class SweetCityVoteServiceImpl extends ServiceImpl<SweetCityVoteMapper, S
...
@@ -85,4 +99,14 @@ public class SweetCityVoteServiceImpl extends ServiceImpl<SweetCityVoteMapper, S
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
public
ResponseDto
setStatList
()
{
List
<
SweetCityVoteStatDto
>
list
=
sweetCityVoteStatMapper
.
getStatList
();
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
ArrayList
<
SweetCItyVoteStatVo
>
newList
=
ObjectUtil
.
getSweetCItyVoteStatVoList
();
list
.
forEach
(
r
->
newList
.
add
(
SweetCItyVoteStatVo
.
getNew
().
copy
(
r
)));
redisDataUtils
.
setSweetCityVoteStatList
(
newList
);
}
return
ResponseDto
.
success
();
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/utils/ObjectUtil.java
View file @
e3d7f75b
...
@@ -7,6 +7,7 @@ import com.liquidnet.service.sweet.dto.SweetManualArtistListDto;
...
@@ -7,6 +7,7 @@ import com.liquidnet.service.sweet.dto.SweetManualArtistListDto;
import
com.liquidnet.service.sweet.dto.SweetManualArtistListMDSKDto
;
import
com.liquidnet.service.sweet.dto.SweetManualArtistListMDSKDto
;
import
com.liquidnet.service.sweet.entity.SweetManualShop
;
import
com.liquidnet.service.sweet.entity.SweetManualShop
;
import
com.liquidnet.service.sweet.entity.SweetManualShopMdsk
;
import
com.liquidnet.service.sweet.entity.SweetManualShopMdsk
;
import
com.liquidnet.service.sweet.vo.SweetCItyVoteStatVo
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -18,6 +19,7 @@ public class ObjectUtil {
...
@@ -18,6 +19,7 @@ public class ObjectUtil {
private
static
final
ArrayList
<
SweetManualAppletMDSKDto
>
sweetManualAppletMDSKDtoList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
SweetManualAppletMDSKDto
>
sweetManualAppletMDSKDtoList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
SweetManualArtistListMDSKDto
>
sweetManualArtistListMDSKDtoList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
SweetManualArtistListMDSKDto
>
sweetManualArtistListMDSKDtoList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
SweetManualShopMdsk
>
sweetManualShopMDSKList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
SweetManualShopMdsk
>
sweetManualShopMDSKList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
SweetCItyVoteStatVo
>
sweetCItyVoteStatVoList
=
new
ArrayList
<>();
public
static
ArrayList
<
SweetManualAppletDto
>
getSweetManualAppletDtoList
()
{
public
static
ArrayList
<
SweetManualAppletDto
>
getSweetManualAppletDtoList
()
{
return
(
ArrayList
<
SweetManualAppletDto
>)
sweetManualAppletDtoList
.
clone
();
return
(
ArrayList
<
SweetManualAppletDto
>)
sweetManualAppletDtoList
.
clone
();
...
@@ -43,4 +45,8 @@ public class ObjectUtil {
...
@@ -43,4 +45,8 @@ public class ObjectUtil {
public
static
ArrayList
<
SweetManualShopMdsk
>
getSweetManualShopMdskList
()
{
public
static
ArrayList
<
SweetManualShopMdsk
>
getSweetManualShopMdskList
()
{
return
(
ArrayList
<
SweetManualShopMdsk
>)
sweetManualShopMDSKList
.
clone
();
return
(
ArrayList
<
SweetManualShopMdsk
>)
sweetManualShopMDSKList
.
clone
();
}
}
public
static
ArrayList
<
SweetCItyVoteStatVo
>
getSweetCItyVoteStatVoList
()
{
return
(
ArrayList
<
SweetCItyVoteStatVo
>)
sweetCItyVoteStatVoList
.
clone
();
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/vo/SweetCItyVoteStatVo.java
View file @
e3d7f75b
...
@@ -2,6 +2,7 @@ package com.liquidnet.service.sweet.vo;
...
@@ -2,6 +2,7 @@ package com.liquidnet.service.sweet.vo;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.liquidnet.service.sweet.dto.SweetCityVoteStatDto
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -25,10 +26,13 @@ public class SweetCItyVoteStatVo implements Serializable, Cloneable {
...
@@ -25,10 +26,13 @@ public class SweetCItyVoteStatVo implements Serializable, Cloneable {
private
String
cityName
;
private
String
cityName
;
@ApiModelProperty
(
"真实投票数量"
)
@ApiModelProperty
(
"真实投票数量"
)
private
String
voteNum
;
private
Integer
voteNum
;
@ApiModelProperty
(
"手动增加投票数量"
)
@ApiModelProperty
(
"手动增加投票数量"
)
private
String
manualVoteNum
;
private
Integer
manualVoteNum
;
@ApiModelProperty
(
"总投票数"
)
private
Integer
totalNum
;
/*@ApiModelProperty("创建时间")
/*@ApiModelProperty("创建时间")
private LocalDateTime createdAt;
private LocalDateTime createdAt;
...
@@ -45,4 +49,14 @@ public class SweetCItyVoteStatVo implements Serializable, Cloneable {
...
@@ -45,4 +49,14 @@ public class SweetCItyVoteStatVo implements Serializable, Cloneable {
}
}
}
}
public
SweetCItyVoteStatVo
copy
(
SweetCityVoteStatDto
source
)
{
if
(
null
==
this
)
return
this
;
this
.
setCityCode
(
source
.
getCityCode
());
this
.
setCityName
(
source
.
getCityName
());
this
.
setVoteNum
(
source
.
getVoteNum
());
this
.
setManualVoteNum
(
source
.
getManualVoteNum
());
this
.
setTotalNum
(
source
.
getTotalNum
());
return
this
;
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/resources/com/liquidnet/service/sweet/mapper/SweetCityVoteStatMapper.xml
0 → 100644
View file @
e3d7f75b
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.liquidnet.service.sweet.mapper.SweetCityVoteStatMapper"
>
<resultMap
id=
"getListResult"
type=
"com.liquidnet.service.sweet.dto.SweetCityVoteStatDto"
>
<result
column=
"city_code"
property=
"cityCode"
/>
<result
column=
"city_name"
property=
"cityName"
/>
<result
column=
"vote_num"
property=
"voteNum"
/>
<result
column=
"manual_vote_num"
property=
"manualVoteNum"
/>
<result
column=
"total_num"
property=
"totalNum"
/>
</resultMap>
<select
id=
"getStatList"
resultMap=
"getListResult"
>
select
*, (vote_num + manual_vote_num) as total_num
from sweet_city_vote_stat
ORDER BY total_num DESC
</select>
</mapper>
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