修改线路模板具体信息接口,没有当前月数据时使用最新数据的所在月数据

main
吴顺杰 1 week ago
parent c23c4ef470
commit f66794f3d8

@ -1,7 +1,6 @@
package com.ykMap.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.ykMap.entity.response.EquipResponse;
import com.ykMap.entity.response.GetCarIdInfoResponse;
import com.ykMap.entity.response.ItemsResponse;
@ -70,17 +69,17 @@ public class LineServiceImpl implements LineService {
@Override
public List<LineTemplateResponse> lineTemplate(String area) {
List<LineTemplateResponse> list;
LocalDate now = LocalDate.now();
if (now.getDayOfMonth() < 26) {
LocalDate a1 = now.minusMonths(2).withDayOfMonth(26);
LocalDate a2 = now.minusMonths(1).withDayOfMonth(25);
list = lineMapper.lineTemplate(area, a1, a2);
} else {
LocalDate a1 = now.minusMonths(1).withDayOfMonth(26);
LocalDate a2 = now.withDayOfMonth(25);
list = lineMapper.lineTemplate(area, a1, a2);
}
if (CollectionUtil.isEmpty(list)) {
// LocalDate now = LocalDate.now();
// if (now.getDayOfMonth() < 26) {
// LocalDate a1 = now.minusMonths(2).withDayOfMonth(26);
// LocalDate a2 = now.minusMonths(1).withDayOfMonth(25);
// list = lineMapper.lineTemplate(area, a1, a2);
// } else {
// LocalDate a1 = now.minusMonths(1).withDayOfMonth(26);
// LocalDate a2 = now.withDayOfMonth(25);
// list = lineMapper.lineTemplate(area, a1, a2);
// }
// if (CollectionUtil.isEmpty(list)) {
// 查询数据库最新时间
LocalDateTime dataTime = lineMapper.findLineTemplateTime();
if (dataTime == null) {
@ -91,7 +90,7 @@ public class LineServiceImpl implements LineService {
// 获取数据库最新时间月份的最后一天
LocalDate lastDayOfMonth = dataTime.with(TemporalAdjusters.lastDayOfMonth()).toLocalDate();
list = lineMapper.lineTemplate(area, firstDayOfMonth, lastDayOfMonth);
}
// }
return list;
}

@ -62,3 +62,9 @@ spring:
wall:
config:
multi-statement-allow: true
# 日志配置
logging:
level:
com.ykMap: error
org.springframework: error

@ -36,20 +36,16 @@
and is_delete =0 and state = '正常'
</select>
<select id="lineTemplate" resultType="com.ykMap.entity.response.LineTemplateResponse">
select outlets_total_num, payment_point_num, line_total_num, atm_total_num, area, data_time
from ysk_ywbmwjdr.operation_overview_data
SELECT area,
SUM(outlets_total_num) AS outlets_total_num,
SUM(payment_point_num) AS payment_point_num,
SUM(line_total_num) AS line_total_num,
SUM(atm_total_num) AS atm_total_num
FROM ysk_ywbmwjdr.operation_overview_data
WHERE data_time >= #{a1}
and data_time &lt; #{a2}
union
(select sum(atm_total_num) as atmNum,
sum(payment_point_num) as skdNum,
sum(line_total_num) as lineNum,
sum(outlets_total_num) as yywdzs,
null as area,
null as data_time
from ysk_ywbmwjdr.operation_overview_data
WHERE create_time >= #{a1}
and create_time &lt; #{a2})
AND data_time &lt; #{a2}
GROUP BY
area
</select>
<select id="searchCity" resultType="com.ykMap.entity.response.SearchCityResponse">

Loading…
Cancel
Save