Commit 00c967e2 authored by wanghao's avatar wanghao

1 第三方施工-意外事件-优化,具体项有

    逻辑部分不考虑 admin角色
    调整后去掉数据列表前多选框
    数据 倒序
    详情界面 分不同角色显示调整
    导出数据分不同角色显示
parent f7f5456a
...@@ -51,7 +51,7 @@ public class TConGasProIncController extends BaseController ...@@ -51,7 +51,7 @@ public class TConGasProIncController extends BaseController
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(TConGasProInc tConGasProInc) public AjaxResult export(TConGasProInc tConGasProInc)
{ {
List<TConGasProInc> list = tConGasProIncService.selectTConGasProIncList(tConGasProInc); List<TConGasProInc> list = tConGasProIncService.exportTConGasProIncList(tConGasProInc);
ExcelUtil<TConGasProInc> util = new ExcelUtil<TConGasProInc>(TConGasProInc.class); ExcelUtil<TConGasProInc> util = new ExcelUtil<TConGasProInc>(TConGasProInc.class);
return util.exportExcel(list, "第三方施工-涉气第三方施工意外事件数据"); return util.exportExcel(list, "第三方施工-涉气第三方施工意外事件数据");
} }
......
...@@ -24,6 +24,11 @@ public class TConGasProInc extends BaseEntity ...@@ -24,6 +24,11 @@ public class TConGasProInc extends BaseEntity
/** 项目编码 */ /** 项目编码 */
private String fIntersectConstructionId; private String fIntersectConstructionId;
/** 燃气企业 */
@Excel(name = "燃气企业")
private String fCompanyInfoId;
@Excel(name = "项目编码") @Excel(name = "项目编码")
private String projectCode; private String projectCode;
...@@ -48,16 +53,17 @@ public class TConGasProInc extends BaseEntity ...@@ -48,16 +53,17 @@ public class TConGasProInc extends BaseEntity
private String fRemark; private String fRemark;
/** 最后修改时间 yyyy-MM-dd hh:mm:ss */ /** 最后修改时间 yyyy-MM-dd hh:mm:ss */
@Excel(name = "最后修改时间")
private String fUpdateTime; private String fUpdateTime;
/** /**
* 企业端上传时间 */ * 企业端上传时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "上传时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date entUploadTime; private Date entUploadTime;
/** /**
* 企业端上传状态 0-未上传,1-已上传*/ * 企业端上传状态 0-未上传,1-已上传*/
@Excel(name = "上传状态",readConverterExp = "1=已上传,0=未上传")
private String entUploadState; private String entUploadState;
/** /**
...@@ -69,10 +75,14 @@ public class TConGasProInc extends BaseEntity ...@@ -69,10 +75,14 @@ public class TConGasProInc extends BaseEntity
* 企业端上传状态 0-未上传,1-已上传*/ * 企业端上传状态 0-未上传,1-已上传*/
private String govUploadState; private String govUploadState;
/** 燃气企业编码 */ public void updateFields() {
@Excel(name = "燃气企业编码") this.entUploadState = govUploadState;
private String fCompanyInfoId; if (govUploadTime != null) {
this.entUploadTime = govUploadTime;
} else {
this.entUploadTime = null;
}
}
public Date getEntUploadTime() { public Date getEntUploadTime() {
return entUploadTime; return entUploadTime;
} }
......
...@@ -29,6 +29,13 @@ public interface TConGasProIncMapper ...@@ -29,6 +29,13 @@ public interface TConGasProIncMapper
*/ */
public List<TConGasProInc> selectTConGasProIncList(TConGasProInc tConGasProInc); public List<TConGasProInc> selectTConGasProIncList(TConGasProInc tConGasProInc);
/**
* 查询第三方施工-涉气第三方施工意外事件列表 - 导出
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 第三方施工-涉气第三方施工意外事件集合
*/
public List<TConGasProInc> exportTConGasProInforList(TConGasProInc tConGasProInc);
/** /**
* 新增第三方施工-涉气第三方施工意外事件 * 新增第三方施工-涉气第三方施工意外事件
* *
......
...@@ -27,6 +27,13 @@ public interface ITConGasProIncService ...@@ -27,6 +27,13 @@ public interface ITConGasProIncService
*/ */
public List<TConGasProInc> selectTConGasProIncList(TConGasProInc tConGasProInc); public List<TConGasProInc> selectTConGasProIncList(TConGasProInc tConGasProInc);
/**
* 查询第三方施工-涉气第三方施工意外事件列表-导出
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 第三方施工-涉气第三方施工意外事件集合
*/
List<TConGasProInc> exportTConGasProIncList(TConGasProInc tConGasProInc);
/** /**
* 新增第三方施工-涉气第三方施工意外事件 * 新增第三方施工-涉气第三方施工意外事件
* *
......
...@@ -2,11 +2,13 @@ package com.zehong.system.service.impl; ...@@ -2,11 +2,13 @@ package com.zehong.system.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zehong.common.core.domain.entity.SysRole; import com.zehong.common.core.domain.entity.SysRole;
import com.zehong.common.core.domain.model.LoginUser;
import com.zehong.common.exception.CustomException; import com.zehong.common.exception.CustomException;
import com.zehong.common.utils.GovernmentDataCopyUtil; import com.zehong.common.utils.GovernmentDataCopyUtil;
import com.zehong.common.utils.GovernmentDataUtil; import com.zehong.common.utils.GovernmentDataUtil;
import com.zehong.common.utils.SecurityUtils; import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TConGasProInc; import com.zehong.system.domain.TConGasProInc;
import com.zehong.system.domain.TConGasProInfor;
import com.zehong.system.domain.vo.TConGasProIncVo; import com.zehong.system.domain.vo.TConGasProIncVo;
import com.zehong.system.mapper.TConGasProIncMapper; import com.zehong.system.mapper.TConGasProIncMapper;
import com.zehong.system.service.ITConGasProIncService; import com.zehong.system.service.ITConGasProIncService;
...@@ -20,6 +22,7 @@ import java.text.SimpleDateFormat; ...@@ -20,6 +22,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 第三方施工-涉气第三方施工意外事件Service业务层处理 * 第三方施工-涉气第三方施工意外事件Service业务层处理
...@@ -62,13 +65,42 @@ public class TConGasProIncServiceImpl implements ITConGasProIncService ...@@ -62,13 +65,42 @@ public class TConGasProIncServiceImpl implements ITConGasProIncService
{ {
SysRole sysRole = SecurityUtils.getLoginUser().getUser().getRoles().get(0); SysRole sysRole = SecurityUtils.getLoginUser().getUser().getRoles().get(0);
// 不是超级管理员也不是企业 // 不是超级管理员也不是企业
if (sysRole.getRoleId() != 1 && sysRole.getRoleId() != 5) { if (sysRole.getRoleId() == 3) {
tConGasProInc.setEntUploadState("1"); tConGasProInc.setEntUploadState("1");
} }
return tConGasProIncMapper.selectTConGasProIncList(tConGasProInc); return tConGasProIncMapper.selectTConGasProIncList(tConGasProInc);
} }
/**
* 查询第三方施工-涉气第三方施工意外事件列表
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 第三方施工-涉气第三方施工意外事件
*/
@Override
public List<TConGasProInc> exportTConGasProIncList(TConGasProInc tConGasProInc)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
// 如果是 政府端 则 把 govUploadState 赋值给 entUploadState, 把 govUploadTime 赋值给 entUploadTime
if(loginUser.getUser().getRoles().get(0).getRoleId()==3){
tConGasProInc.setEntUploadState("1");
}
List<TConGasProInc> tConGasProIncs = tConGasProIncMapper.selectTConGasProIncList(tConGasProInc);
if(loginUser.getUser().getRoles().get(0).getRoleId()==3){
if(tConGasProIncs.size() > 0) {
return tConGasProIncs.stream().peek(TConGasProInc::updateFields).collect(Collectors.toList());
}
}
return tConGasProIncMapper.selectTConGasProIncList(tConGasProInc);
}
/** /**
* 新增第三方施工-涉气第三方施工意外事件 * 新增第三方施工-涉气第三方施工意外事件
* *
......
...@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="fDescription" column="f_description" /> <result property="fDescription" column="f_description" />
<result property="fOccurrenctTime" column="f_occurrenct_time" /> <result property="fOccurrenctTime" column="f_occurrenct_time" />
<result property="fAttachment" column="f_attachment" /> <result property="fAttachment" column="f_attachment" />
<result property="fCompanyInfoId" column="f_company_info_id" />
<result property="fRemark" column="f_remark" /> <result property="fRemark" column="f_remark" />
<result property="fUpdateTime" column="f_update_time" /> <result property="fUpdateTime" column="f_update_time" />
...@@ -35,10 +36,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -35,10 +36,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
inc.f_ent_upload_state, inc.f_ent_upload_state,
inc.f_gov_upload_time, inc.f_gov_upload_time,
inc.f_gov_upload_state, inc.f_gov_upload_state,
info.f_project_code AS projectCode info.f_project_code AS projectCode,
enterprise.enterprise_name as f_company_info_id
FROM FROM
t_con_gas_pro_inc inc t_con_gas_pro_inc inc
LEFT JOIN t_con_gas_pro_infor info ON info.f_con_gas_pro_infor_id = inc.f_intersect_construction_id LEFT JOIN t_con_gas_pro_infor info ON info.f_con_gas_pro_infor_id = inc.f_intersect_construction_id
LEFT JOIN t_enterprise_info enterprise ON info.f_company_info_id = enterprise.enterprise_id
</sql> </sql>
<select id="selectTConGasProIncList" parameterType="TConGasProInc" resultMap="TConGasProIncResult"> <select id="selectTConGasProIncList" parameterType="TConGasProInc" resultMap="TConGasProIncResult">
...@@ -57,6 +60,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -57,6 +60,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by f_update_time desc order by f_update_time desc
</select> </select>
<select id="exportTConGasProInforList" parameterType="TConGasProInc" resultMap="TConGasProIncResult">
<include refid="selectTConGasProIncVo"/>
<where>
<if test="fIntersectConstructionId != null and fIntersectConstructionId != ''"> and info.f_project_code like concat('%', #{fIntersectConstructionId}, '%')</if>
<if test="fTitle != null and fTitle != ''"> and inc.f_title like concat('%', #{fTitle}, '%')</if>
<if test="fDescription != null and fDescription != ''"> and inc.f_description = #{fDescription}</if>
<if test="fOccurrenctTime != null and fOccurrenctTime != ''"> and inc.f_occurrenct_time = #{fOccurrenctTime}</if>
<if test="fAttachment != null and fAttachment != ''"> and inc.f_attachment = #{fAttachment}</if>
<if test="fRemark != null and fRemark != ''"> and inc.f_remark = #{fRemark}</if>
<if test="fUpdateTime != null and fUpdateTime != ''"> and inc.f_update_time = #{fUpdateTime}</if>
<if test="fCompanyInfoId != null and fCompanyInfoId != ''"> and inc.f_company_info_id = #{fCompanyInfoId}</if>
<if test="entUploadState != null and entUploadState != ''"> and inc.f_ent_upload_state = #{entUploadState}</if>
</where>
order by f_update_time desc
</select>
<select id="selectTConGasProIncById" parameterType="Long" resultMap="TConGasProIncResult"> <select id="selectTConGasProIncById" parameterType="Long" resultMap="TConGasProIncResult">
<include refid="selectTConGasProIncVo"/> <include refid="selectTConGasProIncVo"/>
where inc.f_con_gas_pro_inc_id = #{fConGasProIncId} where inc.f_con_gas_pro_inc_id = #{fConGasProIncId}
......
...@@ -50,10 +50,22 @@ ...@@ -50,10 +50,22 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="更新时间"> <el-form-item label="上传状态" >
<span v-if="detailInfo.fUpdateTime">{{ detailInfo.fUpdateTime }}</span> <span>{{fUploadType}}</span>
<span v-else>-</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.entUploadTime }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -70,14 +82,45 @@ ...@@ -70,14 +82,45 @@
data(){ data(){
return{ return{
detailInfo: {}, detailInfo: {},
detailOpen: false detailOpen: false,
fUploadType: "",
fUploadTime: null
} }
}, },
methods:{ methods:{
//根据不同角色显示不同字段
showUploadType() {
let roleId = this.$store.state.user.roleId;
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){ getDetailInfo(id){
getInc(id).then(res =>{ getInc(id).then(res =>{
if(res.code == 200 && res.data){ if(res.code == 200 && res.data){
this.detailInfo = res.data; this.detailInfo = res.data;
this.showUploadType();
this.showUploadTime();
this.detailOpen = true; this.detailOpen = true;
} }
}) })
......
...@@ -19,6 +19,14 @@ ...@@ -19,6 +19,14 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="上传状态" prop="fUploadType">
<el-select v-model="queryParams.fUploadType" placeholder="请选择上传状态" clearable size="small">
<el-option label="未上传" value="0" />
<el-option label="已上传" value="1" />
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
...@@ -33,7 +41,7 @@ ...@@ -33,7 +41,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-if="user.roleId==1||user.roleId==5" v-if="user.roleId==5"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -44,7 +52,7 @@ ...@@ -44,7 +52,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-if="user.roleId==1||user.roleId==5" v-if="user.roleId==5"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -55,7 +63,7 @@ ...@@ -55,7 +63,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-if="user.roleId==1||user.roleId==5" v-if="user.roleId==5"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -72,7 +80,6 @@ ...@@ -72,7 +80,6 @@
</el-row> </el-row>
<el-table v-loading="loading" :data="incList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="incList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目编码" align="center" prop="projectCode" :show-overflow-tooltip="true"/> <el-table-column label="项目编码" align="center" prop="projectCode" :show-overflow-tooltip="true"/>
<el-table-column label="意外事件标题" align="center" prop="fTitle" :show-overflow-tooltip="true"/> <el-table-column label="意外事件标题" align="center" prop="fTitle" :show-overflow-tooltip="true"/>
<el-table-column label="意外事件描述" align="center" prop="fDescription" :show-overflow-tooltip="true"/> <el-table-column label="意外事件描述" align="center" prop="fDescription" :show-overflow-tooltip="true"/>
...@@ -112,14 +119,14 @@ ...@@ -112,14 +119,14 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-if="user.roleId==1||user.roleId==5" v-if="user.roleId==5&&scope.row.entUploadState==0"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-if="user.roleId==1||user.roleId==5" v-if="user.roleId==5&&scope.row.entUploadState==0"
>删除</el-button> >删除</el-button>
<el-button <el-button
size="mini" size="mini"
...@@ -264,7 +271,8 @@ export default { ...@@ -264,7 +271,8 @@ export default {
fOccurrenctTime: null, fOccurrenctTime: null,
fAttachment: null, fAttachment: null,
fRemark: null, fRemark: null,
fUpdateTime: null fUpdateTime: null,
fUploadType:null,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -351,6 +359,11 @@ export default { ...@@ -351,6 +359,11 @@ export default {
// 企业查自己的数据 // 企业查自己的数据
if (this.user.roleId == 5) { if (this.user.roleId == 5) {
this.queryParams.fCompanyInfoId = this.$store.state.user.enterpriseId this.queryParams.fCompanyInfoId = this.$store.state.user.enterpriseId
this.queryParams.entUploadState = this.queryParams.fUploadType;
}
// 政府如果按照状态查的话,是查的 govUploadState
if (this.user.roleId == 3) {
this.queryParams.govUploadState = this.queryParams.fUploadType;
} }
listInc(this.queryParams).then(response => { listInc(this.queryParams).then(response => {
this.incList = response.rows; this.incList = response.rows;
......
...@@ -244,7 +244,6 @@ ...@@ -244,7 +244,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="上传状态" > <el-form-item label="上传状态" >
<span>{{fUploadType}}</span> <span>{{fUploadType}}</span>
...@@ -262,6 +261,7 @@ ...@@ -262,6 +261,7 @@
<span>{{ detailInfo.entUploadTime }}</span> <span>{{ detailInfo.entUploadTime }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</el-dialog> </el-dialog>
......
...@@ -239,12 +239,6 @@ ...@@ -239,12 +239,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12">
<el-form-item label="村级行政区" prop="fVillageId">
<el-input v-model="form.fVillageId" placeholder="请输入村级行政区" />
</el-form-item>
</el-col> -->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="管道压力等级分类" prop="fPipePress"> <el-form-item label="管道压力等级分类" prop="fPipePress">
<el-select style="width: 100%" v-model="form.fPipePress" placeholder="请选择管道压力等级分类"> <el-select style="width: 100%" v-model="form.fPipePress" placeholder="请选择管道压力等级分类">
......
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