44323
2023-10-08 12ec47a5fed86e04433ca725caf6068c5000d0af
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
package com.dsh.guns.modular.system.controller.code;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.dsh.course.feignClient.account.*;
import com.dsh.course.feignClient.account.model.CityManager;
import com.dsh.course.feignClient.account.model.TAppUser;
import com.dsh.course.feignClient.account.model.VipPayment;
import com.dsh.course.feignClient.activity.PointMercharsClient;
import com.dsh.course.feignClient.competition.CompetitionClient;
import com.dsh.course.feignClient.competition.model.Competition;
import com.dsh.course.feignClient.competition.model.CompetitionQuery;
import com.dsh.course.feignClient.competition.model.PaymentCompetition;
import com.dsh.course.feignClient.course.*;
import com.dsh.course.feignClient.course.model.TCoursePackage;
import com.dsh.course.feignClient.course.model.TCoursePackagePayment;
import com.dsh.course.feignClient.other.SiteClient;
import com.dsh.course.feignClient.other.StoreClient;
import com.dsh.course.model.MoneyBack;
import com.dsh.guns.config.UserExt;
import com.dsh.guns.core.base.controller.BaseController;
import com.dsh.guns.modular.system.model.*;
import com.dsh.guns.modular.system.service.ICityService;
import groovyjarjarpicocli.CommandLine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import java.util.stream.Collectors;
 
/**
 * 数据统计控制器
 *
 */
@Controller
@RequestMapping("/data")
public class DataStatisticsController extends BaseController {
    private String PREFIX = "/system/dataStatistics/";
    @Autowired
    private ICityService cityService;
    @Autowired
    private CityManagerClient cityManagerClient;
    @Autowired
    private AppUserClient appUserClient;
    @Autowired
    private VipPaymentClient vipPaymentClient;
    @Autowired
    private FinanceClient financeClient;
    @Autowired
    private CoursePackagePaymentClient coursePackagePaymentClient;
    @Autowired
    private CompetitionClient competitionClient;
    @Autowired
    private StoreClient storeClient;
    @Autowired
    private SiteClient siteClient;
    @Autowired
    private PointMercharsClient pointMercharsClient;
    @Autowired
    private RefundCoursePackageClient refundCoursePackageClient;
    @Resource
    private CourseStuddentClient courseStuddentClient;
    @Autowired
    private CoursePackageClient coursePackageClient;
    /**
     * 跳转到平台统计数据页面
     */
    @RequestMapping("/platform")
    public String index(Model model) {
        return PREFIX + "platformIncome.html";
    }
 
