Compare commits

..

No commits in common. "ae19c4189141c89ed28c3249843129a5584f7490" and "4e0dc26ff024ff1ebc19a5381aef91761f0fd4e3" have entirely different histories.

10 changed files with 195 additions and 247 deletions

View File

@ -385,8 +385,7 @@
command="handleAssess" command="handleAssess"
icon="el-icon-coordinate" icon="el-icon-coordinate"
v-hasPermi="['project:assess:list']" v-hasPermi="['project:assess:list']"
>季度考核管理</el-dropdown-item >季度考核管理</el-dropdown-item>
>
<el-dropdown-item <el-dropdown-item
command="handleBuildNode" command="handleBuildNode"
icon="el-icon-data-analysis" icon="el-icon-data-analysis"
@ -457,14 +456,13 @@
command="handleCostOutput" command="handleCostOutput"
icon="el-icon-money" icon="el-icon-money"
v-hasPermi="['project:costOutput:edit']" v-hasPermi="['project:costOutput:edit']"
>项目成本产值管理</el-dropdown-item >项目成本产值管理</el-dropdown-item>
>
<el-dropdown-item <el-dropdown-item
command="handleDelete" command="handleDelete"
icon="el-icon-delete" icon="el-icon-delete"
v-hasPermi="['project:surProject:remove']" v-hasPermi="['project:surProject:remove']"
>删除项目</el-dropdown-item >删除项目</el-dropdown-item>
>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
@ -779,9 +777,21 @@
<assess-drawer ref="assessDrawer"></assess-drawer> <assess-drawer ref="assessDrawer"></assess-drawer>
<baidu-map ref="map" @success="mapSuccess"></baidu-map> <baidu-map ref="map" @success="mapSuccess"></baidu-map>
<build-node-drawer ref="nodeDrawer"></build-node-drawer> <build-node-drawer ref="nodeDrawer"></build-node-drawer>
<workTrainDrawer ref="workTrainDrawer"></workTrainDrawer> <workTrainDrawer
<emergencyDrillDrawer ref="emergencyDrillDrawer"></emergencyDrillDrawer> size="50%"
<surProjectSpecialDrawer ref="projectSpecial"></surProjectSpecialDrawer> :visible.sync="workTrainDrawerVisible"
:form-data="formData"
></workTrainDrawer>
<emergencyDrillDrawer
size="50%"
:visible.sync="emergencyDrillDrawerVisible"
:form-data="formData"
></emergencyDrillDrawer>
<surProjectSpecialDrawer
size="50%"
:visible.sync="projectSpecialDrawerVisible"
:form-data="formData"
></surProjectSpecialDrawer>
<attendance-drawer ref="attDrawer"></attendance-drawer> <attendance-drawer ref="attDrawer"></attendance-drawer>
<projectDeptWroksDrawer ref="deptWroksDrawer"></projectDeptWroksDrawer> <projectDeptWroksDrawer ref="deptWroksDrawer"></projectDeptWroksDrawer>
<insuranceDrawer ref="insurance"></insuranceDrawer> <insuranceDrawer ref="insurance"></insuranceDrawer>
@ -818,7 +828,7 @@ import projectCheckingDrawer from "../projectChecking/projectCheckingDrawer.vue"
import materialSealDrawer from "@/views/project/materialSeal/projectMaterialSealDrawer.vue"; import materialSealDrawer from "@/views/project/materialSeal/projectMaterialSealDrawer.vue";
import projectMeasureDrawer from "../projectMeasure/projectMeasureDrawer.vue"; import projectMeasureDrawer from "../projectMeasure/projectMeasureDrawer.vue";
import videoConfigDrawer from "@/views/video/videoConfig/videoConfigDrawer"; import videoConfigDrawer from "@/views/video/videoConfig/videoConfigDrawer";
import costOutputDrawer from "@/views/project/costOutput/costOutputDrawer.vue"; import costOutputDrawer from '@/views/project/costOutput/costOutputDrawer.vue'
import { checkPermi, checkRole } from "@/utils/permission"; // import { checkPermi, checkRole } from "@/utils/permission"; //
export default { export default {
@ -839,7 +849,7 @@ export default {
materialSealDrawer, materialSealDrawer,
projectMeasureDrawer, projectMeasureDrawer,
videoConfigDrawer, videoConfigDrawer,
costOutputDrawer, costOutputDrawer
}, },
dicts: [ dicts: [
"sys_check_state", "sys_check_state",
@ -853,6 +863,8 @@ export default {
data() { data() {
return { return {
projectUserInfoDrawerVisible: false, projectUserInfoDrawerVisible: false,
workTrainDrawerVisible: false,
emergencyDrillDrawerVisible: false,
projectSpecialDrawerVisible: false, projectSpecialDrawerVisible: false,
// //
loading: true, loading: true,
@ -1058,13 +1070,13 @@ export default {
this.$refs.nodeDrawer.show(row); this.$refs.nodeDrawer.show(row);
break; break;
case "handleWorkTrain": case "handleWorkTrain":
this.$refs.workTrainDrawer.show(row); this.handleWorkTrain(row);
break; break;
case "handleEmergencyDrill": case "handleEmergencyDrill":
this.$refs.emergencyDrillDrawer.show(row); this.handleEmergencyDrill(row);
break; break;
case "handleProjectSpecial": case "handleProjectSpecial":
this.$refs.projectSpecial.show(row); this.handleProjectSpecial(row);
break; break;
case "handleProjectDeptWroks": case "handleProjectDeptWroks":
this.$refs.deptWroksDrawer.show(row); this.$refs.deptWroksDrawer.show(row);
@ -1188,6 +1200,16 @@ export default {
this.getList(); this.getList();
}); });
}, },
handleWorkTrain(row) {
this.formData.projectId = row.id;
this.formData.projectName = row.projectName;
this.workTrainDrawerVisible = true;
},
handleEmergencyDrill(row) {
this.formData.projectId = row.id;
this.formData.projectName = row.projectName;
this.emergencyDrillDrawerVisible = true;
},
handleProjectSpecial(row) { handleProjectSpecial(row) {
this.formData.projectId = row.id; this.formData.projectId = row.id;
this.formData.projectName = row.projectName; this.formData.projectName = row.projectName;

View File

@ -1,27 +1,13 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-drawer <el-drawer
v-bind="$attrs"
v-if="onOpen" v-if="onOpen"
:visible.sync="onOpen" v-on="$listeners"
direction="rtl" @opened="onOpen"
size="60%" @close="onClose"
style="padding-left: 20px" style="padding-left: 20px"
> >
<template slot="title">
<div>{{ drawerTitle + " 【特种人员管理】" }}</div>
</template>
<el-tabs
v-model="unitActiveName"
style="margin-left: 20px; margin-right: 20px"
@tab-click="getList"
>
<el-tab-pane
v-for="(it, idx) in nodes"
:label="it.unitName + ''"
:name="it.unitId + ''"
:key="idx"
></el-tab-pane>
</el-tabs>
<el-row <el-row
:gutter="10" :gutter="10"
class="mb8" class="mb8"
@ -311,7 +297,12 @@ export default {
components: { components: {
ElImageViewer, ElImageViewer,
}, },
props: {}, props: {
formData: {
projectId: String,
projectName: String,
},
},
dicts: ["sys_user_sex", "project_special_type"], dicts: ["sys_user_sex", "project_special_type"],
data() { data() {
return { return {
@ -339,7 +330,6 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
projectId: null, projectId: null,
deptId: null,
activeName: null, activeName: null,
}, },
// //
@ -386,15 +376,17 @@ export default {
wgq: "未过期0", wgq: "未过期0",
ygq: "已过期0", ygq: "已过期0",
}, },
project: null,
nodes: [],
unitActiveName: "",
onOpen: false,
drawerTitle: "",
}; };
}, },
computed: {}, computed: {},
watch: {}, watch: {
formData: {
handler(value) {
this.formData = value;
},
immediate: true,
},
},
created() {}, created() {},
mounted() {}, mounted() {},
beforeDestroy() {}, beforeDestroy() {},
@ -431,37 +423,23 @@ export default {
this.rules.credentialExpirationTime[0].required = false; this.rules.credentialExpirationTime[0].required = false;
} }
}, },
show(project) { onOpen() {
this.project = project; this.queryParams.activeName = this.activeName;
this.drawerTitle = project.projectName; this.getList();
this.onOpen = true;
this.queryParams.projectId = project.id;
this.$api.publics
.queryUnitList({
projectId: project.id,
unitTypes: "2,4".split(","),
})
.then((d) => {
this.nodes = d.rows;
if (d.rows.length > 0) {
this.unitActiveName = this.nodes[0].unitId + "";
this.getList();
} else {
this.surProjectSpecialList = [];
}
});
}, },
onClose() {},
/** 查询特种人员列表 */ /** 查询特种人员列表 */
getList() { getList() {
this.loading = true; if (this.formData.projectId) {
this.queryParams.deptId = this.unitActiveName; this.loading = true;
this.queryParams.activeName = this.activeName; this.queryParams.projectId = this.formData.projectId;
this.queryCount(); this.queryCount();
listSurProjectSpecial(this.queryParams).then((response) => { listSurProjectSpecial(this.queryParams).then((response) => {
this.surProjectSpecialList = response.rows; this.surProjectSpecialList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
}
}, },
queryCount() { queryCount() {
findWorkSpecialCount(this.queryParams).then((response) => { findWorkSpecialCount(this.queryParams).then((response) => {
@ -516,9 +494,8 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.credential = false; this.credential = false;
this.form.projectId = this.project.id; this.form.projectId = this.formData.projectId;
this.form.projectName = this.project.projectName; this.form.projectName = this.formData.projectName;
this.form.deptId = this.unitActiveName;
this.open = true; this.open = true;
this.title = "添加特种人员"; this.title = "添加特种人员";
}, },
@ -590,4 +567,15 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
@import "@/styles/mixin.scss";
::v-deep .el-drawer__header {
display: none;
}
@include action-bar;
.json-editor {
height: calc(100vh - 33px);
}
</style>

View File

@ -132,7 +132,7 @@ export default {
videoDvrNumber: this.formData.videoDvrNumber, videoDvrNumber: this.formData.videoDvrNumber,
passageState: "2", passageState: "2",
}; };
//editPassageState(param); editPassageState(param);
}, },
}, },
}; };

View File

@ -164,7 +164,7 @@ export default {
videoDvrNumber: this.videoDvrNumber, videoDvrNumber: this.videoDvrNumber,
passageState: "2", passageState: "2",
}; };
//editPassageState(param); editPassageState(param);
}, },
}, },
}; };

