This commit is contained in:
JyuHsin
2026-03-04 15:12:12 +08:00
parent 61bb6ddb50
commit de467361d9
13 changed files with 75 additions and 36 deletions
@@ -75,10 +75,6 @@ public class SmsJshvcServiceImpl implements SmsService {
*/
private void doSend(String title, String content, List<Map<String, String>> receivers, String link) {
if(!SecurityUtil.getUserLoginname().equals("superadmin")) {
return;
}
if (Lang.isEmpty(receivers)) {
log.error("send fail by receivers is null");
return;
@@ -94,7 +90,7 @@ public class SmsJshvcServiceImpl implements SmsService {
NutMap paramsMap = new NutMap();
paramsMap.put("sign", sign);
paramsMap.put("msgType", "0");
paramsMap.put("subject", title);
paramsMap.put("subject", "智慧工会");
paramsMap.put("content", content);
paramsMap.put("sendType", "5");
paramsMap.put("receivers", receivers);
@@ -117,6 +117,7 @@ public class FlowTodoCenterController {
if (StrUtil.isNotBlank(searchKeyword)) {
cnd.where().andLike("ins.variable ->> '$.instanceName'", searchKeyword);
}
cnd.and("t.taskName", "!=", "startTask");
cnd.desc("t.createdAt");
sql.setCondition(cnd);
Pagination pagination = sysUserService.listPageMap(pageNumber, pageSize, sql);
@@ -9,6 +9,7 @@ import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.entity.ProcessTaskActor;
import com.budwk.app.flow.enums.ProcessEventTypeEnum;
import com.budwk.app.todo.service.TodoService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Cnd;
@@ -61,8 +62,11 @@ public class ProcessTaskStartEventListener implements ProcessEventListener {
for (ProcessTaskActor taskActor : taskActors) {
// 模拟发送消息
String message = StrUtil.format("您有一条待办任务,实例:{},处理环节:{}", taskActor.getActorName(), instanceName, taskDisplayName);
String message = StrUtil.format("您有一条待办任务,实例:{},处理环节:{}", instanceName, taskDisplayName);
log.info(message);
if (!List.of("superadmin" ,"CS2025015", "20182040").contains(SecurityUtil.getUserLoginname())) {
break;
}
globalMessageSendService.sendMessage(taskDisplayName, message, 2, List.of(taskActor.getActorId()), null);
}
@@ -32,6 +32,8 @@ import com.budwk.app.flow.service.ProcessTaskService;
import com.budwk.app.flow.vo.HighLightVO;
import com.budwk.app.flow.vo.ProcessInstanceVO;
import com.budwk.app.flow.vo.ProcessTaskVO;
import com.budwk.app.todo.service.TodoService;
import com.budwk.app.todo.service.impl.TodoServiceImpl;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
@@ -43,6 +45,7 @@ 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.Mvcs;
import java.util.*;
import java.util.stream.Collectors;
@@ -558,6 +561,10 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl<ProcessInstance>
List<Long> taskIds = taskList.stream().map(ProcessTask::getId).toList();
dao().clear(ProcessTask.class, Cnd.where(ProcessTask::getId, "in", taskIds));
dao().clear(ProcessInstance.class, Cnd.where(ProcessInstance::getId, "=", processInstanceId));
// 删除学校待办
TodoService todoService = Mvcs.getIoc().get(TodoServiceImpl.class);
todoService.deleteProcessInstance(processInstanceId.toString());
}
@Override
@@ -131,7 +131,7 @@ public class SysSignatureController {
@Aop(TransAop.READ_COMMITTED)
public Result update(@Param("file") TempFile tempFile) {
String url = sysFileService.uploadReturnUrl(SysFileEngineTypeEnum.MINIO.getValue(), tempFile);
Sys_user_signature sysUserSignature = dao.fetch(Sys_user_signature.class);
Sys_user_signature sysUserSignature = dao.fetch(Sys_user_signature.class, Cnd.where("userId", "=", SecurityUtil.getUserId()));
if (ObjectUtil.isNull(sysUserSignature)) {
sysUserSignature = new Sys_user_signature();
}
@@ -361,10 +361,15 @@ public class SysUserController {
if (StrUtil.isBlank(pathname)) {
}
int i = pathname.indexOf("?");
if(i > 0) {
pathname = pathname.substring(0, i);
}
int i = pathname.indexOf("?");
if (i > 0) {
pathname = pathname.substring(0, i);
}
if (pathname.contains("webvpn")) {
int platform = pathname.indexOf("/platform");
pathname = pathname.substring(platform);
}
// Sys_menu menu = sysMenuService.fetch(Cnd.where(Sys_menu::getHref, "like", pathname + "%"));
Sys_menu menu = sysMenuService.fetch(Cnd.where(Sys_menu::getHref, "=", pathname));
if (menu == null) {
@@ -12,7 +12,9 @@ public class TodoPlatformConfig {
// token 获取
public static final String TOKEN_URL = "https://gateway.jshvc.edu.cn/token/gateway/accessToken";
// 待办平台基础地址
public static final String TODO_PLATFORM_BASE_URL = "https://gateway.jshvc.edu.cn/casp-tdc/task/saveOrUpdate";
public static final String TODO_PLATFORM_BASE_URL = "https://gateway.jshvc.edu.cn";
// 待办平台新增或者修改
public static final String TODO_PLATFORM_SAVE_OR_UPDATE_URL = "https://gateway.jshvc.edu.cn/casp-tdc/task/saveOrUpdate";
// 待办平台修改地址
public static final String TODO_PLATFORM_MODIFY_URL = "https://gateway.jshvc.edu.cn/casp-tdc/task/modifyInfo";
// 待办平台删除任务地址
@@ -12,6 +12,7 @@ import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.todo.platform.TodoPlatformConfig;
import com.budwk.app.todo.service.TodoService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.web.commons.base.Globals;
import com.wisedu.casp.sdk.api.BaseResponse;
import com.wisedu.casp.sdk.api.tdc.constants.*;
import com.wisedu.casp.sdk.api.tdc.model.*;
@@ -55,7 +56,7 @@ public class TodoServiceImpl implements TodoService {
@Override
public void saveTask(ProcessTask task) {
if(!SecurityUtil.getUserLoginname().equals("superadmin")) {
if (!List.of("superadmin" ,"CS2025015", "20182040").contains(SecurityUtil.getUserLoginname())) {
return;
}
log.info("新增待办任务,任务数据:{}", Json.toJson(task));
@@ -66,6 +67,7 @@ public class TodoServiceImpl implements TodoService {
ProcessDefine define = dao.fetch(ProcessDefine.class, instance.getProcessDefineId());
// 获取流程发起人
String initiatorAccount = Json.fromJson(NutMap.class, instance.getVariable()).getString(FlowConst.INITIATOR_ACCOUNT);
String instanceName = Json.fromJson(NutMap.class, instance.getVariable()).getString("instanceName");
// 获取任务执行人
List<ProcessTaskActor> taskActors = dao.query(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
List<Processor> processorList = taskActors.stream().map(o -> new Processor(o.getActorAccount())).toList();
@@ -79,25 +81,31 @@ public class TodoServiceImpl implements TodoService {
insertModel.setTaskId(task.getId().toString());
insertModel.setInitiatorId(initiatorAccount);
insertModel.setInitiatorType(ProcessorType.USER_ACCOUNT);
insertModel.setSubject(define.getDisplayName());
insertModel.setSubject(instanceName);
insertModel.setPriority(PriorityType.COMMON);
insertModel.setTaskType(TaskType.COMMON);
insertModel.setProcessors(processorList);
insertModel.setProcessType(ProcessType.OR_SIGN);
insertModel.setNodeId(task.getId().toString());
insertModel.setNodeName(task.getTaskName());
insertModel.setPcViewUrl(task.getFormKey());
insertModel.setH5ViewUrl(task.getH5FormKey());
insertModel.setNodeName(task.getDisplayName());
insertModel.setPcViewUrl(Globals.AppDomain + task.getFormKey());
insertModel.setH5ViewUrl(Globals.AppDomain + task.getH5FormKey());
// insertModel.setServiceId("xxx");
// insertModel.setServiceName("xxx");
// 任务关联的申请信息
ApplicationModel applicationModel = new ApplicationModel();
applicationModel.setProcessInstanceId(instance.getId().toString());
applicationModel.setSubject(define.getDisplayName());
applicationModel.setProcessors(processorList);
applicationModel.setProcessInstanceStatus(ProcessInstanceStatusType.RUNNING);
applicationModel.setNodeId(task.getId().toString());
applicationModel.setNodeName(task.getDisplayName());
insertModel.setApplicationModel(applicationModel);
request.setInsertModel(Collections.singletonList(insertModel));
log.info("新增待办任务,请求参数:{}", Json.toJson(request));
BaseResponse response = client.execute(request);
log.info("新增待办任务,接口响应数据:{}", Json.toJson(response));
} catch (Exception e) {
@@ -107,7 +115,7 @@ public class TodoServiceImpl implements TodoService {
@Override
public void updateTask(ProcessTask task) {
if(!SecurityUtil.getUserLoginname().equals("superadmin")) {
if (!List.of("superadmin" ,"CS2025015", "20182040").contains(SecurityUtil.getUserLoginname())) {
return;
}
log.info("更新待办任务,任务数据:{}", Json.toJson(task));
@@ -123,7 +131,7 @@ public class TodoServiceImpl implements TodoService {
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(task.getId());
// 创建客户端
Client client = new DefaultClient(TodoPlatformConfig.TODO_PLATFORM_MODIFY_URL, TodoPlatformConfig.TODO_APP_ID, TodoPlatformConfig.TODO_APP_SECRET);
Client client = new DefaultClient(TodoPlatformConfig.TODO_PLATFORM_BASE_URL, TodoPlatformConfig.TODO_APP_ID, TodoPlatformConfig.TODO_APP_SECRET);
// 创建请求对象
SaveOrUpdateRequest request = new SaveOrUpdateRequest();
@@ -142,11 +150,12 @@ public class TodoServiceImpl implements TodoService {
applyModel.setProcessInstanceId(instance.getId().toString());
applyModel.setProcessInstanceStatus(ProcessInstanceStatusType.RUNNING);
applyModel.setNodeId(task.getId().toString());
applyModel.setNodeName(task.getTaskName());
applyModel.setNodeName(task.getDisplayName());
applyModel.setProcessors(processorList);
updateModel.setApplyModels(Collections.singletonList(applyModel));
request.setUpdateModel(updateModel);
log.info("更新待办任务,请求参数:{}", Json.toJson(request));
BaseResponse response = client.execute(request);
log.info("更新待办任务,接口响应数据:{}", Json.toJson(response));
} catch (Exception e) {
@@ -156,13 +165,13 @@ public class TodoServiceImpl implements TodoService {
@Override
public void modifyInfo(ProcessTask task) {
if(!SecurityUtil.getUserLoginname().equals("superadmin")) {
if (!List.of("superadmin" ,"CS2025015", "20182040").contains(SecurityUtil.getUserLoginname())) {
return;
}
log.info("修改待办任务,任务数据:{}", Json.toJson(task));
try {
// 创建客户端
Client client = new DefaultClient(TodoPlatformConfig.TODO_PLATFORM_MODIFY_URL, TodoPlatformConfig.TODO_APP_ID, TodoPlatformConfig.TODO_APP_SECRET);
Client client = new DefaultClient(TodoPlatformConfig.TODO_PLATFORM_BASE_URL, TodoPlatformConfig.TODO_APP_ID, TodoPlatformConfig.TODO_APP_SECRET);
// 创建请求对象
TaskModifyInfoRequest request = new TaskModifyInfoRequest();
// 需要修改什么后面扩展吧
@@ -170,6 +179,7 @@ public class TodoServiceImpl implements TodoService {
request.setSubject("test");
request.setProcessors(Arrays.asList(new Processor("user01"), new Processor("user02")));
log.info("修改待办任务,请求参数:{}", Json.toJson(request));
BaseResponse response = client.execute(request);
log.info("修改待办任务,接口响应数据:{}", Json.toJson(response));
} catch (Exception e) {
@@ -179,16 +189,18 @@ public class TodoServiceImpl implements TodoService {
@Override
public void deleteTask(String taskId) {
if(!SecurityUtil.getUserLoginname().equals("superadmin")) {
if (!List.of("superadmin" ,"CS2025015", "20182040").contains(SecurityUtil.getUserLoginname())) {
return;
}
log.info("删除待办任务,任务ID{}", taskId);
try {
// 创建客户端
Client client = new DefaultClient(TodoPlatformConfig.TODO_PLATFORM_DELETE_TASK_URL, TodoPlatformConfig.TODO_APP_ID, TodoPlatformConfig.TODO_APP_SECRET);
Client client = new DefaultClient(TodoPlatformConfig.TODO_PLATFORM_BASE_URL, TodoPlatformConfig.TODO_APP_ID, TodoPlatformConfig.TODO_APP_SECRET);
// 创建请求对象
TaskRealDeleteRequest request = new TaskRealDeleteRequest();
request.setTaskId(taskId);
log.info("删除待办任务,请求参数:{}", Json.toJson(request));
BaseResponse response = client.execute(request);
log.info("删除待办任务,接口响应数据:{}", Json.toJson(response));
} catch (Exception e) {
@@ -198,16 +210,18 @@ public class TodoServiceImpl implements TodoService {
@Override
public void deleteProcessInstance(String processInstanceId) {
if(!SecurityUtil.getUserLoginname().equals("superadmin")) {
if (!List.of("superadmin" ,"CS2025015", "20182040").contains(SecurityUtil.getUserLoginname())) {
return;
}
log.info("删除待办流程,实例ID{}", processInstanceId);
try {
// 创建客户端
Client client = new DefaultClient(TodoPlatformConfig.TODO_PLATFORM_DELETE_INSTANCE_URL, TodoPlatformConfig.TODO_APP_ID, TodoPlatformConfig.TODO_APP_SECRET);
Client client = new DefaultClient(TodoPlatformConfig.TODO_PLATFORM_BASE_URL, TodoPlatformConfig.TODO_APP_ID, TodoPlatformConfig.TODO_APP_SECRET);
// 创建请求对象
ProcessInstanceRealDeleteRequest request = new ProcessInstanceRealDeleteRequest();
request.setProcessInstanceId(processInstanceId);
log.info("删除待办流程,请求参数:{}", Json.toJson(request));
BaseResponse response = client.execute(request);
log.info("删除待办流程,接口响应数据:{}", Json.toJson(response));
} catch (Exception e) {
@@ -34,7 +34,7 @@ public class Globals {
//项目LOGO
public static String AppLogo = "";
//项目域名
public static String AppDomain = "http://127.0.0.1";
public static String AppDomain = "https://zhgh.jshvc.edu.cn";
//文件访问域名
public static String AppFileDomain = "";
//学校代码
@@ -145,6 +145,7 @@ public class ActivityReimbursementApplyController {
args.set("outlayManageSource", activityReimbursementInfo.getOutlayManageSource());
args.set("actualMoney", activityReimbursementInfo.getActualMoney());
args.set("next", activityReimbursementInfo.getReimbursementIdentity());
args.set("clubId",activityReimbursementInfo.getClubId());
ProcessInstance instance = flowEngine.startProcessInstanceByKey("HDBX", activityReimbursementInfo.getId(), SecurityUtil.getUserId(), args);
// 自动完成第一个申请任务
@@ -137,7 +137,7 @@ public class ActivityReimbursementMineController {
""");
Cnd cnd = Cnd.NEW();
SqlExpressionGroup group = new SqlExpressionGroup();
if (AuthUtil.hasPermission("activityReimbursement.apply.schoolHas")) {
/*if (AuthUtil.hasPermission("activityReimbursement.apply.schoolHas")) {
group.or("info.reimbursementIdentity", "=", "school");
}
if (AuthUtil.hasPermission("activityReimbursement.apply.unionHas")) {
@@ -151,8 +151,8 @@ public class ActivityReimbursementMineController {
clubGroup.and("info.clubId", "in", SecurityUtil.getClubIds());
clubGroup.and("info.reimbursementIdentity", "=", "club");
group.or(clubGroup);
}
if (Lang.isNotEmpty(group)) {
}*/
if (!group.isEmpty()) {
cnd.and(group);
} else {
cnd.and("info.userId", "=", SecurityUtil.getUserId());
@@ -70,10 +70,10 @@
<script src="${base!}/assets/platform/plugins/g2plot/g2plot.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/goober@2.1.10/dist/goober.umd.js"></script>-->
<script
<!--<script
type="text/javascript"
src="https://webapi.amap.com/maps?v=2.0&key=57f0d098ba1b881ecc436c4cfd23bbbf&plugin=AMap.PolyEditor,AMap.Geolocation"
></script>
></script>-->
<script src="https://map.qq.com/api/gljs?v=2.exp&key=MLLBZ-GQECI-ASXG7-5GNOZ-XW2OF-H5BVH"></script>
<script nonce="${cspNonce!}">
@@ -284,9 +284,11 @@ layout("/layouts/v4/baseLayout.html"){
<!-- 表格展示 -->
<el-table v-loading="loading" :data="tasks" style="width: 100%" :key="activeTab"
:header-cell-style="{backgroundColor: '#f5f7fa'}">
<el-table-column prop="instanceName" label="流程名称" min-width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="instanceName" label="流程名称" min-width="180"
show-overflow-tooltip></el-table-column>
<el-table-column prop="taskName" label="任务节点" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="categoryName" label="流程分类" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="categoryName" label="流程分类" min-width="150"
show-overflow-tooltip></el-table-column>
<el-table-column prop="initiatorName" label="申请人" min-width="120">
<template slot-scope="{row}">{{row.variable.initiatorName}}</template>
</el-table-column>
@@ -374,7 +376,7 @@ layout("/layouts/v4/baseLayout.html"){
},
created() {
if(GetQueryString("status")){
if (GetQueryString("status")) {
this.activeTab = GetQueryString("status")
}
this.initData()
@@ -464,7 +466,14 @@ layout("/layouts/v4/baseLayout.html"){
this.$message.warning("当前流程没有配置地址")
return
}
window.open(formKey + "?taskId=" + taskId + "bizId=" + businessNo + "taskKey=" + taskKey)
if (this.activeTab === "todo") {
window.open(formKey + "?taskId=" + taskId + "bizId=" + businessNo + "taskKey=" + taskKey)
} else if (this.activeTab === "done") {
window.open(formKey + "?taskId=" + taskId + "bizId=" + businessNo + "taskKey=" + taskKey)
} else {
window.open(formKey)
}
},
// 获取空状态文本