|
@@ -28,17 +28,13 @@ public class TenantPersonStatServiceImpl extends ServiceImpl<TenantPersonStatMap
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void tenantPersonStatTask() {
|
|
|
Date date = DateUtil.addDays(new Date(), -1);
|
|
|
- String day = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
|
|
|
- this.lambdaUpdate().eq(TenantPersonStat::getDay,day).remove();
|
|
|
String month = DateUtil.format(date,DateUtil.ISO_YEAR_MONTH_FORMAT);
|
|
|
- String year = DateUtil.getYear(date);
|
|
|
+ this.lambdaUpdate().eq(TenantPersonStat::getMonth,month).remove();
|
|
|
//获取初始化数据
|
|
|
List<TenantPersonStat> stats = baseMapper.init();
|
|
|
if(CollectionUtils.isNotEmpty(stats)){
|
|
|
stats.stream().forEach(e->{
|
|
|
- e.setDay(day);
|
|
|
e.setMonth(month);
|
|
|
- e.setYear(year);
|
|
|
});
|
|
|
this.saveBatch(stats);
|
|
|
}
|