commit
This commit is contained in:
+42
@@ -25,6 +25,7 @@ import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_con
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.param.*;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.service.TeacherCongressDelegateService;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation_union;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation_unit;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -479,4 +480,45 @@ public class TeacherCongressDelegateManageController {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("tc.delegate.manage")
|
||||
public Result doAllocateDelegation(String sessionId) {
|
||||
List<Teacher_congress_delegate> delegateList = dao.query(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", sessionId)
|
||||
.and(Teacher_congress_delegate::getDelegationId, "is", null));
|
||||
|
||||
for (Teacher_congress_delegate delegate : delegateList) {
|
||||
Teacher_congress_delegation_unit delegation_unit = dao.fetch(Teacher_congress_delegation_unit.class,
|
||||
Cnd.where(Teacher_congress_delegation_unit::getUnitId, "=", delegate.getUnitId())
|
||||
.and(Teacher_congress_delegation_union::getSessionId, "=", sessionId));
|
||||
if (ObjectUtil.isNotEmpty(delegation_unit)) {
|
||||
delegate.setDelegationId(delegation_unit.getDelegationId());
|
||||
dao.update(delegate);
|
||||
Sys_user_role userRole = new Sys_user_role();
|
||||
userRole.setTcDelegationId(delegation_unit.getDelegationId());
|
||||
userRole.setUserId(delegate.getUserId());
|
||||
userRole.setTcSessionId(delegate.getSessionId());
|
||||
Sys_role sys_role = dao.fetch(Sys_role.class, Cnd.where(Sys_role::getCode, "=", RoleConstant.TEACHER_CONGRESS_DELEGATE_FORMAL.name()));
|
||||
|
||||
if (sys_role.getId().equals(delegate.getRoleId())) {
|
||||
delegate.setRoleId(sys_role.getId());
|
||||
userRole.setRoleId(sys_role.getId());
|
||||
}
|
||||
|
||||
Sys_role sys_role2 = dao.fetch(Sys_role.class, Cnd.where(Sys_role::getCode, "=", RoleConstant.TEACHER_CONGRESS_DELEGATE_ATTENDANCE.name()));
|
||||
if (sys_role2.getId().equals(delegate.getRoleId())) {
|
||||
delegate.setRoleId(sys_role2.getId());
|
||||
userRole.setRoleId(sys_role2.getId());
|
||||
}
|
||||
userRole.setTcDelegationId(delegate.getDelegationId());
|
||||
dao.insert(userRole);
|
||||
}
|
||||
sysUserService.clearCache();
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
-6
@@ -6,7 +6,6 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
@@ -24,8 +23,6 @@ import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.TeacherCongressDelegatePush;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation_union;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation_unit;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
@@ -230,7 +227,7 @@ public class TeacherCongressDelegatePushZgAuditController {
|
||||
|
||||
delegate.setSessionId(delegatePush.getSessionId());
|
||||
|
||||
Teacher_congress_delegation_unit delegation_unit = baseService.dao().fetch(Teacher_congress_delegation_unit.class,
|
||||
/*Teacher_congress_delegation_unit delegation_unit = baseService.dao().fetch(Teacher_congress_delegation_unit.class,
|
||||
Cnd.where(Teacher_congress_delegation_unit::getUnitId, "=", user.getUnitId())
|
||||
.and(Teacher_congress_delegation_union::getSessionId, "=", delegatePush.getSessionId()));
|
||||
|
||||
@@ -239,7 +236,7 @@ public class TeacherCongressDelegatePushZgAuditController {
|
||||
userRole.setTcDelegationId(delegation_unit.getDelegationId());
|
||||
} else {
|
||||
return Result.error(user.getUnitName() + "没有设置到代表团,请先在代表团管理里设置。");
|
||||
}
|
||||
}*/
|
||||
if ("正式代表".equals(delegatePush.getRepresentativeType())) {
|
||||
Sys_role sys_role = baseService.dao().fetch(Sys_role.class, Cnd.where(Sys_role::getCode, "=", RoleConstant.TEACHER_CONGRESS_DELEGATE_FORMAL.name()));
|
||||
delegate.setRoleId(sys_role.getId());
|
||||
@@ -253,7 +250,7 @@ public class TeacherCongressDelegatePushZgAuditController {
|
||||
userRole.setUserId(user.getId());
|
||||
userRole.setTcSessionId(delegatePush.getSessionId());
|
||||
baseService.dao().insert(delegate);
|
||||
baseService.dao().insert(userRole);
|
||||
// baseService.dao().insert(userRole);
|
||||
|
||||
// 去改改用户表的手机号
|
||||
baseService.dao().update(
|
||||
|
||||
+27
@@ -144,6 +144,33 @@ public class TeacherCongressDelegatePushServiceImpl extends BaseServiceImpl<Teac
|
||||
return "请先设置名额分配";
|
||||
}
|
||||
|
||||
Sql countSql = Sqls.create("""
|
||||
SELECT
|
||||
info.*
|
||||
FROM
|
||||
teacher_congress_delegate_push 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
|
||||
$condition
|
||||
""");
|
||||
Cnd countCnd = Cnd.NEW();
|
||||
SqlExpressionGroup countGroup = new SqlExpressionGroup();
|
||||
countGroup.or("t.taskName", "=", "900217e4-4332-4a21-90dd-363b8be17801");
|
||||
countGroup.or("t.taskName", "is", null);
|
||||
countCnd.and(countGroup);
|
||||
countCnd.and("info.unionId", "=", unionId);
|
||||
countSql.setCondition(countCnd);
|
||||
List<NutMap> delegatePushList = listMap(countSql);
|
||||
if (!delegatePushList.isEmpty()){
|
||||
return "您已提交无需再提交!";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
|
||||
+17
@@ -38,6 +38,9 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button size="small" type="primary" icon="el-icon-plus" @click="doAllocateDelegation">
|
||||
根据单位分配代表团
|
||||
</el-button>
|
||||
<el-button size="small" type="primary" icon="el-icon-plus" @click="excelImportDialog = true">导入代表</el-button>
|
||||
<el-button size="small" type="primary" icon="el-icon-plus" @click="$refs.addFormRef.onOpen(pageForm.sessionId,pageForm.delegationId)">新增代表</el-button>
|
||||
<el-button
|
||||
@@ -139,6 +142,20 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doAllocateDelegation() {
|
||||
this.$confirm("确定要一键给没有代表团的代表,根据单位所在代表团设置代表团吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
this.$axios.post(loc() + "/doAllocateDelegation", {sessionId: this.pageForm.sessionId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
sessionChange() {
|
||||
this.pageForm.delegationId = null
|
||||
this.delegationOptions = []
|
||||
|
||||
Reference in New Issue
Block a user