Commit bee19102 authored by wanghao's avatar wanghao

1第三方施工-意外事件 调整成 政府端 不能修改 和 删除 操作,只能 查看后没问题上传 省厅操作。

parent 64b0ee3a
......@@ -109,4 +109,15 @@ public class TConGasProIncController extends BaseController
return AjaxResult.error("上传第三方施工意外事件接口异常");
}
}
/**
* 企业端上传第三方施工意外事件
* @param fConGasProIncId 第三方施工意外事件id
* @return
*/
@GetMapping("/entReportConGasProInfo")
public AjaxResult entReportConGasProInfo(Long fConGasProIncId){
return toAjax(tConGasProIncService.entReportConGasProInfo(fConGasProIncId));
}
}
package com.zehong.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
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_con_gas_pro_inc
*
......@@ -48,7 +51,69 @@ public class TConGasProInc extends BaseEntity
@Excel(name = "最后修改时间")
private String fUpdateTime;
public void setfConGasProIncId(Long fConGasProIncId)
/**
* 企业端上传时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date entUploadTime;
/**
* 企业端上传状态 0-未上传,1-已上传*/
private String entUploadState;
/**
* 政府端上传时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date govUploadTime;
/**
* 企业端上传状态 0-未上传,1-已上传*/
private String govUploadState;
/** 燃气企业编码 */
@Excel(name = "燃气企业编码")
private String fCompanyInfoId;
public Date getEntUploadTime() {
return entUploadTime;
}
public void setEntUploadTime(Date entUploadTime) {
this.entUploadTime = entUploadTime;
}
public String getEntUploadState() {
return entUploadState;
}
public void setEntUploadState(String entUploadState) {
this.entUploadState = entUploadState;
}
public Date getGovUploadTime() {
return govUploadTime;
}
public void setGovUploadTime(Date govUploadTime) {
this.govUploadTime = govUploadTime;
}
public String getGovUploadState() {
return govUploadState;
}
public void setGovUploadState(String govUploadState) {
this.govUploadState = govUploadState;
}
public String getfCompanyInfoId() {
return fCompanyInfoId;
}
public void setfCompanyInfoId(String fCompanyInfoId) {
this.fCompanyInfoId = fCompanyInfoId;
}
public void setfConGasProIncId(Long fConGasProIncId)
{
this.fConGasProIncId = fConGasProIncId;
}
......
package com.zehong.system.mapper;
import java.util.Date;
import java.util.List;
import com.zehong.system.domain.TConGasProInc;
import org.apache.ibatis.annotations.Param;
/**
* 第三方施工-涉气第三方施工意外事件Mapper接口
......@@ -43,6 +45,11 @@ public interface TConGasProIncMapper
*/
public int updateTConGasProInc(TConGasProInc tConGasProInc);
/**
*
* 根据id修改 企业端上传状态*/
public int updateEntUploadStateById(@Param("state") String state, @Param("entUploadTime") Date entUploadTime,
@Param("fConGasProIncId") Long fConGasProIncId);
/**
* 删除第三方施工-涉气第三方施工意外事件
*
......
......@@ -65,4 +65,11 @@ public interface ITConGasProIncService
* @return
*/
int reportAccidentInfo(Long fConGasProIncId) throws Exception ;
/**
* 企业端上传第三方施工意外事件
* @param fConGasProIncId 意外事件工id
* @return
*/
int entReportConGasProInfo(Long fConGasProIncId);
}
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.system.domain.TConGasProInc;
import com.zehong.system.domain.vo.TConGasProIncVo;
import com.zehong.system.mapper.TConGasProIncMapper;
......@@ -30,7 +32,7 @@ public class TConGasProIncServiceImpl implements ITConGasProIncService
{
private static final Logger log = LoggerFactory.getLogger(TConGasProIncServiceImpl.class);
@Autowired
@Resource
private TConGasProIncMapper tConGasProIncMapper;
@Resource
......@@ -58,6 +60,12 @@ public class TConGasProIncServiceImpl implements ITConGasProIncService
@Override
public List<TConGasProInc> selectTConGasProIncList(TConGasProInc tConGasProInc)
{
SysRole sysRole = SecurityUtils.getLoginUser().getUser().getRoles().get(0);
// 不是超级管理员也不是企业
if (sysRole.getRoleId() != 1 && sysRole.getRoleId() != 5) {
tConGasProInc.setEntUploadState("1");
}
return tConGasProIncMapper.selectTConGasProIncList(tConGasProInc);
}
......@@ -127,6 +135,20 @@ public class TConGasProIncServiceImpl implements ITConGasProIncService
JSONObject reportResult = governmentDataUtil.setInfo("construction/gas/project/incident","WRITE",data);
log.info("上传第三方施工意外事件结果===================" + reportResult.toJSONString());
if(!"0".equals(reportResult.getString("resultCode"))) throw new CustomException("上传第三方施意外事件工接口失败");
conGasProInc.setGovUploadState("1");
conGasProInc.setGovUploadTime(new Date());
tConGasProIncMapper.updateTConGasProInc(conGasProInc);
return 1;
}
/**
* 企业端上传
* @param fConGasProIncId 意外事件工id
* @return r
*/
@Override
public int entReportConGasProInfo(Long fConGasProIncId) {
tConGasProIncMapper.updateEntUploadStateById("1",new Date(),fConGasProIncId);
return 1;
}
}
......@@ -13,6 +13,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="fAttachment" column="f_attachment" />
<result property="fRemark" column="f_remark" />
<result property="fUpdateTime" column="f_update_time" />
<result property="fCompanyInfoId" column="f_company_info_id" />
<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="selectTConGasProIncVo">
......@@ -25,6 +31,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
inc.f_attachment,
inc.f_remark,
inc.f_update_time,
inc.f_ent_upload_time,
inc.f_ent_upload_state,
inc.f_gov_upload_time,
inc.f_gov_upload_state,
info.f_project_code AS projectCode
FROM
t_con_gas_pro_inc inc
......@@ -34,13 +44,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTConGasProIncList" parameterType="TConGasProInc" resultMap="TConGasProIncResult">
<include refid="selectTConGasProIncVo"/>
<where>
<if test="fIntersectConstructionId != null and fIntersectConstructionId != ''"> and inc.f_intersect_construction_id = #{fIntersectConstructionId}</if>
<if test="fTitle != null and fTitle != ''"> and inc.f_title = #{fTitle}</if>
<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>
......@@ -60,6 +72,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fAttachment != null and fAttachment != ''">f_attachment,</if>
<if test="fRemark != null and fRemark != ''">f_remark,</if>
<if test="fUpdateTime != null and fUpdateTime != ''">f_update_time,</if>
<if test="fCompanyInfoId != null and fCompanyInfoId != ''">f_company_info_id,</if>
<if test="entUploadTime != null and entUploadTime != ''">f_ent_upload_time,</if>
<if test="entUploadState != null and entUploadState != ''">f_ent_upload_state,</if>
<if test="govUploadTime != null and govUploadTime != ''">f_gov_upload_time,</if>
<if test="govUploadState != null and govUploadState != ''">f_gov_upload_state,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fIntersectConstructionId != null and fIntersectConstructionId != ''">#{fIntersectConstructionId},</if>
......@@ -69,6 +87,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fAttachment != null and fAttachment != ''">#{fAttachment},</if>
<if test="fRemark != null and fRemark != ''">#{fRemark},</if>
<if test="fUpdateTime != null and fUpdateTime != ''">#{fUpdateTime},</if>
<if test="fCompanyInfoId != null and fCompanyInfoId != ''">#{fCompanyInfoId},</if>
<if test="entUploadTime != null and entUploadTime != ''">#{entUploadTime},</if>
<if test="entUploadState != null and entUploadState != ''">#{entUploadState},</if>
<if test="govUploadTime != null and govUploadTime != ''">#{govUploadTime},</if>
<if test="govUploadState != null and govUploadState != ''">#{govUploadState},</if>
</trim>
</insert>
......@@ -82,6 +106,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fAttachment != null and fAttachment != ''">f_attachment = #{fAttachment},</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 and entUploadTime != ''">f_ent_upload_time = #{entUploadTime},</if>
<if test="entUploadState != null and entUploadState != ''">f_ent_upload_state = #{entUploadState},</if>
<if test="govUploadTime != null and govUploadTime != ''">f_gov_upload_time = #{govUploadTime},</if>
<if test="govUploadState != null and govUploadState != ''">f_gov_upload_state = #{govUploadState},</if>
</trim>
where f_con_gas_pro_inc_id = #{fConGasProIncId}
</update>
......@@ -90,6 +119,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from t_con_gas_pro_inc where f_con_gas_pro_inc_id = #{fConGasProIncId}
</delete>
<update id="updateEntUploadStateById">
update t_con_gas_pro_inc set f_ent_upload_state = #{state}, f_ent_upload_time = #{entUploadTime} where f_con_gas_pro_inc_id = #{fConGasProIncId}
</update>
<delete id="deleteTConGasProIncByIds" parameterType="String">
delete from t_con_gas_pro_inc where f_con_gas_pro_inc_id in
<foreach item="fConGasProIncId" collection="array" open="(" separator="," close=")">
......
......@@ -64,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fProjectName != null and fProjectName != ''"> and f_project_name like concat('%', #{fProjectName}, '%')</if>
<if test="fPipePress != null and fPipePress != ''"> and f_pipe_press = #{fPipePress}</if>
<if test="entUploadState != null and entUploadState != ''"> and f_ent_upload_state = #{entUploadState}</if>
<if test="fCompanyInfoId != null and fCompanyInfoId != ''"> and f_company_info_id = #{fCompanyInfoId}</if>
</where>
order by f_update_time desc
</select>
......
......@@ -59,3 +59,11 @@ export function reportAccidentInfo(query) {
params: query
})
}
export function entReportConGasProInfo(query) {
return request({
url: '/third/accident/entReportConGasProInfo',
method: 'get',
params: query
})
}
\ No newline at end of file
......@@ -33,6 +33,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-if="user.roleId==1||user.roleId==5"
>新增</el-button>
</el-col>
<el-col :span="1.5">
......@@ -43,6 +44,7 @@
size="mini"
:disabled="single"
@click="handleUpdate"
v-if="user.roleId==1||user.roleId==5"
>修改</el-button>
</el-col>
<el-col :span="1.5">
......@@ -53,6 +55,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
v-if="user.roleId==1||user.roleId==5"
>删除</el-button>
</el-col>
<el-col :span="1.5">
......@@ -94,7 +97,8 @@
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="最后修改时间" align="center" prop="fUpdateTime" />
<el-table-column label="上传状态" align="center" prop="uploadState" :formatter="uploadStateFormat" />
<el-table-column label="上传时间" align="center" prop="uploadTime" :formatter="uploadTimeFormat" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -108,17 +112,20 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-if="user.roleId==1||user.roleId==5"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-if="user.roleId==1||user.roleId==5"
>删除</el-button>
<el-button
size="mini"
type="text"
@click="handleReport(scope.row)"
v-if="judgeUploadIsShow((scope.row))"
>上传</el-button>
</template>
</el-table-column>
......@@ -210,10 +217,12 @@
</template>
<script>
import { listInc, getInc, delInc, addInc, updateInc, exportInc, reportAccidentInfo} from "@/api/thirdbuild/accident";
import { listInc, getInc, delInc, addInc, updateInc, exportInc, reportAccidentInfo,entReportConGasProInfo} from "@/api/thirdbuild/accident";
import { conGasProInfoList } from "@/api/thirdbuild/project";
import FileUpload from '@/components/FileUpload';
import{getInfo} from "@/api/login"
let uploadfile = require("@/assets/uploadfile.png");
import { enterpriseLists } from "@/api/regulation/info";
import DetailInfo from "./components/DetailInfo";
export default {
name: "Inc",
......@@ -223,6 +232,8 @@ export default {
},
data() {
return {
user:{},
enterprises: [],
// 遮罩层
loading: true,
// 导出遮罩层
......@@ -280,19 +291,104 @@ export default {
};
},
created() {
this.getList();
this.getProjectInfo();
this.getuserInfo();
this.getEnterpriseLists();
},
methods: {
//所属单位
getEnterpriseLists(){
const param = {};
enterpriseLists(param).then(response => {
if (response.rows.length>1){
this.enterprises = response.rows;
this.enterpriseName = response.rows[0].enterpriseName;
}else {
this.enterprises = response.rows;
this.enterpriseName = response.rows[0].enterpriseName;
}
});
},
getuserInfo(){
getInfo().then(response => {
this.user = response.user.roles[0]
this.getList();
this.getProjectInfo();
});
},
//上传状态动态展示
uploadStateFormat(row, column) {
//角色 1 超级管理员 5 企业
let roleId = this.user.roleId;
if (roleId == 5) {
if (row.entUploadState == '0') {
return "未上传"
} else{
return "已上传"
}
} else {
if (row.govUploadState == '0') {
return "未上传"
} else{
return "已上传"
}
}
},
//上传时间动态展示
uploadTimeFormat(row, column) {
//角色 1 超级管理员 5 企业
let roleId = this.user.roleId;
if (roleId == 5) {
return row.entUploadTime;
} else {
return row.govUploadTime;
}
},
/** 查询涉气第三方施工意外事件列表 */
getList() {
this.loading = true;
// 企业查自己的数据
if (this.user.roleId == 5) {
this.queryParams.fCompanyInfoId = this.$store.state.user.enterpriseId
}
listInc(this.queryParams).then(response => {
this.incList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//判断 上传是否需要显示,上传分为企业上传 和 政府端上传
judgeUploadIsShow(row) {
//角色 1 超级管理员 5 企业
let roleId = this.user.roleId;
// 企业端 上传状态 0-未上传,1-已上传
let entUploadState = row.entUploadState;
// 政府端 上传状态 0-未上传,1-已上传
let govUploadState = row.govUploadState;
// 如果政府端都已经上传,那就不能显示了。
if(govUploadState === '1') {
return false;
}
// 如果企业端上传了,则企业端就不能显示了,政府端和 超级管理员能显示
if(entUploadState === '1' && govUploadState === '0') {
if (roleId === 5) {
return false;
} else {
return true;
}
}
// 别的情况,都显示
return true;
},
// 取消按钮
cancel() {
this.open = false;
......@@ -355,6 +451,7 @@ export default {
this.getList();
});
} else {
this.form.fCompanyInfoId=this.enterprises[0].enterpriseId;
addInc(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
......@@ -395,15 +492,22 @@ export default {
},
//获取第三方施工项目信息
getProjectInfo(){
conGasProInfoList({}).then(res =>{
// 企业查自己的数据
let conGasProInfoQueryParams = {};
if (this.user.roleId == 5) {
conGasProInfoQueryParams.fCompanyInfoId= this.$store.state.user.enterpriseId
}
conGasProInfoList(conGasProInfoQueryParams).then(res =>{
if(res.code == 200 && res.data){
this.projectInfo = res.data;
}
})
},
//上传
getFileInfo(res){
getFileInfo(res){
console.log("this.form.fAttachment res" + res.url);
this.form.fAttachment = res.url;
console.log("this.form.fAttachment" + this.form.fAttachment);
this.fileList.push({
name: res.fileName,
url: uploadfile,
......@@ -420,9 +524,21 @@ export default {
handleDetail(row){
this.$refs.detail.getDetailInfo(row.fConGasProIncId);
},
/** 删除按钮操作 */
/** 上传按钮操作 */
handleReport(row) {
this.$confirm('是否确认上传项目编号为"' + row.projectCode + '"的数据项?', "警告", {
if (this.user.roleId == 5) {
this.$confirm('是否确认上传项目编号为"' + row.projectCode + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return entReportConGasProInfo({fConGasProIncId : row.fConGasProIncId});
}).then(() => {
this.getList();
this.msgSuccess("上传成功");
}).catch(() => {});
} else {
this.$confirm('是否确认上传项目编号为"' + row.projectCode + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
......@@ -431,7 +547,8 @@ export default {
}).then(() => {
this.getList();
this.msgSuccess("上传成功");
}).catch(() => {});
}).catch(() => {});
}
},
}
};
......
......@@ -99,6 +99,8 @@
</template>
</el-table-column>
<el-table-column label="管道压力等级分类" align="center" prop="fPipePress" :formatter="fPipePressFormat" />
<el-table-column label="上传状态" align="center" prop="uploadState" :formatter="uploadStateFormat" />
<el-table-column label="上传时间" align="center" prop="uploadTime" :formatter="uploadTimeFormat" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="210">
<template slot-scope="scope">
<el-button
......@@ -530,6 +532,7 @@ export default {
fProjectNo: null,
fProjectName: null,
fPipePress: null,
fCompanyInfoId: null,
},
// 表单参数
form: {},
......@@ -578,7 +581,6 @@ export default {
},
created() {
this.getuserInfo();
this.getList();
this.getCountyInfo();
this.getEnterpriseLists();
this.getDicts("t_pipe_press").then(response => {
......@@ -592,12 +594,10 @@ export default {
enterpriseLists(param).then(response => {
if (response.rows.length>1){
this.enterprises = response.rows;
this.enterpriseName = response.rows[0].enterpriseName;
console.log("this.form.fCompanyInfoId = " + this.form.fCompanyInfoId);
this.enterpriseName = response.rows[0].enterpriseName;
}else {
this.enterprises = response.rows;
this.enterpriseName = response.rows[0].enterpriseName;
console.log("this.form.fCompanyInfoId = " + this.form.fCompanyInfoId);
this.enterpriseName = response.rows[0].enterpriseName;
}
});
},
......@@ -615,7 +615,12 @@ export default {
},
/** 查询涉气第三方施工项目档案列表 */
getList() {
this.loading = true;
this.loading = true;
// 企业查自己的数据
if (this.user.roleId == 5) {
this.queryParams.fCompanyInfoId = this.$store.state.user.enterpriseId
}
console.log("this.queryParams = " + this.queryParams)
listInfor(this.queryParams).then(response => {
this.inforList = response.rows;
this.total = response.total;
......@@ -626,6 +631,35 @@ export default {
fPipePressFormat(row, column) {
return this.selectDictLabel(this.fPipePressOptions, row.fPipePress);
},
//上传状态动态展示
uploadStateFormat(row, column) {
//角色 1 超级管理员 5 企业
let roleId = this.user.roleId;
if (roleId == 5) {
if (row.entUploadState == '0') {
return "未上传"
} else{
return "已上传"
}
} else {
if (row.govUploadState == '0') {
return "未上传"
} else{
return "已上传"
}
}
},
//上传时间动态展示
uploadTimeFormat(row, column) {
//角色 1 超级管理员 5 企业
let roleId = this.user.roleId;
if (roleId == 5) {
return row.entUploadTime;
} else {
return row.govUploadTime;
}
},
// 取消按钮
cancel() {
this.open = false;
......@@ -699,9 +733,6 @@ export default {
this.reset();
this.open = true;
this.title = "添加涉气第三方施工项目档案";
console.log("this.form.fCompanyInfoId = ");
console.log("this.form.fCompanyInfoId = " + this.form.fCompanyInfoId);
},
/** 修改按钮操作 */
handleUpdate(row) {
......@@ -714,9 +745,7 @@ export default {
});
},
//判断 上传是否需要显示,上传分为企业上传 和 政府端上传
judgeUploadIsShow(row) {
console.log("judgeUploadIsShow"+row)
judgeUploadIsShow(row) {
//角色 1 超级管理员 5 企业
let roleId = this.user.roleId;
......@@ -732,9 +761,9 @@ export default {
return false;
}
// 如果企业端上传了,则企业端就不能显示了,政府端能显示
// 如果企业端上传了,则企业端就不能显示了,政府端和 超级管理员能显示
if(entUploadState === '1' && govUploadState === '0') {
if (roleId === 1 | roleId === 5) {
if (roleId === 5) {
return false;
} else {
return true;
......@@ -747,8 +776,8 @@ export default {
},
getuserInfo(){
getInfo().then(response => {
console.log(response);
this.user = response.user.roles[0]
this.getList();
});
},
/** 提交按钮 */
......@@ -830,7 +859,7 @@ export default {
/** 上传按钮操作 */
handleReport(row) {
if (this.user.roleId == 1 || this.user.roleId == 5 ) {
if (this.user.roleId == 5 ) {
this.$confirm('是否确认上传涉气第三方施工项目档案名称为"' + row.fProjectName + '"的数据项?', "警告", {
confirmButtonText: "确定",
......
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