累计跟新

main
liukewei 8 months ago
parent 9f748f183d
commit f81142913f

@ -181,5 +181,14 @@ public class EhsIndexStatisticsController extends BaseController {
}
return AjaxResult.success(row);
}
/**
*
*/
@ApiOperation("隐患整改进度分析统计")
@GetMapping("/getHiddenDangerStatusMapList")
public AjaxResult getHiddenDangerStatusMapList()
{
List<Map<String,Object>> list = ehsIndexStatisticsService.getHiddenDangerStatusMapList();
return AjaxResult.success(list);
}
}

@ -229,7 +229,7 @@ public class EhsMyMessageController extends BaseController
String myMsgType ="m"+classFirst.toString();
ehsMaterial.setIsSendQuantity(1);
List<EhsMaterial> list = ehsMaterialService.selectEhsMaterialList(ehsMaterial);
String[] MaterialIds = list.stream().map(item -> item.getMaterialId().toString()).toArray(String[]::new);
String[] MaterialIds = list.stream().map(item -> item.getMaterialDetailId().toString()).toArray(String[]::new);
String strmIds = StringUtils.join(MaterialIds,",");
EhsMyMessage ehsMyMessage = new EhsMyMessage();
ehsMyMessage.setMyMessageType(myMsgType);

@ -209,7 +209,9 @@ public class EhsNoticeMessageController extends BaseController
EhsMyMessage msgNew = new EhsMyMessage();
msgNew.setMyMessageKey(noticeMessageId.toString());
msgNew.setMyMessageState("Y");
ehsMyMessageService.saveMyMessage(msgNew);
msgNew.setMyUserId(SecurityUtils.getUserId());
msgNew.setMyMessageType("1");
ehsMyMessageService.updatebyKeyUserId(msgNew);
return success(ehsNoticeMessage);
}

@ -25,5 +25,6 @@ public interface EhsIndexStatisticsMapper {
List<Map<String,Object>> geteconomicTypeMapList(@Param("deptId") Long deptId);
List<Map<String,Object>> getenterpriseScaleMapList(@Param("deptId") Long deptId);
List<Map<String,Object>> getHiddenDangerTypeMapList(@Param("deptId") Long deptId);
List<Map<String,Object>> getHiddenDangerStatusMapList(@Param("deptId") Long deptId);
List<Map<String,Object>> getHiddenDangerDataMapList(@Param("yearStr") String yearStr,@Param("deptId") Long deptId);
}

@ -35,4 +35,5 @@ public interface EhsIndexStatisticsService {
List<Map<String,Object>> getenterpriseScaleMapList();
List<Map<String,Object>> getHiddenDangerTypeMapList();
List<Map<String,Object>> getHiddenDangerDataMapList(String yearStr);
List<Map<String,Object>> getHiddenDangerStatusMapList( );
}

@ -172,4 +172,19 @@ public class EhsIndexStatisticsServiceImpl implements EhsIndexStatisticsService
}
return mapper.getHiddenDangerDataMapList(yearStr,deptId);
}
@Override
public List<Map<String,Object>> getHiddenDangerStatusMapList() {
Long deptId = null;
// 如果登录用户不是超级管理员,并且他的部门不是唐河县应急管理局(根节点),那么只能查询当前登录用户他的部门创建的公文
SysUser currentUser = SecurityUtils.getLoginUser().getUser();
List<Long> roleIds = currentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
Long deptParentId = currentUser.getDept().getParentId();
if (!roleIds.contains(1L) &&
deptParentId != null &&
deptParentId.longValue() != 0) {
deptId = currentUser.getDept().getDeptId().longValue();
}
return mapper.getHiddenDangerStatusMapList(deptId);
}
}

@ -71,5 +71,7 @@ public class EhsMaterial extends BaseEntity
private String sendQuantity;
@TableField(exist = false)
private Integer isSendQuantity;
@TableField(exist = false)
private Long materialDetailId;
}

