Commit 27acb673 authored by zhangjianqian's avatar zhangjianqian

评论汇总

parent 919aface
...@@ -87,4 +87,14 @@ public class TEnterpriseRankingController extends BaseController ...@@ -87,4 +87,14 @@ public class TEnterpriseRankingController extends BaseController
{ {
return toAjax(tEnterpriseRankingService.deleteTEnterpriseRankingByIds(rankingIds)); return toAjax(tEnterpriseRankingService.deleteTEnterpriseRankingByIds(rankingIds));
} }
/**
* 根据年份获取企业评价评分
*/
@GetMapping(value = "/byyear")
public AjaxResult getInfo(Integer yearNum)
{
return AjaxResult.success(tEnterpriseRankingService.selectFractionByYear(yearNum));
}
} }
package com.zehong.system.mapper; package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TEnterpriseRanking; import com.zehong.system.domain.TEnterpriseRanking;
/** /**
...@@ -58,4 +60,11 @@ public interface TEnterpriseRankingMapper ...@@ -58,4 +60,11 @@ public interface TEnterpriseRankingMapper
* @return 结果 * @return 结果
*/ */
public int deleteTEnterpriseRankingByIds(Long[] rankingIds); public int deleteTEnterpriseRankingByIds(Long[] rankingIds);
/**
* 根据年份查询企业评论分
* @param yearNum
* @return
*/
public Map<String,Object> selectFractionByYear(Integer yearNum);
} }
package com.zehong.system.service; package com.zehong.system.service;
import java.util.List; import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TEnterpriseRanking; import com.zehong.system.domain.TEnterpriseRanking;
/** /**
...@@ -58,4 +60,10 @@ public interface ITEnterpriseRankingService ...@@ -58,4 +60,10 @@ public interface ITEnterpriseRankingService
* @return 结果 * @return 结果
*/ */
public int deleteTEnterpriseRankingById(Long rankingId); public int deleteTEnterpriseRankingById(Long rankingId);
/**
* 根据年份查询企业评论分
* @return
*/
public List<Map<String,Object>> selectFractionByYear(Integer yearNum);
} }
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -81,6 +84,21 @@ public class TEnterpriseRankingServiceImpl implements ITEnterpriseRankingService ...@@ -81,6 +84,21 @@ public class TEnterpriseRankingServiceImpl implements ITEnterpriseRankingService
return tEnterpriseRankingMapper.deleteTEnterpriseRankingByIds(rankingIds); return tEnterpriseRankingMapper.deleteTEnterpriseRankingByIds(rankingIds);
} }
/**
* 根据年份查询企业评论分
* @return
*/
public List<Map<String,Object>> selectFractionByYear(Integer yearNum){
List<Map<String,Object>> list = new ArrayList<>();
for (int i=0;i<6;i++){
yearNum++;
Map<String,Object> map = tEnterpriseRankingMapper.selectFractionByYear(yearNum);
map.put("yearNum",yearNum);
list.add(map);
}
return list;
}
/** /**
* 删除企业评价信息 * 删除企业评价信息
* *
......
...@@ -86,4 +86,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -86,4 +86,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{rankingId} #{rankingId}
</foreach> </foreach>
</delete> </delete>
<select id="selectFractionByYear" resultType="hashmap" >
SELECT GROUP_CONCAT(e.enterprise_name) as enterpriseName,GROUP_CONCAT(IFNULL(r.fraction,0)) as fraction FROM
(SELECT * FROM t_enterprise_info
WHERE enterprise_id IN (SELECT beyond_enterprise_id FROM t_enterprise_ranking GROUP BY beyond_enterprise_id)
order by enterprise_id)e
LEFT JOIN t_enterprise_ranking r ON r.beyond_enterprise_id = e.enterprise_id AND r.year_num =#{yearNum}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -50,4 +50,14 @@ export function exportRanking(query) { ...@@ -50,4 +50,14 @@ export function exportRanking(query) {
method: 'get', method: 'get',
params: query params: query
}) })
} }
\ No newline at end of file
// 企业评价
export function byyearRanking(query) {
return request({
url: '/system/ranking/byyear',
method: 'get',
params: query
})
}
<!--
* @Author: your name
* @Date: 2022-04-11 15:07:47
* @LastEditTime: 2022-04-20 11:09:34
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/xunjianxuncha/topChars/left.vue
-->
<template>
<div class="charsCom all-flex-h">
<div class="title">风险变化走势</div>
<div class="two all-flex">
<div class="left">
<div id="main" class="chars-box" >
</div>
</div>
</div>
</div>
</template>
<script>
//import { hiddenBookqiyeStatistics,hiddenBookYearStatistics } from "@/api/standingBook/hidden";
import { byyearRanking } from "@/api/system/ranking";
export default {
components: {
},
props:{
annual: {
type: String,
default: 2025,
},
companyInfoId: {
type: String,
default: 23,
},
},
data() {
return {
option:{
///color:['RoyalBlue',"lightblue"],
title: {
text: ''
},
legend: {
data: ['已整改', '未整改']
},
xAxis: [
{
type: 'category',
splitLine: { show: false },
data: ['2020', '2021', '2022', '2023', '2024', '2025', '2026']
}
],
yAxis:{
axisLine: {
show: true,
lineStyle: {
color: "#bbb6b6",
},
},
splitLine: {
show: true,
lineStyle: {
type: "dashed",
color: "#bbb6b6",
},
},
type: "value",
} ,
series: [
{
name: '已整改',
type: 'line',
stack: 'Total',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '未整改',
type: 'line',
stack: 'Total',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: [220, 182, 191, 234, 290, 330, 310]
}
]
},
};
},
created(){
setTimeout(this.getzhanshi,1000)
},
methods: {
getzhanshi(){
var arr=[];
byyearRanking({yearNum:2020}).then(res =>{
if(res.data.length>0){
var namestr = res.data[0].enterpriseName.split(',');
this.option.legend.data = namestr;
var listarr = res.data;
for(var i =0;i<namestr.length;i++){
var date = [];
//取企业每年评分
for(var item of listarr){
date.push(parseFloat(item.fraction.split(',')[i]))
}
var model = {
name: namestr[i],
type: 'line',
areaStyle: {},
smooth: true,
emphasis: {
focus: 'series'
},
data: date
}
arr.push(model)
}
}
console.log("arr",arr);
this.option.series = arr;
this.option.xAxis.data = [2021,2022,2023,2024,2025,2026];
console.log(this.option)
var myChart = this.$echarts.init(document.getElementById('main'));
myChart.setOption(this.option);
})
},
},
};
</script>
<style lang="scss" scoped>
.charsCom {
width: 100%;
height: 100%;
color: #333333;
}
.title {
text-align: center;
font-size: 24px;
margin-bottom: 7px;
}
.two {
flex: 1;
> .left {
max-width: 90%;
margin-right: 70px;
.first {
margin-bottom: 6px;
}
.chars-box {
width: 90%;
height: 100%;
margin: 0 auto;
}
.second {
width: 213px;
height: 30px;
line-height: 30px;
box-sizing: border-box;
box-shadow: 0px 0px 3px 1px #dddddd;
margin-bottom: 19px;
> div {
// flex: 1;
text-align: center;
&.left {
color: #1d8cf3;
}
&.right {
color: #00c3f1;
}
}
}
.third {
text-align: center;
width: 213px;
margin-bottom: 24px;
}
}
> .right {
width: 50%;
.first {
text-align: center !important;
}
.chars-box {
width: 100%;
height: 90%;
margin: 0 auto;
}
}
> div {
font-size: 16px;
flex: 1;
// display: flex;
// flex-direction: column;
}
.left,
.right {
// display: flex;
// flex-direction: column;
// justify-content: space-between;
.first {
text-align: left;
.text {
display: inline-block;
margin-right: 8px;
}
}
}
}
.three {
font-size: 16px;
flex: 1;
// background: red;
.chars-box {
flex: 1;
}
}
</style>
<!--
* @Author: your name
* @Date: 2022-04-11 14:11:04
* @LastEditTime: 2022-04-14 10:45:52
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/xunjianxuncha/index.vue
-->
<template>
<div class="app-container xjxc">
<div class="wrapper flex-h">
<div class="bottom">
<Middle :annual="activeName" :companyInfoId="companyInfoId" />
</div>
</div>
</div>
</template>
<script>
import Middle from "./components/Middle";
import { enterpriseLists } from "@/api/regulation/info";
export default {
components: {
Middle
},
data() {
return {
danwei:null,
enterprises: [],
activeName: '2025',
companyInfoId:''
};
},
created() {
this.getEnterpriseLists();
},
methods: {
selectcompanyId(e){
this.companyInfoId = e;
},
//所属单位
getEnterpriseLists(){
const param = {};
enterpriseLists(param).then(response => {
this.enterprises = response.rows;
});
},
handleClick(tab, event) {
console.log(tab, event);
}
},
mounted(){
}
};
</script>
<style lang="scss" scoped>
.app-main {
}
.xjxc {
height: calc(100vh - 50px) !important;
}
.flex {
display: flex;
justify-content: space-between;
}
.flex-h {
display: flex;
// justify-content: space-around;
flex-direction: column;
height: 100%;
.top {
height: 38.7%;
.left {
width: 70%;
padding: 15px 24px 19px;
}
.middle {
width: 35.3%;
padding: 15px 80px 19px 71px;
}
.right {
width: 30.2%;
padding: 15px 29px;
}
> div {
// box-shadow: 2px 0px 13px 1px rgba(0, 0, 0, 0.1);
box-shadow: 2px 0px 10px 1px rgba(0, 0, 0, 0.1);
border-radius: 3px;
}
}
>.middle {
margin: 5px 0;
background: repeating-linear-gradient(135deg, transparent, transparent 3px, #D6D6D6 3px, #D6D6D6 8px);
height: 2px;
}
.bottom {
flex: 1;
}
> div {
// height: 50%;
}
}
.shai{
position: fixed;
right: 20px;
width: 300px;
height: 40px;
}
::v-deep .el-select{
width: 300px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment