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

main
吴顺杰 2 weeks ago
parent c23c4ef470
commit f66794f3d8

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

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

@ -36,20 +36,16 @@
and is_delete =0 and state = '正常' and is_delete =0 and state = '正常'
</select> </select>
<select id="lineTemplate" resultType="com.ykMap.entity.response.LineTemplateResponse"> <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 SELECT area,
from ysk_ywbmwjdr.operation_overview_data 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} WHERE data_time >= #{a1}
and data_time &lt; #{a2} AND data_time &lt; #{a2}
union GROUP BY
(select sum(atm_total_num) as atmNum, area
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})
</select> </select>
<select id="searchCity" resultType="com.ykMap.entity.response.SearchCityResponse"> <select id="searchCity" resultType="com.ykMap.entity.response.SearchCityResponse">

Loading…
Cancel
Save