1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-06 07:21:24 +08:00

Fuzzy query optimized more

This commit is contained in:
assina045
2023-06-08 20:49:29 +08:00
parent 3d04abc08a
commit 54dc7acba7
10 changed files with 67 additions and 89 deletions

View File

@@ -58,9 +58,8 @@ public class AffairController {
@GetMapping("/personal_affairs_fuzzy_queries")
@PreAuthorize("hasAuthority('affair:self:get')")
public ResponseResult getPersonalAffairsByTitle(String title,Long typeId,Integer status) {
System.out.println(title);
Long applicantId =WebUtil.getLoginUser().getUser().getId();
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getFuzzyQueriesByAffairTitle(title,typeId,status,applicantId));
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getFuzzyQueriesByAffairTitle(title.trim(),typeId,status,applicantId));
}
@GetMapping("/not_approved")
@@ -74,8 +73,8 @@ public class AffairController {
@GetMapping("/not_approved_FuzzyQueries")
@PreAuthorize("hasAuthority('affair:manage:get')")
public ResponseResult<List<Affair>> selectNotApprovedByFuzzyQueries(String title,Long typeId,Integer status,Long applicantId) {
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getNotApprovedByFuzzyQueries(title,typeId,status,applicantId));
public ResponseResult<List<Affair>> selectNotApprovedByFuzzyQueries(String title,Long typeId,Integer status,Long applicantId,LocalDateTime startTime,LocalDateTime endTime ) {
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getNotApprovedByFuzzyQueries(title,typeId,status,applicantId,startTime,endTime));
}

View File

@@ -43,7 +43,7 @@ public interface AffairMapper extends BaseMapper<Affair> {
List<Affair> getFuzzyQueriesByAffairTitle(String title, Long typeId, Integer status,Long applicantId);
List<Affair> getNotApprovedByFuzzyQueries(String title, Long typeId, Integer status,Long applicantId);
List<Affair> getNotApprovedByFuzzyQueries(String title, Long typeId, Integer status,Long applicantId ,LocalDateTime startTime,LocalDateTime endTime);
//
// @Select("SELECT t_affair.applicant_id,t_affair.inspector_id,t_user.id,t_user.username from t_affair,t_user ")

View File

@@ -26,7 +26,7 @@ public interface IAffairService extends IService<Affair> {
List<User> getSameDepartmentUser (long id);
List<Affair> getFuzzyQueriesByAffairTitle(String title,Long typeId,Integer status,Long applicantId);
List<Affair> getNotApprovedByFuzzyQueries(String title,Long typeId,Integer status,Long applicantId);
List<Affair> getNotApprovedByFuzzyQueries(String title,Long typeId,Integer status,Long applicantId,LocalDateTime startTime,LocalDateTime endTime);
}

View File

@@ -46,7 +46,8 @@ public class AffairServiceImpl extends ServiceImpl<AffairMapper, Affair> impleme
}
public List<Affair> getNotApprovedByFuzzyQueries(String title, Long typeId, Integer status, Long applicantId) {
return null;
public List<Affair> getNotApprovedByFuzzyQueries(String title, Long typeId, Integer status, Long applicantId, LocalDateTime startTime ,LocalDateTime endTime) {
List<Affair> affairList =affairMapper.getNotApprovedByFuzzyQueries(title,typeId,status,applicantId,startTime,endTime);
return affairList;
}
}

View File

