dev_xds
姜玉琦 2023-09-21 23:17:26 +08:00
commit b842ee2035
12 changed files with 1345 additions and 2 deletions

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询标准化管理列表
export function listProjectStandard(query) {
return request({
url: '/project/projectStandard/list',
method: 'get',
params: query
})
}
// 查询标准化管理详细
export function getProjectStandard(id) {
return request({
url: '/project/projectStandard/' + id,
method: 'get'
})
}
// 新增标准化管理
export function addProjectStandard(data) {
return request({
url: '/project/projectStandard',
method: 'post',
data: data
})
}
// 修改标准化管理
export function updateProjectStandard(data) {
return request({
url: '/project/projectStandard',
method: 'put',
data: data
})
}
// 删除标准化管理
export function delProjectStandard(id) {
return request({
url: '/project/projectStandard/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,314 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="项目ID" prop="projectId">
<el-input
v-model="queryParams.projectId"
placeholder="请输入项目ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="总包单位" prop="deptId">
<el-input
v-model="queryParams.deptId"
placeholder="请输入总包单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="图片描述" prop="desc">
<el-input
v-model="queryParams.desc"
placeholder="请输入图片描述"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="排序" prop="ord">
<el-input
v-model="queryParams.ord"
placeholder="请输入排序"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="${comment}" prop="isDel">
<el-input
v-model="queryParams.isDel"
placeholder="请输入${comment}"
clearable
@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>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['project:projectStandard:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['project:projectStandard:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['project:projectStandard:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['project:projectStandard:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="projectStandardList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="${comment}" align="center" prop="id" />
<el-table-column label="项目ID" align="center" prop="projectId" />
<el-table-column label="总包单位" align="center" prop="deptId" />
<el-table-column label="图片路径" align="center" prop="imageFile" />
<el-table-column label="图片描述" align="center" prop="standardDesc" />
<el-table-column label="排序" align="center" prop="ord" />
<el-table-column label="类型1、现场管理标准化2、作业标准化3、安全技术标准化4、设备管理标准化5、文明施工标准化6、环境保护标准化" align="center" prop="standardType" />
<el-table-column label="${comment}" align="center" prop="isDel" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['project:projectStandard:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['project:projectStandard:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改标准化管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="项目ID" prop="projectId">
<el-input v-model="form.projectId" placeholder="请输入项目ID" />
</el-form-item>
<el-form-item label="总包单位" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入总包单位" />
</el-form-item>
<el-form-item label="图片路径" prop="imageFile">
<file-upload v-model="form.imageFile"/>
</el-form-item>
<el-form-item label="图片描述" prop="standardDesc">
<el-input v-model="form.standardDesc" placeholder="请输入图片描述" />
</el-form-item>
<el-form-item label="排序" prop="ord">
<el-input v-model="form.ord" placeholder="请输入排序" />
</el-form-item>
<el-form-item label="${comment}" prop="isDel">
<el-input v-model="form.isDel" placeholder="请输入${comment}" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listProjectStandard, getProjectStandard, delProjectStandard, addProjectStandard, updateProjectStandard } from "@/api/project/projectStandard";
export default {
name: "ProjectStandard",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
projectStandardList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: null,
deptId: null,
imageFile: null,
standardDesc: null,
ord: null,
standardType: null,
isDel: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询标准化管理列表 */
getList() {
this.loading = true;
listProjectStandard(this.queryParams).then(response => {
this.projectStandardList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
projectId: null,
deptId: null,
imageFile: null,
desc: null,
ord: null,
standardType: null,
isDel: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加标准化管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getProjectStandard(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改标准化管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateProjectStandard(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addProjectStandard(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除标准化管理编号为"' + ids + '"的数据项?').then(function() {
return delProjectStandard(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('project/projectStandard/export', {
...this.queryParams
}, `projectStandard_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,136 @@
<template>
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body custom-class="project-standard-dlg">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="项目名称:">
{{ prj.projectName }}
</el-form-item>
<el-form-item label="总包单位:">
{{ dept.deptName }}
</el-form-item>
<el-form-item label="类型:" prop="standardType" style="margin-bottom: 16px;">
<el-select v-model="form.standardType" required clearable placeholder="请选择" @change="clearForm">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<div v-if="form.standardType" class="div-tip">
<div v-if="form.standardType == 1">
现场管理标准化是指在施工现场中通过科学的管理方法和规范化的操作流程严格控制现场人员的行为保证施工现场的安全和有序进行具体来说现场管理标准化包括制定现场管理制度落实安全生产责任制开展安全教育培训建立安全监控系统等
</div>
<div v-if="form.standardType == 2">
作业标准化是指在施工现场中通过规范作业流程和操作规程保证施工过程中的安全和质量具体来说作业标准化包括制定作业指导书明确作业流程规范操作规程建立作业记录等</div>
<div v-if="form.standardType == 3">
安全技术标准化是指在施工现场中通过科学的安全技术手段和规范化的操作方法保证施工现场的安全具体来说安全技术标准化包括制定安全技术规范落实安全技术措施开展安全技术培训建立安全技术档案等</div>
<div v-if="form.standardType == 4">
设备管理标准化是指在施工现场中通过规范设备的使用和维护保证设备的正常运行和安全使用具体来说设备管理标准化包括制定设备使用规范落实设备维护责任制开展设备维护培训建立设备维护记录等</div>
<div v-if="form.standardType == 5">
文明施工标准化是指在施工现场中通过规范施工行为和文明施工保证施工现场的整洁有序和安全具体来说文明施工标准化包括制定文明施工规范落实文明施工责任制开展文明施工培训建立文明施工记录等</div>
<div v-if="form.standardType == 6">
环境保护标准化是指在施工现场中通过科学的环保措施和规范化的操作方法保护环境和自然资源具体来说环境保护标准化包括制定环境保护规范落实环境保护责任制开展环境保护培训建立环境保护记录等</div>
</div>
<el-form-item label="图片描述" prop="desc" style="margin-bottom: 16px;">
<el-input v-model="form.desc" placeholder="请输入图片描述" type="textarea" :row="4" @input="clearForm" />
</el-form-item>
<el-form-item label="图片路径" prop="imageFile">
<file-upload v-model="form.imageFile" @input="clearForm" :fileSize="5" :fileType="['png', 'jpg', 'jpeg']"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {addProjectStandard} from '@/api/project/projectStandard.js'
export default {
name: 'RuoyiUiProjectStandardDlg',
data() {
return {
open: false,
title: "添加标准化管理",
prj: {},
dept: {},
form: {
standardType: 1,
desc:'',
imageFile:[]
},
rules: {
standardType: [{ required: true, trigger: "blur", message: "请选择" }],
desc: [{ required: true, trigger: "blur", message: "请输入图片描述" }],
imageFile: [{ required: true, trigger: "blur", message: "请上传图片" }],
},
options: [
{ label: '现场管理标准化', value: 1 },
{ label: '作业标准化', value: 2 },
{ label: '安全技术标准化', value: 3 },
{ label: '设备管理标准化', value: 4 },
{ label: '文明施工标准化', value: 5 },
{ label: '环境保护标准化', value: 6 },
]
};
},
methods: {
clearForm(){
this.$refs.form.clearValidate();
},
submitForm() {
this.$refs.form.validate(v => {
if(v){
this.doSave();
}
});
},
doSave(){
let postData={
projectId:this.prj.id,
deptId:this.dept.deptId,
imageFile:this.form.imageFile.map(d=>d.url).filter(d=>d).join(","),
standardDesc:this.form.desc,
standardType:this.form.standardType
}
addProjectStandard(postData).then(d=>{
if (d.code == 200) {
this.$message({
message: '增加成功',
type: 'success'
});
this.$emit("success");
this.open=false;
}
});
},
cancel() {
this.open = false;
},
showDialog(prj, dept) {
this.prj = prj || {};
this.dept = dept || {};
this.open = true;
}
},
};
</script>
<style lang="scss">
.project-standard-dlg {
.el-dialog__body {
padding: 12px;
.el-form-item {
margin-bottom: 8px;
}
.div-tip {
color: #13ce66;
padding: 0px 20px 0px 40px;
line-height: 24px;
}
}
}</style>

View File

@ -0,0 +1,239 @@
<template>
<div class="project-standar-drawer" v-if="isOpen">
<el-drawer v-if="isOpen" :visible.sync="isOpen" direction="rtl" size="60%" style="padding-left: 20px">
<template slot="title">
<div>{{ title + " 【标准化管理】" }}</div>
<right-toolbar @queryTable="loadData" :search="false">
<template slot="left">
</template>
</right-toolbar>
</template>
<el-tabs v-model="activeName" :key="elKey">
<el-tab-pane :label="'' + it.deptName" :name="'' + it.deptId" :key="idx" v-for="(it, idx) in depts">
<div>
<el-button type="primary" @click="doAdd"></el-button>
<el-button style="margin-right:12px;">删除</el-button>
<el-select v-model="standType" clearable placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-button type="success" style="margin-left:12px;" @click="doQuery"></el-button>
</div>
<div class="div-data">
<el-table v-loading="loading" :data="projectStandardList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="图片路径" align="center" prop="imageFile">
<template slot-scope="{row}">
<el-image :src="row.imageFile+'.min.jpg'" style="height:50px" :preview-src-list="[row.imageFile]" />
</template>
</el-table-column>
<el-table-column label="图片描述" align="center" prop="desc">
<template slot-scope="{row,$index}">
<div class="row-desc" @click="changeEditMode(row,$index)" v-if="!row.editDesc">{{row.standardDesc}}</div>
<el-input v-model="row.standardDesc" v-if="row.editDesc" @blur="doSaveDesc(row)" type="textarea" :row="4" ></el-input>
</template>
</el-table-column>
<el-table-column label="排序" align="center" prop="ord" >
<template slot-scope="{row}">
<el-input-number v-model="row.ord" controls-position="right" @change="doSave(row,false)" :min="1" :max="10000" ></el-input-number>
</template>
</el-table-column>
<el-table-column label="类型" align="center" prop="standardType">
<template slot-scope="{row}">{{ getType(row) }}</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['project:projectStandard:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="loadData" />
</div>
</el-tab-pane>
</el-tabs>
</el-drawer>
<standardDlg ref="dlg" @success="loadData"></standardDlg>
</div>
</template>
<script>
import { listProjectStandard,updateProjectStandard } from '@/api/project/projectStandard.js'
import standardDlg from './projectStandardDlg.vue'
export default {
components: {
standardDlg
},
data() {
return {
elKey: 0,
isOpen: false,
prj: null,
//
ids: [],
//
single: true,
//
multiple: true,
total: 0,
activeName: "",
depts: [],
standType: '',
projectStandardList: [],
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: null,
deptId: null,
imageFile: null,
standardDesc: null,
ord: null,
standardType: null,
isDel: null,
},
options: [
{ label: '现场管理标准化', value: 1 },
{ label: '作业标准化', value: 2 },
{ label: '安全技术标准化', value: 3 },
{ label: '设备管理标准化', value: 4 },
{ label: '文明施工标准化', value: 5 },
{ label: '环境保护标准化', value: 6 },
]
};
},
mounted() {
},
methods: {
doSaveDesc(row){
if(row.oldStandardDesc!=row.standardDesc){
this.doSave(row,true);
row.oldStandardDesc=row.standardDesc;
row.editDesc=false;
}
},
doSave(row,showMsg){
updateProjectStandard(row).then(d=>{
if(d.code==200){
if(showMsg){
this.$message({
message: '修改成功',
type: 'success'
});
}
}
});
},
changeEditMode(row,idx){
row.oldStandardDesc=row.standardDesc;
row.editDesc=true;
setTimeout(()=>{
let els=document.querySelectorAll(".el-table__body-wrapper tr");
if(els.length>idx+1){
let el=els[idx].querySelector(".el-textarea__inner");
if(el){
el.focus();
}
}
},400);
},
doQuery(){
this.queryParams.pageNum=1;
this.loadData();
},
getType(row){
let t=row.standardType||1;
let tmps=this.options.filter(d=>d.value==t);
return tmps.length>0?tmps[0].label:'';
},
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
doAdd() {
let tmps = this.depts.filter(d => d.deptId == this.activeName);
this.$refs.dlg.showDialog(this.prj, tmps.length > 0 ? tmps[0] : {});
},
loadDepts(cb) {
let tmps = this.$root.prjDept2 && this.$root.prjDept2[this.prj.id] ? this.$root.prjDept2[this.prj.id] || [] : [];
if (tmps.length > 0) {
this.depts = tmps;
if (tmps.length > 0) {
this.activeName = tmps[0].deptId + "";
}
this.elKey++;
cb && cb();
return;
}
this.$api.publics.queryUnitList({
projectId: this.prj.id,
unitTypes: "2".split(","),
}).then((d) => {
let objs = d.rows || [];
if (!this.$root.prjDept2) {
this.$root.prjDept2 = {};
}
this.$root.prjDept2[this.prj.id] = objs;
this.depts = objs;
if (objs.length > 0) {
this.activeName = objs[0].deptId + "";
}
this.elKey++;
cb && cb();
});
},
loadData() {
let tmps = this.depts.filter(d => d.deptId == this.activeName);
this.queryParams.projectId = this.prj.id;
this.queryParams.deptId=tmps.length>0?tmps[0].deptId:null;
this.queryParams.standardType = this.standType ? this.standType : null;
this.loading = true;
listProjectStandard(this.queryParams).then(response => {
this.projectStandardList = (response.rows||[]).map(it=>{
it.editDesc=false;
return it;
});
this.total = response.total;
this.loading = false;
});
},
show(prj) {
this.prj = prj;
this.title = prj.projectName;
this.isOpen = true;
this.loadDepts(()=>{
this.loadData(true);
});
},
},
};
</script>
<style lang="scss" scoped>
.project-standar-drawer {
::v-deep .el-drawer__header {
margin-bottom: 0px;
}
::v-deep .el-drawer__body {
padding: 0px 24px;
.el-tabs__content{
padding-bottom: 10px;
.el-input-number--medium{
width:100px;
}
.row-desc{
cursor: pointer;
}
}
}
}
</style>

View File

@ -376,6 +376,7 @@
'video:videoConfig:list',
'project:checkDetection:list',
'project:costOutput:edit',
'project:projectStandard:edit',
'project:surProject:remove',
]"
>
@ -467,6 +468,12 @@
v-hasPermi="['project:costOutput:edit']"
>项目成本产值管理</el-dropdown-item
>
<el-dropdown-item
command="handleStandard"
icon="el-icon-s-grid"
v-hasPermi="['project:projectStandard:list']"
>标准化管理</el-dropdown-item
>
<el-dropdown-item
command="handleDelete"
icon="el-icon-delete"
@ -749,6 +756,7 @@
<videoConfigDrawer ref="videoConfig"></videoConfigDrawer>
<costOutputDrawer ref="costOutput"></costOutputDrawer>
<checkDetectionDrawer ref="checkDetection"></checkDetectionDrawer>
<standardDrawer ref="standard"></standardDrawer>
</div>
</template>
@ -779,6 +787,7 @@ import projectMeasureDrawer from "../projectMeasure/projectMeasureDrawer.vue";
import videoConfigDrawer from "@/views/video/videoConfig/videoConfigDrawer";
import costOutputDrawer from "@/views/project/costOutput/costOutputDrawer.vue";
import checkDetectionDrawer from "../checkDetection/checkDetectionDrawer.vue";
import standardDrawer from '@/views/project/projectStandard/projectStandardDrawer.vue'
import { checkPermi, checkRole } from "@/utils/permission"; //
export default {
@ -801,6 +810,7 @@ export default {
videoConfigDrawer,
costOutputDrawer,
checkDetectionDrawer,
standardDrawer
},
dicts: [
"sur_project_xmjd",
@ -1053,6 +1063,9 @@ export default {
case "handleCheckDetection":
this.$refs.checkDetection.show(row);
break;
case "handleStandard":
this.$refs.standard.show(row);
break;
default:
break;
}

View File

@ -150,6 +150,8 @@
icon="el-icon-s-check">今日出勤</el-button>
<el-button type="primary" @click="doPrjCostOutput" v-hasPermi="['project:costOutput:edit']"
icon="el-icon-money">项目成本产值管理</el-button>
<el-button type="primary" @click="doPrjStandard" v-hasPermi="['project:projectStandard:list']"
icon="el-icon-s-grid">标准化管理</el-button>
</div>
@ -159,6 +161,7 @@
<attendance-drawer ref="attDrawer"></attendance-drawer>
<projectUserInfoDrawer ref="prjUser" size="50%" :visible.sync="showPrjUser" :form-data="prj"/>
<costOutputDrawer ref="costOutput"></costOutputDrawer>
<standardDrawer ref="standard"></standardDrawer>
</div>
</template>
@ -171,6 +174,7 @@ import AssessDrawer from "../surProjectQuarterlyAssess/assessDrawer.vue";
import buildNodeDrawer from "../surBuildNode/buildNodeDrawer.vue";
import attendanceDrawer from "../surProjectAttendance/attendanceDrawer.vue";
import costOutputDrawer from '@/views/project/costOutput/costOutputDrawer.vue'
import standardDrawer from '@/views/project/projectStandard/projectStandardDrawer.vue'
export default {
dicts: [
@ -188,7 +192,8 @@ export default {
buildNodeDrawer,
attendanceDrawer,
projectUserInfoDrawer,
costOutputDrawer
costOutputDrawer,
standardDrawer
},
data() {
return {
@ -227,6 +232,9 @@ export default {
}
});
},
doPrjStandard(){
this.$refs.standard.show(this.prj);
},
doPrjCostOutput(){
this.$refs.costOutput.show(this.prj);
},
@ -311,8 +319,13 @@ export default {
box-shadow: 5px 5px 7px 4px rgba(0, 0, 0, 0.3);
margin-top: 24px;
overflow: auto;
padding: 12px;
padding: 12px 12px 0px ;
line-height: 32px;
.el-button{
margin-bottom: 12px;
margin-left: 0px;
margin-right: 12px;
}
}
}
</style>

View File

@ -0,0 +1,104 @@
package com.yanzhu.jh.project.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.yanzhu.jh.project.domain.SurProjectStandard;
import com.yanzhu.jh.project.service.ISurProjectStandardService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-09-19
*/
@RestController
@RequestMapping("/project/projectStandard")
public class SurProjectStandardController extends BaseController
{
@Autowired
private ISurProjectStandardService surProjectStandardService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:projectStandard:list')")
@GetMapping("/list")
public TableDataInfo list(SurProjectStandard surProjectStandard)
{
startPage();
List<SurProjectStandard> list = surProjectStandardService.selectSurProjectStandardList(surProjectStandard);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:projectStandard:export')")
@Log(title = "标准化管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SurProjectStandard surProjectStandard)
{
List<SurProjectStandard> list = surProjectStandardService.selectSurProjectStandardList(surProjectStandard);
ExcelUtil<SurProjectStandard> util = new ExcelUtil<SurProjectStandard>(SurProjectStandard.class);
util.exportExcel(response, list, "标准化管理数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:projectStandard:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(surProjectStandardService.selectSurProjectStandardById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:projectStandard:add')")
@Log(title = "标准化管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SurProjectStandard surProjectStandard)
{
return toAjax(surProjectStandardService.insertSurProjectStandards(surProjectStandard));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:projectStandard:edit')")
@Log(title = "标准化管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SurProjectStandard surProjectStandard)
{
return toAjax(surProjectStandardService.updateSurProjectStandard(surProjectStandard));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:projectStandard:remove')")
@Log(title = "标准化管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(surProjectStandardService.deleteSurProjectStandardByIds(ids));
}
}

View File

@ -0,0 +1,139 @@
package com.yanzhu.jh.project.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* sur_project_standard
*
* @author ruoyi
* @date 2023-09-19
*/
public class SurProjectStandard extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** */
private Long id;
/** 项目ID */
@Excel(name = "项目ID")
private Long projectId;
/** 总包单位 */
@Excel(name = "总包单位")
private Long deptId;
/** 图片路径 */
@Excel(name = "图片路径")
private String imageFile;
/** 图片描述 */
@Excel(name = "图片描述")
private String standardDesc;
/** 排序 */
@Excel(name = "排序")
private Long ord;
/** 类型1、现场管理标准化2、作业标准化3、安全技术标准化4、设备管理标准化5、文明施工标准化6、环境保护标准化 */
@Excel(name = "类型1、现场管理标准化2、作业标准化3、安全技术标准化4、设备管理标准化5、文明施工标准化6、环境保护标准化")
private String standardType;
/** */
@Excel(name = "")
private Long isDel;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setProjectId(Long projectId)
{
this.projectId = projectId;
}
public Long getProjectId()
{
return projectId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setImageFile(String imageFile)
{
this.imageFile = imageFile;
}
public String getImageFile()
{
return imageFile;
}
public void setStandardDesc(String standardDesc)
{
this.standardDesc = standardDesc;
}
public String getStandardDesc()
{
return standardDesc;
}
public void setOrd(Long ord)
{
this.ord = ord;
}
public Long getOrd()
{
return ord;
}
public void setStandardType(String standardType)
{
this.standardType = standardType;
}
public String getStandardType()
{
return standardType;
}
public void setIsDel(Long isDel)
{
this.isDel = isDel;
}
public Long getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("projectId", getProjectId())
.append("deptId", getDeptId())
.append("imageFile", getImageFile())
.append("standardDesc", getStandardDesc())
.append("ord", getOrd())
.append("standardType", getStandardType())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.yanzhu.jh.project.mapper;
import java.util.List;
import com.yanzhu.jh.project.domain.SurProjectStandard;
/**
* Mapper
*
* @author ruoyi
* @date 2023-09-19
*/
public interface SurProjectStandardMapper
{
/**
*
*
* @param id
* @return
*/
public SurProjectStandard selectSurProjectStandardById(Long id);
/**
*
*
* @param surProjectStandard
* @return
*/
public List<SurProjectStandard> selectSurProjectStandardList(SurProjectStandard surProjectStandard);
/**
*
*
* @param surProjectStandard
* @return
*/
public int insertSurProjectStandard(SurProjectStandard surProjectStandard);
/**
*
*
* @param surProjectStandard
* @return
*/
public int updateSurProjectStandard(SurProjectStandard surProjectStandard);
/**
*
*
* @param id
* @return
*/
public int deleteSurProjectStandardById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteSurProjectStandardByIds(Long[] ids);
}

View File

@ -0,0 +1,63 @@
package com.yanzhu.jh.project.service;
import java.util.List;
import com.yanzhu.jh.project.domain.SurProjectStandard;
/**
* Service
*
* @author ruoyi
* @date 2023-09-19
*/
public interface ISurProjectStandardService
{
/**
*
*
* @param id
* @return
*/
public SurProjectStandard selectSurProjectStandardById(Long id);
/**
*
*
* @param surProjectStandard
* @return
*/
public List<SurProjectStandard> selectSurProjectStandardList(SurProjectStandard surProjectStandard);
/**
*
*
* @param surProjectStandard
* @return
*/
public int insertSurProjectStandard(SurProjectStandard surProjectStandard);
/**
*
*
* @param surProjectStandard
* @return
*/
public int updateSurProjectStandard(SurProjectStandard surProjectStandard);
/**
*
*
* @param ids
* @return
*/
public int deleteSurProjectStandardByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteSurProjectStandardById(Long id);
public int insertSurProjectStandards(SurProjectStandard surProjectStandard);
}

View File

@ -0,0 +1,114 @@
package com.yanzhu.jh.project.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.jh.project.mapper.SurProjectStandardMapper;
import com.yanzhu.jh.project.domain.SurProjectStandard;
import com.yanzhu.jh.project.service.ISurProjectStandardService;
import com.ruoyi.common.utils.SecurityUtils;
/**
* Service
*
* @author ruoyi
* @date 2023-09-19
*/
@Service
public class SurProjectStandardServiceImpl implements ISurProjectStandardService
{
@Autowired
private SurProjectStandardMapper surProjectStandardMapper;
/**
*
*
* @param id
* @return
*/
@Override
public SurProjectStandard selectSurProjectStandardById(Long id)
{
return surProjectStandardMapper.selectSurProjectStandardById(id);
}
/**
*
*
* @param surProjectStandard
* @return
*/
@Override
public List<SurProjectStandard> selectSurProjectStandardList(SurProjectStandard surProjectStandard)
{
return surProjectStandardMapper.selectSurProjectStandardList(surProjectStandard);
}
/**
*
*
* @param surProjectStandard
* @return
*/
@Override
public int insertSurProjectStandard(SurProjectStandard surProjectStandard)
{
surProjectStandard.setCreateBy(SecurityUtils.getUsername());
surProjectStandard.setCreateTime(DateUtils.getNowDate());
return surProjectStandardMapper.insertSurProjectStandard(surProjectStandard);
}
/**
*
*
* @param surProjectStandard
* @return
*/
@Override
public int updateSurProjectStandard(SurProjectStandard surProjectStandard)
{
surProjectStandard.setUpdateBy(SecurityUtils.getUsername());
surProjectStandard.setUpdateTime(DateUtils.getNowDate());
return surProjectStandardMapper.updateSurProjectStandard(surProjectStandard);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteSurProjectStandardByIds(Long[] ids)
{
return surProjectStandardMapper.deleteSurProjectStandardByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteSurProjectStandardById(Long id)
{
return surProjectStandardMapper.deleteSurProjectStandardById(id);
}
@Override
public int insertSurProjectStandards(SurProjectStandard surProjectStandard) {
String imgFile=surProjectStandard.getImageFile();
surProjectStandard.setOrd(1l);
String[] images=imgFile.split(",");
int n=0;
for(String img :images){
if(Strings.isNotEmpty(img)){
surProjectStandard.setImageFile(img);
n+=insertSurProjectStandard(surProjectStandard);
}
}
return n;
}
}

View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yanzhu.jh.project.mapper.SurProjectStandardMapper">
<resultMap type="SurProjectStandard" id="SurProjectStandardResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="deptId" column="dept_id" />
<result property="imageFile" column="image_file" />
<result property="standardDesc" column="standard_desc" />
<result property="ord" column="ord" />
<result property="standardType" column="standard_type" />
<result property="isDel" column="is_del" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectSurProjectStandardVo">
select id, project_id, dept_id, image_file, standard_desc, ord, standard_type, is_del, create_by, create_time, update_by, update_time from sur_project_standard
</sql>
<select id="selectSurProjectStandardList" parameterType="SurProjectStandard" resultMap="SurProjectStandardResult">
<include refid="selectSurProjectStandardVo"/>
<where>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="imageFile != null and imageFile != ''"> and image_file = #{imageFile}</if>
<if test="standardDesc != null and standardDesc != ''"> and standard_desc = #{standardDesc}</if>
<if test="ord != null "> and ord = #{ord}</if>
<if test="standardType != null and standardType != ''"> and standard_type = #{standardType}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
order by standard_type,ord
</select>
<select id="selectSurProjectStandardById" parameterType="Long" resultMap="SurProjectStandardResult">
<include refid="selectSurProjectStandardVo"/>
where id = #{id}
</select>
<insert id="insertSurProjectStandard" parameterType="SurProjectStandard" useGeneratedKeys="true" keyProperty="id">
insert into sur_project_standard
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectId != null">project_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="imageFile != null">image_file,</if>
<if test="standardDesc != null">standard_desc,</if>
<if test="ord != null">ord,</if>
<if test="standardType != null">standard_type,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectId != null">#{projectId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="imageFile != null">#{imageFile},</if>
<if test="standardDesc != null">#{standardDesc},</if>
<if test="ord != null">#{ord},</if>
<if test="standardType != null">#{standardType},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateSurProjectStandard" parameterType="SurProjectStandard">
update sur_project_standard
<trim prefix="SET" suffixOverrides=",">
<if test="projectId != null">project_id = #{projectId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="imageFile != null">image_file = #{imageFile},</if>
<if test="standardDesc != null">standard_desc = #{standardDesc},</if>
<if test="ord != null">ord = #{ord},</if>
<if test="standardType != null">standard_type = #{standardType},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSurProjectStandardById" parameterType="Long">
delete from sur_project_standard where id = #{id}
</delete>
<delete id="deleteSurProjectStandardByIds" parameterType="String">
delete from sur_project_standard where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>