Пример #1
0
 /**
  * [创建一个支付报名费纪录信息]
  *
  * @param financeAccountDetail [需要创建的充值纪录实例]
  * @return
  * @throws Exception
  */
 public boolean createEntryFreeDetail(FinanceAccountDetail financeAccountDetail) throws Exception {
   // 申明变量
   boolean flag = false;
   // 检查参数合法性
   if (null == financeAccountDetail) {
     throw new ParamErrorException(ServiceErrorCodeConstant.E0038);
   } else {
     // 预设信息
     financeAccountDetail.setType(FinanceAccountDetailTypeEnum.ENTRY_FREE.getCode());
     financeAccountDetail.setStatus(FinanceAccountDetailStatusEnum.PASS_JUDGEMENT.getCode());
     // 默认正常
     financeAccountDetail.setDstatus(DataStatusEnum.NORMAL.getCode());
     financeAccountDetail.setRequireJudgement(YesOrNoEnum.NO.getCode());
     // 执行保存操作
     this.createFinanceAccountDetail(financeAccountDetail);
     flag = true;
   }
   return flag;
 }
Пример #2
0
 /**
  * [审核充值记录]
  *
  * @param financeAccountDetailId [充值记录实例]
  * @param flag [是否通过标志]
  * @return
  * @throws Exception
  */
 public boolean judgeFinanceAccountDetail(Integer financeAccountDetailId, boolean flag)
     throws Exception {
   // 申明变量
   FinanceAccountDetail detail = null;
   boolean result = false;
   // 判断参数合法性
   if (NumberUtil.isEmptyOrZero(financeAccountDetailId)) {
     throw new ParamErrorException(ServiceErrorCodeConstant.E0044);
   } else {
     // 获取指定的账户和明细信息
     detail = this.hibernateTemplate.load(FinanceAccountDetail.class, financeAccountDetailId);
     if (YesOrNoEnum.YES.getCode().equals(detail.getRequireJudgement())) {
       if (FinanceAccountDetailTypeEnum.RECHARGE.getCode().equals(detail.getType())) { // 如果是审核记录
         if (flag) { // 如果审核通过
           detail.setStatus(FinanceAccountDetailStatusEnum.PASS_JUDGEMENT.getCode());
           this.changeFinanceAccountMoney(
               detail.getAccountId(),
               true,
               FinanceAccountMoneyTypeEnum.CANUSE.getCode(),
               detail.getPrice());
           this.changeFinanceAccountMoney(
               detail.getAccountId(),
               false,
               FinanceAccountMoneyTypeEnum.FROZEN.getCode(),
               detail.getPrice());
         } else { // 如果审核未通过
           detail.setStatus(FinanceAccountDetailStatusEnum.REFUSE_JUDGEMENT.getCode());
           this.changeFinanceAccountMoney(
               detail.getAccountId(),
               false,
               FinanceAccountMoneyTypeEnum.FROZEN.getCode(),
               detail.getPrice());
         }
         result = true;
       } else if (FinanceAccountDetailTypeEnum.WITHDRAW.getCode().equals(detail.getType())) {
         if (flag) { // 如果审核通过
           detail.setStatus(FinanceAccountDetailStatusEnum.PASS_JUDGEMENT.getCode());
           this.changeFinanceAccountMoney(
               detail.getAccountId(),
               false,
               FinanceAccountMoneyTypeEnum.FROZEN.getCode(),
               detail.getPrice());
         } else { // 如果审核未通过
           detail.setStatus(FinanceAccountDetailStatusEnum.REFUSE_JUDGEMENT.getCode());
           this.changeFinanceAccountMoney(
               detail.getAccountId(),
               true,
               FinanceAccountMoneyTypeEnum.CANUSE.getCode(),
               detail.getPrice());
           this.changeFinanceAccountMoney(
               detail.getAccountId(),
               false,
               FinanceAccountMoneyTypeEnum.FROZEN.getCode(),
               detail.getPrice());
         }
         result = true;
       }
     }
   }
   return result;
 }