lcr 1 mese fa
parent
commit
a7f2d48e1b
8 ha cambiato i file con 31 aggiunte e 22 eliminazioni
  1. +2
    -2
      ruoyi-admin/src/main/resources/application.yml
  2. +2
    -2
      ruoyi-business/src/main/java/com/ruoyi/business/controller/ApplyController.java
  3. +1
    -1
      ruoyi-business/src/main/java/com/ruoyi/business/service/IApplyService.java
  4. +9
    -4
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ApplyPlanServiceImpl.java
  5. +12
    -7
      ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ApplyServiceImpl.java
  6. +1
    -3
      ruoyi-business/src/main/resources/mapper/business/ApplyPlanMapper.xml
  7. +2
    -1
      ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
  8. +2
    -2
      ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java

+ 2
- 2
ruoyi-admin/src/main/resources/application.yml Vedi File

@@ -57,9 +57,9 @@ spring:
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
max-file-size: 200MB
# 设置总上传的文件大小
max-request-size: 20MB
max-request-size: 200MB
# 服务模块
devtools:
restart:


+ 2
- 2
ruoyi-business/src/main/java/com/ruoyi/business/controller/ApplyController.java Vedi File

@@ -110,7 +110,7 @@ public class ApplyController extends BaseController {
planLogList = qw.in(ApplyPlanLog::getPlanId, planIdList).isNotNull(ApplyPlanLog::getUpdateTime).list();
}
startPage();
List<ListApplyVO> list = applyService.list(planList, planLogList, apply);
List<ListApplyVO> list = applyService.list(apply,planList, planLogList );
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<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);
util.exportExcel(response, list, "应用信息管理数据");
}


+ 1
- 1
ruoyi-business/src/main/java/com/ruoyi/business/service/IApplyService.java Vedi File

@@ -42,7 +42,7 @@ public interface IApplyService extends IService<Apply>
* @param apply 应用信息管理
* @return 应用信息管理集合
*/
List<ListApplyVO> list(List<ApplyPlan> planList, List<ApplyPlanLog> planLogList, Apply apply);
List<ListApplyVO> list(Apply apply,List<ApplyPlan> planList, List<ApplyPlanLog> planLogList);

/**
* 查询所有应用信息列表


+ 9
- 4
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ApplyPlanServiceImpl.java Vedi File

@@ -121,10 +121,15 @@ public class ApplyPlanServiceImpl extends ServiceImpl<ApplyPlanMapper, ApplyPlan
ApplyPlan applyPlan = this.lambdaQuery().eq(ApplyPlan::getTaskUuid, yinDaoCallBackBO.getJobUuid()).one();
applyPlan.setStartTime(DateUtils.parseDate(yinDaoCallBackBO.getStartTime()));
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());

if (!yinDaoCallBackBO.getResult().isEmpty()) {
applyPlan.setOutParam(yinDaoCallBackBO.getResult().get(0).getValue());

@@ -782,7 +787,7 @@ public class ApplyPlanServiceImpl extends ServiceImpl<ApplyPlanMapper, ApplyPlan
* @return 应用执行计划管理
*/
@Override
@DataScope(deptAlias = "d")
@DataScope(deptAlias = "plan")
public List<ApplyPlan> list(ApplyPlan applyPlan) {
return baseMapper.selectApplyPlanList(applyPlan);
}


+ 12
- 7
ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ApplyServiceImpl.java Vedi File

@@ -9,6 +9,9 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;

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.bo.ApplyStartBO;
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.common.annotation.DataScope;
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.utils.SecurityUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.sql.SqlUtil;
import com.ruoyi.system.service.ISysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -152,19 +158,19 @@ public class ApplyServiceImpl extends ServiceImpl<ApplyMapper, Apply> implements
*/
@Override
@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分组
Map<String, List<ApplyPlan>> planMap = planList.stream().collect(Collectors.groupingBy(ApplyPlan::getAppId));
// 日志按照app分组
Map<String, List<ApplyPlanLog>> planLogMap = planLogList.stream().collect(Collectors.groupingBy(ApplyPlanLog::getAppId));

List<ListApplyVO> listApplyVOS = baseMapper.selectApplyList(apply);
List<ListApplyVO> newList = listApplyVOS.stream().map(e -> {
listApplyVOS.forEach(e -> {
// 根据appId获取执行计划
List<ApplyPlan> applyPlans = planMap.get(e.getAppId());
// 应用没有设置时间
if (null == applyPlans) {
return e;
return;
}
// 总计节约时间 (分钟)
AtomicReference<BigDecimal> planTime = new AtomicReference<>(BigDecimal.ZERO);
@@ -189,9 +195,8 @@ public class ApplyServiceImpl extends ServiceImpl<ApplyMapper, Apply> implements
}
});
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());
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 + "");
}
applyPlanService.updateById(e);


+ 1
- 3
ruoyi-business/src/main/resources/mapper/business/ApplyPlanMapper.xml Vedi File

@@ -103,7 +103,7 @@
plan.dept_id,<!-- 部门id -->
plan.dept_name,<!-- 部门名称 -->
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.update_by,<!-- 更新者 -->
plan.update_time,<!-- 更新时间 -->
@@ -114,8 +114,6 @@
<select id="selectApplyPlanList" parameterType="ApplyPlan" resultMap="ApplyPlanResult">
<include refid="selectApplyPlanVo"/>
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>
deleted = 0
<if test="planName != null and planName != ''">and plan_name like concat(#{planName}, '%')</if>


+ 2
- 1
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java Vedi File

@@ -86,7 +86,8 @@ public class BaseController
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(list);
rspData.setTotal(new PageInfo(list).getTotal());
PageInfo pageInfo = new PageInfo(list);
rspData.setTotal(pageInfo.getTotal());
return rspData;
}



+ 2
- 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java Vedi File

@@ -23,9 +23,9 @@ import com.ruoyi.common.utils.uuid.Seq;
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


Loading…
Annulla
Salva