nili 7 months ago
parent
commit
5d42b3b173
  1. 8
      game-dao/src/main/java/awesome/group/game/dao/mapper/MatrixMoneyRecordMapper.java
  2. 2
      game-service/src/main/java/awesome/group/game/service/citrus/ScheduleService.java

8
game-dao/src/main/java/awesome/group/game/dao/mapper/MatrixMoneyRecordMapper.java

@ -25,6 +25,14 @@ public interface MatrixMoneyRecordMapper extends BaseMapper<MatrixMoneyRecord> {
@Update("update matrix_money_record set status = #{status}, reason=#{reason} where id = #{id}")
int updateStatusAndReason(int id, int status, String reason);
@Update("update matrix_money_record set status = #{r.status}, " +
"reason = #{r.reason}, " +
"order_id = #{r.orderId}, " +
"pay_fund_order_id = #{r.payFundOrderId}, " +
"trans_date = #{r.transDate} " +
"where id = #{id}")
int updateTransResult(int id, MatrixMoneyRecord r);
@Select("select * from matrix_money_record where user_id = #{userId}")
List<MatrixMoneyRecord> queryByUserId(Integer userId);
}

2
game-service/src/main/java/awesome/group/game/service/citrus/ScheduleService.java

@ -30,7 +30,7 @@ public class ScheduleService {
continue;
}
boolean success = aliTransfer.transfer(r);
moneyRecordMapper.updateStatusAndReason(r.getId(), r.getStatus(), r.getReason());
moneyRecordMapper.updateTransResult(r.getId(), r);
if (!success) {
userMapper.incMoney(r.getUserId(), -r.getCent());
}

Loading…
Cancel
Save