Commit 7d6b0f5d authored by wanghao's avatar wanghao

1 第三方施工-项目档案-调整成 企业 录入数据,上传给 政府,政府查看后,再上传给 省平台。

parent bd5a1722
......@@ -114,4 +114,15 @@ public class TConGasProInforController extends BaseController
return AjaxResult.error("上传第三方施工接口异常");
}
}
/**
* 企业端上传第三方施工
* @param fConGasProInforId 第三方施工id
* @return
*/
@GetMapping("/entReportConGasProInfo")
public AjaxResult entReportConGasProInfo(Long fConGasProInforId){
return toAjax(tConGasProInforService.entReportConGasProInfo(fConGasProInforId));
}
}
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_infor
*
......@@ -183,6 +186,23 @@ public class TConGasProInfor extends BaseEntity
@Excel(name = "最后修改时间")
private String fUpdateTime;
/**
* 企业端上传时间 */
@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;
public void setfConGasProInforId(Long fConGasProInforId)
{
this.fConGasProInforId = fConGasProInforId;
......@@ -544,6 +564,38 @@ public class TConGasProInfor extends BaseEntity
return fUpdateTime;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.zehong.system.mapper;
import java.util.Date;
import java.util.List;
import com.zehong.system.domain.TConGasProInfor;
import org.apache.ibatis.annotations.Param;
/**
* 第三方施工-涉气第三方施工项目档案Mapper接口
......@@ -43,6 +45,12 @@ public interface TConGasProInforMapper
*/
public int updateTConGasProInfor(TConGasProInfor tConGasProInfor);
/**
*
* 根据id修改 企业端上传状态*/
public int updateEntUploadStateById( @Param("state") String state,@Param("entUploadTime") Date entUploadTime,
@Param("fConGasProInforId") Long fConGasProInforId);
/**
* 删除第三方施工-涉气第三方施工项目档案
*
......
......@@ -65,4 +65,11 @@ public interface ITConGasProInforService
* @return
*/
int reportConGasProInfo(Long fConGasProInforId) throws Exception;
/**
* 企业端上传数据
* @param fConGasProInforId id
* @return
*/
int entReportConGasProInfo(Long fConGasProInforId);
}
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.DateUtils;
import com.zehong.common.utils.GovernmentDataCopyUtil;
import com.zehong.common.utils.GovernmentDataUtil;
import com.zehong.common.utils.StringUtils;
import com.zehong.common.utils.*;
import com.zehong.system.domain.SysSetting;
import com.zehong.system.domain.TConGasProInfor;
import com.zehong.system.domain.vo.TConGasProInforVo;
......@@ -37,7 +36,7 @@ public class TConGasProInforServiceImpl implements ITConGasProInforService
{
private static final Logger log = LoggerFactory.getLogger(TConGasProInforServiceImpl.class);
@Autowired
@Resource
private TConGasProInforMapper tConGasProInforMapper;
@Resource
......@@ -70,6 +69,11 @@ public class TConGasProInforServiceImpl implements ITConGasProInforService
@Override
public List<TConGasProInfor> selectTConGasProInforList(TConGasProInfor tConGasProInfor)
{
SysRole sysRole = SecurityUtils.getLoginUser().getUser().getRoles().get(0);
if (sysRole.getRoleId() != 1 && sysRole.getRoleId() != 5) {
tConGasProInfor.setEntUploadState("1");
}
return tConGasProInforMapper.selectTConGasProInforList(tConGasProInfor);
}
......@@ -128,7 +132,7 @@ public class TConGasProInforServiceImpl implements ITConGasProInforService
}
/**
* 上传第三方施工
* 政府端上传第三方施工
* @param fConGasProInforId 第三方施工id
* @return
*/
......@@ -143,6 +147,20 @@ public class TConGasProInforServiceImpl implements ITConGasProInforService
JSONObject reportResult = governmentDataUtil.setInfo("construction/gas/project/information","WRITE",data);
log.info("上传第三方施工结果===================" + reportResult.toJSONString());
if(!"0".equals(reportResult.getString("resultCode"))) throw new CustomException("上传第三方施工接口失败");
conGasProInfor.setGovUploadState("1");
conGasProInfor.setGovUploadTime(new Date());
tConGasProInforMapper.updateTConGasProInfor(conGasProInfor);
return 1;
}
/**
* 企业端上传数据
* @param fConGasProInforId id
* @return
*/
@Override
public int entReportConGasProInfo(Long fConGasProInforId) {
tConGasProInforMapper.updateEntUploadStateById("1",new Date(),fConGasProInforId);
return 1;
}
}
......@@ -45,10 +45,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="fGasCompanyStationPhone" column="f_gas_company_station_phone" />
<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="selectTConGasProInforVo">
select f_con_gas_pro_infor_id, f_project_code, f_project_no, f_project_name, f_construction_start, f_construction_end, f_address, f_district_id, f_construction_longitude, f_construction_latitude, f_construction_point_type, f_village_id, f_pipe_press, f_report_flag, f_construction_status, f_build_department, f_project_leader, f_project_leader_phone, f_industry, f_department_name, f_construct_department, f_build_project_leader_name, f_build_project_leader_phone, f_technical_leader_name, f_technical_leader_phone, f_supervision_unit_name, f_chief_engineer_name, f_chief_engineer_phone, f_company_info_id, f_patrol_safety_officer_no, f_partrol_safety_officer_name, f_patrol_safety_officer_phone, f_resident_safety_officer_no, f_resident_safety_officer_name, f_resident_safety_officer_phone, f_gas_company_station_no, f_gas_company_station_name, f_gas_company_station_phone, f_remark, f_update_time from t_con_gas_pro_infor
select f_con_gas_pro_infor_id, f_project_code, f_project_no, f_project_name, f_construction_start, f_construction_end, f_address, f_district_id, f_construction_longitude, f_construction_latitude, f_construction_point_type, f_village_id, f_pipe_press, f_report_flag, f_construction_status, f_build_department, f_project_leader, f_project_leader_phone, f_industry, f_department_name, f_construct_department, f_build_project_leader_name, f_build_project_leader_phone, f_technical_leader_name, f_technical_leader_phone, f_supervision_unit_name, f_chief_engineer_name, f_chief_engineer_phone, f_company_info_id, f_patrol_safety_officer_no, f_partrol_safety_officer_name, f_patrol_safety_officer_phone, f_resident_safety_officer_no, f_resident_safety_officer_name, f_resident_safety_officer_phone, f_gas_company_station_no, f_gas_company_station_name, f_gas_company_station_phone, f_remark, f_update_time,f_ent_upload_time,f_ent_upload_state,f_gov_upload_time,f_gov_upload_state from t_con_gas_pro_infor
</sql>
<select id="selectTConGasProInforList" parameterType="TConGasProInfor" resultMap="TConGasProInforResult">
......@@ -58,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fProjectNo != null "> and f_project_no = #{fProjectNo}</if>
<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>
</where>
order by f_update_time desc
</select>
......@@ -109,6 +115,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fGasCompanyStationPhone != null">f_gas_company_station_phone,</if>
<if test="fRemark != null">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 entUploadStatue != ''">f_ent_upload_state,</if>
<if test="govUploadTime != null">f_gov_upload_time,</if>
<if test="govUploadState != null and govUploadStatue != ''">f_gov_upload_state,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fProjectCode != null and fProjectCode != ''">#{fProjectCode},</if>
......@@ -149,7 +160,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fGasCompanyStationName != null">#{fGasCompanyStationName},</if>
<if test="fGasCompanyStationPhone != null">#{fGasCompanyStationPhone},</if>
<if test="fRemark != null">#{fRemark},</if>
<if test="fUpdateTime != null and fUpdateTime != ''">#{fUpdateTime},</if>
<if test="fUpdateTime != null">#{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>
......@@ -194,11 +210,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fGasCompanyStationName != null">f_gas_company_station_name = #{fGasCompanyStationName},</if>
<if test="fGasCompanyStationPhone != null">f_gas_company_station_phone = #{fGasCompanyStationPhone},</if>
<if test="fRemark != null">f_remark = #{fRemark},</if>
<if test="fUpdateTime != null and fUpdateTime != ''">f_update_time = #{fUpdateTime},</if>
<if test="fUpdateTime != null">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_con_gas_pro_infor_id = #{fConGasProInforId}
</update>
<update id="updateEntUploadStateById">
update t_con_gas_pro_infor set f_ent_upload_state = #{state}, f_ent_upload_time = #{entUploadTime} where f_con_gas_pro_infor_id = #{fConGasProInforId}
</update>
<delete id="deleteTConGasProInforById" parameterType="Long">
delete from t_con_gas_pro_infor where f_con_gas_pro_infor_id = #{fConGasProInforId}
</delete>
......
......@@ -60,6 +60,15 @@ export function reportConGasProInfo(query) {
})
}
export function entReportConGasProInfo(query) {
return request({
url: '/third/project/entReportConGasProInfo',
method: 'get',
params: query
})
}
export function conGasProInfoList(query) {
return request({
url: '/third/project/conGasProInfoList',
......
......@@ -45,6 +45,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">
......@@ -55,6 +56,7 @@
size="mini"
:disabled="single"
@click="handleUpdate"
v-if="user.roleId==1||user.roleId==5"
>修改</el-button>
</el-col>
<el-col :span="1.5">
......@@ -65,6 +67,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
v-if="user.roleId==1||user.roleId==5"
>删除</el-button>
</el-col>
<el-col :span="1.5">
......@@ -109,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>
......@@ -464,8 +470,9 @@
</template>
<script>
import { listInfor, getInfor, delInfor, addInfor, updateInfor, exportInfor, reportConGasProInfo } from "@/api/thirdbuild/project";
import { listInfor, getInfor, delInfor, addInfor, updateInfor, exportInfor, reportConGasProInfo,entReportConGasProInfo } from "@/api/thirdbuild/project";
import GetPos from '@/components/GetPos';
import{getInfo} from "@/api/login"
import DetailInfo from "./components/DetailInfo";
export default {
name: "Infor",
......@@ -475,6 +482,7 @@ export default {
},
data() {
return {
user:{},
// 遮罩层
loading: true,
// 导出遮罩层
......@@ -553,6 +561,7 @@ export default {
};
},
created() {
this.getuserInfo();
this.getList();
this.getDicts("t_pipe_press").then(response => {
this.fPipePressOptions = response.data;
......@@ -656,6 +665,44 @@ export default {
this.title = "修改涉气第三方施工项目档案";
});
},
//判断 上传是否需要显示,上传分为企业上传 和 政府端上传
judgeUploadIsShow(row) {
console.log("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 === 1 | roleId === 5) {
return false;
} else {
return true;
}
}
// 别的情况,都显示
return true;
},
getuserInfo(){
getInfo().then(response => {
console.log(response);
this.user = response.user.roles[0]
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
......@@ -731,8 +778,22 @@ export default {
handleDetail(row){
this.$refs.detail.getDetailInfo(row.fConGasProInforId);
},
/** 删除按钮操作 */
/** 上传按钮操作 */
handleReport(row) {
if (this.user.roleId == 1 || this.user.roleId == 5 ) {
this.$confirm('是否确认上传涉气第三方施工项目档案名称为"' + row.fProjectName + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return entReportConGasProInfo({fConGasProInforId : row.fConGasProInforId});
}).then(() => {
this.getList();
this.msgSuccess("上传成功");
}).catch(() => {});
} else {
this.$confirm('是否确认上传涉气第三方施工项目档案名称为"' + row.fProjectName + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
......@@ -743,6 +804,7 @@ export default {
this.getList();
this.msgSuccess("上传成功");
}).catch(() => {});
}
},
}
};
......
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