|
@@ -171,6 +171,10 @@ public class TCStatisticsServiceImpl extends ServiceImpl<TCStatisticsMapper, TCS
|
|
for (String batchNo : batchNoSet) {
|
|
for (String batchNo : batchNoSet) {
|
|
List<TCStatisticsTemp> tcStatisticsTempList = tcStatisticsTempService.findByBatchNoJoin(sysUser.getSchoolId(), batchNo);
|
|
List<TCStatisticsTemp> tcStatisticsTempList = tcStatisticsTempService.findByBatchNoJoin(sysUser.getSchoolId(), batchNo);
|
|
if (Objects.nonNull(tcStatisticsTempList) && tcStatisticsTempList.size() > 0) {
|
|
if (Objects.nonNull(tcStatisticsTempList) && tcStatisticsTempList.size() > 0) {
|
|
|
|
+ QueryWrapper<TCStatisticsTemp> tcStatisticsTempQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ tcStatisticsTempQueryWrapper.lambda().eq(TCStatisticsTemp::getBatchNo, batchNo);
|
|
|
|
+ tcStatisticsTempService.remove(tcStatisticsTempQueryWrapper);
|
|
|
|
+
|
|
String batchNoNew = SystemConstant.getUuid();
|
|
String batchNoNew = SystemConstant.getUuid();
|
|
Set<Long> collegeIdSet = new HashSet<>();
|
|
Set<Long> collegeIdSet = new HashSet<>();
|
|
for (TCStatisticsTemp t : tcStatisticsTempList) {
|
|
for (TCStatisticsTemp t : tcStatisticsTempList) {
|
|
@@ -189,6 +193,10 @@ public class TCStatisticsServiceImpl extends ServiceImpl<TCStatisticsMapper, TCS
|
|
List<TCStatisticsDto> tcStatisticsDtoList = this.findByBatchNoCountJoin(sysUser.getSchoolId(), batchNoNew, orgIds);
|
|
List<TCStatisticsDto> tcStatisticsDtoList = this.findByBatchNoCountJoin(sysUser.getSchoolId(), batchNoNew, orgIds);
|
|
if (Objects.nonNull(tcStatisticsDtoList) && tcStatisticsDtoList.size() > 0) {
|
|
if (Objects.nonNull(tcStatisticsDtoList) && tcStatisticsDtoList.size() > 0) {
|
|
TCStatisticsService tcStatisticsService = SpringContextHolder.getBean(TCStatisticsService.class);
|
|
TCStatisticsService tcStatisticsService = SpringContextHolder.getBean(TCStatisticsService.class);
|
|
|
|
+ QueryWrapper<TCStatistics> tcStatisticsQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ tcStatisticsQueryWrapper.lambda().eq(TCStatistics::getBatchNo, batchNo);
|
|
|
|
+ tcStatisticsService.remove(tcStatisticsQueryWrapper);
|
|
|
|
+
|
|
Gson gson = new Gson();
|
|
Gson gson = new Gson();
|
|
List<TCStatistics> tcStatisticsList = gson.fromJson(JacksonUtil.parseJson(tcStatisticsDtoList), new TypeToken<List<TCStatistics>>() {
|
|
List<TCStatistics> tcStatisticsList = gson.fromJson(JacksonUtil.parseJson(tcStatisticsDtoList), new TypeToken<List<TCStatistics>>() {
|
|
}.getType());
|
|
}.getType());
|
|
@@ -201,24 +209,6 @@ public class TCStatisticsServiceImpl extends ServiceImpl<TCStatisticsMapper, TCS
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 删除旧的关联数据
|
|
|
|
- *
|
|
|
|
- * @param batchNoSet
|
|
|
|
- */
|
|
|
|
- @Override
|
|
|
|
- @Transactional
|
|
|
|
- public void removeOldJoinData(Set<String> batchNoSet) {
|
|
|
|
- QueryWrapper<TCStatisticsTemp> tcStatisticsTempQueryWrapper = new QueryWrapper<>();
|
|
|
|
- tcStatisticsTempQueryWrapper.lambda().in(TCStatisticsTemp::getBatchNo, batchNoSet);
|
|
|
|
- tcStatisticsTempService.remove(tcStatisticsTempQueryWrapper);
|
|
|
|
-
|
|
|
|
- TCStatisticsService tcStatisticsService = SpringContextHolder.getBean(TCStatisticsService.class);
|
|
|
|
- QueryWrapper<TCStatistics> tcStatisticsQueryWrapper = new QueryWrapper<>();
|
|
|
|
- tcStatisticsQueryWrapper.lambda().in(TCStatistics::getBatchNo, batchNoSet);
|
|
|
|
- tcStatisticsService.remove(tcStatisticsQueryWrapper);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 刷新数据
|
|
* 刷新数据
|
|
*
|
|
*
|
|
@@ -238,7 +228,6 @@ public class TCStatisticsServiceImpl extends ServiceImpl<TCStatisticsMapper, TCS
|
|
if (redisUtil.lock(SystemConstant.REDIS_LOCK_BATCH_NO_PREFIX + Math.abs(batchNoSet.toString().hashCode()),
|
|
if (redisUtil.lock(SystemConstant.REDIS_LOCK_BATCH_NO_PREFIX + Math.abs(batchNoSet.toString().hashCode()),
|
|
SystemConstant.REDIS_LOCK_BATCH_NO_TIME_OUT)) {
|
|
SystemConstant.REDIS_LOCK_BATCH_NO_TIME_OUT)) {
|
|
tcStatisticsService.freshenJoinData(sysUser, batchNoSet);
|
|
tcStatisticsService.freshenJoinData(sysUser, batchNoSet);
|
|
- tcStatisticsService.removeOldJoinData(batchNoSet);
|
|
|
|
} else {
|
|
} else {
|
|
throw ExceptionResultEnum.ERROR.exception("正在刷新数据,请稍候再试!");
|
|
throw ExceptionResultEnum.ERROR.exception("正在刷新数据,请稍候再试!");
|
|
}
|
|
}
|