Commit 394a6621 by jscat

nyx-app: 更新java后台功能

1. 添加tbl_match_bonus和view_match_bonus, view_match_point数据结构
2. 添加更新tbl_match和tbl_match_bonus的功能
parent 9827513c
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
......@@ -8,7 +8,7 @@ import java.util.Date;
/**
* 竞答结果 tbl_match
* Created by jscat on 2020/01/06.
* Created by jscat on 2020/07/31.
*/
@Data
@AllArgsConstructor
......@@ -16,15 +16,11 @@ import java.util.Date;
public class Rockwell_keyT_match{
private String matchId; // 竞答的id uuid format
private String matchSeason; // 竞答赛季, s01
private String matchType; // 竞答类别: daily|pk
private String matchTeam; // 竞答队伍 uid_001
private String teamType; //主队还是客队 blue|red
private String matchResult; // 竞答结果 win|lose;
private String matchScore; // 竞答分数, 比如:;uid_1:1;uid_2:0;
private String quizIndex; // '竞答|学习进行到第几题',
private String rankScore; // 段位分数, 胜利+2,失败-1
private String memberId; // 商家的id uuid format
private String userId; // 用户的id uuid format
private String matchStatus; // (可用|不可用): 1|
private Double matchPoint; // 得分: 4.5 or 5.0
private String matchResult; // 结果: 9/10
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime; // 创建时间
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
......
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 竞答结果 tbl_match_bonus
* Created by jscat on 2020/07/31.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_keyT_match_bonus{
private String matchId; // 竞答的id uuid format
private String userId; // 用户的id uuid format
private String userName; // 用户名
private Double bonusPoint; // 得分: 0.5
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime; // 创建时间
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date updateDatetime; // 更新时间
}
package cn.com.fun.nyxkey.api.domain;
package cn.com.fun.nyxkey.api.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 竞答-积分 视图表
* Created by jscat on 2020/07/31.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rockwell_keyV_match_point{
private String matchId; // 竞答的id uuid format
private String matchStatus; // (可用|不可用): 1|
private String memberId; // 商家的id uuid format
private String memberName; // 商家的名称
private String userId; // 用户的id uuid format
private String nickName; // 用户的名称
private String matchPoint; // 竞答得分: 4.5 or 5.0
private String bonusPoint; // 助力得分: 4.5 or 5.0
private String totalPoint; // 总得分: 4.5 or 5.0
private String bonusCount; // 助力人次: 4
}
package cn.com.fun.nyxkey.api.domain.query;
package cn.com.fun.nyxkey.api.domain.query;
......@@ -20,82 +20,78 @@ public class Rockwell_keyT_matchQuery {
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createDatetime;
private String matchId;
private String matchSeason;
private String matchType;
private String matchTeam; //userid
private String matchResult; //用于统计比赛胜负 win|lose
private String memberId;
private String userId;
private String matchStatus; // 积分状态, 可用|不可用
private Pagination pagination;
private List<Rockwell_keyT_match> listRockwell_keyT_match;
private List<Rockwell_keyV_match_rank> listRockwell_keyV_match_rank;
//默认返回1页4条记录
public Rockwell_keyT_matchQuery()
{
this.pagination = new Pagination(1, 4);
}
public void setMatchSeason(String strMatchSeason)
public void setMatchStatus(String strMatchStatus)
{
if(strMatchSeason.equals("0"))
if(strMatchStatus.equals("0"))
{
this.matchSeason = null;
this.matchStatus = null;
}
else
{
this.matchSeason = strMatchSeason;
this.matchStatus = strMatchStatus;
}
}
public void setMatchType(String strMatchType)
public void setMemberId(String strMemberId)
{
if(strMatchType.equals("0"))
if(strMemberId.equals("0"))
{
this.matchType = null;
this.memberId = null;
}
else
{
this.matchType = strMatchType;
this.memberId = strMemberId;
}
}
public void setMatchId(String strMatchId)
public void setUserId(String strUserId)
{
if(strMatchId.equals("0"))
if(strUserId.equals("0"))
{
this.matchId = null;
this.userId = null;
}
else
{
this.matchId = strMatchId;
this.userId = strUserId;
}
}
}
public void setMatchTeam(String strMatchTeam)
public void setMatchId(String strMatchId)
{
if(strMatchTeam.equals("0"))
if(strMatchId.equals("0"))
{
this.matchTeam = null;
this.matchId = null;
}
else
{
this.matchTeam = strMatchTeam;
this.matchId = strMatchId;
}
}
@Override
public String toString() {
return "Rockwell_keyT_matchQuery{" +
"createDatetime='" + createDatetime + '\'' +
"matchId='" + matchId + '\'' +
"matchSeason='" + matchSeason + '\'' +
"matchType='" + matchType + '\'' +
"matchTeam='" + matchTeam + '\'' +
"matchResult='" + matchResult + '\'' +
"matchStatus='" + matchStatus + '\'' +
"memberId='" + memberId + '\'' +
"userId='" + userId + '\'' +
"pagination='" + pagination + '\'' +
"listRockwell_keyT_match='" + listRockwell_keyT_match + '\'' +
"listRockwell_keyV_match_rank='" + listRockwell_keyV_match_rank + '\'' +
'}';
}
}
package cn.com.fun.nyxkey.api.etl;
package cn.com.fun.nyxkey.api.etl;
......@@ -24,25 +24,25 @@ public class DataProcessor {
private Rockwell_keyService rockwell_keyService;
//计算赛季
public String getSeason()
{
Calendar calender = Calendar.getInstance();
Date date = new Date();
calender.setTime(date);
Integer year = calender.get(Calendar.YEAR);
Integer month = calender.get(Calendar.MONTH);
Integer season = year % 2020 * 4 + month/3 + 1;
String matchSeason = season >= 10 ? String.valueOf(season) : '0' + String.valueOf(season);
return "s"+String.valueOf(matchSeason);
}
@Scheduled(cron = "${app.service.cron.genT_match_rank}")
public void runStat() {
String matchSeason = getSeason();
rockwell_keyService.Rockwell_keyServiceGenT_match_rank(matchSeason);
}
// public String getSeason()
// {
// Calendar calender = Calendar.getInstance();
// Date date = new Date();
// calender.setTime(date);
// Integer year = calender.get(Calendar.YEAR);
// Integer month = calender.get(Calendar.MONTH);
//
//
// Integer season = year % 2020 * 4 + month/3 + 1;
// String matchSeason = season >= 10 ? String.valueOf(season) : '0' + String.valueOf(season);
// return "s"+String.valueOf(matchSeason);
// }
// @Scheduled(cron = "${app.service.cron.genT_match_rank}")
// public void runStat() {
//
// String matchSeason = getSeason();
// rockwell_keyService.Rockwell_keyServiceGenT_match_rank(matchSeason);
// }
}
package cn.com.fun.nyxkey.api.repository;
package cn.com.fun.nyxkey.api.repository;
......@@ -23,16 +23,20 @@ public interface Rockwell_keyMapper {
List<Rockwell_keyV_quiz_type_total> getT_quiz_type_total(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_quizDefectItem(Rockwell_keyT_quiz_defect rockwell_keyT_quiz_defect);
/* 通过pagination, matchId查询t_match */
/* 通过pagination, matchId 查询t_match */
List<Rockwell_keyT_match> getT_match_by_matchid(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyT_match> getV_match_point_by_matchid(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyT_match> getT_match_by_page(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_matchList(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_matchItem(Rockwell_keyT_match rockwell_keyT_match);
// 更新match_status的状态 主要是由可用->不可用 jscat 20200731
void updateT_match_status(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_match_bonusItem(Rockwell_keyT_match_bonus rockwell_keyT_match_bonus);
/* match rank api */
List<Rockwell_keyV_match_rank> getV_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void updateT_match_rank_defaultType(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void genT_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
// List<Rockwell_keyV_match_rank> getV_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
// void updateT_match_rank_defaultType(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
// void genT_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
/* post api */
List<Rockwell_keyV_post_info> getV_post_info(Rockwell_keyT_postQuery rockwell_keyT_postQuery);
......@@ -40,8 +44,8 @@ public interface Rockwell_keyMapper {
void addT_postLike(Rockwell_keyT_post rockwell_keyT_post);
/* pair api */
List<Rockwell_keyT_pair> getT_pair(Rockwell_keyT_pairQuery rockwell_keyT_pairQuery);
void addT_pair(Rockwell_keyT_pair rockwell_keyT_pair);
// List<Rockwell_keyT_pair> getT_pair(Rockwell_keyT_pairQuery rockwell_keyT_pairQuery);
// void addT_pair(Rockwell_keyT_pair rockwell_keyT_pair);
/* area api */
List<Rockwell_keyV_area_total> getCityList();
......
package cn.com.fun.nyxkey.api.service;
package cn.com.fun.nyxkey.api.service;
......@@ -20,27 +20,18 @@ public interface Rockwell_keyService {
JSONResult Rockwell_keyServiceGetT_quizRand();
JSONResult Rockwell_keyServiceGetT_matchLike();
JSONResult Rockwell_keyServiceGetT_quizitem(String questionId);
JSONResult Rockwell_keyServiceGetT_quiz_study(String matchSeason, String matchType, String matchTeam, String quizId, int pageNum, int pageCount);
int addT_quizDefectItem(String questionId, String userId, String userComment);
JSONResult Rockwell_keyServiceGetT_quiz_type_total(String matchType);
// t_match相关service
// getT_match三个场合
// 1. match详情,指定matchId
// 2. 查询比赛历史 with pagination, 指定matchTeam, order by create_datetime desc, match_status == 1
// 3. 今日比赛未完,依靠create_datetime & match_status
JSONResult Rockwell_keyServiceGetT_match_by_matchid(String matchId);
JSONResult Rockwell_keyServiceGetT_match_by_page(String matchSeason, String matchType, String matchTeam);
JSONResult Rockwell_keyServiceGetT_match_by_page(String memberId, String userId, String matchStatus);
void Rockwell_keyServiceAddT_matchList(List<Rockwell_keyT_match> listRockwell_keyT_match);
void Rockwell_keyServiceAddT_matchItem(String matchSeason, String matchType, String matchTeam, String matchScore,
String teamType, String matchResult, String quizIndex, String rankScore);
// match ranking
JSONResult Rockwell_keyServiceGetV_match_rank(String matchSeason, String matchType, String matchTeam);
void Rockwell_keyServiceUpdateT_match_rank_defaultType(List<Rockwell_keyV_match_rank> listRockwell_keyV_match_rank);
void Rockwell_keyServiceGenT_match_rank(String matchSeason);
void Rockwell_keyServiceAddT_matchItem(String memberId, String userId, Double matchPoint, String matchResult);
int Rockwell_keyServiceUpdateT_match_status(String matchId);
void Rockwell_keyServiceAddT_match_bonusItem(String matchId, String userId, String userName, Double bonusPoint);
/* post api */
JSONResult Rockwell_keyServiceGetV_post_info(String tag, String title, String top, int pageNum, int pageCount);
......@@ -50,15 +41,6 @@ public interface Rockwell_keyService {
int Rockwell_keyServiceAddT_post(String userId, String noteImage, String tag, String title, String content) throws UnsupportedEncodingException;
int Rockwell_keyServiceAddT_postLike(String postId);
/* pair api 20200530 jscat */
JSONResult Rockwell_keyServiceGetT_pair(String userId, String strSearchName, int pageNum, int pageCount);
int Rockwell_keyServiceAddT_pair(String userId, String food, String wineName, String wineDesc,
String imgLink, String wineLink, String sourceLink) throws UnsupportedEncodingException;
/* member pos api */
JSONResult Rockwell_keyServiceGetCityList();
JSONResult Rockwell_keyServiceGetCityInfo(String city);
JSONResult Rockwell_keyServiceGetMemberPos(int areaId, String areaName);
// testing
void Rockwell_keyServiceTest(List<Rockwell_keyT_match> listRockwell_keyT_match);
......
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
......@@ -33,7 +33,6 @@ public class IndexController extends BaseController{
@RequestMapping(value="/",method=RequestMethod.GET)
public String index_default(Model model){
// model.addAttribute("collector","");
Rockwell_userT_user user = super.getUser();
if(null != user){
model.addAttribute("user",user);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论