新增待办信息
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
package com.jeesite.modules.app.Job;
|
||||||
|
|
||||||
|
import com.jeesite.modules.app.utils.LoggerUtils;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class appJob {
|
||||||
|
|
||||||
|
private static final LoggerUtils logger = LoggerUtils.getInstance();
|
||||||
|
|
||||||
|
public void initJob() {
|
||||||
|
try {
|
||||||
|
System.out.println("appJob");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
package com.jeesite.modules.app.Job;
|
package com.jeesite.modules.app.Job.biz;
|
||||||
|
|
||||||
|
|
||||||
import com.jeesite.modules.app.dao.TableTree;
|
import com.jeesite.modules.app.dao.TableTree;
|
||||||
import com.jeesite.modules.app.utils.LoggerUtils;
|
import com.jeesite.modules.app.utils.LoggerUtils;
|
||||||
import com.jeesite.modules.app.utils.MyFileUtils;
|
|
||||||
import com.jeesite.modules.app.utils.MysqlUtils;
|
import com.jeesite.modules.app.utils.MysqlUtils;
|
||||||
import com.jeesite.modules.app.utils.vDate;
|
import com.jeesite.modules.app.utils.vDate;
|
||||||
import com.jeesite.modules.biz.entity.BizDbConfig;
|
import com.jeesite.modules.biz.entity.BizDbConfig;
|
||||||
@@ -19,10 +18,8 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@@ -47,11 +44,22 @@ public class dataJob {
|
|||||||
|
|
||||||
private static final LoggerUtils logger = LoggerUtils.getInstance();
|
private static final LoggerUtils logger = LoggerUtils.getInstance();
|
||||||
|
|
||||||
|
|
||||||
|
@Scheduled(cron = "10 30 2 * * ?")
|
||||||
|
public void initJob() {
|
||||||
|
try {
|
||||||
|
ExecScript();
|
||||||
|
DataManager();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据字典更新
|
* 数据字典更新
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "10 30 2 * * ?")
|
public void DataManager() {
|
||||||
public void getDataManager() {
|
|
||||||
BizDbConfig dbConfig = new BizDbConfig();
|
BizDbConfig dbConfig = new BizDbConfig();
|
||||||
dbConfig.setIsEnabled("1");
|
dbConfig.setIsEnabled("1");
|
||||||
List<BizDbConfig> configList = dbConfigService.findList(dbConfig);
|
List<BizDbConfig> configList = dbConfigService.findList(dbConfig);
|
||||||
@@ -83,8 +91,7 @@ public class dataJob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Scheduled(cron = "0 30 0 * * ?")
|
public void ExecScript() {
|
||||||
public void getExecScript() {
|
|
||||||
BizExecScript execScript = new BizExecScript();
|
BizExecScript execScript = new BizExecScript();
|
||||||
execScript.setDataStatus("1");
|
execScript.setDataStatus("1");
|
||||||
List<BizExecScript> bizExecScriptList = bizExecScriptService.findList(execScript);
|
List<BizExecScript> bizExecScriptList = bizExecScriptService.findList(execScript);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jeesite.modules.app.Job;
|
package com.jeesite.modules.app.Job.biz;
|
||||||
|
|
||||||
import com.jeesite.common.config.Global;
|
import com.jeesite.common.config.Global;
|
||||||
import com.jeesite.modules.app.dao.info.CpuInfo;
|
import com.jeesite.modules.app.dao.info.CpuInfo;
|
||||||
@@ -40,11 +40,19 @@ public class hostJob {
|
|||||||
private static final double DISK_RATE = Double.parseDouble(Global.getConfig("biz.host.Disk", "60"));
|
private static final double DISK_RATE = Double.parseDouble(Global.getConfig("biz.host.Disk", "60"));
|
||||||
private static final LoggerUtils logger = LoggerUtils.getInstance();
|
private static final LoggerUtils logger = LoggerUtils.getInstance();
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 0/15 * * * ?")
|
||||||
|
public void initJob() {
|
||||||
|
try {
|
||||||
|
HostStatus();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主机运行与磁盘监测
|
* 主机运行与磁盘监测
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0/15 * * * ?")
|
public void HostStatus() {
|
||||||
public void getHostStatus() {
|
|
||||||
List<BizMonitorHost> hosts = monitorHostService.findList(new BizMonitorHost());
|
List<BizMonitorHost> hosts = monitorHostService.findList(new BizMonitorHost());
|
||||||
List<CompletableFuture<Void>> futures = new ArrayList<>(hosts.size());
|
List<CompletableFuture<Void>> futures = new ArrayList<>(hosts.size());
|
||||||
for (BizMonitorHost monitorHost : hosts) {
|
for (BizMonitorHost monitorHost : hosts) {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.jeesite.modules.app.Job;
|
package com.jeesite.modules.app.Job.biz;
|
||||||
|
|
||||||
import com.jeesite.common.config.Global;
|
import com.jeesite.common.config.Global;
|
||||||
import com.jeesite.modules.app.dao.MailReceived;
|
import com.jeesite.modules.app.dao.MailReceived;
|
||||||
@@ -42,7 +42,16 @@ public class mailJob {
|
|||||||
private static final String CRON_JOB = Global.getConfig("biz.cron.MailJob", "false");
|
private static final String CRON_JOB = Global.getConfig("biz.cron.MailJob", "false");
|
||||||
|
|
||||||
@Scheduled(cron = "10 0/15 * * * ?")
|
@Scheduled(cron = "10 0/15 * * * ?")
|
||||||
public void getMailReceived() {
|
public void initJob() {
|
||||||
|
try {
|
||||||
|
MailReceived();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void MailReceived() {
|
||||||
if (CRON_JOB.equals("true")) {
|
if (CRON_JOB.equals("true")) {
|
||||||
List<BizMailAccount> accounts = bizMailAccountService.findList(new BizMailAccount());
|
List<BizMailAccount> accounts = bizMailAccountService.findList(new BizMailAccount());
|
||||||
List<CompletableFuture<Void>> futures = new ArrayList<>(accounts.size());
|
List<CompletableFuture<Void>> futures = new ArrayList<>(accounts.size());
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.jeesite.modules.app.Job.biz;
|
||||||
|
|
||||||
|
import com.jeesite.modules.app.utils.LoggerUtils;
|
||||||
|
import com.jeesite.modules.biz.service.BizListItemService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class msgJob {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BizListItemService bizListItemService;
|
||||||
|
|
||||||
|
|
||||||
|
private static final LoggerUtils logger = LoggerUtils.getInstance();
|
||||||
|
|
||||||
|
public void initJob() {
|
||||||
|
try {
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.jeesite.modules.app.service;
|
||||||
|
|
||||||
|
import com.jeesite.common.config.Global;
|
||||||
|
import com.jeesite.modules.app.utils.MyUtils;
|
||||||
|
import com.jeesite.modules.biz.entity.BizCalendarSchedule;
|
||||||
|
import com.jeesite.modules.biz.entity.BizListItem;
|
||||||
|
import com.jeesite.modules.biz.service.BizListItemService;
|
||||||
|
import com.jeesite.modules.sys.entity.User;
|
||||||
|
import com.jeesite.modules.sys.utils.UserUtils;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MsgService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BizListItemService bizListItemService;
|
||||||
|
|
||||||
|
private static final String HTTP_URL = Global.getConfig("biz.http.url", "");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日程待办
|
||||||
|
*/
|
||||||
|
public void addSchedule(BizCalendarSchedule bizCalendarSchedule) {
|
||||||
|
User user = UserUtils.getUser();
|
||||||
|
User fUser = UserUtils.getByLoginCode(bizCalendarSchedule.getParticipantUser());
|
||||||
|
String title = MyUtils.concatParams("您有一条:[", bizCalendarSchedule.getTitle(), "]日程消息,请及时处理.");
|
||||||
|
BizListItem listItem = new BizListItem(title, bizCalendarSchedule.getEndTime(), bizCalendarSchedule.getContent(), fUser.getLoginCode(), fUser.getUserName(), user.getLoginCode());
|
||||||
|
listItem.setAvatar(HTTP_URL + user.getAvatar());
|
||||||
|
bizListItemService.save(listItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,17 @@ import java.util.Map;
|
|||||||
public class MyUtils {
|
public class MyUtils {
|
||||||
|
|
||||||
|
|
||||||
|
public static String concatParams(String... args) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (String param : args) {
|
||||||
|
if (param != null) {
|
||||||
|
sb.append(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Map<String, Object> convertToTreeNode(BizFolders folder, String parentName) {
|
public static Map<String, Object> convertToTreeNode(BizFolders folder, String parentName) {
|
||||||
Map<String, Object> node = new HashMap<>();
|
Map<String, Object> node = new HashMap<>();
|
||||||
node.put("folderId", folder.getFolderId());
|
node.put("folderId", folder.getFolderId());
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class BizListItem extends DataEntity<BizListItem> implements Serializable
|
|||||||
private String avatar; // 头像图标
|
private String avatar; // 头像图标
|
||||||
private String title; // 通知标题
|
private String title; // 通知标题
|
||||||
private String titleDelete; // 是否删除
|
private String titleDelete; // 是否删除
|
||||||
private String datetime; // 发送时间
|
private Date datetime; // 发送时间
|
||||||
private String type; // 类型标识
|
private String type; // 类型标识
|
||||||
private String readFlag; // 是否已读
|
private String readFlag; // 是否已读
|
||||||
private String description; // 描述信息
|
private String description; // 描述信息
|
||||||
@@ -105,6 +105,21 @@ public class BizListItem extends DataEntity<BizListItem> implements Serializable
|
|||||||
super(id);
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BizListItem(String title, Date datetime, String description, String loginUser, String userName, String createUser) {
|
||||||
|
this.createTime = new Date();
|
||||||
|
this.title = title;
|
||||||
|
this.titleDelete = "0";
|
||||||
|
this.datetime = datetime;
|
||||||
|
this.type = "2";
|
||||||
|
this.readFlag = "0";
|
||||||
|
this.description = description;
|
||||||
|
this.clickClose = "0";
|
||||||
|
this.ustatus = "1";
|
||||||
|
this.loginUser = loginUser;
|
||||||
|
this.userName = userName;
|
||||||
|
this.createUser = createUser;
|
||||||
|
}
|
||||||
|
|
||||||
public Date getCreateTime_gte() {
|
public Date getCreateTime_gte() {
|
||||||
return sqlMap.getWhere().getValue("create_time", QueryType.GTE);
|
return sqlMap.getWhere().getValue("create_time", QueryType.GTE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,12 @@ package com.jeesite.modules.biz.web;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.jeesite.modules.app.service.MsgService;
|
||||||
import com.jeesite.modules.app.utils.vDate;
|
import com.jeesite.modules.app.utils.vDate;
|
||||||
import com.jeesite.modules.biz.entity.BizCalendarFlow;
|
import com.jeesite.modules.biz.entity.BizCalendarFlow;
|
||||||
|
import com.jeesite.modules.biz.entity.BizListItem;
|
||||||
import com.jeesite.modules.biz.service.BizCalendarFlowService;
|
import com.jeesite.modules.biz.service.BizCalendarFlowService;
|
||||||
|
import com.jeesite.modules.biz.service.BizListItemService;
|
||||||
import com.jeesite.modules.sys.entity.User;
|
import com.jeesite.modules.sys.entity.User;
|
||||||
import com.jeesite.modules.sys.utils.DictUtils;
|
import com.jeesite.modules.sys.utils.DictUtils;
|
||||||
import com.jeesite.modules.sys.utils.UserUtils;
|
import com.jeesite.modules.sys.utils.UserUtils;
|
||||||
@@ -46,8 +49,13 @@ public class BizCalendarScheduleController extends BaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
private BizCalendarFlowService flowService;
|
private BizCalendarFlowService flowService;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MsgService msgService;
|
||||||
|
|
||||||
private final BizCalendarScheduleService bizCalendarScheduleService;
|
private final BizCalendarScheduleService bizCalendarScheduleService;
|
||||||
|
|
||||||
|
|
||||||
public BizCalendarScheduleController(BizCalendarScheduleService bizCalendarScheduleService) {
|
public BizCalendarScheduleController(BizCalendarScheduleService bizCalendarScheduleService) {
|
||||||
this.bizCalendarScheduleService = bizCalendarScheduleService;
|
this.bizCalendarScheduleService = bizCalendarScheduleService;
|
||||||
}
|
}
|
||||||
@@ -104,6 +112,7 @@ public class BizCalendarScheduleController extends BaseController {
|
|||||||
if (!bizCalendarSchedule.getIsNewRecord()) {
|
if (!bizCalendarSchedule.getIsNewRecord()) {
|
||||||
getScheduleFlow(bizCalendarSchedule, user);
|
getScheduleFlow(bizCalendarSchedule, user);
|
||||||
}
|
}
|
||||||
|
msgService.addSchedule(bizCalendarSchedule);
|
||||||
bizCalendarSchedule.setCreatorUser(user.getLoginCode());
|
bizCalendarSchedule.setCreatorUser(user.getLoginCode());
|
||||||
bizCalendarSchedule.setParticipantName(fUser.getUserName());
|
bizCalendarSchedule.setParticipantName(fUser.getUserName());
|
||||||
bizCalendarScheduleService.save(bizCalendarSchedule);
|
bizCalendarScheduleService.save(bizCalendarSchedule);
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package com.jeesite.modules.biz.web;
|
package com.jeesite.modules.biz.web;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.jeesite.modules.app.dao.TabItem;
|
import com.jeesite.modules.app.dao.TabItem;
|
||||||
@@ -188,6 +185,7 @@ public class BizListItemController extends BaseController {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<TabItem> getTabListData() {
|
public List<TabItem> getTabListData() {
|
||||||
User user = UserUtils.getUser();
|
User user = UserUtils.getUser();
|
||||||
|
Set<String> targetCodes = new HashSet<>(Arrays.asList("2", "3"));
|
||||||
return Arrays.stream(NotifyType.values())
|
return Arrays.stream(NotifyType.values())
|
||||||
.map(type -> {
|
.map(type -> {
|
||||||
BizListItem listItem = new BizListItem();
|
BizListItem listItem = new BizListItem();
|
||||||
@@ -196,7 +194,7 @@ public class BizListItemController extends BaseController {
|
|||||||
listItem.setUstatus("1");
|
listItem.setUstatus("1");
|
||||||
listItem.setType(type.getCode());
|
listItem.setType(type.getCode());
|
||||||
listItem.setDateTime_gte(new Date());
|
listItem.setDateTime_gte(new Date());
|
||||||
if (type.getCode().equals("3")) {
|
if (targetCodes.contains(type.getCode())) {
|
||||||
listItem.setLoginUser(user.getLoginCode());
|
listItem.setLoginUser(user.getLoginCode());
|
||||||
}
|
}
|
||||||
List<BizListItem> dataList = bizListItemService.findList(listItem);
|
List<BizListItem> dataList = bizListItemService.findList(listItem);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
componentProps: {
|
componentProps: {
|
||||||
selectType: 'userSelect',
|
selectType: 'userSelect',
|
||||||
},
|
},
|
||||||
ifShow: () => types.value === '3',
|
ifShow: () => ['2', '3'].includes(types.value),
|
||||||
required: true,
|
required: true,
|
||||||
colProps: { md: 24, lg: 24 },
|
colProps: { md: 24, lg: 24 },
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user