View File

@ -1,31 +1,17 @@
<template> <template>
<div class="emergency-container"> <div class="app-container">
<el-drawer <el-drawer
v-bind="$attrs"
v-if="onOpen" v-if="onOpen"
:visible.sync="onOpen" v-on="$listeners"
direction="rtl" @opened="onOpen"
size="60%" @close="onClose"
style="padding-left: 20px" style="padding-left: 20px"
> >
<template slot="title">
<div>{{ drawerTitle + " 【应急演练管理】" }}</div>
</template>
<el-tabs
v-model="activeName"
style="margin-left: 20px; margin-right: 20px"
@tab-click="getworkTrainList"
>
<el-tab-pane
v-for="(it, idx) in nodes"
:label="it.unitName + ''"
:name="it.unitId + ''"
:key="idx"
></el-tab-pane>
</el-tabs>
<el-row <el-row
:gutter="10" :gutter="10"
class="mb8" class="mb8"
style="margin-left: 25px; margin-top: 10px; margin-right: 20px" style="margin-left: 25px; margin-top: 10px; margin-right: 0px"
> >
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -48,8 +34,9 @@
v-loading="loading" v-loading="loading"
:data="workTrainList" :data="workTrainList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
style="margin-left: 25px"
> >
<el-table-column label="演练主图" align="center" prop="mainImage" width="80"> <el-table-column label="演练主图" align="center" prop="mainImage" width="75">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image <el-image
ref="preview" ref="preview"
@ -63,7 +50,7 @@
label="演练类型" label="演练类型"
align="center" align="center"
prop="trainNature" prop="trainNature"
width="180" width="130"
show-overflow-tooltip show-overflow-tooltip
v-if="false" v-if="false"
> >
@ -78,7 +65,7 @@
label="演练标题" label="演练标题"
align="center" align="center"
prop="trainTitle" prop="trainTitle"
width="220" width="160"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <el-table-column
@ -96,6 +83,7 @@
label="演练内容" label="演练内容"
align="center" align="center"
prop="trainContent" prop="trainContent"
width="170"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <el-table-column
@ -258,7 +246,6 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex";
import { import {
listWorkTrain, listWorkTrain,
getWorkTrain, getWorkTrain,
@ -273,6 +260,12 @@ export default {
components: { components: {
ElImageViewer, ElImageViewer,
}, },
props: {
formData: {
projectId: String,
projectName: String,
},
},
dicts: ["train_nature_yjyl"], dicts: ["train_nature_yjyl"],
data() { data() {
return { return {
@ -295,7 +288,6 @@ export default {
open: false, open: false,
// //
title: "", title: "",
drawerTitle: "",
deptOptions: [], deptOptions: [],
// //
queryParams: { queryParams: {
@ -326,14 +318,17 @@ export default {
}, },
previewList: [], previewList: [],
files: [], files: [],
project: null,
nodes: [],
activeName: "",
onOpen: false,
}; };
}, },
computed: {}, computed: {},
watch: {}, watch: {
formData: {
handler(value) {
this.formData = value;
},
immediate: true,
},
},
created() {}, created() {},
mounted() {}, mounted() {},
beforeDestroy() {}, beforeDestroy() {},
@ -356,35 +351,21 @@ export default {
return []; return [];
} }
}, },
show(project) { onOpen() {
this.project = project; this.getworkTrainList();
this.drawerTitle = project.projectName;
this.onOpen = true;
this.queryParams.projectId = project.id;
this.$api.publics
.queryUnitList({
projectId: project.id,
unitTypes: "2,4".split(","),
})
.then((d) => {
this.nodes = d.rows;
if (d.rows.length > 0) {
this.activeName = this.nodes[0].unitId + "";
this.getworkTrainList();
} else {
this.workTrainList = [];
}
});
}, },
onClose() {},
/** 查询应急演练列表 */ /** 查询应急演练列表 */
getworkTrainList() { getworkTrainList() {
this.loading = true; if (this.formData.projectId) {
this.queryParams.deptId = this.activeName; this.loading = true;
listWorkTrain(this.queryParams).then((response) => { this.queryParams.projectId = this.formData.projectId;
this.workTrainList = response.rows; listWorkTrain(this.queryParams).then((response) => {
this.total = response.total; this.workTrainList = response.rows;
this.loading = false; this.total = response.total;
}); this.loading = false;
});
}
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
@ -419,8 +400,8 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.form.projectId = this.project.id; this.form.projectId = this.formData.projectId;
this.form.projectName = this.project.projectName; this.form.projectName = this.formData.projectName;
this.open = true; this.open = true;
this.title = "添加应急演练"; this.title = "添加应急演练";
this.getDeptList(); this.getDeptList();
@ -476,7 +457,7 @@ export default {
this.title = "修改应急演练"; this.title = "修改应急演练";
const id = row.id || this.ids; const id = row.id || this.ids;
let param = { let param = {
projectId: this.project.id, projectId: this.formData.projectId,
}; };
// //
listProjectUnit(param).then((response) => { listProjectUnit(param).then((response) => {
@ -501,7 +482,7 @@ export default {
this.$modal this.$modal
.confirm('是否确认删除应急演练编号为"' + ids + '"的数据项?') .confirm('是否确认删除应急演练编号为"' + ids + '"的数据项?')
.then(function () { .then(function () {
return delWorkTrain(ids); return delSurProjectUserInfo(ids);
}) })
.then(() => { .then(() => {
this.getworkTrainList(); this.getworkTrainList();
@ -529,4 +510,18 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
@import "@/styles/mixin.scss";
::v-deep .el-drawer__header {
display: none;
}
@include action-bar;
.json-editor {
height: calc(100vh - 33px);
}
.div_tag {
margin-bottom: 5px;
}
</style>

View File

@ -1,31 +1,17 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-drawer <el-drawer
v-bind="$attrs"
v-if="onOpen" v-if="onOpen"
:visible.sync="onOpen" v-on="$listeners"
direction="rtl" @opened="onOpen"
size="60%" @close="onClose"
style="padding-left: 20px" style="padding-left: 20px"
> >
<template slot="title">
<div>{{ drawerTitle + " 【专项培训管理】" }}</div>
</template>
<el-tabs
v-model="activeName"
style="margin-left: 20px; margin-right: 20px"
@tab-click="getworkTrainList"
>
<el-tab-pane
v-for="(it, idx) in nodes"
:label="it.unitName + ''"
:name="it.unitId + ''"
:key="idx"
></el-tab-pane>
</el-tabs>
<el-row <el-row
:gutter="10" :gutter="10"
class="mb8" class="mb8"
style="margin-left: 20px; margin-top: 10px; margin-right: 20px" style="margin-left: 25px; margin-top: 10px; margin-right: 0px"
> >
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -48,8 +34,9 @@
v-loading="loading" v-loading="loading"
:data="workTrainList" :data="workTrainList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
style="margin-left: 25px"
> >
<el-table-column label="培训主图" align="center" prop="mainImage" width="80"> <el-table-column label="培训主图" align="center" prop="mainImage" width="75">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image <el-image
ref="preview" ref="preview"
@ -63,7 +50,7 @@
label="培训类型" label="培训类型"
align="center" align="center"
prop="trainNature" prop="trainNature"
width="180" width="130"
show-overflow-tooltip show-overflow-tooltip
v-if="false" v-if="false"
> >
@ -78,7 +65,7 @@
label="培训标题" label="培训标题"
align="center" align="center"
prop="trainTitle" prop="trainTitle"
width="220" width="160"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <el-table-column
@ -96,6 +83,7 @@
label="培训内容" label="培训内容"
align="center" align="center"
prop="trainContent" prop="trainContent"
width="170"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <el-table-column
@ -300,7 +288,6 @@ export default {
open: false, open: false,
// //
title: "", title: "",
drawerTitle: "",
deptOptions: [], deptOptions: [],
// //
queryParams: { queryParams: {
@ -331,14 +318,17 @@ export default {
}, },
previewList: [], previewList: [],
files: [], files: [],
project: null,
nodes: [],
activeName: "",
onOpen: false,
}; };
}, },
computed: {}, computed: {},
watch: {}, watch: {
formData: {
handler(value) {
this.formData = value;
},
immediate: true,
},
},
created() {}, created() {},
mounted() {}, mounted() {},
beforeDestroy() {}, beforeDestroy() {},
@ -361,35 +351,21 @@ export default {
return []; return [];
} }
}, },
show(project) { onOpen() {
this.project = project; this.getworkTrainList();
this.drawerTitle = project.projectName;
this.onOpen = true;
this.queryParams.projectId = project.id;
this.$api.publics
.queryUnitList({
projectId: project.id,
unitTypes: "2,4".split(","),
})
.then((d) => {
this.nodes = d.rows;
if (d.rows.length > 0) {
this.activeName = this.nodes[0].unitId + "";
this.getworkTrainList();
} else {
this.workTrainList = [];
}
});
}, },
onClose() {},
/** 查询专项培训列表 */ /** 查询专项培训列表 */
getworkTrainList() { getworkTrainList() {
this.loading = true; if (this.formData.projectId) {
this.queryParams.deptId = this.activeName; this.loading = true;
listWorkTrain(this.queryParams).then((response) => { this.queryParams.projectId = this.formData.projectId;
this.workTrainList = response.rows; listWorkTrain(this.queryParams).then((response) => {
this.total = response.total; this.workTrainList = response.rows;
this.loading = false; this.total = response.total;
}); this.loading = false;
});
}
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
@ -507,7 +483,7 @@ export default {
this.$modal this.$modal
.confirm('是否确认删除专项培训编号为"' + ids + '"的数据项?') .confirm('是否确认删除专项培训编号为"' + ids + '"的数据项?')
.then(function () { .then(function () {
return delWorkTrain(ids); return delSurProjectUserInfo(ids);
}) })
.then(() => { .then(() => {
this.getworkTrainList(); this.getworkTrainList();
@ -535,4 +511,18 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
@import "@/styles/mixin.scss";
::v-deep .el-drawer__header {
display: none;
}
@include action-bar;
.json-editor {
height: calc(100vh - 33px);
}
.div_tag {
margin-bottom: 5px;
}
</style>

View File

@ -1,18 +1,16 @@
package com.ruoyi.web.project.controller; package com.ruoyi.web.project.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.web.project.service.WxIProjectInfoService; import com.ruoyi.web.project.service.WxIProjectInfoService;
import com.yanzhu.jh.project.service.ISurProjectUserinfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
/** /**
* @version : V1.0 * @version : V1.0
@ -25,9 +23,6 @@ import java.util.concurrent.TimeUnit;
@RequestMapping("/wechat/project") @RequestMapping("/wechat/project")
public class ProjectController extends BaseController { public class ProjectController extends BaseController {
@Autowired
private RedisCache redisCache;
@Autowired @Autowired
WxIProjectInfoService IProjectInfoService; WxIProjectInfoService IProjectInfoService;
@ -61,15 +56,7 @@ public class ProjectController extends BaseController {
*/ */
@RequestMapping("/selectProjectByCompanyId") @RequestMapping("/selectProjectByCompanyId")
public Object selectProjectByCompanyId(@RequestParam Map<String,Object> map) { public Object selectProjectByCompanyId(@RequestParam Map<String,Object> map) {
//设置缓存 return IProjectInfoService.getProjectByDeptIdAndCompanyId(map);
String key="wechat_project_selectProjectByCompanyId-deptId_"+map.get("deptId")+"-userId_"+map.get("userId")+"-minRoleId_"+map.get("minRoleId");
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return obj;
}
List<Map<String,Object>> list = IProjectInfoService.getProjectByDeptIdAndCompanyId(map);
redisCache.setCacheObject(key, list, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
return list;
} }
/** /**
@ -79,14 +66,7 @@ public class ProjectController extends BaseController {
*/ */
@RequestMapping("/getProjectUnitList") @RequestMapping("/getProjectUnitList")
public Object getProjectUnitList(String projectId){ public Object getProjectUnitList(String projectId){
String key="wechat_project_getProjectUnitList-projectId_"+projectId; return IProjectInfoService.getProjectUnitList(projectId);
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return obj;
}
List<Map<String,Object>> list = IProjectInfoService.getProjectUnitList(projectId);
redisCache.setCacheObject(key, list, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
return list;
} }
/*** /***

View File

@ -4,17 +4,13 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginBody; import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.framework.web.service.SysLoginService; import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.framework.web.service.TokenService; import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.web.userLogin.service.IWechatUserLoginService; import com.ruoyi.web.userLogin.service.IWechatUserLoginService;
import com.yanzhu.jh.trouble.domain.SmzSspProblemmodify;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
/** /**
* @version : V1.0 * @version : V1.0
@ -27,9 +23,6 @@ import java.util.concurrent.TimeUnit;
@RequestMapping("/wechat") @RequestMapping("/wechat")
public class WechatUserLoginController extends BaseController { public class WechatUserLoginController extends BaseController {
@Autowired
private RedisCache redisCache;
@Autowired @Autowired
private SysLoginService loginService; private SysLoginService loginService;
@ -68,18 +61,8 @@ public class WechatUserLoginController extends BaseController {
public AjaxResult openIdLogin(@RequestBody LoginBody loginBody) public AjaxResult openIdLogin(@RequestBody LoginBody loginBody)
{ {
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
Map<String,Object> data = null;
//设置缓存
String key="wechat_openIdLogin-"+loginBody.getOpenId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
data = (Map<String,Object>) obj;
ajax.put("data",data);
return ajax;
}
ajax.put(Constants.TOKEN, ""); ajax.put(Constants.TOKEN, "");
data = wechatUserLoginService.getLoginUserByOpenId(loginBody.getOpenId()); Map<String,Object> data = wechatUserLoginService.getLoginUserByOpenId(loginBody.getOpenId());
redisCache.setCacheObject(key, data, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
if(data!=null){ if(data!=null){
ajax.put("data",data); ajax.put("data",data);
return ajax; return ajax;
@ -116,17 +99,7 @@ public class WechatUserLoginController extends BaseController {
*/ */
@RequestMapping("/selectDeptAll") @RequestMapping("/selectDeptAll")
public AjaxResult selectDeptAll(@RequestParam Map<String,Object> map){ public AjaxResult selectDeptAll(@RequestParam Map<String,Object> map){
Map<String,Object> data = null; return success(wechatUserLoginService.getDeptAll(map));
//设置缓存
String key="wechat_selectDeptAll-deptId_"+map.get("deptId")+"-userId_"+map.get("userId")+"-minRoleId_"+map.get("minRoleId");
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
data = (Map<String,Object>) obj;
return success(data);
}
data = wechatUserLoginService.getDeptAll(map);
redisCache.setCacheObject(key, data, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
return success(data);
} }
/** /**

View File

@ -83,7 +83,7 @@ public class SurProjectWorkSpecialServiceImpl implements ISurProjectWorkSpecialS
public int insertSurProjectWorkSpecial(SurProjectWorkSpecial surProjectWorkSpecial) public int insertSurProjectWorkSpecial(SurProjectWorkSpecial surProjectWorkSpecial)
{ {
surProjectWorkSpecial.setCreateBy(SecurityUtils.getUsername()); surProjectWorkSpecial.setCreateBy(SecurityUtils.getUsername());
//surProjectWorkSpecial.setDeptId(SecurityUtils.getDeptId()); surProjectWorkSpecial.setDeptId(SecurityUtils.getDeptId());
surProjectWorkSpecial.setCreateTime(DateUtils.getNowDate()); surProjectWorkSpecial.setCreateTime(DateUtils.getNowDate());
surProjectWorkSpecial.setCredentialType(FileUtils.getFileLastNameUpCase(surProjectWorkSpecial.getCredentialFile())); surProjectWorkSpecial.setCredentialType(FileUtils.getFileLastNameUpCase(surProjectWorkSpecial.getCredentialFile()));
return surProjectWorkSpecialMapper.insertSurProjectWorkSpecial(surProjectWorkSpecial); return surProjectWorkSpecialMapper.insertSurProjectWorkSpecial(surProjectWorkSpecial);

View File

@ -62,10 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> left join sur_project_unit_info spui on spui.projectId = sp.id</if> <if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> left join sur_project_unit_info spui on spui.projectId = sp.id</if>
<!--普通用户查询项目人员--> <!--普通用户查询项目人员-->
<if test='nowRole == "99"'> left join sur_project_userinfo spu on spu.project_id = sp.id</if> <if test='nowRole == "99"'> left join sur_project_userinfo spu on spu.project_id = sp.id</if>
<if test="deptId != null"> left join work_train_dept wtd2 on wtd2.train_id = wt.id and wtd2.is_main ='Y'</if>
<where> <where>
<if test="projectId != null"> and wt.project_id = #{projectId}</if> <if test="projectId != null"> and wt.project_id = #{projectId}</if>
<if test="deptId != null"> and wtd2.dept_id = #{deptId}</if>
<if test="projectName != null and projectName != ''"> and wt.project_name like concat('%', #{projectName}, '%')</if> <if test="projectName != null and projectName != ''"> and wt.project_name like concat('%', #{projectName}, '%')</if>
<if test="trainType != null and trainType != ''"> and train_type = #{trainType}</if> <if test="trainType != null and trainType != ''"> and train_type = #{trainType}</if>
<if test="trainTitle != null and trainTitle != ''"> and train_title like concat('%', #{trainTitle}, '%')</if> <if test="trainTitle != null and trainTitle != ''"> and train_title like concat('%', #{trainTitle}, '%')</if>
@ -78,6 +76,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test='nowRole == "4"'> and sp.deptId = #{nowDept}</if> <if test='nowRole == "4"'> and sp.deptId = #{nowDept}</if>
<!--监理单位/总包公司/分包单位查询当前关联数据--> <!--监理单位/总包公司/分包单位查询当前关联数据-->
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and spui.unitId = #{nowDept}</if> <if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and spui.unitId = #{nowDept}</if>
<!--监理单位/总包公司/分包单位查询当前关联数据-->
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and spui.unitId = #{nowDept}</if>
<!--普通用户查询项目人员--> <!--普通用户查询项目人员-->
<if test='nowRole == "99"'> and spu.user_id = #{nowUser} and spu.is_del=0</if> <if test='nowRole == "99"'> and spu.user_id = #{nowUser} and spu.is_del=0</if>
</where> </where>