@@ -57,9 +57,9 @@ spring: | |||||
servlet: | servlet: | ||||
multipart: | multipart: | ||||
# 单个文件大小 | # 单个文件大小 | ||||
max-file-size: 10MB | |||||
max-file-size: 200MB | |||||
# 设置总上传的文件大小 | # 设置总上传的文件大小 | ||||
max-request-size: 20MB | |||||
max-request-size: 200MB | |||||
# 服务模块 | # 服务模块 | ||||
devtools: | devtools: | ||||
restart: | restart: | ||||
@@ -110,7 +110,7 @@ public class ApplyController extends BaseController { | |||||
planLogList = qw.in(ApplyPlanLog::getPlanId, planIdList).isNotNull(ApplyPlanLog::getUpdateTime).list(); | planLogList = qw.in(ApplyPlanLog::getPlanId, planIdList).isNotNull(ApplyPlanLog::getUpdateTime).list(); | ||||
} | } | ||||
startPage(); | startPage(); | ||||
List<ListApplyVO> list = applyService.list(planList, planLogList, apply); | |||||
List<ListApplyVO> list = applyService.list(apply,planList, planLogList ); | |||||
return getDataTable(list); | return getDataTable(list); | ||||
} | } | ||||
@@ -125,7 +125,7 @@ public class ApplyController extends BaseController { | |||||
List<ApplyPlan> planList = applyPlanService.lambdaQuery().eq(ApplyPlan::getTaskStatus, PlanRunStatus.FINISH.getKey()).list(); | List<ApplyPlan> planList = applyPlanService.lambdaQuery().eq(ApplyPlan::getTaskStatus, PlanRunStatus.FINISH.getKey()).list(); | ||||
// 获取所有计划记录 | // 获取所有计划记录 | ||||
List<ApplyPlanLog> planLogList = applyPlanLogService.list(); | List<ApplyPlanLog> planLogList = applyPlanLogService.list(); | ||||
List<ListApplyVO> list = applyService.list(planList, planLogList, apply); | |||||
List<ListApplyVO> list = applyService.list(apply,planList, planLogList); | |||||
ExcelUtil<ListApplyVO> util = new ExcelUtil<ListApplyVO>(ListApplyVO.class); | ExcelUtil<ListApplyVO> util = new ExcelUtil<ListApplyVO>(ListApplyVO.class); | ||||
util.exportExcel(response, list, "应用信息管理数据"); | util.exportExcel(response, list, "应用信息管理数据"); | ||||
} | } | ||||
@@ -42,7 +42,7 @@ public interface IApplyService extends IService<Apply> | |||||
* @param apply 应用信息管理 | * @param apply 应用信息管理 | ||||
* @return 应用信息管理集合 | * @return 应用信息管理集合 | ||||
*/ | */ | ||||
List<ListApplyVO> list(List<ApplyPlan> planList, List<ApplyPlanLog> planLogList, Apply apply); | |||||
List<ListApplyVO> list(Apply apply,List<ApplyPlan> planList, List<ApplyPlanLog> planLogList); | |||||
/** | /** | ||||
* 查询所有应用信息列表 | * 查询所有应用信息列表 | ||||
@@ -121,10 +121,15 @@ public class ApplyPlanServiceImpl extends ServiceImpl<ApplyPlanMapper, ApplyPlan | |||||
ApplyPlan applyPlan = this.lambdaQuery().eq(ApplyPlan::getTaskUuid, yinDaoCallBackBO.getJobUuid()).one(); | ApplyPlan applyPlan = this.lambdaQuery().eq(ApplyPlan::getTaskUuid, yinDaoCallBackBO.getJobUuid()).one(); | ||||
applyPlan.setStartTime(DateUtils.parseDate(yinDaoCallBackBO.getStartTime())); | applyPlan.setStartTime(DateUtils.parseDate(yinDaoCallBackBO.getStartTime())); | ||||
applyPlan.setEndTime(DateUtils.parseDate(yinDaoCallBackBO.getEndTime())); | applyPlan.setEndTime(DateUtils.parseDate(yinDaoCallBackBO.getEndTime())); | ||||
BigDecimal planTime = new BigDecimal((double) (Long.parseLong(yinDaoCallBackBO.getEndTime()) - Long.parseLong(yinDaoCallBackBO.getStartTime())) / (60 * 1000)).setScale(2, RoundingMode.HALF_UP); | |||||
applyPlan.setPlanTime(planTime + ""); | |||||
if (null != yinDaoCallBackBO.getEndTime()) { | |||||
log.debug("endTime:" + yinDaoCallBackBO.getEndTime()); | |||||
Date endDate = DateUtils.parseDate(yinDaoCallBackBO.getEndTime()); | |||||
Date startDate = DateUtils.parseDate(yinDaoCallBackBO.getStartTime()); | |||||
BigDecimal planTime = new BigDecimal((double) (endDate.getTime() - startDate.getTime()) / (60 * 1000)).setScale(2, RoundingMode.HALF_UP); | |||||
applyPlan.setPlanTime(planTime + ""); | |||||
} | |||||
applyPlan.setTaskStatus(yinDaoCallBackBO.getStatus()); | applyPlan.setTaskStatus(yinDaoCallBackBO.getStatus()); | ||||
if (!yinDaoCallBackBO.getResult().isEmpty()) { | if (!yinDaoCallBackBO.getResult().isEmpty()) { | ||||
applyPlan.setOutParam(yinDaoCallBackBO.getResult().get(0).getValue()); | applyPlan.setOutParam(yinDaoCallBackBO.getResult().get(0).getValue()); | ||||
@@ -782,7 +787,7 @@ public class ApplyPlanServiceImpl extends ServiceImpl<ApplyPlanMapper, ApplyPlan | |||||
* @return 应用执行计划管理 | * @return 应用执行计划管理 | ||||
*/ | */ | ||||
@Override | @Override | ||||
@DataScope(deptAlias = "d") | |||||
@DataScope(deptAlias = "plan") | |||||
public List<ApplyPlan> list(ApplyPlan applyPlan) { | public List<ApplyPlan> list(ApplyPlan applyPlan) { | ||||
return baseMapper.selectApplyPlanList(applyPlan); | return baseMapper.selectApplyPlanList(applyPlan); | ||||
} | } | ||||
@@ -9,6 +9,9 @@ import java.util.concurrent.atomic.AtomicReference; | |||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||||
import com.github.pagehelper.Page; | |||||
import com.github.pagehelper.PageHelper; | |||||
import com.github.pagehelper.PageInfo; | |||||
import com.ruoyi.business.domain.*; | import com.ruoyi.business.domain.*; | ||||
import com.ruoyi.business.domain.bo.ApplyStartBO; | import com.ruoyi.business.domain.bo.ApplyStartBO; | ||||
import com.ruoyi.business.domain.bo.JobQueryBO; | import com.ruoyi.business.domain.bo.JobQueryBO; | ||||
@@ -21,9 +24,12 @@ import com.ruoyi.business.service.IResourceLibraryService; | |||||
import com.ruoyi.business.util.YinDaoHttpUtils; | import com.ruoyi.business.util.YinDaoHttpUtils; | ||||
import com.ruoyi.common.annotation.DataScope; | import com.ruoyi.common.annotation.DataScope; | ||||
import com.ruoyi.common.core.domain.entity.SysDept; | import com.ruoyi.common.core.domain.entity.SysDept; | ||||
import com.ruoyi.common.core.page.PageDomain; | |||||
import com.ruoyi.common.core.page.TableSupport; | |||||
import com.ruoyi.common.enums.PlanRunStatus; | import com.ruoyi.common.enums.PlanRunStatus; | ||||
import com.ruoyi.common.utils.SecurityUtils; | import com.ruoyi.common.utils.SecurityUtils; | ||||
import com.ruoyi.common.utils.bean.BeanUtils; | import com.ruoyi.common.utils.bean.BeanUtils; | ||||
import com.ruoyi.common.utils.sql.SqlUtil; | |||||
import com.ruoyi.system.service.ISysDeptService; | import com.ruoyi.system.service.ISysDeptService; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
@@ -152,19 +158,19 @@ public class ApplyServiceImpl extends ServiceImpl<ApplyMapper, Apply> implements | |||||
*/ | */ | ||||
@Override | @Override | ||||
@DataScope(deptAlias = "apply") | @DataScope(deptAlias = "apply") | ||||
public List<ListApplyVO> list(List<ApplyPlan> planList, List<ApplyPlanLog> planLogList, Apply apply) { | |||||
public List<ListApplyVO> list(Apply apply,List<ApplyPlan> planList, List<ApplyPlanLog> planLogList) { | |||||
// 按照appId分组 | // 按照appId分组 | ||||
Map<String, List<ApplyPlan>> planMap = planList.stream().collect(Collectors.groupingBy(ApplyPlan::getAppId)); | Map<String, List<ApplyPlan>> planMap = planList.stream().collect(Collectors.groupingBy(ApplyPlan::getAppId)); | ||||
// 日志按照app分组 | // 日志按照app分组 | ||||
Map<String, List<ApplyPlanLog>> planLogMap = planLogList.stream().collect(Collectors.groupingBy(ApplyPlanLog::getAppId)); | Map<String, List<ApplyPlanLog>> planLogMap = planLogList.stream().collect(Collectors.groupingBy(ApplyPlanLog::getAppId)); | ||||
List<ListApplyVO> listApplyVOS = baseMapper.selectApplyList(apply); | List<ListApplyVO> listApplyVOS = baseMapper.selectApplyList(apply); | ||||
List<ListApplyVO> newList = listApplyVOS.stream().map(e -> { | |||||
listApplyVOS.forEach(e -> { | |||||
// 根据appId获取执行计划 | // 根据appId获取执行计划 | ||||
List<ApplyPlan> applyPlans = planMap.get(e.getAppId()); | List<ApplyPlan> applyPlans = planMap.get(e.getAppId()); | ||||
// 应用没有设置时间 | // 应用没有设置时间 | ||||
if (null == applyPlans) { | if (null == applyPlans) { | ||||
return e; | |||||
return; | |||||
} | } | ||||
// 总计节约时间 (分钟) | // 总计节约时间 (分钟) | ||||
AtomicReference<BigDecimal> planTime = new AtomicReference<>(BigDecimal.ZERO); | AtomicReference<BigDecimal> planTime = new AtomicReference<>(BigDecimal.ZERO); | ||||
@@ -189,9 +195,8 @@ public class ApplyServiceImpl extends ServiceImpl<ApplyMapper, Apply> implements | |||||
} | } | ||||
}); | }); | ||||
e.setTimeSaving(planTime.get() + ""); | e.setTimeSaving(planTime.get() + ""); | ||||
return e; | |||||
}).collect(Collectors.toList()); | |||||
return newList; | |||||
}); | |||||
return listApplyVOS; | |||||
} | } | ||||
/** | /** | ||||
@@ -220,7 +225,7 @@ public class ApplyServiceImpl extends ServiceImpl<ApplyMapper, Apply> implements | |||||
e.setManualTime(apply.getManualTime()); | e.setManualTime(apply.getManualTime()); | ||||
if (PlanRunStatus.FINISH.getKey().equals(e.getTaskStatus())) { | if (PlanRunStatus.FINISH.getKey().equals(e.getTaskStatus())) { | ||||
// 计算节约时间 | // 计算节约时间 | ||||
long diff = Long.parseLong(e.getManualTime()) - Long.parseLong(Optional.ofNullable(e.getPlanTime()).orElse("0")); | |||||
double diff = Double.parseDouble(e.getManualTime()) - Double.parseDouble(Optional.ofNullable(e.getPlanTime()).orElse("0")); | |||||
e.setTimeSaving(diff + ""); | e.setTimeSaving(diff + ""); | ||||
} | } | ||||
applyPlanService.updateById(e); | applyPlanService.updateById(e); | ||||
@@ -103,7 +103,7 @@ | |||||
plan.dept_id,<!-- 部门id --> | plan.dept_id,<!-- 部门id --> | ||||
plan.dept_name,<!-- 部门名称 --> | plan.dept_name,<!-- 部门名称 --> | ||||
plan.enabled,<!-- 是否启用 --> | plan.enabled,<!-- 是否启用 --> | ||||
plan.create_by,<!-- 创建者 --> | |||||
ifnull((select nick_name from sys_user where user_name = plan.create_by),plan.create_by) as create_by,<!-- 创建者 --> | |||||
plan.create_time,<!-- 创建时间 --> | plan.create_time,<!-- 创建时间 --> | ||||
plan.update_by,<!-- 更新者 --> | plan.update_by,<!-- 更新者 --> | ||||
plan.update_time,<!-- 更新时间 --> | plan.update_time,<!-- 更新时间 --> | ||||
@@ -114,8 +114,6 @@ | |||||
<select id="selectApplyPlanList" parameterType="ApplyPlan" resultMap="ApplyPlanResult"> | <select id="selectApplyPlanList" parameterType="ApplyPlan" resultMap="ApplyPlanResult"> | ||||
<include refid="selectApplyPlanVo"/> | <include refid="selectApplyPlanVo"/> | ||||
from ct_apply_plan plan | from ct_apply_plan plan | ||||
left JOIN sys_user u ON plan.create_by = u.user_name | |||||
left join sys_dept d on u.dept_id = d.dept_id | |||||
<where> | <where> | ||||
deleted = 0 | deleted = 0 | ||||
<if test="planName != null and planName != ''">and plan_name like concat(#{planName}, '%')</if> | <if test="planName != null and planName != ''">and plan_name like concat(#{planName}, '%')</if> | ||||
@@ -86,7 +86,8 @@ public class BaseController | |||||
rspData.setCode(HttpStatus.SUCCESS); | rspData.setCode(HttpStatus.SUCCESS); | ||||
rspData.setMsg("查询成功"); | rspData.setMsg("查询成功"); | ||||
rspData.setRows(list); | rspData.setRows(list); | ||||
rspData.setTotal(new PageInfo(list).getTotal()); | |||||
PageInfo pageInfo = new PageInfo(list); | |||||
rspData.setTotal(pageInfo.getTotal()); | |||||
return rspData; | return rspData; | ||||
} | } | ||||
@@ -23,9 +23,9 @@ import com.ruoyi.common.utils.uuid.Seq; | |||||
public class FileUploadUtils | public class FileUploadUtils | ||||
{ | { | ||||
/** | /** | ||||
* 默认大小 50M | |||||
* 默认大小 200M | |||||
*/ | */ | ||||
public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024; | |||||
public static final long DEFAULT_MAX_SIZE = 200 * 1024 * 1024; | |||||
/** | /** | ||||
* 默认的文件名最大长度 100 | * 默认的文件名最大长度 100 | ||||