Commit 9dc2fa11 authored by wuqinghua's avatar wuqinghua

2022-3-22 吴卿华

parent 7c8ae314
package com.zehong.web.controller.supervise; package com.zehong.web.controller.supervise;
import java.io.File; import java.io.File;
import java.text.ParseException;
import java.util.List; import java.util.List;
import com.zehong.common.config.GassafetyProgressConfig; import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -77,8 +79,7 @@ public class TProjectInfoController extends BaseController ...@@ -77,8 +79,7 @@ public class TProjectInfoController extends BaseController
@PreAuthorize("@ss.hasPermi('project:info:add')") @PreAuthorize("@ss.hasPermi('project:info:add')")
@Log(title = "工程项目信息", businessType = BusinessType.INSERT) @Log(title = "工程项目信息", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TProjectInfo tProjectInfo) public AjaxResult add(@RequestBody TProjectInfo tProjectInfo) throws ParseException {
{
//查询是否已经有重复的年份数据 //查询是否已经有重复的年份数据
List<TProjectInfo> tProjectInfos = tProjectInfoService.selectSameYear(tProjectInfo.getProjectYear()); List<TProjectInfo> tProjectInfos = tProjectInfoService.selectSameYear(tProjectInfo.getProjectYear());
//说明有重复的年份 将重复的年份删除 //说明有重复的年份 将重复的年份删除
...@@ -86,6 +87,10 @@ public class TProjectInfoController extends BaseController ...@@ -86,6 +87,10 @@ public class TProjectInfoController extends BaseController
//重复年份删除方法 //重复年份删除方法
tProjectInfoService.deleteisSameYear(tProjectInfo.getProjectYear()); tProjectInfoService.deleteisSameYear(tProjectInfo.getProjectYear());
} }
SysUser user = SecurityUtils.getLoginUser().getUser();
//获取用户所属单位
String enterpriseName = user.getEnterpriseName();
tProjectInfo.setEnterpriseCode(String.valueOf(enterpriseName));
return toAjax(tProjectInfoService.insertTProjectInfo(tProjectInfo)); return toAjax(tProjectInfoService.insertTProjectInfo(tProjectInfo));
} }
...@@ -99,7 +104,7 @@ public class TProjectInfoController extends BaseController ...@@ -99,7 +104,7 @@ public class TProjectInfoController extends BaseController
{ {
//查询修改文件之前的路径 //查询修改文件之前的路径
TProjectInfo tProjectInfos = tProjectInfoService.selectNearbyAddress(tProjectInfo.getProjectId()); TProjectInfo tProjectInfos = tProjectInfoService.selectNearbyAddress(tProjectInfo.getProjectId());
if (tProjectInfos.getNearbyAddress()!=null){ if (tProjectInfos!=null){
// 上传文件路径 // 上传文件路径
String filePath = GassafetyProgressConfig.getUploadPath(); String filePath = GassafetyProgressConfig.getUploadPath();
String[] strs = tProjectInfos.getNearbyAddress().split("upload"); String[] strs = tProjectInfos.getNearbyAddress().split("upload");
......
...@@ -46,6 +46,10 @@ public class TProjectInfo extends BaseEntity ...@@ -46,6 +46,10 @@ public class TProjectInfo extends BaseEntity
@Excel(name = "管道金额") @Excel(name = "管道金额")
private BigDecimal pipeInvestment; private BigDecimal pipeInvestment;
/**企业编码*/
@Excel(name = "企业编码")
private String enterpriseCode;
/** 附件地址 */ /** 附件地址 */
private String nearbyAddress; private String nearbyAddress;
...@@ -56,26 +60,37 @@ public class TProjectInfo extends BaseEntity ...@@ -56,26 +60,37 @@ public class TProjectInfo extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String remarks; private String remarks;
public String getEnterpriseCode() {
return enterpriseCode;
}
public void setEnterpriseCode(String enterpriseCode) {
this.enterpriseCode = enterpriseCode;
}
public void setProjectId(Long projectId) public void setProjectId(Long projectId)
{ {
this.projectId = projectId; this.projectId = projectId;
} }
public Long getProjectId() public static long getSerialVersionUID() {
{ return serialVersionUID;
return projectId;
} }
public void setProjectYear(Date projectYear)
{ public Long getProjectId() {
this.projectYear = projectYear; return projectId;
} }
public Date getProjectYear() public Date getProjectYear() {
{
return projectYear; return projectYear;
} }
public void setGateStationAddress(String gateStationAddress)
{ public void setProjectYear(Date projectYear) {
this.projectYear = projectYear;
}
public void setGateStationAddress(String gateStationAddress) {
this.gateStationAddress = gateStationAddress; this.gateStationAddress = gateStationAddress;
} }
...@@ -149,21 +164,18 @@ public class TProjectInfo extends BaseEntity ...@@ -149,21 +164,18 @@ public class TProjectInfo extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "TProjectInfo{" +
.append("projectId", getProjectId()) "projectId=" + projectId +
.append("projectYear", getProjectYear()) ", projectYear=" + projectYear +
.append("gateStationAddress", getGateStationAddress()) ", gateStationAddress='" + gateStationAddress + '\'' +
.append("gateStationInvestment", getGateStationInvestment()) ", gateStationInvestment=" + gateStationInvestment +
.append("numberGateStations", getNumberGateStations()) ", numberGateStations=" + numberGateStations +
.append("pipeLength", getPipeLength()) ", pipeLength=" + pipeLength +
.append("pipeInvestment", getPipeInvestment()) ", pipeInvestment=" + pipeInvestment +
.append("nearbyAddress", getNearbyAddress()) ", enterpriseCode='" + enterpriseCode + '\'' +
.append("createBy", getCreateBy()) ", nearbyAddress='" + nearbyAddress + '\'' +
.append("createTime", getCreateTime()) ", isDel='" + isDel + '\'' +
.append("updateBy", getUpdateBy()) ", remarks='" + remarks + '\'' +
.append("updateTime", getUpdateTime()) '}';
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
} }
} }
...@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TProjectInfo" id="TProjectInfoResult"> <resultMap type="TProjectInfo" id="TProjectInfoResult">
<result property="projectId" column="project_id" /> <result property="projectId" column="project_id" />
<result property="enterpriseCode" column="enterprise_code" />
<result property="projectYear" column="project_year" /> <result property="projectYear" column="project_year" />
<result property="gateStationAddress" column="gate_station_address" /> <result property="gateStationAddress" column="gate_station_address" />
<result property="gateStationInvestment" column="gate_station_investment" /> <result property="gateStationInvestment" column="gate_station_investment" />
...@@ -22,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -22,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTProjectInfoVo"> <sql id="selectTProjectInfoVo">
select project_id, project_year, gate_station_address, gate_station_investment, number_gate_stations, pipe_length, pipe_investment, nearby_address, create_by, create_time, update_by, update_time, is_del, remarks from t_project_info select project_id,enterprise_code,project_year, gate_station_address, gate_station_investment, number_gate_stations, pipe_length, pipe_investment, nearby_address, create_by, create_time, update_by, update_time, is_del, remarks from t_project_info
</sql> </sql>
<select id="selectTProjectInfoList" parameterType="TProjectInfo" resultMap="TProjectInfoResult"> <select id="selectTProjectInfoList" parameterType="TProjectInfo" resultMap="TProjectInfoResult">
...@@ -51,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -51,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into t_project_info insert into t_project_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectYear != null">project_year,</if> <if test="projectYear != null">project_year,</if>
<if test="enterpriseCode != null">enterprise_code,</if>
<if test="gateStationAddress != null">gate_station_address,</if> <if test="gateStationAddress != null">gate_station_address,</if>
<if test="gateStationInvestment != null">gate_station_investment,</if> <if test="gateStationInvestment != null">gate_station_investment,</if>
<if test="numberGateStations != null">number_gate_stations,</if> <if test="numberGateStations != null">number_gate_stations,</if>
...@@ -66,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -66,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectYear != null">#{projectYear},</if> <if test="projectYear != null">#{projectYear},</if>
<if test="enterpriseCode != null">#{enterpriseCode},</if>
<if test="gateStationAddress != null">#{gateStationAddress},</if> <if test="gateStationAddress != null">#{gateStationAddress},</if>
<if test="gateStationInvestment != null">#{gateStationInvestment},</if> <if test="gateStationInvestment != null">#{gateStationInvestment},</if>
<if test="numberGateStations != null">#{numberGateStations},</if> <if test="numberGateStations != null">#{numberGateStations},</if>
...@@ -85,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -85,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update t_project_info update t_project_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="projectYear != null">project_year = #{projectYear},</if> <if test="projectYear != null">project_year = #{projectYear},</if>
<if test="enterpriseCode != null">enterprise_code = #{enterpriseCode},</if>
<if test="gateStationAddress != null">gate_station_address = #{gateStationAddress},</if> <if test="gateStationAddress != null">gate_station_address = #{gateStationAddress},</if>
<if test="gateStationInvestment != null">gate_station_investment = #{gateStationInvestment},</if> <if test="gateStationInvestment != null">gate_station_investment = #{gateStationInvestment},</if>
<if test="numberGateStations != null">number_gate_stations = #{numberGateStations},</if> <if test="numberGateStations != null">number_gate_stations = #{numberGateStations},</if>
......
...@@ -9,15 +9,6 @@ ...@@ -9,15 +9,6 @@
placeholder="选择工程项目年度"> placeholder="选择工程项目年度">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="门站地址" prop="gateStationAddress">
<el-input
v-model="queryParams.gateStationAddress"
placeholder="请输入门站地址"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</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>
...@@ -75,20 +66,29 @@ ...@@ -75,20 +66,29 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="工程项目年度" align="center" prop="projectYear" width="180"> <el-table-column label="工程项目年度" align="center" prop="projectYear" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.projectYear, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.projectYear, '{y}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="门站地址" align="center" prop="gateStationAddress" /> <el-table-column label="企业名称" align="center" prop="enterpriseCode" >
<el-table-column label="门站金额" align="center" prop="gateStationInvestment" /> <span slot-scope="scope" v-if="scope.row.enterpriseCode">{{scope.row.enterpriseCode}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="门站数量" align="center" prop="numberGateStations" /> <el-table-column label="门站数量" align="center" prop="numberGateStations" />
<el-table-column label="门站投资额(万元)" align="center" prop="gateStationInvestment">
<span slot-scope="scope" v-if="scope.row.gateStationInvestment">{{scope.row.gateStationInvestment}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="管道长度" align="center" prop="pipeLength" /> <el-table-column label="管道长度" align="center" prop="pipeLength" />
<el-table-column label="管道金额" align="center" prop="pipeInvestment" /> <el-table-column label="管道投资额(万元)" align="center" prop="pipeInvestment" >
<el-table-column label="附件" align="center" prop="nearbyAddress"> <span slot-scope="scope" v-if="scope.row.pipeInvestment">{{scope.row.pipeInvestment}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="附件" align="center" prop="nearbyAddress" >
<template slot-scope="scope"> <template slot-scope="scope">
<span <span
class="dbtn" class="dbtn"
@click="checkFile(scope.row.nearbyAddress)" @click="checkFile(scope.row.nearbyAddress)"
v-if="scope.row.dealPlan != ''" v-if="scope.row.nearbyAddress"
> >
<i class="el-icon el-icon-view"></i>查看/下载 <i class="el-icon el-icon-view"></i>查看/下载
</span> </span>
...@@ -126,8 +126,7 @@ ...@@ -126,8 +126,7 @@
<!-- 添加或修改工程项目信息对话框 --> <!-- 添加或修改工程项目信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="780px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="项目年度" prop="projectYear"> <el-form-item label="项目年度" prop="projectYear">
...@@ -140,40 +139,54 @@ ...@@ -140,40 +139,54 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="门站地址" prop="gateStationAddress"> <el-form-item label="企业名称" prop="enterpriseCode">
<el-input v-model="form.gateStationAddress" placeholder="请输入门站地址" /> <el-input :disabled="true" v-model="form.enterpriseCode" placeholder="企业名称" >
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <div class="tableTitle">
<img :src="stationImg" style="width: 24px; height: 25px;position: relative; left: -326px; top: -12px;"/>
<span class="midText">门站</span>
</div>
<el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="门站数量" prop="numberGateStations"> <el-form-item label="门站数量" prop="numberGateStations">
<el-input @change="numberGateStations()" v-model="form.numberGateStations" placeholder="请输入门站数量" /> <el-input @change="numberGateStations()" v-model="form.numberGateStations" placeholder="请输入门站数量" >
<template slot="append"></template>
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="门站额" prop="gateStationInvestment"> <el-form-item label="门站投资额" prop="gateStationInvestment">
<el-input :disabled="isGateStationDisabled" v-model="form.gateStationInvestment" placeholder="请输入门站额" > <el-input :disabled="isGateStationDisabled" v-model="form.gateStationInvestment" placeholder="请输入门站投资额" >
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<div class="tableTitle">
<img :src="bookImg" style="width: 24px; height: 25px; position: relative; left: -326px; top: -12px;"/>
<span class="midText">管道</span>
</div>
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="管道长度" prop="pipeLength"> <el-form-item label="管道长度" prop="pipeLength">
<el-input @change="conduitGateStations()" v-model="form.pipeLength" placeholder="请输入管道长度" /> <el-input @change="conduitGateStations()" v-model="form.pipeLength" placeholder="请输入管道长度" >
<template slot="append"></template>
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="管道额" prop="pipeInvestment"> <el-form-item label="管道投资额" prop="pipeInvestment">
<el-input :disabled="isPipelineAmount" v-model="form.pipeInvestment" placeholder="请输入管道额" > <el-input :disabled="isPipelineAmount" v-model="form.pipeInvestment" placeholder="请输入管道投资额" >
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -220,6 +233,8 @@ export default { ...@@ -220,6 +233,8 @@ export default {
}, },
data() { data() {
return { return {
stationImg: require('@/assets/project/station.png'),
bookImg: require('@/assets/project/theConduit.png'),
// 上传文件列表 // 上传文件列表
fileList: [], fileList: [],
//门站金额输入框是否输入 //门站金额输入框是否输入
...@@ -251,7 +266,6 @@ export default { ...@@ -251,7 +266,6 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectYear: null, projectYear: null,
gateStationAddress: null,
gateStationInvestment: null, gateStationInvestment: null,
numberGateStations: null, numberGateStations: null,
pipeLength: null, pipeLength: null,
...@@ -325,10 +339,9 @@ export default { ...@@ -325,10 +339,9 @@ export default {
this.form = { this.form = {
projectId: null, projectId: null,
projectYear: null, projectYear: null,
gateStationAddress: null,
gateStationInvestment: null, gateStationInvestment: null,
numberGateStations: null, numberGateStations: 0,
pipeLength: null, pipeLength: 0,
pipeInvestment: null, pipeInvestment: null,
nearbyAddress: null, nearbyAddress: null,
createBy: null, createBy: null,
...@@ -336,7 +349,8 @@ export default { ...@@ -336,7 +349,8 @@ export default {
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
isDel: null, isDel: null,
remarks: null remarks: null,
enterpriseCode:null
}; };
this.resetForm("form"); this.resetForm("form");
this.fileList = []; this.fileList = [];
...@@ -482,4 +496,23 @@ export default { ...@@ -482,4 +496,23 @@ export default {
border-width: 1px; border-width: 1px;
border-color: rgb(48, 180, 107); border-color: rgb(48, 180, 107);
} }
.tableTitle {
position: relative;
margin: 24px auto;
width: 600px;
height: 2px;
background-color: #d4d4d4;
text-align: center;
font-size: 16px;
color: rgba(101, 101, 101, 1);
}
.midText {
position: absolute;
left: 3%;
background-color: #ffffff;
padding: 0 15px;
transform: translateX(-50%) translateY(-50%);
}
</style> </style>
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