团体报告导出添加判断
This commit is contained in:
parent
4250b6a948
commit
ecddd11751
|
@ -278,6 +278,11 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
|||
if (batchNo == null) {
|
||||
throw new ServerException("场次Id不能为空");
|
||||
}
|
||||
//查询前置,用来判断
|
||||
int completeNum = recordMapper.selectCompleteNumByBatchNo(batchNo);
|
||||
if (completeNum == 0) {
|
||||
throw new ServerException("本场次暂无完成的量测记录,请测评后再导出");
|
||||
}
|
||||
PublishRecordWordData wordData = new PublishRecordWordData();
|
||||
|
||||
SysScalePublishVo publishVo = baseMapper.selectVoById(batchNo);
|
||||
|
@ -309,7 +314,7 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
|||
.series("", new Integer[]{maleNum, femaleNum}).create();
|
||||
wordData.setSexChart(sexChart);
|
||||
|
||||
int completeNum = recordMapper.selectCompleteNumByBatchNo(batchNo);
|
||||
|
||||
int undoneNum = recordMapper.selectUndoneNumByBatchNo(batchNo);
|
||||
int recordNum = completeNum + undoneNum;
|
||||
int completePercent = processHalfUpPercent(completeNum, recordNum);
|
||||
|
@ -408,11 +413,4 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
|||
.divide(BigDecimal.valueOf(total), 2, RoundingMode.HALF_UP)
|
||||
.multiply(BigDecimal.valueOf(100)).intValue();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
int i = BigDecimal.valueOf(0)
|
||||
.divide(BigDecimal.valueOf(10), 2, RoundingMode.HALF_UP)
|
||||
.multiply(BigDecimal.valueOf(100)).intValue();
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,8 +86,8 @@
|
|||
select scale_name as `name`,
|
||||
publish_nums as `value`
|
||||
from sys_scale
|
||||
where status = 1
|
||||
order by publish_nums desc
|
||||
where status = 1 and publish_nums >0
|
||||
order by publish_nums
|
||||
</select>
|
||||
|
||||
<select id="selectPublishNumByGrade" resultType="org.dromara.scale.domain.vo.StatisticNumVo">
|
||||
|
|
Loading…
Reference in New Issue