update handbook plan project

jzq 2024-07-30 16:46:28 +08:00
parent 9843ca4020
commit 316a0618a9
38 changed files with 1792 additions and 994 deletions

View File

@ -35,10 +35,30 @@ export function updatePlan(data) {
})
}
// 删除项目申报v2
export function delPlan(handbookId) {
// 删除项目申报计划
export function delPlan(planId) {
return request({
url: '/scientific/plan/' + handbookId,
url: '/scientific/plan/' + planId,
method: 'delete'
})
}
// 封装寻找最新 表单 的函数,返回 Promise
export function findLatestDeploymentTimeIndex(response) {
return new Promise((resolve, reject) => {
let latestIndex = 0;
let latestTime = new Date(response.rows[0].deploymentTime);
response.rows.forEach((row, index) => {
const currentTime = new Date(row.deploymentTime);
if (currentTime > latestTime) {
latestTime = currentTime;
latestIndex = index;
}
});
// 返回最新的索引
resolve(latestIndex);
});
}

View File

@ -215,7 +215,7 @@ export const dynamicRoutes = [
path: '/scientific/project_application_plan',
component: Layout,
hidden: true,
permissions: ['scientific:project_application_plan'],
permissions: ['scientific:plan'],
children: [
// zqjia:这个路由是菜单管理里的起作用
// {
@ -230,13 +230,12 @@ export const dynamicRoutes = [
name: 'planDetail',
meta: { title: '申报计划详情' }
},
// zqjia:这个路由是菜单管理里的起作用
// {
// path: 'planApply',
// component: () => import('@/views/scientific/project_application_plan/planApply'),
// name: 'planApply',
// meta: { title: '项目申报', icon: '' }
// },
{
path: 'planApply',
component: () => import('@/views/scientific/project_application_plan/planApply'),
name: 'planApply',
meta: { title: '项目申报', icon: '' }
},
]
},
// 项目路由
@ -268,13 +267,49 @@ export const dynamicRoutes = [
meta: { title: '已申报项目' }
},
{
path: 'projectApply/:deployId([\\w|\\-]+)',
component: () => import('@/views/scientific/project/projectApply.vue'),
path: 'projectApply',
component: () => import('@/views/scientific/project/projectApply'),
name: 'ProjectApply',
meta: { title: '项目申报', icon: '' }
},
]
},
// 指南路由
{
path: '/scientific/handbook',
component: Layout,
hidden: true,
permissions: ['scientific:handbook'],
children: [
// zqjia:这个路由是菜单管理里的起作用
// {
// path: 'list',
// component: () => import('@/views/scientific/project/index'),
// name: 'projectList',
// meta: { title: '项目', icon: '' }
// },
// zqjia:项目详情还没写
{
path: 'detail/:planProcId([\\w|\\-]+)',
component: () => import('@/views/scientific/handbook/detail'),
name: 'handbookDetail',
meta: { title: '申报计划详情' }
},
// {
// path: 'planProjectQuery/:planId([\\w|\\-]+)',
// // permissions: ['scientific:application:list'],
// component: () => import('@/views/scientific/project/index'),
// name: 'planProjectQuery',
// meta: { title: '已申报项目' }
// },
// {
// path: 'projectApply/:deployId([\\w|\\-]+)',
// component: () => import('@/views/scientific/project/projectApply.vue'),
// name: 'ProjectApply',
// meta: { title: '项目申报', icon: '' }
// },
]
},
]
// 防止连续点击多次路由报错

View File

@ -0,0 +1,476 @@
<template>
<div class="app-container">
<el-tabs tab-position="top" :value="processed === true ? 'approval' : 'form'">
<el-tab-pane label="表单信息" name="form">
<div v-if="formOpen">
<el-card class="box-card" shadow="never" v-for="(formInfo, index) in processFormList" :key="index">
<div slot="header" class="clearfix">
<!-- <span>{{ formInfo.title }}</span>-->
<span> 指南详情 </span>
</div>
<!--流程处理表单模块-->
<el-col :span="20" :offset="2">
<parser :form-conf="formInfo"/>
</el-col>
</el-card>
</div>
</el-tab-pane >
</el-tabs>
</div>
</template>
<script>
import { detailProcess } from '@/api/workflow/process'
import Parser from '@/utils/generator/parser'
import { complete, delegate, transfer, rejectTask, returnList, returnTask } from '@/api/workflow/task'
import { selectUser, deptTreeSelect } from '@/api/system/user'
import ProcessViewer from '@/components/ProcessViewer'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import Treeselect from '@riophae/vue-treeselect'
export default {
name: "WorkDetail",
components: {
ProcessViewer,
Parser,
Treeselect
},
props: {},
computed: {
commentType() {
return val => {
switch (val) {
case '1': return '通过'
case '2': return '退回'
case '3': return '驳回'
case '4': return '委派'
case '5': return '转办'
case '6': return '终止'
case '7': return '撤回'
}
}
},
approveTypeTag() {
return val => {
switch (val) {
case '1': return 'success'
case '2': return 'warning'
case '3': return 'danger'
case '4': return 'primary'
case '5': return 'success'
case '6': return 'danger'
case '7': return 'info'
}
}
}
},
data() {
return {
height: document.documentElement.clientHeight - 205 + 'px;',
// xml
loadIndex: 0,
xmlData: undefined,
finishedInfo: {
finishedSequenceFlowSet: [],
finishedTaskSet: [],
unfinishedTaskSet: [],
rejectedTaskSet: []
},
historyProcNodeList: [],
//
deptName: undefined,
//
deptOptions: undefined,
userLoading: false,
//
userList: null,
deptProps: {
children: "children",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
deptId: undefined
},
total: 0,
//
loading: true,
taskForm:{
comment:"", //
procInsId: "", //
taskId: "" ,//
copyUserIds: "", // Id
vars: "",
targetKey:""
},
rules: {
comment: [{ required: true, message: '请输入审批意见', trigger: 'blur' }],
},
currentUserId: null,
variables: [], //
taskFormOpen: false,
taskFormData: {}, //
processFormList: [], //
formOpen: false, //
returnTaskList: [], // 退
processed: false,
returnTitle: null,
returnOpen: false,
rejectOpen: false,
rejectTitle: null,
userData: {
title: '',
type: '',
open: false,
},
copyUser: [],
nextUser: [],
userMultipleSelection: [],
userDialogTitle: '',
userOpen: false
};
},
created() {
this.initData();
},
methods: {
initData() {
this.taskForm.procInsId = this.$route.params && this.$route.params.planProcId;
this.taskForm.taskId = this.$route.query && this.$route.query.taskId;
this.processed = this.$route.query && eval(this.$route.query.processed || false);
//
this.getProcessDetails(this.taskForm.procInsId, this.taskForm.taskId);
this.loadIndex = this.taskForm.procInsId;
},
/** 查询部门下拉树结构 */
getTreeSelect() {
deptTreeSelect().then(response => {
this.deptOptions = response.data;
});
},
/** 查询用户列表 */
getList() {
this.userLoading = true;
selectUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
this.toggleSelection(this.userMultipleSelection);
this.userLoading = false;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.getList();
},
setIcon(val) {
if (val) {
return "el-icon-check";
} else {
return "el-icon-time";
}
},
setColor(val) {
if (val) {
return "#2bc418";
} else {
return "#b3bdbb";
}
},
//
handleSelectionChange(selection) {
this.userMultipleSelection = selection
},
toggleSelection(selection) {
if (selection && selection.length > 0) {
this.$nextTick(()=> {
selection.forEach(item => {
let row = this.userList.find(k => k.userId === item.userId);
this.$refs.userTable.toggleRowSelection(row);
})
})
} else {
this.$nextTick(() => {
this.$refs.userTable.clearSelection();
});
}
},
//
handleClose(type, tag) {
let userObj = this.userMultipleSelection.find(item => item.userId === tag.id);
this.userMultipleSelection.splice(this.userMultipleSelection.indexOf(userObj), 1);
if (type === 'copy') {
this.copyUser = this.userMultipleSelection;
// ID
if (this.copyUser && this.copyUser.length > 0) {
const val = this.copyUser.map(item => item.id);
this.taskForm.copyUserIds = val instanceof Array ? val.join(',') : val;
} else {
this.taskForm.copyUserIds = '';
}
} else if (type === 'next') {
this.nextUser = this.userMultipleSelection;
// ID
if (this.nextUser && this.nextUser.length > 0) {
const val = this.nextUser.map(item => item.id);
this.taskForm.nextUserIds = val instanceof Array ? val.join(',') : val;
} else {
this.taskForm.nextUserIds = '';
}
}
},
/** 流程变量赋值 */
handleCheckChange(val) {
if (val instanceof Array) {
this.taskForm.values = {
"approval": val.join(',')
}
} else {
this.taskForm.values = {
"approval": val
}
}
},
getProcessDetails(procInsId, taskId) {
const params = {procInsId: procInsId, taskId: taskId}
detailProcess(params).then(res => {
const data = res.data;
this.xmlData = data.bpmnXml;
this.processFormList = data.processFormList;
this.taskFormOpen = data.existTaskForm;
if (this.taskFormOpen) {
this.taskFormData = data.taskFormData;
}
this.historyProcNodeList = data.historyProcNodeList;
this.finishedInfo = data.flowViewer;
this.formOpen = true;
})
},
onSelectCopyUsers() {
this.userMultipleSelection = this.copyUser;
this.onSelectUsers('添加抄送人', 'copy')
},
onSelectNextUsers() {
this.userMultipleSelection = this.nextUser;
this.onSelectUsers('指定审批人', 'next')
},
onSelectUsers(title, type) {
this.userData.title = title;
this.userData.type = type;
this.getTreeSelect();
this.getList()
this.userData.open = true;
},
/** 通过任务 */
handleComplete() {
//
const taskFormRef = this.$refs.taskFormParser;
const isExistTaskForm = taskFormRef !== undefined;
// taskFormPromise true
const taskFormPromise = !isExistTaskForm ? true : new Promise((resolve, reject) => {
taskFormRef.$refs[taskFormRef.formConfCopy.formRef].validate(valid => {
valid ? resolve() : reject()
})
});
const approvalPromise = new Promise((resolve, reject) => {
this.$refs['taskForm'].validate(valid => {
valid ? resolve() : reject()
})
});
Promise.all([taskFormPromise, approvalPromise]).then(() => {
if (isExistTaskForm) {
this.taskForm.variables = taskFormRef[taskFormRef.formConfCopy.formModel]
}
complete(this.taskForm).then(response => {
this.$modal.msgSuccess(response.msg);
this.goBack();
});
})
},
/** 委派任务 */
handleDelegate() {
this.$refs["taskForm"].validate(valid => {
if (valid) {
this.userData.type = 'delegate';
this.userData.title = '委派任务'
this.userData.open = true;
this.getTreeSelect();
}
})
},
/** 转办任务 */
handleTransfer(){
this.$refs["taskForm"].validate(valid => {
if (valid) {
this.userData.type = 'transfer';
this.userData.title = '转办任务';
this.userData.open = true;
this.getTreeSelect();
}
})
},
/** 拒绝任务 */
handleReject() {
this.$refs["taskForm"].validate(valid => {
if (valid) {
const _this = this;
this.$modal.confirm('拒绝审批单流程会终止,是否继续?').then(function() {
return rejectTask(_this.taskForm);
}).then(res => {
this.$modal.msgSuccess(res.msg);
this.goBack();
});
}
});
},
changeCurrentUser(val) {
this.currentUserId = val.userId
},
/** 返回页面 */
goBack() {
//
this.$tab.closePage(this.$route)
this.$router.back()
},
/** 接收子组件传的值 */
getData(data) {
if (data) {
const variables = [];
data.fields.forEach(item => {
let variableData = {};
variableData.label = item.__config__.label
//
if (item.__config__.defaultValue instanceof Array) {
const array = [];
item.__config__.defaultValue.forEach(val => {
array.push(val)
})
variableData.val = array;
} else {
variableData.val = item.__config__.defaultValue
}
variables.push(variableData)
})
this.variables = variables;
}
},
submitUserData() {
let type = this.userData.type;
if (type === 'copy' || type === 'next') {
if (!this.userMultipleSelection || this.userMultipleSelection.length <= 0) {
this.$modal.msgError("请选择用户");
return false;
}
let userIds = this.userMultipleSelection.map(k => k.userId);
if (type === 'copy') {
// ID
this.copyUser = this.userMultipleSelection;
this.taskForm.copyUserIds = userIds instanceof Array ? userIds.join(',') : userIds;
} else if (type === 'next') {
// ID
this.nextUser = this.userMultipleSelection;
this.taskForm.nextUserIds = userIds instanceof Array ? userIds.join(',') : userIds;
}
this.userData.open = false;
} else {
if (!this.taskForm.comment) {
this.$modal.msgError("请输入审批意见");
return false;
}
if (!this.currentUserId) {
this.$modal.msgError("请选择用户");
return false;
}
this.taskForm.userId = this.currentUserId;
if (type === 'delegate') {
delegate(this.taskForm).then(res => {
this.$modal.msgSuccess(res.msg);
this.goBack();
});
}
if (type === 'transfer') {
transfer(this.taskForm).then(res => {
this.$modal.msgSuccess(res.msg);
this.goBack();
});
}
}
},
/** 可退回任务列表 */
handleReturn() {
this.$refs['taskForm'].validate(valid => {
if (valid) {
this.returnTitle = "退回流程";
returnList(this.taskForm).then(res => {
this.returnTaskList = res.data;
this.taskForm.values = null;
this.returnOpen = true;
})
}
});
},
/** 提交退回任务 */
submitReturn() {
this.$refs["taskForm"].validate(valid => {
if (valid) {
if (!this.taskForm.targetKey) {
this.$modal.msgError("请选择退回节点!");
}
returnTask(this.taskForm).then(res => {
this.$modal.msgSuccess(res.msg);
this.goBack()
});
}
});
}
}
};
</script>
<style lang="scss" scoped>
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
.box-card {
width: 100%;
margin-bottom: 20px;
}
.el-tag + .el-tag {
margin-left: 10px;
}
.el-row {
margin-bottom: 20px;
&:last-child {
margin-bottom: 0;
}
}
.el-col {
border-radius: 4px;
}
.button-new-tag {
margin-left: 10px;
}
</style>

