Commit 72c4ea08 authored by wanghao's avatar wanghao

Merge remote-tracking branch 'origin/master'

parents abe7e7ae 378719b8
package com.zehong.web.controller.supervision;
import java.util.List;
import com.zehong.common.exception.CustomException;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -110,4 +112,22 @@ public class TInsHazRefController extends BaseController
return AjaxResult.error("上传监督检查发现隐患及整改、执法结果接口异常");
}
}
/**
* 根据检查记录上传隐患
* @param checkCode
* @return
*/
@GetMapping("/reportHazRefInfoByCheckCode")
public AjaxResult reportHazRefInfoByCheckCode(String checkCode){
try {
return toAjax(tInsHazRefService.reportHazRefInfoByCheckCode(checkCode));
}catch (CustomException e){
logger.error("根据检查编码上传隐患业务异常=====",e);
return AjaxResult.error(e.getMessage());
}catch (Exception e){
logger.error("根据检查编码上传隐患接口异常=====",e);
return AjaxResult.error("上传隐患接口异常");
}
}
}
......@@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import java.util.List;
/**
* 监督检查-检查记录对象 t_ins_rec_infor
*
......@@ -106,6 +108,11 @@ public class TInsRecInfor extends BaseEntity
private String taskName;
/**
* 隐患集合
*/
private List<TInsHazRef> rectificationList;
public void setfInsRecInforId(Long fInsRecInforId)
{
......@@ -260,6 +267,14 @@ public class TInsRecInfor extends BaseEntity
this.taskName = taskName;
}
public List<TInsHazRef> getRectificationList() {
return rectificationList;
}
public void setRectificationList(List<TInsHazRef> rectificationList) {
this.rectificationList = rectificationList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -58,4 +58,6 @@ public interface TInsHazRefMapper
* @return 结果
*/
public int deleteTInsHazRefByIds(Long[] fInsHazRefIds);
int deleteTInsHazRefByCheckCode(String fCheckCode);
}
......@@ -65,4 +65,11 @@ public interface ITInsHazRefService
* @return
*/
int reportHazRefInfo(Long fInsHazRefId) throws Exception;
/**
* 根据检查记录上传隐患
* @param checkCode
* @return
*/
int reportHazRefInfoByCheckCode(String checkCode) throws Exception;
}
......@@ -13,6 +13,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.sql.SQLIntegrityConstraintViolationException;
......@@ -148,4 +149,28 @@ public class TInsHazRefServiceImpl implements ITInsHazRefService
return 1;
}
/**
* 根据检查记录上传隐患
* @param checkCode
* @return
*/
@Override
public int reportHazRefInfoByCheckCode(String checkCode) throws Exception {
TInsHazRef tInsHazRef = new TInsHazRef();
tInsHazRef.setfCheckCode(checkCode);
List<TInsHazRef> refList = tInsHazRefMapper.selectTInsHazRefList(tInsHazRef);
if(CollectionUtils.isEmpty(refList)) throw new CustomException("该检查记录下未查到关联隐患");
List<TInsHazRefVo> data = new ArrayList<>();
for(TInsHazRef insHazRef : refList){
TInsHazRefVo insHazRefVo = new TInsHazRefVo();
GovernmentDataCopyUtil.copyToGovernData(insHazRef,insHazRefVo);
data.add(insHazRefVo);
}
JSONObject reportResult = governmentDataUtil.setInfo("inspection/record/information","WRITE",data);
log.info("上传监督检查发现隐患及整改、执法结果===================" + reportResult.toJSONString());
if(!"0".equals(reportResult.getString("resultCode"))) throw new CustomException("上传隐患市局接口失败");
return 1;
}
}
......@@ -6,8 +6,10 @@ import com.zehong.common.utils.GovernmentDataCopyUtil;
import com.zehong.common.utils.GovernmentDataUtil;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.SysSetting;
import com.zehong.system.domain.TInsHazRef;
import com.zehong.system.domain.TInsRecInfor;
import com.zehong.system.domain.vo.TInsRecInforVo;
import com.zehong.system.mapper.TInsHazRefMapper;
import com.zehong.system.mapper.TInsRecInforMapper;
import com.zehong.system.service.ISysSettingService;
import com.zehong.system.service.ITInsRecInforService;
......@@ -16,8 +18,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.sql.SQLIntegrityConstraintViolationException;
import java.text.SimpleDateFormat;
import java.time.Year;
import java.util.ArrayList;
......@@ -48,6 +53,9 @@ public class TInsRecInforServiceImpl implements ITInsRecInforService
@Resource
private ITSerialNumberInfoService itSerialNumberInfoService;
@Resource
private TInsHazRefMapper tInsHazRefMapper;
/**
* 查询监督检查-检查记录
*
......@@ -79,6 +87,7 @@ public class TInsRecInforServiceImpl implements ITInsRecInforService
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertTInsRecInfor(TInsRecInfor tInsRecInfor)
{
tInsRecInfor.setfLastUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
......@@ -87,6 +96,12 @@ public class TInsRecInforServiceImpl implements ITInsRecInforService
Map<String,String> num = itSerialNumberInfoService.getSerialNumberByTableType("t_ins_rec_infor");
if(null == num || StringUtils.isEmpty(num.get("f_check_code"))) throw new CustomException("检查记录编码未配置!");
tInsRecInfor.setfCheckCode(code.getSystemValue()+ Year.now().getValue() + num.get("f_check_code"));
if(!CollectionUtils.isEmpty(tInsRecInfor.getRectificationList())){
for(TInsHazRef ref : tInsRecInfor.getRectificationList()){
ref.setfCheckCode(tInsRecInfor.getfCheckCode());
addInsHazRef(ref);
}
}
return tInsRecInforMapper.insertTInsRecInfor(tInsRecInfor);
}
......@@ -97,12 +112,42 @@ public class TInsRecInforServiceImpl implements ITInsRecInforService
* @return 结果
*/
@Override
public int updateTInsRecInfor(TInsRecInfor tInsRecInfor)
{
@Transactional(rollbackFor = Exception.class)
public int updateTInsRecInfor(TInsRecInfor tInsRecInfor){
tInsRecInfor.setfLastUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
if(!CollectionUtils.isEmpty(tInsRecInfor.getRectificationList())){
tInsHazRefMapper.deleteTInsHazRefByCheckCode(tInsRecInfor.getfCheckCode());
for(TInsHazRef ref : tInsRecInfor.getRectificationList()){
ref.setfObjType(tInsRecInfor.getfObjectType());
ref.setfObjCode(tInsRecInfor.getfObjectCode());
ref.setfCheckCode(tInsRecInfor.getfCheckCode());
addInsHazRef(ref);
}
}
return tInsRecInforMapper.updateTInsRecInfor(tInsRecInfor);
}
/**
* 新增隐患
* @param ref
*/
private void addInsHazRef(TInsHazRef ref){
try{
ref.setfLastTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
tInsHazRefMapper.insertTInsHazRef(ref);
}catch (Exception e){
Throwable cause = e.getCause();
if (cause instanceof SQLIntegrityConstraintViolationException){
String errMsg = cause.getMessage();
if (StringUtils.isNotEmpty(errMsg) && errMsg.contains("index_hazard_unique_code")){
throw new CustomException("隐患唯一编码不唯一");
}
}
throw new CustomException("隐患新增失败");
}
}
/**
* 批量删除监督检查-检查记录
*
......
......@@ -44,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fRectificationStatus != null and fRectificationStatus != ''"> and f_rectification_status = #{fRectificationStatus}</if>
<if test="fIsEnforcement != null and fIsEnforcement != ''"> and f_is_enforcement = #{fIsEnforcement}</if>
<if test="fEnforcementType != null and fEnforcementType != ''"> and f_enforcement_type = #{fEnforcementType}</if>
<if test="fCheckCode != null and fCheckCode != ''"> and f_check_code = #{fCheckCode}</if>
</where>
ORDER BY f_last_time DESC
</select>
......@@ -147,4 +148,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{fInsHazRefId}
</foreach>
</delete>
<delete id="deleteTInsHazRefByCheckCode" parameterType="String">
delete from t_ins_haz_ref where f_check_code = #{fCheckCode}
</delete>
</mapper>
\ No newline at end of file
......@@ -71,3 +71,12 @@ export function importTemplate() {
method: 'get'
})
}
// 查询企业所有信息
export function enterpriseListInfo(query) {
return request({
url: '/regulation/info/enterpriseInfoList',
method: 'get',
params: query
})
}
......@@ -60,3 +60,12 @@ export function reportHazRefInfo(query) {
params: query
})
}
//上传隐患
export function reportHazRefInfoByCheckCode(query) {
return request({
url: '/supervision/rectification/reportHazRefInfoByCheckCode',
method: 'get',
params: query
})
}
......@@ -4,6 +4,9 @@
<!-- 检查记录详情 -->
<InspectInfo v-if="detailOpen" :detailInfo="detailInfo"/>
<!-- 隐患管理 -->
<Rectification :fCheckCode="detailInfo.fCheckCode" :readOnly="true" v-if="detailOpen"/>
</el-dialog>
</template>
......@@ -11,6 +14,7 @@
<script>
import { getInfor } from "@/api/supervision/record";
import InspectInfo from "./InspectInfo";
import Rectification from "./Rectification";
export default {
name: "detail-info",
data(){
......@@ -23,6 +27,7 @@
},
components:{
InspectInfo,
Rectification
},
methods:{
getDetailInfo(id){
......
<template>
<el-dialog title="详情" :visible.sync="detailOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="150px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="隐患唯一编码">
<span v-if="detailInfo.fHazardUniqueCode">{{ detailInfo.fHazardUniqueCode }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="自有编号">
<span v-if="detailInfo.fHazardOutUniqueCode">{{ detailInfo.fHazardOutUniqueCode }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检查记录编码">
<span v-if="detailInfo.fCheckCode">{{ detailInfo.fCheckCode }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="涉及供气企业编码">
<span v-if="detailInfo.fInvolveEnterpriseCode">{{ detailInfo.fInvolveEnterpriseCode }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检查对象分类">
<span v-if="detailInfo.fObjType">{{ $parent.fObjTypeFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="对象编码">
<span v-if="detailInfo.fObjCode">{{ detailInfo.fObjCode }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="行政区县级行政区">
<span v-if="detailInfo.fObjBelongRegionId">{{ $parent.countyInfo.find(item =>item.fId = detailInfo.fObjBelongRegionId).fName }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="监督检查时间">
<span v-if="detailInfo.fCheckTime">{{ detailInfo.fCheckTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="隐患分类分级编码">
<span v-if="detailInfo.fHazardTypeLevelId">{{ detailInfo.fHazardTypeLevelId }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="整改状态">
<span v-if="detailInfo.fRectificationStatus">{{ $parent.fRectificationStatusFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="整改资金/万元">
<span v-if="detailInfo.fRectificationFund">{{ detailInfo.fRectificationFund }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="整改完成日期">
<span v-if="detailInfo.fCompletionDate">{{ detailInfo.fCompletionDate }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="整改或管控措施描述">
<span v-if="detailInfo.fControlMeasure">{{ detailInfo.fControlMeasure }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="隐患整改前照片">
<el-image
:src="detailInfo.fBeforePicture"
:preview-src-list="[detailInfo.fBeforePicture]"
v-if="detailInfo.fBeforePicture != '' && detailInfo.fBeforePicture != null"
:z-index=5000
style="width: 200px;height: 200px;"
></el-image>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="隐患整改后照片">
<el-image
:src="detailInfo.fAfterPicture"
:preview-src-list="[detailInfo.fAfterPicture]"
v-if="detailInfo.fAfterPicture != '' && detailInfo.fAfterPicture != null"
:z-index=5000
style="width: 200px;height: 200px;"
></el-image>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否执行">
<span v-if="detailInfo.fIsEnforcement == '1'"></span>
<span v-else-if="detailInfo.fIsEnforcement == '0'"></span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="处罚措施">
<span v-if="detailInfo.fEnforcementType">{{ $parent.fEnforcementTypeFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="处罚金额/万元">
<span v-if="detailInfo.fPenaltyAmount">{{ detailInfo.fPenaltyAmount }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="执法日期">
<span v-if="detailInfo.fPenaltyDate">{{ detailInfo.fPenaltyDate }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="其他执法情况说明">
<span v-if="detailInfo.fPenaltyDesc">{{ detailInfo.fPenaltyDesc }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="更新时间">
<span v-if="detailInfo.fLastTime">{{ detailInfo.fLastTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注">
<span v-if="detailInfo.fRemark">{{ detailInfo.fRemark }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
export default {
name: "ins-ref-detail-info",
data(){
return{
detailInfo: {
fDeleteFlag: 0
},
detailOpen: false
}
}
}
</script>
<style scoped>
</style>
......@@ -89,7 +89,7 @@
<el-table v-loading="loading" :data="inforList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="检查记录编码" align="center" prop="fCheckCode" />
<el-table-column label="检查记录编码" align="center" prop="fCheckCode" width="150"/>
<el-table-column label="任务编码" align="center" prop="fCheckTaskCode" />
<el-table-column label="任务名称" align="center" prop="taskName">
<template slot-scope="scope">
......@@ -107,7 +107,7 @@
<el-table-column label="检查对象分类" align="center" prop="fObjectType"/>
<el-table-column label="对象编码" align="center" prop="fObjectCode" />
<el-table-column label="检查人员姓名" align="center" prop="fCheckManName" />
<el-table-column label="检查人员联系电话" align="center" prop="fCheckManPhone">
<el-table-column label="检查人员联系电话" align="center" prop="fCheckManPhone" width="150">
<template slot-scope="scope">
<span v-if="scope.row.fCheckManPhone">{{ scope.row.fCheckManPhone }}</span>
<span v-else>-</span>
......@@ -151,7 +151,12 @@
size="mini"
type="text"
@click="handleReport(scope.row)"
>上传</el-button>
>上传记录</el-button>
<el-button
size="mini"
type="text"
@click="handleReportHidden(scope.row)"
>上传隐患</el-button>
</template>
</el-table-column>
</el-table>
......@@ -165,7 +170,7 @@
/>
<!-- 添加或修改检查记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row class="el-row-table">
<el-col :span="12">
......@@ -179,7 +184,7 @@
<el-option
v-for="task in taskData"
:key="task.fInsTaskInforId"
:label="task.fName + ' ' +task.fUniqueCode"
:label="task.fName + ' + ' +task.fUniqueCode"
:value="task.fUniqueCode"
/>
</el-select>
......@@ -275,7 +280,7 @@
<el-col :span="12">
<el-form-item label="隐患数量" prop="fHazardsNum">
<el-input v-model="form.fHazardsNum" type="number" placeholder="请输入隐患数量" />
<el-input disabled v-model="form.fHazardsNum" type="number" placeholder="请输入隐患数量" />
</el-form-item>
</el-col>
......@@ -298,14 +303,17 @@
</el-form-item>
</el-col>
<el-col :span="24">
<!--<el-col :span="24">
<el-form-item label="描述" prop="fRemark">
<el-input type="textarea" v-model="form.fRemark" placeholder="请输入描述" />
</el-form-item>
</el-col>
</el-col>-->
</el-row>
<!-- 隐患管理 -->
<Rectification :fCheckCode="form.fCheckCode" v-if="open"/>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
......@@ -329,12 +337,15 @@ import DetailInfo from "./components/DetailInfo";
import { getDefaultCountyList } from "@/api/area/county";
import { getInspectionUsers } from "@/api/system/user";
import TaskInfo from "./components/TaskInfo";
import Rectification from "./components/Rectification";
import { reportHazRefInfoByCheckCode } from "@/api/supervision/rectification";
export default {
name: "Infor",
components: {
ImageUpload,
DetailInfo,
TaskInfo
TaskInfo,
Rectification
},
data() {
return {
......@@ -551,7 +562,6 @@ export default {
this.$refs.detail.getDetailInfo(row.fInsRecInforId);
},
//上传
/** 删除按钮操作 */
handleReport(row) {
this.$confirm('是否确认上传检查记录编码为"' + row.fCheckCode + '"的数据项?', "警告", {
confirmButtonText: "确定",
......@@ -564,6 +574,19 @@ export default {
this.msgSuccess("上传成功");
}).catch(() => {});
},
//上传隐患
handleReportHidden(row){
this.$confirm('是否确认上传检查记录编码为"' + row.fCheckCode + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return reportHazRefInfoByCheckCode({checkCode : row.fCheckCode});
}).then(() => {
this.getList();
this.msgSuccess("上传隐患成功");
}).catch(() => {});
},
taskChange(val){
const selectTask = this.taskData.find(item => item.fUniqueCode == val);
this.taskName = selectTask.fName;
......
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