Commit 9dc2fa11 authored by wuqinghua's avatar wuqinghua

2022-3-22 吴卿华

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