    /**
     * 营收数据-平台
     *
     */
    @RequestMapping(value = "/getIncomeData")
    @ResponseBody
    public Object getIncomeData(Integer type) {
        // 充值记录查询query
        RechargeRecordsQuery rechargeRecordsQuery = new RechargeRecordsQuery();
        // 报名课程查询query
        RegisterOrderQuery query = new RegisterOrderQuery();
        // 赛事活动查询query
        CompetitionQuery competitionQuery = new CompetitionQuery();
        // 会员支付查询query
        IncomeQuery incomeQuery = new IncomeQuery();
        // 场地预约记录查询query
        SiteBookingQuery siteBookingQuery = new SiteBookingQuery();
        Integer roleType = UserExt.getUser().getObjectType();
        IncomeVO incomeVO = new IncomeVO();
        List<IncomeVO> incomeVOS = new ArrayList<>();
                // 会员支付记录
                List<VipPayment> vipPayments = vipPaymentClient.registrationList(incomeQuery);
                for (VipPayment vipPayment : vipPayments) {
                    IncomeVO temp = new IncomeVO();
                    if (vipPayment.getPayStatus()==1){
                        temp.setInsertTime(vipPayment.getInsertTime());
                        incomeVOS.add(temp);
                    }
                    if (vipPayment.getAmount() != null) {
                        temp.setAmount(new BigDecimal(vipPayment.getAmount().toString()));
                    }
                }
                // 充值记录
                List<RechargeRecordsVO> rechargeRecordsVOS = financeClient.rechargeList(rechargeRecordsQuery);
                for (RechargeRecordsVO rechargeRecordsVO : rechargeRecordsVOS) {
                    IncomeVO temp = new IncomeVO();
                    temp.setInsertTime(rechargeRecordsVO.getInsertTime());
                    if (rechargeRecordsVO.getAmount() != null) {
                        temp.setAmount(rechargeRecordsVO.getAmount());
                    }
                    if (rechargeRecordsVO.getPayStatus() ==1){
                        incomeVOS.add(temp);
                    }
 
                }
                // 报名课程记录
                List<RegisterOrderVO> registerOrderVOS = coursePackagePaymentClient.listAllRegister(query);
                for (RegisterOrderVO registerOrderVO : registerOrderVOS) {
                    if (registerOrderVO.getMoney() == null) {
                        continue;
                    }
                    IncomeVO temp = new IncomeVO();
                    temp.setInsertTime(registerOrderVO.getInsertTime());
                    if (registerOrderVO.getMoney() != null) {
                        temp.setAmount(registerOrderVO.getMoney());
                    }
                    if (registerOrderVO.getPayStatus()==2){
                        incomeVOS.add(temp);
                    }
                }
                    // 报名活动
                    List<PaymentCompetition> competitions = competitionClient.listAllPayment(competitionQuery);
                    for (PaymentCompetition competition : competitions) {
                        if (competition.getPayStatus() != 2) {
                            continue;
                        }
                        if (competition.getPayType()==3 || competition.getPayType()==4){
                            continue;
                        }
                        IncomeVO temp = new IncomeVO();
                        temp.setInsertTime(competition.getInsertTime());
                        if (competition.getAmount() != null) {
                            temp.setAmount(new BigDecimal(competition.getAmount().toString()));
                        }
                        incomeVOS.add(temp);
                    }
                // 预约场地
                List<SiteBooking> siteBookings = siteClient.listAll(siteBookingQuery);
                for (SiteBooking siteBooking : siteBookings) {
                    IncomeVO temp = new IncomeVO();
                    if(siteBooking.getStatus()!=3){
                        continue;
                    }
                    temp.setInsertTime(siteBooking.getPayTime());
                    if (siteBooking.getPayMoney() != null) {
                        temp.setAmount(new BigDecimal(siteBooking.getPayMoney().toString()));
                    }
                    incomeVOS.add(temp);
                }
        // 积分商品
        List<PointMerchandiseIncomeVo> amount = pointMercharsClient.getAmount();
        for (PointMerchandiseIncomeVo pointMerchandiseIncomeVo : amount) {
            IncomeVO temp = new IncomeVO();
            temp.setInsertTime(pointMerchandiseIncomeVo.getInsertTime());
            if (pointMerchandiseIncomeVo.getCash()!=null){
                temp.setAmount(pointMerchandiseIncomeVo.getCash());
                incomeVOS.add(temp);
            }
        }
 
        // 最终返回的数据
        Map<String, List<Object>> monthlyData = new HashMap<>();
        // 创建一个 Map 用于存储每年的累计 amount
        Map<Integer, BigDecimal> yearToTotalAmountMap = new HashMap<>();
        // 初始化一个 BigDecimal 用于累加
        BigDecimal totalAmount1 = BigDecimal.ZERO;
        // 用于返回图表上的总营收 年度营收 月度 周度 日度
        List<Object> objects = new ArrayList<>();
        // 遍历 incomeVOS
        for (IncomeVO incomeVO1 : incomeVOS) {
            // 总营收
            BigDecimal total = incomeVO1.getAmount();
            // 累加到总金额
            totalAmount1 = totalAmount1.add(total);
 
            Date insertTime = incomeVO1.getInsertTime(); // 假设有一个方法用于获取 insertTime
            BigDecimal amount1 = incomeVO1.getAmount(); // 假设有一个方法用于获取 amount
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(insertTime);
            int year = calendar.get(Calendar.YEAR); // 获取年份
            // 更新年份对应的累计 amount
            if (yearToTotalAmountMap.containsKey(year)) {
                BigDecimal totalAmount = yearToTotalAmountMap.get(year);
                yearToTotalAmountMap.put(year, totalAmount.add(amount1));
            } else {
                yearToTotalAmountMap.put(year, amount1);
            }
        }
        objects.add(totalAmount1);
        // 创建一个新的列表,按年份升序排列
        List<Integer> sortedYears = new ArrayList<>(yearToTotalAmountMap.keySet());
        Collections.sort(sortedYears);
        // 创建一个新的 IncomeVO 列表,包含按年份累计的 amount
        List<Object> resultIncomeVOS = new ArrayList<>();
        // 循环遍历2023年到2028年的年份
        for (int year = 2023; year <= 2028; year++) {
            BigDecimal totalAmount = yearToTotalAmountMap.getOrDefault(year, BigDecimal.ZERO);
            // 创建一个新的 IncomeVO 对象,并设置年份和累计金额
            IncomeVO resultIncomeVO = new IncomeVO();
            resultIncomeVO.setAmount(totalAmount);
            resultIncomeVOS.add(resultIncomeVO);
        }
        monthlyData.put("yearIncome",resultIncomeVOS);
 
        // 创建一个 Map 用于存储今年每个月的累计 amount
        Map<Integer, BigDecimal> monthToTotalAmountMap = new HashMap<>();
        Calendar calendar = Calendar.getInstance();
        int currentYear = calendar.get(Calendar.YEAR);
        List<BigDecimal> monthlyAmountList = new ArrayList<>(Collections.nCopies(12, BigDecimal.ZERO));
 
        for (IncomeVO incomeVO1 : incomeVOS) {
            Calendar calendar1 = Calendar.getInstance();
            calendar1.setTime(incomeVO1.getInsertTime());
            int year = calendar1.get(Calendar.YEAR);
            int month = calendar1.get(Calendar.MONTH) + 1; // 月份从0开始,所以需要加1
            if (year == currentYear) {
                BigDecimal totalAmount = monthlyAmountList.get(month - 1);
                totalAmount = totalAmount.add(incomeVO1.getAmount());
                monthlyAmountList.set(month - 1, totalAmount);
            }
        }
        monthlyData.put("monthIncome", Collections.singletonList(monthlyAmountList));
 
        // 获取当前月份
        LocalDate currentDate = LocalDate.now();
        int currentMonth = currentDate.getMonthValue();
        // 初始化一个长度为当前月份的天数的列表,并将每一天的金额初始化为零
        int daysInCurrentMonth = currentDate.lengthOfMonth();
        List<BigDecimal> weekAmount = new ArrayList<>(daysInCurrentMonth);
        for (int i = 0; i < daysInCurrentMonth; i++) {
            weekAmount.add(BigDecimal.ZERO);
        }
        for (IncomeVO incomeVO1 : incomeVOS) {
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            String string = dateFormat.format(incomeVO1.getInsertTime());
            LocalDate insertDate = LocalDate.parse(string, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
            if (insertDate.getMonthValue() == currentMonth) {
                int dayOfMonth = insertDate.getDayOfMonth();
                BigDecimal currentAmount = weekAmount.get(dayOfMonth - 1); // 列表索引从0开始
                weekAmount.set(dayOfMonth - 1, currentAmount.add(incomeVO1.getAmount()));
            }
        }
        monthlyData.put("weekIncome", Collections.singletonList(weekAmount));
 
        LocalDateTime currentDateTime = LocalDateTime.now();
        List<BigDecimal> amountByDay = new ArrayList<>(Collections.nCopies(7, BigDecimal.ZERO));
        for (IncomeVO incomeVO3 : incomeVOS) {
            Date insertTime = incomeVO3.getInsertTime();
            // 将 Date 转换为 LocalDateTime
            LocalDateTime insertDateTime = LocalDateTime.ofInstant(insertTime.toInstant(), ZoneId.systemDefault());
            // 计算日期与当前日期的差距
            long daysDifference = ChronoUnit.DAYS.between(insertDateTime.toLocalDate(), currentDateTime.toLocalDate());
            // 如果日期在七天内,累加金额
            if (daysDifference >= 0 && daysDifference < 7) {
                int index = (int) (6 - daysDifference); // 计算对应的索引位置
                BigDecimal amount3 = incomeVO3.getAmount();
                BigDecimal updatedAmount = amountByDay.get(index).add(amount3);
                amountByDay.set(index, updatedAmount);
 
            }
        }
 
        monthlyData.put("dayIncome", Collections.singletonList(amountByDay));
        // 创建一个 Map 用于存储今年本周的累计 amount
        Map<Integer, BigDecimal> dayToTotalAmountMap = new HashMap<>();
        BigDecimal yearAmount = BigDecimal.ZERO; // 初始化累加变量为0
        BigDecimal monthAmount = BigDecimal.ZERO; // 初始化累加变量为0
        BigDecimal todayAmount = BigDecimal.ZERO; // 初始化累加变量为0
        // 获取当前日期和时间
        LocalDateTime now = LocalDateTime.now();
        // 今年的起始日期和结束日期
        LocalDateTime startOfYear = now.with(TemporalAdjusters.firstDayOfYear()).with(LocalTime.MIN);
        LocalDateTime endOfYear = now.with(TemporalAdjusters.lastDayOfYear()).with(LocalTime.MAX);
        // 本月的起始日期和结束日期
        LocalDateTime startOfMonth = now.with(TemporalAdjusters.firstDayOfMonth()).with(LocalTime.MIN);
        LocalDateTime endOfMonth = now.with(TemporalAdjusters.lastDayOfMonth()).with(LocalTime.MAX);
        // 本周的起始日期和结束日期
        LocalDateTime startOfWeek = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)).with(LocalTime.MIN);
        LocalDateTime endOfWeek = now.with(TemporalAdjusters.nextOrSame(DayOfWeek.SUNDAY)).with(LocalTime.MAX);
        // 今天的起始日期和结束日期
        LocalDateTime startOfDay = now.with(LocalTime.MIN);
        LocalDateTime endOfDay = now.with(LocalTime.MAX);
        // 创建日期格式化器
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        // 筛选符合条件的IncomeVO对象
        List<IncomeVO> thisYearIncome = incomeVOS.stream()
                .filter(income -> {
                    Date insertTime = income.getInsertTime();
                    try {
                        LocalDateTime insertDateTime = LocalDateTime.ofInstant(insertTime.toInstant(), ZoneId.systemDefault());
                        return insertDateTime.isAfter(startOfYear) && insertDateTime.isBefore(endOfYear);
                    } catch (Exception e) {
                        e.printStackTrace();
                        return false;
                    }
                })
                .collect(Collectors.toList());
        // 使用 map 方法将 IncomeVO 转换为 BigDecimal,提取出 amount 字段
        List<BigDecimal> amounts = thisYearIncome.stream()
                .map(IncomeVO::getAmount)
                .collect(Collectors.toList());
        //本年总收入
        BigDecimal totalAmount = amounts.stream()
                .reduce(BigDecimal.ZERO, BigDecimal::add);
        // 用于展示总营收 本年度营收 本月营收 本周营收 本日营收
        objects.add(totalAmount);
        List<IncomeVO> thisMonthIncome = incomeVOS.stream()
                .filter(income -> {
                    Date insertTime = income.getInsertTime();
                    try {
                        LocalDateTime insertDateTime = LocalDateTime.ofInstant(insertTime.toInstant(), ZoneId.systemDefault());
                        return insertDateTime.isAfter(startOfMonth) && insertDateTime.isBefore(endOfMonth);
                    } catch (Exception e) {
                        e.printStackTrace();
                        return false;
                    }
                })
                .collect(Collectors.toList());
        List<BigDecimal> amountMonth = thisMonthIncome.stream()
                .map(IncomeVO::getAmount)
                .collect(Collectors.toList());
        // 使用 本月总收入
        BigDecimal totalMonth = amountMonth.stream()
                .reduce(BigDecimal.ZERO, BigDecimal::add);
 
