|
@@ -80,13 +80,25 @@ public class AppAgentController extends BaseController {
|
|
|
AppUserAgentJournalIndexVO vo = new AppUserAgentJournalIndexVO();
|
|
|
Date curDate = DateUtil.date();
|
|
|
if(agentIndexDto.getType() == 1){
|
|
|
- curDate = DateUtil.offsetMonth(curDate,-1); //上个月
|
|
|
+// curDate = DateUtil.offsetMonth(curDate,-1); //上个月
|
|
|
+ //上一个周期
|
|
|
+ curDate = DateUtil.offsetDay(curDate,-15);
|
|
|
}
|
|
|
String formatP = "yyyy-MM-dd";
|
|
|
- Date beginDate = DateUtil.beginOfMonth(curDate);
|
|
|
- Date endDate = DateUtil.endOfMonth(curDate);
|
|
|
- Date weekBegin = DateUtil.beginOfWeek(now);
|
|
|
- Date weekend = DateUtil.endOfWeek(now);
|
|
|
+ /*Date beginDate = DateUtil.beginOfMonth(curDate);
|
|
|
+ Date endDate = DateUtil.endOfMonth(curDate);*/
|
|
|
+ int curDay = Integer.parseInt(DateUtil.format(curDate,"dd"));
|
|
|
+
|
|
|
+ Date weekBegin = null;
|
|
|
+ Date weekend = null;
|
|
|
+ if(curDay <= 15){
|
|
|
+ weekBegin = DateUtil.beginOfMonth(curDate);
|
|
|
+ weekend = DateUtil.parse(DateUtil.format(curDate,"yyyy-MM-".concat("15").concat(" 23:59:59")),"yyyy-MM-dd HH:mm:ss");
|
|
|
+ }else{
|
|
|
+ weekBegin = DateUtil.parse(DateUtil.format(curDate,"yyyy-MM-".concat("15").concat(" 00:00:00")),"yyyy-MM-dd HH:mm:ss");
|
|
|
+ weekend = DateUtil.endOfMonth(curDate);
|
|
|
+ }
|
|
|
+
|
|
|
List<AppUserCount> appUserCountList = appUserCountService.getAppUserCountNew(userId,DateUtil.format(weekBegin,formatP),DateUtil.format(weekend,formatP));
|
|
|
AppUserAgent queryAppUserAgent = new AppUserAgent();
|
|
|
queryAppUserAgent.setPid(userId);
|
|
@@ -170,7 +182,7 @@ public class AppAgentController extends BaseController {
|
|
|
compareTime(e.getCreateTime(),yesterDay,yesterDay)
|
|
|
).collect(Collectors.toList()).size());
|
|
|
vo.setMonthUser(appUserAgentList.stream().filter(e->
|
|
|
- compareTime(e.getCreateTime(),beginDate,endDate)
|
|
|
+ compareTime(e.getCreateTime(),DateUtil.beginOfMonth(new Date()),DateUtil.endOfMonth(new Date()))
|
|
|
).collect(Collectors.toList()).size());
|
|
|
|
|
|
return HttpRet.success(MessageUtils.message("11022"),vo);
|