commit
This commit is contained in:
@@ -3,7 +3,9 @@ package io.v.nutz.base.utils;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.constant.Env;
|
||||
import io.v.nutz.sys.models.Sys_wechat_msg;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
@@ -58,6 +60,10 @@ public class MsgApi {
|
||||
|
||||
|
||||
public boolean sendMsg(String msgContent, List<String> receivers){
|
||||
if(Globals.isEnv(Env.dev)) {
|
||||
log.info("本地开发模式,不发送消息");
|
||||
return false;
|
||||
}
|
||||
Assert.notBlank(msgContent);
|
||||
Assert.notEmpty(receivers);
|
||||
|
||||
@@ -98,6 +104,10 @@ public class MsgApi {
|
||||
* @param receivers 接收人工号/手机号
|
||||
*/
|
||||
public void sendSmsMsg(String msgContent, List<String> receivers) {
|
||||
if(Globals.isEnv(Env.dev)) {
|
||||
log.info("本地开发模式,不发送消息");
|
||||
return;
|
||||
}
|
||||
Assert.notBlank(msgContent);
|
||||
Assert.notEmpty(receivers);
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package io.v.nutz.oa.client;
|
||||
|
||||
import io.v.nutz.constant.Env;
|
||||
import io.v.nutz.oa.util.MyHttpDelete;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
@@ -33,6 +35,9 @@ public class HhuEduOaClient {
|
||||
}
|
||||
|
||||
public String doDelete(String url,String json,String signature,String nonce,String timestamp) {
|
||||
if(Globals.isEnv(Env.dev)) {
|
||||
throw new RuntimeException("本地开发模式,不调用待办");
|
||||
}
|
||||
System.out.println(url);
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
@@ -93,7 +98,10 @@ public class HhuEduOaClient {
|
||||
|
||||
|
||||
public String doGet(String url,String timestamp,String nonce,String signature,String summaryVer,String summary) {
|
||||
System.out.println(url);
|
||||
if(Globals.isEnv(Env.dev)) {
|
||||
throw new RuntimeException("本地开发模式,不调用待办");
|
||||
}
|
||||
System.out.println(url);
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
String result = "";
|
||||
@@ -154,7 +162,10 @@ public class HhuEduOaClient {
|
||||
}
|
||||
|
||||
public String doPost(String url, String json, String signature, String nonce,String timestamp,String summary) {
|
||||
System.out.println(url);
|
||||
if(Globals.isEnv(Env.dev)) {
|
||||
throw new RuntimeException("本地开发模式,不调用待办");
|
||||
}
|
||||
System.out.println(url);
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
String result = "";
|
||||
@@ -217,6 +228,9 @@ public class HhuEduOaClient {
|
||||
}
|
||||
|
||||
public String doPut(String url,String json,String signature,String nonce,String timestamp) {
|
||||
if(Globals.isEnv(Env.dev)) {
|
||||
throw new RuntimeException("本地开发模式,不调用待办");
|
||||
}
|
||||
CloseableHttpClient httpClient = null;
|
||||
CloseableHttpResponse response = null;
|
||||
String result = "";
|
||||
|
||||
@@ -11,7 +11,8 @@ public enum OaBusinessTypeEnum {
|
||||
DIRECTOR_EXECUTIVE_COMMITTEE(8, "执委会主任审核", "36"),
|
||||
PRINCIPAL_SECRETARY_AUDIT(9, "校长、书记审核", "45"),
|
||||
DIRECTOR_EXECUTIVE_CONFIRM_COMMITTEE(10, "执委会主任确认审核", "54"),
|
||||
DIRECTOR_CONFIRM_ORGANIZER_REPLY(11, "提案委确认承办审核", "63");
|
||||
DIRECTOR_CONFIRM_ORGANIZER_REPLY(11, "提案委确认承办审核", "63"),
|
||||
COMMITTEE_READ(12, "提案委查阅", "54");
|
||||
|
||||
private Integer code;
|
||||
|
||||
|
||||
@@ -82,11 +82,11 @@ public enum ProposalAuditEnum {
|
||||
// 生成代办
|
||||
if (flag == 1) {
|
||||
Sys_user createUser = dao.fetch(Sys_user.class, info.getCreateUser());
|
||||
String title = "提案委审核-" + info.getProposalName() + "(" + info.getProposalCode() + "[" + createUser.getUsername() + "]" + ")";
|
||||
String subTitle = createUser.getUsername() + "邀请您提案审核";
|
||||
String title = "提案委查阅-" + info.getProposalName() + "(" + info.getProposalCode() + "[" + createUser.getUsername() + "]" + ")";
|
||||
String subTitle = createUser.getUsername() + "邀请您提案查阅";
|
||||
|
||||
// 参与审核人员
|
||||
Sql userSql = Sqls.create("select su.* from sys_user su left join sys_user_role sur on su.id = sur.userid" +
|
||||
/*Sql userSql = Sqls.create("select su.* from sys_user su left join sys_user_role sur on su.id = sur.userid" +
|
||||
" where sur.roleId in (@roleId)");
|
||||
userSql.params().set("roleId", Arrays.asList(Roles.WYH_ZR, Roles.tmanage));
|
||||
userSql.setCallback(Sqls.callback.maps());
|
||||
@@ -103,7 +103,15 @@ public enum ProposalAuditEnum {
|
||||
createUser.getId(),
|
||||
userIds,
|
||||
Globals.AppDomain + "/platform/proposal/transact/case/case?proposalId=" + info.getId(),
|
||||
Globals.AppDomain + "/platform/proposal/transact/case/case");
|
||||
Globals.AppDomain + "/platform/proposal/transact/case/case");*/
|
||||
auditInstanceService.createTask(OaBusinessTypeEnum.COMMITTEE_READ,
|
||||
info.getId(),
|
||||
title,
|
||||
subTitle,
|
||||
createUser.getId(),
|
||||
List.of("20010021"),
|
||||
Globals.AppDomain + "/platform/proposal/transact/caseRead?proposalId=" + info.getId(),
|
||||
Globals.AppDomain + "/platform/proposal/transact/caseRead");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package io.v.nutz.proposal.constants;
|
||||
|
||||
import org.nutz.lang.random.R;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2021-01-27 09:54
|
||||
@@ -32,6 +34,11 @@ public interface ProposalState {
|
||||
*/
|
||||
Integer PREAUDIT = 250;
|
||||
|
||||
/**
|
||||
* 提案委员会查阅
|
||||
*/
|
||||
Integer COMMITTEE_READ = 260;
|
||||
|
||||
/**
|
||||
* 待提案委员会立案审核
|
||||
*/
|
||||
|
||||
@@ -7,35 +7,46 @@ import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.dao.CndPlus;
|
||||
import io.v.nutz.modules.models.PageForm;
|
||||
import io.v.nutz.oa.enums.OaBusinessTypeEnum;
|
||||
import io.v.nutz.oa.service.IOaAuditInstanceService;
|
||||
import io.v.nutz.oa.service.impl.OaAuditInstanceServiceImpl;
|
||||
import io.v.nutz.proposal.constants.ProposalConstant;
|
||||
import io.v.nutz.proposal.constants.ProposalState;
|
||||
import io.v.nutz.proposal.constants.ProposalStateDirectionEnum;
|
||||
import io.v.nutz.proposal.models.ProposalAudit;
|
||||
import io.v.nutz.proposal.models.ProposalInfo;
|
||||
import io.v.nutz.proposal.models.ProposalSearch;
|
||||
import io.v.nutz.proposal.services.ProposalInfoService;
|
||||
import io.v.nutz.proposal.services.ProposalProcessService;
|
||||
import io.v.nutz.sys.models.Sys_signature;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.sys.models.User;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.util.ShiroUtil;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.Mvcs;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -101,15 +112,18 @@ public class CaseReadController {
|
||||
|
||||
if (Strings.isNotBlank(search.getIsAudit())) {
|
||||
if (search.getIsAudit().equals("true")) {
|
||||
cnd.and("info.stateCode", ">", ProposalState.COMMITTEE_READ);
|
||||
cnd.and(new Static("FIND_IN_SET(( SELECT id FROM proposal_audit WHERE proposalId = info.id AND userId = '%s' AND other IS NOT NULL limit 1), info.membersOpinions )is not null".formatted(ShiroUtil.getUserId())));
|
||||
// cnd.and(new Static("JSON_CONTAINS(JSON_EXTRACT( info.membersOpinions, '$[*].userId' ), '\"%s\"') = 1".formatted(ShiroUtil.getUserId())));
|
||||
} else {
|
||||
cnd.and("info.stateCode", "=", ProposalState.COMMITTEE_READ);
|
||||
cnd.and(new Static("FIND_IN_SET(( SELECT id FROM proposal_audit WHERE proposalId = info.id AND userId = '%s' AND other IS NOT NULL limit 1), info.membersOpinions ) is null".formatted(ShiroUtil.getUserId())));
|
||||
|
||||
// cnd.and(new Static("(JSON_CONTAINS(JSON_EXTRACT( info.membersOpinions, '$[*].userId' ), '\"%s\"') = 0 or JSON_CONTAINS(JSON_EXTRACT( info.membersOpinions, '$[*].userId' ), '\"%s\"') is null)".formatted(ShiroUtil.getUserId(), ShiroUtil.getUserId())));
|
||||
}
|
||||
}
|
||||
cnd.and("info.stateCode", ">", ProposalState.DELEGATION);
|
||||
} else {
|
||||
cnd.and("info.stateCode", ">=", ProposalState.COMMITTEE_READ);
|
||||
}
|
||||
|
||||
cnd.asc("info.stateCode");
|
||||
// proposalInfoService.sortAndSearch(cnd,page,search);
|
||||
Pagination pagination = (Pagination) proposalInfoService.initSql(sql, page, search, cnd);
|
||||
@@ -160,6 +174,7 @@ public class CaseReadController {
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object putSuggestion(String sign, @Param("audit") String audit, @Param("proposalId") String proposalId) {
|
||||
ProposalInfo proposalInfo = proposalInfoService.fetch(proposalId);
|
||||
String signId = sysSignatureService.insert(new Sys_signature(sign)).getId();
|
||||
@@ -178,7 +193,40 @@ public class CaseReadController {
|
||||
List<String> membersOpinions = proposalInfo.getMembersOpinions() == null ? new ArrayList<>() : proposalInfo.getMembersOpinions();
|
||||
membersOpinions.add(proposalAudit.getId());
|
||||
proposalInfo.setMembersOpinions(membersOpinions);
|
||||
proposalInfoService.updateIgnoreNull(proposalInfo);
|
||||
|
||||
// 搞下一个节点去
|
||||
ProposalProcessService processService = Mvcs.getIoc().get(ProposalProcessService.class);
|
||||
int nextStateCode = processService.getSomeNodeNextStateCode(proposalInfo.getStateCode(), ProposalStateDirectionEnum.NEXT);
|
||||
proposalInfo.setStateCode(nextStateCode);
|
||||
|
||||
proposalInfoService.updateIgnoreNull(proposalInfo);
|
||||
|
||||
// 发待办
|
||||
IOaAuditInstanceService auditInstanceService = Mvcs.getIoc().get(OaAuditInstanceServiceImpl.class);
|
||||
|
||||
Sql userSql = Sqls.create("select su.* from sys_user su left join sys_user_role sur on su.id = sur.userid" +
|
||||
" where sur.roleId in (@roleId)");
|
||||
userSql.params().set("roleId", Arrays.asList(Roles.WYH_ZR, Roles.tmanage));
|
||||
userSql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(userSql);
|
||||
List<NutMap> sysUsers = userSql.getList(NutMap.class);
|
||||
|
||||
if(Lang.isNotEmpty(sysUsers)) {
|
||||
List<String> userIds = sysUsers.stream().map(item-> { return item.getString("id"); }).collect(Collectors.toList());
|
||||
|
||||
Sys_user createUser = dao.fetch(Sys_user.class, proposalInfo.getCreateUser());
|
||||
String title = "提案委审核-" + proposalInfo.getProposalName() + "(" + proposalInfo.getProposalCode() + "[" + createUser.getUsername() + "]" + ")";
|
||||
String subTitle = createUser.getUsername() + "邀请您提案审核";
|
||||
|
||||
auditInstanceService.createTask(OaBusinessTypeEnum.PROPOSAL_COMMITTEE_AUDIT,
|
||||
proposalInfo.getId(),
|
||||
title,
|
||||
subTitle,
|
||||
createUser.getId(),
|
||||
userIds,
|
||||
Globals.AppDomain + "/platform/proposal/transact/case/case?proposalId=" + proposalInfo.getId(),
|
||||
Globals.AppDomain + "/platform/proposal/transact/case/case");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ window.proposal = {
|
||||
UNSUBMIT: 100,
|
||||
INVIRTE: 150,
|
||||
DELEGATION: 200,
|
||||
COMMITTEE_READ: 260,
|
||||
CASE: 300,
|
||||
PRINCIPALREAD: 330,
|
||||
CASEUNIT: 400,
|
||||
|
||||
@@ -13,10 +13,10 @@ layout("/layouts/platform.html"){
|
||||
<el-card shadow="never" class="mt20">
|
||||
<table-tool label="委员查阅提案" :app="this">
|
||||
<template #func>
|
||||
<el-button @click="doSend" size="small" type="primary"
|
||||
<!--<el-button @click="doSend" size="small" type="primary"
|
||||
v-if="(${@shiro.hasRole('T01') || @shiro.hasRole('sysadmin')} && pageForm.isAudit==false)"
|
||||
>一键提醒
|
||||
</el-button>
|
||||
</el-button>-->
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" align="center" header-align="center" :row-key="(row)=>{row.id}"
|
||||
@@ -42,25 +42,25 @@ layout("/layouts/platform.html"){
|
||||
<el-link type="primary" @click="openView(row)">{{row.proposalName}}</el-link>
|
||||
</template>
|
||||
<template v-else-if="column.prop=='auditState'" scope="{row}">
|
||||
<span class="text-success" v-if="row.stateCode!=proposal.DELEGATION">已审核</span>
|
||||
<span class="text-primary" v-if="row.stateCode==proposal.DELEGATION">待审核</span>
|
||||
<span class="text-success" v-if="row.stateCode > proposal.COMMITTEE_READ">已审核</span>
|
||||
<span class="text-primary" v-if="row.stateCode == proposal.COMMITTEE_READ">待审核</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
|
||||
<template scope="{row}">
|
||||
<!-- <el-button type="primary" size="mini" @click="openView(row)">-->
|
||||
<!-- 查阅-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button type="primary" size="mini"-->
|
||||
<!-- v-if="row.isOpinion==0&&[proposal.CASE].includes(row.stateCode)"-->
|
||||
<!-- @click="openAudit(row.id)">-->
|
||||
<!-- 提出意见-->
|
||||
<!-- </el-button>-->
|
||||
<el-button type="primary" size="mini" @click="openView(row)">
|
||||
查阅
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini"
|
||||
v-if="row.isOpinion==0&&[proposal.COMMITTEE_READ].includes(row.stateCode)"
|
||||
@click="openAudit(row.id)">
|
||||
提出意见
|
||||
</el-button>
|
||||
|
||||
<el-button type="primary" size="mini" @click="openRead(row)">
|
||||
<!--<el-button type="primary" size="mini" @click="openRead(row)">
|
||||
查阅
|
||||
</el-button>
|
||||
</el-button>-->
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -146,18 +146,18 @@ layout("/layouts/platform.html"){
|
||||
{prop: 'proposalName', label: '提案名称', width: "300", disabled: true},
|
||||
{prop: 'username', label: '提案人', disabled: true},
|
||||
{prop: 'typeCode', label: '提案类型编码', sortable: true, checked: 0},
|
||||
{prop: 'typeName', label: '提案类型', sortable: true, checked: 0},
|
||||
{prop: 'typeName', label: '提案类型', sortable: true, checked: 1},
|
||||
{prop: 'mannerCode', label: '提案方式编码', sortable: true, checked: 0},
|
||||
{prop: 'mannerName', label: '提案方式', sortable: true, checked: 0},
|
||||
{prop: 'meetingName', label: '届次', sortable: true, checked: 0},
|
||||
{prop: 'mannerName', label: '提案方式', sortable: true, checked: 1},
|
||||
{prop: 'meetingName', label: '届次', sortable: true, checked: 1},
|
||||
{prop: 'delegationCode', label: '代表团编码', sortable: true, checked: 0},
|
||||
{prop: 'delegationName', label: '代表团', sortable: true, checked: 0},
|
||||
{prop: 'delegationName', label: '代表团', sortable: true, checked: 1},
|
||||
{prop: 'stateName', label: '提案状态', sortable: true},
|
||||
{prop: 'caseNum', label: '立案票数', sortable: true},
|
||||
// {prop: 'caseNum', label: '立案票数', sortable: true},
|
||||
// {prop: 'emphasisNum', label: '重点提案票数', sortable: true},
|
||||
// {prop: 'ordinaryNum', label: '普通提案票数', sortable: true},
|
||||
{prop: 'opinionNum', label: '意见建议票数', sortable: true},
|
||||
{prop: 'notGiveNum', label: '不予立案票数', sortable: true},
|
||||
// {prop: 'opinionNum', label: '意见建议票数', sortable: true},
|
||||
// {prop: 'notGiveNum', label: '不予立案票数', sortable: true},
|
||||
|
||||
|
||||
],
|
||||
@@ -272,4 +272,4 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
Reference in New Issue
Block a user