🐞 fix: 报告生成-厂界在线部分细节调整
This commit is contained in:
parent
0050fd0d27
commit
13a54ebcb6
|
@ -46,11 +46,11 @@ public class OilReportController extends BaseController {
|
||||||
// 异常设备数
|
// 异常设备数
|
||||||
int abnormalDeviceCount = getDeviceCount(deptId, year, 0);
|
int abnormalDeviceCount = getDeviceCount(deptId, year, 0);
|
||||||
// 全年解决报警次数
|
// 全年解决报警次数
|
||||||
// int alarmSolveCountYear = oilThDeviceDealService.countThDeviceDealByYear(year);
|
int alarmSolveCountYear = oilThDeviceDealService.countThDeviceDealByYear(year);
|
||||||
resultMap.put("deviceCount", deviceCount);
|
resultMap.put("deviceCount", deviceCount);
|
||||||
resultMap.put("normalDeviceCount", normalDeviceCount);
|
resultMap.put("normalDeviceCount", normalDeviceCount);
|
||||||
resultMap.put("abnormalDeviceCount", abnormalDeviceCount);
|
resultMap.put("abnormalDeviceCount", abnormalDeviceCount);
|
||||||
// resultMap.put("alarmSolveCountYear", alarmSolveCountYear);
|
resultMap.put("alarmSolveCountYear", alarmSolveCountYear);
|
||||||
return AjaxResult.success(resultMap);
|
return AjaxResult.success(resultMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,5 +114,5 @@ public interface OilMonitorMapper {
|
||||||
|
|
||||||
Integer querryDealTotal(@Param("reportId") Long reportId);
|
Integer querryDealTotal(@Param("reportId") Long reportId);
|
||||||
|
|
||||||
|
Integer countThDeviceDealByYear(@Param("year") String year);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,14 +3,7 @@ package com.ruoyi.project.oil.mapper;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Lenovo
|
|
||||||
* @description 针对表【th_device_deal】的数据库操作Mapper
|
|
||||||
* @createDate 2024-10-29 15:40:41
|
|
||||||
* @Entity com.ruoyi.oil.domain.monitor.ThDeviceDeal
|
|
||||||
*/
|
|
||||||
public interface ThDeviceDealMapper {
|
public interface ThDeviceDealMapper {
|
||||||
int countThDeviceDealByYear(@Param("year") String year);
|
int selectThDeviceDealByYear(@Param("year") String year);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.project.oil.service.impl;
|
package com.ruoyi.project.oil.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.project.oil.mapper.OilMonitorMapper;
|
||||||
import com.ruoyi.project.oil.mapper.ThDeviceDealMapper;
|
import com.ruoyi.project.oil.mapper.ThDeviceDealMapper;
|
||||||
import com.ruoyi.project.oil.service.IOilThDeviceDealService;
|
import com.ruoyi.project.oil.service.IOilThDeviceDealService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -9,10 +10,10 @@ import org.springframework.stereotype.Service;
|
||||||
public class OilThDeviceDealServiceImpl implements IOilThDeviceDealService {
|
public class OilThDeviceDealServiceImpl implements IOilThDeviceDealService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ThDeviceDealMapper thDeviceDealMapper;
|
private OilMonitorMapper oilMonitorMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int countThDeviceDealByYear(String year) {
|
public int countThDeviceDealByYear(String year) {
|
||||||
return thDeviceDealMapper.countThDeviceDealByYear(year);
|
return oilMonitorMapper.countThDeviceDealByYear(year);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -471,4 +471,9 @@ select t.id,t. name,t.unit_no,t.system_no,t.status,t.sn,t.file_url,t.note,t.crea
|
||||||
<select id="querryDealTotal" resultType="java.lang.Integer">
|
<select id="querryDealTotal" resultType="java.lang.Integer">
|
||||||
select count(*) from th_device_deal where report_id=#{reportId}
|
select count(*) from th_device_deal where report_id=#{reportId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="countThDeviceDealByYear" parameterType="string" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(1) FROM th_device_deal
|
||||||
|
WHERE to_char(create_time, 'yyyy') = #{year}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -1,41 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
|
|
||||||
<mapper namespace="com.ruoyi.project.oil.mapper.ThDeviceDealMapper">
|
|
||||||
<parameterMap id="BaseParameterMap" type="com.ruoyi.project.oil.domain.monitor.ThDeviceDeal">
|
|
||||||
<parameter property="id" jdbcType="BIGINT" />
|
|
||||||
<parameter property="reportId" jdbcType="BIGINT" />
|
|
||||||
<parameter property="dealUser" jdbcType="VARCHAR" />
|
|
||||||
<parameter property="dealWay" jdbcType="VARCHAR" />
|
|
||||||
<parameter property="dealTime" jdbcType="TIMESTAMP" />
|
|
||||||
<parameter property="createBy" jdbcType="VARCHAR" />
|
|
||||||
<parameter property="createTime" jdbcType="TIMESTAMP" />
|
|
||||||
<parameter property="reason" jdbcType="VARCHAR" />
|
|
||||||
<parameter property="fileUrl" jdbcType="VARCHAR" />
|
|
||||||
<parameter property="status" jdbcType="INTEGER" />
|
|
||||||
<parameter property="remark" jdbcType="VARCHAR" />
|
|
||||||
</parameterMap>
|
|
||||||
<resultMap id="ThDeviceDealResultMap" type="com.ruoyi.project.oil.domain.monitor.ThDeviceDeal">
|
|
||||||
<id property="id" column="ID" jdbcType="BIGINT" />
|
|
||||||
<result property="reportId" column="REPORT_ID" jdbcType="BIGINT" />
|
|
||||||
<result property="dealUser" column="DEAL_USER" jdbcType="VARCHAR" />
|
|
||||||
<result property="dealWay" column="DEAL_WAY" jdbcType="VARCHAR" />
|
|
||||||
<result property="dealTime" column="DEAL_TIME" jdbcType="TIMESTAMP" />
|
|
||||||
<result property="createBy" column="CREATE_BY" jdbcType="VARCHAR" />
|
|
||||||
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP" />
|
|
||||||
<result property="reason" column="REASON" jdbcType="VARCHAR" />
|
|
||||||
<result property="fileUrl" column="FILE_URL" jdbcType="VARCHAR" />
|
|
||||||
<result property="status" column="STATUS" jdbcType="INTEGER" />
|
|
||||||
<result property="remark" column="REMARK" jdbcType="VARCHAR" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
|
|
||||||
<select id="countThDeviceDealByYear" parameterType="map" resultType="int">
|
|
||||||
SELECT COUNT(1) FROM th_device_deal
|
|
||||||
WHERE to_char(create_time, 'yyyy') = #{year}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
|
@ -42,7 +42,7 @@
|
||||||
<el-col
|
<el-col
|
||||||
v-for="item in group"
|
v-for="item in group"
|
||||||
:key="item.label"
|
:key="item.label"
|
||||||
:span="8"
|
:span="24/rowTagNum"
|
||||||
style="display: flex; justify-content: center"
|
style="display: flex; justify-content: center"
|
||||||
>
|
>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
@ -107,59 +107,8 @@ export default {
|
||||||
dept: null,
|
dept: null,
|
||||||
year: "",
|
year: "",
|
||||||
total: 0,
|
total: 0,
|
||||||
tableData: [
|
tableData: [],
|
||||||
{
|
rowTagNum: 4,
|
||||||
deptName: "企业1",
|
|
||||||
sn: "SN001",
|
|
||||||
position: "位置1",
|
|
||||||
month1: 1,
|
|
||||||
month2: 2,
|
|
||||||
month3: 3,
|
|
||||||
month4: 4,
|
|
||||||
month5: 5,
|
|
||||||
month6: 6,
|
|
||||||
month7: 7,
|
|
||||||
month8: 8,
|
|
||||||
month9: 9,
|
|
||||||
month10: 10,
|
|
||||||
month11: 11,
|
|
||||||
month12: 12,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
deptName: "企业2",
|
|
||||||
sn: "SN002",
|
|
||||||
position: "位置2",
|
|
||||||
month1: 1,
|
|
||||||
month2: 2,
|
|
||||||
month3: 3,
|
|
||||||
month4: 4,
|
|
||||||
month5: 5,
|
|
||||||
month6: 6,
|
|
||||||
month7: 7,
|
|
||||||
month8: 8,
|
|
||||||
month9: 9,
|
|
||||||
month10: 10,
|
|
||||||
month11: 11,
|
|
||||||
month12: 12,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
deptName: "企业3",
|
|
||||||
sn: "SN003",
|
|
||||||
position: "位置3",
|
|
||||||
month1: 1,
|
|
||||||
month2: 2,
|
|
||||||
month3: 3,
|
|
||||||
month4: 4,
|
|
||||||
month5: 5,
|
|
||||||
month6: 6,
|
|
||||||
month7: 7,
|
|
||||||
month8: 8,
|
|
||||||
month9: 9,
|
|
||||||
month10: 10,
|
|
||||||
month11: 11,
|
|
||||||
month12: 12,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
dashboardTag: [
|
dashboardTag: [
|
||||||
{
|
{
|
||||||
label: "设备总数",
|
label: "设备总数",
|
||||||
|
@ -171,26 +120,26 @@ export default {
|
||||||
key: "normalDeviceCount",
|
key: "normalDeviceCount",
|
||||||
icon: "el-icon-help",
|
icon: "el-icon-help",
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
label: "异常设备数",
|
// label: "异常设备数",
|
||||||
key: "abnormalDeviceCount",
|
// key: "abnormalDeviceCount",
|
||||||
icon: "el-icon-s-help",
|
// icon: "el-icon-s-help",
|
||||||
},
|
// },
|
||||||
// {
|
// {
|
||||||
// label: "正在报警设备数",
|
// label: "正在报警设备数",
|
||||||
// key: "alarmDeviceCount",
|
// key: "alarmDeviceCount",
|
||||||
// icon: "el-icon-message-solid",
|
// icon: "el-icon-message-solid",
|
||||||
// },
|
// },
|
||||||
// {
|
{
|
||||||
// label: "全年报警次数",
|
label: "全年报警次数",
|
||||||
// key: "alarmCountYear",
|
key: "alarmCountYear",
|
||||||
// icon: "el-icon-s-marketing",
|
icon: "el-icon-s-marketing",
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// label: "全年解决报警次数",
|
label: "全年解决报警次数",
|
||||||
// key: "alarmSolveCountYear",
|
key: "alarmSolveCountYear",
|
||||||
// icon: "el-icon-folder-checked",
|
icon: "el-icon-folder-checked",
|
||||||
// },
|
},
|
||||||
// {
|
// {
|
||||||
// label: "全年未解决报警次数",
|
// label: "全年未解决报警次数",
|
||||||
// key: "alarmUnsolvedCountYear",
|
// key: "alarmUnsolvedCountYear",
|
||||||
|
@ -243,7 +192,7 @@ export default {
|
||||||
}
|
}
|
||||||
return newArr;
|
return newArr;
|
||||||
}
|
}
|
||||||
return splitArray(this.dashboardTag, 3);
|
return splitArray(this.dashboardTag, this.rowTagNum);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -272,6 +221,17 @@ export default {
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.tableData = res.data;
|
this.tableData = res.data;
|
||||||
|
console.log(this.tableData);
|
||||||
|
this.dashboardData.alarmCountYear = res.data.reduce((prev, cur) => {
|
||||||
|
for (let key in cur) {
|
||||||
|
if (key.includes("month")) {
|
||||||
|
prev += cur[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return prev;
|
||||||
|
},
|
||||||
|
0
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -308,7 +268,7 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: end;
|
align-items: flex-end;
|
||||||
|
|
||||||
.card-content__title {
|
.card-content__title {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
Loading…
Reference in New Issue