commit
This commit is contained in:
+1
@@ -343,6 +343,7 @@ public class ProposalMineController {
|
||||
seconded.setUnionName(item.getString("unionName"));
|
||||
seconded.setDelegationName(item.getString("delegationName"));
|
||||
seconded.setMobile(item.getString("mobile"));
|
||||
seconded.setMode(true);
|
||||
seconded.setInviteTime(new Date());
|
||||
return seconded;
|
||||
}).toList();
|
||||
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalConfig;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalSecond;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalSecondedService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.dao.util.cri.Static;
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ProposalPositiveSecondedController
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/1/27 14:27
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/proposal/positiveSeconded")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "提案管理系统-提案主动附议")
|
||||
public class ProposalPositiveSecondedController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ProposalSecondedService proposalSecondedService;
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/positiveSeconded/index.html")
|
||||
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/positiveSeconded/index.html")
|
||||
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
|
||||
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
ins.state instanceState,
|
||||
t.displayName taskName,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT t.displayName),'结束') curTaskName,
|
||||
sum( CASE WHEN ps.seconderId=@seconderId and ps.isAgree is not null THEN 1 ELSE 0 END ) as count
|
||||
FROM
|
||||
`proposal_info` info
|
||||
LEFT JOIN proposal_second ps ON ps.proposalId = info.id
|
||||
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
|
||||
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 cnd = Cnd.NEW();
|
||||
sql.setCondition(cnd);
|
||||
sql.setParam("seconderId", SecurityUtil.getUserId());
|
||||
|
||||
cnd.and("t.taskName", "in", List.of("invite", "second", "delegation", "committee"));
|
||||
cnd.and("ins.id", "is not", null);
|
||||
|
||||
if (approval) {
|
||||
cnd.and("ps.seconderId", "=", SecurityUtil.getUserId());
|
||||
cnd.and("ps.mode", "=", false);
|
||||
cnd.and("ps.isAgree", "is not", null);
|
||||
} else {
|
||||
cnd.and(new Static("info.id not in (select proposalId from proposal_second where seconderId = '%s' and isAgree is not null)".formatted(SecurityUtil.getUserId())));
|
||||
}
|
||||
|
||||
cnd.groupBy("info.id");
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
|
||||
Pagination pagination = proposalCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("主动附议")
|
||||
@SLog(tag = "提案管理系统-主动附议", msg = "主动附议")
|
||||
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
|
||||
public Result handle(@Param("proposalId") String proposalId,
|
||||
@Param("opinion") String opinion,
|
||||
@Param("submitType") Integer submitType) {
|
||||
View_user user = dao.fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId()));
|
||||
|
||||
// 查询当前用户所属的教代会
|
||||
Teacher_congress_session session = dao.fetch(Teacher_congress_session.class, Cnd.where("enable", "=", 1).desc("startDate"));
|
||||
Teacher_congress_delegate delegate = dao.fetch(Teacher_congress_delegate.class, Cnd.where("sessionId", "=", session.getId()).and("userId", "=", user.getId()));
|
||||
|
||||
if (delegate == null) {
|
||||
return Result.error("未查询到您的代表信息");
|
||||
}
|
||||
|
||||
Teacher_congress_delegation delegation = dao.fetch(Teacher_congress_delegation.class, delegate.getDelegationId());
|
||||
if (delegation == null) {
|
||||
return Result.error("未查询到您所在的代表团信息");
|
||||
}
|
||||
|
||||
ProposalSecond seconded = new ProposalSecond();
|
||||
seconded.setProposalId(proposalId);
|
||||
seconded.setSeconderId(user.getId());
|
||||
seconded.setUserName(user.getUsername());
|
||||
seconded.setLoginName(user.getLoginname());
|
||||
seconded.setUnitName(user.getUnitName());
|
||||
seconded.setUnionName(user.getUnionName());
|
||||
seconded.setDelegationName(delegation.getName());
|
||||
seconded.setMobile(user.getMobile());
|
||||
seconded.setMode(false);
|
||||
seconded.setInviteTime(new Date());
|
||||
seconded.setOpinion(opinion);
|
||||
seconded.setSecondedTime(new Date());
|
||||
seconded.setIsAgree(ObjectUtil.equals(submitType, ProcessSubmitTypeEnum.AGREE.getCode()));
|
||||
|
||||
dao.insert(seconded);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
|
||||
public Result listPositiveSeconded(String bizId) {
|
||||
List<ProposalSecond> list = dao.query(ProposalSecond.class, Cnd.where(ProposalSecond::getProposalId, "=", bizId).and(ProposalSecond::getMode, "=", false));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR)
|
||||
public Result validateTime() {
|
||||
ProposalConfig config = dao.fetch(ProposalConfig.class, Cnd.NEW());
|
||||
if(System.currentTimeMillis() < config.getSecondedStartTime().getTime()) {
|
||||
return Result.error(99, "主动附议时间未开始");
|
||||
}
|
||||
if(System.currentTimeMillis() > config.getSecondedEndTime().getTime()) {
|
||||
return Result.error(99, "主动附议时间已结束");
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+110
-78
@@ -1,28 +1,38 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.base.service.BaseService;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
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.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalSecond;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalSecondedService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.lang.util.NutMap;
|
||||
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;
|
||||
@@ -37,89 +47,111 @@ import java.util.List;
|
||||
@Api(tags = "提案管理系统-提案附议")
|
||||
public class ProposalSecondedController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private ProposalSecondedService proposalSecondedService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private ProposalSecondedService proposalSecondedService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/seconded/index.html")
|
||||
@SaCheckPermission("proposal.seconded")
|
||||
public void index() {
|
||||
}
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/seconded/index.html")
|
||||
@SaCheckPermission("proposal.seconded")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/seconded/index.html")
|
||||
@SaCheckPermission("proposal.seconded")
|
||||
public void h5Index() {
|
||||
}
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/seconded/index.html")
|
||||
@SaCheckPermission("proposal.seconded")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.seconded")
|
||||
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
|
||||
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,
|
||||
ta.actorName taskActorName,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
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 AND rt.taskState = 10
|
||||
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", "=", "second");
|
||||
@At
|
||||
@SaCheckPermission("proposal.seconded")
|
||||
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
|
||||
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,
|
||||
ta.actorId taskActorUserId,
|
||||
ta.actorName taskActorName,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
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 AND rt.taskState = 10
|
||||
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", "=", "second");
|
||||
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> list = pagination.getList(NutMap.class);
|
||||
for (NutMap row : list) {
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> list = pagination.getList(NutMap.class);
|
||||
for (NutMap row : list) {
|
||||
// String instanceId = row.getString("instanceId");
|
||||
}
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.seconded")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("修改提案附议信息")
|
||||
@SLog(tag = "提案管理系统-附议提案", msg = "修改提案附议信息")
|
||||
public Result updateInfo(@Param("proposalId") String proposalId,
|
||||
@Param("taskActorUserId") String taskActorUserId,
|
||||
@Param("opinion") String opinion,
|
||||
@Param("submitType") Integer submitType) {
|
||||
// 查询附议信息表
|
||||
ProposalSecond proposalSecond = dao.fetch(
|
||||
ProposalSecond.class,
|
||||
Cnd.where(ProposalSecond::getProposalId, "=", proposalId)
|
||||
.and(ProposalSecond::getSeconderId, "=", taskActorUserId)
|
||||
);
|
||||
proposalSecond.setIsAgree(ObjectUtil.equals(submitType, ProcessSubmitTypeEnum.AGREE.getCode()));
|
||||
proposalSecond.setOpinion(opinion);
|
||||
proposalSecond.setSecondedTime(DateUtil.date());
|
||||
dao.update(proposalSecond);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.models;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -60,4 +61,14 @@ public class ProposalConfig extends BaseModel {
|
||||
@Comment("校领导单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> schoolLeaderUnitIds;
|
||||
|
||||
@Column
|
||||
@Comment("附议开始时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private DateTime secondedStartTime;
|
||||
|
||||
@Column
|
||||
@Comment("附议结束时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private DateTime secondedEndTime;
|
||||
}
|
||||
|
||||
@@ -77,4 +77,14 @@ public class ProposalSecond extends BaseModel {
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isAgree;
|
||||
|
||||
@Column
|
||||
@Comment("附议类型,true表示正常邀请,false表示主动附议")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("1")
|
||||
private Boolean mode;
|
||||
|
||||
@Column
|
||||
@Comment("附议人内容")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String opinion;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user