Merge branch 'main' of https://dd3skj.picp.vip/zhaoxinyu/v4
This commit is contained in:
+138
@@ -0,0 +1,138 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.senior;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.models.BpmProcessTask;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.entity.ProcessTaskActor;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ProposalExpeditingController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/9/23 9:38
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/senior/expediting")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "提案-高级管理-提案催办")
|
||||
public class ProposalExpeditingController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
private GlobalMessageSendService globalMessageSendService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/senior/expediting/index.html")
|
||||
@SaCheckPermission("proposal.senior.expediting")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.senior.expediting")
|
||||
@ApiOperation("分页列表")
|
||||
public Result pageData(@Valid ProposalSearchParam pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
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,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.taskName),'结束') curTaskKey,
|
||||
CASE WHEN t.taskState = 20 AND ( rt.id IS NULL OR rt.taskState = 10 ) THEN 1 ELSE 0 END AS canRevoke,
|
||||
t.variable->>'$.unitName' AS taskUnitName,
|
||||
IF(JSON_EXTRACT(t.variable, '$.isMaster') = true, 1, 0) AS taskIsMaster
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id
|
||||
LEFT JOIN proposal_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "in", List.of("85cf23da-2dd5-4007-a1e9-bd9bfddc68f0", "c9a1586e-272b-41b8-b438-0be9f9e3781d","5ed5a1be-0cd3-4b47-a0d5-238d53b61f34"));
|
||||
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = proposalCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("提案催办")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("proposal.senior.expediting")
|
||||
@SLog(tag = "提案-高级管理", msg = "提案催办")
|
||||
public Result submit(@Param(value = "taskIds") String[] taskIds,
|
||||
@Param(value = "content") String content) {
|
||||
|
||||
for (String taskId : taskIds) {
|
||||
|
||||
ProcessTask task = dao.fetch(ProcessTask.class, taskId);
|
||||
|
||||
List<ProcessTaskActor> taskActors = dao.query(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
|
||||
List<String> list = taskActors.stream().map(ProcessTaskActor::getActorId).toList();
|
||||
|
||||
String message = "您有一条待办任务," + content;
|
||||
globalMessageSendService.sendMessage(task.getDisplayName(), message, 2, list, null);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+162
@@ -0,0 +1,162 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.delegate.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.TeacherCongressDelegatePush;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.Period;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/9/22 20:41
|
||||
* @description
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/teacherCongress/delegate/push")
|
||||
@Ok("json:full")
|
||||
@Api(value = "/platform/teacherCongress/delegate/push", tags = "教代会代表推选")
|
||||
public class TeacherCongressDelegatePushController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/delegate/push/index.html")
|
||||
@SaCheckPermission("tc.delegate.push")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取本分工会下的非代表用户
|
||||
*
|
||||
* @param sessionId
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("tc.delegate.push")
|
||||
@SLog(tag = "民主管理-教代会代表推选", msg = "获取本分工会下的非代表用户")
|
||||
public Result getUnionUser(String sessionId, String unionId) {
|
||||
// 查询预选中的代表
|
||||
Cnd cndx = Cnd.where("sessionId", "=", sessionId);
|
||||
cndx.andEX("unionId", "=", SecurityUtil.getUnionId());
|
||||
List<Teacher_congress_delegate> delegateList = dao.query(Teacher_congress_delegate.class, cndx);
|
||||
// u.professionalTitle,
|
||||
// u.professionalLevel,
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id AS userId,
|
||||
u.loginname as loginName,
|
||||
u.username as userName,
|
||||
|
||||
u.sex,
|
||||
u.birthday,
|
||||
u.nation,
|
||||
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age
|
||||
FROM
|
||||
`vw_user` u
|
||||
LEFT JOIN teacher_congress_delegate tcd ON tcd.userId = u.id
|
||||
AND tcd.sessionId = @sessionId
|
||||
LEFT JOIN teacher_congress_delegate_push tcdp ON tcdp.userId = tcdp.id
|
||||
AND tcdp.sessionId = @sessionId
|
||||
$condition
|
||||
""");
|
||||
sql.setParam("sessionId", sessionId);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("u.member", "=", 1);
|
||||
cnd.and("tcd.userId", "is", null);
|
||||
cnd.and("tcdp.id", "is", null);
|
||||
cnd.and("u.unionId", "=", SecurityUtil.getUnionId());
|
||||
sql.setCondition(cnd);
|
||||
List userList = baseService.listMap(sql);
|
||||
return Result.success(Map.of("userData", userList, "userValue", delegateList));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 推选代表
|
||||
*/
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object addPreselectionDb(@Param("userValue") String[] userValue, String sessionId, String representativeType) {
|
||||
List<TeacherCongressDelegatePush> list = new ArrayList<>();
|
||||
for (String id : userValue) {
|
||||
View_user user = dao.fetch(View_user.class, Cnd.where("id", "=", id));
|
||||
|
||||
TeacherCongressDelegatePush tmd = new TeacherCongressDelegatePush();
|
||||
tmd.setUserId(user.getId());
|
||||
tmd.setSessionId(sessionId);
|
||||
tmd.setDelegationId(null);
|
||||
tmd.setUserName(user.getUsername());
|
||||
tmd.setLoginName(user.getLoginname());
|
||||
tmd.setSex(user.getSex());
|
||||
tmd.setNation(user.getNation());
|
||||
tmd.setEducation(user.getEducation());
|
||||
tmd.setAcademicDegree(user.getAcademicDegree());
|
||||
tmd.setPolitical(user.getPolitical());
|
||||
tmd.setProfessionalTitle(user.getProfessionalTitle());
|
||||
tmd.setProfessionalLevel(user.getProfessionalLevel());
|
||||
|
||||
tmd.setBirthday(user.getBirthday());
|
||||
tmd.setUnitId(user.getUnitId());
|
||||
tmd.setUnitName(user.getUnitName());
|
||||
tmd.setUnionId(user.getUnionId());
|
||||
tmd.setUnionName(user.getUnionName());
|
||||
|
||||
tmd.setOrdinaryTeacher(false);
|
||||
tmd.setSeniorTeacher(false);
|
||||
tmd.setSchoolLeader(false);
|
||||
tmd.setMiddleLevelLeader(false);
|
||||
|
||||
tmd.setMobile(user.getMobile());
|
||||
|
||||
tmd.setIsJdh(true);
|
||||
tmd.setIsGdh(false);
|
||||
tmd.setRepresentativeType(representativeType);
|
||||
if (ObjectUtil.isNotEmpty(user.getBirthday())) {
|
||||
Date birthdayDate = user.getBirthday();
|
||||
LocalDate birthday = birthdayDate.toInstant()
|
||||
.atZone(ZoneId.systemDefault())
|
||||
.toLocalDate();
|
||||
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
int age = Period.between(birthday, currentDate).getYears();
|
||||
tmd.setAge(age);
|
||||
}
|
||||
tmd.setPushTime(new Date());
|
||||
list.add(tmd);
|
||||
}
|
||||
dao.insert(list);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.delegate.models;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/9/22 20:40
|
||||
* @description 代表推选表
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("teacher_congress_delegate_push")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("代表推选表")
|
||||
public class TeacherCongressDelegatePush extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("代表用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("所属教代会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column
|
||||
@Comment("所属代表团 当用户为校领导是该字段不为空")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
@Column
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 2)
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@Comment("出生日期")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
@Column
|
||||
@Comment("民族")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String nation;
|
||||
|
||||
@Column
|
||||
@Comment("政治面貌")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String political;
|
||||
|
||||
@Column
|
||||
@Comment("学历")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String education;
|
||||
|
||||
@Column
|
||||
@Comment("学位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String academicDegree;
|
||||
|
||||
@Column
|
||||
@Comment("职称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String professionalTitle;
|
||||
|
||||
@Column
|
||||
@Comment("职级")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String professionalLevel;
|
||||
|
||||
@Column
|
||||
@Comment("是否专任教师")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean ordinaryTeacher;
|
||||
|
||||
@Column
|
||||
@Comment("是否高级职称专任教师")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean seniorTeacher;
|
||||
|
||||
@Column
|
||||
@Comment("是否校领导")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean schoolLeader;
|
||||
|
||||
@Column
|
||||
@Comment("是否中层领导")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean middleLevelLeader;
|
||||
|
||||
@Column
|
||||
@Comment("行政职称===>position")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String administrativeTitle;
|
||||
|
||||
@Column
|
||||
@Comment("年龄")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer age;
|
||||
|
||||
@Column
|
||||
@Comment("单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("单位名称")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("分工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("分工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("手机号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("推送时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pushTime;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("教代会代表类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String roleId;
|
||||
|
||||
@Column
|
||||
@Comment("教代会")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isJdh;
|
||||
|
||||
@Column
|
||||
@Comment("工代会")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isGdh;
|
||||
|
||||
@Column
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String bz;
|
||||
|
||||
@Column
|
||||
@Comment("代表类型(正式代表 列席代表)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 4)
|
||||
private String representativeType;
|
||||
}
|
||||
+2
-1
@@ -171,7 +171,8 @@ public class TeacherCongressDelegationController {
|
||||
seg.orEX("id", "not in", unitIds);
|
||||
seg.orEX("id", "in", selectUnitIds);
|
||||
|
||||
Cnd cnd = Cnd.where("unitLevel", "=", 2);
|
||||
// Cnd cnd = Cnd.where("unitLevel", "=", 2);
|
||||
Cnd cnd = Cnd.where("unitTypeCode", "=", "1");
|
||||
if (!seg.isEmpty()) {
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
+2
-1
@@ -174,7 +174,8 @@ public class WorkerCongressDelegationController {
|
||||
seg.orEX("id", "not in", unitIds);
|
||||
seg.orEX("id", "in", selectUnitIds);
|
||||
|
||||
Cnd cnd = Cnd.where("unitLevel", "=", 2);
|
||||
// Cnd cnd = Cnd.where("unitLevel", "=", 2);
|
||||
Cnd cnd = Cnd.where("unitTypeCode", "=", "1");
|
||||
if (!seg.isEmpty()) {
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user