@@ -2,7 +2,11 @@
<el-form :model="form" label-width="120px">
<el-form-item label="事务标题:">
<el-col :span="4">
<el-input v-model="form.title" placeholder="请输入事务标题" class="longInput" />
<el-input
v-model.trim="form.title"
placeholder="请输入事务标题"
class="longInput"
/>
</el-col>
</el-form-item>
@@ -78,7 +82,13 @@
</el-form-item>
<el-form-item label="具体内容:">
<el-input v-model="form.content" type="textarea" class="textarea" rows="15" cols="20" />
<el-input
v-model.trim="form.content"
type="textarea"
class="textarea"
rows="15"
cols="20"
/>
</el-form-item>
<el-form-item>
<el-col :span="6">
@@ -122,7 +132,8 @@ export default {
department_id: ''
},
sameDepartmentUsers: [],
grant: true
grant: true,
formView: false
}
},
methods: {
@@ -148,7 +159,7 @@ export default {
console.log(reportError)
})
this.getPersonalAffair()
this.$router.go()
this.$router.go(-1)
} else {
if (_.isEmpty(form.title)) {
ElMessage({

View File

@@ -1,6 +1,6 @@
<template>
<el-table :data="tableData" style="width: 100%">
<el-table-column label="事务编号" prop="id" />
<!-- <el-table-column label="事务编号" prop="id" />-->
<el-table-column label="事务名称" prop="title" />
@@ -19,7 +19,21 @@
</el-table-column>
<el-table-column label="申请者" prop="applicantId">
<el-text v-for="(user, index) in users" :key="index" :content="user.username" />
<template #default="scope">
{{
scope.row.applicantId === 1652714496280469506
? 'cyb'
: scope.row.applicantId === 1654151146072145921
? 'syf'
: scope.row.applicantId === 1654151877520973826
? 'gzw'
: scope.row.applicantId === 1654151930402746370
? 'yrm'
: scope.row.applicantId === 1
? 'admin'
: 'ggb'
}}
</template>
</el-table-column>
<el-table-column label="提交日期" prop="createTime">
<template #default="scope">
@@ -74,20 +88,6 @@
</el-col>
</el-row>
</el-dialog>
<el-divider>
<div class="block">
<el-pagination
style="color: #888888"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:page-size="100"
layout="prev, pager, next, jumper"
:total="1000"
>
</el-pagination>
</div>
</el-divider>
</template>
<script lang="ts">
@@ -165,12 +165,6 @@ export default {
console.log(reportError)
}) // 数据库中获取用户
},
handleSizeChange(val) {
console.log(`每页 ${val}`)
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
},
getApproved() {
request
.get('/affair/approved')
@@ -194,7 +188,6 @@ export default {
}
},
created() {
console.log('approved created')
this.getApproved()
this.dialogFalse()
this.getUser()
@@ -202,6 +195,7 @@ export default {
props: ['DataToRouterView'],
watch: {
DataToRouterView: function (val) {
this.getUser()
this.tableData = val
}
}

View File

@@ -1,6 +1,6 @@
<template>
<el-table :data="tableData" style="width: 100%">
<el-table-column label="事务编号" prop="id" />
<!-- <el-table-column label="事务编号" prop="id" />-->
<el-table-column label="事务名称" prop="title" />
@@ -80,20 +80,6 @@
</el-col>
</el-row>
</el-dialog>
<el-divider>
<div class="block">
<el-pagination
style="color: #888888"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:page-size="100"
layout="prev, pager, next, jumper"
:total="1000"
>
</el-pagination>
</div>
</el-divider>
</template>
<script lang="ts">
@@ -150,13 +136,6 @@ export default {
console.log(reportError)
}) // 审批驳回
},
handleSizeChange(val) {
console.log(`每页 ${val}`)
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
}, // 标签页
getApproved() {
request
.get('/affair/not_approved')
@@ -180,7 +159,6 @@ export default {
} // 关闭弹出框
},
created() {
console.log('not approved created')
this.getApproved()
this.dialogFalse()
}, // 获取事务信息

View File

@@ -1,6 +1,6 @@
<template>
<el-table :data="tableData" style="width: 100%">
<el-table-column label="事务编号" prop="id" />
<!-- <el-table-column label="事务编号" prop="id" />-->
<el-table-column label="事务名称" prop="title" />
@@ -18,16 +18,16 @@
</template>
</el-table-column>
<el-table-column label="审批者" prop="applicantId">
<el-table-column label="审批者" prop="inspectorId">
<template #default="scope">
{{
scope.row.applicantId === 1
scope.row.inspectorId === 1
? 'ggb'
: scope.row.applicantId === 1652714496280469506
: scope.row.inspectorId === 1652714496280469506
? 'cyb'
: scope.row.applicantId === 1654151146072145921
: scope.row.inspectorId === 1654151146072145921
? 'syf'
: scope.row.applicantId === 1654151877520973826
: scope.row.inspectorId === 1654151877520973826
? 'gzw'
: 'yrm'
}}
@@ -86,18 +86,6 @@
</el-col>
</el-row>
</el-dialog>
<el-divider>
<div class="block">
<el-pagination
style="color: #888888"
:page-size="100"
layout="prev, pager, next, jumper"
:total="1000"
>
</el-pagination>
</div>
</el-divider>
</template>
<script lang="ts">

View File

@@ -27,7 +27,7 @@
<el-col :span="1"></el-col>
<el-col :span="4">
<el-form-item label="事务类型:"
><el-select v-model="formData.typeId">
><el-select v-model="formData.typeId" clearable>
<el-option label="事假" name="type1" value="1"></el-option>
<el-option label="病假" name="type2" value="2"></el-option>
<el-option label="财务报销" name="type3" value="3"></el-option>
@@ -35,14 +35,19 @@
</el-select> </el-form-item
></el-col>
<el-col :span="1"></el-col>
<el-col :span="4"
><el-form-item label="审批进度:">
<el-select v-model="formData.status">
<el-option label="未审批" value="0"></el-option>
<el-option label="同意" value="1"></el-option>
<el-option label="驳回" value="2"></el-option>
</el-select> </el-form-item
></el-col>
<!-- <el-col :xs="6" :sm="6" :md="5" :lg="8" :xl="10">-->
<!-- <el-form-item label="日期:" prop="timeRang">-->
<!-- <el-date-picker-->
<!-- v-model="forTime"-->
<!-- type="datetimerange"-->
<!-- range-separator="至"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- style="width: auto"-->
<!-- >-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="1"></el-col>
<el-col :span="3">
<el-button type="primary" @click="onSubmit">查询</el-button>
@@ -67,7 +72,9 @@ export default {
formData: {
title: '',
typeId: '',
status: ''
status: '',
startTime: '',
endTime: ''
},
DataToRouterView: {}
}
@@ -81,7 +88,7 @@ export default {
},
onSubmit() {
request
.get('/affair/personal_affairs_fuzzy_queries', this.formData)
.get('/affair/not_approved_FuzzyQueries', this.formData)
.then((response) => {
this.DataToRouterView = response.data.data
console.log(response.data)

View File

@@ -31,7 +31,7 @@
<el-col :span="1"></el-col>
<el-col :span="4">
<el-form-item label="事务类型:"
><el-select v-model="formData.typeId">
><el-select v-model="formData.typeId" clearable>
<el-option label="事假" name="type1" value="1"></el-option>
<el-option label="病假" name="type2" value="2"></el-option>
<el-option label="财务报销" name="type3" value="3"></el-option>
@@ -41,7 +41,7 @@
<el-col :span="1"></el-col>
<el-col :span="4"
><el-form-item label="审批进度:">
<el-select v-model="formData.status">
<el-select v-model="formData.status" clearable>
<el-option label="未审批" value="0"></el-option>
<el-option label="同意" value="1"></el-option>
<el-option label="驳回" value="2"></el-option>