|
@@ -86,9 +86,28 @@ public class TsCustomerStatisticMonthlyServiceImpl extends ServiceImpl<TsCustome
|
86
|
86
|
LocalDateTime nowDate = LocalDateTime.now();
|
87
|
87
|
//12个月前的日期
|
88
|
88
|
LocalDateTime beforeDate = nowDate.plusMonths(-12);
|
89
|
|
- //获取31天的日期数据
|
|
89
|
+ //获取12个月数据
|
90
|
90
|
List<TsCustomerStatisticMonthly> list = customerStatisticMonthlyMapper.getMonthlyList(customerType,orgId,nowDate,beforeDate,personId,userId);
|
91
|
|
- return list;
|
|
91
|
+ //构造12个月的数据
|
|
92
|
+ List<TsCustomerStatisticMonthly> newList = new ArrayList<>();
|
|
93
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
|
|
94
|
+ for (int i = 0; i < 12;i++){
|
|
95
|
+ String newDate = nowDate.plusDays(-i).format(formatter);
|
|
96
|
+ TsCustomerStatisticMonthly tsCustomerStatisticMonthly = new TsCustomerStatisticMonthly();
|
|
97
|
+ tsCustomerStatisticMonthly.setCustomerType(customerType);
|
|
98
|
+ tsCustomerStatisticMonthly.setMonth(newDate);
|
|
99
|
+ tsCustomerStatisticMonthly.setCustomerNum(0);
|
|
100
|
+ tsCustomerStatisticMonthly.setOrgId(orgId);
|
|
101
|
+ tsCustomerStatisticMonthly.setRealtyConsultant(personId);
|
|
102
|
+ newList.add(tsCustomerStatisticMonthly);
|
|
103
|
+ list.forEach(l -> {
|
|
104
|
+ if (newDate.equals(l.getMonth())){
|
|
105
|
+ tsCustomerStatisticMonthly.setCustomerNum(l.getCustomerNum());
|
|
106
|
+ }
|
|
107
|
+ });
|
|
108
|
+ }
|
|
109
|
+
|
|
110
|
+ return newList;
|
92
|
111
|
}
|
93
|
112
|
|
94
|
113
|
/**
|