This commit is contained in:
2025-08-28 11:29:30 +08:00
parent f364119414
commit c93cf2f36c
2 changed files with 307 additions and 0 deletions
@@ -0,0 +1,73 @@
package com.budwk.app.zhgh.outlay.outlayReimburse.service.impl;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.zhgh.outlay.outlayReimburse.service.OutlayReimburseSummaryService;
import com.budwk.app.zhgh.outlay.outlayReimburse.vo.OutlayReimbursePageForm;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* @author zhf
* @date 2025/8/21 09:17
* @description
*/
@IocBean(args = {"refer:dao"})
public class OutlayReimburseSummaryServiceImpl extends BaseServiceImpl implements OutlayReimburseSummaryService {
public OutlayReimburseSummaryServiceImpl(Dao dao) {
super(dao);
}
@Override
public Sql getSql(OutlayReimbursePageForm pageForm) {
Sql sql = Sqls.create("""
SELECT
info.*,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariale,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariale,
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
(SELECT MAX(id) FROM wf_process_task WHERE processInstanceId = ins.id AND taskName = 'startTask' AND taskState IN (10, 20)) AS startTaskId
FROM
outlay_reimburse info
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
AND t.taskState = 10
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("info.unionId", "=", pageForm.getUnionId());
cnd.andEX("info.outlayManageSource", "=", pageForm.getOutlayManageSource());
cnd.andEX("YEAR(info.applyTime)", "=", pageForm.getYear());
cnd.andEX("info.detailsTypeId", "=", pageForm.getDetailsTypeId());
cnd.and("ins.state", "=", ProcessTaskStateEnum.FINISHED.getCode());
if (StrUtil.isAllNotEmpty(pageForm.getSearchName(), pageForm.getSearchKeyword())) {
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
}
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.desc("t.createdAt").desc("info.applyTime");
} else {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
sql.setCondition(cnd);
return sql;
}
}
@@ -0,0 +1,234 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="开始年度:">
<el-date-picker
v-model="pageForm.startYear"
type="year"
class="picker-year"
format="yyyy"
style="width: 100%"
value-format="yyyy"
placeholder="请选择开始年度"
@change="handleChangeYear"
>
</el-date-picker>
</search-item>
<search-item label="结束年度:">
<el-date-picker
v-model="pageForm.endYear"
type="year"
class="picker-year"
format="yyyy"
style="width: 100%"
value-format="yyyy"
placeholder="请选择结束年度"
@change="handleChangeYear"
>
</el-date-picker>
</search-item>
<search-item label="旅行社:">
<el-select clearable filterable style="width: 100%"
v-model="pageForm.travelAgencyId"
@change="doSearch"
placeholder="请选择旅行社">
<el-option :key="item.id"
:label="item.travelAgencyName"
:value="item.id"
v-for="item in travelAgencyList"
></el-option>
</el-select>
</search-item>
<search-item label="线路名称:">
<el-input @keyup.enter.native="doSearch" clearable clearable
placeholder="请输入内容"
style="width: 100%"
v-model="pageForm.lineName">
</el-input>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt20">
<table-tool label="线路列表">
<el-button type="primary" size="small" @click="onAdd">
<i class="ti-plus"></i>
新增线路
</el-button>
</table-tool>
<el-table :data="tableData" @sort-change="pageOrder" :size="tableSize">
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:key="column.prop"
:width="column.width"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template v-slot="{ row }" v-if="column.prop === 'isDisabled'">
<el-switch
:active-value="true"
:inactive-value="false"
@change="(val)=>{lineStatusChange(row.id)}"
active-color="#13ce66"
inactive-color="#ff4949"
v-model="row.isDisabled">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="230">
<template v-slot="{ row }">
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="onEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button @click="onDelete(row)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<basic-form ref="basicFormRef" @refresh="refresh"
:travel-list="travelAgencyList"
></basic-form>
</template>
<template #view>
<info ref="infoRef"></info>
</template>
</guava>
</div>
<script>
<!--#include('basicForm.js'){}#-->
<!--#include('info.js'){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
components: {
"basic-form": basicForm,
"info": info,
},
data() {
return {
travelAgencyList: [],
unionOptions: [],
showImportDialog: false,
tableColumns: [
{label: '年度', prop: 'year', sortable: true},
{label: '线路名称', prop: 'lineName', sortable: true, width: '200'},
{label: '承担旅行社', prop: 'travelAgencyName', sortable: true},
{label: '创建人', prop: 'createUserName', sortable: true},
{label: '是否启用', prop: 'isDisabled', sortable: true}
],
}
},
methods: {
async lineStatusChange(id) {
const resp = await this.$axios.post(loc() + '/openClosedLine/' + id)
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
},
async getEnumOptions(enumName) {
const resp = await this.$axios.post("/open/common/dictEnumOptions", { name: enumName })
return resp.data
},
async selectTravelAgencyList() {
const resp = await this.$axios.post('/platform/excellentRecuperation/travelAgency/selectTravelAgency', {year: this.formData.year})
this.travelAgencyList = resp.data
},
handleChangeYear(){
if (this.pageForm.startYear && this.pageForm.endYear){
if (this.pageForm.startYear > this.pageForm.endYear){
this.pageForm.endYear = '';
this.$message.error('起始年份需小于结束年份!');
}
}
},
async travelAgencyStatusChange(id) {
const resp = await $.post(loc() + '/openClosedLine/' + id)
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
},
refresh() {
this.doSearch()
this.$refs.guava.index()
},
onView(row) {
this.$refs.guava.view(() => {
this.$refs.infoRef.onOpen(row.id)
})
},
onAdd() {
this.$refs.guava.edit(() => {
this.$refs.basicFormRef.onOpen()
})
},
onEdit(row) {
this.$refs.guava.edit(() => {
this.$refs.basicFormRef.onOpen(row)
})
},
onDelete(row) {
this.$confirm("您确定要删除吗, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.$axios.post("/platform/excellentRecuperation/line/onDelete", { id: row.id }).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
})
.catch(() => {})
},
pageData() {
this.$axios.post(loc() + "/pageData", this.pageForm).then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
},
async initData() {
await this.selectTravelAgencyList()
this.signUpModeList = await this.getEnumOptions('RecuperationSignUpMode')
this.unionOptions = await this.$businessTool.listUnion()
}
},
async created() {
await this.initData()
this.pageData()
}
})
</script>
<!--#
}
#-->