|
@@ -487,6 +487,10 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<PitcherGameDataDayVO> getPitcherGameDataDay(PitcherGameDataDayDTO dto) {
|
|
|
+
|
|
|
+ if (CollectionUtils.isEmpty(dto.getGameId())) {
|
|
|
+ return getPitcherGameDataDayForOld(dto);
|
|
|
+ }
|
|
|
com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
|
|
|
List<Long> userIds = CollectionUtils.isEmpty(dto.getPitcherId()) ? poerInfo.first : dto.getPitcherId();
|
|
|
List<Long> gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? poerInfo.second : dto.getGameId();
|
|
@@ -566,6 +570,76 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
|
|
|
return new Page<>(list, pager);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 投手游戏每日数据
|
|
|
+ *
|
|
|
+ * @param dto PitcherGameDataDayDTO
|
|
|
+ * @return Page<PitcherGameDataDayVO>
|
|
|
+ */
|
|
|
+ public Page<PitcherGameDataDayVO> getPitcherGameDataDayForOld(PitcherGameDataDayDTO dto) {
|
|
|
+ com.github.sd4324530.jtuple.Tuple2<List<Long>, List<Long>> poerInfo = dataPowerComponent.getPowerInfo(dto.getSourceSystem());
|
|
|
+ List<Long> userIds = CollectionUtils.isEmpty(dto.getPitcherId()) ? poerInfo.first : dto.getPitcherId();
|
|
|
+ List<Long> gameIds = CollectionUtils.isEmpty(dto.getGameId()) ? poerInfo.second : dto.getGameId();
|
|
|
+
|
|
|
+
|
|
|
+ if (dto.getBeginDate() == null || dto.getEndDate() == null) {
|
|
|
+ dto.setBeginDate(LocalDate.now());
|
|
|
+ dto.setEndDate(LocalDate.now());
|
|
|
+ }
|
|
|
+
|
|
|
+ Criteria cri = Cnd.cri();
|
|
|
+ if (CollectionUtils.isNotEmpty(userIds)) {
|
|
|
+ cri.where().andInList("pitcher_id", userIds);
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isNotEmpty(gameIds)) {
|
|
|
+ cri.where().andInList("game_id", gameIds);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(dto.getSourceSystem())) {
|
|
|
+ cri.where().andEquals("source_system", dto.getSourceSystem());
|
|
|
+ }
|
|
|
+ if (dto.getBeginDate() != null && dto.getEndDate() != null) {
|
|
|
+ cri.where().andBetween("dt", dto.getBeginDate(), dto.getEndDate());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(dto.getGameCp())) {
|
|
|
+ cri.where().andEquals("game_cp", dto.getGameCp());
|
|
|
+ }
|
|
|
+ if (dto.getGameType() != null) {
|
|
|
+ cri.where().andEquals("game_type", dto.getGameType());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(dto.getSortType())) {
|
|
|
+ dto.setSortType(OrderByEnum.DESC.getOrderType());
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(dto.getSortFiled())) {
|
|
|
+ cri.getOrderBy().orderBy("dt", dto.getSortType());
|
|
|
+ cri.getOrderBy().orderBy("cost", dto.getSortType());
|
|
|
+ } else {
|
|
|
+ cri.getOrderBy().orderBy(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dto.getSortFiled()), dto.getSortType());
|
|
|
+ }
|
|
|
+
|
|
|
+ Pager pager = dao.createPager(dto.getPageNum(), dto.getPageSize());
|
|
|
+
|
|
|
+ Sql sql = Sqls.create(pitcherGameDataDaySql() + cri);
|
|
|
+
|
|
|
+ sql.setCallback(Sqls.callback.entities());
|
|
|
+ sql.setEntity(dao.getEntity(PitcherGameDataDayVO.class));
|
|
|
+
|
|
|
+ sql.setPager(pager);
|
|
|
+
|
|
|
+ dao.execute(sql);
|
|
|
+
|
|
|
+ pager.setRecordCount(dao.count(AdsGamePitcherDay.class, cri));
|
|
|
+
|
|
|
+ List<PitcherGameDataDayVO> tempList = sql.getList(PitcherGameDataDayVO.class);
|
|
|
+ List<PitcherGameDataDayVO> list = tempList.stream().map(vo -> {
|
|
|
+ formatPitcherGameDataDayDayN(vo);
|
|
|
+ return vo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+ return new Page<>(list, pager);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
* 投手游戏每日数据总计
|
|
|
*
|