@ -78,11 +78,12 @@ public class EhsMyMessageServiceImpl extends ServiceImpl<EhsMyMessageMapper, Ehs
msgNew.setMyMessageType("1");
msgNew.setMyMessageDesc("您有新的消息通知未阅读,请及及时处理!");
msgNew.setMyMessageState(StringUtils.isNotEmpty(msgNew.getMyMessageState())?msgNew.getMyMessageState():"N");
int i = ehsMyMessageMapper.updatebyKeyUserId(msgNew);
/*int i = ehsMyMessageMapper.updatebyKeyUserId(msgNew);
if(i==0){
save(msgNew);
}
return true;
}*/
return save(msgNew);
}
public int updatebyKeyUserId(EhsMyMessage ehsMyMessage){
return ehsMyMessageMapper.updatebyKeyUserId(ehsMyMessage);

@ -71,6 +71,10 @@ public class EhsRiskServiceImpl extends ServiceImpl<EhsRiskMapper, EhsRisk> impl
@Override
public List<EhsRisk> selectEhsRiskList(EhsRisk ehsRisk)
{
if(SecurityUtils.getLoginUser().getUser().getDept().getParentId()!=null &&
SecurityUtils.getLoginUser().getUser().getDept().getParentId().longValue()!=0) {
ehsRisk.setDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId().longValue());
}
return ehsRiskMapper.selectEhsRiskList(ehsRisk);
}
/**

@ -225,6 +225,21 @@ SELECT
GROUP BY
e.hidden_danger_type
</select>
<select id="getHiddenDangerStatusMapList"
resultType="map">
SELECT
ifnull(d.dict_label,'未知') 'name',
count( 1 ) 'value'
FROM
ehs_hidden_danger e
LEFT JOIN sys_dict_data d ON e.status = d.dict_value
AND d.dict_type = 'hidden_danger_status'
<where>
<if test="deptId != null and deptId != ''">and dept_id = #{deptId}</if>
</where>
GROUP BY
e.status
</select>
<select id="getHiddenDangerDataMapList"
resultType="map">
SELECT

@ -25,12 +25,13 @@
<result property="createUserId" column="create_user_id" />
<result property="updateUserId" column="update_user_id" />
<result property="isSendQuantity" column="is_send_quantity" />
<result property="materialDetailId" column="material_detail_id" />
</resultMap>
<sql id="selectEhsMaterialVo">
select m.* , d.dept_name,a.send_quantity from ehs_material m
select m.* , d.dept_name,a.send_quantity ,a.material_detail_id from ehs_material m
left join sys_dept d on m.dept_id = d.dept_id
left join (select GROUP_CONCAT(send_quantity ) send_quantity,m.material_id
left join (select GROUP_CONCAT(send_quantity ) send_quantity,m.material_id,material_detail_id
from ehs_material m left join ehs_material_detail dt
on dt.material_id= m.material_id and dt.outbound_user_id is null group by dt.material_id ) a
on a.material_id= m.material_id

@ -87,7 +87,7 @@
<update id="updatebyKeyUserId" parameterType="GenTableColumn">
update ehs_my_message
set my_message_state = #{myMessageState}
where my_message_key = #{myMessageKey} and my_user_id = #{myUserId}
where my_message_key = #{myMessageKey} and my_user_id = #{myUserId} and my_message_type= #{myMessageType}
</update>
<update id="updateHDbyKeyUserId" parameterType="GenTableColumn">
update ehs_my_message

@ -55,7 +55,7 @@
from ehs_notice_message m
left join sys_user e on e.user_id = m.CREATE_USER_ID
left join sys_dept d on m.dept_id=d.dept_id and d.parent_id!=0
left join ehs_my_message mym on m.notice_message_id = my_message_key
left join ehs_my_message mym on m.notice_message_id = my_message_key and my_message_type = 1
<if test="myUserId != null and myUserId != '' "> and my_user_id = #{myUserId} </if>
<where>
<if test="title != null and title != '' "> and m.title like '%${title}%'</if>

@ -58,7 +58,6 @@
<if test="villageName1 != null and villageName1 != ''"> and village_name1 like concat('%', #{villageName1}, '%')</if>
<if test="villageDuties1 != null and villageDuties1 != ''"> and village_duties1 like concat('%', #{villageDuties1}, '%')</if>
<if test="villageTel1 != null and villageTel1 != ''"> and village_tel1 like concat('%', #{villageTel1}, '%')</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="createUserId != null "> and create_user_id = #{createUserId}</if>
<if test="updateUserId != null "> and update_user_id = #{updateUserId}</if>
<if test="inspectionName != null and inspectionName != ''"> and inspection_name like concat('%', #{inspectionName}, '%')</if>

@ -46,7 +46,14 @@ return request({
params: data
})
}
// 查询隐患整改进度 环
export function getDangerStatus(data) {
return request({
url: '/ehs/indexStatistics/getHiddenDangerStatusMapList',
method: 'get',
params: data
})
}
// 查询行业领域统计 饼
export function getTrade(){
return request({

@ -69,9 +69,9 @@
<router-link to="/user/profile">
<el-dropdown-item>个人中心</el-dropdown-item>
</router-link>
<el-dropdown-item @click.native="setting = true">
<!--<el-dropdown-item @click.native="setting = true">
<span>布局设置</span>
</el-dropdown-item>
</el-dropdown-item>-->
<el-dropdown-item divided @click.native="logout">
<span>退出登录</span>
</el-dropdown-item>
@ -291,7 +291,7 @@
style: "position:absolute;right: 15px;cursor:pointer",
on: {
click: () => {
this.goMaterial(response.data.myMessageId, response.data.myMessageType.substring(1, 2),this.getCount((response.data.myMessageKey.split(",")).length));
this.goMaterial(this.getCount(response.data.myMessageKey), response.data.myMessageType.substring(1, 2));
},
},
},

@ -124,7 +124,7 @@
</div>
<!-- <div class="right_top bcg" :style="$store.state.app.sidebar.opened ? 'width: 24%;': 'width: 32%;' "> -->
<div class="right_top bcg">
<h3>上报隐患数量排名</h3>
<h3>本月上报隐患排名</h3>
<el-table
ref="right_top"
class="custom-table"
@ -185,7 +185,7 @@ import {
getTrade,
getEconomics,
getScale,
getDangerClass,
getDangerStatus,
getDangerList,
} from "@/api/ehs/ehsExamples";
import indexHD from "./indexHD";
@ -296,10 +296,10 @@ export default {
// myChart.resize();
},
async rightBominit() {
let res = await getDangerClass();
let res = await getDangerStatus();
this.myChart2 = echarts.init(this.$refs.right_bom);
let option = {
title: { text: "隐患类型分析统计" },
title: { text: "隐患整改进度统计" },
tooltip: {
trigger: "item",
},
@ -310,7 +310,7 @@ export default {
},
series: [
{
name: "隐患类型数量",
name: "隐患数量",
type: "pie",
radius: ["40%", "70%"],
avoidLabelOverlap: false,
@ -517,7 +517,7 @@ export default {
mounted() {
// this.autoScroll();
this.leftCenterinit(); //
this.rightBominit(); //
this.rightBominit(); //
this.hylyinit(); //
this.jjClassInit(); //
this.scaleInit(); //

@ -119,7 +119,7 @@
v-hasPermi="['ehsMaterial:ehsMaterial:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<!--<el-col :span="1.5">
<el-button
type="success"
plain
@ -140,7 +140,7 @@
@click="handleDelete"
v-hasPermi="['ehsMaterial:ehsMaterial:remove']"
>删除</el-button>
</el-col>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
@ -198,14 +198,14 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
<el-button v-if="curDeptId==scope.row.deptId"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['ehsMaterial:ehsMaterial:edit']"
>修改</el-button>
<el-button
<el-button v-if="curDeptId==scope.row.deptId"
size="mini"
type="text"
icon="el-icon-delete"
@ -477,6 +477,7 @@
pageSize: 10,
//
deptShow: false,
curDeptId:null,//id
//
allDeptList: [],
sendQuantity:"",//
@ -571,6 +572,7 @@
this.getListAllDept();
this.deptShow = this.$store.state.user.parentId==0 ?true :false;
this.curDeptId = this.$store.state.user.deptId;
//console.log(this.curDict);
this.getMaterialClassJson(this.materialClass);
//this.getSendQuantityList();

@ -192,7 +192,7 @@
v-hasPermi="['ehsRisk:ehsRisk:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<!--<el-col :span="1.5">
<el-button
type="success"
plain
@ -213,7 +213,7 @@
@click="handleDelete"
v-hasPermi="['ehsRisk:ehsRisk:remove']"
>删除</el-button>
</el-col>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
@ -285,14 +285,14 @@
<!--<el-table-column label="创建者部门" align="center" prop="deptId" />-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
<el-button v-if="curDeptId==scope.row.deptId"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['ehsRisk:ehsRisk:edit']"
>修改</el-button>
<el-button
<el-button v-if="curDeptId==scope.row.deptId"
size="mini"
type="text"
icon="el-icon-delete"
@ -498,6 +498,7 @@
open: false,
//
deptShow: false,
curDeptId:null,//id
//
allDeptList: [],
//
@ -582,7 +583,7 @@
this.getList();
this.getListAllDept();
this.deptShow = this.$store.state.user.parentId==0 ?true :false;
//this.curDeptId = this.$store.state.user.deptId;
this.curDeptId = this.$store.state.user.deptId;
},
methods: {
/** 查询风险信息列表 */
@ -733,7 +734,7 @@
handleImport() {
console.log(this.$refs.uploadRef.upload);
this.$refs.uploadRef.upload.open = true;
this.$refs.uploadRef.upload.title = "应急救援队伍导入";
this.$refs.uploadRef.upload.title = "风险信息导入";
this.$refs.uploadRef.upload.url =
process.env.VUE_APP_BASE_API + "/ehsRisk/ehsRisk/importData";
},

Loading…
Cancel
Save