mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 15:01:23 +08:00
Fuzzy query was completed and AffairsCard optimized
This commit is contained in:
@@ -55,11 +55,12 @@ public class AffairController {
|
|||||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper));
|
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/personal_affairs_title")
|
@GetMapping("/personal_affairs_fuzzy_queries")
|
||||||
@PreAuthorize("hasAuthority('affair:self:get')")
|
@PreAuthorize("hasAuthority('affair:self:get')")
|
||||||
public ResponseResult getPersonalAffairsByTitle(String title,Integer typeId,Integer status,Integer inspectorId,String startTime,String endTime) {
|
public ResponseResult getPersonalAffairsByTitle(String title,Long typeId,Integer status) {
|
||||||
System.out.println(title);
|
System.out.println(title);
|
||||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getFuzzyQueriesByAffairTitle(title,typeId,status,inspectorId,startTime,endTime));
|
Long applicantId =WebUtil.getLoginUser().getUser().getId();
|
||||||
|
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.getFuzzyQueriesByAffairTitle(title,typeId,status,applicantId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/not_approved")
|
@GetMapping("/not_approved")
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public interface AffairMapper extends BaseMapper<Affair> {
|
|||||||
List<User> getSameDepartmentUser(@Param("id") long id);
|
List<User> getSameDepartmentUser(@Param("id") long id);
|
||||||
|
|
||||||
|
|
||||||
List<Affair> getFuzzyQueriesByAffairTitle(String title, Integer typeId, Integer status, Integer inspectorId,LocalDateTime start,LocalDateTime end );
|
List<Affair> getFuzzyQueriesByAffairTitle(String title, Long typeId, Integer status,Long applicantId);
|
||||||
|
|
||||||
//
|
//
|
||||||
// @Select("SELECT t_affair.applicant_id,t_affair.inspector_id,t_user.id,t_user.username from t_affair,t_user ")
|
// @Select("SELECT t_affair.applicant_id,t_affair.inspector_id,t_user.id,t_user.username from t_affair,t_user ")
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public interface IAffairService extends IService<Affair> {
|
|||||||
|
|
||||||
// int deleteAffair_ApprovedByID(Affair affair);
|
// int deleteAffair_ApprovedByID(Affair affair);
|
||||||
List<User> getSameDepartmentUser (long id);
|
List<User> getSameDepartmentUser (long id);
|
||||||
List<Affair> getFuzzyQueriesByAffairTitle(String title,Integer typeId,Integer status,Integer inspectorId,String startTime,String endTime);
|
List<Affair> getFuzzyQueriesByAffairTitle(String title,Long typeId,Integer status,Long applicantId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,13 +40,8 @@ public class AffairServiceImpl extends ServiceImpl<AffairMapper, Affair> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<Affair> getFuzzyQueriesByAffairTitle(String title ,Integer typeId,Integer status,Integer inspectorId,String startTime, String endTime) {
|
public List<Affair> getFuzzyQueriesByAffairTitle(String title ,Long typeId,Integer status,Long applicantId) {
|
||||||
LocalDateTime start=null,end=null;
|
List<Affair> affairList = affairMapper.getFuzzyQueriesByAffairTitle(title,typeId,status,applicantId);
|
||||||
if (startTime!=""&&endTime!=""){
|
|
||||||
start= LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
||||||
end = LocalDateTime.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
||||||
}
|
|
||||||
List<Affair> affairList = affairMapper.getFuzzyQueriesByAffairTitle(title,typeId,status,inspectorId,start,end);
|
|
||||||
return affairList;
|
return affairList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,12 @@
|
|||||||
*
|
*
|
||||||
from t_affair
|
from t_affair
|
||||||
<where>
|
<where>
|
||||||
|
<if test=" applicantId !=null">
|
||||||
|
applicant_id = #{applicantId}
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test=" title!=null and title!='' ">
|
<if test=" title!=null and title!='' ">
|
||||||
instr(title,#{title})>0
|
and instr(title,#{title})>0
|
||||||
</if>
|
</if>
|
||||||
<if test=" typeId!=null ">
|
<if test=" typeId!=null ">
|
||||||
and instr(type_id,#{typeId})>0
|
and instr(type_id,#{typeId})>0
|
||||||
@@ -34,15 +38,6 @@
|
|||||||
<if test="status!=null ">
|
<if test="status!=null ">
|
||||||
and instr(status,#{status})>0
|
and instr(status,#{status})>0
|
||||||
</if>
|
</if>
|
||||||
<if test="inspectorId!=null">
|
|
||||||
and instr(inspector_id,#{inspectorId})>0
|
|
||||||
</if>
|
|
||||||
<if test="createTime!=null">
|
|
||||||
and create_time >= #{start}
|
|
||||||
</if>
|
|
||||||
<if test="endTime!=null">
|
|
||||||
and create_time < #{end}
|
|
||||||
</if>
|
|
||||||
</where>
|
</where>
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<el-col :span="16">
|
||||||
|
<div class="mt-4">
|
||||||
|
<el-input placeholder="查询事务" class="input-with-select">
|
||||||
|
<template #prepend>
|
||||||
|
<el-select placeholder="查询方式">
|
||||||
|
<el-option label="事务编号" value="1" />
|
||||||
|
<el-option label="事务名称" value="2" />
|
||||||
|
<el-option label="日期" value="3" />
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #append>
|
||||||
|
<el-button>查询</el-button>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
<el-table :data="tableData" style="width: 100%">
|
<el-table :data="tableData" style="width: 100%">
|
||||||
<el-table-column label="事务编号" prop="id" />
|
<el-table-column label="事务编号" prop="id" />
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<el-col :span="16">
|
||||||
|
<div class="mt-4">
|
||||||
|
<el-input placeholder="查询事务" class="input-with-select">
|
||||||
|
<template #prepend>
|
||||||
|
<el-select placeholder="查询方式">
|
||||||
|
<el-option label="事务编号" value="1" />
|
||||||
|
<el-option label="事务名称" value="2" />
|
||||||
|
<el-option label="日期" value="3" />
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #append>
|
||||||
|
<el-button>查询</el-button>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
<el-table :data="tableData" style="width: 100%">
|
<el-table :data="tableData" style="width: 100%">
|
||||||
<el-table-column label="事务编号" prop="id" />
|
<el-table-column label="事务编号" prop="id" />
|
||||||
|
|
||||||
|
|||||||
@@ -192,13 +192,34 @@ export default {
|
|||||||
dialogFalse() {
|
dialogFalse() {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
}
|
}
|
||||||
|
// forRouter() {
|
||||||
|
// setInterval(() => {
|
||||||
|
// if (this.DataToRouterView !== '') {
|
||||||
|
// this.tableData = this.DataToRouterView
|
||||||
|
// }
|
||||||
|
// }, 500)
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getApproved()
|
this.getApproved()
|
||||||
this.dialogFalse()
|
this.dialogFalse()
|
||||||
this.getGrantUser()
|
this.getGrantUser()
|
||||||
|
// this.forRouter()
|
||||||
// this.getInspectorName()
|
// this.getInspectorName()
|
||||||
|
},
|
||||||
|
props: ['DataToRouterView'],
|
||||||
|
watch: {
|
||||||
|
DataToRouterView: function (val) {
|
||||||
|
this.tableData = val
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style></style>
|
<style>
|
||||||
|
.el-header {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
.el-form {
|
||||||
|
margin-top: 1px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
>
|
>
|
||||||
<el-col :xs="4" :sm="4" :md="3" :lg="3" :xl="2" style="text-align: right"
|
<el-col :xs="4" :sm="4" :md="3" :lg="3" :xl="2" style="text-align: right"
|
||||||
><el-text type="info" style="line-height: 32px">{{
|
><el-text type="info" style="line-height: 32px">{{
|
||||||
item.status
|
item.status === 0 ? '未审批' : item.status === 1 ? '同意' : '驳回'
|
||||||
}}</el-text></el-col
|
}}</el-text></el-col
|
||||||
>
|
>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|||||||
@@ -1,23 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :span="24">
|
<el-container>
|
||||||
<el-col :span="16">
|
<el-header>
|
||||||
<div class="mt-4">
|
<el-col :span="24">
|
||||||
<el-input placeholder="查询事务" class="input-with-select">
|
|
||||||
<template #prepend>
|
|
||||||
<el-select placeholder="查询方式">
|
|
||||||
<el-option label="事务编号" value="1" />
|
|
||||||
<el-option label="事务名称" value="2" />
|
|
||||||
<el-option label="日期" value="3" />
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
<template #append>
|
|
||||||
<el-button>查询</el-button>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-menu
|
<el-menu
|
||||||
:default-active="$route.path"
|
:default-active="$route.path"
|
||||||
class="el-menu-demo"
|
class="el-menu-demo"
|
||||||
@@ -25,22 +9,107 @@
|
|||||||
router
|
router
|
||||||
background-color="white"
|
background-color="white"
|
||||||
>
|
>
|
||||||
<el-menu-item index="/affair/personal/person">
|
<el-menu-item index="/affair/personal/person" @click="turnFormViewTrue">
|
||||||
<el-button type="success" round>我的事务</el-button>
|
我的事务
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item index="/affair/personal/add">
|
<el-menu-item index="/affair/personal/add" @click="turnFormViewFalse">
|
||||||
<el-button type="success" round>添加事务</el-button>
|
添加事务
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-header>
|
||||||
|
|
||||||
|
<el-main>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form v-if="formView" :model="formData">
|
||||||
|
<el-row :span="24">
|
||||||
|
<el-col :span="5">
|
||||||
|
<el-form-item label="事务标题:"
|
||||||
|
><el-input v-model="formData.title"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1"></el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<el-form-item label="事务类型:"
|
||||||
|
><el-select v-model="formData.typeId">
|
||||||
|
<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>
|
||||||
|
<el-option label="调休" name="type4" value="4"></el-option>
|
||||||
|
</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 :span="1"></el-col>
|
||||||
|
<el-col :span="3">
|
||||||
|
<el-button type="primary" @click="onSubmit">查询</el-button>
|
||||||
|
<el-button type="primary" @click="resetForm">重置</el-button>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<router-view></router-view>
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
<router-view :DataToRouterView="DataToRouterView"></router-view>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import request from '@/services'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'personalAffairsView'
|
data() {
|
||||||
|
return {
|
||||||
|
formView: true,
|
||||||
|
formData: {
|
||||||
|
title: '',
|
||||||
|
typeId: '',
|
||||||
|
status: ''
|
||||||
|
},
|
||||||
|
DataToRouterView: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
turnFormViewFalse() {
|
||||||
|
this.formView = false
|
||||||
|
},
|
||||||
|
turnFormViewTrue() {
|
||||||
|
this.formView = true
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
request
|
||||||
|
.get('/affair/personal_affairs_fuzzy_queries', this.formData)
|
||||||
|
.then((response) => {
|
||||||
|
this.DataToRouterView = response.data.data
|
||||||
|
console.log(response.data)
|
||||||
|
})
|
||||||
|
.catch((reportError) => {
|
||||||
|
console.log(reportError)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resetForm() {
|
||||||
|
this.$router.go()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
.longInput {
|
||||||
|
width: 99%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.textarea {
|
||||||
|
height: 70%;
|
||||||
|
width: 70%;
|
||||||
|
}
|
||||||
|
.roleSelect {
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user