This commit is contained in:
2025-10-19 20:00:35 +08:00
parent 4afee184cf
commit 7c14e477b1
8 changed files with 172 additions and 152 deletions
@@ -109,6 +109,8 @@ public interface FlowConst {
// 流程实例名称
String PROCESS_INSTANCE_NAME = "instanceName";
//============================================扩展==================================================
// 开启之后不会校验任务执行所属权
String EXT_ENABLE_OPERATOR = "";
}
@@ -22,6 +22,9 @@ public class FlowCommonService {
public void executeTask(Dict args){
Long processTaskId = args.getLong(FlowConst.PROCESS_TASK_ID_KEY);
String operator = SecurityUtil.getUserId();
if (args.containsKey(FlowConst.EXT_ENABLE_OPERATOR)&&args.getBool(FlowConst.EXT_ENABLE_OPERATOR)){
operator = FlowConst.ADMIN_ID;
}
args.remove(FlowConst.PROCESS_TASK_ID_KEY);
Integer submitType = args.getInt(FlowConst.SUBMIT_TYPE);
if (submitType == null) {
@@ -289,35 +289,23 @@ public class TeacherCongressDelegatePushController {
Sql sql = Sqls.create("""
SELECT
info.*,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariable,
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 taskVariable,
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') AS startTaskId
t.displayName taskName
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
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("info.sessionId", "=", sessionId);
cnd.andEX("info.unionId", "=", SecurityUtil.getUnionId());
cnd.andEX("t.taskName", "=", "53ff0c2a-ba93-45e9-a9fd-db51cdab3080");
cnd.andEX("t.taskName", "=", "0cacd1e7-7bb2-47dd-818b-6a73062e0c62");
cnd.groupBy("info.id");
sql.setCondition(cnd);
List<NutMap> writeList = baseService.listMap(sql);
// 已上报总人数
int total = writeList.size();
// 已上报女代表人数
@@ -340,21 +328,28 @@ public class TeacherCongressDelegatePushController {
if (total > allocation.getAllocationNum()) {
tips.append("上报总人数超出分配名额!");
}
/* if (female < allocation.getFemaleNum()) {
tips.append("女教师代表数不满足分配名额数!");
}
if (seniorTeacher < allocation.getSeniorTeaNum()) {
tips.append("高级职称专任教师数不满足分配名额数!");
}
if (intermediateBelow < allocation.getIntermediateBelowNum()) {
tips.append("中级职称及以下代表数不满足分配名额数!");
}
if (ordinaryTeacher < allocation.getOrdinaryTeaNum()) {
tips.append("专任教师数不满足分配名额数!");
if (cadre < allocation.getCadreNum()) {
tips.append("干部代表数不满足分配名额数!");
}
if (worker < allocation.getWorkerNum()) {
tips.append("工人代表数不满足分配名额数!");
}
if (female < allocation.getFemaleNum()) {
tips.append("女教师代表数不满足分配名额数!");
}
if (under45 < allocation.getLess45Num()) {
tips.append("45岁以下教师代表数不满足分配名额数!");
}*/
}
if (StrUtil.isNotBlank(tips)) {
return Result.error(tips.toString());
@@ -368,7 +363,7 @@ public class TeacherCongressDelegatePushController {
@ApiOperation("本单位代表上报情况")
@SaCheckPermission("tc.delegate.push")
public Result selfUnionPushMetric(String sessionId, String unionId) {
if (StrUtil.isBlank(unionId)){
if (StrUtil.isBlank(unionId)) {
unionId = SecurityUtil.getUnionId();
}
@@ -103,7 +103,7 @@ public class TeacherCongressDelegatePushWriteController {
@At
@ApiOperation("代表信息填写保存")
@SaCheckPermission("tc.delegate.push.write")
@SaCheckLogin
public Result save(TeacherCongressDelegatePush teacherCongressDelegatePush){
dao.updateIgnoreNull(teacherCongressDelegatePush);
return Result.success();
@@ -111,13 +111,14 @@ public class TeacherCongressDelegatePushWriteController {
@At
@ApiOperation("代表信息填写提交")
@SaCheckPermission("tc.delegate.push.write")
@SaCheckLogin
public Result submit(TeacherCongressDelegatePush teacherCongressDelegatePush,String taskId){
dao.updateIgnoreNull(teacherCongressDelegatePush);
Dict dict = Dict.create();
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.AGREE.getCode());
dict.set(FlowConst.EXT_ENABLE_OPERATOR,true);
flowCommonService.executeTask(dict);
return Result.success();
}
@@ -67,6 +67,7 @@ public class TeacherCongressDelegatePushServiceImpl extends BaseServiceImpl<Teac
Dict dict = Dict.create();
dict.set(FlowConst.PROCESS_TASK_ID_KEY, push.getString("taskId"));
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.AGREE.getCode());
dict.set(FlowConst.EXT_ENABLE_OPERATOR,true);
flowCommonService.executeTask(dict);
});
}