优化代码

This commit is contained in:
RuoYi 2025-03-14 16:09:01 +08:00
parent 525ebf92d2
commit 51632f8e60
5 changed files with 24 additions and 15 deletions

View File

@ -798,14 +798,23 @@ public class Convert
{ {
return (String) obj; return (String) obj;
} }
else if (obj instanceof byte[]) else if (obj instanceof byte[] || obj instanceof Byte[])
{
if (obj instanceof byte[])
{ {
return str((byte[]) obj, charset); return str((byte[]) obj, charset);
} }
else if (obj instanceof Byte[]) else
{ {
byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj); Byte[] bytes = (Byte[]) obj;
return str(bytes, charset); int length = bytes.length;
byte[] dest = new byte[length];
for (int i = 0; i < length; i++)
{
dest[i] = bytes[i];
}
return str(dest, charset);
}
} }
else if (obj instanceof ByteBuffer) else if (obj instanceof ByteBuffer)
{ {
@ -961,9 +970,7 @@ public class Convert
c[i] = (char) (c[i] - 65248); c[i] = (char) (c[i] - 65248);
} }
} }
String returnString = new String(c); return new String(c);
return returnString;
} }
/** /**

View File

@ -64,7 +64,7 @@ public class GenController extends BaseController
} }
/** /**
* 修改代码生成业务 * 获取代码生成信息
*/ */
@PreAuthorize("@ss.hasPermi('tool:gen:query')") @PreAuthorize("@ss.hasPermi('tool:gen:query')")
@GetMapping(value = "/{tableId}") @GetMapping(value = "/{tableId}")

View File

@ -177,7 +177,7 @@ public class SysJobController extends BaseController
@PreAuthorize("@ss.hasPermi('monitor:job:remove')") @PreAuthorize("@ss.hasPermi('monitor:job:remove')")
@Log(title = "定时任务", businessType = BusinessType.DELETE) @Log(title = "定时任务", businessType = BusinessType.DELETE)
@DeleteMapping("/{jobIds}") @DeleteMapping("/{jobIds}")
public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException
{ {
jobService.deleteJobByIds(jobIds); jobService.deleteJobByIds(jobIds);
return success(); return success();

View File

@ -3,7 +3,6 @@ package com.ruoyi.quartz.util;
import java.util.Date; import java.util.Date;
import org.quartz.Job; import org.quartz.Job;
import org.quartz.JobExecutionContext; import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.Constants;
@ -31,7 +30,7 @@ public abstract class AbstractQuartzJob implements Job
private static ThreadLocal<Date> threadLocal = new ThreadLocal<>(); private static ThreadLocal<Date> threadLocal = new ThreadLocal<>();
@Override @Override
public void execute(JobExecutionContext context) throws JobExecutionException public void execute(JobExecutionContext context)
{ {
SysJob sysJob = new SysJob(); SysJob sysJob = new SysJob();
BeanUtils.copyBeanProp(sysJob, context.getMergedJobDataMap().get(ScheduleConstants.TASK_PROPERTIES)); BeanUtils.copyBeanProp(sysJob, context.getMergedJobDataMap().get(ScheduleConstants.TASK_PROPERTIES));

View File

@ -167,6 +167,9 @@ export function handleTree(data, id, parentId, children) {
for (let d of data) { for (let d of data) {
let id = d[config.id]; let id = d[config.id];
childrenListMap[id] = d; childrenListMap[id] = d;
if (!d[config.childrenList]) {
d[config.childrenList] = [];
}
} }
for (let d of data) { for (let d of data) {
@ -216,7 +219,7 @@ export function getNormalPath(p) {
if (res[res.length - 1] === '/') { if (res[res.length - 1] === '/') {
return res.slice(0, res.length - 1) return res.slice(0, res.length - 1)
} }
return res; return res
} }
// 验证是否为blob格式 // 验证是否为blob格式