|
@@ -263,27 +263,15 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
|
|
|
//取出用户ids,制作响应vo
|
|
|
List<PitcherDataDayVO> list = tempList.stream().map(vo -> {
|
|
|
Long[] usersID = ArrayUtils.EMPTY_LONG_OBJECT_ARRAY;
|
|
|
- //默认查询的数据-不选择投手
|
|
|
- if (CollectionUtils.isEmpty(dto.getPitcherId())) {
|
|
|
- //将gameId和需要查询的注册时间拼接
|
|
|
- String pitcherIdDate = vo.getPitcher() + "/" + dto.getBeginDate();
|
|
|
- //取出所有usersId
|
|
|
- if (map.containsKey(pitcherIdDate)) {
|
|
|
- //string[] -> Long[]
|
|
|
- usersID = Arrays.stream(map.get(pitcherIdDate)
|
|
|
- .split("/"))
|
|
|
- .map(Long::parseLong)
|
|
|
- .toArray(Long[]::new);
|
|
|
- }
|
|
|
- } else {
|
|
|
- //取出所有usersId
|
|
|
- if (map.containsKey(dto.getBeginDate().toString())) {
|
|
|
- //string[] -> Long[]
|
|
|
- usersID = Arrays.stream(map.get(dto.getBeginDate().toString())
|
|
|
- .split("/"))
|
|
|
- .map(Long::parseLong)
|
|
|
- .toArray(Long[]::new);
|
|
|
- }
|
|
|
+ //将pitcherId和需要查询的注册时间拼接
|
|
|
+ String pitcherIdDate = vo.getPitcherId() + "/" + dto.getBeginDate();
|
|
|
+ //取出所有usersId
|
|
|
+ if (map.containsKey(pitcherIdDate)) {
|
|
|
+ //string[] -> Long[]
|
|
|
+ usersID = Arrays.stream(map.get(pitcherIdDate)
|
|
|
+ .split("/"))
|
|
|
+ .map(Long::parseLong)
|
|
|
+ .toArray(Long[]::new);
|
|
|
}
|
|
|
formatPitcherDataDayDayN(vo);
|
|
|
|
|
@@ -310,7 +298,6 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
|
|
|
*/
|
|
|
private Map findUsersIdForGameData(PitcherDataDayDTO dto) {
|
|
|
//不选投手查询的结果 --> (投手id/日期, userId)
|
|
|
- //选投手查询的结果 --> (日期, userId)
|
|
|
|
|
|
//默认查询子游戏维度
|
|
|
if (dto.getGameDimension() == null) {
|
|
@@ -338,16 +325,8 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
|
|
|
findUsersCri.where().andNotEquals("reg_agent_id", 0);
|
|
|
Sql findUsersIdSql;
|
|
|
Criteria groupByCri = Cnd.cri();
|
|
|
- //如果是默认查询,需要按投手、日期分组
|
|
|
- if (CollectionUtils.isEmpty(dto.getPitcherId())) {
|
|
|
- groupByCri.getGroupBy().groupBy("pitcher_id", "DATE(reg_user_time)");
|
|
|
- findUsersIdSql = Sqls.create(findUsersIdSql(findUsersCri, groupByCri));
|
|
|
- } else {
|
|
|
- //选择投手后,只按照日期分组
|
|
|
- //拼接分组条件
|
|
|
- groupByCri.getGroupBy().groupBy("DATE(reg_user_time)");
|
|
|
- findUsersIdSql = Sqls.create(findUsersIdSqlPitcher(findUsersCri, groupByCri));
|
|
|
- }
|
|
|
+ groupByCri.getGroupBy().groupBy("pitcher_id", "DATE(reg_user_time)");
|
|
|
+ findUsersIdSql = Sqls.create(findUsersIdSql(findUsersCri, groupByCri));
|
|
|
//自定义回传
|
|
|
findUsersIdSql.setCallback((connection, resultSet, sql) -> {
|
|
|
Map<String, String> tempMap = new HashMap<>();
|