Commit 05e16e40 authored by hezhen's avatar hezhen

123

parent 5b8e8fa1
...@@ -214,7 +214,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> { ...@@ -214,7 +214,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
//每日次数 //每日次数
Integer maxNumberOfDay=ruleVo.getMaxNumberOfDay()==null?0:ruleVo.getMaxNumberOfDay(); Integer maxNumberOfDay=ruleVo.getMaxNumberOfDay()==null?0:ruleVo.getMaxNumberOfDay();
//查询当日次数和金额 //查询当日次数和金额
sumDto=myWalletCathBiz.sumCathAmount(1); sumDto=myWalletCathBiz.sumCathAmount(userId,1);
BigDecimal ramount=amount.add(sumDto.getSumAmount()); BigDecimal ramount=amount.add(sumDto.getSumAmount());
if (amountOfDay.compareTo(BigDecimal.ZERO)>0&&ramount.compareTo(amountOfDay)>0){ if (amountOfDay.compareTo(BigDecimal.ZERO)>0&&ramount.compareTo(amountOfDay)>0){
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "提现金额超过日额度"+amountOfDay+"元"); return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "提现金额超过日额度"+amountOfDay+"元");
...@@ -230,7 +230,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> { ...@@ -230,7 +230,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
Integer maxNumberOfMonth=ruleVo.getMaxNumberOfMonth(); Integer maxNumberOfMonth=ruleVo.getMaxNumberOfMonth();
//查询当月次数和金额 //查询当月次数和金额
sumDto=myWalletCathBiz.sumCathAmount(2); sumDto=myWalletCathBiz.sumCathAmount(userId,2);
BigDecimal yamount=amount.add(sumDto.getSumAmount()); BigDecimal yamount=amount.add(sumDto.getSumAmount());
if (amountOfMonth.compareTo(BigDecimal.ZERO)>0&&yamount.compareTo(amountOfMonth)>0){ if (amountOfMonth.compareTo(BigDecimal.ZERO)>0&&yamount.compareTo(amountOfMonth)>0){
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "提现金额超过月额度"+amountOfMonth+"元"); return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "提现金额超过月额度"+amountOfMonth+"元");
......
...@@ -122,7 +122,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> { ...@@ -122,7 +122,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
return userIdAndPersonalConsumptionMap; return userIdAndPersonalConsumptionMap;
} }
public WalletCathSumDto sumCathAmount(Integer type){ public WalletCathSumDto sumCathAmount(Integer userId,Integer type){
return mapper.sumCathAmount(type); return mapper.sumCathAmount(userId,type);
} }
} }
...@@ -29,5 +29,5 @@ public interface MyWalletCathMapper extends Mapper<MyWalletCath> { ...@@ -29,5 +29,5 @@ public interface MyWalletCathMapper extends Mapper<MyWalletCath> {
* @param type 1-日;2-月 * @param type 1-日;2-月
* @return * @return
*/ */
WalletCathSumDto sumCathAmount(@Param("type") int type); WalletCathSumDto sumCathAmount(@Param("userId") Integer userId,@Param("type") int type);
} }
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<select id="sumCathAmount" resultType="com.github.wxiaoqi.security.admin.dto.WalletCathSumDto"> <select id="sumCathAmount" resultType="com.github.wxiaoqi.security.admin.dto.WalletCathSumDto">
select IFNULL(SUM(amount),0) as sumAmount,COUNT(*) as `number` from my_wallet_cath select IFNULL(SUM(amount),0) as sumAmount,COUNT(*) as `number` from my_wallet_cath
<where> <where>
user_id=#{userId} and stauts in(0,1)
<choose> <choose>
<when test="type ==1 "> <when test="type ==1 ">
AND date_format(from_unixtime(crt_time/1000),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') AND date_format(from_unixtime(crt_time/1000),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment