bug修改
This commit is contained in:
parent
91d9a96d12
commit
53b0c330b2
@ -10,8 +10,8 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countRtToolTrend" resultType="java.util.HashMap">
|
<select id="countRtToolTrend" resultType="java.util.HashMap">
|
||||||
select t1.day,ifnull(t1.当日入库量,0) as 当日入库量,ifnull(t2.当日出库量,0) as 当日出库量 from (
|
select t1.day,ifnull(t1.当日入库次数,0) as 当日入库次数,ifnull(t2.当日出库次数,0) as 当日出库次数 from (
|
||||||
select date_format(entry_time, '%Y-%m-%d') day, count(*) 当日入库量
|
select date_format(entry_time, '%Y-%m-%d') day, count(*) 当日入库次数
|
||||||
from rt_tool_history
|
from rt_tool_history
|
||||||
where project_sn = #{projectSn}
|
where project_sn = #{projectSn}
|
||||||
<if test="type == '1'.toString()">
|
<if test="type == '1'.toString()">
|
||||||
@ -19,7 +19,7 @@
|
|||||||
group by day
|
group by day
|
||||||
</if>
|
</if>
|
||||||
)t1 left join (
|
)t1 left join (
|
||||||
select date_format(exit_time, '%Y-%m-%d') day, count(*) 当日出库量
|
select date_format(exit_time, '%Y-%m-%d') day, count(*) 当日出库次数
|
||||||
from rt_tool_history
|
from rt_tool_history
|
||||||
where project_sn = #{projectSn}
|
where project_sn = #{projectSn}
|
||||||
<if test="type == '1'.toString()">
|
<if test="type == '1'.toString()">
|
||||||
@ -28,8 +28,8 @@
|
|||||||
</if>
|
</if>
|
||||||
)t2 on t1.day=t2.day
|
)t2 on t1.day=t2.day
|
||||||
union
|
union
|
||||||
select t2.day,ifnull(t1.当日入库量,0) as 当日入库量,ifnull(t2.当日出库量,0) as 当日出库量 from (
|
select t2.day,ifnull(t1.当日入库次数,0) as 当日入库次数,ifnull(t2.当日出库次数,0) as 当日出库次数 from (
|
||||||
select date_format(entry_time, '%Y-%m-%d') day, count(*) 当日入库量
|
select date_format(entry_time, '%Y-%m-%d') day, count(*) 当日入库次数
|
||||||
from rt_tool_history
|
from rt_tool_history
|
||||||
where project_sn = #{projectSn}
|
where project_sn = #{projectSn}
|
||||||
<if test="type == '1'.toString()">
|
<if test="type == '1'.toString()">
|
||||||
@ -37,7 +37,7 @@
|
|||||||
group by day
|
group by day
|
||||||
</if>
|
</if>
|
||||||
)t1 right join (
|
)t1 right join (
|
||||||
select date_format(exit_time, '%Y-%m-%d') day, count(*) 当日出库量
|
select date_format(exit_time, '%Y-%m-%d') day, count(*) 当日出库次数
|
||||||
from rt_tool_history
|
from rt_tool_history
|
||||||
where project_sn = #{projectSn}
|
where project_sn = #{projectSn}
|
||||||
<if test="type == '1'.toString()">
|
<if test="type == '1'.toString()">
|
||||||
|
|||||||
@ -11,8 +11,8 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countRtToolTrend" resultType="java.util.HashMap">
|
<select id="countRtToolTrend" resultType="java.util.HashMap">
|
||||||
select t1.day,ifnull(t1.当日入库量,0) as 当日入库量,ifnull(t2.当日出库量,0) as 当日出库量 from (
|
select t1.day,ifnull(t1.当日入库次数,0) as 当日入库次数,ifnull(t2.当日出库次数,0) as 当日出库次数 from (
|
||||||
select date_format(entry_time, '%Y-%m-%d') day, count(*) 当日入库量
|
select date_format(entry_time, '%Y-%m-%d') day, count(*) 当日入库次数
|
||||||
from rt_tool
|
from rt_tool
|
||||||
where project_sn = #{projectSn}
|
where project_sn = #{projectSn}
|
||||||
<if test="type == '1'.toString()">
|
<if test="type == '1'.toString()">
|
||||||
@ -20,7 +20,7 @@
|
|||||||
group by day
|
group by day
|
||||||
</if>
|
</if>
|
||||||
)t1 left join (
|
)t1 left join (
|
||||||
select date_format(exit_time, '%Y-%m-%d') day, count(*) 当日出库量
|
select date_format(exit_time, '%Y-%m-%d') day, count(*) 当日出库次数
|
||||||
from rt_tool
|
from rt_tool
|
||||||
where project_sn = #{projectSn}
|
where project_sn = #{projectSn}
|
||||||
<if test="type == '1'.toString()">
|
<if test="type == '1'.toString()">
|
||||||
@ -29,8 +29,8 @@
|
|||||||
</if>
|
</if>
|
||||||
)t2 on t1.day=t2.day
|
)t2 on t1.day=t2.day
|
||||||
union
|
union
|
||||||
select t2.day,ifnull(t1.当日入库量,0) as 当日入库量,ifnull(t2.当日出库量,0) as 当日出库量 from (
|
select t2.day,ifnull(t1.当日入库次数,0) as 当日入库次数,ifnull(t2.当日出库次数,0) as 当日出库次数 from (
|
||||||
select date_format(entry_time, '%Y-%m-%d') day, count(*) 当日入库量
|
select date_format(entry_time, '%Y-%m-%d') day, count(*) 当日入库次数
|
||||||
from rt_tool
|
from rt_tool
|
||||||
where project_sn = #{projectSn}
|
where project_sn = #{projectSn}
|
||||||
<if test="type == '1'.toString()">
|
<if test="type == '1'.toString()">
|
||||||
@ -38,7 +38,7 @@
|
|||||||
group by day
|
group by day
|
||||||
</if>
|
</if>
|
||||||
)t1 right join (
|
)t1 right join (
|
||||||
select date_format(exit_time, '%Y-%m-%d') day, count(*) 当日出库量
|
select date_format(exit_time, '%Y-%m-%d') day, count(*) 当日出库次数
|
||||||
from rt_tool
|
from rt_tool
|
||||||
where project_sn = #{projectSn}
|
where project_sn = #{projectSn}
|
||||||
<if test="type == '1'.toString()">
|
<if test="type == '1'.toString()">
|
||||||
|
|||||||
@ -22,20 +22,29 @@
|
|||||||
pvc.video_type as pvc_video_type,
|
pvc.video_type as pvc_video_type,
|
||||||
pvc.is_enable as pvc_is_enable,
|
pvc.is_enable as pvc_is_enable,
|
||||||
pvc.account as pvc_account,
|
pvc.account as pvc_account,
|
||||||
pvc.`password` as pvc_password ,
|
pvc.`password` as pvc_password,
|
||||||
pvc.app_id as pvc_app_id,
|
pvc.app_id as pvc_app_id,
|
||||||
pvc.app_secret as pvc_app_secret,
|
pvc.app_secret as pvc_app_secret,
|
||||||
pvc.play_type as pvc_play_type
|
pvc.play_type as pvc_play_type
|
||||||
from rt_work_ticket rwt
|
from rt_work_ticket rwt
|
||||||
left join project_video_config pvc on pvc.project_sn=rwt.project_sn and is_enable=1
|
left join project_video_config pvc on pvc.project_sn = rwt.project_sn and is_enable = 1
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countRtWorkTicket" resultType="com.zhgd.xmgl.modules.rt.entity.vo.CountRtWorkTicketVo">
|
<select id="countRtWorkTicket" resultType="com.zhgd.xmgl.modules.rt.entity.vo.CountRtWorkTicketVo">
|
||||||
select t.*,(count-t.todayCount) historyCount
|
select t.*, (count - t.todayCount) historyCount
|
||||||
from (select
|
from (select count(*) count,
|
||||||
count(*) count,
|
ifnull(
|
||||||
ifnull(sum(if(create_time >= CURDATE(), 1, 0)), 0) as todayCount
|
sum(
|
||||||
|
IF
|
||||||
|
(((start_time <![CDATA[<=]]> now() OR start_time IS NULL)
|
||||||
|
AND (end_time >= now() OR end_time IS NULL)
|
||||||
|
AND (start_time IS NOT NULL OR end_time IS NOT NULL)),
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
)),
|
||||||
|
0
|
||||||
|
) AS todayCount
|
||||||
from rt_work_ticket
|
from rt_work_ticket
|
||||||
where project_sn = #{projectSn}) t
|
where project_sn = #{projectSn}) t
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -147,6 +147,8 @@ public class RtToolServiceImpl extends ServiceImpl<RtToolMapper, RtTool> impleme
|
|||||||
source1.addAll(source2);
|
source1.addAll(source2);
|
||||||
//实时和历史的记录相加
|
//实时和历史的记录相加
|
||||||
Map<String, List<HashMap<String, Object>>> dayMap = source1.stream().collect(Collectors.groupingBy(map -> MapUtils.getString(map, "day")));
|
Map<String, List<HashMap<String, Object>>> dayMap = source1.stream().collect(Collectors.groupingBy(map -> MapUtils.getString(map, "day")));
|
||||||
|
String inStr = "当日入库次数";
|
||||||
|
String outStr = "当日出库次数";
|
||||||
for (Map.Entry<String, List<HashMap<String, Object>>> entry : dayMap.entrySet()) {
|
for (Map.Entry<String, List<HashMap<String, Object>>> entry : dayMap.entrySet()) {
|
||||||
HashMap<String, Object> hm = new HashMap<>();
|
HashMap<String, Object> hm = new HashMap<>();
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
@ -156,20 +158,20 @@ public class RtToolServiceImpl extends ServiceImpl<RtToolMapper, RtTool> impleme
|
|||||||
String day = null;
|
String day = null;
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
for (HashMap<String, Object> map : list) {
|
for (HashMap<String, Object> map : list) {
|
||||||
in += MapUtils.getInteger(map, "当日入库量");
|
in += MapUtils.getInteger(map, inStr);
|
||||||
out += MapUtils.getInteger(map, "当日出库量");
|
out += MapUtils.getInteger(map, outStr);
|
||||||
day = MapUtils.getString(map, "day");
|
day = MapUtils.getString(map, "day");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hm.put("day", day);
|
hm.put("day", day);
|
||||||
hm.put("当日入库量", in);
|
hm.put(inStr, in);
|
||||||
hm.put("当日出库量", out);
|
hm.put(outStr, out);
|
||||||
source.add(hm);
|
source.add(hm);
|
||||||
}
|
}
|
||||||
List<String> dimensions = new ArrayList<>();
|
List<String> dimensions = new ArrayList<>();
|
||||||
dimensions.add("day");
|
dimensions.add("day");
|
||||||
dimensions.add("当日入库量");
|
dimensions.add(inStr);
|
||||||
dimensions.add("当日出库量");
|
dimensions.add(outStr);
|
||||||
flexibleBigScreenVo.setDimensions(dimensions);
|
flexibleBigScreenVo.setDimensions(dimensions);
|
||||||
flexibleBigScreenVo.setSource(source);
|
flexibleBigScreenVo.setSource(source);
|
||||||
List<String> strList = DateUtils.getDateTimeStrList(60, "yyyy-MM-dd");
|
List<String> strList = DateUtils.getDateTimeStrList(60, "yyyy-MM-dd");
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
|
||||||
import com.zhgd.xmgl.modules.project.entity.ProjectVideoConfig;
|
import com.zhgd.xmgl.modules.project.entity.ProjectVideoConfig;
|
||||||
import com.zhgd.xmgl.modules.project.mapper.ProjectVideoConfigMapper;
|
import com.zhgd.xmgl.modules.project.mapper.ProjectVideoConfigMapper;
|
||||||
import com.zhgd.xmgl.modules.rt.entity.RtRiskSecurityLibraryType;
|
import com.zhgd.xmgl.modules.rt.entity.RtRiskSecurityLibraryType;
|
||||||
@ -87,8 +86,14 @@ public class RtWorkTicketServiceImpl extends ServiceImpl<RtWorkTicketMapper, RtW
|
|||||||
QueryWrapper<RtWorkTicket> queryWrapper = QueryGenerator.initPageQueryWrapper(RtWorkTicket.class, paramMap, alias);
|
QueryWrapper<RtWorkTicket> queryWrapper = QueryGenerator.initPageQueryWrapper(RtWorkTicket.class, paramMap, alias);
|
||||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(RtWorkTicket::getId));
|
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(RtWorkTicket::getId));
|
||||||
if (Objects.equals(type, 1)) {
|
if (Objects.equals(type, 1)) {
|
||||||
queryWrapper.le(RefUtil.fieldNameUlc(RtWorkTicket::getStartTime), DateUtil.now());
|
String startTime = alias + RefUtil.fieldNameUlc(RtWorkTicket::getStartTime);
|
||||||
queryWrapper.ge(RefUtil.fieldNameUlc(RtWorkTicket::getEndTime), DateUtil.now());
|
queryWrapper.and(qw -> qw.le(startTime, DateUtil.now())
|
||||||
|
.or().isNull(startTime));
|
||||||
|
String endTime = alias + RefUtil.fieldNameUlc(RtWorkTicket::getEndTime);
|
||||||
|
queryWrapper.and(qw -> qw.ge(endTime, DateUtil.now())
|
||||||
|
.or().isNull(endTime));
|
||||||
|
queryWrapper.and(qw -> qw.isNotNull(startTime)
|
||||||
|
.or().isNotNull(endTime));
|
||||||
}
|
}
|
||||||
queryWrapper.le(Objects.equals(type, 2), RefUtil.fieldNameUlc(RtWorkTicket::getCreateTime), DateUtil.formatDateTime(DateUtil.endOfDay(DateUtil.offsetDay(DateUtil.date(), -1))));
|
queryWrapper.le(Objects.equals(type, 2), RefUtil.fieldNameUlc(RtWorkTicket::getCreateTime), DateUtil.formatDateTime(DateUtil.endOfDay(DateUtil.offsetDay(DateUtil.date(), -1))));
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user