Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
e85d5a770b
|
|
@ -92,6 +92,11 @@ public class AppCashController {
|
|||
}
|
||||
}
|
||||
redisUtils.set(intervalKey, true, 30);
|
||||
double money = Double.parseDouble(commonInfoService.findOne(929).getValue());
|
||||
double v = cashOutService.queryUserTodayCashAmount(userId);
|
||||
if ((v + amount) >= money) {
|
||||
return Result.error("今日提现金额已达上限");
|
||||
}
|
||||
Result ret = Result.error();
|
||||
try {
|
||||
ret = cashOutService.withdraw(userId, amount, null, false);
|
||||
|
|
|
|||
|
|
@ -50,4 +50,6 @@ public interface CashOutDao extends BaseMapper<CashOut> {
|
|||
List<CashOut> selectSumByUserIdList(ArrayList<Long> userIdList, Integer state);
|
||||
|
||||
List<CashOut> countByUserIdList(Set<Long> userIdList);
|
||||
|
||||
Double queryUserTodayCashOutSum(@Param("userId") Long userId, @Param("time") String time);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,4 +66,5 @@ public interface CashOutService {
|
|||
|
||||
Result batchCashOutOrder(Double maxMoney, Integer count);
|
||||
|
||||
double queryUserTodayCashAmount(Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -905,6 +905,10 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||
return Result.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double queryUserTodayCashAmount(Long userId) {
|
||||
return baseMapper.queryUserTodayCashOutSum(userId, DateUtil.format(DateUtil.beginOfDay(new Date()), "yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
|
||||
private void batchSendCashMoney(List<Long> userIds, Double maxMoney, Integer count, int len) {
|
||||
if (CollUtil.isEmpty(userIds)) {
|
||||
|
|
|
|||
|
|
@ -207,5 +207,7 @@
|
|||
select format(sum(money),2) from cash_out where state = #{state} and user_id = #{userId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryUserTodayCashOutSum" resultType="double">
|
||||
select format(sum(money),2) from cash_out where state in (1, 3) and user_id = #{userId} and create_at >= #{time}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue