添加量表发布统计数量限制
This commit is contained in:
parent
b222b1dfec
commit
b2a67f18ba
|
@ -122,8 +122,8 @@ public class StatisticController extends BaseController {
|
||||||
* 获取量表发布次数
|
* 获取量表发布次数
|
||||||
*/
|
*/
|
||||||
@GetMapping("/scale/publish/num")
|
@GetMapping("/scale/publish/num")
|
||||||
public R<List<StatisticNumVo>> getPublishNum() {
|
public R<List<StatisticNumVo>> getPublishNum(Integer limitNum) {
|
||||||
return R.ok(statisticService.getScalePublishNum());
|
return R.ok(statisticService.getScalePublishNum(limitNum));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,7 +32,7 @@ public interface StatisticMapper {
|
||||||
int selectWarnNum();
|
int selectWarnNum();
|
||||||
int selectInterveneNum();
|
int selectInterveneNum();
|
||||||
|
|
||||||
List<StatisticNumVo> selectScalePublishNum();
|
List<StatisticNumVo> selectScalePublishNum(int limitNum);
|
||||||
List<StatisticNumVo> selectPublishNumByGrade(@Param("startTime") String startTime);
|
List<StatisticNumVo> selectPublishNumByGrade(@Param("startTime") String startTime);
|
||||||
List<StatisticNumVo> selectEvaluationNumByGrade(@Param("startTime") String startTime);
|
List<StatisticNumVo> selectEvaluationNumByGrade(@Param("startTime") String startTime);
|
||||||
List<StatisticWarnVo> selectConclusion(@Param("startTime") String startTime);
|
List<StatisticWarnVo> selectConclusion(@Param("startTime") String startTime);
|
||||||
|
|
|
@ -30,7 +30,7 @@ public interface IStatisticService {
|
||||||
int getEvaluationNum();
|
int getEvaluationNum();
|
||||||
int getWarnNum();
|
int getWarnNum();
|
||||||
int getInterveneNum();
|
int getInterveneNum();
|
||||||
List<StatisticNumVo> getScalePublishNum();
|
List<StatisticNumVo> getScalePublishNum(Integer limitNum);
|
||||||
List<StatisticNumVo> getPublishAndEvaluationNumByGrade(String select);
|
List<StatisticNumVo> getPublishAndEvaluationNumByGrade(String select);
|
||||||
|
|
||||||
List<StatisticWarnVo> getConclusion(String select);
|
List<StatisticWarnVo> getConclusion(String select);
|
||||||
|
|
|
@ -41,10 +41,6 @@ public interface ISysInterveneRecordService {
|
||||||
*/
|
*/
|
||||||
Boolean insertByBo(SysInterveneRecordBo bo);
|
Boolean insertByBo(SysInterveneRecordBo bo);
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改干预记录
|
|
||||||
*/
|
|
||||||
Boolean updateByBo(SysInterveneRecordBo bo);
|
|
||||||
|
|
||||||
List<TimeAxisVo> queryInterveneTimeList(Long userId);
|
List<TimeAxisVo> queryInterveneTimeList(Long userId);
|
||||||
|
|
||||||
|
|
|
@ -196,8 +196,8 @@ public class StatisticServiceImpl implements IStatisticService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StatisticNumVo> getScalePublishNum() {
|
public List<StatisticNumVo> getScalePublishNum(Integer limitNum) {
|
||||||
return statisticMapper.selectScalePublishNum();
|
return statisticMapper.selectScalePublishNum(limitNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.dromara.scale.service.impl;
|
package org.dromara.scale.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
@ -60,17 +59,14 @@ public class SysInterveneRecordServiceImpl implements ISysInterveneRecordService
|
||||||
.eq(SysInterveneRecord::getUserId, userId)
|
.eq(SysInterveneRecord::getUserId, userId)
|
||||||
.orderByDesc(SysInterveneRecord::getCreateTime)
|
.orderByDesc(SysInterveneRecord::getCreateTime)
|
||||||
);
|
);
|
||||||
if (ObjectUtil.isNotEmpty(result.getRecords())) {
|
|
||||||
for (SysInterveneRecordVo record : result.getRecords()) {
|
for (SysInterveneRecordVo record : result.getRecords()) {
|
||||||
SysScalePublish sysScalePublish = publishMapper.selectById(record.getBatchNo());
|
SysScalePublish sysScalePublish = publishMapper.selectById(record.getBatchNo());
|
||||||
record.setSessionName(sysScalePublish.getSessionName());
|
record.setSessionName(sysScalePublish.getSessionName());
|
||||||
SysWarnRecord warn = warnMapper.selectOne(new LambdaQueryWrapper<SysWarnRecord>()
|
SysWarnRecord warn = warnMapper.selectOne(new LambdaQueryWrapper<SysWarnRecord>()
|
||||||
//.select(SysWarnRecord::getNote)
|
|
||||||
.eq(SysWarnRecord::getBatchNo, record.getBatchNo())
|
.eq(SysWarnRecord::getBatchNo, record.getBatchNo())
|
||||||
.eq(SysWarnRecord::getUserId, record.getUserId()));
|
.eq(SysWarnRecord::getUserId, record.getUserId()));
|
||||||
record.setNote(warn.getNote());
|
record.setNote(warn.getNote());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,9 +118,7 @@ public class SysInterveneRecordServiceImpl implements ISysInterveneRecordService
|
||||||
throw new ServiceException("此用户状态为无需干预,无法提交干预记录");
|
throw new ServiceException("此用户状态为无需干预,无法提交干预记录");
|
||||||
}
|
}
|
||||||
SysInterveneRecord add = MapstructUtils.convert(bo, SysInterveneRecord.class);
|
SysInterveneRecord add = MapstructUtils.convert(bo, SysInterveneRecord.class);
|
||||||
//add.setCreateTime(new Date());
|
|
||||||
add.setCounselorId(loginUser.getUserId());
|
add.setCounselorId(loginUser.getUserId());
|
||||||
validEntityBeforeSave(add);
|
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
if (flag) {
|
if (flag) {
|
||||||
bo.setInterveneId(add.getInterveneId());
|
bo.setInterveneId(add.getInterveneId());
|
||||||
|
@ -139,23 +133,6 @@ public class SysInterveneRecordServiceImpl implements ISysInterveneRecordService
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改干预记录
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Boolean updateByBo(SysInterveneRecordBo bo) {
|
|
||||||
SysInterveneRecord update = MapstructUtils.convert(bo, SysInterveneRecord.class);
|
|
||||||
validEntityBeforeSave(update);
|
|
||||||
return baseMapper.updateById(update) > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存前的数据校验
|
|
||||||
*/
|
|
||||||
private void validEntityBeforeSave(SysInterveneRecord entity) {
|
|
||||||
//TODO 做一些数据校验,如唯一约束
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TimeAxisVo> queryInterveneTimeList(Long userId) {
|
public List<TimeAxisVo> queryInterveneTimeList(Long userId) {
|
||||||
List<TimeAxisVo> warn = warnMapper.selectTimeList(userId);
|
List<TimeAxisVo> warn = warnMapper.selectTimeList(userId);
|
||||||
|
|
|
@ -96,6 +96,7 @@
|
||||||
where status = 1
|
where status = 1
|
||||||
and publish_nums > 0
|
and publish_nums > 0
|
||||||
order by publish_nums
|
order by publish_nums
|
||||||
|
limit #{limitNum}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPublishNumByGrade" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
<select id="selectPublishNumByGrade" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
||||||
|
|
Loading…
Reference in New Issue