|
|
@@ -131,14 +131,14 @@ public class CpsDistribtueDataController {
|
|
|
long cpsUserId = StpCpsManageUser.getLoginIdAsLong();
|
|
|
String first = null;
|
|
|
String end = null;
|
|
|
- String timeSql = StrUtil.EMPTY;
|
|
|
+ String timeSql = null;
|
|
|
if (firstDate != null) {
|
|
|
first = DateUtil.format(DateTime.of(firstDate), "yyyy-MM-dd HH:mm:ss");
|
|
|
- timeSql += String.format(" and o.created_time >= '%s'", first);
|
|
|
+ timeSql += String.format(" and dw.created_time >= '%s'", first);
|
|
|
}
|
|
|
if (lastDate != null) {
|
|
|
end = DateUtil.format(DateTime.of(lastDate), "yyyy-MM-dd HH:mm:ss");
|
|
|
- timeSql += String.format(" and o.created_time < '%s'", end);
|
|
|
+ timeSql += String.format(" and dw.created_time < '%s'", end);
|
|
|
}
|
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
builder.put("sharedId", String.format("shared_id = %s", cpsUserId));
|
|
|
@@ -203,22 +203,20 @@ public class CpsDistribtueDataController {
|
|
|
.orElse(new CpsOrderDataStatisticsView());
|
|
|
|
|
|
if (brokenLineObjView != null) {
|
|
|
- String timeSql = StrUtil.EMPTY;
|
|
|
+ MapBuilder builder = MapUtils.builder();
|
|
|
if (firstDate != null) {
|
|
|
first = DateUtil.format(DateTime.of(firstDate), "yyyy-MM-dd HH:mm:ss");
|
|
|
- timeSql += String.format(" and o.created_time >= '%s'", first);
|
|
|
}
|
|
|
if (lastDate != null) {
|
|
|
end = DateUtil.format(DateTime.of(lastDate), "yyyy-MM-dd HH:mm:ss");
|
|
|
- timeSql += String.format(" and o.created_time < '%s'", end);
|
|
|
}
|
|
|
- MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
- builder.put("sharedId", String.format("shared_id = %s", cpsUserId));
|
|
|
- if (StrUtil.isNotEmpty(timeSql)) {
|
|
|
- builder.put("time", timeSql);
|
|
|
+ if (first != null && end != null) {
|
|
|
+ builder.field(CpsOrderView::getDate, first, end).op(Operator.Between);
|
|
|
}
|
|
|
- builder.put("sharedId", String.format("shared_id = %s", cpsUserId));
|
|
|
- List<CpsOrderView> views = beanSearcher.searchAll(CpsOrderView.class,builder.build());
|
|
|
+ List<CpsOrderView> views = beanSearcher.searchAll(CpsOrderView.class, builder
|
|
|
+ .put("userId", String.format("dw.shared_id = %s", cpsUserId))
|
|
|
+ .orderBy(CpsOrderView::getDate).asc()
|
|
|
+ .build());
|
|
|
Map<Long, List<CpsOrderView>> goodsMap = views.stream().collect(Collectors.groupingBy(CpsOrderView::getGoodsId));
|
|
|
brokenLineObjView.setGoodsData(goodsMap);
|
|
|
}
|