|
|
|
@@ -116,42 +116,42 @@ public class WxMerchantTradeDailyController extends BaseController { |
|
|
|
// wxMerchantTradeDaily.setMerchantId(merchant.getId()); |
|
|
|
|
|
|
|
PageInfo<WxMerchantTradeDaily> pageInfo = wxMerchantTradeDailyService.listAsPage(wxMerchantTradeDaily, pageNum,pageSize); |
|
|
|
List<WxMerchantTradeDaily> tradeDailyList = pageInfo.getList(); |
|
|
|
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
SimpleDateFormat sdMonth = new SimpleDateFormat("yyyy-MM"); |
|
|
|
|
|
|
|
String startTime; |
|
|
|
String endTime; |
|
|
|
//month为空取查询区间开始时间 结束时间 |
|
|
|
if(StringUtils.isBlank(wxMerchantTradeDaily.getMonth())){ |
|
|
|
startTime = sd.format(pageInfo.getList().get(pageInfo.getList().size()-1).getCreateDate()); |
|
|
|
endTime = sd.format(new Date()); |
|
|
|
}else { |
|
|
|
startTime = wxMerchantTradeDaily.getMonth()+"-01"; |
|
|
|
endTime = sd.format(DateUtils.getLastDayForMonth(sd.parse(startTime))); |
|
|
|
|
|
|
|
//如果是本月,截止到当天 |
|
|
|
if (sdMonth.format(new Date()).equals(wxMerchantTradeDaily.getMonth())) { |
|
|
|
endTime = sd.format(new Date()); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> days = DateUtils.getTjTimeList(startTime, endTime,"0"); |
|
|
|
|
|
|
|
Map<String,WxMerchantTradeDaily> resultMap = getMap(days); |
|
|
|
|
|
|
|
for (WxMerchantTradeDaily wx:tradeDailyList) { |
|
|
|
resultMap.put(sd.format(wx.getCreateDate()),wx); |
|
|
|
} |
|
|
|
// List<WxMerchantTradeDaily> tradeDailyList = pageInfo.getList(); |
|
|
|
// SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
// SimpleDateFormat sdMonth = new SimpleDateFormat("yyyy-MM"); |
|
|
|
// |
|
|
|
// String startTime; |
|
|
|
// String endTime; |
|
|
|
// //month为空取查询区间开始时间 结束时间 |
|
|
|
// if(StringUtils.isBlank(wxMerchantTradeDaily.getMonth())){ |
|
|
|
// startTime = sd.format(pageInfo.getList().get(pageInfo.getList().size()-1).getCreateDate()); |
|
|
|
// endTime = sd.format(new Date()); |
|
|
|
// }else { |
|
|
|
// startTime = wxMerchantTradeDaily.getMonth()+"-01"; |
|
|
|
// endTime = sd.format(DateUtils.getLastDayForMonth(sd.parse(startTime))); |
|
|
|
// |
|
|
|
// //如果是本月,截止到当天 |
|
|
|
// if (sdMonth.format(new Date()).equals(wxMerchantTradeDaily.getMonth())) { |
|
|
|
// endTime = sd.format(new Date()); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// List<String> days = DateUtils.getTjTimeList(startTime, endTime,"0"); |
|
|
|
// |
|
|
|
// Map<String,WxMerchantTradeDaily> resultMap = getMap(days); |
|
|
|
// |
|
|
|
// for (WxMerchantTradeDaily wx:tradeDailyList) { |
|
|
|
// resultMap.put(sd.format(wx.getCreateDate()),wx); |
|
|
|
// } |
|
|
|
|
|
|
|
List<WxMerchantTradeDaily> resultList = mapToList(resultMap); |
|
|
|
//判断第1条是否是当天 |
|
|
|
if(CollectionUtils.isNotEmpty(resultList)){ |
|
|
|
if(sd.format(resultList.get(0).getCreateDate()).equals(sd.format(new Date()))){ |
|
|
|
resultList.get(0).setIsToday(1); |
|
|
|
} |
|
|
|
} |
|
|
|
// List<WxMerchantTradeDaily> resultList = mapToList(resultMap); |
|
|
|
// //判断第1条是否是当天 |
|
|
|
// if(CollectionUtils.isNotEmpty(resultList)){ |
|
|
|
// if(sd.format(resultList.get(0).getCreateDate()).equals(sd.format(new Date()))){ |
|
|
|
// resultList.get(0).setIsToday(1); |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
pageInfo.setList(resultList); |
|
|
|
// pageInfo.setList(resultList); |
|
|
|
|
|
|
|
// for (WxMerchantTradeDaily w:resultList) { |
|
|
|
// System.out.println(sd.format(w.getCreateDate())+" "+w.getTradeAmt()); |
|
|
|
|