疗休养优化1.1

This commit is contained in:
2026-06-14 17:53:58 +08:00
parent f4f8387c1e
commit 6b892bb026
6 changed files with 63 additions and 11 deletions
@@ -39,14 +39,14 @@ public class TourSchoolUserAssignmentController {
}
/**
* 分页查询校工会分配记录,列表数据只来自人员分配表。
* 分页查询人员分配记录,列表数据只来自人员分配表,默认由前端传入校工会分配类别
*/
@At
@SaCheckPermission("tour.schoolUserAssignment")
public Result pageData(PageForm pageForm, Integer year, String settingId, String matterId, String unionId,
String personType, String keyword) {
String personType, String keyword, String assignSource) {
return Result.success(tourUserAssignmentService.schoolAssignmentPage(pageForm, year, settingId, matterId,
unionId, personType, keyword));
unionId, personType, keyword, assignSource));
}
/**
@@ -522,12 +522,31 @@ public class TourSignupController {
IFNULL(lot.allowOverReimbursement, 0) AS allowOverReimbursement,
s.allowFamily,
IFNULL(s.fillBedInfo, 1) AS fillBedInfo,
s.boardingPlace AS boardingPlaceOptions
s.boardingPlace AS boardingPlaceOptions,
IFNULL(sc.signupCount, 0) AS signupCount,
IFNULL(sc.familyCount, 0) AS familyCount
FROM tour_matter m
INNER JOIN tour_line l ON l.id = m.lineId
LEFT JOIN tour_travel_agency a ON a.id = l.travelAgencyId
LEFT JOIN tour_setting_lot lot ON lot.id = l.lotId
LEFT JOIN tour_setting s ON s.id = m.settingId
LEFT JOIN (
SELECT
t.matterId,
COUNT(1) + SUM(IFNULL(f.familyCount, 0)) AS signupCount,
SUM(IFNULL(f.familyCount, 0)) AS familyCount
FROM tour_ledger t
LEFT JOIN (
SELECT ledgerId, COUNT(1) AS familyCount
FROM tour_ledger_family
WHERE delFlag = 0
GROUP BY ledgerId
) f ON f.ledgerId = t.id
WHERE t.delFlag = 0
AND t.matterId IS NOT NULL
AND t.matterId <> ''
GROUP BY t.matterId
) sc ON sc.matterId = m.id
WHERE m.delFlag = 0
AND m.enabled = 1
AND m.id = @matterId
@@ -20,10 +20,11 @@ public interface TourUserAssignmentService extends BaseService<TourUserAssignmen
* @param unionId 所属分工会ID
* @param personType 人员类型:FORMAL 正式人员,BACKUP 替补人员
* @param keyword 姓名或工号关键字
* @param assignSource 分配类别:SCHOOL_UNION 校工会分配,BRANCH_UNION 分工会分配;为空时查询全部
* @return 校工会分配记录分页数据
*/
Pagination<NutMap> schoolAssignmentPage(PageForm pageForm, Integer year, String settingId, String matterId,
String unionId, String personType, String keyword);
String unionId, String personType, String keyword, String assignSource);
/**
* 分页查询校工会可分配候选人,候选人来自疗休养配置的可参加人员范围,并排除同一配置下已分配人员。
@@ -45,7 +45,7 @@ public class TourUserAssignmentServiceImpl extends BaseServiceImpl<TourUserAssig
@Override
public Pagination<NutMap> schoolAssignmentPage(PageForm pageForm, Integer year, String settingId, String matterId,
String unionId, String personType, String keyword) {
String unionId, String personType, String keyword, String assignSource) {
Sql sql = Sqls.create("""
SELECT
a.*,
@@ -63,7 +63,8 @@ public class TourUserAssignmentServiceImpl extends BaseServiceImpl<TourUserAssig
""");
Cnd cnd = Cnd.NEW();
cnd.and("a.delFlag", "=", false);
cnd.and("a.assignSource", "=", TourUserAssignment.ASSIGN_SOURCE_SCHOOL_UNION);
// 分配类别由页面筛选控制;为空时校工会页面可查看全部来源,默认值仍由前端传入校工会分配。
cnd.andEX("a.assignSource", "=", assignSource);
cnd.andEX("s.`year`", "=", year);
cnd.andEX("a.settingId", "=", settingId);
cnd.andEX("a.matterId", "=", matterId);
@@ -1182,6 +1183,8 @@ public class TourUserAssignmentServiceImpl extends BaseServiceImpl<TourUserAssig
cnd.orderBy("a.lineName", orderBy);
} else if ("personType".equals(orderName)) {
cnd.orderBy("a.personType", orderBy);
} else if ("assignSource".equals(orderName)) {
cnd.orderBy("a.assignSource", orderBy);
} else if ("assignedAt".equals(orderName)) {
cnd.orderBy("a.assignedAt", orderBy);
}
@@ -37,6 +37,11 @@ layout("/layouts/platform.html"){
<el-option label="替补人员" value="BACKUP"></el-option>
</el-select>
</search-item>
<search-item label="分配类别">
<el-select v-model="pageForm.assignSource" clearable placeholder="请选择分配类别" style="width: 100%">
<el-option v-for="item in assignSourceOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</search-item>
<search-item label="姓名/工号">
<el-input
v-model="pageForm.keyword"
@@ -75,6 +80,11 @@ layout("/layouts/platform.html"){
<el-table-column label="线路" prop="lineName" min-width="200" sortable="custom" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="出行时间" prop="travelPeriod" min-width="180" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="乘车地点" prop="boardingPlace" min-width="140" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="分配类别" prop="assignSource" width="120" sortable="custom" align="center" header-align="center">
<template slot-scope="{row}">
<el-tag size="mini" :type="row.assignSource === 'BRANCH_UNION' ? 'warning' : 'primary'">{{ assignSourceText(row.assignSource) }}</el-tag>
</template>
</el-table-column>
<el-table-column label="人员类型" prop="personType" width="110" sortable="custom" align="center" header-align="center">
<template slot-scope="{row}">
<el-tag size="mini" :type="row.personType === 'BACKUP' ? 'warning' : 'success'">{{ personTypeText(row.personType) }}</el-tag>
@@ -88,9 +98,9 @@ layout("/layouts/platform.html"){
<el-table-column label="分配时间" prop="assignedAt" width="170" sortable="custom" align="center" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="320" align="center" header-align="center" fixed="right">
<template slot-scope="{row}">
<el-button v-if="!row.matterId && row.personType !== 'BACKUP'" size="mini" type="primary" @click="openSelectMatter(row)">选择线路</el-button>
<el-button v-if="isCancelled(row) && $auth.hasPermission('tour.schoolUserAssignment.cancelRestore')" size="mini" type="warning" @click="restoreCancel(row)">取消退出</el-button>
<el-button size="mini" type="danger" @click="doDelete(row)">删除</el-button>
<el-button v-if="isSchoolUnionAssignment(row) && !row.matterId && row.personType !== 'BACKUP'" size="mini" type="primary" @click="openSelectMatter(row)">选择线路</el-button>
<el-button v-if="isSchoolUnionAssignment(row) && isCancelled(row) && $auth.hasPermission('tour.schoolUserAssignment.cancelRestore')" size="mini" type="warning" @click="restoreCancel(row)">取消退出</el-button>
<el-button v-if="isSchoolUnionAssignment(row)" size="mini" type="danger" @click="doDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -283,6 +293,10 @@ layout("/layouts/platform.html"){
return {
settingOptions: [],
pageMatterOptions: [],
assignSourceOptions: [
{label: "校工会分配", value: "SCHOOL_UNION"},
{label: "分工会分配", value: "BRANCH_UNION"}
],
assignSettingOptions: [],
assignMatterOptions: [],
unionOptions: [],
@@ -305,6 +319,7 @@ layout("/layouts/platform.html"){
matterId: "",
unionId: "",
personType: "",
assignSource: "SCHOOL_UNION",
keyword: ""
},
assignForm: {
@@ -366,6 +381,8 @@ layout("/layouts/platform.html"){
this.pageForm.matterId = ""
this.pageForm.unionId = ""
this.pageForm.personType = ""
// 页面打开和重置后默认查看校工会分配,清空该筛选项时后端会查询全部来源。
this.pageForm.assignSource = "SCHOOL_UNION"
this.pageForm.keyword = ""
this.loadSettingOptions()
},
@@ -667,6 +684,18 @@ layout("/layouts/platform.html"){
personTypeText(personType) {
return personType === "BACKUP" ? "替补人员" : "正式人员"
},
assignSourceText(assignSource) {
if (assignSource === "SCHOOL_UNION") {
return "校工会分配"
}
if (assignSource === "BRANCH_UNION") {
return "分工会分配"
}
return assignSource || ""
},
isSchoolUnionAssignment(row) {
return row && row.assignSource === "SCHOOL_UNION"
},
isCancelled(row) {
return row && (row.cancelled === true || row.cancelled === 1)
},
@@ -306,7 +306,7 @@ layout("/layouts/platform_h5.html"){
}
return this.canModifySignup() ? "修改报名" : "审核中"
}
return "我要报名"
return "我要核对信息"
},
detailActionType() {
return this.canRevokeSignup() ? "danger" : "info"