Commit 378719b8 authored by 耿迪迪's avatar 耿迪迪

上传检查记录及上传隐患

parent c5976ac2
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("上传隐患接口异常");
}
}
}
......@@ -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;
}
}
......@@ -60,3 +60,12 @@ export function reportHazRefInfo(query) {
params: query
})
}
//上传隐患
export function reportHazRefInfoByCheckCode(query) {
return request({
url: '/supervision/rectification/reportHazRefInfoByCheckCode',
method: 'get',
params: query
})
}
......@@ -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>
......@@ -333,6 +338,7 @@ 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: {
......@@ -556,7 +562,6 @@ export default {
this.$refs.detail.getDetailInfo(row.fInsRecInforId);
},
//上传
/** 删除按钮操作 */
handleReport(row) {
this.$confirm('是否确认上传检查记录编码为"' + row.fCheckCode + '"的数据项?', "警告", {
confirmButtonText: "确定",
......@@ -569,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