        objects.add(totalMonth);
        List<IncomeVO> thisWeekIncome = incomeVOS.stream()
                .filter(income -> {
                    Date insertTime = income.getInsertTime();
                    try {
                        LocalDateTime insertDateTime = LocalDateTime.ofInstant(insertTime.toInstant(), ZoneId.systemDefault());
                        return insertDateTime.isAfter(startOfWeek) && insertDateTime.isBefore(endOfWeek);
                    } catch (Exception e) {
                        e.printStackTrace();
                        return false;
                    }
                })
                .collect(Collectors.toList());
        List<BigDecimal> amountWeek = thisWeekIncome.stream()
                .map(IncomeVO::getAmount)
                .collect(Collectors.toList());
        // 使用 本月总收入
        BigDecimal totalWeek = amountWeek.stream()
                .reduce(BigDecimal.ZERO, BigDecimal::add);
        objects.add(totalWeek);
        List<IncomeVO> todayIncome = incomeVOS.stream()
                .filter(income -> {
                    Date insertTime = income.getInsertTime();
                    try {
                        LocalDateTime insertDateTime = LocalDateTime.ofInstant(insertTime.toInstant(), ZoneId.systemDefault());
                        return insertDateTime.isAfter(startOfDay) && insertDateTime.isBefore(endOfDay);
                    } catch (Exception e) {
                        e.printStackTrace();
                        return false;
                    }
                })
                .collect(Collectors.toList());
        List<BigDecimal> amountToday = todayIncome.stream()
                .map(IncomeVO::getAmount)
                .collect(Collectors.toList());
        // 使用 本月总收入
        BigDecimal totalToday = amountToday.stream()
                .reduce(BigDecimal.ZERO, BigDecimal::add);
        objects.add(totalToday);
        // 最后put
        monthlyData.put("yearMount",objects);
 