View File

@ -0,0 +1,163 @@
<template>
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{ processName }}</span>
</div>
<el-col :span="18" :offset="3">
<div class="form-conf" v-if="formOpen">
<parser :key="new Date().getTime()" :form-conf="formData" @submit="submit" ref="parser" @getData="getData"/>
</div>
</el-col>
</el-card>
</div>
</template>
<script>
import { listProcess, startProcess_ } from '@/api/workflow/process'
import { listAllCategory } from '@/api/workflow/category'
import { getProcessForm, startProcess } from '@/api/workflow/process'
import Parser from '@/utils/generator/parser'
import {findLatestDeploymentTimeIndex } from '@/api/scientific/project_application_plan'
import { addHandbook } from '@/api/scientific/handbook'
export default {
name: 'handbookApply',
components: {
Parser
},
data() {
return {
definitionId: null,
deployId: null,
procInsId: null,
formOpen: false,
formData: {},
processName: '',
categoryOptions: [],
//
processParams: null,
//
queryParams: {
pageNum: 1,
pageSize: 10,
processKey: undefined,
processName: "",
category: "010"
},
}
},
created() {
this.initData();
},
methods: {
initData() {
/** 查询流程定义列表 */
listProcess(this.queryParams).then(response => {
findLatestDeploymentTimeIndex(response).then((latestIndex) => {
this.processParams = response.rows[latestIndex];
this.processName = this.processParams.processName;
this.definitionId = this.processParams.definitionId;
getProcessForm({
definitionId: this.processParams.definitionId,
deployId: this.processParams.deploymentId,
procInsId: undefined
}).then(res => {
if (res.data) {
this.formData = res.data;
this.formOpen = true;
}
})
});
})
},
/** 接收子组件传的值 */
getData(data) {
if (data) {
const variables = [];
data.fields.forEach(item => {
let variableData = {};
variableData.label = item.__config__.label
//
if (item.__config__.defaultValue instanceof Array) {
const array = [];
item.__config__.defaultValue.forEach(val => {
array.push(val)
})
variableData.val = array;
} else {
variableData.val = item.__config__.defaultValue
}
variables.push(variableData)
})
this.variables = variables;
}
},
submit(data) {
if (data && this.definitionId) {
//
startProcess_(this.definitionId, JSON.stringify(data.valData)).then(res => {
if (res.code !== 200) {
this.$modal.msgError("操作失败");
return;
}
let handbookData = data.valData;
handbookData.handbookProcId = res.msg;
// zqjia:
handbookData.handbookStatus = 1;
// zqjia:
const date = new Date(handbookData.handbookDate);
handbookData.handbookDate = this.formatDateTime(date);
// zqjia:handbookFile
const files = handbookData.handbookFile;
if (files !== null) {
let formatedFiles = {};
files.forEach(file => {
if(file.response.code === 200 && file.ossId) {
formatedFiles[file.name] = file.ossId;
}
})
handbookData.handbookFile = JSON.stringify(formatedFiles);
}
addHandbook(JSON.stringify(handbookData)).then(resp => {
if (res.code !== 200) {
this.$modal.msgError("操作失败");
return;
}
this.$modal.msgSuccess(resp.msg);
this.$tab.closeOpenPage({
// zqjia:
path: '/scientific/handbook/list'
})
});
})
}
},
formatDateTime(date) {
const padZero = (num) => (num < 10 ? '0' + num : num);
const year = date.getFullYear();
const month = padZero(date.getMonth() + 1); // getMonth() 0-11 1
const day = padZero(date.getDate());
const hours = padZero(date.getHours());
const minutes = padZero(date.getMinutes());
const seconds = padZero(date.getSeconds());
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
}
}
</script>
<style lang="scss" scoped>
.form-conf {
margin: 15px auto;
width: 80%;
padding: 15px;
}
</style>

View File

@ -1,14 +1,6 @@
<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="handbookId">
<el-input
v-model="queryParams.handbookId"
placeholder="请输入项目ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="指南名称" prop="handbookName">
<el-input
v-model="queryParams.handbookName"
@ -25,10 +17,10 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="指南级别(4院级 3市级 2省级 1国家级)" prop="handbookLevel">
<el-form-item label="指南级别" prop="handbookLevel">
<el-input
v-model="queryParams.handbookLevel"
placeholder="请输入指南级别(4院级 3市级 2省级 1国家级)"
placeholder="请输入指南级别"
clearable
@keyup.enter.native="handleQuery"
/>
@ -41,22 +33,7 @@
placeholder="请选择发布时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="handbookNote">
<el-input
v-model="queryParams.handbookNote"
placeholder="请输入备注"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="指南录入流程实例Id" prop="handbookProcId">
<el-input
v-model="queryParams.handbookProcId"
placeholder="请输入指南录入流程实例Id"
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>
@ -111,35 +88,48 @@
<el-table v-loading="loading" :data="handbookList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目ID" align="center" prop="handbookId" v-if="true"/>
<el-table-column label="指南名称" align="center" prop="handbookName" />
<el-table-column label="指南分类" align="center" prop="handbookCategory" />
<el-table-column label="指南级别(4院级 3市级 2省级 1国家级)" align="center" prop="handbookLevel" />
<el-table-column label="指南级别" align="center" prop="handbookLevel" />
<el-table-column label="发布时间" align="center" prop="handbookDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.handbookDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="handbookNote" />
<el-table-column label="指南文件" align="center" prop="handbookFile" />
<el-table-column label="指南录入流程实例Id" align="center" prop="handbookProcId" />
<el-table-column label="指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过)" align="center" prop="handbookStatus" />
<!-- <el-table-column label="指南文件" align="center" prop="handbookFile" />-->
<!-- <el-table-column label="指南录入流程状态" align="center" prop="handbookStatus" />-->
<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="['scientific:project_application_plan:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['scientific:project_application_plan:remove']"-->
<!-- >删除</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
@click="handleHandbookDetail(scope.row)"
v-hasPermi="['scientific:project_application_plan:edit']"
>修改</el-button>
>详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
@click="handlePlanApply(scope.row)"
v-hasPermi="['scientific:project_application_plan:remove']"
>删除</el-button>
>发布计划</el-button>
</template>
</el-table-column>
</el-table>
@ -192,9 +182,16 @@
<script>
import { listHandbook, getHandbook, delHandbook, addHandbook, updateHandbook } from "@/api/scientific/handbook";
import planApply from '@/views/scientific/project_application_plan/planApply.vue'
import { listProcess } from '@/api/workflow/process'
export default {
name: "Handbook",
computed: {
planApply() {
return planApply
}
},
data() {
return {
// loading
@ -229,7 +226,7 @@ export default {
handbookNote: undefined,
handbookFile: undefined,
handbookProcId: undefined,
handbookStatus: undefined,
handbookStatus: 3,
},
//
form: {},
@ -381,7 +378,24 @@ export default {
this.download('scientific/project_application_plan/export', {
...this.queryParams
}, `handbook_${new Date().getTime()}.xlsx`)
}
},
handleHandbookDetail(row) {
this.$router.push({
path: '/scientific/handbook/detail/' + row.handbookProcId,
query: {
processed: false,
}
})
},
handlePlanApply(row) {
//
this.$router.push({
name: 'planApply',
params: {
handbook: row
}
})
},
}
};
</script>

View File

@ -324,6 +324,11 @@ export default {
/** 查询项目申报列表 */
getList() {
this.loading = true;
const queryParams = this.$route.params && this.$route.params.queryParams;
if (queryParams !== undefined) {
this.queryParams = queryParams;
}
listApplication(this.queryParams).then(response => {
this.applicationList = response.rows;
this.total = response.total;

View File

@ -2,7 +2,7 @@
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{ this.handbook.handbookName }}</span>
<span>{{ this.plan.planName }}</span>
</div>
<el-col :span="18" :offset="3">
@ -15,9 +15,9 @@
</template>
<script>
import { getProcessForm, startProcess_ } from '@/api/workflow/process'
import { getProcessForm, listProcess, startProcess_ } from '@/api/workflow/process'
import Parser from '@/utils/generator/parser'
import {addProject} from "@/api/scientific/project";
import { findLatestDeploymentTimeIndex } from '@/api/scientific/project_application_plan'
import { addApplication } from '@/api/scientific/application'
export default {
@ -33,7 +33,16 @@ export default {
formOpen: false,
formData: {},
handbook: {},
plan: {},
//
queryParams: {
pageNum: 1,
pageSize: 10,
processKey: undefined,
processName: "",
category: "002"
},
}
},
created() {
@ -41,20 +50,35 @@ export default {
},
methods: {
initData() {
this.deployId = this.$route.params && this.$route.params.deployId;
this.definitionId = this.$route.params && this.$route.params.definitionId;
this.handbook = this.$route.params && this.$route.params.row;
getProcessForm({
definitionId: this.definitionId,
deployId: this.deployId,
procInsId: undefined,
}).then(res => {
if (res.data) {
this.formData = res.data;
this.formOpen = true
}
this.plan = this.$route.params && this.$route.params.plan;
listProcess(this.queryParams).then(response => {
findLatestDeploymentTimeIndex(response).then((latestIndex) => {
this.processParams = response.rows[latestIndex];
this.processName = this.processParams.processName;
this.definitionId = this.processParams.definitionId;
getProcessForm({
definitionId: this.processParams.definitionId,
deployId: this.processParams.deploymentId,
procInsId: undefined
}).then(res => {
if (res.data) {
this.formData = res.data;
this.formOpen = true;
}
})
});
})
// getProcessForm({
// definitionId: this.definitionId,
// deployId: this.deployId,
// procInsId: undefined,
// }).then(res => {
// if (res.data) {
// this.formData = res.data;
// this.formOpen = true
// }
// })
},
/** 接收子组件传的值 */
getData(data) {
@ -81,26 +105,26 @@ export default {
submit(data) {
if (data && this.definitionId) {
//
console.log(data);
startProcess_(this.definitionId, JSON.stringify(data.valData)).then(res => {
const ori_data = data.valData;
// zqjia:
let projectData = {};
projectData.projectName = ori_data.projectName;
projectData.projectStatus = 0;
projectData.projectStatus = 1;
projectData.projectAppProcId = res.msg;
projectData.projectDeclareStatus = 1;
projectData.projectAppStTime = this.formatDateTime(new Date());
projectData.projectAppEndTime = this.formatDateTime(new Date());
projectData.projectLeader = "liye";
projectData.projectBudget = 11;
projectData.projectHandbookId = this.handbook.handbookId;
projectData.projectHandbookName = this.handbook.handbookName;
projectData.projectPlanId = this.plan.planId;
projectData.projectPlanName = this.plan.planName;
projectData.projectLeaderPhone = ori_data.projectLeaderPhone;
projectData.projectCategory = this.handbook.handbookLevel;
projectData.projectCategory = this.plan.planLevel;
projectData.projectContent = ori_data.projectContent;
console.log(projectData);
projectData.projectPlanId = this.plan.planId;
projectData.projectPlanName = this.plan.planName;
addApplication(JSON.stringify(projectData)).then(response => {
this.$modal.msgSuccess("申报完成");

View File

@ -48,7 +48,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['scientific:project_application_plan:add']"
v-hasPermi="['scientific:plan:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
@ -59,7 +59,7 @@
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['scientific:project_application_plan:edit']"
v-hasPermi="['scientific:plan:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
@ -70,7 +70,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['scientific:project_application_plan:remove']"
v-hasPermi="['scientific:plan:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
@ -80,20 +80,20 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['scientific:project_application_plan:export']"
v-hasPermi="['scientific:plan:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="handbookList" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="申报计划名称" align="center" prop="handbookName" :min-width="100"/>
<el-table-column label="申报计划名称" align="center" prop="planName" :min-width="100"/>
<el-table-column label="申报计划级别" align="center" width="100px" :min-width="100">
<template slot-scope="scope">
<el-tag size="medium" :type="getTagLevelType(scope.row.handbookLevel)">
{{ formatHandbookLevel(scope.row.handbookLevel) }}
<el-tag size="medium" :type="getTagLevelType(scope.row.planLevel)">
{{ formatHandbookLevel(scope.row.planLevel) }}
</el-tag>
</template>
</el-table-column>
@ -114,8 +114,8 @@
<template slot-scope="scope">
<el-button plain
size="mini"
@click="listProjectInHandbook(scope.row.handbookId)"
v-hasPermi="['scientific:project_application_plan:list']"
@click="listProjectInPlan(scope.row.planId)"
v-hasPermi="['scientific:plan:list']"
>{{ scope.row.nProject }}</el-button>
</template>
</el-table-column>
@ -134,8 +134,8 @@
type="primary"
icon="el-icon-top"
size="mini"
@click="handbookDetail(scope.row)"
v-hasPermi="['scientific:project_application_plan:list']"
@click="planDetail(scope.row)"
v-hasPermi="['scientific:plan:list']"
>查看计划</el-button>
<el-button
@ -144,7 +144,7 @@
size="mini"
@click="projectApply(scope.row)"
:disabled="isCurrentDateInRange(scope.row.projectAppStTime, scope.row.projectAppEndTime) !== '申报中'"
v-hasPermi="['scientific:project_application_plan:list']"
v-hasPermi="['scientific:plan:list']"
>进入申报</el-button>
</template>
@ -221,7 +221,7 @@ export default {
//
total: 0,
// v2
handbookList: [],
planList: [],
//
title: "",
//
@ -245,7 +245,7 @@ export default {
form: {},
//
rules: {
handbookId: [
planId: [
{ required: true, message: "项目ID不能为空", trigger: "blur" }
],
handbookName: [
@ -277,14 +277,14 @@ export default {
getList() {
this.loading = true;
listPlan(this.queryParams).then(response => {
this.handbookList = response.rows;
this.planList = response.rows;
this.total = response.total;
// 使Promise.all
const promises = this.handbookList.map(item => {
const promises = this.planList.map(item => {
const queryParams = {
pageNum: 1,
pageSize: 10,
projectHandbookId: item.handbookId,
projectPlanId: item.planId,
};
listApplication(queryParams).then(res => {
// zqjia:res
@ -307,7 +307,7 @@ export default {
//
reset() {
this.form = {
handbookId: undefined,
planId: undefined,
handbookName: undefined,
handbookProcId: undefined,
handbookStatus: undefined,
@ -337,7 +337,7 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.handbookId)
this.ids = selection.map(item => item.planId)
this.single = selection.length!==1
this.multiple = !selection.length
},
@ -351,8 +351,8 @@ export default {
handleUpdate(row) {
this.loading = true;
this.reset();
const handbookId = row.handbookId || this.ids
getPlan(handbookId).then(response => {
const planId = row.planId || this.ids
getPlan(planId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
@ -364,7 +364,7 @@ export default {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.handbookId != null) {
if (this.form.planId != null) {
updatePlan(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
@ -386,10 +386,10 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const handbookIds = row.handbookId || this.ids;
this.$modal.confirm('是否确认删除项目申报v2编号为"' + handbookIds + '"的数据项?').then(() => {
const planIds = row.planId || this.ids;
this.$modal.confirm('是否确认删除项目申报计划编号为"' + planIds + '"的数据项?').then(() => {
this.loading = true;
return delPlan(handbookIds);
return delPlan(planIds);
}).then(() => {
this.loading = false;
this.getList();
@ -401,7 +401,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('scientific/project_application_plan/export', {
this.download('scientific/plan/export', {
...this.queryParams
}, `handbook_${new Date().getTime()}.xlsx`)
},
@ -481,50 +481,34 @@ export default {
}
},
projectApply(row) {
let queryParams = {
pageNum: 1,
pageSize: 10,
processKey: undefined,
processName: "项目申报",
category: "002"
};
//
listProcess(queryParams).then(response => {
const apply = response.rows[0];
if(apply) {
this.$router.push({
name: 'ProjectApply',
params: {
deployId: apply.deploymentId,
definitionId: apply.definitionId,
row: row
}
})
this.$router.push({
name: 'ProjectApply',
params: {
plan: row
}
});
})
},
listProjectInHandbook(handbookId) {
if (handbookId === undefined) {
handbookId = 1;
listProjectInPlan(planId) {
if (planId === undefined) {
planId = 1;
}
let queryParams = {
pageNum: 1,
pageSize: 10,
projectHandbookId: handbookId,
projectPlanId: planId,
};
this.$router.push({
name: 'planProjectQuery',
params: {
planId: handbookId,
planId: planId,
queryParams: queryParams,
}
})
},
handbookDetail(row) {
console.log('/scientific/project_application_plan/detail/' + row.handbookProcId)
planDetail(row) {
this.$router.push({
path: '/scientific/project_application_plan/detail/' + row.handbookProcId,
path: '/scientific/project_application_plan/detail/' + row.planProcId,
query: {
processed: false,
}

View File

@ -16,13 +16,13 @@
<script>
import { listProcess, startProcess_ } from '@/api/workflow/process'
import { listAllCategory } from '@/api/workflow/category'
import { getProcessForm, startProcess } from '@/api/workflow/process'
import Parser from '@/utils/generator/parser'
import { addPlan } from '@/api/scientific/project_application_plan'
import { addPlan, findLatestDeploymentTimeIndex } from '@/api/scientific/project_application_plan'
export default {
name: 'handbookApply',
name: 'planApply',
components: {
Parser
},
@ -43,7 +43,7 @@ export default {
pageNum: 1,
pageSize: 10,
processKey: undefined,
processName: "项目指南录入",
processName: "",
category: "007"
},
}
@ -51,24 +51,29 @@ export default {
created() {
this.initData();
},
methods: {
initData() {
this.handbook = this.$route.params && this.$route.params.handbook;
/** 查询流程定义列表 */
listProcess(this.queryParams).then(response => {
this.processParams = response.rows[0];
this.processName = this.processParams.processName;
this.definitionId = this.processParams.definitionId;
getProcessForm({
definitionId: this.processParams.definitionId,
deployId: this.processParams.deploymentId,
procInsId: undefined
}).then(res => {
if (res.data) {
this.formData = res.data;
this.formOpen = true;
}
})
findLatestDeploymentTimeIndex(response).then((latestIndex) => {
this.processParams = response.rows[latestIndex];
this.processName = this.processParams.processName;
this.definitionId = this.processParams.definitionId;
getProcessForm({
definitionId: this.processParams.definitionId,
deployId: this.processParams.deploymentId,
procInsId: undefined
}).then(res => {
if (res.data) {
this.formData = res.data;
this.formOpen = true;
}
})
});
})
},
@ -102,21 +107,21 @@ export default {
this.$modal.msgError("操作失败");
return;
}
let handbookData = data.valData;
handbookData.handbookProcId = res.msg;
let planData = data.valData;
planData.planProcId = res.msg;
// zqjia:
handbookData.handbookStatus = 1;
planData.planStatus = 1;
// zqjia:
const date1 = new Date(handbookData.projectAppStTime);
const date2 = new Date(handbookData.projectAppEndTime);
handbookData.projectAppStTime = this.formatDateTime(date1);
handbookData.projectAppEndTime = this.formatDateTime(date2);
const date3 = new Date(handbookData.reviewStTime);
const date4 = new Date(handbookData.reviewEndTime);
handbookData.reviewStTime = this.formatDateTime(date3);
handbookData.reviewEndTime = this.formatDateTime(date4);
// zqjia:handbookFile
const files = handbookData.handbookFile;
const date1 = new Date(planData.projectAppStTime);
const date2 = new Date(planData.projectAppEndTime);
planData.projectAppStTime = this.formatDateTime(date1);
planData.projectAppEndTime = this.formatDateTime(date2);
const date3 = new Date(planData.reviewStTime);
const date4 = new Date(planData.reviewEndTime);
planData.reviewStTime = this.formatDateTime(date3);
planData.reviewEndTime = this.formatDateTime(date4);
// zqjia:planFile
const files = planData.planFile;
if (files !== null) {
let formatedFiles = {};
files.forEach(file => {
@ -124,10 +129,14 @@ export default {
formatedFiles[file.name] = file.ossId;
}
})
handbookData.handbookFile = JSON.stringify(formatedFiles);
planData.planFile = JSON.stringify(formatedFiles);
}
addPlan(JSON.stringify(handbookData)).then(resp => {
if (this.handbook !== undefined) {
planData.handbookId = this.handbook.handbookId
}
addPlan(JSON.stringify(planData)).then(resp => {
if (res.code !== 200) {
this.$modal.msgError("操作失败");
return;
@ -135,7 +144,7 @@ export default {
this.$modal.msgSuccess(resp.msg);
this.$tab.closeOpenPage({
// zqjia:
path: '/scientific/handbookList'
path: '/scientific/project_application_plan/list'
})
});
})

View File

@ -1,108 +0,0 @@
package com.ruoyi.scientific.controller;
import java.util.List;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.core.validate.QueryGroup;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.scientific.domain.vo.HandbookVo;
import com.ruoyi.scientific.domain.bo.HandbookBo;
import com.ruoyi.scientific.service.IHandbookService;
import com.ruoyi.common.core.page.TableDataInfo;
/**
*
*
* @author zqjia
* @date 2024-07-29
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/scientific/handbook1")
public class HandbookController extends BaseController {
private final IHandbookService iHandbookService;
/**
*
*/
@SaCheckPermission("scientific:handbook1:list")
@GetMapping("/list")
public TableDataInfo<HandbookVo> list(HandbookBo bo, PageQuery pageQuery) {
return iHandbookService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("scientific:handbook1:export")
@Log(title = "项目申报指南", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HandbookBo bo, HttpServletResponse response) {
List<HandbookVo> list = iHandbookService.queryList(bo);
ExcelUtil.exportExcel(list, "项目申报指南", HandbookVo.class, response);
}
/**
*
*
* @param handbookId
*/
@SaCheckPermission("scientific:handbook1:query")
@GetMapping("/{handbookId}")
public R<HandbookVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long handbookId) {
return R.ok(iHandbookService.queryById(handbookId));
}
/**
*
*/
@SaCheckPermission("scientific:handbook1:add")
@Log(title = "项目申报指南", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody HandbookBo bo) {
return toAjax(iHandbookService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("scientific:handbook1:edit")
@Log(title = "项目申报指南", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody HandbookBo bo) {
return toAjax(iHandbookService.updateByBo(bo));
}
/**
*
*
* @param handbookIds
*/
@SaCheckPermission("scientific:handbook1:remove")
@Log(title = "项目申报指南", businessType = BusinessType.DELETE)
@DeleteMapping("/{handbookIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] handbookIds) {
return toAjax(iHandbookService.deleteWithValidByIds(Arrays.asList(handbookIds), true));
}
}

View File

@ -2,8 +2,9 @@ package com.ruoyi.scientific.controller;
import java.util.List;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import com.ruoyi.scientific.domain.bo.ProjectHandbookBo;
import com.ruoyi.scientific.service.IProjectHandbookService;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
@ -17,54 +18,51 @@ import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.core.validate.QueryGroup;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.scientific.domain.vo.ProjectHandbookVo;
import com.ruoyi.scientific.domain.bo.ProjectHandbookBo;
import com.ruoyi.scientific.service.IProjectHandbookService;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* v2
*
*
* @author ruoyi
* @date 2024-07-23
* @author zqjia
* @date 2024-07-29
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/scientific/plan")
@RequestMapping("/scientific/handbook")
public class ProjectHandbookController extends BaseController {
private final IProjectHandbookService iProjectHandbookService;
/**
* v2
*
*/
@SaCheckPermission("scientific:project_application_plan:list")
@SaCheckPermission("scientific:handbook:list")
@GetMapping("/list")
public TableDataInfo<ProjectHandbookVo> list(ProjectHandbookBo bo, PageQuery pageQuery) {
return iProjectHandbookService.queryPageList(bo, pageQuery);
}
/**
* v2
*
*/
@SaCheckPermission("scientific:plan:export")
@Log(title = "项目申报v2", businessType = BusinessType.EXPORT)
@SaCheckPermission("scientific:handbook:export")
@Log(title = "项目申报指南", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ProjectHandbookBo bo, HttpServletResponse response) {
List<ProjectHandbookVo> list = iProjectHandbookService.queryList(bo);
ExcelUtil.exportExcel(list, "项目申报v2", ProjectHandbookVo.class, response);
ExcelUtil.exportExcel(list, "项目申报指南", ProjectHandbookVo.class, response);
}
/**
* v2
*
*
* @param handbookId
*/
@SaCheckPermission("scientific:plan:query")
@SaCheckPermission("scientific:handbook:query")
@GetMapping("/{handbookId}")
public R<ProjectHandbookVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long handbookId) {
@ -72,10 +70,10 @@ public class ProjectHandbookController extends BaseController {
}
/**
* v2
*
*/
@SaCheckPermission("scientific:plan:add")
@Log(title = "项目申报v2", businessType = BusinessType.INSERT)
@SaCheckPermission("scientific:handbook:add")
@Log(title = "项目申报指南", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ProjectHandbookBo bo) {
@ -83,10 +81,10 @@ public class ProjectHandbookController extends BaseController {
}
/**
* v2
*
*/
@SaCheckPermission("scientific:plan:edit")
@Log(title = "项目申报v2", businessType = BusinessType.UPDATE)
@SaCheckPermission("scientific:handbook:edit")
@Log(title = "项目申报指南", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProjectHandbookBo bo) {
@ -94,12 +92,12 @@ public class ProjectHandbookController extends BaseController {
}
/**
* v2
*
*
* @param handbookIds
*/
@SaCheckPermission("scientific:plan:remove")
@Log(title = "项目申报v2", businessType = BusinessType.DELETE)
@SaCheckPermission("scientific:handbook:remove")
@Log(title = "项目申报指南", businessType = BusinessType.DELETE)
@DeleteMapping("/{handbookIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] handbookIds) {

View File

@ -0,0 +1,106 @@
package com.ruoyi.scientific.controller;
import java.util.List;
import java.util.Arrays;
import com.ruoyi.scientific.domain.bo.ProjectPlanBo;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.scientific.domain.vo.ProjectPlanVo;
import com.ruoyi.scientific.service.IProjectPlanService;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* v2
*
* @author ruoyi
* @date 2024-07-23
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/scientific/plan")
public class ProjectPlanController extends BaseController {
private final IProjectPlanService iProjectHandbookService;
/**
* v2
*/
@SaCheckPermission("scientific:project_application_plan:list")
@GetMapping("/list")
public TableDataInfo<ProjectPlanVo> list(ProjectPlanBo bo, PageQuery pageQuery) {
return iProjectHandbookService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("scientific:plan:export")
@Log(title = "项目申报v2", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ProjectPlanBo bo, HttpServletResponse response) {
List<ProjectPlanVo> list = iProjectHandbookService.queryList(bo);
ExcelUtil.exportExcel(list, "项目申报v2", ProjectPlanVo.class, response);
}
/**
*
*
* @param planId
*/
@SaCheckPermission("scientific:plan:query")
@GetMapping("/{planId}")
public R<ProjectPlanVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long planId) {
return R.ok(iProjectHandbookService.queryById(planId));
}
/**
*
*/
@SaCheckPermission("scientific:plan:add")
@Log(title = "项目申报计划", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ProjectPlanBo bo) {
return toAjax(iProjectHandbookService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("scientific:plan:edit")
@Log(title = "项目申报计划", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProjectPlanBo bo) {
return toAjax(iProjectHandbookService.updateByBo(bo));
}
/**
*
*
* @param planIds
*/
@SaCheckPermission("scientific:plan:remove")
@Log(title = "项目申报计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{planIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] planIds) {
return toAjax(iProjectHandbookService.deleteWithValidByIds(Arrays.asList(planIds), true));
}
}

View File

@ -1,65 +0,0 @@
package com.ruoyi.scientific.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* handbook
*
* @author zqjia
* @date 2024-07-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("handbook")
public class Handbook extends BaseEntity {
private static final long serialVersionUID=1L;
/**
* ID
*/
@TableId(value = "handbook_id")
private Long handbookId;
/**
*
*/
private String handbookName;
/**
*
*/
private String handbookCategory;
/**
* (4 3 2 1)
*/
private String handbookLevel;
/**
*
*/
private Date handbookDate;
/**
*
*/
private String handbookNote;
/**
*
*/
private String handbookFile;
/**
* Id
*/
private String handbookProcId;
/**
* (0 1 2 3)
*/
private String handbookStatus;
}

View File

@ -71,17 +71,17 @@ public class ProjectApplication extends BaseEntity {
private String projectLeaderPhone;
/**
* ID
* ID
*/
private Long projectHandbookId;
private Long projectPlanId;
/**
*
*
*/
private String projectHandbookName;
private String projectPlanName;
/**
* (0 1 2 )
* (0 1 2 )
*/
private String projectCategory;

View File

@ -3,19 +3,16 @@ package com.ruoyi.scientific.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* v2 project_handbook
* handbook
*
* @author ruoyi
* @date 2024-07-23
* @author zqjia
* @date 2024-07-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ -30,75 +27,36 @@ public class ProjectHandbook extends BaseEntity {
@TableId(value = "handbook_id")
private Long handbookId;
/**
*
*
*/
private String handbookName;
/**
* Id
*
*/
private String handbookCategory;
/**
* (4 3 2 1)
*/
private String handbookLevel;
/**
*
*/
private Date handbookDate;
/**
*
*/
private String handbookNote;
/**
*
*/
private String handbookFile;
/**
* Id
*/
private String handbookProcId;
/**
* (1 2 3)
* (0 1 2 3)
*/
private String handbookStatus;
/**
* (4 3 2 1)
*/
private String handbookLevel;
/**
*
*/
private String handbookFile;
/**
*
*/
private String handbookComment;
/**
*
*/
private Date projectAppStTime;
/**
*
*/
private Date projectAppEndTime;
/**
*
*/
private String projectSourceDepartment;
/**
* ()
*/
private String projectCategory;
/**
*
*/
private String projectSubclass;
/**
*
*/
private String reviewName;
/**
*
*/
private Date reviewStTime;
/**
*
*/
private Date reviewEndTime;
/**
*
*/
private String createName;
}

View File

@ -0,0 +1,105 @@
package com.ruoyi.scientific.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* v2 project_handbook
*
* @author ruoyi
* @date 2024-07-23
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_plan")
public class ProjectPlan extends BaseEntity {
private static final long serialVersionUID=1L;
/**
* ID
*/
@TableId(value = "plan_id")
private Long planId;
/**
*
*/
private String planName;
/**
* Id
*/
private String planProcId;
/**
* (1 2 3)
*/
private String planStatus;
/**
* (4 3 2 1)
*/
private String planLevel;
/**
*
*/
private String planFile;
/**
*
*/
private String planComment;
/**
*
*/
private Date projectAppStTime;
/**
*
*/
private Date projectAppEndTime;
/**
*
*/
private String projectSourceDepartment;
/**
* ()
*/
private String projectCategory;
/**
*
*/
private String projectSubclass;
/**
*
*/
private String reviewName;
/**
*
*/
private Date reviewStTime;
/**
*
*/
private Date reviewEndTime;
/**
*
*/
private String createName;
/**
* ID
*/
private Long handbookId;
}

View File

@ -1,81 +0,0 @@
package com.ruoyi.scientific.domain.bo;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.util.Date;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* handbook
*
* @author zqjia
* @date 2024-07-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class HandbookBo extends BaseEntity {
/**
* ID
*/
@NotNull(message = "项目ID不能为空", groups = { EditGroup.class })
private Long handbookId;
/**
*
*/
@NotBlank(message = "指南名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookName;
/**
*
*/
@NotBlank(message = "指南分类不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookCategory;
/**
* (4 3 2 1)
*/
@NotBlank(message = "指南级别(4院级 3市级 2省级 1国家级)不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookLevel;
/**
*
*/
@NotNull(message = "发布时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date handbookDate;
/**
*
*/
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookNote;
/**
*
*/
@NotBlank(message = "指南文件不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookFile;
/**
* Id
*/
@NotBlank(message = "指南录入流程实例Id不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookProcId;
/**
* (0 1 2 3)
*/
@NotBlank(message = "指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过)不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookStatus;
}

View File

@ -88,14 +88,14 @@ public class ProjectApplicationBo extends BaseEntity {
private String projectLeaderPhone;
/**
* ID
* ID
*/
private Long projectHandbookId;
private Long projectPlanId;
/**
*
*
*/
private String projectHandbookName;
private String projectPlanName;
/**
* (0 1 2 )

View File

@ -8,15 +8,13 @@ import javax.validation.constraints.*;
import java.util.Date;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* v2 project_handbook
* handbook
*
* @author ruoyi
* @date 2024-07-23
* @author zqjia
* @date 2024-07-29
*/
@Data
@ -30,85 +28,48 @@ public class ProjectHandbookBo extends BaseEntity {
private Long handbookId;
/**
*
*
*/
@NotBlank(message = "申报信息名称不能为空", groups = { AddGroup.class, EditGroup.class })
@NotBlank(message = "指南名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookName;
/**
* Id
*
*/
@NotBlank(message = "指南录入流程实例Id不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookProcId;
@NotBlank(message = "指南分类不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookCategory;
/**
* (1 2 3)
* (4 3 2 1)
*/
@NotBlank(message = "指南录入流程审核状态", groups = { AddGroup.class, EditGroup.class })
private String handbookStatus;
/**
* (4 3 2 1)
*/
@NotBlank(message = "项目指南级别(4院级 3市级 2省级 1国家级)不能为空", groups = { AddGroup.class, EditGroup.class })
@NotBlank(message = "指南级别(4院级 3市级 2省级 1国家级)不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookLevel;
/**
*
*
*/
private String handbookFile;
@NotNull(message = "发布时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date handbookDate;
/**
*
*/
private String handbookComment;
private String handbookNote;
/**
*
*
*/
@NotNull(message = "申报开始日期不能为空", groups = { AddGroup.class, EditGroup.class })
private Date projectAppStTime;
private String handbookFile;
/**
*
* Id
*/
@NotNull(message = "申报结束日期不能为空", groups = { AddGroup.class, EditGroup.class })
private Date projectAppEndTime;
private String handbookProcId;
/**
*
* (0 1 2 3)
*/
private String projectSourceDepartment;
private String handbookStatus;
/**
* ()
*/
private String projectCategory;
/**
*
*/
private String projectSubclass;
/**
*
*/
private String reviewName;
/**
*
*/
private Date reviewStTime;
/**
*
*/
private Date reviewEndTime;
/**
*
*/
private String createName;
}

View File

@ -0,0 +1,116 @@
package com.ruoyi.scientific.domain.bo;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.util.Date;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* v2 project_handbook
*
* @author ruoyi
* @date 2024-07-23
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class ProjectPlanBo extends BaseEntity {
/**
* ID
*/
@NotNull(message = "项目ID不能为空", groups = { EditGroup.class })
private Long planId;
/**
*
*/
@NotBlank(message = "申报信息名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String planName;
/**
* Id
*/
@NotBlank(message = "指南录入流程实例Id不能为空", groups = { AddGroup.class, EditGroup.class })
private String planProcId;
/**
* (1 2 3)
*/
@NotBlank(message = "指南录入流程审核状态", groups = { AddGroup.class, EditGroup.class })
private String planStatus;
/**
* (4 3 2 1)
*/
@NotBlank(message = "项目指南级别(4院级 3市级 2省级 1国家级)不能为空", groups = { AddGroup.class, EditGroup.class })
private String planLevel;
/**
*
*/
private String planFile;
/**
*
*/
private String planComment;
/**
*
*/
@NotNull(message = "申报开始日期不能为空", groups = { AddGroup.class, EditGroup.class })
private Date projectAppStTime;
/**
*
*/
@NotNull(message = "申报结束日期不能为空", groups = { AddGroup.class, EditGroup.class })
private Date projectAppEndTime;
/**
*
*/
private String projectSourceDepartment;
/**
* ()
*/
private String projectCategory;
/**
*
*/
private String projectSubclass;
/**
*
*/
private String reviewName;
/**
*
*/
private Date reviewStTime;
/**
*
*/
private Date reviewEndTime;
/**
*
*/
private String createName;
/**
* ID
*/
private Long handbookId;
}

View File

@ -1,81 +0,0 @@
package com.ruoyi.scientific.domain.vo;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.annotation.ExcelDictFormat;
import com.ruoyi.common.convert.ExcelDictConvert;
import lombok.Data;
import java.util.Date;
/**
* handbook
*
* @author zqjia
* @date 2024-07-29
*/
@Data
@ExcelIgnoreUnannotated
public class HandbookVo {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ExcelProperty(value = "项目ID")
private Long handbookId;
/**
*
*/
@ExcelProperty(value = "指南名称")
private String handbookName;
/**
*
*/
@ExcelProperty(value = "指南分类")
private String handbookCategory;
/**
* (4 3 2 1)
*/
@ExcelProperty(value = "指南级别(4院级 3市级 2省级 1国家级)")
private String handbookLevel;
/**
*
*/
@ExcelProperty(value = "发布时间")
private Date handbookDate;
/**
*
*/
@ExcelProperty(value = "备注")
private String handbookNote;
/**
*
*/
@ExcelProperty(value = "指南文件")
private String handbookFile;
/**
* Id
*/
@ExcelProperty(value = "指南录入流程实例Id")
private String handbookProcId;
/**
* (0 1 2 3)
*/
@ExcelProperty(value = "指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过)")
private String handbookStatus;
}

View File

@ -88,5 +88,23 @@ public class ProjectApplicationVo {
@ExcelProperty(value = "项目负责人联系电话")
private String projectLeaderPhone;
/**
* ID
*/
private Long projectPlanId;
/**
*
*/
private String projectPlanName;
/**
* (0 1 2 )
*/
private String projectCategory;
/**
*
*/
private String projectContent;
}

View File

@ -1,21 +1,17 @@
package com.ruoyi.scientific.domain.vo;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.annotation.ExcelDictFormat;
import com.ruoyi.common.convert.ExcelDictConvert;
import lombok.Data;
import java.util.Date;
/**
* v2 project_handbook
* handbook
*
* @author ruoyi
* @date 2024-07-23
* @author zqjia
* @date 2024-07-29
*/
@Data
@ExcelIgnoreUnannotated
@ -30,85 +26,52 @@ public class ProjectHandbookVo {
private Long handbookId;
/**
*
*
*/
@ExcelProperty(value = "申报信息名称")
@ExcelProperty(value = "指南名称")
private String handbookName;
/**
* Id
*
*/
@ExcelProperty(value = "项目立项流程实例Id")
private String handbookProcId;
@ExcelProperty(value = "指南分类")
private String handbookCategory;
/**
* (0 1 3)
* (4 3 2 1)
*/
@ExcelProperty(value = "项目审核状态(0未审核 1审核中 3审核通过)")
private String handbookStatus;
/**
* (0 1 3 4)
*/
@ExcelProperty(value = "项目指南级别(0市级 1区级 3省级 4国家级)")
@ExcelProperty(value = "指南级别(4院级 3市级 2省级 1国家级)")
private String handbookLevel;
/**
*
*
*/
@ExcelProperty(value = "发布时间")
private Date handbookDate;
/**
*
*/
@ExcelProperty(value = "备注")
private String handbookNote;
/**
*
*/
@ExcelProperty(value = "指南文件")
private String handbookFile;
/**
*
* Id
*/
private String handbookComment;
@ExcelProperty(value = "指南录入流程实例Id")
private String handbookProcId;
/**
*
* (0 1 2 3)
*/
@ExcelProperty(value = "申报开始日期")
private Date projectAppStTime;
/**
*
*/
@ExcelProperty(value = "申报结束日期")
private Date projectAppEndTime;
/**
*
*/
private String projectSourceDepartment;
/**
* ()
*/
private String projectCategory;
/**
*
*/
private String projectSubclass;
/**
*
*/
private String reviewName;
/**
*
*/
private Date reviewStTime;
/**
*
*/
private Date reviewEndTime;
/**
*
*/
private String createName;
@ExcelProperty(value = "指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过)")
private String handbookStatus;
}

View File

@ -0,0 +1,113 @@
package com.ruoyi.scientific.domain.vo;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* v2 project_handbook
*
* @author ruoyi
* @date 2024-07-23
*/
@Data
@ExcelIgnoreUnannotated
public class ProjectPlanVo {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ExcelProperty(value = "项目ID")
private Long planId;
/**
*
*/
@ExcelProperty(value = "申报信息名称")
private String planName;
/**
* Id
*/
@ExcelProperty(value = "项目立项流程实例Id")
private String planProcId;
/**
* (0 1 3)
*/
@ExcelProperty(value = "项目审核状态(0未审核 1审核中 3审核通过)")
private String planStatus;
/**
* (0 1 3 4)
*/
@ExcelProperty(value = "项目指南级别(0市级 1区级 3省级 4国家级)")
private String planLevel;
/**
*
*/
private String planFile;
/**
*
*/
private String planComment;
/**
*
*/
@ExcelProperty(value = "申报开始日期")
private Date projectAppStTime;
/**
*
*/
@ExcelProperty(value = "申报结束日期")
private Date projectAppEndTime;
/**
*
*/
private String projectSourceDepartment;
/**
* ()
*/
private String projectCategory;
/**
*
*/
private String projectSubclass;
/**
*
*/
private String reviewName;
/**
*
*/
private Date reviewStTime;
/**
*
*/
private Date reviewEndTime;
/**
*
*/
private String createName;
/**
* ID
*/
private Long handbookId;
}

View File

@ -1,50 +1,24 @@
package com.ruoyi.scientific.listener;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.flowable.common.constant.ProcessConstants;
import com.ruoyi.flowable.common.enums.ProcessStatus;
import com.ruoyi.scientific.service.IProjectApplicationService;
import com.ruoyi.scientific.domain.bo.ProjectHandbookBo;
import com.ruoyi.scientific.service.IProjectHandbookService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.springframework.stereotype.Component;
import org.springframework.beans.factory.annotation.Autowired;
import org.flowable.engine.HistoryService;
import com.ruoyi.scientific.domain.bo.ProjectHandbookBo;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.scientific.domain.vo.ProjectHandbookVo;
import com.ruoyi.common.core.page.TableDataInfo;
import java.util.Map;
import java.util.HashMap;
//@Component
//public class HandbookUpdateListener implements ExecutionListener {
//
// @Override
// public void notify(DelegateExecution execution) {
// System.out.println("当前活动名称: " + execution.getProcessInstanceBusinessStatus());
//
// if ("end".equals(execution.getEventName())) {
// if (execution.isEnded()) {
// System.out.println("任务被终止: " + execution.getId());
// } else {
// System.out.println("任务正常完成: " + execution.getId());
// }
// }
// }
//}
@Component
public class HandbookUpdateListener implements ExecutionListener {
/**
*
*/
private final IProjectHandbookService iProjectHandbookService =
private final IProjectHandbookService ihandbookServiceProject =
SpringUtils.getBean(IProjectHandbookService.class);
private final HistoryService historyService =
SpringUtils.getBean(HistoryService.class);
@ -54,13 +28,13 @@ public class HandbookUpdateListener implements ExecutionListener {
@Override
public void notify(DelegateExecution execution) {
System.out.println("科研模块:执行指南更新任务监听器...");
System.out.println("科研模块:执行申报指南更新任务监听器...");
String handbookProcId = execution.getProcessInstanceId();
ProjectHandbookBo bo = new ProjectHandbookBo();
bo.setHandbookProcId(handbookProcId);
PageQuery pageQuery = new PageQuery();
TableDataInfo<ProjectHandbookVo> result = iProjectHandbookService.queryPageList(bo, pageQuery);
TableDataInfo<ProjectHandbookVo> result = ihandbookServiceProject.queryPageList(bo, pageQuery);
Long handbookId = result.getRows().get(0).getHandbookId();
// zqjia:获取在task complete时注入的review状态
@ -69,16 +43,15 @@ public class HandbookUpdateListener implements ExecutionListener {
String status = (String) runtimeService.getVariable(handbookProcId, ProcessConstants.PROCESS_STATUS_KEY);
// zqjia: runtimeService获取是否terminated判断注入review字段可以区分是complete还是cancel
// 退回有bug暂时不知道会不会到这来
if("terminated".equals(status)) {
iProjectHandbookService.updateHandbookInfoById(handbookId, "2");
ihandbookServiceProject.updateHandbookInfoById(handbookId, "2");
}
else {
if("1".equals(reviewStatus)) {
iProjectHandbookService.updateHandbookInfoById(handbookId, "3");
ihandbookServiceProject.updateHandbookInfoById(handbookId, "3");
}
else {
iProjectHandbookService.updateHandbookInfoById(handbookId, "0");
ihandbookServiceProject.updateHandbookInfoById(handbookId, "0");
}
}
}

View File

@ -0,0 +1,76 @@
package com.ruoyi.scientific.listener;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.flowable.common.constant.ProcessConstants;
import com.ruoyi.scientific.service.IProjectPlanService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;
import org.flowable.engine.HistoryService;
import com.ruoyi.scientific.domain.bo.ProjectPlanBo;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.scientific.domain.vo.ProjectPlanVo;
import com.ruoyi.common.core.page.TableDataInfo;
//@Component
//public class HandbookUpdateListener implements ExecutionListener {
//
// @Override
// public void notify(DelegateExecution execution) {
// System.out.println("当前活动名称: " + execution.getProcessInstanceBusinessStatus());
//
// if ("end".equals(execution.getEventName())) {
// if (execution.isEnded()) {
// System.out.println("任务被终止: " + execution.getId());
// } else {
// System.out.println("任务正常完成: " + execution.getId());
// }
// }
// }
//}
@Component
public class PlanUpdateListener implements ExecutionListener {
/**
*
*/
private final IProjectPlanService iProjectHandbookService =
SpringUtils.getBean(IProjectPlanService.class);
private final HistoryService historyService =
SpringUtils.getBean(HistoryService.class);
private final RuntimeService runtimeService =
SpringUtils.getBean(RuntimeService.class);
@Override
public void notify(DelegateExecution execution) {
System.out.println("科研模块:执行申报计划更新任务监听器...");
String handbookProcId = execution.getProcessInstanceId();
ProjectPlanBo bo = new ProjectPlanBo();
bo.setPlanProcId(handbookProcId);
PageQuery pageQuery = new PageQuery();
TableDataInfo<ProjectPlanVo> result = iProjectHandbookService.queryPageList(bo, pageQuery);
Long handbookId = result.getRows().get(0).getPlanId();
// zqjia:获取在task complete时注入的review状态
String reviewStatus = (String) execution.getVariable("review");
// 获取流程状态
String status = (String) runtimeService.getVariable(handbookProcId, ProcessConstants.PROCESS_STATUS_KEY);
// zqjia: runtimeService获取是否terminated判断注入review字段可以区分是complete还是cancel
// 退回有bug暂时不知道会不会到这来
if("terminated".equals(status)) {
iProjectHandbookService.updateHandbookInfoById(handbookId, "2");
}
else {
if("1".equals(reviewStatus)) {
iProjectHandbookService.updateHandbookInfoById(handbookId, "3");
}
else {
iProjectHandbookService.updateHandbookInfoById(handbookId, "0");
}
}
}
}

View File

@ -1,15 +0,0 @@
package com.ruoyi.scientific.mapper;
import com.ruoyi.scientific.domain.Handbook;
import com.ruoyi.scientific.domain.vo.HandbookVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
/**
* Mapper
*
* @author zqjia
* @date 2024-07-29
*/
public interface HandbookMapper extends BaseMapperPlus<HandbookMapper, Handbook, HandbookVo> {
}

View File

@ -5,10 +5,10 @@ import com.ruoyi.scientific.domain.vo.ProjectHandbookVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
/**
* v2Mapper
* Mapper
*
* @author ruoyi
* @date 2024-07-23
* @author zqjia
* @date 2024-07-29
*/
public interface ProjectHandbookMapper extends BaseMapperPlus<ProjectHandbookMapper, ProjectHandbook, ProjectHandbookVo> {

View File

@ -0,0 +1,15 @@
package com.ruoyi.scientific.mapper;
import com.ruoyi.scientific.domain.ProjectPlan;
import com.ruoyi.scientific.domain.vo.ProjectPlanVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
/**
* v2Mapper
*
* @author ruoyi
* @date 2024-07-23
*/
public interface ProjectPlanMapper extends BaseMapperPlus<ProjectPlanMapper, ProjectPlan, ProjectPlanVo> {
}

View File

@ -1,49 +0,0 @@
package com.ruoyi.scientific.service;
import com.ruoyi.scientific.domain.Handbook;
import com.ruoyi.scientific.domain.vo.HandbookVo;
import com.ruoyi.scientific.domain.bo.HandbookBo;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author zqjia
* @date 2024-07-29
*/
public interface IHandbookService {
/**
*
*/
HandbookVo queryById(Long handbookId);
/**
*
*/
TableDataInfo<HandbookVo> queryPageList(HandbookBo bo, PageQuery pageQuery);
/**
*
*/
List<HandbookVo> queryList(HandbookBo bo);
/**
*
*/
Boolean insertByBo(HandbookBo bo);
/**
*
*/
Boolean updateByBo(HandbookBo bo);
/**
*
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

View File

@ -1,8 +1,7 @@
package com.ruoyi.scientific.service;
import com.ruoyi.scientific.domain.ProjectHandbook;
import com.ruoyi.scientific.domain.vo.ProjectHandbookVo;
import com.ruoyi.scientific.domain.bo.ProjectHandbookBo;
import com.ruoyi.scientific.domain.vo.ProjectHandbookVo;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
@ -10,40 +9,40 @@ import java.util.Collection;
import java.util.List;
/**
* v2Service
* Service
*
* @author ruoyi
* @date 2024-07-23
* @author zqjia
* @date 2024-07-29
*/
public interface IProjectHandbookService {
/**
* v2
*
*/
ProjectHandbookVo queryById(Long handbookId);
/**
* v2
*
*/
TableDataInfo<ProjectHandbookVo> queryPageList(ProjectHandbookBo bo, PageQuery pageQuery);
/**
* v2
*
*/
List<ProjectHandbookVo> queryList(ProjectHandbookBo bo);
/**
* v2
*
*/
Boolean insertByBo(ProjectHandbookBo bo);
/**
* v2
*
*/
Boolean updateByBo(ProjectHandbookBo bo);
/**
* v2
*
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

View File

@ -0,0 +1,53 @@
package com.ruoyi.scientific.service;
import com.ruoyi.scientific.domain.bo.ProjectPlanBo;
import com.ruoyi.scientific.domain.vo.ProjectPlanVo;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* v2Service
*
* @author ruoyi
* @date 2024-07-23
*/
public interface IProjectPlanService {
/**
* v2
*/
ProjectPlanVo queryById(Long handbookId);
/**
* v2
*/
TableDataInfo<ProjectPlanVo> queryPageList(ProjectPlanBo bo, PageQuery pageQuery);
/**
* v2
*/
List<ProjectPlanVo> queryList(ProjectPlanBo bo);
/**
* v2
*/
Boolean insertByBo(ProjectPlanBo bo);
/**
* v2
*/
Boolean updateByBo(ProjectPlanBo bo);
/**
* v2
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
*
*/
Boolean updateHandbookInfoById(Long handbookId, String status);
}

View File

@ -1,117 +0,0 @@
package com.ruoyi.scientific.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.ruoyi.scientific.domain.bo.HandbookBo;
import com.ruoyi.scientific.domain.vo.HandbookVo;
import com.ruoyi.scientific.domain.Handbook;
import com.ruoyi.scientific.mapper.HandbookMapper;
import com.ruoyi.scientific.service.IHandbookService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author zqjia
* @date 2024-07-29
*/
@RequiredArgsConstructor
@Service
public class HandbookServiceImpl implements IHandbookService {
private final HandbookMapper baseMapper;
/**
*
*/
@Override
public HandbookVo queryById(Long handbookId){
return baseMapper.selectVoById(handbookId);
}
/**
*
*/
@Override
public TableDataInfo<HandbookVo> queryPageList(HandbookBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<Handbook> lqw = buildQueryWrapper(bo);
Page<HandbookVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*/
@Override
public List<HandbookVo> queryList(HandbookBo bo) {
LambdaQueryWrapper<Handbook> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<Handbook> buildQueryWrapper(HandbookBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<Handbook> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getHandbookId() != null, Handbook::getHandbookId, bo.getHandbookId());
lqw.like(StringUtils.isNotBlank(bo.getHandbookName()), Handbook::getHandbookName, bo.getHandbookName());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookCategory()), Handbook::getHandbookCategory, bo.getHandbookCategory());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookLevel()), Handbook::getHandbookLevel, bo.getHandbookLevel());
lqw.eq(bo.getHandbookDate() != null, Handbook::getHandbookDate, bo.getHandbookDate());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookNote()), Handbook::getHandbookNote, bo.getHandbookNote());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookFile()), Handbook::getHandbookFile, bo.getHandbookFile());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookProcId()), Handbook::getHandbookProcId, bo.getHandbookProcId());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookStatus()), Handbook::getHandbookStatus, bo.getHandbookStatus());
return lqw;
}
/**
*
*/
@Override
public Boolean insertByBo(HandbookBo bo) {
Handbook add = BeanUtil.toBean(bo, Handbook.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setHandbookId(add.getHandbookId());
}
return flag;
}
/**
*
*/
@Override
public Boolean updateByBo(HandbookBo bo) {
Handbook update = BeanUtil.toBean(bo, Handbook.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(Handbook entity){
//TODO 做一些数据校验,如唯一约束
}
/**
*
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteBatchIds(ids) > 0;
}
}

View File

@ -75,7 +75,7 @@ public class ProjectApplicationServiceImpl implements IProjectApplicationService
// zqjia:自定义条件查询
lqw.eq(bo.getProjectHandbookId() != null, ProjectApplication::getProjectHandbookId, bo.getProjectHandbookId());
lqw.eq(bo.getProjectPlanId() != null, ProjectApplication::getProjectPlanId, bo.getProjectPlanId());
return lqw;
}

View File

@ -7,24 +7,23 @@ import com.ruoyi.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.scientific.domain.ProjectApplication;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.ruoyi.scientific.domain.bo.ProjectHandbookBo;
import com.ruoyi.scientific.domain.vo.ProjectHandbookVo;
import com.ruoyi.scientific.domain.ProjectHandbook;
import com.ruoyi.scientific.mapper.ProjectHandbookMapper;
import com.ruoyi.scientific.service.IProjectHandbookService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.ruoyi.scientific.domain.vo.ProjectHandbookVo;
import com.ruoyi.scientific.domain.ProjectHandbook;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* v2Service
* Service
*
* @author ruoyi
* @date 2024-07-23
* @author zqjia
* @date 2024-07-29
*/
@RequiredArgsConstructor
@Service
@ -33,7 +32,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
private final ProjectHandbookMapper baseMapper;
/**
* v2
*
*/
@Override
public ProjectHandbookVo queryById(Long handbookId){
@ -41,7 +40,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
}
/**
* v2
*
*/
@Override
public TableDataInfo<ProjectHandbookVo> queryPageList(ProjectHandbookBo bo, PageQuery pageQuery) {
@ -51,7 +50,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
}
/**
* v2
*
*/
@Override
public List<ProjectHandbookVo> queryList(ProjectHandbookBo bo) {
@ -62,20 +61,20 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
private LambdaQueryWrapper<ProjectHandbook> buildQueryWrapper(ProjectHandbookBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<ProjectHandbook> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getHandbookId() != null, ProjectHandbook::getHandbookId, bo.getHandbookId());
lqw.like(StringUtils.isNotBlank(bo.getHandbookName()), ProjectHandbook::getHandbookName, bo.getHandbookName());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookCategory()), ProjectHandbook::getHandbookCategory, bo.getHandbookCategory());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookLevel()), ProjectHandbook::getHandbookLevel, bo.getHandbookLevel());
lqw.eq(bo.getHandbookDate() != null, ProjectHandbook::getHandbookDate, bo.getHandbookDate());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookNote()), ProjectHandbook::getHandbookNote, bo.getHandbookNote());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookFile()), ProjectHandbook::getHandbookFile, bo.getHandbookFile());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookProcId()), ProjectHandbook::getHandbookProcId, bo.getHandbookProcId());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookStatus()), ProjectHandbook::getHandbookStatus, bo.getHandbookStatus());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookLevel()), ProjectHandbook::getHandbookLevel, bo.getHandbookLevel());
lqw.eq(bo.getProjectAppStTime() != null, ProjectHandbook::getProjectAppStTime, bo.getProjectAppStTime());
lqw.eq(bo.getProjectAppEndTime() != null, ProjectHandbook::getProjectAppEndTime, bo.getProjectAppEndTime());
return lqw;
}
/**
* v2
*
*/
@Override
public Boolean insertByBo(ProjectHandbookBo bo) {
@ -89,7 +88,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
}
/**
* v2
*
*/
@Override
public Boolean updateByBo(ProjectHandbookBo bo) {
@ -106,7 +105,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
}
/**
* v2
*
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
@ -122,7 +121,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
if (update == null) {
return false;
}
// 更新预算信息
// 更新状态信息
update.setHandbookStatus(status);
// 保存信息
validEntityBeforeSave(update);

View File

@ -0,0 +1,131 @@
package com.ruoyi.scientific.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.scientific.domain.bo.ProjectPlanBo;
import com.ruoyi.scientific.mapper.ProjectPlanMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.ruoyi.scientific.domain.vo.ProjectPlanVo;
import com.ruoyi.scientific.domain.ProjectPlan;
import com.ruoyi.scientific.service.IProjectPlanService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* v2Service
*
* @author ruoyi
* @date 2024-07-23
*/
@RequiredArgsConstructor
@Service
public class ProjectPlanServiceImpl implements IProjectPlanService {
private final ProjectPlanMapper baseMapper;
/**
* v2
*/
@Override
public ProjectPlanVo queryById(Long handbookId){
return baseMapper.selectVoById(handbookId);
}
/**
* v2
*/
@Override
public TableDataInfo<ProjectPlanVo> queryPageList(ProjectPlanBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<ProjectPlan> lqw = buildQueryWrapper(bo);
Page<ProjectPlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* v2
*/
@Override
public List<ProjectPlanVo> queryList(ProjectPlanBo bo) {
LambdaQueryWrapper<ProjectPlan> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<ProjectPlan> buildQueryWrapper(ProjectPlanBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<ProjectPlan> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(bo.getPlanName()), ProjectPlan::getPlanName, bo.getPlanName());
lqw.eq(StringUtils.isNotBlank(bo.getPlanProcId()), ProjectPlan::getPlanProcId, bo.getPlanProcId());
lqw.eq(StringUtils.isNotBlank(bo.getPlanStatus()), ProjectPlan::getPlanStatus, bo.getPlanStatus());
lqw.eq(StringUtils.isNotBlank(bo.getPlanLevel()), ProjectPlan::getPlanLevel, bo.getPlanLevel());
lqw.eq(bo.getProjectAppStTime() != null, ProjectPlan::getProjectAppStTime, bo.getProjectAppStTime());
lqw.eq(bo.getProjectAppEndTime() != null, ProjectPlan::getProjectAppEndTime, bo.getProjectAppEndTime());
return lqw;
}
/**
* v2
*/
@Override
public Boolean insertByBo(ProjectPlanBo bo) {
ProjectPlan add = BeanUtil.toBean(bo, ProjectPlan.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setPlanId(add.getPlanId());
}
return flag;
}
/**
* v2
*/
@Override
public Boolean updateByBo(ProjectPlanBo bo) {
ProjectPlan update = BeanUtil.toBean(bo, ProjectPlan.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(ProjectPlan entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* v2
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteBatchIds(ids) > 0;
}
public Boolean updateHandbookInfoById(Long handbookId, String status){
// 获取项目的详细信息
ProjectPlan update = baseMapper.selectById(handbookId);
if (update == null) {
return false;
}
// 更新状态信息
update.setPlanStatus(status);
// 保存信息
validEntityBeforeSave(update);
// 返回结果取决于是否更新成功
return baseMapper.updateById(update) > 0;
}
}

View File

@ -4,18 +4,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.scientific.mapper.ProjectHandbookMapper">
<resultMap type="com.ruoyi.scientific.domain.ProjectHandbook" id="ProjectHandbookResult">
<resultMap type="com.ruoyi.scientific.domain.ProjectHandbook" id="HandbookResult">
<result property="handbookId" column="handbook_id"/>
<result property="handbookName" column="handbook_name"/>
<result property="handbookCategory" column="handbook_category"/>
<result property="handbookLevel" column="handbook_level"/>
<result property="handbookDate" column="handbook_date"/>
<result property="handbookNote" column="handbook_note"/>
<result property="handbookFile" column="handbook_file"/>
<result property="handbookProcId" column="handbook_proc_id"/>
<result property="handbookStatus" column="handbook_status"/>
<result property="handbookType" column="handbook_type"/>
<result property="handbookLevel" column="handbook_level"/>
<result property="declareStatus" column="declare_status"/>
<result property="projectAppStTime" column="project_app_st_time"/>
<result property="projectAppEndTime" column="project_app_end_time"/>
<result property="handbookLeader" column="handbook_leader"/>
<result property="projectLeaderPhone" column="project_leader_phone"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>

View File

@ -2,18 +2,20 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.scientific.mapper.HandbookMapper">
<mapper namespace="com.ruoyi.scientific.mapper.ProjectPlanMapper">
<resultMap type="com.ruoyi.scientific.domain.Handbook" id="HandbookResult">
<resultMap type="com.ruoyi.scientific.domain.ProjectPlan" id="ProjectHandbookResult">
<result property="handbookId" column="handbook_id"/>
<result property="handbookName" column="handbook_name"/>
<result property="handbookCategory" column="handbook_category"/>
<result property="handbookLevel" column="handbook_level"/>
<result property="handbookDate" column="handbook_date"/>
<result property="handbookNote" column="handbook_note"/>
<result property="handbookFile" column="handbook_file"/>
<result property="handbookProcId" column="handbook_proc_id"/>
<result property="handbookStatus" column="handbook_status"/>
<result property="handbookType" column="handbook_type"/>
<result property="handbookLevel" column="handbook_level"/>
<result property="declareStatus" column="declare_status"/>
<result property="projectAppStTime" column="project_app_st_time"/>
<result property="projectAppEndTime" column="project_app_end_time"/>
<result property="handbookLeader" column="handbook_leader"/>
<result property="projectLeaderPhone" column="project_leader_phone"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>