Commit 00c967e2 authored by wanghao's avatar wanghao

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

    逻辑部分不考虑 admin角色
    调整后去掉数据列表前多选框
    数据 倒序
    详情界面 分不同角色显示调整
    导出数据分不同角色显示
parent f7f5456a
......@@ -51,7 +51,7 @@ public class TConGasProIncController extends BaseController
@GetMapping("/export")
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);
return util.exportExcel(list, "第三方施工-涉气第三方施工意外事件数据");
}
......
......@@ -24,6 +24,11 @@ public class TConGasProInc extends BaseEntity
/** 项目编码 */
private String fIntersectConstructionId;
/** 燃气企业 */
@Excel(name = "燃气企业")
private String fCompanyInfoId;
@Excel(name = "项目编码")
private String projectCode;
......@@ -48,16 +53,17 @@ public class TConGasProInc extends BaseEntity
private String fRemark;
/** 最后修改时间 yyyy-MM-dd hh:mm:ss */
@Excel(name = "最后修改时间")
private String fUpdateTime;
/**
* 企业端上传时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "上传时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date entUploadTime;
/**
* 企业端上传状态 0-未上传,1-已上传*/
@Excel(name = "上传状态",readConverterExp = "1=已上传,0=未上传")
private String entUploadState;
/**
......@@ -69,10 +75,14 @@ public class TConGasProInc extends BaseEntity
* 企业端上传状态 0-未上传,1-已上传*/
private String govUploadState;
/** 燃气企业编码 */
@Excel(name = "燃气企业编码")
private String fCompanyInfoId;
public void updateFields() {
this.entUploadState = govUploadState;
if (govUploadTime != null) {
this.entUploadTime = govUploadTime;
} else {
this.entUploadTime = null;
}
}
public Date getEntUploadTime() {
return entUploadTime;
}
......
......@@ -29,6 +29,13 @@ public interface TConGasProIncMapper
*/
public List<TConGasProInc> selectTConGasProIncList(TConGasProInc tConGasProInc);
/**
* 查询第三方施工-涉气第三方施工意外事件列表 - 导出
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 第三方施工-涉气第三方施工意外事件集合
*/
public List<TConGasProInc> exportTConGasProInforList(TConGasProInc tConGasProInc);
/**
* 新增第三方施工-涉气第三方施工意外事件
*
......
......@@ -27,6 +27,13 @@ public interface ITConGasProIncService
*/
public List<TConGasProInc> selectTConGasProIncList(TConGasProInc tConGasProInc);
/**
* 查询第三方施工-涉气第三方施工意外事件列表-导出
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 第三方施工-涉气第三方施工意外事件集合
*/
List<TConGasProInc> exportTConGasProIncList(TConGasProInc tConGasProInc);
/**
* 新增第三方施工-涉气第三方施工意外事件
*
......
......@@ -2,11 +2,13 @@ package com.zehong.system.service.impl;
import com.alibaba.fastjson.JSONObject;
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.utils.GovernmentDataCopyUtil;
import com.zehong.common.utils.GovernmentDataUtil;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TConGasProInc;
import com.zehong.system.domain.TConGasProInfor;
import com.zehong.system.domain.vo.TConGasProIncVo;
import com.zehong.system.mapper.TConGasProIncMapper;
import com.zehong.system.service.ITConGasProIncService;
......@@ -20,6 +22,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 第三方施工-涉气第三方施工意外事件Service业务层处理
......@@ -62,13 +65,42 @@ public class TConGasProIncServiceImpl implements ITConGasProIncService
{
SysRole sysRole = SecurityUtils.getLoginUser().getUser().getRoles().get(0);
// 不是超级管理员也不是企业
if (sysRole.getRoleId() != 1 && sysRole.getRoleId() != 5) {
if (sysRole.getRoleId() == 3) {
tConGasProInc.setEntUploadState("1");
}
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"
<result property="fDescription" column="f_description" />
<result property="fOccurrenctTime" column="f_occurrenct_time" />
<result property="fAttachment" column="f_attachment" />
<result property="fCompanyInfoId" column="f_company_info_id" />
<result property="fRemark" column="f_remark" />
<result property="fUpdateTime" column="f_update_time" />
......@@ -35,10 +36,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
inc.f_ent_upload_state,
inc.f_gov_upload_time,
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
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_enterprise_info enterprise ON info.f_company_info_id = enterprise.enterprise_id
</sql>
<select id="selectTConGasProIncList" parameterType="TConGasProInc" resultMap="TConGasProIncResult">
......@@ -56,7 +59,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by f_update_time desc
</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">
<include refid="selectTConGasProIncVo"/>
where inc.f_con_gas_pro_inc_id = #{fConGasProIncId}
......
......@@ -50,10 +50,22 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="更新时间">
<span v-if="detailInfo.fUpdateTime">{{ detailInfo.fUpdateTime }}</span>
<span v-else>-</span>
<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.entUploadTime }}</span>
</el-form-item>
</el-col>
......@@ -70,14 +82,45 @@
data(){
return{
detailInfo: {},
detailOpen: false
detailOpen: false,
fUploadType: "",
fUploadTime: null
}
},
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){
getInc(id).then(res =>{
if(res.code == 200 && res.data){
this.detailInfo = res.data;
this.showUploadType();
this.showUploadTime();
this.detailOpen = true;
}
})
......
......@@ -19,6 +19,14 @@
@keyup.enter.native="handleQuery"
/>
</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-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>
......@@ -33,7 +41,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-if="user.roleId==1||user.roleId==5"
v-if="user.roleId==5"
>新增</el-button>
</el-col>
<el-col :span="1.5">
......@@ -44,7 +52,7 @@
size="mini"
:disabled="single"
@click="handleUpdate"
v-if="user.roleId==1||user.roleId==5"
v-if="user.roleId==5"
>修改</el-button>
</el-col>
<el-col :span="1.5">
......@@ -55,7 +63,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
v-if="user.roleId==1||user.roleId==5"
v-if="user.roleId==5"
>删除</el-button>
</el-col>
<el-col :span="1.5">
......@@ -72,7 +80,6 @@
</el-row>
<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="fTitle" :show-overflow-tooltip="true"/>
<el-table-column label="意外事件描述" align="center" prop="fDescription" :show-overflow-tooltip="true"/>
......@@ -112,14 +119,14 @@
type="text"
icon="el-icon-edit"
@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
size="mini"
type="text"
icon="el-icon-delete"
@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
size="mini"
......@@ -264,7 +271,8 @@ export default {
fOccurrenctTime: null,
fAttachment: null,
fRemark: null,
fUpdateTime: null
fUpdateTime: null,
fUploadType:null,
},
// 表单参数
form: {},
......@@ -351,7 +359,12 @@ export default {
// 企业查自己的数据
if (this.user.roleId == 5) {
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 => {
this.incList = response.rows;
this.total = response.total;
......
......@@ -244,7 +244,6 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="上传状态" >
<span>{{fUploadType}}</span>
......@@ -262,6 +261,7 @@
<span>{{ detailInfo.entUploadTime }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
......
......@@ -237,13 +237,7 @@
<el-option label="农村" value="2" />
</el-select>
</el-form-item>
</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>
<el-col :span="12">
<el-form-item label="管道压力等级分类" prop="fPipePress">
......
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