This commit is contained in:
@jyuhsin
2025-12-20 15:47:29 +08:00
parent 48df1417e3
commit 82cfccaf72
8 changed files with 417 additions and 292 deletions
@@ -329,6 +329,7 @@ public class SysUnitController {
parentId = ""; parentId = "";
} }
unit.setCreatedBy(SecurityUtil.getUserId()); unit.setCreatedBy(SecurityUtil.getUserId());
unit.setUnitType("用户自建");
unit.setUnitTypeCode(1); unit.setUnitTypeCode(1);
sysUnitService.save(unit, parentId); sysUnitService.save(unit, parentId);
return Result.success(); return Result.success();
@@ -219,7 +219,6 @@ public class FamilyActivityApplyController {
return Result.error(99, "报名信息为空"); return Result.error(99, "报名信息为空");
} }
currentFamilyNumber = currentFamilyNumber != null ? currentFamilyNumber : 0;
FamilyCourse course = dao.fetch(FamilyCourse.class, courseId); FamilyCourse course = dao.fetch(FamilyCourse.class, courseId);
FamilyType type = dao.fetch(FamilyType.class, course.getCourseType()); FamilyType type = dao.fetch(FamilyType.class, course.getCourseType());
FamilyActivity activity = dao.fetch(FamilyActivity.class, course.getActivityId()); FamilyActivity activity = dao.fetch(FamilyActivity.class, course.getActivityId());
@@ -238,10 +237,12 @@ public class FamilyActivityApplyController {
return Result.error(99,"抱歉,您没有此次活动的权限"); return Result.error(99,"抱歉,您没有此次活动的权限");
} }
if(type.getIsBringFamily() && currentFamilyNumber == 0) { if(type.getIsBringFamily() && currentFamilyNumber != null && currentFamilyNumber == 0) {
return Result.error(99, "%s信息不能为空".formatted(activity.getKeyWord())); return Result.error(99, "%s信息不能为空".formatted(activity.getKeyWord()));
} }
currentFamilyNumber = currentFamilyNumber != null ? currentFamilyNumber : 0;
//判断是否报名 //判断是否报名
boolean courseByUser = familyActivityService.isSignCourseByUser(courseId, SecurityUtil.getUserId()); boolean courseByUser = familyActivityService.isSignCourseByUser(courseId, SecurityUtil.getUserId());
if(courseByUser) { if(courseByUser) {
@@ -1,14 +1,20 @@
package com.budwk.app.zhgh.democratic.grassrootscongress.controller.material; package com.budwk.app.zhgh.democratic.grassrootscongress.controller.material;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.json.JSONObject;
import com.budwk.app.base.page.Pagination; import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.flow.enums.ProcessInstanceStateEnum; import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
import com.budwk.app.sys.models.Sys_file;
import com.budwk.app.sys.utils.SysFileMinIoUtil;
import com.budwk.app.zhgh.democratic.grassrootscongress.models.GrassrootsCongressMeetingInfo;
import com.budwk.app.zhgh.democratic.grassrootscongress.param.GrassrootsCongressPageForm; import com.budwk.app.zhgh.democratic.grassrootscongress.param.GrassrootsCongressPageForm;
import com.budwk.app.zhgh.democratic.grassrootscongress.service.GrassrootsCongressService; import com.budwk.app.zhgh.democratic.grassrootscongress.service.GrassrootsCongressService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -18,6 +24,13 @@ import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@Slf4j @Slf4j
@IocBean @IocBean
@Ok("json:full") @Ok("json:full")
@@ -60,4 +73,48 @@ public class GrassrootsCongressMaterialStatisticsController {
Pagination<NutMap> pagination = grassrootsCongressService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); Pagination<NutMap> pagination = grassrootsCongressService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination); return Result.success(pagination);
} }
@At
@Ok("void")
@SaCheckPermission("grassrootsCongress.material.statistics")
public void downloadFiles(GrassrootsCongressPageForm pageForm,
HttpServletResponse response) {
Sql sql = Sqls.create("""
SELECT
info.*
FROM
grassroots_congress_materials_info info
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("ins.state","=", ProcessInstanceStateEnum.FINISHED.getCode());
cnd.andEX("YEAR(info.createdTime)", "=", pageForm.getYear());
cnd.desc("info.createdTime");
sql.setCondition(cnd);
List<GrassrootsCongressMeetingInfo> list = grassrootsCongressService.listEntity(sql);
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ZipOutputStream zipOutputStream = new ZipOutputStream(bos);
for (GrassrootsCongressMeetingInfo info : list) {
// 循环下载文件
List<JSONObject> files = info.getFiles();
for (JSONObject file : files) {
Sys_file sysFile = grassrootsCongressService.dao().fetch(Sys_file.class, Cnd.where(Sys_file::getDownloadPath, "=", file.get("url")));
byte[] bytes = SysFileMinIoUtil.getFileBytes(sysFile.getBucket(), sysFile.getStoragePath());
ZipEntry zipEntry = new ZipEntry(sysFile.getName());
zipOutputStream.putNextEntry(zipEntry);
zipOutputStream.write(bytes);
zipOutputStream.closeEntry();
}
}
zipOutputStream.close();
CommonDownloadUtil.download("资料汇总压缩包.zip", bos.toByteArray(), response);
} catch (Exception e) {
e.printStackTrace();
}
}
} }
@@ -262,6 +262,28 @@ public class TeacherCongressDelegationController {
return Result.success(pagination.getList()); return Result.success(pagination.getList());
} }
@At
@SaCheckPermission("tc.delegation")
public Result notContactUser(@Valid String sessionId, @Valid String delegationId, String keyWord) {
List<Sys_user_role> userRoleList = dao.query(
Sys_user_role.class,
Cnd.where(Sys_user_role::getTcSessionId, "=", sessionId)
.and(Sys_user_role::getTcDelegationId, "=", delegationId)
);
List<String> list = userRoleList.stream().map(Sys_user_role::getUserId).distinct().toList();
Sql sql = Sqls.create("select id as userId,loginName,userName,unitName from vw_user $condition");
Cnd cnd = Cnd.NEW();
cnd.and("id", "not in", list);
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("loginName", keyWord);
seg.orLike("userName", keyWord);
cnd.and(seg);
sql.setCondition(cnd);
Pagination pagination = sysUserService.listPageMap(1, 10, sql);
return Result.success(pagination.getList());
}
/** /**
* 查询团长 * 查询团长
* *
@@ -79,13 +79,25 @@
<el-form-item label="" label-width="0" v-for="(nr,idx) in formData.nrs" :key="idx"> <el-form-item label="" label-width="0" v-for="(nr,idx) in formData.nrs" :key="idx">
<el-row type="flex" justify="space-between"> <el-row type="flex" justify="space-between">
<el-input v-model="nr.content" v-if="!is_view" maxlength="30" style="width: 50%" placeholder="请填写考核内容"> <div style="width: 80%">
<el-input v-model="nr.content" :disabled="is_view" maxlength="30" style="width: 68%" placeholder="请填写考核内容">
<template slot="prepend"><span>{{ idx + 1 }}</span></template> <template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input> </el-input>
<span style="background-color: #F6F7FA;" v-else>{{ idx + 1 }}&nbsp;&nbsp;{{ nr.content }}</span> <el-select v-model="nr.auditUser" :disabled="is_view" placeholder="请根据姓名或工号选择审核人" style="width: 300px"
remote reserve-keyword :remote-method="selectUser"
clearable filterable>
<el-option
v-for="item in userOptions"
:key="item.loginName"
:label="item.userName + item.loginName + '(' + item.unitName + ')'"
:value="item.loginName">
</el-option>
</el-select>
</div>
<div style="display: flex; gap: 10px;"> <div style="display: flex; gap: 10px;">
<el-button v-if="!is_view" size="small" icon="el-icon-plus" type="primary" <el-button v-if="!is_view" size="small" icon="el-icon-plus" type="primary"
@click="formData.nrs.push({bzs:[{}]})"> @click="formData.nrs.push({bzs:[{}], auditUser: ''})">
添加内容 添加内容
</el-button> </el-button>
<el-button v-if="!is_view" size="small" :disabled="formData.nrs.length<=1" type="danger" <el-button v-if="!is_view" size="small" :disabled="formData.nrs.length<=1" type="danger"
@@ -195,7 +207,7 @@
<el-table-column v-if="!is_view" label="操作" width="100px"> <el-table-column v-if="!is_view" label="操作" width="100px">
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id)" type="danger" icon="el-icon-delete" <el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id !== null)" type="danger" icon="el-icon-delete"
@click="nr.bzs.splice($index,1)"></el-button> @click="nr.bzs.splice($index,1)"></el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -217,7 +229,7 @@
</template> </template>
<script nonce="${cspNonce!}"> <script>
const METHOD_NAME = "change" const METHOD_NAME = "change"
@@ -232,7 +244,8 @@ module.exports = {
default: function() { default: function() {
return { return {
nrs: [{ nrs: [{
bzs: [{}] bzs: [{}],
auditUser: '',
}], }],
}; };
} }
@@ -265,10 +278,23 @@ module.exports = {
{moduleName:'二级教代会',id:'secteameet'}, {moduleName:'二级教代会',id:'secteameet'},
{moduleName:'慰问/补助',id:'ConandDif'}, {moduleName:'慰问/补助',id:'ConandDif'},
], ],
formData:{} formData:{},
userOptions: [],
} }
}, },
methods: { methods: {
async selectUser(query) {
if (query) {
this.userOptions = []
this.userOptions = await this.getUserList(query)
}
},
async getUserList(query) {
const resp = await this.$axios.post("/platform/ghkh/Xjkhzb/getUserByKeyWord", {
keyWord: query,
})
return resp.data
},
async getByZbData() { async getByZbData() {
this.$axios.post('/platform/ghkh/khzb/edit', {id: this.formData.zbId}).then(res => { this.$axios.post('/platform/ghkh/khzb/edit', {id: this.formData.zbId}).then(res => {
if (res.code === 0) { if (res.code === 0) {
@@ -328,16 +354,17 @@ module.exports = {
return sums; return sums;
} }
}, },
created() { async created() {
this.getZbList() this.getZbList()
if (!this.form_data || !Object.keys(this.form_data).length) { if (!this.form_data || !Object.keys(this.form_data).length) {
this.formData = { this.formData = {
nrs: [{ nrs: [{
bzs: [{}] bzs: [{}],
auditUser: '',
}], }],
} }
}else{ } else {
this.formData=this.form_data this.formData = this.form_data
// 初始化时间范围数据用于编辑 // 初始化时间范围数据用于编辑
if (this.formData.startDateTime && this.formData.endDateTime) { if (this.formData.startDateTime && this.formData.endDateTime) {
this.$set(this.formData, 'fillTimeRange', [this.formData.startDateTime, this.formData.endDateTime]); this.$set(this.formData, 'fillTimeRange', [this.formData.startDateTime, this.formData.endDateTime]);
@@ -345,6 +372,19 @@ module.exports = {
if (this.formData.startApplyTime && this.formData.endApplyTime) { if (this.formData.startApplyTime && this.formData.endApplyTime) {
this.$set(this.formData, 'appealTimeRange', [this.formData.startApplyTime, this.formData.endApplyTime]); this.$set(this.formData, 'appealTimeRange', [this.formData.startApplyTime, this.formData.endApplyTime]);
} }
// 回显审核人
if (this.formData.nrs.length > 0) {
const users = [...new Set(
this.formData.nrs
.map(o => o.auditUser)
.filter(o => o != null && o !== '')
)]
let array = []
for (const o of users) {
array = array.concat(await this.getUserList(o))
}
this.userOptions = array
}
} }
} }
} }
@@ -27,7 +27,7 @@
<template v-else> <template v-else>
<file-upload <file-upload
:value.sync="data.files" :value.sync="data.files"
:upload_number="20" :upload_number="50"
upload_mode="drag" upload_mode="drag"
upload_result_category="array" upload_result_category="array"
complete_result complete_result
@@ -40,7 +40,7 @@
</el-form> </el-form>
</template> </template>
<script nonce="${cspNonce!}"> <script>
const METHOD_NAME = "change" const METHOD_NAME = "change"
@@ -26,6 +26,7 @@ layout("/layouts/platform.html"){
</el-card> </el-card>
<el-card shadow="never"> <el-card shadow="never">
<table-tool label="资料列表"> <table-tool label="资料列表">
<el-button @click="downloadFiles" icon="el-icon-download" size="small" type="primary">一键下载</el-button>
</table-tool> </table-tool>
<el-table :data="tableData" @sort-change="pageOrder"> <el-table :data="tableData" @sort-change="pageOrder">
@@ -79,6 +80,9 @@ layout("/layouts/platform.html"){
} }
}, },
methods: { methods: {
downloadFiles() {
this.$downLoad('/platform/grassrootsCongress/material/statistics/downloadFiles', this.pageForm)
},
openView(row) { openView(row) {
this.$refs.guava.public(() => { this.$refs.guava.public(() => {
this.$refs.grassrootsCongressMaterialInfoRef.onOpen(row) this.$refs.grassrootsCongressMaterialInfoRef.onOpen(row)
@@ -40,7 +40,7 @@ const HEAD_FORM_TEMPLATE = {
<el-form-item prop="contactUserId" label="联络人"> <el-form-item prop="contactUserId" label="联络人">
<user-select v-model="formData.contactUserId" <user-select v-model="formData.contactUserId"
v-if="headDialogFormVisible" v-if="headDialogFormVisible"
api="/platform/teacherCongress/delegation/notHeadUser" api="/platform/teacherCongress/delegation/notContactUser"
:api_params="{sessionId:formData.sessionId,delegationId:formData.delegationId}" :api_params="{sessionId:formData.sessionId,delegationId:formData.delegationId}"
api_input_key_name="keyWord" api_input_key_name="keyWord"
:option_list="contactOptions" :option_list="contactOptions"
@@ -70,8 +70,8 @@ const HEAD_FORM_TEMPLATE = {
name: [{required: true, message: "必填", trigger: ["change", "blur"]}], name: [{required: true, message: "必填", trigger: ["change", "blur"]}],
code: [{required: true, message: "必填", trigger: ["change", "blur"]}], code: [{required: true, message: "必填", trigger: ["change", "blur"]}],
userId: [{required: true, message: "必填", trigger: ["change", "blur"]}], userId: [{required: true, message: "必填", trigger: ["change", "blur"]}],
viceUserId: [{required: true, message: "必填", trigger: ["change", "blur"]}], //viceUserId: [{required: true, message: "必填", trigger: ["change", "blur"]}],
contactUserId: [{required: true, message: "必填", trigger: ["change", "blur"]}] //contactUserId: [{required: true, message: "必填", trigger: ["change", "blur"]}]
} }
} }
}, },