        return monthlyData;
    }
 
    /**
     * 运营统计-平台-用户数据
     *
     */
    @RequestMapping(value = "/getUserData")
    @ResponseBody
    public Object getUserData() {
 
 
        return null;
    }
    /**
     * 退费-平台
     *
     */
    @RequestMapping(value = "/getRefundData")
    @ResponseBody
    public Object getRefundData(Integer type) {
        // 赛事活动查询query
        CompetitionQuery competitionQuery = new CompetitionQuery();
        List<IncomeVO> incomeVOS = new ArrayList<>();
        // 获取学员课包退费
        List<MoneyBack> refund = refundCoursePackageClient.getRefund();
 
        for (MoneyBack moneyBack : refund) {
            List<TCoursePackagePayment> coursePackagePayments =  courseStuddentClient.queryByIds(moneyBack.getIds());
            BigDecimal totalAmount = BigDecimal.ZERO;
            for (TCoursePackagePayment payment : coursePackagePayments){
                //课包名称
                TCoursePackage tCoursePackage = coursePackageClient.queryById(payment.getCoursePackageId());
                payment.setName(tCoursePackage.getName());
                payment.setId(Long.valueOf(tCoursePackage.getId()));
                BigDecimal cashPayment = payment.getCashPayment();
                if (cashPayment==null){
                    cashPayment = BigDecimal.ZERO;
                }
                Integer totalClassHours = payment.getTotalClassHours();
                BigDecimal result =  new BigDecimal(0);
                if (totalClassHours!=0) {
                    result = cashPayment.divide(BigDecimal.valueOf(totalClassHours), 2, RoundingMode.HALF_UP);
                }
                //单价
                payment.setOnePrice(result);
                int has = payment.getTotalClassHours() - payment.getLaveClassHours();
                //剩余课时
                payment.setHasHours(has);
                BigDecimal onePrice = payment.getOnePrice();
                Integer laveClassHours = payment.getLaveClassHours();
                BigDecimal result1 = onePrice.multiply(BigDecimal.valueOf(laveClassHours));
                //总价
                payment.setRestPrice(result1);
                System.out.println("======="+result1);
                totalAmount = totalAmount.add(result1);
                IncomeVO temp = new IncomeVO();
                temp.setInsertTime(payment.getInsertTime());
                temp.setAmount(result1);
                incomeVOS.add(temp);
            }
        }
        // 获取赛事退费记录
        List<PaymentCompetition> competitions = competitionClient.listAllPayment(competitionQuery);
        for (PaymentCompetition competition : competitions) {
            if (competition.getPayStatus() != 3) {
                continue;
            }
            if (competition.getPayType()==3 || competition.getPayType()==4){
                continue;
            }
            IncomeVO temp = new IncomeVO();
            temp.setInsertTime(competition.getInsertTime());
            if (competition.getAmount() != null) {
                temp.setAmount(new BigDecimal(competition.getAmount().toString()));
            }
            incomeVOS.add(temp);
        }
 
        return null;
    }
    /**
     * 跳转到运营商统计数据页面
     */
    @RequestMapping("/operator")
    public String operator(Model model) {
        Integer objectType = UserExt.getUser().getObjectType();
        List<CityManager> cityManagers = cityManagerClient.listAll();
        HashSet<String> city = new HashSet<>();
        List<CityManager> list = new ArrayList<>();
        for (CityManager cityManager : cityManagers) {
            if (!city.contains(cityManager.getCity())){
                city.add(cityManager.getCity());
                list.add(cityManager);
            }
        }
        model.addAttribute("list",list);
        model.addAttribute("objectType",objectType);
        return PREFIX + "operatorIncome.html";
    }
    /**
     * 跳转到门店统计数据页面
     */
    @RequestMapping("/store")
    public String store(Model model) {
        Integer objectType = UserExt.getUser().getObjectType();
        List<CityManager> cityManagers = cityManagerClient.listAll();
        HashSet<String> city = new HashSet<>();
        List<CityManager> list = new ArrayList<>();
        for (CityManager cityManager : cityManagers) {
            if (!city.contains(cityManager.getCity())){
                city.add(cityManager.getCity());
                list.add(cityManager);
            }
        }
        model.addAttribute("list",list);
        model.addAttribute("objectType",objectType);
        return PREFIX + "storeIncome.html";
    }
}