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({ return request({
url: '/scientific/plan/' + handbookId, url: '/scientific/plan/' + planId,
method: 'delete' 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', path: '/scientific/project_application_plan',
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['scientific:project_application_plan'], permissions: ['scientific:plan'],
children: [ children: [
// zqjia:这个路由是菜单管理里的起作用 // zqjia:这个路由是菜单管理里的起作用
// { // {
@ -230,13 +230,12 @@ export const dynamicRoutes = [
name: 'planDetail', name: 'planDetail',
meta: { title: '申报计划详情' } meta: { title: '申报计划详情' }
}, },
// zqjia:这个路由是菜单管理里的起作用 {
// { path: 'planApply',
// path: 'planApply', component: () => import('@/views/scientific/project_application_plan/planApply'),
// component: () => import('@/views/scientific/project_application_plan/planApply'), name: 'planApply',
// name: 'planApply', meta: { title: '项目申报', icon: '' }
// meta: { title: '项目申报', icon: '' } },
// },
] ]
}, },
// 项目路由 // 项目路由
@ -268,13 +267,49 @@ export const dynamicRoutes = [
meta: { title: '已申报项目' } meta: { title: '已申报项目' }
}, },
{ {
path: 'projectApply/:deployId([\\w|\\-]+)', path: 'projectApply',
component: () => import('@/views/scientific/project/projectApply.vue'), component: () => import('@/views/scientific/project/projectApply'),
name: 'ProjectApply', name: 'ProjectApply',
meta: { title: '项目申报', icon: '' } 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> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <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-form-item label="指南名称" prop="handbookName">
<el-input <el-input
v-model="queryParams.handbookName" v-model="queryParams.handbookName"
@ -25,10 +17,10 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="指南级别(4院级 3市级 2省级 1国家级)" prop="handbookLevel"> <el-form-item label="指南级别" prop="handbookLevel">
<el-input <el-input
v-model="queryParams.handbookLevel" v-model="queryParams.handbookLevel"
placeholder="请输入指南级别(4院级 3市级 2省级 1国家级)" placeholder="请输入指南级别"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -41,22 +33,7 @@
placeholder="请选择发布时间"> placeholder="请选择发布时间">
</el-date-picker> </el-date-picker>
</el-form-item> </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-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-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 v-loading="loading" :data="handbookList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <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="handbookName" />
<el-table-column label="指南分类" align="center" prop="handbookCategory" /> <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"> <el-table-column label="发布时间" align="center" prop="handbookDate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.handbookDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.handbookDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="handbookNote" />
<el-table-column label="指南文件" align="center" prop="handbookFile" /> <!-- <el-table-column label="指南文件" align="center" prop="handbookFile" />-->
<el-table-column label="指南录入流程实例Id" align="center" prop="handbookProcId" /> <!-- <el-table-column label="指南录入流程状态" align="center" prop="handbookStatus" />-->
<el-table-column label="指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过)" align="center" prop="handbookStatus" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <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 <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleHandbookDetail(scope.row)"
v-hasPermi="['scientific:project_application_plan:edit']" v-hasPermi="['scientific:project_application_plan:edit']"
>修改</el-button> >详情</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handlePlanApply(scope.row)"
v-hasPermi="['scientific:project_application_plan:remove']" v-hasPermi="['scientific:project_application_plan:remove']"
>删除</el-button> >发布计划</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -192,9 +182,16 @@
<script> <script>
import { listHandbook, getHandbook, delHandbook, addHandbook, updateHandbook } from "@/api/scientific/handbook"; 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 { export default {
name: "Handbook", name: "Handbook",
computed: {
planApply() {
return planApply
}
},
data() { data() {
return { return {
// loading // loading
@ -229,7 +226,7 @@ export default {
handbookNote: undefined, handbookNote: undefined,
handbookFile: undefined, handbookFile: undefined,
handbookProcId: undefined, handbookProcId: undefined,
handbookStatus: undefined, handbookStatus: 3,
}, },
// //
form: {}, form: {},
@ -381,7 +378,24 @@ export default {
this.download('scientific/project_application_plan/export', { this.download('scientific/project_application_plan/export', {
...this.queryParams ...this.queryParams
}, `handbook_${new Date().getTime()}.xlsx`) }, `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> </script>

View File

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

View File

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

View File

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

View File

@ -16,13 +16,13 @@
<script> <script>
import { listProcess, startProcess_ } from '@/api/workflow/process' import { listProcess, startProcess_ } from '@/api/workflow/process'
import { listAllCategory } from '@/api/workflow/category'
import { getProcessForm, startProcess } from '@/api/workflow/process' import { getProcessForm, startProcess } from '@/api/workflow/process'
import Parser from '@/utils/generator/parser' 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 { export default {
name: 'handbookApply', name: 'planApply',
components: { components: {
Parser Parser
}, },
@ -43,7 +43,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
processKey: undefined, processKey: undefined,
processName: "项目指南录入", processName: "",
category: "007" category: "007"
}, },
} }
@ -51,14 +51,18 @@ export default {
created() { created() {
this.initData(); this.initData();
}, },
methods: { methods: {
initData() { initData() {
this.handbook = this.$route.params && this.$route.params.handbook;
/** 查询流程定义列表 */ /** 查询流程定义列表 */
listProcess(this.queryParams).then(response => { listProcess(this.queryParams).then(response => {
this.processParams = response.rows[0]; findLatestDeploymentTimeIndex(response).then((latestIndex) => {
this.processParams = response.rows[latestIndex];
this.processName = this.processParams.processName; this.processName = this.processParams.processName;
this.definitionId = this.processParams.definitionId; this.definitionId = this.processParams.definitionId;
getProcessForm({ getProcessForm({
definitionId: this.processParams.definitionId, definitionId: this.processParams.definitionId,
deployId: this.processParams.deploymentId, deployId: this.processParams.deploymentId,
@ -69,6 +73,7 @@ export default {
this.formOpen = true; this.formOpen = true;
} }
}) })
});
}) })
}, },
@ -102,21 +107,21 @@ export default {
this.$modal.msgError("操作失败"); this.$modal.msgError("操作失败");
return; return;
} }
let handbookData = data.valData; let planData = data.valData;
handbookData.handbookProcId = res.msg; planData.planProcId = res.msg;
// zqjia: // zqjia:
handbookData.handbookStatus = 1; planData.planStatus = 1;
// zqjia: // zqjia:
const date1 = new Date(handbookData.projectAppStTime); const date1 = new Date(planData.projectAppStTime);
const date2 = new Date(handbookData.projectAppEndTime); const date2 = new Date(planData.projectAppEndTime);
handbookData.projectAppStTime = this.formatDateTime(date1); planData.projectAppStTime = this.formatDateTime(date1);
handbookData.projectAppEndTime = this.formatDateTime(date2); planData.projectAppEndTime = this.formatDateTime(date2);
const date3 = new Date(handbookData.reviewStTime); const date3 = new Date(planData.reviewStTime);
const date4 = new Date(handbookData.reviewEndTime); const date4 = new Date(planData.reviewEndTime);
handbookData.reviewStTime = this.formatDateTime(date3); planData.reviewStTime = this.formatDateTime(date3);
handbookData.reviewEndTime = this.formatDateTime(date4); planData.reviewEndTime = this.formatDateTime(date4);
// zqjia:handbookFile // zqjia:planFile
const files = handbookData.handbookFile; const files = planData.planFile;
if (files !== null) { if (files !== null) {
let formatedFiles = {}; let formatedFiles = {};
files.forEach(file => { files.forEach(file => {
@ -124,10 +129,14 @@ export default {
formatedFiles[file.name] = file.ossId; 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) { if (res.code !== 200) {
this.$modal.msgError("操作失败"); this.$modal.msgError("操作失败");
return; return;
@ -135,7 +144,7 @@ export default {
this.$modal.msgSuccess(resp.msg); this.$modal.msgSuccess(resp.msg);
this.$tab.closeOpenPage({ this.$tab.closeOpenPage({
// zqjia: // 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.List;
import java.util.Arrays; 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 lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*; 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.domain.R;
import com.ruoyi.common.core.validate.AddGroup; import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup; import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.core.validate.QueryGroup;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.scientific.domain.vo.ProjectHandbookVo; 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; import com.ruoyi.common.core.page.TableDataInfo;
/** /**
* v2 *
* *
* @author ruoyi * @author zqjia
* @date 2024-07-23 * @date 2024-07-29
*/ */
@Validated @Validated
@RequiredArgsConstructor @RequiredArgsConstructor
@RestController @RestController
@RequestMapping("/scientific/plan") @RequestMapping("/scientific/handbook")
public class ProjectHandbookController extends BaseController { public class ProjectHandbookController extends BaseController {
private final IProjectHandbookService iProjectHandbookService; private final IProjectHandbookService iProjectHandbookService;
/** /**
* v2 *
*/ */
@SaCheckPermission("scientific:project_application_plan:list") @SaCheckPermission("scientific:handbook:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<ProjectHandbookVo> list(ProjectHandbookBo bo, PageQuery pageQuery) { public TableDataInfo<ProjectHandbookVo> list(ProjectHandbookBo bo, PageQuery pageQuery) {
return iProjectHandbookService.queryPageList(bo, pageQuery); return iProjectHandbookService.queryPageList(bo, pageQuery);
} }
/** /**
* v2 *
*/ */
@SaCheckPermission("scientific:plan:export") @SaCheckPermission("scientific:handbook:export")
@Log(title = "项目申报v2", businessType = BusinessType.EXPORT) @Log(title = "项目申报指南", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(ProjectHandbookBo bo, HttpServletResponse response) { public void export(ProjectHandbookBo bo, HttpServletResponse response) {
List<ProjectHandbookVo> list = iProjectHandbookService.queryList(bo); List<ProjectHandbookVo> list = iProjectHandbookService.queryList(bo);
ExcelUtil.exportExcel(list, "项目申报v2", ProjectHandbookVo.class, response); ExcelUtil.exportExcel(list, "项目申报指南", ProjectHandbookVo.class, response);
} }
/** /**
* v2 *
* *
* @param handbookId * @param handbookId
*/ */
@SaCheckPermission("scientific:plan:query") @SaCheckPermission("scientific:handbook:query")
@GetMapping("/{handbookId}") @GetMapping("/{handbookId}")
public R<ProjectHandbookVo> getInfo(@NotNull(message = "主键不能为空") public R<ProjectHandbookVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long handbookId) { @PathVariable Long handbookId) {
@ -72,10 +70,10 @@ public class ProjectHandbookController extends BaseController {
} }
/** /**
* v2 *
*/ */
@SaCheckPermission("scientific:plan:add") @SaCheckPermission("scientific:handbook:add")
@Log(title = "项目申报v2", businessType = BusinessType.INSERT) @Log(title = "项目申报指南", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ProjectHandbookBo bo) { public R<Void> add(@Validated(AddGroup.class) @RequestBody ProjectHandbookBo bo) {
@ -83,10 +81,10 @@ public class ProjectHandbookController extends BaseController {
} }
/** /**
* v2 *
*/ */
@SaCheckPermission("scientific:plan:edit") @SaCheckPermission("scientific:handbook:edit")
@Log(title = "项目申报v2", businessType = BusinessType.UPDATE) @Log(title = "项目申报指南", businessType = BusinessType.UPDATE)
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProjectHandbookBo bo) { public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProjectHandbookBo bo) {
@ -94,12 +92,12 @@ public class ProjectHandbookController extends BaseController {
} }
/** /**
* v2 *
* *
* @param handbookIds * @param handbookIds
*/ */
@SaCheckPermission("scientific:plan:remove") @SaCheckPermission("scientific:handbook:remove")
@Log(title = "项目申报v2", businessType = BusinessType.DELETE) @Log(title = "项目申报指南", businessType = BusinessType.DELETE)
@DeleteMapping("/{handbookIds}") @DeleteMapping("/{handbookIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] handbookIds) { @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; 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; private String projectCategory;

View File

@ -3,19 +3,16 @@ package com.ruoyi.scientific.domain;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* v2 project_handbook * handbook
* *
* @author ruoyi * @author zqjia
* @date 2024-07-23 * @date 2024-07-29
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ -30,75 +27,36 @@ public class ProjectHandbook extends BaseEntity {
@TableId(value = "handbook_id") @TableId(value = "handbook_id")
private Long handbookId; private Long handbookId;
/** /**
* *
*/ */
private String handbookName; 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; private String handbookProcId;
/** /**
* (1 2 3) * (0 1 2 3)
*/ */
private String handbookStatus; 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; private String projectLeaderPhone;
/** /**
* ID * ID
*/ */
private Long projectHandbookId; private Long projectPlanId;
/** /**
* *
*/ */
private String projectHandbookName; private String projectPlanName;
/** /**
* (0 1 2 ) * (0 1 2 )

View File

@ -8,15 +8,13 @@ import javax.validation.constraints.*;
import java.util.Date; import java.util.Date;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* v2 project_handbook * handbook
* *
* @author ruoyi * @author zqjia
* @date 2024-07-23 * @date 2024-07-29
*/ */
@Data @Data
@ -30,85 +28,48 @@ public class ProjectHandbookBo extends BaseEntity {
private Long handbookId; private Long handbookId;
/** /**
* *
*/ */
@NotBlank(message = "申报信息名称不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "指南名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookName; private String handbookName;
/** /**
* Id *
*/ */
@NotBlank(message = "指南录入流程实例Id不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "指南分类不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookProcId; private String handbookCategory;
/** /**
* (1 2 3) * (4 3 2 1)
*/ */
@NotBlank(message = "指南录入流程审核状态", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "指南级别(4院级 3市级 2省级 1国家级)不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookStatus;
/**
* (4 3 2 1)
*/
@NotBlank(message = "项目指南级别(4院级 3市级 2省级 1国家级)不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookLevel; private String handbookLevel;
/** /**
* *
*/ */
@NotNull(message = "发布时间不能为空", groups = { AddGroup.class, EditGroup.class })
private String handbookFile; private Date handbookDate;
/** /**
* *
*/ */
private String handbookComment; private String handbookNote;
/** /**
* *
*/ */
@NotNull(message = "申报开始日期不能为空", groups = { AddGroup.class, EditGroup.class }) private String handbookFile;
private Date projectAppStTime;
/** /**
* * Id
*/ */
@NotNull(message = "申报结束日期不能为空", groups = { AddGroup.class, EditGroup.class }) private String handbookProcId;
private Date projectAppEndTime;
/** /**
* * (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 = "项目负责人联系电话") @ExcelProperty(value = "项目负责人联系电话")
private String projectLeaderPhone; 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; package com.ruoyi.scientific.domain.vo;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.annotation.ExcelDictFormat;
import com.ruoyi.common.convert.ExcelDictConvert;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* v2 project_handbook * handbook
* *
* @author ruoyi * @author zqjia
* @date 2024-07-23 * @date 2024-07-29
*/ */
@Data @Data
@ExcelIgnoreUnannotated @ExcelIgnoreUnannotated
@ -30,85 +26,52 @@ public class ProjectHandbookVo {
private Long handbookId; private Long handbookId;
/** /**
* *
*/ */
@ExcelProperty(value = "申报信息名称") @ExcelProperty(value = "指南名称")
private String handbookName; private String handbookName;
/** /**
* Id *
*/ */
@ExcelProperty(value = "项目立项流程实例Id") @ExcelProperty(value = "指南分类")
private String handbookProcId; private String handbookCategory;
/** /**
* (0 1 3) * (4 3 2 1)
*/ */
@ExcelProperty(value = "项目审核状态(0未审核 1审核中 3审核通过)") @ExcelProperty(value = "指南级别(4院级 3市级 2省级 1国家级)")
private String handbookStatus;
/**
* (0 1 3 4)
*/
@ExcelProperty(value = "项目指南级别(0市级 1区级 3省级 4国家级)")
private String handbookLevel; private String handbookLevel;
/** /**
* *
*/ */
@ExcelProperty(value = "发布时间")
private Date handbookDate;
/**
*
*/
@ExcelProperty(value = "备注")
private String handbookNote;
/**
*
*/
@ExcelProperty(value = "指南文件")
private String handbookFile; private String handbookFile;
/** /**
* * Id
*/ */
private String handbookComment; @ExcelProperty(value = "指南录入流程实例Id")
private String handbookProcId;
/** /**
* * (0 1 2 3)
*/ */
@ExcelProperty(value = "申报开始日期") @ExcelProperty(value = "指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过)")
private Date projectAppStTime; private String handbookStatus;
/**
*
*/
@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;
} }

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; 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.common.utils.spring.SpringUtils;
import com.ruoyi.flowable.common.constant.ProcessConstants; import com.ruoyi.flowable.common.constant.ProcessConstants;
import com.ruoyi.flowable.common.enums.ProcessStatus; import com.ruoyi.scientific.domain.bo.ProjectHandbookBo;
import com.ruoyi.scientific.service.IProjectApplicationService;
import com.ruoyi.scientific.service.IProjectHandbookService; import com.ruoyi.scientific.service.IProjectHandbookService;
import org.flowable.engine.RuntimeService; import org.flowable.engine.RuntimeService;
import org.flowable.engine.delegate.DelegateExecution; import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener; import org.flowable.engine.delegate.ExecutionListener;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.beans.factory.annotation.Autowired;
import org.flowable.engine.HistoryService; import org.flowable.engine.HistoryService;
import com.ruoyi.scientific.domain.bo.ProjectHandbookBo;
import com.ruoyi.common.core.domain.PageQuery; import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.scientific.domain.vo.ProjectHandbookVo; import com.ruoyi.scientific.domain.vo.ProjectHandbookVo;
import com.ruoyi.common.core.page.TableDataInfo; 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 @Component
public class HandbookUpdateListener implements ExecutionListener { public class HandbookUpdateListener implements ExecutionListener {
/** /**
* *
*/ */
private final IProjectHandbookService iProjectHandbookService = private final IProjectHandbookService ihandbookServiceProject =
SpringUtils.getBean(IProjectHandbookService.class); SpringUtils.getBean(IProjectHandbookService.class);
private final HistoryService historyService = private final HistoryService historyService =
SpringUtils.getBean(HistoryService.class); SpringUtils.getBean(HistoryService.class);
@ -54,13 +28,13 @@ public class HandbookUpdateListener implements ExecutionListener {
@Override @Override
public void notify(DelegateExecution execution) { public void notify(DelegateExecution execution) {
System.out.println("科研模块:执行指南更新任务监听器..."); System.out.println("科研模块:执行申报指南更新任务监听器...");
String handbookProcId = execution.getProcessInstanceId(); String handbookProcId = execution.getProcessInstanceId();
ProjectHandbookBo bo = new ProjectHandbookBo(); ProjectHandbookBo bo = new ProjectHandbookBo();
bo.setHandbookProcId(handbookProcId); bo.setHandbookProcId(handbookProcId);
PageQuery pageQuery = new PageQuery(); 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(); Long handbookId = result.getRows().get(0).getHandbookId();
// zqjia:获取在task complete时注入的review状态 // zqjia:获取在task complete时注入的review状态
@ -69,16 +43,15 @@ public class HandbookUpdateListener implements ExecutionListener {
String status = (String) runtimeService.getVariable(handbookProcId, ProcessConstants.PROCESS_STATUS_KEY); String status = (String) runtimeService.getVariable(handbookProcId, ProcessConstants.PROCESS_STATUS_KEY);
// zqjia: runtimeService获取是否terminated判断注入review字段可以区分是complete还是cancel // zqjia: runtimeService获取是否terminated判断注入review字段可以区分是complete还是cancel
// 退回有bug暂时不知道会不会到这来
if("terminated".equals(status)) { if("terminated".equals(status)) {
iProjectHandbookService.updateHandbookInfoById(handbookId, "2"); ihandbookServiceProject.updateHandbookInfoById(handbookId, "2");
} }
else { else {
if("1".equals(reviewStatus)) { if("1".equals(reviewStatus)) {
iProjectHandbookService.updateHandbookInfoById(handbookId, "3"); ihandbookServiceProject.updateHandbookInfoById(handbookId, "3");
} }
else { 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; import com.ruoyi.common.core.mapper.BaseMapperPlus;
/** /**
* v2Mapper * Mapper
* *
* @author ruoyi * @author zqjia
* @date 2024-07-23 * @date 2024-07-29
*/ */
public interface ProjectHandbookMapper extends BaseMapperPlus<ProjectHandbookMapper, ProjectHandbook, ProjectHandbookVo> { 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; 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.bo.ProjectHandbookBo;
import com.ruoyi.scientific.domain.vo.ProjectHandbookVo;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery; import com.ruoyi.common.core.domain.PageQuery;
@ -10,40 +9,40 @@ import java.util.Collection;
import java.util.List; import java.util.List;
/** /**
* v2Service * Service
* *
* @author ruoyi * @author zqjia
* @date 2024-07-23 * @date 2024-07-29
*/ */
public interface IProjectHandbookService { public interface IProjectHandbookService {
/** /**
* v2 *
*/ */
ProjectHandbookVo queryById(Long handbookId); ProjectHandbookVo queryById(Long handbookId);
/** /**
* v2 *
*/ */
TableDataInfo<ProjectHandbookVo> queryPageList(ProjectHandbookBo bo, PageQuery pageQuery); TableDataInfo<ProjectHandbookVo> queryPageList(ProjectHandbookBo bo, PageQuery pageQuery);
/** /**
* v2 *
*/ */
List<ProjectHandbookVo> queryList(ProjectHandbookBo bo); List<ProjectHandbookVo> queryList(ProjectHandbookBo bo);
/** /**
* v2 *
*/ */
Boolean insertByBo(ProjectHandbookBo bo); Boolean insertByBo(ProjectHandbookBo bo);
/** /**
* v2 *
*/ */
Boolean updateByBo(ProjectHandbookBo bo); Boolean updateByBo(ProjectHandbookBo bo);
/** /**
* v2 *
*/ */
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); 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:自定义条件查询 // zqjia:自定义条件查询
lqw.eq(bo.getProjectHandbookId() != null, ProjectApplication::getProjectHandbookId, bo.getProjectHandbookId()); lqw.eq(bo.getProjectPlanId() != null, ProjectApplication::getProjectPlanId, bo.getProjectPlanId());
return lqw; 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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; 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.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.mapper.ProjectHandbookMapper;
import com.ruoyi.scientific.service.IProjectHandbookService; 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.List;
import java.util.Map; import java.util.Map;
import java.util.Collection; import java.util.Collection;
/** /**
* v2Service * Service
* *
* @author ruoyi * @author zqjia
* @date 2024-07-23 * @date 2024-07-29
*/ */
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
@ -33,7 +32,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
private final ProjectHandbookMapper baseMapper; private final ProjectHandbookMapper baseMapper;
/** /**
* v2 *
*/ */
@Override @Override
public ProjectHandbookVo queryById(Long handbookId){ public ProjectHandbookVo queryById(Long handbookId){
@ -41,7 +40,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
} }
/** /**
* v2 *
*/ */
@Override @Override
public TableDataInfo<ProjectHandbookVo> queryPageList(ProjectHandbookBo bo, PageQuery pageQuery) { public TableDataInfo<ProjectHandbookVo> queryPageList(ProjectHandbookBo bo, PageQuery pageQuery) {
@ -51,7 +50,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
} }
/** /**
* v2 *
*/ */
@Override @Override
public List<ProjectHandbookVo> queryList(ProjectHandbookBo bo) { public List<ProjectHandbookVo> queryList(ProjectHandbookBo bo) {
@ -62,20 +61,20 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
private LambdaQueryWrapper<ProjectHandbook> buildQueryWrapper(ProjectHandbookBo bo) { private LambdaQueryWrapper<ProjectHandbook> buildQueryWrapper(ProjectHandbookBo bo) {
Map<String, Object> params = bo.getParams(); Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<ProjectHandbook> lqw = Wrappers.lambdaQuery(); 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.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.getHandbookProcId()), ProjectHandbook::getHandbookProcId, bo.getHandbookProcId());
lqw.eq(StringUtils.isNotBlank(bo.getHandbookStatus()), ProjectHandbook::getHandbookStatus, bo.getHandbookStatus()); 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; return lqw;
} }
/** /**
* v2 *
*/ */
@Override @Override
public Boolean insertByBo(ProjectHandbookBo bo) { public Boolean insertByBo(ProjectHandbookBo bo) {
@ -89,7 +88,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
} }
/** /**
* v2 *
*/ */
@Override @Override
public Boolean updateByBo(ProjectHandbookBo bo) { public Boolean updateByBo(ProjectHandbookBo bo) {
@ -106,7 +105,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
} }
/** /**
* v2 *
*/ */
@Override @Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
@ -122,7 +121,7 @@ public class ProjectHandbookServiceImpl implements IProjectHandbookService {
if (update == null) { if (update == null) {
return false; return false;
} }
// 更新预算信息 // 更新状态信息
update.setHandbookStatus(status); update.setHandbookStatus(status);
// 保存信息 // 保存信息
validEntityBeforeSave(update); 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"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.scientific.mapper.ProjectHandbookMapper"> <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="handbookId" column="handbook_id"/>
<result property="handbookName" column="handbook_name"/> <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="handbookProcId" column="handbook_proc_id"/>
<result property="handbookStatus" column="handbook_status"/> <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="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>

View File

@ -2,18 +2,20 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "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="handbookId" column="handbook_id"/>
<result property="handbookName" column="handbook_name"/> <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="handbookProcId" column="handbook_proc_id"/>
<result property="handbookStatus" column="handbook_status"/> <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="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>