Commit 5bc24aae authored by wanghao's avatar wanghao

1 重要风险点管控-按照 文档调整

    具体正在调整项为:
    1 调整成 有 企业 新增数据后,上传给  政府,政府查看后,上传给 省平台
    2  企业 新增 默认不上传,操作上加个 上传的按钮,点击上传给政府 后不能 修改,不能删除。
    3  涉及燃气企业编码  改成 燃气企业,默认就是 企业提交的名称。
    4 县级行政区ID 改成  县级行政区 ,数据从 上面 县级行政区接口获取下拉数据。
parent 00c967e2
......@@ -44,7 +44,7 @@ public class TRiskDevMajInforController extends BaseController
@GetMapping("/export")
public AjaxResult export(TRiskDevMajInfor tRiskDevMajInfor)
{
List<TRiskDevMajInfor> list = tRiskDevMajInforService.selectTRiskDevMajInforList(tRiskDevMajInfor);
List<TRiskDevMajInfor> list = tRiskDevMajInforService.exportRiskDevMajInforList(tRiskDevMajInfor);
ExcelUtil<TRiskDevMajInfor> util = new ExcelUtil<TRiskDevMajInfor>(TRiskDevMajInfor.class);
return util.exportExcel(list, "重要风险点管控数据");
}
......
......@@ -116,7 +116,7 @@ public class TPipeOldPlanProcess extends BaseEntity
private String fUploadType;
/** 上传时间,yyyy-MM-dd hh:mm:ss */
@Excel(name = "上传时间")
@Excel(name = "上传时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private String fUploadTime;
......
......@@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 重要风险点管控对象 t_risk_dev_maj_infor
*
......@@ -72,6 +74,36 @@ public class TRiskDevMajInfor extends BaseEntity
@Excel(name = "最后修改时间")
private String fUpdateTime;
/**
* 企业端上传状态 0-未上传,1-已上传,Excel 企业和政府通用
*/
@Excel(name = "上传状态",readConverterExp = "1=已上传,0=未上传")
private String entUploadState;
/**
* 企业端上传时间 Excel 企业和政府通用
*/
@Excel(name = "上传时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date entUploadTime;
/**
* 政府端上传 状态
*/
private String govUploadState;
/**
* 政府端上传 时间
*/
private Date govUploadTime;
public void updateFields() {
this.entUploadState = govUploadState;
if (govUploadTime != null) {
this.entUploadTime = govUploadTime;
} else {
this.entUploadTime = null;
}
}
public void setfRiskDevMajInforId(Long fRiskDevMajInforId)
{
this.fRiskDevMajInforId = fRiskDevMajInforId;
......@@ -190,6 +222,38 @@ public class TRiskDevMajInfor extends BaseEntity
return fUpdateTime;
}
public String getEntUploadState() {
return entUploadState;
}
public void setEntUploadState(String entUploadState) {
this.entUploadState = entUploadState;
}
public Date getEntUploadTime() {
return entUploadTime;
}
public void setEntUploadTime(Date entUploadTime) {
this.entUploadTime = entUploadTime;
}
public String getGovUploadState() {
return govUploadState;
}
public void setGovUploadState(String govUploadState) {
this.govUploadState = govUploadState;
}
public Date getGovUploadTime() {
return govUploadTime;
}
public void setGovUploadTime(Date govUploadTime) {
this.govUploadTime = govUploadTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -27,6 +27,14 @@ public interface TRiskDevMajInforMapper
*/
public List<TRiskDevMajInfor> selectTRiskDevMajInforList(TRiskDevMajInfor tRiskDevMajInfor);
/**
* 查询重要风险点管控列表 - 导出
*
* @param tRiskDevMajInfor 重要风险点管控
* @return 重要风险点管控集合
*/
public List<TRiskDevMajInfor> exportRiskDevMajInforList(TRiskDevMajInfor tRiskDevMajInfor);
/**
* 新增重要风险点管控
*
......
......@@ -27,6 +27,13 @@ public interface ITRiskDevMajInforService
*/
public List<TRiskDevMajInfor> selectTRiskDevMajInforList(TRiskDevMajInfor tRiskDevMajInfor);
/**
* 查询重要风险点管控列表 - 导出用
*
* @param tRiskDevMajInfor 重要风险点管控
* @return 重要风险点管控集合
*/
List<TRiskDevMajInfor> exportRiskDevMajInforList(TRiskDevMajInfor tRiskDevMajInfor);
/**
* 新增重要风险点管控
*
......
package com.zehong.system.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.zehong.common.core.domain.entity.SysRole;
import com.zehong.common.exception.CustomException;
import com.zehong.common.utils.GovernmentDataCopyUtil;
import com.zehong.common.utils.GovernmentDataUtil;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TConGasProInfor;
import com.zehong.system.domain.TRiskDevMajInfor;
import com.zehong.system.domain.vo.TRiskDevMajInfoVo;
import com.zehong.system.mapper.TRiskDevMajInforMapper;
......@@ -21,6 +24,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 重要风险点管控Service业务层处理
......@@ -33,7 +37,7 @@ public class TRiskDevMajInforServiceImpl implements ITRiskDevMajInforService
{
private static final Logger log = LoggerFactory.getLogger(TRiskDevMajInforServiceImpl.class);
@Autowired
@Resource
private TRiskDevMajInforMapper tRiskDevMajInforMapper;
@Resource
......@@ -63,9 +67,39 @@ public class TRiskDevMajInforServiceImpl implements ITRiskDevMajInforService
@Override
public List<TRiskDevMajInfor> selectTRiskDevMajInforList(TRiskDevMajInfor tRiskDevMajInfor)
{
SysRole sysRole = SecurityUtils.getLoginUser().getUser().getRoles().get(0);
if (sysRole.getRoleId() == 3) {
tRiskDevMajInfor.setEntUploadState("1");
}
return tRiskDevMajInforMapper.selectTRiskDevMajInforList(tRiskDevMajInfor);
}
/**
* 查询重要风险点管控列表
*
* @param tRiskDevMajInfor 重要风险点管控 - 导出
* @return 重要风险点管控
*/
@Override
public List<TRiskDevMajInfor> exportRiskDevMajInforList(TRiskDevMajInfor tRiskDevMajInfor)
{
SysRole sysRole = SecurityUtils.getLoginUser().getUser().getRoles().get(0);
if (sysRole.getRoleId() == 3) {
tRiskDevMajInfor.setEntUploadState("1");
}
List<TRiskDevMajInfor> tRiskDevMajInfors = tRiskDevMajInforMapper.exportRiskDevMajInforList(tRiskDevMajInfor);
if(sysRole.getRoleId()==3){
if(tRiskDevMajInfors.size() > 0) {
return tRiskDevMajInfors.stream().peek(TRiskDevMajInfor::updateFields).collect(Collectors.toList());
}
}
return tRiskDevMajInforMapper.exportRiskDevMajInforList(tRiskDevMajInfor);
}
/**
* 新增重要风险点管控
*
......
......@@ -18,10 +18,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="fRiskControlMeasures" column="f_risk_control_measures" />
<result property="fRemark" column="f_remark" />
<result property="fUpdateTime" column="f_update_time" />
<result property="entUploadTime" column="f_ent_upload_time" />
<result property="entUploadState" column="f_ent_upload_state" />
<result property="govUploadTime" column="f_gov_upload_time" />
<result property="govUploadState" column="f_gov_upload_state" />
</resultMap>
<sql id="selectTRiskDevMajInforVo">
select f_risk_dev_maj_infor_id, f_risk_code, f_risk_name, f_company_id, f_region_id, f_risk_type, f_risk_place_detail, f_lon, f_lat, f_risk_structure, f_risk_control_measures, f_remark, f_update_time from t_risk_dev_maj_infor
select f_risk_dev_maj_infor_id,
f_risk_code,
f_risk_name,
f_company_id,
f_region_id,
f_risk_type,
f_risk_place_detail,
f_lon,
f_lat,
f_risk_structure,
f_risk_control_measures,
f_remark,
f_update_time,
f_ent_upload_time,
f_ent_upload_state,
f_gov_upload_time,
f_gov_upload_state
from t_risk_dev_maj_infor
</sql>
<sql id="exportRiskDevMajInforVo">
select f_risk_dev_maj_infor_id,
f_risk_code,
f_risk_name,
enterprise.enterprise_name as f_company_id,
region.f_name as f_region_id,
f_risk_type,
f_risk_place_detail,
f_lon,
f_lat,
f_risk_structure,
f_risk_control_measures,
f_remark,
f_update_time,
f_ent_upload_time,
f_ent_upload_state,
f_gov_upload_time,
f_gov_upload_state
from t_risk_dev_maj_infor riskInfor
left join t_enterprise_info enterprise on riskInfor.f_company_id = enterprise.enterprise_id
left join t_county_level_region region on region.f_id = enterprise.f_region_id
</sql>
<select id="selectTRiskDevMajInforList" parameterType="TRiskDevMajInfor" resultMap="TRiskDevMajInforResult">
......@@ -30,6 +76,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fRiskCode != null and fRiskCode != ''"> and f_risk_code like concat('%', #{fRiskCode}, '%')</if>
<if test="fRiskName != null and fRiskName != ''"> and f_risk_name like concat('%', #{fRiskName}, '%')</if>
<if test="fRiskType != null "> and f_risk_type = #{fRiskType}</if>
<if test="entUploadState != null "> and f_ent_upload_state = #{entUploadState}</if>
</where>
order by f_update_time desc
</select>
<select id="exportRiskDevMajInforList" parameterType="TRiskDevMajInfor" resultMap="TRiskDevMajInforResult">
<include refid="exportRiskDevMajInforVo"/>
<where>
<if test="fRiskCode != null and fRiskCode != ''"> and f_risk_code like concat('%', #{fRiskCode}, '%')</if>
<if test="fRiskName != null and fRiskName != ''"> and f_risk_name like concat('%', #{fRiskName}, '%')</if>
<if test="fRiskType != null "> and f_risk_type = #{fRiskType}</if>
<if test="entUploadState != null "> and f_ent_upload_state = #{entUploadState}</if>
</where>
order by f_update_time desc
</select>
......@@ -54,6 +112,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fRiskControlMeasures != null and fRiskControlMeasures != ''">f_risk_control_measures,</if>
<if test="fRemark != null and fRemark != ''">f_remark,</if>
<if test="fUpdateTime != null and fUpdateTime != ''">f_update_time,</if>
<if test="entUploadTime != null ">f_ent_upload_time,</if>
<if test="entUploadState != null and entUploadState != ''">f_ent_upload_state,</if>
<if test="govUploadTime != null">f_gov_upload_time,</if>
<if test="govUploadState != null and govUploadState != ''">f_gov_upload_state,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fRiskCode != null and fRiskCode != ''">#{fRiskCode},</if>
......@@ -68,6 +131,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fRiskControlMeasures != null and fRiskControlMeasures != ''">#{fRiskControlMeasures},</if>
<if test="fRemark != null and fRemark != ''">#{fRemark},</if>
<if test="fUpdateTime != null and fUpdateTime != ''">#{fUpdateTime},</if>
<if test="entUploadTime != null">#{entUploadTime},</if>
<if test="entUploadState != null and entUploadState != ''">#{entUploadState},</if>
<if test="govUploadTime != null">#{govUploadTime},</if>
<if test="govUploadState != null and govUploadState != ''">#{govUploadState},</if>
</trim>
</insert>
......@@ -86,6 +154,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fRiskControlMeasures != null and fRiskControlMeasures != ''">f_risk_control_measures = #{fRiskControlMeasures},</if>
<if test="fRemark != null and fRemark != ''">f_remark = #{fRemark},</if>
<if test="fUpdateTime != null and fUpdateTime != ''">f_update_time = #{fUpdateTime},</if>
<if test="entUploadTime != null">f_ent_upload_time = #{entUploadTime},</if>
<if test="entUploadState != null and entUploadState != ''">f_ent_upload_state = #{entUploadState},</if>
<if test="govUploadTime != null">f_gov_upload_time = #{govUploadTime},</if>
<if test="govUploadState != null and govUploadState != ''">f_gov_upload_state = #{govUploadState},</if>
</trim>
where f_risk_dev_maj_infor_id = #{fRiskDevMajInforId}
</update>
......
......@@ -18,9 +18,8 @@
</el-col>
<el-col :span="12">
<el-form-item label="涉及燃气企业编码">
<span v-if="detailInfo.fCompanyId">{{ detailInfo.fCompanyId }}</span>
<span v-else>-</span>
<el-form-item label="燃气企业">
<span>{{ enterpriseName }}</span>
</el-form-item>
</el-col>
......@@ -67,6 +66,24 @@
</el-col>
</el-col>
<el-col :span="12">
<el-form-item label="上传状态" >
<span>{{fUploadType}}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="上传时间" >
<span>{{ fUploadTime }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="this.$store.state.user.roleId == 3" label="企业端上传时间" >
<span>{{ detailInfo.fUploadTime }}</span>
</el-form-item>
</el-col>
<el-col :span="10">
<div id="risk-map" style="height: 400px"></div>
</el-col>
......@@ -84,8 +101,13 @@
name: "detail-info",
data(){
return{
enterprises: [],
countyInfo: [],
detailInfo: {},
detailOpen: false
enterpriseName:"",
detailOpen: false,
fUploadType: "",
fUploadTime: null
}
},
watch:{
......@@ -96,10 +118,69 @@
}
},
methods:{
//获取县级
getCountyInfo(){
getDefaultCountyList().then(res =>{
if(res.code == 200 && res.data){
this.countyInfo = res.data;
}
})
},
//所属单位
getEnterpriseLists(){
queryAllEnterprise().then(response => {
this.enterprises = response;
});
},
beyondCountyFormat(row){
let info = this.countyInfo.find(item => item.fId == row.fRegionId);
return info?info.fName:"-";
},
beyondCompanyFormat(row){
let info = this.enterprises.find(item => item.enterpriseId == row.fCompanyId);
return info?info.enterpriseName:"-";
},
//根据不同角色显示不同字段
showUploadType() {
let roleId = this.$store.state.user.roleId;
console.log("roleId == 3" + (roleId == 3))
if (roleId == 3) {
this.fUploadType = this.detailInfo.govUploadState
}
if (roleId == 5) {
this.fUploadType = this.detailInfo.entUploadState
}
if (this.fUploadType == '0') {
this.fUploadType = "未上传"
}
if (this.fUploadType == '1') {
this.fUploadType = "已上传"
}
},
showUploadTime() {
let roleId = this.$store.state.user.roleId;
if (roleId == 3) {
this.fUploadTime = this.detailInfo.govUploadTime
}
if (roleId == 5) {
this.fUploadTime = this.detailInfo.entUploadTime
}
},
getDetailInfo(id){
getInfor(id).then(res =>{
if(res.code == 200 && res.data){
this.detailInfo = res.data;
this.detailInfo.fRegionId = this.beyondCountyFormat(this.detailInfo);
let fCompanyId = this.detailInfo.fCompanyId;
if (fCompanyId != null) {
this.enterpriseName= this.beyondCompanyFormat(this.detailInfo);
}
this.showUploadType();
this.showUploadTime();
this.detailOpen = true;
}
})
......
......@@ -43,6 +43,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-if="this.user.roleId==5"
>新增</el-button>
</el-col>
<el-col :span="1.5">
......@@ -53,6 +54,7 @@
size="mini"
:disabled="single"
@click="handleUpdate"
v-if="this.user.roleId==5"
>修改</el-button>
</el-col>
<el-col :span="1.5">
......@@ -63,6 +65,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
v-if="this.user.roleId==5"
>删除</el-button>
</el-col>
<el-col :span="1.5">
......@@ -79,7 +82,6 @@
</el-row>
<el-table v-loading="loading" :data="inforList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="重要风险点编码" align="center" prop="fRiskCode" />
<el-table-column label="重要风险点名称" align="center" prop="fRiskName" :show-overflow-tooltip="true"/>
<el-table-column label="涉及燃气企业编码" align="center" prop="fCompanyId" />
......@@ -100,12 +102,14 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-if="this.user.roleId==5&&scope.row.entUploadState==0"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-if="this.user.roleId==5&&scope.row.entUploadState==0"
>删除</el-button>
<el-button
size="mini"
......@@ -136,14 +140,34 @@
</el-col>
<el-col :span="12">
<el-form-item label="涉及燃气企业编码" prop="fCompanyId">
<el-input v-model="form.fCompanyId" placeholder="请输入涉及燃气企业编码" />
<el-form-item label="燃气企业" prop="fCompanyId">
<el-select style="width: 100%;" :disabled="isDisabledEnterprise" v-model="form.fCompanyId" placeholder="请选择">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="县级行政区ID" prop="fRegionId">
<el-input v-model="form.fRegionId" placeholder="请输入县级行政区ID" />
<el-form-item label="县级行政区" prop="fRegionId">
<el-select
v-model="form.fRegionId"
placeholder="请选择县级行政区"
style="width: 100%"
>
<el-option
v-for="county in countyInfo"
:key="county.fId"
:label="county.fName.trim()"
:value="county.fId"
/>
</el-select>
</el-form-item>
</el-col>
......@@ -222,7 +246,10 @@
<script>
import { listInfor, getInfor, delInfor, addInfor, updateInfor, exportInfor, reportRiskInfo } from "@/api/risk/info";
import GetPos from '@/components/GetPos';
import { enterpriseLists } from "@/api/regulation/info";
import DetailInfo from "./components/DetailInfo";
import{getInfo} from "@/api/login"
import { getDefaultCountyList } from "@/api/area/county";
export default {
name: "Infor",
components: {
......@@ -233,11 +260,17 @@ export default {
return {
// 遮罩层
loading: true,
user:{},
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
fRiskCodes: [],
//燃气企业
enterprises: [],
//县级行政区
countyInfo: [],
isDisabledEnterprise: false,
// 非单个禁用
single: true,
// 非多个禁用
......@@ -295,15 +328,46 @@ export default {
};
},
created() {
this.getList();
this.getuserInfo();
this.getDicts("t_risk_type").then(response => {
this.fRiskTypeOptions = response.data;
});
this.getEnterpriseLists();
this.getCountyInfo();
},
methods: {
//获取县级
getCountyInfo(){
getDefaultCountyList().then(res =>{
if(res.code == 200 && res.data){
this.countyInfo = res.data;
}
})
},
//所属单位
getEnterpriseLists(){
const param = {};
enterpriseLists(param).then(response => {
this.enterprises = response.rows;
});
},
getuserInfo(){
getInfo().then(response => {
this.user = response.user.roles[0]
this.getList();
});
},
/** 查询重要风险点管控列表 */
getList() {
this.loading = true;
// 企业查自己的数据
if (this.user.roleId == 5) {
this.queryParams.fCompanyId = this.$store.state.user.enterpriseId
}
// 政府如果按照状态查的话,是查的 govUploadState
if (this.user.roleId == 3) {
this.queryParams.govUploadState = this.queryParams.fUploadType;
}
listInfor(this.queryParams).then(response => {
this.inforList = response.rows;
this.total = response.total;
......@@ -361,6 +425,11 @@ export default {
this.reset();
this.open = true;
this.title = "添加重要风险点管控";
// 说明是 企业在新增,直接赋值显示就行了。
if (this.enterprises.length == 1) {
this.form.fCompanyId = this.enterprises[0].enterpriseId
this.isDisabledEnterprise = true;
}
},
/** 修改按钮操作 */
handleUpdate(row) {
......
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