|
|
|
@ -3,6 +3,7 @@ package com.example.demo.serviceImpl.cash; |
|
|
|
import com.example.demo.domain.entity.CashRecord; |
|
|
|
import com.example.demo.domain.vo.cash.CashCollection; |
|
|
|
import com.example.demo.domain.vo.cash.CashRecordDone; |
|
|
|
import com.example.demo.domain.vo.coin.Result; |
|
|
|
import com.example.demo.mapper.cash.CashRefundMapper; |
|
|
|
import com.example.demo.service.cash.RefundService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
@ -37,6 +38,9 @@ public class CashRefundServiceImpl implements RefundService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public int add(CashRecordDone cashRecordDone) throws Exception { |
|
|
|
if(cashRecordDone.getHandlingCharge()== null){ |
|
|
|
throw new Exception("未输入手续费") ; |
|
|
|
} |
|
|
|
if(cashRecordDone.getJwcode()==null){ |
|
|
|
throw new Exception("未输入精网号") ; |
|
|
|
} |
|
|
|
@ -62,6 +66,56 @@ public class CashRefundServiceImpl implements RefundService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public int update(CashRecordDone cashRecordDone) { |
|
|
|
return cashRefundMapper.update(cashRecordDone); |
|
|
|
if (cashRecordDone.getJwcode()== null) { |
|
|
|
throw new RuntimeException("未输入精网号"); |
|
|
|
} |
|
|
|
if (cashRecordDone.getPaymentAmount()== null) { |
|
|
|
throw new RuntimeException("未输入付款金额"); |
|
|
|
} |
|
|
|
if (cashRecordDone.getPaymentCurrency()== null){ |
|
|
|
throw new RuntimeException("未输入付款币种");} |
|
|
|
if (cashRecordDone.getRefundModel()== null) { |
|
|
|
throw new RuntimeException("请填写退款类型"); |
|
|
|
} |
|
|
|
if (cashRecordDone.getRefundReason()== null) { |
|
|
|
throw new RuntimeException("请填写退款理由"); |
|
|
|
} |
|
|
|
int result = cashRefundMapper.update(cashRecordDone); |
|
|
|
return (result > 0 ? Result.success("重新提交成功") : Result.error("重新提交失败")).getCode(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public int withdraw(CashRecordDone cashRecordDone) { |
|
|
|
return cashRefundMapper.withdraw(cashRecordDone.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public int review(CashRecordDone cashRecordDone) { |
|
|
|
int result = cashRefundMapper.review(cashRecordDone); |
|
|
|
return (result > 0 ? Result.success("重新提交成功") : Result.error("重新提交失败")).getCode(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public int executor(CashRecordDone cashRecordDone) { |
|
|
|
if(cashRecordDone.getRefundVoucher()== null){ |
|
|
|
throw new RuntimeException("未输入退款凭证"); |
|
|
|
} |
|
|
|
if(cashRecordDone.getRefundTime()== null){ |
|
|
|
throw new RuntimeException("未输入退款时间"); |
|
|
|
} |
|
|
|
if(cashRecordDone.getRefundRemark()== null){ |
|
|
|
throw new RuntimeException("未输入退款备注"); |
|
|
|
} |
|
|
|
if(cashRecordDone.getRefundChannels()== null){ |
|
|
|
throw new RuntimeException("未输入退款途径"); |
|
|
|
} |
|
|
|
if(cashRecordDone.getRefundCurrency()== null){ |
|
|
|
throw new RuntimeException("未输入退款币种"); |
|
|
|
} |
|
|
|
if(cashRecordDone.getRefundAmount()== null){ |
|
|
|
throw new RuntimeException("未输入退款金额"); |
|
|
|
} |
|
|
|
int result = cashRefundMapper.executor(cashRecordDone); |
|
|
|
return (result > 0 ? Result.success("重新提交成功") : Result.error("重新提交失败")).getCode(); |
|
|
|
} |
|
|
|
} |