记得上下班打卡 | git大法好,push需谨慎

Commit be643502 authored by jiangxiulong's avatar jiangxiulong

Merge branch 'jxl_1018_active' into pre

parents 68d6fc30 d2c358c0
......@@ -33,8 +33,8 @@ public class KylinTableStatusConst {
public static final Integer ORDER_REFUND_STATUS_REFUNDED = 4; // 完成退款
public static final Integer ORDER_REFUND_STATUS_REJECT = 5; // 运营审核驳回退款 等同取消
public static final Integer ORDER_REFUND_STATUS_ERROR = 6; // 退款失败
public static final Integer ORDER_REFUND_STATUS_UNFILLED = 7; // 二审同意 等待退款
public static final Integer ORDER_REFUND_STATUS_REFUSE = 8; // 二审拒绝
public static final Integer ORDER_REFUND_STATUS_UNFILLED = 7; // 财务审核同意 等待退款
public static final Integer ORDER_REFUND_STATUS_REFUSE = 8; // 财务审核拒绝
public static final Integer ORDER_REFUND_STATUS_TICKET = 9; // 票务确认收货
public static final Integer ORDER_REFUND_TYPE_APPLY = 0; // 客服、票务人工申请,可以取消退款,回调再处理库存和券
......
......@@ -15,14 +15,14 @@ INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, ur
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2012, '取消', 2007, 1, '#', 'menuItem', 'F', '0', '1', 'kylin:refund:cancel', '#', 'admin', '2021-06-02 16:48:35', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2013, '提交申请', 2007, 2, '#', 'menuItem', 'F', '0', '1', 'kylin:refund:apple', '#', 'admin', '2021-06-02 16:49:18', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2014, '运营审核', 2007, 3, '#', 'menuItem', 'F', '0', '1', 'kylin:refund:review', '#', 'admin', '2021-06-02 16:50:17', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2015, '二审', 2007, 4, '#', 'menuItem', 'F', '0', '1', 'kylin:refund:execute', '#', 'admin', '2021-06-02 16:50:44', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2015, '财务审核', 2007, 4, '#', 'menuItem', 'F', '0', '1', 'kylin:refund:execute', '#', 'admin', '2021-06-02 16:50:44', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2016, '主动完成退款', 2007, 5, '#', 'menuItem', 'F', '0', '1', 'kylin:refund:completed', '#', 'admin', '2021-06-02 16:53:42', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2008, '演出退款管理', 2006, 1, '/kylin/refundBatch', 'menuItem', 'C', '0', '1', 'kylin:refundBatch:list', '#', 'admin', '2021-06-01 11:07:19', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2018, '详情', 2008, 0, '#', 'menuItem', 'F', '0', '1', 'kylin:refundBatch:detail', '#', 'admin', '2021-06-03 19:21:53', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2019, '取消', 2008, 1, '#', 'menuItem', 'F', '0', '1', 'kylin:refundBatch:cancel', '#', 'admin', '2021-06-03 19:22:25', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2020, '提交申请', 2008, 2, '#', 'menuItem', 'F', '0', '1', 'kylin:refundBatch:apply', '#', 'admin', '2021-06-03 19:22:55', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2021, '运营审核', 2008, 3, '#', 'menuItem', 'F', '0', '1', 'kylin:refundBatch:review', '#', 'admin', '2021-06-03 19:23:27', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2022, '二审', 2008, 4, '#', 'menuItem', 'F', '0', '1', 'kylin:refundBatch:execute', '#', 'admin', '2021-06-03 19:23:52', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2022, '财务审核', 2008, 4, '#', 'menuItem', 'F', '0', '1', 'kylin:refundBatch:execute', '#', 'admin', '2021-06-03 19:23:52', '', null, '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2023, '会员管理', 2000, 3, '#', 'menuItem', 'C', '0', '1', '', '#', 'admin', '2021-06-06 17:24:23', 'admin', '2021-06-07 20:02:44', '');
INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, url, target, menu_type, visible, is_refresh, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (2024, '会员订单', 2023, 1, '/adam/order/orderList', 'menuItem', 'C', '0', '1', null, '#', 'admin', '2021-06-06 17:26:44', '', null, '');
......
......@@ -5,6 +5,7 @@ import feign.hystrix.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Component
@FeignClient(name = "liquidnet-service-sweet",
......@@ -14,6 +15,6 @@ import org.springframework.web.bind.annotation.GetMapping;
public interface FeignSweetTaskActivityClient {
@GetMapping("sweet/sweetCityVote/setStatList")
ResponseDto<Boolean> setStatList();
ResponseDto<Boolean> setStatList(@RequestParam("type") Integer type);
}
......@@ -2,6 +2,7 @@ package com.liquidnet.service.executor.main.handler;
import com.liquidnet.service.feign.sweet.task.FeignSweetTaskActivityClient;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -21,7 +22,9 @@ public class SweetCityVoteTaskHandler {
@XxlJob(value = "sev-sweet:cityVoteStat")
public ReturnT<String> cityVoteStatHandler() {
try {
Boolean data = feignSweetTaskActivityClient.setStatList().getData();
String jobParam = XxlJobHelper.getJobParam();//执行参数
log.info("jobParam = " + Integer.parseInt(jobParam));
Boolean data = feignSweetTaskActivityClient.setStatList(Integer.parseInt(jobParam)).getData();
log.info("cityVoteStatHandler:结果:{}", data);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(String.valueOf(data));
......
......@@ -814,10 +814,10 @@ CREATE TABLE `kylin_order_express`
`order_tickets_id` varchar(255) NOT NULL DEFAULT '' COMMENT '订单id',
`order_express_code` varchar(255) NOT NULL DEFAULT '' COMMENT '订单快递编号',
`mailno` varchar(255) NOT NULL DEFAULT '' COMMENT '顺丰运单号',
`express_type` tinyint NOT NULL DEFAULT 0 COMMENT '快件产品类型 1顺丰特快...',
`express_type` tinyint NOT NULL DEFAULT 0 COMMENT '快件产品类型 1顺丰特快 2标快...',
`filter_result` varchar(2) NOT NULL DEFAULT '0' COMMENT '1-人工确认;2-可收派;3-不可以收派',
`remark` varchar(255) NOT NULL DEFAULT '' COMMENT 'filter_result=3时返回不可以收派的原因代码',
`express_status` tinyint NOT NULL DEFAULT 0 COMMENT '快递状态',
`express_status` smallint(6) NOT NULL DEFAULT 0 COMMENT '快递状态',
`origincode` varchar(255) NOT NULL DEFAULT '' COMMENT '原寄地区域代码 可用于顺丰电子面单标签打印',
`destcode` varchar(255) NOT NULL DEFAULT '' COMMENT '目的地区域代码 可用于顺丰电子面单标签打印',
......
......@@ -490,6 +490,7 @@ CREATE TABLE `sweet_city_vote`
`phone` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号',
`openId` varchar(255) NOT NULL DEFAULT '' COMMENT 'openId',
`unionId` varchar(255) NOT NULL DEFAULT '' COMMENT 'unionId',
`type` tinyint NOT NULL DEFAULT 1 COMMENT '活动类型 1新裤子 2莫宰羊',
`city_code` varchar(255) NOT NULL DEFAULT '' COMMENT '城市代码',
`city_name` varchar(255) NOT NULL DEFAULT '' COMMENT '城市名称',
`day_time` varchar(255) NOT NULL DEFAULT '' COMMENT '投票天',
......@@ -511,6 +512,7 @@ CREATE TABLE `sweet_city_vote_stat`
`city_name` varchar(255) NOT NULL DEFAULT '' COMMENT '城市名称',
`vote_num` int NOT NULL DEFAULT 0 COMMENT '真实投票数量',
`manual_vote_num` int NOT NULL DEFAULT 0 COMMENT '手动增加投票数量',
`type` tinyint NOT NULL DEFAULT 1 COMMENT '活动类型 1新裤子 2莫宰羊',
`created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`mid`),
......
......@@ -26,7 +26,8 @@ public class SweetConstant {
public final static String REDIS_KEY_SWEET_ANSWER_PHONE="sweet:answer:phone:";
public final static String REDIS_KEY_SWEET_CITY_VOTE_STAT_LIST="sweet:cityVote:StatList";
public final static String REDIS_KEY_SWEET_CITY_VOTE_CITY_CODE="sweet:cityVote:cityCode:";
public final static String REDIS_KEY_SWEET_CITY_VOTE_USER="sweet:cityVote:user:";
public final static String REDIS_KEY_SWEET_CITY_VOTE="sweet:cityVote";
public final static String REDIS_KEY_SWEET_CITY_VOTE_USER=":user:";
public final static String REDIS_KEY_SWEET_CITY_VOTE_STAT_UPDATE_TIME="sweet:cityVote:updateTime";
public final static String REDIS_KEY_SWEET_WECHAT_USER_INFO_MODERNSKY="sweet:wechatUser:modernsky:unionId:";
......
......@@ -32,28 +32,30 @@ public class SweetCityVoteController {
private ISweetCityVoteService sweetCityVoteService;
@GetMapping("statList")
@ApiOperation("城市投票排名")
@ApiOperation("城市投票排名列表")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "phone", value = "手机号", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "unionId", value = "unionId", required = true)
@ApiImplicitParam(type = "query", dataType = "String", name = "unionId", value = "unionId", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = "活动类型 1新裤子 2莫宰羊", required = false)
})
public ResponseDto<List<SweetCItyVoteStatVo>> getList(
@RequestParam String phone,
@RequestParam String unionId
@RequestParam String unionId,
@RequestParam(defaultValue = "1") Integer type
) {
return sweetCityVoteService.getList(phone, unionId);
return sweetCityVoteService.getList(phone, unionId, type);
}
@PostMapping("createVote")
@ApiOperation("用户投票记录")
@ApiOperation("用户投票")
public ResponseDto createVote(@Valid @RequestBody SweetCityVoteParam param) {
return sweetCityVoteService.createVote(param);
}
@GetMapping("setStatList")
@ApiOperation("统计投票排名")
public ResponseDto setStatList() {
return sweetCityVoteService.setStatList();
public ResponseDto setStatList(@RequestParam Integer type) {
return sweetCityVoteService.setStatList(type);
}
}
......@@ -27,6 +27,9 @@ public class SweetCityVoteStatDto implements Serializable ,Cloneable{
@ApiModelProperty("总投票数")
private Integer totalNum;
@ApiModelProperty("type")
private Integer type;
private static final SweetCityVoteStatDto obj = new SweetCityVoteStatDto();
public static SweetCityVoteStatDto getNew() {
......
......@@ -47,6 +47,11 @@ public class SweetCityVote implements Serializable {
@TableField("unionId")
private String unionId;
/**
* 活动类型 1新裤子 2莫宰羊
*/
private Integer type;
/**
* 城市代码
*/
......
......@@ -49,6 +49,11 @@ public class SweetCityVoteStat implements Serializable {
*/
private Integer manualVoteNum;
/**
* type
*/
private Integer type;
/**
* 创建时间
*/
......
......@@ -16,5 +16,5 @@ import java.util.List;
*/
public interface SweetCityVoteStatMapper extends BaseMapper<SweetCityVoteStat> {
List<SweetCityVoteStatDto> getStatList();
List<SweetCityVoteStatDto> getStatList(Integer type);
}
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@ApiModel(value = "SweetCityVoteParam", description = "用户投票记录入参")
......@@ -29,4 +30,8 @@ public class SweetCityVoteParam implements Serializable {
@NotBlank(message = "cityName不能为空")
private String cityName;
@ApiModelProperty(position = 14, required = true, value = "活动类型 1新裤子 2莫宰羊", example = "1")
@NotNull(message = "type不能为空")
private Integer type;
}
......@@ -20,7 +20,7 @@ public interface ISweetCityVoteService extends IService<SweetCityVote> {
ResponseDto createVote(SweetCityVoteParam param);
ResponseDto setStatList();
ResponseDto setStatList(Integer type);
ResponseDto<List<SweetCItyVoteStatVo>> getList(String phone, String unionId);
ResponseDto<List<SweetCItyVoteStatVo>> getList(String phone, String unionId, Integer type);
}
......@@ -46,9 +46,9 @@ public class SweetCityVoteServiceImpl extends ServiceImpl<SweetCityVoteMapper, S
private SweetCityVoteStatMapper sweetCityVoteStatMapper;
@Override
public ResponseDto getList(String phone, String unionId) {
List<SweetCItyVoteStatVo> sweetCityVoteStatList = redisDataUtils.getSweetCityVoteStatList();
SweetCityVoteParam userVote = redisDataUtils.getUserVote(phone, unionId);
public ResponseDto getList(String phone, String unionId, Integer type) {
List<SweetCItyVoteStatVo> sweetCityVoteStatList = redisDataUtils.getSweetCityVoteStatList(type);
SweetCityVoteParam userVote = redisDataUtils.getUserVote(phone, unionId, type);
if (!CollectionUtils.isEmpty(sweetCityVoteStatList)) {
for (SweetCItyVoteStatVo info : sweetCityVoteStatList) {
if (null == userVote) {
......@@ -64,14 +64,14 @@ public class SweetCityVoteServiceImpl extends ServiceImpl<SweetCityVoteMapper, S
HashMap<String, Object> stringObjectHashMap = CollectionUtil.mapStringObject();
stringObjectHashMap.put("list", sweetCityVoteStatList);
stringObjectHashMap.put("userVote", userVote);
stringObjectHashMap.put("statUpdateTime", redisDataUtils.getSweetCityVoteStatUpdateTime());
stringObjectHashMap.put("statUpdateTime", redisDataUtils.getSweetCityVoteStatUpdateTime(type));
return ResponseDto.success(stringObjectHashMap);
}
@Override
public ResponseDto createVote(SweetCityVoteParam param) {
SweetCityVoteParam userVote = redisDataUtils.getUserVote(param.getPhone(), param.getUnionId());
SweetCityVoteParam userVote = redisDataUtils.getUserVote(param.getPhone(), param.getUnionId(), param.getType());
if (null != userVote) {
return ResponseDto.failure("已经投过票啦~");
}
......@@ -83,6 +83,7 @@ public class SweetCityVoteServiceImpl extends ServiceImpl<SweetCityVoteMapper, S
aNew.setUnionId(param.getUnionId());
aNew.setCityCode(param.getCityCode());
aNew.setCityName(param.getCityName());
aNew.setType(param.getType());
LinkedList<String> sqls = CollectionUtil.linkedListString();
......@@ -90,38 +91,38 @@ public class SweetCityVoteServiceImpl extends ServiceImpl<SweetCityVoteMapper, S
LinkedList<Object[]> sqlsDataB = CollectionUtil.linkedListObjectArr();
sqls.add(SqlMapping.get("sweet_city_vote.insert"));
sqlsDataA.add(new Object[]{
aNew.getVoteId(), aNew.getPhone(), sweetWechatOpenId, aNew.getUnionId(), aNew.getCityCode(), aNew.getCityName(), DateUtil.format(LocalDateTime.now(), DateUtil.Formatter.yyyyMMdd)
aNew.getVoteId(), aNew.getPhone(), sweetWechatOpenId, aNew.getUnionId(), aNew.getType(), aNew.getCityCode(), aNew.getCityName(), DateUtil.format(LocalDateTime.now(), DateUtil.Formatter.yyyyMMdd)
});
Integer cityVoteNum = redisDataUtils.getSweetCityVote(aNew.getCityCode());
Integer cityVoteNum = redisDataUtils.getSweetCityVote(aNew.getCityCode(), aNew.getType());
if (cityVoteNum > 0) { // 已有 incr
sqls.add(SqlMapping.get("sweet_city_vote_stat.update"));
sqlsDataB.add(new Object[]{
LocalDateTime.now(), aNew.getCityCode()
LocalDateTime.now(), aNew.getCityCode(), aNew.getType()
});
} else { // insert
sqls.add(SqlMapping.get("sweet_city_vote_stat.insert"));
sqlsDataB.add(new Object[]{
IDGenerator.nextSnowId(), aNew.getCityCode(), aNew.getCityName(), 1
IDGenerator.nextSnowId(), aNew.getCityCode(), aNew.getCityName(), 1, aNew.getType()
});
}
queueUtils.sendMsgByRedis(MQConst.SweetQueue.SWEET_CITY_VOTE_DRAW.getKey(),
SqlMapping.gets(sqls, sqlsDataA, sqlsDataB));
redisDataUtils.incrSweetCityVote(aNew.getCityCode());
redisDataUtils.incrSweetCityVote(aNew.getCityCode(), aNew.getType());
redisDataUtils.setUserVote(param.getPhone(), param.getUnionId(), param);
return ResponseDto.success();
}
public ResponseDto setStatList() {
List<SweetCityVoteStatDto> list = sweetCityVoteStatMapper.getStatList();
public ResponseDto setStatList(Integer type) {
List<SweetCityVoteStatDto> list = sweetCityVoteStatMapper.getStatList(type);
if (!CollectionUtils.isEmpty(list)) {
ArrayList<SweetCItyVoteStatVo> newList = ObjectUtil.getSweetCItyVoteStatVoList();
list.forEach(r -> newList.add(SweetCItyVoteStatVo.getNew().copy(r)));
redisDataUtils.setSweetCityVoteStatList(newList);
redisDataUtils.setSweetCityVoteStatList(newList, type);
}
redisDataUtils.setSweetCityVoteStatUpdateTime();
redisDataUtils.setSweetCityVoteStatUpdateTime(type);
return ResponseDto.success();
}
}
......@@ -492,12 +492,12 @@ public class RedisDataUtils {
}
// 投票
public void setSweetCityVoteStatList(List<SweetCItyVoteStatVo> sweetCItyVoteStatVo) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_STAT_LIST;
public void setSweetCityVoteStatList(List<SweetCItyVoteStatVo> sweetCItyVoteStatVo, Integer type) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_STAT_LIST.concat(String.valueOf(type));
redisUtil.set(redisKey, sweetCItyVoteStatVo);
}
public List<SweetCItyVoteStatVo> getSweetCityVoteStatList() {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_STAT_LIST;
public List<SweetCItyVoteStatVo> getSweetCityVoteStatList(Integer type) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_STAT_LIST.concat(String.valueOf(type));
Object obj = redisUtil.get(redisKey);
List<SweetCItyVoteStatVo> sweetCityVoteStatList = ObjectUtil.getSweetCItyVoteStatVoList();
if (null != obj) {
......@@ -505,12 +505,12 @@ public class RedisDataUtils {
}
return sweetCityVoteStatList;
}
public void incrSweetCityVote(String cityCode) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_CITY_CODE.concat(cityCode);
public void incrSweetCityVote(String cityCode, Integer type) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_CITY_CODE.concat(String.valueOf(type)).concat(cityCode);
redisUtil.incr(redisKey, 1);
}
public Integer getSweetCityVote(String cityCode) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_CITY_CODE.concat(cityCode);
public Integer getSweetCityVote(String cityCode, Integer type) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_CITY_CODE.concat(String.valueOf(type)).concat(cityCode);
Object obj = redisUtil.get(redisKey);
if (null == obj) {
return 0;
......@@ -519,11 +519,13 @@ public class RedisDataUtils {
}
}
public void setUserVote(String phone, String openId, SweetCityVoteParam param) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_USER.concat(phone).concat("-").concat(openId);
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE.concat(String.valueOf(param.getType()))
.concat(SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_USER).concat(phone).concat("-").concat(openId);
redisUtil.set(redisKey, param);
}
public SweetCityVoteParam getUserVote(String phone, String openId) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_USER.concat(phone).concat("-").concat(openId);
public SweetCityVoteParam getUserVote(String phone, String openId, Integer type) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE.concat(String.valueOf(type))
.concat(SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_USER).concat(phone).concat("-").concat(openId);
Object obj = redisUtil.get(redisKey);
if (null == obj) {
return null;
......@@ -531,12 +533,12 @@ public class RedisDataUtils {
return (SweetCityVoteParam) obj;
}
}
public void setSweetCityVoteStatUpdateTime() {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_STAT_UPDATE_TIME;
public void setSweetCityVoteStatUpdateTime(Integer type) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_STAT_UPDATE_TIME.concat(String.valueOf(type));
redisUtil.set(redisKey, DateUtil.getNowTime());
}
public String getSweetCityVoteStatUpdateTime() {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_STAT_UPDATE_TIME;
public String getSweetCityVoteStatUpdateTime(Integer type) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_CITY_VOTE_STAT_UPDATE_TIME.concat(String.valueOf(type));
Object obj = redisUtil.get(redisKey);
if (null == obj) {
return "";
......
......@@ -37,6 +37,9 @@ public class SweetCItyVoteStatVo implements Serializable, Cloneable {
@ApiModelProperty("当前用户是否投了当前城市 1没投 2投了")
private Integer isVote;
@ApiModelProperty("type")
private Integer type;
/*@ApiModelProperty("创建时间")
private LocalDateTime createdAt;
......@@ -59,6 +62,7 @@ public class SweetCItyVoteStatVo implements Serializable, Cloneable {
// this.setVoteNum(source.getVoteNum());
// this.setManualVoteNum(source.getManualVoteNum());
this.setTotalNum(source.getTotalNum());
this.setType(source.getType());
return this;
}
......
......@@ -8,12 +8,18 @@
<result column="vote_num" property="voteNum"/>
<result column="manual_vote_num" property="manualVoteNum"/>
<result column="total_num" property="totalNum"/>
<result column="type" property="type"/>
</resultMap>
<select id="getStatList" resultMap="getListResult">
select
*, (vote_num + manual_vote_num) as total_num
from sweet_city_vote_stat
<where>
<if test="type != ''">
AND type=${type}
</if>
</where>
ORDER BY total_num DESC
</select>
</mapper>
......@@ -50,8 +50,8 @@ sweet_remind.insert=INSERT INTO sweet_remind (remind_id,openId,unionId,performan
# --------------------------小程序登录记录用户解密后信息--------------------------
sweet_applet_user.insert=INSERT INTO sweet_applet_user (user_id,openId,unionId,getPhoneNumber,getPurePhoneNumber,getCountryCode,type) VALUES (?,?,?,?,?,?,?)
# --------------------------用户投票记录--------------------------
sweet_city_vote.insert=INSERT INTO sweet_city_vote (vote_id,phone,openId,unionId,city_code,city_name,day_time) VALUES (?,?,?,?,?,?,?)
sweet_city_vote_stat.insert=INSERT INTO sweet_city_vote_stat (stat_id,city_code,city_name,vote_num) VALUES (?,?,?,?)
sweet_city_vote_stat.update=UPDATE sweet_city_vote_stat SET vote_num = IFNULL(vote_num, 0) + 1, updated_at = ? WHERE city_code = ?
sweet_city_vote.insert=INSERT INTO sweet_city_vote (vote_id,phone,openId,unionId,type,city_code,city_name,day_time) VALUES (?,?,?,?,?,?,?,?)
sweet_city_vote_stat.insert=INSERT INTO sweet_city_vote_stat (stat_id,city_code,city_name,vote_num,type) VALUES (?,?,?,?,?)
sweet_city_vote_stat.update=UPDATE sweet_city_vote_stat SET vote_num = IFNULL(vote_num, 0) + 1, updated_at = ? WHERE city_code = ? AND type = ?
# --------------------------防疫答题--------------------------
sweet_antigenic_question.insert=INSERT INTO sweet_antigenic_question (question_id,type,openId,unionId,nickname,address,phone,urgent_phone,keyword1,keyword11,keyword2,keyword3,keyword4,keyword5,keyword6,keyword7) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment