Commit 457a7eb1 authored by zhangjianqian's avatar zhangjianqian

隐患增加营业网点

parent a4a57cdb
......@@ -49,6 +49,9 @@ public class TDanger extends BaseEntity
@Excel(name = "隐患级别",readConverterExp = "1=重大,2=一般")
private Integer level;
/** 营业网点 */
@Excel(name = "营业网点", dictType = "t_branch")
private String branch;
/** 隐患内容 */
@Excel(name = "隐患内容")
private String beforeContent;
......@@ -188,6 +191,14 @@ public class TDanger extends BaseEntity
private Long village;
public String getBranch() {
return branch;
}
public void setBranch(String branch) {
this.branch = branch;
}
public void setId(Long id)
{
this.id = id;
......
......@@ -5,14 +5,8 @@ import com.zehong.common.core.domain.entity.SysRole;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.SysPost;
import com.zehong.system.domain.TDanger;
import com.zehong.system.domain.TDangerStatus;
import com.zehong.system.domain.TTaskInspect;
import com.zehong.system.mapper.SysPostMapper;
import com.zehong.system.mapper.TDangerMapper;
import com.zehong.system.mapper.TDangerStatusMapper;
import com.zehong.system.mapper.TTaskInspectMapper;
import com.zehong.system.domain.*;
import com.zehong.system.mapper.*;
import com.zehong.system.service.ITDangerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -45,6 +39,16 @@ public class TDangerServiceImpl implements ITDangerService
@Resource
private TTaskInspectMapper taskInspectMapper;
@Autowired
private TIndustryMapper industryMapper;
@Autowired
private TBusinessMapper businessMapper;
@Autowired
private TUserMapper userMapper;
/**
* 查询安检隐患整改
*
......@@ -94,6 +98,18 @@ public class TDangerServiceImpl implements ITDangerService
tDanger.setIsVisitor("1");
}
}
if(tDanger.getReceiveId()!=null){
if(tDanger.getType()==1){
TUser u = userMapper.selectTUserById(tDanger.getReceiveId());
tDanger.setBranch(u.getBranch());
}else if(tDanger.getType()==2){
TBusiness bu = businessMapper.selectTBusinessById(tDanger.getReceiveId());
tDanger.setBranch(bu.getBranch());
}else{
TIndustry iu = industryMapper.selectTIndustryById(tDanger.getReceiveId());
tDanger.setBranch(iu.getBranch());
}
}
int result = tDangerMapper.insertTDanger(tDanger);
TDangerStatus tDangerStatus = new TDangerStatus();
tDangerStatus.setDangerId(tDanger.getId());
......
......@@ -44,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="fundsMaterials" column="funds_materials" />
<result property="safetyEmergencyPlan" column="safety_emergency_plan" />
<result property="dealMethod" column="deal_method" />
<result property="branch" column="branch" />
</resultMap>
<sql id="selectTDangerVo">
......@@ -88,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
danger.funds_materials,
danger.safety_emergency_plan,
danger.deal_method,
danger.branch,
(SELECT nick_name FROM sys_user where user_id = danger.file_id) as fileName,
(
case type
......@@ -145,6 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dealMethod != null and dealMethod != ''"> and danger.deal_method = #{dealMethod}</if>
<if test="reportName != null and reportName != ''"> and us.nick_name like concat('%',#{reportName},'%')</if>
<if test="beginDate != null and endDate != null"> and danger.create_time BETWEEN #{beginDate} and #{endDate}</if>
<if test="branch != null "> and danger.branch = #{branch}</if>
</where>
ORDER BY create_time DESC
</select>
......@@ -195,6 +198,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fundsMaterials != null">funds_materials,</if>
<if test="safetyEmergencyPlan != null">safety_emergency_plan,</if>
<if test="dealMethod != null">deal_method,</if>
<if test="branch != null">branch,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskId != null">#{taskId},</if>
......@@ -235,6 +239,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fundsMaterials != null">#{fundsMaterials},</if>
<if test="safetyEmergencyPlan != null">#{safetyEmergencyPlan},</if>
<if test="dealMethod != null">#{dealMethod},</if>
<if test="branch != null"> #{branch},</if>
</trim>
</insert>
......@@ -279,6 +284,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fundsMaterials != null">funds_materials = #{fundsMaterials},</if>
<if test="safetyEmergencyPlan != null">safety_emergency_plan = #{safetyEmergencyPlan},</if>
<if test="dealMethod != null">deal_method = #{dealMethod},</if>
<if test="branch != null">branch = #{branch},</if>
</trim>
where id = #{id}
</update>
......
......@@ -189,7 +189,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="流量计型号" prop="type">
<el-select v-model.number="form.type" placeholder="请选择流量计型号">
<el-select v-model="form.type" placeholder="请选择流量计型号">
<!--<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
......
......@@ -172,6 +172,12 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="营业网点">
<span>{{ $parent.branchFormat(dangerDetailInfo,null) }}</span>
</el-form-item>
</el-col>
<!--<el-col :span="12">
<el-form-item label="归档人">
<span v-if="dangerDetailInfo.fileName">{{
......
......@@ -74,6 +74,17 @@
</el-date-picker>
</el-form-item>
<el-form-item label="营业网点" prop="branch">
<el-select v-model="queryParams.branch" placeholder="请选择营业网点">
<el-option
v-for="dict in sceneOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</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>
......@@ -114,6 +125,7 @@
</template>
</el-table-column>
<el-table-column label="隐患来源" align="center" prop="type" :formatter="typeFormatter"/>
<el-table-column label="营业网点" align="center" prop="branch" :formatter="branchFormat"/>
<el-table-column label="表具编号" align="center" prop="meterNum" />
<el-table-column label="责任归属" align="center" prop="flag">
<template slot-scope="scope">
......@@ -319,6 +331,7 @@ export default {
total: 0,
// 安检隐患整改表格数据
dangerList: [],
sceneOptions:[],
// 弹出层标题
title: "",
// 是否显示弹出层
......@@ -348,7 +361,8 @@ export default {
status: null,
reportName: null,
beginDate: null,
endDate : null
endDate : null,
branch:null
},
// 表单参数
form: {},
......@@ -364,8 +378,14 @@ export default {
created() {
this.getList();
this.getDangerSource();
this.getDicts("t_branch").then(response => {
this.sceneOptions = response.data;
});
},
methods: {
branchFormat(row, column) {
return this.selectDictLabel(this.sceneOptions, row.branch);
},
/** 查询安检隐患整改列表 */
getList() {
this.loading = true;
......
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