123
This commit is contained in:
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
@@ -42,7 +43,8 @@ public class DayIncomeStatisticsController extends BaseController {
|
||||
@SaCheckPermission("cai:dayIncomeStatistics:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<DayIncomeStatistics> list(DayIncomeStatistics bo, PageQuery pageQuery) {
|
||||
Page<DayIncomeStatistics> page = dayIncomeStatisticsService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||
Page<DayIncomeStatistics> page = dayIncomeStatisticsService.page(pageQuery.build(),
|
||||
Wrappers.lambdaQuery(bo).orderByDesc(DayIncomeStatistics::getDate));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@@ -58,6 +60,22 @@ public class DayIncomeStatisticsController extends BaseController {
|
||||
return R.ok(dayIncomeStatisticsService.getById(id));
|
||||
}
|
||||
|
||||
@Log(title = "刷新单天统计", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/refreshToday")
|
||||
public R<Void> refreshToday() {
|
||||
dayIncomeStatisticsService.refreshByDate(LocalDate.now());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Log(title = "刷新昨日统计", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/refreshLastDay")
|
||||
public R<Void> refreshLastDay() {
|
||||
dayIncomeStatisticsService.refreshByDate(LocalDate.now().plusDays(-1));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增每日账单统计
|
||||
*/
|
||||
|
||||
@@ -28,4 +28,6 @@ public class LowHeightRiskAdminVo extends LowHeightRisk {
|
||||
* 性别 0 未知 1 女 2 男
|
||||
*/
|
||||
private Integer gender;
|
||||
|
||||
private String lastLoginIp;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.time.LocalDate;
|
||||
public class IncomeStatisticsJob {
|
||||
@Autowired
|
||||
private DayIncomeStatisticsService dayIncomeStatisticsService;
|
||||
@Scheduled(cron = "0 0/6 * * * ? *")
|
||||
@Scheduled(cron = "0 0/6 * * * ?")
|
||||
public void persistentDb() {
|
||||
try {
|
||||
dayIncomeStatisticsService.refreshByDate(LocalDate.now());
|
||||
|
||||
@@ -58,18 +58,26 @@ public class DayIncomeStatisticsServiceImpl extends ServiceImpl<DayIncomeStatist
|
||||
RechargeOrderCountDTO recharge = rechargeOrderMapper.incomeStatistics(startTime,endTime);
|
||||
VipOrderCountDTO vip = vipOrderMapper.incomeStatistics(startTime,endTime);
|
||||
AccountCashCountDTO cash = accountCashMapper.incomeStatistics(startTime,endTime);
|
||||
one = new DayIncomeStatistics();
|
||||
one.setExpInMoney(recharge.getExpInMoney()==null? BigDecimal.ZERO:recharge.getExpInMoney());
|
||||
one.setOrderCount(recharge.getOrderCount()==null?0:recharge.getOrderCount());
|
||||
one.setOutMoney(cash.getCashMoney()==null?BigDecimal.ZERO:cash.getCashMoney());
|
||||
one.setCashCount(cash.getCashCount()==null?0:cash.getCashCount());
|
||||
one.setVipInMoney(vip.getVipMoney()==null?BigDecimal.ZERO:vip.getVipMoney());
|
||||
one.setVipCount(vip.getVipCount()==null?0:vip.getVipCount());
|
||||
one.setModifyCoinAdd(recharge.getModifyCoinAdd()==null?0:recharge.getModifyCoinAdd());
|
||||
one.setModifyCoinSub(recharge.getModifyCoinSub()==null?0:recharge.getModifyCoinSub());
|
||||
one.setModifyIncomeAdd(recharge.getModifyIncomeAdd()==null?0:recharge.getModifyIncomeAdd());
|
||||
one.setModifyIncomeSub(recharge.getModifyIncomeSub()==null?0:recharge.getModifyIncomeSub());
|
||||
this.updateById(one);
|
||||
DayIncomeStatistics update = new DayIncomeStatistics();
|
||||
update.setId(one.getId());
|
||||
if(recharge != null){
|
||||
update.setExpInMoney(recharge.getExpInMoney()==null? BigDecimal.ZERO:recharge.getExpInMoney());
|
||||
update.setOrderCount(recharge.getOrderCount()==null?0:recharge.getOrderCount());
|
||||
update.setModifyCoinAdd(recharge.getModifyCoinAdd()==null?0:recharge.getModifyCoinAdd());
|
||||
update.setModifyCoinSub(recharge.getModifyCoinSub()==null?0:recharge.getModifyCoinSub());
|
||||
update.setModifyIncomeAdd(recharge.getModifyIncomeAdd()==null?0:recharge.getModifyIncomeAdd());
|
||||
update.setModifyIncomeSub(recharge.getModifyIncomeSub()==null?0:recharge.getModifyIncomeSub());
|
||||
}
|
||||
if(cash != null){
|
||||
update.setOutMoney(cash.getCashMoney()==null?BigDecimal.ZERO:cash.getCashMoney());
|
||||
update.setCashCount(cash.getCashCount()==null?0:cash.getCashCount());
|
||||
}
|
||||
if(vip != null){
|
||||
update.setVipInMoney(vip.getVipMoney()==null?BigDecimal.ZERO:vip.getVipMoney());
|
||||
update.setVipCount(vip.getVipCount()==null?0:vip.getVipCount());
|
||||
}
|
||||
update.setUpdateTime(LocalDateTime.now());
|
||||
this.updateById(update);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user