系统设置
角色
This commit is contained in:
pan.wl.2 2024-10-22 16:27:11 +08:00
parent d319816a17
commit 68e587fb66
51 changed files with 631 additions and 493 deletions

View File

@ -1,6 +1,6 @@
package com.mdd.admin.config.quartz;
import com.mdd.common.entity.Crontab;
import com.mdd.common.entity.DevCrontab;
import com.mdd.common.util.SpringUtils;
import com.mdd.common.util.StringUtils;
@ -19,7 +19,7 @@ public class InvokeUtils {
*
* @param crontab 系统任务
*/
public static void invokeMethod(Crontab crontab) throws Exception {
public static void invokeMethod(DevCrontab crontab) throws Exception {
String invokeTarget = crontab.getCommand();
String beanName = getBeanName(invokeTarget);
String methodName = getMethodName(invokeTarget);

View File

@ -2,7 +2,7 @@ package com.mdd.admin.config.quartz;
import com.mdd.admin.config.quartz.exceution.QuartzDisExecution;
import com.mdd.admin.config.quartz.exceution.QuartzJobExecution;
import com.mdd.common.entity.Crontab;
import com.mdd.common.entity.DevCrontab;
import com.mdd.common.util.StringUtils;
import org.quartz.*;
@ -17,9 +17,10 @@ public class QuartzUtils {
* @param crontab 执行计划
* @return 具体执行任务类
*/
private static Class<? extends Job> getQuartzJobClass(Crontab crontab) {
boolean isConcurrent = crontab.getConcurrent().equals(0);
return isConcurrent ? QuartzJobExecution.class : QuartzDisExecution.class;
private static Class<? extends Job> getQuartzJobClass(DevCrontab crontab) {
// boolean isConcurrent = crontab.getConcurrent().equals(0);
// return isConcurrent ? QuartzJobExecution.class : QuartzDisExecution.class;
return QuartzJobExecution.class;
}
/**
@ -51,10 +52,11 @@ public class QuartzUtils {
* @param job 任务
* @throws SchedulerException 调度异常
*/
public static void createScheduleJob(Scheduler scheduler, Crontab job) throws SchedulerException {
public static void createScheduleJob(Scheduler scheduler, DevCrontab job) throws SchedulerException {
Integer jobId = job.getId();
String jobGroup = job.getTypes();
String expression = job.getRules();
String jobGroup = job.getType().toString();
String expression = job.getExpression();
// 构建任务
Class<? extends Job> jobClass = getQuartzJobClass(job);
@ -64,17 +66,19 @@ public class QuartzUtils {
// 构建时间
CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(expression);
switch (job.getStrategy()) {
case 1: // 立即执行
cronScheduleBuilder = cronScheduleBuilder.withMisfireHandlingInstructionIgnoreMisfires();
break;
case 2: // 执行一次
cronScheduleBuilder = cronScheduleBuilder.withMisfireHandlingInstructionFireAndProceed();
break;
case 3: // 放弃执行
cronScheduleBuilder = cronScheduleBuilder.withMisfireHandlingInstructionDoNothing();
break;
}
// switch (job.getStrategy()) {
// case 1: // 立即执行
// cronScheduleBuilder = cronScheduleBuilder.withMisfireHandlingInstructionIgnoreMisfires();
// break;
// case 2: // 执行一次
// cronScheduleBuilder = cronScheduleBuilder.withMisfireHandlingInstructionFireAndProceed();
// break;
// case 3: // 放弃执行
// cronScheduleBuilder = cronScheduleBuilder.withMisfireHandlingInstructionDoNothing();
// break;
// }
cronScheduleBuilder = cronScheduleBuilder.withMisfireHandlingInstructionIgnoreMisfires();
// 注入参数
jobDetail.getJobDataMap().put(TaskConstants.TASK_PROPERTIES, job);
@ -91,7 +95,7 @@ public class QuartzUtils {
}
// 如果过期则调度
if (StringUtils.isNotNull(CronUtils.nextExecution(job.getRules()))) {
if (StringUtils.isNotNull(CronUtils.nextExecution(job.getExpression()))) {
scheduler.scheduleJob(jobDetail, trigger);
}

View File

@ -1,8 +1,8 @@
package com.mdd.admin.config.quartz.exceution;
import com.mdd.admin.config.quartz.TaskConstants;
import com.mdd.common.entity.Crontab;
import com.mdd.common.mapper.CrontabMapper;
import com.mdd.common.entity.DevCrontab;
import com.mdd.common.mapper.DevCrontabMapper;
import com.mdd.common.util.SpringUtils;
import com.mdd.common.util.StringUtils;
import org.quartz.Job;
@ -27,7 +27,7 @@ public abstract class AbstractQuartzJob implements Job {
*/
@Override
public void execute(JobExecutionContext context) {
Crontab crontab = new Crontab();
DevCrontab crontab = new DevCrontab();
BeanUtils.copyProperties(context.getMergedJobDataMap().get(TaskConstants.TASK_PROPERTIES), crontab);
try {
before();
@ -51,22 +51,23 @@ public abstract class AbstractQuartzJob implements Job {
*
* @param crontab 系统计划任务
*/
protected void after(Crontab crontab, Exception e)
protected void after(DevCrontab crontab, Exception e)
{
long startTime = threadLocal.get();
long endTime = System.currentTimeMillis();
threadLocal.remove();
crontab.setError("");
crontab.setStartTime(startTime / 1000);
crontab.setEndTime(endTime / 1000);
crontab.setTaskTime(endTime - startTime);
// crontab.set(startTime / 1000);
crontab.setLastTime(endTime / 1000);
crontab.setMaxTime(endTime - startTime);
crontab.setTime(endTime - startTime);
if (StringUtils.isNotNull(e)) {
crontab.setError(e.getMessage());
crontab.setStatus(TaskConstants.STATUS_FAIL);
}
SpringUtils.getBean(CrontabMapper.class).updateById(crontab);
SpringUtils.getBean(DevCrontabMapper.class).updateById(crontab);
}
/**
@ -76,6 +77,6 @@ public abstract class AbstractQuartzJob implements Job {
* @param sysJob 系统计划任务
* @throws Exception 执行过程中的异常
*/
protected abstract void doExecute(JobExecutionContext context, Crontab sysJob) throws Exception;
protected abstract void doExecute(JobExecutionContext context, DevCrontab sysJob) throws Exception;
}

View File

@ -1,7 +1,7 @@
package com.mdd.admin.config.quartz.exceution;
import com.mdd.admin.config.quartz.InvokeUtils;
import com.mdd.common.entity.Crontab;
import com.mdd.common.entity.DevCrontab;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
@ -12,7 +12,7 @@ import org.quartz.JobExecutionContext;
public class QuartzDisExecution extends AbstractQuartzJob {
@Override
protected void doExecute(JobExecutionContext context, Crontab crontab) throws Exception {
protected void doExecute(JobExecutionContext context, DevCrontab crontab) throws Exception {
InvokeUtils.invokeMethod(crontab);
}

View File

@ -1,7 +1,7 @@
package com.mdd.admin.config.quartz.exceution;
import com.mdd.admin.config.quartz.InvokeUtils;
import com.mdd.common.entity.Crontab;
import com.mdd.common.entity.DevCrontab;
import org.quartz.JobExecutionContext;
/**
@ -10,7 +10,7 @@ import org.quartz.JobExecutionContext;
public class QuartzJobExecution extends AbstractQuartzJob {
@Override
protected void doExecute(JobExecutionContext context, Crontab crontab) throws Exception {
protected void doExecute(JobExecutionContext context, DevCrontab crontab) throws Exception {
InvokeUtils.invokeMethod(crontab);
}

View File

@ -4,9 +4,9 @@ import cn.dev33.satoken.stp.StpInterface;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mdd.admin.LikeAdminThreadLocal;
import com.mdd.common.entity.system.SystemMenu;
import com.mdd.common.entity.system.SystemAuthPerm;
import com.mdd.common.entity.system.SystemRoleMenu;
import com.mdd.common.mapper.system.SystemMenuMapper;
import com.mdd.common.mapper.system.SystemAuthPermMapper;
import com.mdd.common.mapper.system.SystemRoleMenuMapper;
import com.mdd.common.util.StringUtils;
import org.springframework.stereotype.Component;
@ -20,7 +20,7 @@ import java.util.*;
public class StpInterConfig implements StpInterface {
@Resource
SystemAuthPermMapper systemAuthPermMapper;
SystemRoleMenuMapper systemRoleMenuMapper;
@Resource
SystemMenuMapper systemAuthMenuMapper;
@ -41,8 +41,8 @@ public class StpInterConfig implements StpInterface {
return perms;
}
List<SystemAuthPerm> permList = systemAuthPermMapper.selectList(
new QueryWrapper<SystemAuthPerm>()
List<SystemRoleMenu> permList = systemRoleMenuMapper.selectList(
new QueryWrapper<SystemRoleMenu>()
.select("id,role_id,menu_id")
.in("role_id", roleIds));
@ -51,7 +51,7 @@ public class StpInterConfig implements StpInterface {
}
List<Integer> menuIds = new LinkedList<>();
for (SystemAuthPerm systemAuthPerm : permList) {
for (SystemRoleMenu systemAuthPerm : permList) {
menuIds.add(systemAuthPerm.getMenuId());
}

View File

@ -10,24 +10,28 @@ import com.mdd.admin.vo.CrontabDetailVo;
import com.mdd.admin.vo.CrontabListedVo;
import com.mdd.common.core.AjaxResult;
import com.mdd.common.core.PageResult;
import com.mdd.common.exception.OperateException;
import com.mdd.common.validator.annotation.IDMust;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.quartz.CronExpression;
import org.quartz.SchedulerException;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
@RestController
@RequestMapping("api/crontab")
@RequestMapping("/adminapi/crontab/crontab")
@Api(tags = "计划任务管理")
public class CrontabController {
@Resource
ICrontabService iCrontabService;
@GetMapping("/list")
@GetMapping("/lists")
@ApiOperation(value="计划任务列表")
public AjaxResult< PageResult<CrontabListedVo>> list(@Validated PageValidate pageValidate) {
PageResult<CrontabListedVo> list = iCrontabService.list(pageValidate);
@ -58,11 +62,58 @@ public class CrontabController {
}
@Log(title = "计划任务删除")
@PostMapping("/del")
@PostMapping("/delete")
@ApiOperation(value="计划任务删除")
public AjaxResult<Object> del(@Validated @RequestBody IdValidate idValidate) throws SchedulerException {
iCrontabService.del(idValidate.getId());
return AjaxResult.success();
}
@GetMapping("/expression")
@ApiOperation(value="计划任务列表")
public AjaxResult<List<Map<String, String>>> expression(@Validated @RequestParam("expression") String expression) {
return AjaxResult.success(getExpression(expression));
}
public static List<Map<String, String>> getExpression(String cronExpression) {
try {
CronExpression cron = new CronExpression(cronExpression);
List<Date> dates = new ArrayList<>();
Date date = new Date();
for (int i = 0; i < 5; i++) {
Date nextValidTimeAfter = cron.getNextValidTimeAfter(date); // 假设从当前时间开始
if (nextValidTimeAfter != null) {
dates.add(nextValidTimeAfter);
date = nextValidTimeAfter;
} else {
break; // 如果没有更多的有效时间则退出循环
}
}
List<Map<String, String>> lists = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (int i = 0; i < dates.size(); i++) {
Map<String, String> entry = new HashMap<>();
entry.put("time", String.valueOf(i + 1));
entry.put("date", sdf.format(dates.get(i)));
lists.add(entry);
}
// 添加额外的条目
Map<String, String> extraEntry = new HashMap<>();
extraEntry.put("time", "x");
extraEntry.put("date", "……");
lists.add(extraEntry);
return lists;
} catch (Exception e) {
// 注意在Java中通常不会直接返回异常消息作为业务逻辑的一部分
// 这里为了与PHP函数保持一致我们返回异常消息但在实际应用中应避免这样做
throw new OperateException(e.getMessage());
}
}
}

View File

@ -1,5 +1,6 @@
package com.mdd.admin.controller.decorate;
import com.alibaba.fastjson2.JSONObject;
import com.mdd.common.aop.NotPower;
import com.mdd.admin.service.IDecorateDataService;
import com.mdd.admin.vo.decorate.DecorateDataArticleVo;
@ -30,4 +31,12 @@ public class DecorateDataController {
return AjaxResult.success(list);
}
@GetMapping("/pc")
@ApiOperation(value="获取pc装修数据")
public AjaxResult<JSONObject> pc() {
JSONObject pc = iDecorateDataService.pc();
return AjaxResult.success(pc);
}
}

View File

@ -5,6 +5,7 @@ import com.mdd.admin.service.IFinanceRechargerService;
import com.mdd.admin.validate.commons.IdValidate;
import com.mdd.admin.validate.commons.PageValidate;
import com.mdd.admin.validate.finance.FinanceRechargeSearchValidate;
import com.mdd.admin.validate.finance.FinanceRefundValidate;
import com.mdd.admin.vo.finance.FinanceRechargeListVo;
import com.mdd.common.core.AjaxResult;
import com.mdd.common.core.PageResult;
@ -17,14 +18,14 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("api/finance/recharger")
@RequestMapping("/adminapi/recharge/recharge")
@Api("充值记录管理")
public class FinanceRechargerController {
@Resource
IFinanceRechargerService iFinanceRechargerService;
@GetMapping("/list")
@GetMapping("/lists")
@ApiOperation("充值记录")
public AjaxResult<PageResult<FinanceRechargeListVo>> list(@Validated PageValidate pageValidate,
@Validated FinanceRechargeSearchValidate searchValidate) {
@ -34,10 +35,10 @@ public class FinanceRechargerController {
@PostMapping("/refund")
@ApiOperation("发起退款")
public AjaxResult<Object> refund(@Validated @RequestBody IdValidate idValidate) {
public AjaxResult<Object> refund(@Validated @RequestBody FinanceRefundValidate financeRefundValidate) {
Integer adminId = LikeAdminThreadLocal.getAdminId();
iFinanceRechargerService.refund(idValidate.getId(), adminId);
iFinanceRechargerService.refund(financeRefundValidate.getRecharge_id(), adminId);
return AjaxResult.success();
}

View File

@ -20,7 +20,7 @@ import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("api/finance/refund")
@RequestMapping("/adminapi/finance/refund")
@Api("退款记录管理")
public class FinanceRefundController {
@ -30,10 +30,10 @@ public class FinanceRefundController {
@GetMapping("/stat")
@ApiOperation("退还统计")
public AjaxResult<Object> stat() {
return AjaxResult.success();
return AjaxResult.success(iFinanceRefundService.stat());
}
@GetMapping("/list")
@GetMapping("/record")
@ApiOperation("退款记录")
public AjaxResult<Object> list(@Validated PageValidate pageValidate,
@Validated FinanceRefundSearchValidate searchValidate) {
@ -43,7 +43,7 @@ public class FinanceRefundController {
@GetMapping("/log")
@ApiOperation("退款日志")
public AjaxResult<Object> log(@Validated @IDMust() @RequestParam("id") Integer id) {
public AjaxResult<Object> log(@Validated @IDMust() @RequestParam("record_id") Integer id) {
List<FinanceRefundLogVo> list = iFinanceRefundService.log(id);
return AjaxResult.success(list);
}

View File

@ -14,16 +14,17 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;
@RestController
@RequestMapping("api/finance/wallet")
@RequestMapping("/adminapi/finance/account_log")
@Api("余额明细管理")
public class FinanceWalletController {
@Resource
IFinanceWalletService iFinanceWalletService;
@GetMapping("/list")
@GetMapping("/lists")
@ApiOperation("记录列表")
public AjaxResult<Object> list(@Validated PageValidate pageValidate,
@Validated FinanceWalletSearchValidate searchValidate) {
@ -31,4 +32,11 @@ public class FinanceWalletController {
return AjaxResult.success(list);
}
@GetMapping("/getUmChangeType")
@ApiOperation("记录列表")
public AjaxResult<Map<Integer, String>> getUmChangeType() {
return AjaxResult.success(iFinanceWalletService.getUmChangeType());
}
}

View File

@ -45,6 +45,13 @@ public class SystemAuthMenuController {
return AjaxResult.success(result);
}
@GetMapping("/all")
@ApiOperation(value="获取菜单列表")
public AjaxResult<JSONArray> all() {
JSONArray result = iSystemAuthMenuService.all();
return AjaxResult.success(result);
}
@GetMapping("/detail")
@ApiOperation(value="获取菜单详情")
public AjaxResult<SystemAuthMenuVo> detail(@Validated @IDMust() @RequestParam("id") Integer id) {

View File

@ -68,7 +68,7 @@ public class SystemAuthRoleController {
}
@Log(title = "角色删除")
@PostMapping("/del")
@PostMapping("/delete")
@ApiOperation(value="角色删除")
public AjaxResult<Object> del(@Validated @RequestBody IdValidate idValidate) {
iSystemAuthRoleService.del(idValidate.getId());

View File

@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
public class MyJob {
public void handle(String s) {
// System.out.println("有参数定时任务执行逻辑 : " + s);
System.out.println("有参数定时任务执行逻辑 : " + s);
}
}

View File

@ -1,5 +1,6 @@
package com.mdd.admin.service;
import com.alibaba.fastjson2.JSONObject;
import com.mdd.admin.vo.decorate.DecorateDataArticleVo;
import java.util.List;
@ -18,4 +19,5 @@ public interface IDecorateDataService {
*/
List<DecorateDataArticleVo> article(Integer limit);
JSONObject pc();
}

View File

@ -7,6 +7,7 @@ import com.mdd.admin.vo.finance.FinanceRefundLogVo;
import com.mdd.common.core.PageResult;
import java.util.List;
import java.util.Map;
/**
* 退款记录服务接口类
@ -31,4 +32,5 @@ public interface IFinanceRefundService {
*/
List<FinanceRefundLogVo> log(Integer recordId);
Map<String, Object> stat();
}

View File

@ -5,6 +5,8 @@ import com.mdd.admin.validate.finance.FinanceWalletSearchValidate;
import com.mdd.admin.vo.finance.FinanceWalletListVo;
import com.mdd.common.core.PageResult;
import java.util.Map;
/**
* 用户余额记录服务接口类
*/
@ -20,4 +22,5 @@ public interface IFinanceWalletService {
*/
PageResult<FinanceWalletListVo> list(PageValidate pageValidate, FinanceWalletSearchValidate searchValidate);
Map<Integer, String> getUmChangeType();
}

View File

@ -1,5 +1,7 @@
package com.mdd.admin.service.admin;
import com.mdd.common.entity.admin.AdminRole;
import java.util.List;
/**
@ -15,6 +17,9 @@ public interface IAdminRoleService {
List<Integer> getRoleIdAttr(Integer adminId);
List<AdminRole> getAdminIdByRoleId(Integer roleId);
/**
* 批量设置部门
* @param adminId

View File

@ -11,9 +11,8 @@ import com.mdd.admin.validate.commons.PageValidate;
import com.mdd.admin.vo.CrontabDetailVo;
import com.mdd.admin.vo.CrontabListedVo;
import com.mdd.common.core.PageResult;
import com.mdd.common.entity.Crontab;
import com.mdd.common.mapper.CrontabMapper;
import com.mdd.common.util.TimeUtils;
import com.mdd.common.entity.DevCrontab;
import com.mdd.common.mapper.DevCrontabMapper;
import org.quartz.*;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -35,7 +34,7 @@ public class CrontabServiceImpl implements ICrontabService {
Scheduler scheduler;
@Resource
CrontabMapper crontabMapper;
DevCrontabMapper crontabMapper;
/**
* 项目启动初始化任务
@ -46,8 +45,8 @@ public class CrontabServiceImpl implements ICrontabService {
@PostConstruct
public void init() throws SchedulerException {
scheduler.clear();
List<Crontab> jobs = crontabMapper.selectList(new QueryWrapper<Crontab>().isNull("delete_time"));
for (Crontab crontab : jobs) {
List<DevCrontab> jobs = crontabMapper.selectList(new QueryWrapper<DevCrontab>().isNull("delete_time"));
for (DevCrontab crontab : jobs) {
QuartzUtils.createScheduleJob(scheduler, crontab);
}
}
@ -64,18 +63,19 @@ public class CrontabServiceImpl implements ICrontabService {
Integer pageNo = pageValidate.getPage_no();
Integer pageSize = pageValidate.getPage_size();
IPage<Crontab> iPage = crontabMapper.selectPage(new Page<>(pageNo, pageSize),
new QueryWrapper<Crontab>()
IPage<DevCrontab> iPage = crontabMapper.selectPage(new Page<>(pageNo, pageSize),
new QueryWrapper<DevCrontab>()
.isNull("delete_time")
.orderByDesc("id"));
List<CrontabListedVo> list = new LinkedList<>();
for (Crontab crontab : iPage.getRecords()) {
for (DevCrontab crontab : iPage.getRecords()) {
CrontabListedVo vo = new CrontabListedVo();
BeanUtils.copyProperties(crontab, vo);
vo.setStartTime(crontab.getStartTime()<=0?"-": TimeUtils.timestampToDate(crontab.getStartTime()));
vo.setEndTime(crontab.getEndTime()<=0?"-": TimeUtils.timestampToDate(crontab.getEndTime()));
vo.setTypeDesc("定时任务");
vo.setStatusDesc(vo.getStatus() == null ? "未运行" : (vo.getStatus().equals(1) ? "运行" : (vo.getStatus().equals(2) ? "停止" : "错误")));
list.add(vo);
}
@ -91,8 +91,8 @@ public class CrontabServiceImpl implements ICrontabService {
*/
@Override
public CrontabDetailVo detail(Integer id) {
Crontab crontab = crontabMapper.selectOne(
new QueryWrapper<Crontab>()
DevCrontab crontab = crontabMapper.selectOne(
new QueryWrapper<DevCrontab>()
.eq("id", id)
.isNull("delete_time")
.last("limit 1"));
@ -113,20 +113,20 @@ public class CrontabServiceImpl implements ICrontabService {
@Override
@Transactional
public void add(CrontabCreateValidate createValidate) throws SchedulerException {
Crontab crontab = new Crontab();
DevCrontab crontab = new DevCrontab();
crontab.setName(createValidate.getName());
crontab.setTypes(createValidate.getTypes());
crontab.setType(createValidate.getType());
crontab.setCommand(createValidate.getCommand());
crontab.setRules(createValidate.getRules());
crontab.setExpression(createValidate.getExpression());
crontab.setStatus(createValidate.getStatus());
crontab.setRemark(createValidate.getRemark());
crontab.setStrategy(createValidate.getStrategy());
crontab.setConcurrent(createValidate.getConcurrent());
crontab.setParams(createValidate.getParams());
crontab.setCreateTime(System.currentTimeMillis() / 1000);
crontab.setUpdateTime(System.currentTimeMillis() / 1000);
crontabMapper.insert(crontab);
QuartzUtils.createScheduleJob(scheduler, crontab);
if (createValidate.getStatus() != null && createValidate.getStatus().equals(1)) {
QuartzUtils.createScheduleJob(scheduler, crontab);
}
}
/**
@ -138,8 +138,8 @@ public class CrontabServiceImpl implements ICrontabService {
@Override
@Transactional
public void edit(CrontabUpdateValidate updateValidate) throws SchedulerException {
Crontab crontab = crontabMapper.selectOne(
new QueryWrapper<Crontab>()
DevCrontab crontab = crontabMapper.selectOne(
new QueryWrapper<DevCrontab>()
.eq("id", updateValidate.getId())
.isNull("delete_time")
.last("limit 1"));
@ -148,16 +148,19 @@ public class CrontabServiceImpl implements ICrontabService {
crontab.setName(updateValidate.getName());
crontab.setCommand(updateValidate.getCommand());
crontab.setTypes(updateValidate.getTypes());
crontab.setRules(updateValidate.getRules());
crontab.setType(updateValidate.getType());
crontab.setExpression(updateValidate.getExpression());
crontab.setStatus(updateValidate.getStatus());
crontab.setRemark(updateValidate.getRemark());
crontab.setStrategy(updateValidate.getStrategy());
crontab.setConcurrent(updateValidate.getConcurrent());
crontab.setParams(updateValidate.getParams());
crontab.setUpdateTime(System.currentTimeMillis() / 1000);
crontabMapper.updateById(crontab);
if (updateValidate.getStatus() != null && updateValidate.getStatus().equals(1)) {
QuartzUtils.createScheduleJob(scheduler, crontab);
} else {
scheduler.deleteJob(QuartzUtils.getJobKey(crontab.getId(), crontab.getType().toString()));
}
QuartzUtils.createScheduleJob(scheduler, crontab);
}
/**
@ -169,19 +172,18 @@ public class CrontabServiceImpl implements ICrontabService {
@Override
@Transactional
public void del(Integer id) throws SchedulerException {
Crontab crontab = crontabMapper.selectOne(
new QueryWrapper<Crontab>()
DevCrontab crontab = crontabMapper.selectOne(
new QueryWrapper<DevCrontab>()
.eq("id", id)
.isNull("delete_time")
.last("limit 1"));
Assert.notNull(crontab, "数据不存在!");
crontab.setIsDelete(1);
crontab.setDeleteTime(System.currentTimeMillis() / 1000);
crontabMapper.updateById(crontab);
scheduler.deleteJob(QuartzUtils.getJobKey(crontab.getId(), crontab.getTypes()));
scheduler.deleteJob(QuartzUtils.getJobKey(crontab.getId(), crontab.getType().toString()));
}
}

View File

@ -1,12 +1,18 @@
package com.mdd.admin.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.mdd.admin.service.IDecorateDataService;
import com.mdd.admin.vo.decorate.DecorateDataArticleVo;
import com.mdd.admin.vo.decorate.DecoratePageVo;
import com.mdd.common.entity.article.Article;
import com.mdd.common.entity.decorate.DecoratePage;
import com.mdd.common.mapper.article.ArticleMapper;
import com.mdd.common.mapper.decorate.DecoratePageMapper;
import com.mdd.common.util.TimeUtils;
import com.mdd.common.util.UrlUtils;
import com.mdd.common.util.YmlUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -23,6 +29,9 @@ public class DecorateDataServiceImpl implements IDecorateDataService {
@Resource
ArticleMapper articleMapper;
@Resource
DecoratePageMapper decoratePageMapper;
/**
* 获取文章数据
*
@ -58,4 +67,17 @@ public class DecorateDataServiceImpl implements IDecorateDataService {
return list;
}
@Override
public JSONObject pc() {
JSONObject pc = new JSONObject();
DecoratePage decoratePage = decoratePageMapper.selectById(4);
Assert.notNull(decoratePage, "数据不存在!");
pc.put("update_time", TimeUtils.timestampToDate(decoratePage.getUpdateTime()));
pc.put("pc_url", YmlUtils.get("like.front-url") + "/pc");
return pc;
}
}

View File

@ -50,7 +50,7 @@ public class FinanceRechargerServiceImpl implements IFinanceRechargerService {
UserMapper userMapper;
@Resource
UserAccountLogMapper logMoneyMapper;
UserAccountLogMapper userAccountLogMapper;
@Resource
RefundRecordMapper refundRecordMapper;
@ -79,19 +79,19 @@ public class FinanceRechargerServiceImpl implements IFinanceRechargerService {
MPJQueryWrapper<RechargeOrder> mpjQueryWrapper = new MPJQueryWrapper<>();
mpjQueryWrapper.selectAll(RechargeOrder.class)
.select("U.id as user_id,U.sn as user_sn,U.nickname,U.avatar")
.select("U.id as user_id,U.account ,U.nickname,U.avatar, t.sn AS sn")
.leftJoin("?_user U ON U.id=t.user_id".replace("?_", GlobalConfig.tablePrefix))
.orderByDesc("id");
rechargeOrderMapper.setSearch(mpjQueryWrapper, searchValidate, new String[]{
"like:sn@t.order_sn:str",
"=:payWay@t.pay_way:int",
"=:payStatus@t.pay_status:int",
"datetime:startTime-endTime@create_time:long",
"like:sn@t.sn:str",
"=:pay_way@t.pay_way:int",
"=:pay_status@t.pay_status:int",
"datetime:start_time-end_time@create_time:long",
});
if (StringUtils.isNotEmpty(searchValidate.getKeyword())) {
String keyword = searchValidate.getKeyword();
if (StringUtils.isNotEmpty(searchValidate.getUser_info())) {
String keyword = searchValidate.getUser_info();
mpjQueryWrapper.nested(wq->wq
.like("U.nickname", keyword).or()
.like("U.sn", keyword).or()
@ -107,20 +107,9 @@ public class FinanceRechargerServiceImpl implements IFinanceRechargerService {
vo.setCreateTime(TimeUtils.timestampToDate(vo.getCreateTime()));
vo.setPayTime(TimeUtils.timestampToDate(vo.getPayTime()));
vo.setAvatar(UrlUtils.toAbsoluteUrl(vo.getAvatar()));
vo.setPayWay(PaymentEnum.getPayWayMsg(Integer.parseInt(vo.getPayWay())));
vo.setIsRefund(0);
if (vo.getPayStatus().equals(1)) {
RefundRecord refundRecord = refundRecordMapper.selectOne(
new QueryWrapper<RefundRecord>()
.eq("order_type", "recharge")
.eq("order_id", vo.getId())
.last("limit 1"));
if (StringUtils.isNotNull(refundRecord)) {
vo.setIsRefund(1);
vo.setRefundStatusMsg(RefundEnum.getRefundStatusMsg(refundRecord.getRefundStatus()));
}
}
vo.setPayWay(vo.getPayWay());
vo.setPayWayText(PaymentEnum.getPayWayMsg(Integer.parseInt(vo.getPayWay())));
vo.setPayStatusText(PaymentEnum.getPayStatusMsg(vo.getPayStatus()));
}
return PageResult.iPageHandle(iPage);
@ -166,7 +155,7 @@ public class FinanceRechargerServiceImpl implements IFinanceRechargerService {
userMapper.updateById(user);
// 记录余额日志
logMoneyMapper.dec(
userAccountLogMapper.dec(
user.getId(),
LogMoneyEnum.UM_DEC_RECHARGE.getCode(),
rechargeOrder.getOrderAmount(),

View File

@ -13,6 +13,7 @@ import com.mdd.common.config.GlobalConfig;
import com.mdd.common.core.PageResult;
import com.mdd.common.entity.RefundLog;
import com.mdd.common.entity.RefundRecord;
import com.mdd.common.enums.PaymentEnum;
import com.mdd.common.enums.RefundEnum;
import com.mdd.common.mapper.RefundLogMapper;
import com.mdd.common.mapper.RefundRecordMapper;
@ -52,24 +53,21 @@ public class FinanceRefundServiceImpl implements IFinanceRefundService {
MPJQueryWrapper<RefundRecord> mpjQueryWrapper = new MPJQueryWrapper<>();
mpjQueryWrapper.selectAll(RefundRecord.class)
.select("U.id as user_id,U.nickname,U.avatar")
.select("U.id as user_id,U.nickname,U.avatar, U.account")
.leftJoin("?_user U ON U.id=t.user_id".replace("?_", GlobalConfig.tablePrefix))
.orderByDesc("id");
refundRecordMapper.setSearch(mpjQueryWrapper, searchValidate, new String[]{
"like:sn@t.sn:str",
"like:orderSn@t.t.order_sn:str",
"=:refundType@t.refund_type:int",
"=:refundStatus@t.refund_status:int",
"datetime:startTime-endTime@create_time:long",
"like:order_sn@t.order_sn:str",
"=:refund_type@t.refund_type:int",
"=:refund_status@t.refund_status:int",
"datetime:start_time-end_time@create_time:long",
});
if (StringUtils.isNotNull(searchValidate.getType()) && searchValidate.getType() != -1) {
mpjQueryWrapper.eq("refund_status", searchValidate.getType());
}
if (StringUtils.isNotEmpty(searchValidate.getKeyword())) {
String keyword = searchValidate.getKeyword();
if (StringUtils.isNotEmpty(searchValidate.getUser_info())) {
String keyword = searchValidate.getUser_info();
mpjQueryWrapper.nested(wq->wq
.like("U.nickname", keyword).or()
.like("U.sn", keyword).or()
@ -82,8 +80,9 @@ public class FinanceRefundServiceImpl implements IFinanceRefundService {
mpjQueryWrapper);
for (FinanceRefundListVo vo : iPage.getRecords()) {
vo.setRefundTypeMsg(RefundEnum.getRefundTypeMsg(vo.getRefundType()));
vo.setRefundStatusMsg(RefundEnum.getRefundStatusMsg(vo.getRefundStatus()));
vo.setRefundTypeText(RefundEnum.getRefundTypeMsg(vo.getRefundType()));
vo.setRefundStatusText(RefundEnum.getRefundStatusMsg(vo.getRefundStatus()));
vo.setRefundWayText(PaymentEnum.getPayWayMsg(vo.getRefundWay()));
vo.setCreateTime(TimeUtils.timestampToDate(vo.getCreateTime()));
}
@ -114,19 +113,28 @@ public class FinanceRefundServiceImpl implements IFinanceRefundService {
public List<FinanceRefundLogVo> log(Integer recordId) {
MPJQueryWrapper<RefundLog> mpjQueryWrapper = new MPJQueryWrapper<>();
mpjQueryWrapper.selectAll(RefundLog.class)
.select("sa.nickname as handler")
.select("sa.name as handler")
.eq("t.record_id", recordId)
.innerJoin("?_system_auth_admin sa ON sa.id=t.handle_id".replace("?_", GlobalConfig.tablePrefix))
.innerJoin("?_admin sa ON sa.id=t.handle_id".replace("?_", GlobalConfig.tablePrefix))
.orderByDesc("t.id");
List<FinanceRefundLogVo> list = refundLogMapper.selectJoinList(FinanceRefundLogVo.class, mpjQueryWrapper);
for (FinanceRefundLogVo vo : list) {
vo.setRefundStatusMsg(RefundEnum.getRefundStatusMsg(vo.getRefundStatus()));
vo.setRefundStatusText(RefundEnum.getRefundStatusMsg(vo.getRefundStatus()));
vo.setCreateTime(TimeUtils.timestampToDate(vo.getCreateTime()));
}
return list;
}
@Override
public Map<String, Object> stat() {
Map<String, Object> stat = new LinkedHashMap<>();
stat.put("total", refundRecordMapper.sum("order_amount", new QueryWrapper<>()));
stat.put("ing", refundRecordMapper.sum("order_amount", new QueryWrapper<RefundRecord>().eq("refund_status", 0)));
stat.put("success", refundRecordMapper.sum("order_amount", new QueryWrapper<RefundRecord>().eq("refund_status", 1)));
stat.put("error", refundRecordMapper.sum("order_amount", new QueryWrapper<RefundRecord>().eq("refund_status", 2)));
return stat;
}
}

View File

@ -37,17 +37,17 @@ public class FinanceWalletServiceImpl implements IFinanceWalletService {
MPJQueryWrapper<UserAccountLog> mpjQueryWrapper = new MPJQueryWrapper<>();
mpjQueryWrapper.selectAll(UserAccountLog.class)
.select("U.id as user_id,U.sn as user_sn,U.nickname,U.avatar")
.select("U.id as user_id,U.sn as sn,U.nickname,U.avatar, U.account, U.mobile")
.leftJoin("?_user U ON U.id=t.user_id".replace("?_", GlobalConfig.tablePrefix))
.orderByDesc("id");
logMoneyMapper.setSearch(mpjQueryWrapper, searchValidate, new String[]{
"=:type@change_type:int",
"=:change_type@change_type:int",
"datetime:startTime-endTime@create_time:long",
});
if (StringUtils.isNotEmpty(searchValidate.getKeyword())) {
String keyword = searchValidate.getKeyword();
if (StringUtils.isNotEmpty(searchValidate.getUser_info())) {
String keyword = searchValidate.getUser_info();
mpjQueryWrapper.nested(wq->wq
.like("U.nickname", keyword).or()
.like("U.sn", keyword).or()
@ -61,7 +61,7 @@ public class FinanceWalletServiceImpl implements IFinanceWalletService {
for (FinanceWalletListVo vo : iPage.getRecords()) {
vo.setCreateTime(TimeUtils.timestampToDate(vo.getCreateTime()));
vo.setChangeType(LogMoneyEnum.getMsgByCode(Integer.parseInt(vo.getChangeType())));
vo.setChangeTypeDesc(LogMoneyEnum.getMsgByCode(Integer.parseInt(vo.getChangeType())));
vo.setAvatar(UrlUtils.toAbsoluteUrl(vo.getAvatar()));
}
@ -71,4 +71,8 @@ public class FinanceWalletServiceImpl implements IFinanceWalletService {
return PageResult.iPageHandle(iPage.getTotal(), iPage.getCurrent(), iPage.getSize(), iPage.getRecords(), extend);
}
@Override
public Map<Integer, String> getUmChangeType() {
return LogMoneyEnum.getTypeList();
}
}

View File

@ -31,6 +31,12 @@ public class AdminRoleServiceImpl implements IAdminRoleService {
return ret;
}
@Override
public List<AdminRole> getAdminIdByRoleId(Integer roleId) {
List<AdminRole> result = adminRoleMapper.selectList(new QueryWrapper<AdminRole>().eq("role_id", roleId).select("admin_id"));
return result;
}
@Override
public void batchInsert(Integer adminId, List<Integer> roleIds) {
this.deleteByAdminId(adminId);

View File

@ -1,15 +1,14 @@
package com.mdd.admin.service.impl.admin;
import cn.dev33.satoken.stp.StpUtil;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.query.MPJQueryWrapper;
import com.mdd.admin.service.admin.*;
import com.mdd.admin.service.system.ISystemAuthPermService;
import com.mdd.admin.service.system.ISystemMenuService;
import com.mdd.admin.service.system.ISystemRoleMenuService;
import com.mdd.admin.validate.commons.PageValidate;
import com.mdd.admin.validate.system.SystemAdminCreateValidate;
import com.mdd.admin.validate.system.SystemAdminSearchValidate;
@ -20,7 +19,6 @@ import com.mdd.admin.vo.auth.AuthMySelfVo;
import com.mdd.admin.vo.system.*;
import com.mdd.common.core.PageResult;
import com.mdd.common.entity.admin.Admin;
import com.mdd.common.entity.admin.AdminDept;
import com.mdd.common.entity.admin.Dept;
import com.mdd.common.entity.system.Jobs;
import com.mdd.common.entity.system.SystemMenu;
@ -54,7 +52,7 @@ public class AdminServiceImpl implements IAdminService {
SystemRoleMapper systemAuthRoleMapper;
@Resource
ISystemAuthPermService iSystemAuthPermService;
ISystemRoleMenuService iSystemRoleMenuService;
@Resource
IAdminRoleService iAdminRoleService;
@Resource
@ -101,8 +99,8 @@ public class AdminServiceImpl implements IAdminService {
"like:name:str"
});
if (StringUtils.isNotNull(searchValidate.getRole())) {
mpjQueryWrapper.in("lar.role_id", searchValidate.getRole());
if (StringUtils.isNotNull(searchValidate.getRole_id())) {
mpjQueryWrapper.in("lar.role_id", searchValidate.getRole_id());
}
IPage<SystemAuthAdminListedVo> iPage = systemAuthAdminMapper.selectJoinPage(
@ -134,7 +132,7 @@ public class AdminServiceImpl implements IAdminService {
List<Integer> jobsId = new ArrayList<>();
List<String> jobsNames = new ArrayList<>();
if (!jobs.isEmpty()) {
roles.forEach(item-> {
jobs.forEach(item-> {
jobsId.add(item.getId());
jobsNames.add(item.getName());
});
@ -147,7 +145,7 @@ public class AdminServiceImpl implements IAdminService {
List<Integer> deptIds = new ArrayList<>();
List<String> deptNames = new ArrayList<>();
if (!depts.isEmpty()) {
roles.forEach(item-> {
depts.forEach(item-> {
deptIds.add(item.getId());
deptNames.add(item.getName());
});
@ -157,6 +155,8 @@ public class AdminServiceImpl implements IAdminService {
}
}
vo.setDisableDesc(vo.getDisable() != null && vo.getDisable().equals(0) ? "启用" : "禁用");
vo.setAvatar(UrlUtils.toAbsoluteUrl(vo.getAvatar()));
vo.setCreateTime(TimeUtils.timestampToDate(vo.getCreateTime()));
vo.setUpdateTime(TimeUtils.timestampToDate(vo.getUpdateTime()));
@ -195,7 +195,7 @@ public class AdminServiceImpl implements IAdminService {
List<String> auths = new LinkedList<>();
if (adminId > 1) {
List<Integer> roleIds = new ArrayList<Integer>();
List<Integer> menuIds = iSystemAuthPermService.selectMenuIdsByRoleId(roleIds);
List<Integer> menuIds = iSystemRoleMenuService.selectMenuIdsByRoleId(roleIds);
if (menuIds.size() > 0) {
List<SystemMenu> systemAuthMenus = systemAuthMenuMapper.selectList(new QueryWrapper<SystemMenu>()
.eq("is_disable", 0)
@ -317,6 +317,12 @@ public class AdminServiceImpl implements IAdminService {
throw new OperateException("您无权限编辑系统管理员!");
}
boolean isEditInfo = false;
if (updateValidate.getPassword() != null) {
isEditInfo = true;
}
String[] field = {"id", "account", "name"};
Assert.notNull(systemAuthAdminMapper.selectOne(new QueryWrapper<Admin>()
.select(field)
@ -339,36 +345,48 @@ public class AdminServiceImpl implements IAdminService {
.last("limit 1")), "昵称已存在换一个吧!");
Admin model = new Admin();
model.setId(updateValidate.getId());
model.setName(updateValidate.getName());
model.setAvatar(UrlUtils.toRelativeUrl(updateValidate.getAvatar()));
model.setMultipointLogin(updateValidate.getMultipointLogin());
model.setDisable(updateValidate.getDisable());
model.setUpdateTime(System.currentTimeMillis() / 1000);
if (!updateValidate.getId().equals(1)) {
model.setAccount(updateValidate.getAccount());
}
if (isEditInfo) {
if (StringUtils.isNotNull(updateValidate.getPassword()) && StringUtils.isNotEmpty(updateValidate.getPassword())) {
String pwd = ToolUtils.makePassword(updateValidate.getPassword().trim());
model.setPassword(pwd);
model.setName(updateValidate.getName());
model.setAvatar(UrlUtils.toRelativeUrl(updateValidate.getAvatar()));
model.setMultipointLogin(updateValidate.getMultipointLogin());
model.setUpdateTime(System.currentTimeMillis() / 1000);
if (!updateValidate.getId().equals(1)) {
model.setAccount(updateValidate.getAccount());
}
if (StringUtils.isNotNull(updateValidate.getPassword()) && StringUtils.isNotEmpty(updateValidate.getPassword())) {
String pwd = ToolUtils.makePassword(updateValidate.getPassword().trim());
model.setPassword(pwd);
}
} else {
model.setDisable(updateValidate.getDisable());
}
systemAuthAdminMapper.updateById(model);
if (StringUtils.isNotNull(updateValidate.getPassword()) && StringUtils.isNotEmpty(updateValidate.getPassword())) {
StpUtil.kickout(updateValidate.getId());
if (isEditInfo) {
if (StringUtils.isNotNull(updateValidate.getPassword()) && StringUtils.isNotEmpty(updateValidate.getPassword())) {
StpUtil.kickout(updateValidate.getId());
}
List<Integer> deptIds = updateValidate.getDeptId();
List<Integer> jobsIds = updateValidate.getJobsId();
List<Integer> roleIds = updateValidate.getRoleId();
this.iAdminDeptService.batchInsert(updateValidate.getId(), deptIds);
this.iAdminJobsService.batchInsert(updateValidate.getId(), jobsIds);
this.iAdminRoleService.batchInsert(updateValidate.getId(), roleIds);
}
List<Integer> deptIds = updateValidate.getDeptId();
List<Integer> jobsIds = updateValidate.getJobsId();
List<Integer> roleIds = updateValidate.getRoleId();
this.iAdminDeptService.batchInsert(updateValidate.getId(), deptIds);
this.iAdminJobsService.batchInsert(updateValidate.getId(), jobsIds);
this.iAdminRoleService.batchInsert(updateValidate.getId(), roleIds);
}

View File

@ -1,105 +0,0 @@
package com.mdd.admin.service.impl.system;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mdd.admin.service.system.ISystemAuthPermService;
import com.mdd.common.entity.system.SystemAuthPerm;
import com.mdd.common.entity.system.SystemRole;
import com.mdd.common.mapper.system.SystemAuthPermMapper;
import com.mdd.common.mapper.system.SystemRoleMapper;
import com.mdd.common.util.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.LinkedList;
import java.util.List;
/**
* 系统权限服务实现类
*/
@Service
public class SystemAuthPermServiceImpl implements ISystemAuthPermService {
@Resource
SystemAuthPermMapper systemAuthPermMapper;
@Resource
SystemRoleMapper systemAuthRoleMapper;
/**
* 根据角色ID获取菜单ID
*
* @param roleIds 角色ID
* @return List<Integer>
*/
@Override
public List<Integer> selectMenuIdsByRoleId(List<Integer> roleIds) {
List<Integer> menus = new LinkedList<>();
if (roleIds.isEmpty()) {
return menus;
}
SystemRole systemAuthRole = systemAuthRoleMapper.selectOne(new QueryWrapper<SystemRole>()
.in("id", roleIds)
.eq("is_disable", 0)
.last("limit 1"));
if (StringUtils.isNull(systemAuthRole)) {
return menus;
}
List<SystemAuthPerm> systemAuthPerms = systemAuthPermMapper.selectList(
new QueryWrapper<SystemAuthPerm>()
.in("role_id", roleIds));
for (SystemAuthPerm systemAuthPerm : systemAuthPerms) {
menus.add(systemAuthPerm.getMenuId());
}
return menus;
}
/**
* 批量写入角色菜单
*
* @author fzr
* @param roleId 角色ID
* @param menuIds 菜单ID组
*/
@Override
@Transactional
public void batchSaveByMenuIds(Integer roleId, String menuIds) {
if (menuIds != null && !menuIds.equals("")) {
for (String menuId : menuIds.split(",")) {
SystemAuthPerm model = new SystemAuthPerm();
model.setRoleId(roleId);
model.setMenuId(Integer.parseInt(menuId));
systemAuthPermMapper.insert(model);
}
}
}
/**
* 批量删除角色菜单(根据角色ID)
*
* @author fzr
* @param roleId 角色ID
*/
@Override
public void batchDeleteByRoleId(Integer roleId) {
systemAuthPermMapper.delete(new QueryWrapper<SystemAuthPerm>().eq("role_id", roleId));
}
/**
* 批量删除角色菜单(根据菜单ID)
*
* @author fzr
* @param menuId 菜单ID
*/
@Override
public void batchDeleteByMenuId(Integer menuId) {
systemAuthPermMapper.delete(new QueryWrapper<SystemAuthPerm>().eq("menu_id", menuId));
}
}

View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.mdd.admin.LikeAdminThreadLocal;
import com.mdd.admin.service.system.ISystemMenuService;
import com.mdd.admin.service.system.ISystemAuthPermService;
import com.mdd.admin.service.system.ISystemRoleMenuService;
import com.mdd.admin.validate.system.SystemMenuCreateValidate;
import com.mdd.admin.validate.system.SystemMenuUpdateValidate;
import com.mdd.admin.vo.system.SystemAuthMenuVo;
@ -32,7 +32,7 @@ public class SystemMenuServiceImpl implements ISystemMenuService {
SystemMenuMapper systemAuthMenuMapper;
@Resource
ISystemAuthPermService iSystemAuthPermService;
ISystemRoleMenuService iSystemRoleMenuService;
/**
* 根据角色ID获取菜单
@ -44,7 +44,7 @@ public class SystemMenuServiceImpl implements ISystemMenuService {
@Override
public JSONArray selectMenuByRoleId(List<Integer> roleIds) {
Integer adminId = LikeAdminThreadLocal.getAdminId();
List<Integer> menuIds = iSystemAuthPermService.selectMenuIdsByRoleId(roleIds);
List<Integer> menuIds = iSystemRoleMenuService.selectMenuIdsByRoleId(roleIds);
QueryWrapper<SystemMenu> queryWrapper = new QueryWrapper<>();
queryWrapper.in("type", Arrays.asList("M", "C"));
@ -81,6 +81,13 @@ public class SystemMenuServiceImpl implements ISystemMenuService {
*/
@Override
public JSONObject list() {
return new JSONObject() {{
put("lists", all());
}};
}
@Override
public JSONArray all() {
QueryWrapper<SystemMenu> queryWrapper = new QueryWrapper<>();
queryWrapper.orderByDesc("sort");
queryWrapper.orderByAsc("id");
@ -99,10 +106,7 @@ public class SystemMenuServiceImpl implements ISystemMenuService {
JSONArray jsonArray = JSONArray.parseArray(JSONArray.toJSONString(lists));
return new JSONObject() {{
put("lists", ListUtils.listToTree(jsonArray, "id", "pid", "children"));
}};
return ListUtils.listToTree(jsonArray, "id", "pid", "children");
}
/**
@ -202,7 +206,7 @@ public class SystemMenuServiceImpl implements ISystemMenuService {
"请先删除子菜单再操作!");
systemAuthMenuMapper.deleteById(id);
iSystemAuthPermService.batchDeleteByMenuId(id);
iSystemRoleMenuService.batchDeleteByMenuId(id);
}
}

View File

@ -1,9 +1,18 @@
package com.mdd.admin.service.impl.system;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mdd.admin.service.system.ISystemRoleMenuService;
import com.mdd.common.entity.system.SystemRole;
import com.mdd.common.entity.system.SystemRoleMenu;
import com.mdd.common.mapper.system.SystemRoleMapper;
import com.mdd.common.mapper.system.SystemRoleMenuMapper;
import com.mdd.common.util.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
/**
@ -13,10 +22,85 @@ import java.util.List;
public class SystemRoleMenuServiceImpl implements ISystemRoleMenuService {
@Resource
SystemRoleMenuMapper systemRoleMenuMapper;
@Resource
SystemRoleMapper systemAuthRoleMapper;
/**
* 根据角色ID获取菜单ID
*
* @param roleIds 角色ID
* @return List<Integer>
*/
@Override
public List<Integer> getMenuIdsByRoleIds(List<Integer> roleIds) {
List<Integer> ret = new ArrayList<>();
return ret;
public List<Integer> selectMenuIdsByRoleId(List<Integer> roleIds) {
List<Integer> menus = new LinkedList<>();
if (roleIds.isEmpty()) {
return menus;
}
SystemRole systemAuthRole = systemAuthRoleMapper.selectOne(new QueryWrapper<SystemRole>()
.in("id", roleIds)
.eq("is_disable", 0)
.last("limit 1"));
if (StringUtils.isNull(systemAuthRole)) {
return menus;
}
List<SystemRoleMenu> systemRoleMenus = systemRoleMenuMapper.selectList(
new QueryWrapper<SystemRoleMenu>()
.in("role_id", roleIds));
for (SystemRoleMenu systemRoleMenu : systemRoleMenus) {
menus.add(systemRoleMenu.getMenuId());
}
return menus;
}
/**
* 批量写入角色菜单
*
* @author fzr
* @param roleId 角色ID
* @param menuIds 菜单ID组
*/
@Override
@Transactional
public void batchSaveByMenuIds(Integer roleId, List<Integer> menuIds) {
if (menuIds != null && !menuIds.isEmpty()) {
menuIds.forEach(item-> {
SystemRoleMenu model = new SystemRoleMenu();
model.setRoleId(roleId);
model.setMenuId(item);
systemRoleMenuMapper.insert(model);
});
}
}
/**
* 批量删除角色菜单(根据角色ID)
*
* @author fzr
* @param roleId 角色ID
*/
@Override
public void batchDeleteByRoleId(Integer roleId) {
systemRoleMenuMapper.delete(new QueryWrapper<SystemRoleMenu>().eq("role_id", roleId));
}
/**
* 批量删除角色菜单(根据菜单ID)
*
* @author fzr
* @param menuId 菜单ID
*/
@Override
public void batchDeleteByMenuId(Integer menuId) {
systemRoleMenuMapper.delete(new QueryWrapper<SystemRoleMenu>().eq("menu_id", menuId));
}
}

View File

@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mdd.admin.service.admin.IAdminRoleService;
import com.mdd.admin.service.system.ISystemAuthPermService;
import com.mdd.admin.service.system.ISystemRoleMenuService;
import com.mdd.admin.service.system.ISystemRoleService;
import com.mdd.admin.validate.commons.PageValidate;
import com.mdd.admin.validate.system.SystemRoleCreateValidate;
@ -40,7 +40,7 @@ public class SystemRoleServiceImpl implements ISystemRoleService {
SystemRoleMapper systemRoleMapper;
@Resource
ISystemAuthPermService iSystemAuthPermService;
ISystemRoleMenuService iSystemRoleMenuService;
@Resource
IAdminRoleService iAdminRoleService;
@ -55,6 +55,7 @@ public class SystemRoleServiceImpl implements ISystemRoleService {
QueryWrapper<SystemRole> queryWrapper = new QueryWrapper<>();
queryWrapper.select("id,name,sort,create_time,update_time");
queryWrapper.orderByDesc(Arrays.asList("sort", "id"));
queryWrapper.isNull("delete_time");
List<SystemRole> systemAuthRoles = systemRoleMapper.selectList(queryWrapper);
List<SystemAuthRoleVo> list = new ArrayList<>();
@ -89,6 +90,7 @@ public class SystemRoleServiceImpl implements ISystemRoleService {
QueryWrapper<SystemRole> queryWrapper = new QueryWrapper<>();
queryWrapper.orderByDesc(Arrays.asList("sort", "id"));
queryWrapper.isNull("delete_time");
IPage<SystemRole> iPage = systemRoleMapper.selectPage(new Page<>(page, limit), queryWrapper);
@ -127,7 +129,7 @@ public class SystemRoleServiceImpl implements ISystemRoleService {
SystemAuthRoleVo vo = new SystemAuthRoleVo();
BeanUtils.copyProperties(systemAuthRole, vo);
vo.setNum(0);
vo.setMenusId(iSystemAuthPermService.selectMenuIdsByRoleId(roleIds));
vo.setMenusId(iSystemRoleMenuService.selectMenuIdsByRoleId(roleIds));
vo.setCreateTime(TimeUtils.timestampToDate(systemAuthRole.getCreateTime()));
vo.setUpdateTime(TimeUtils.timestampToDate(systemAuthRole.getUpdateTime()));
@ -186,8 +188,8 @@ public class SystemRoleServiceImpl implements ISystemRoleService {
model.setUpdateTime(System.currentTimeMillis() / 1000);
systemRoleMapper.updateById(model);
// iSystemAuthPermService.batchDeleteByRoleId(updateValidate.getId());
// iSystemAuthPermService.batchSaveByMenuIds(updateValidate.getId(), updateValidate.getMenuIds());
iSystemRoleMenuService.batchDeleteByRoleId(updateValidate.getId());
iSystemRoleMenuService.batchSaveByMenuIds(updateValidate.getId(), updateValidate.getMenuId());
}
/**
@ -206,19 +208,18 @@ public class SystemRoleServiceImpl implements ISystemRoleService {
.last("limit 1")),
"角色已不存在!");
Assert.isNull(adminMapper.selectOne(new QueryWrapper<Admin>()
.select("id", "role_ids", "nickname")
.apply("find_in_set({0}, role_ids)", id)
.isNull("delete_time")),
List<AdminRole> adminRoles = iAdminRoleService.getAdminIdByRoleId(id);
Assert.isTrue( adminRoles != null && adminRoles.isEmpty(),
"角色已被管理员使用,请先移除");
systemRoleMapper.deleteById(id);
iSystemAuthPermService.batchDeleteByRoleId(id);
iSystemRoleMenuService.batchDeleteByRoleId(id);
}
@Override
public List<String> getRoleNameByAdminId(Integer adminId) {
List<String> ret = new ArrayList<String>();
List<String> ret = new ArrayList<>();
Admin admin = adminMapper.selectOne(new QueryWrapper<Admin>().eq("id", adminId).isNull("delete_time"));
if (StringUtils.isNull(admin)) {
return ret;

View File

@ -1,43 +0,0 @@
package com.mdd.admin.service.system;
import java.util.List;
/**
* 系统角色菜单服务接口类
*/
public interface ISystemAuthPermService {
/**
* 根据角色ID获取菜单ID
*
* @param roleIds 角色ID
* @return List<Integer>
*/
List<Integer> selectMenuIdsByRoleId(List<Integer> roleIds);
/**
* 批量写入角色菜单
*
* @author fzr
* @param roleId 角色ID
* @param menuIds 菜单ID组
*/
void batchSaveByMenuIds(Integer roleId, String menuIds);
/**
* 根据角色ID批量删除角色菜单
*
* @author fzr
* @param roleId 角色ID
*/
void batchDeleteByRoleId(Integer roleId);
/**
* 根据菜单ID批量删除角色菜单
*
* @author fzr
* @param menuId 菜单ID
*/
void batchDeleteByMenuId(Integer menuId);
}

View File

@ -29,6 +29,14 @@ public interface ISystemMenuService {
*/
JSONObject list();
/**
* 菜单列表
*
* @author fzr
* @return JSONArray
*/
JSONArray all();
/**
* 菜单详情
*

View File

@ -8,10 +8,37 @@ import java.util.List;
*/
public interface ISystemRoleMenuService {
/**
* 根据roleIds 返回menuIds
* @param roleIds
* @return
* 根据角色ID获取菜单ID
*
* @param roleIds 角色ID
* @return List<Integer>
*/
List<Integer> getMenuIdsByRoleIds(List<Integer> roleIds);
List<Integer> selectMenuIdsByRoleId(List<Integer> roleIds);
/**
* 批量写入角色菜单
*
* @author fzr
* @param roleId 角色ID
* @param menuIds 菜单ID组
*/
void batchSaveByMenuIds(Integer roleId, List<Integer> menuIds);
/**
* 根据角色ID批量删除角色菜单
*
* @author fzr
* @param roleId 角色ID
*/
void batchDeleteByRoleId(Integer roleId);
/**
* 根据菜单ID批量删除角色菜单
*
* @author fzr
* @param menuId 菜单ID
*/
void batchDeleteByMenuId(Integer menuId);
}

View File

@ -20,8 +20,8 @@ public class CrontabCreateValidate implements Serializable {
private String name;
@NotNull(message = "types参数缺失")
@ApiModelProperty(value = "任务分组", required = true)
private String types;
@ApiModelProperty("类型 1-定时任务")
private Integer type;
@NotNull(message = "command参数缺失")
@ApiModelProperty(value = "执行指令", required = true)
@ -29,7 +29,7 @@ public class CrontabCreateValidate implements Serializable {
@NotNull(message = "rules参数缺失")
@ApiModelProperty(value = "执行规则", required = true)
private String rules;
private String expression;
@Length(max = 200, message = "remark参数不能超出200个字符")
@ApiModelProperty(value = "备注")
@ -40,14 +40,17 @@ public class CrontabCreateValidate implements Serializable {
@ApiModelProperty(value = "状态")
private Integer status;
@NotNull(message = "strategy参数缺失")
@IntegerContains(values = {1, 2, 3}, message = "strategy参数取值异常")
@ApiModelProperty(value = "strategy", required = true)
private Integer strategy;
@ApiModelProperty(" 参数")
private String params;
@NotNull(message = "concurrent参数缺失")
@IntegerContains(values = {0, 1}, message = "concurrent参数取值异常")
@ApiModelProperty(value = "concurrent", required = true)
private Integer concurrent;
// @NotNull(message = "strategy参数缺失")
// @IntegerContains(values = {1, 2, 3}, message = "strategy参数取值异常")
// @ApiModelProperty(value = "strategy", required = true)
// private Integer strategy;
//
// @NotNull(message = "concurrent参数缺失")
// @IntegerContains(values = {0, 1}, message = "concurrent参数取值异常")
// @ApiModelProperty(value = "concurrent", required = true)
// private Integer concurrent;
}

View File

@ -20,21 +20,21 @@ public class CrontabUpdateValidate implements Serializable {
@ApiModelProperty(value = "id", required = true)
private Integer id;
@NotNull(message = "types参数缺失")
@ApiModelProperty(value = "任务分组", required = true)
private String types;
@NotNull(message = "name参数缺失")
@ApiModelProperty(value = "任务名称", required = true)
private String name;
@NotNull(message = "types参数缺失")
@ApiModelProperty("类型 1-定时任务")
private Integer type;
@NotNull(message = "command参数缺失")
@ApiModelProperty(value = "执行指令", required = true)
private String command;
@NotNull(message = "rules参数缺失")
@ApiModelProperty(value = "执行规则", required = true)
private String rules;
private String expression;
@Length(max = 200, message = "remark参数不能超出200个字符")
@ApiModelProperty(value = "备注")
@ -42,17 +42,11 @@ public class CrontabUpdateValidate implements Serializable {
@NotNull(message = "status参数缺失")
@IntegerContains(values = {1, 2, 3}, message = "status参数取值异常")
@ApiModelProperty(value = "状态", required = true)
@ApiModelProperty(value = "状态")
private Integer status;
@NotNull(message = "strategy参数缺失")
@IntegerContains(values = {1, 2, 3}, message = "strategy参数取值异常")
@ApiModelProperty(value = "strategy", required = true)
private Integer strategy;
@ApiModelProperty(" 参数")
private String params;
@NotNull(message = "concurrent参数缺失")
@IntegerContains(values = {0, 1}, message = "concurrent参数取值异常")
@ApiModelProperty(value = "concurrent", required = true)
private Integer concurrent;
}

View File

@ -16,18 +16,18 @@ public class FinanceRechargeSearchValidate implements Serializable {
private String sn;
@ApiModelProperty(value = "关键词")
private String keyword;
private String user_info;
@ApiModelProperty(value = "支付方式")
private Integer payWay;
private Integer pay_way;
@ApiModelProperty(value = "支付状态")
private Integer payStatus;
private Integer pay_status;
@ApiModelProperty(value = "开始时间")
private Integer startTime;
private Integer start_time;
@ApiModelProperty(value = "结束时间")
private Integer endTime;
private Integer end_time;
}

View File

@ -13,24 +13,23 @@ public class FinanceRefundSearchValidate implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("筛选类型: -1=全部, 0=退款中, 1=退款成功, 2=退款失败")
private Integer type;
private Integer refund_type;
@ApiModelProperty("用户信息")
private String keyword;
private String user_info;
@ApiModelProperty("退款单号")
private String sn;
@ApiModelProperty("来源单号")
private String orderSn;
private String order_sn;
@ApiModelProperty("退款类型: 1=后台退款")
private Integer refundType;
private Integer refund_status;
@ApiModelProperty("开始时间")
private Long startTime;
private Long start_time;
@ApiModelProperty("结束时间")
private Long endTime;
private Long end_time;
}

View File

@ -0,0 +1,19 @@
package com.mdd.admin.validate.finance;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("退款记录搜索参数")
public class FinanceRefundValidate implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("充值订单id")
private Integer recharge_id;
}

View File

@ -13,15 +13,15 @@ public class FinanceWalletSearchValidate implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "关键词")
private String keyword;
private String user_info;
@ApiModelProperty(value = "类型")
private Integer type;
private Integer change_type;
@ApiModelProperty(value = "创建时间")
private Integer startTime;
private Integer start_time;
@ApiModelProperty(value = "结束时间")
private Integer endTime;
private Integer end_time;
}

View File

@ -13,12 +13,12 @@ public class SystemAdminSearchValidate implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "登录账号")
private String username;
private String account;
@ApiModelProperty(value = "用户昵称")
private String nickname;
private String name;
@ApiModelProperty(value = "角色ID")
private Integer role;
private Integer role_id;
}

View File

@ -55,7 +55,7 @@ public class SystemAdminUpdateValidate implements Serializable {
@ApiModelProperty(value = "头像")
private String avatar = "";
@NotNull(message = "请选择角色")
// @NotNull(message = "请选择角色")
@ApiModelProperty(value = "角色ID")
private List<Integer> roleId;

View File

@ -15,31 +15,28 @@ public class CrontabDetailVo implements Serializable {
@ApiModelProperty(value = "任务ID")
private Integer id;
@ApiModelProperty(value = "任务分组")
private String types;
@ApiModelProperty(value = "任务名称")
@ApiModelProperty("任务名称")
private String name;
@ApiModelProperty(value = "执行命令")
private String command;
@ApiModelProperty("类型 1-定时任务")
private Integer type;
@ApiModelProperty(value = "执行规则")
private String rules;
@ApiModelProperty("是否系统任务 0-否 1-是")
private Integer system;
@ApiModelProperty(value = "备注信息")
@ApiModelProperty("备注信息")
private String remark;
@ApiModelProperty(value = "错误信息")
private String error;
@ApiModelProperty("执行命令")
private String command;
@ApiModelProperty(value = "执行状态: 1=正在运行, 2=任务停止, 3=发生错误")
@ApiModelProperty(" 执行状态: 1=正在运行, 2=任务停止, 3=发生错误")
private Integer status;
@ApiModelProperty(value = "执行策略: 1=立即执行, 2=执行一次, 3=放弃执行")
private Integer strategy;
@ApiModelProperty(" 参数")
private String params;
@ApiModelProperty(value = "并发执行: 0=否, 1=是")
private Integer concurrent;
@ApiModelProperty("执行规则")
private String expression;
}

View File

@ -12,40 +12,56 @@ public class CrontabListedVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "任务ID")
private Integer id; // 执行ID
@ApiModelProperty("ID")
private Integer id;
@ApiModelProperty(value = "任务分组")
private String groups;
@ApiModelProperty(value = "任务名称")
@ApiModelProperty("任务名称")
private String name;
@ApiModelProperty(value = "执行命令")
@ApiModelProperty("类型 1-定时任务")
private Integer type;
private String typeDesc;
@ApiModelProperty("是否系统任务 0-否 1-是")
private Integer system;
@ApiModelProperty("备注信息")
private String remark;
@ApiModelProperty("执行命令")
private String command;
@ApiModelProperty(value = "执行规则")
private String rules;
@ApiModelProperty(value = "错误信息")
private String error;
@ApiModelProperty(value = "执行状态: [1=正在运行, 2=任务停止, 3=发生错误]")
@ApiModelProperty(" 执行状态: 1=正在运行, 2=任务停止, 3=发生错误")
private Integer status;
@ApiModelProperty(value = "执行策略: [1=立即执行, 2=执行一次, 3=放弃执行]")
private Integer strategy;
private String statusDesc;
@ApiModelProperty(value = "并发执行: [0=否, 1=是]")
private Integer concurrent;
@ApiModelProperty(" 参数")
private String params;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty("执行规则")
private String expression;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty("错误信息")
private String error;
@ApiModelProperty(value = "执行耗时")
private Long taskTime;
@ApiModelProperty("结束时间")
private Long lastTime;
@ApiModelProperty("最大执行时长")
private Long time;
@ApiModelProperty("最大执行时长")
private Long maxTime;
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("更新时间")
private Long updateTime;
@ApiModelProperty("删除时间")
private Long deleteTime;
}

View File

@ -22,11 +22,11 @@ public class FinanceRechargeListVo implements Serializable {
@ApiModelProperty("用户头像")
private String avatar;
@ApiModelProperty("用户编")
private String userSn;
@ApiModelProperty("")
private String acount;
@ApiModelProperty("订单编号")
private String orderSn;
private String sn;
@ApiModelProperty("支付方式: [2=微信支付, 3=支付宝支付]")
private String payWay;
@ -37,11 +37,11 @@ public class FinanceRechargeListVo implements Serializable {
@ApiModelProperty("退款状态: [0=未退款 , 1=已退款]")
private Integer refundStatus;
@ApiModelProperty("是否有退款: [0=否 , 1=是]")
private Integer isRefund;
@ApiModelProperty("支付状态: [0=待支付, 1=已支付]")
private String payStatusText;
@ApiModelProperty("退款状态描述")
private String refundStatusMsg;
@ApiModelProperty("支付方式")
private String payWayText;
@ApiModelProperty("支付金额")
private BigDecimal orderAmount;

View File

@ -40,11 +40,15 @@ public class FinanceRefundListVo implements Serializable {
@ApiModelProperty("退款状态: 0=退款中, 1=退款成功, 2=退款失败")
private Integer refundStatus;
private Integer refundWay;
@ApiModelProperty("退款类型描述")
private String refundTypeMsg;
private String refundTypeText;
@ApiModelProperty("退款状态描述")
private String refundStatusMsg;
private String refundStatusText;
private String refundWayText;
@ApiModelProperty("记录时间")
private String createTime;

View File

@ -29,7 +29,7 @@ public class FinanceRefundLogVo implements Serializable {
private Integer refundStatus;
@ApiModelProperty("退款状态描述")
private String refundStatusMsg;
private String refundStatusText;
@ApiModelProperty("退款信息")
private String refundMsg;

View File

@ -17,7 +17,13 @@ public class FinanceWalletListVo implements Serializable {
private Integer id;
@ApiModelProperty(value = "用户编号")
private String userSn;
private String sn;
private String account;
private String mobile;
private Integer action;
@ApiModelProperty(value = "u屏幕估计头皮屑")
private String avatar;
@ -34,6 +40,8 @@ public class FinanceWalletListVo implements Serializable {
@ApiModelProperty(value = "变动类型")
private String changeType;
private String changeTypeDesc;
@ApiModelProperty(value = "来源单号")
private String sourceSn;

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
@Data
@ApiModel("计划任务实体")
public class Crontab implements Serializable {
public class DevCrontab implements Serializable {
private static final long serialVersionUID = 1L;
@ -21,41 +21,44 @@ public class Crontab implements Serializable {
@ApiModelProperty("任务名称")
private String name;
@ApiModelProperty("任务分组")
private String types;
@ApiModelProperty("类型 1-定时任务")
private Integer type;
@ApiModelProperty("执行命令")
private String command;
@ApiModelProperty("执行规则")
private String rules;
@ApiModelProperty("是否系统任务 0-否 1-是")
private Integer system;
@ApiModelProperty("备注信息")
private String remark;
@ApiModelProperty("错误信息")
private String error;
@ApiModelProperty("执行命令")
private String command;
@ApiModelProperty(" 执行状态: 1=正在运行, 2=任务停止, 3=发生错误")
private Integer status;
@ApiModelProperty("执行策略: 1=立即执行, 2=执行一次, 3=放弃执行")
private Integer strategy;
@ApiModelProperty(" 参数")
private String params;
@ApiModelProperty("并发执行: 0=否, 1=是")
private Integer concurrent;
@ApiModelProperty("执行规则")
private String expression;
@ApiModelProperty("是否删除: 0=否, 1=是")
private Integer isDelete;
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("错误信息")
private String error;
@ApiModelProperty("结束时间")
private Long endTime;
private Long lastTime;
@ApiModelProperty("任务耗时")
private Long taskTime;
// @ApiModelProperty("执行策略: 1=立即执行, 2=执行一次, 3=放弃执行")
// private Integer strategy;
//
// @ApiModelProperty("并发执行: 0=否, 1=是")
// private Integer concurrent;
@ApiModelProperty("最大执行时长")
private Long time;
@ApiModelProperty("最大执行时长")
private Long maxTime;
@ApiModelProperty("创建时间")
private Long createTime;

View File

@ -1,27 +0,0 @@
package com.mdd.common.entity.system;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("系统角色菜单实体")
public class SystemAuthPerm implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_UUID)
@ApiModelProperty("ID")
private String id;
@ApiModelProperty("角色ID")
private Integer roleId;
@ApiModelProperty("菜单ID")
private Integer menuId;
}

View File

@ -61,4 +61,20 @@ public enum PaymentEnum {
return "未知";
}
/**
*
* @author fzr
* @param status 支付状态
* @return String
*/
public static String getPayStatusMsg(Integer status){
switch (status) {
case 0:
return "未支付";
case 1:
return "已支付";
}
return "未知";
}
}

View File

@ -1,12 +1,12 @@
package com.mdd.common.mapper;
import com.mdd.common.core.basics.IBaseMapper;
import com.mdd.common.entity.Crontab;
import com.mdd.common.entity.DevCrontab;
import org.apache.ibatis.annotations.Mapper;
/**
* 计划任务Mapper
*/
@Mapper
public interface CrontabMapper extends IBaseMapper<Crontab> {
public interface DevCrontabMapper extends IBaseMapper<DevCrontab> {
}

View File

@ -1,12 +0,0 @@
package com.mdd.common.mapper.system;
import com.mdd.common.core.basics.IBaseMapper;
import com.mdd.common.entity.system.SystemAuthPerm;
import org.apache.ibatis.annotations.Mapper;
/**
* 角色菜单Mapper
*/
@Mapper
public interface SystemAuthPermMapper extends IBaseMapper<SystemAuthPerm> {
}