|
|
@@ -31,6 +31,7 @@ import com.ruoyi.user.domain.UserThirdIdentity;
|
|
|
import com.ruoyi.user.enums.UserThirdType;
|
|
|
import com.ruoyi.user.service.IUserService;
|
|
|
import com.ruoyi.user.service.IUserThirdIdentityService;
|
|
|
+import com.wechat.pay.java.service.refund.model.Status;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -261,22 +262,33 @@ public class WithdrawServiceImpl implements IWithdrawService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void transferCallback(HttpServletRequest request) throws GeneralSecurityException, IOException {
|
|
|
-
|
|
|
- WxTransferDataDTO wxTransferDataDTO = transferService.transferCallback(request);
|
|
|
- if(ObjectUtil.isNotNull(wxTransferDataDTO)){
|
|
|
- String outBillNo = wxTransferDataDTO.getOutBillNo();
|
|
|
- Withdraw withdraw = this.loadByBusinessCode(outBillNo);
|
|
|
- //如果打款成功
|
|
|
- withdraw.setRemitStatus(RemitStatus.REMIT);
|
|
|
- withdraw.setRemitTime(new Date());
|
|
|
- withdraw.setRemitMan("系统");
|
|
|
- withdraw.setVerifyMan("系统");
|
|
|
- this.baseMapper.updateById( withdraw);
|
|
|
- billService.outBill(withdraw.getIdentityId(),
|
|
|
- String.format("会员提现:%s,提现单号:%s", withdraw.getMoney(),withdraw.getBusinessCode()),
|
|
|
- UserBillType.WITHDRAW,
|
|
|
- withdraw.getMoney(), withdraw.getBusinessCode(),"系统");
|
|
|
+ public void transferCallback(HttpServletRequest request){
|
|
|
+ try{
|
|
|
+ WxTransferDataDTO wxTransferDataDTO = transferService.transferCallback(request);
|
|
|
+ if(ObjectUtil.isNotNull(wxTransferDataDTO)){
|
|
|
+ String state = wxTransferDataDTO.getState();
|
|
|
+ String outBillNo = wxTransferDataDTO.getOutBillNo();
|
|
|
+ Withdraw withdraw = this.loadByBusinessCode(outBillNo);
|
|
|
+ if(Status.SUCCESS.equals(state)){
|
|
|
+ //如果打款成功
|
|
|
+ withdraw.setRemitStatus(RemitStatus.REMIT);
|
|
|
+ withdraw.setRemitTime(new Date());
|
|
|
+ withdraw.setRemitMan("系统");
|
|
|
+ withdraw.setVerifyMan("系统");
|
|
|
+ this.baseMapper.updateById( withdraw);
|
|
|
+ billService.outBill(withdraw.getIdentityId(),
|
|
|
+ String.format("会员提现:%s,提现单号:%s", withdraw.getMoney(),withdraw.getBusinessCode()),
|
|
|
+ UserBillType.WITHDRAW,
|
|
|
+ withdraw.getMoney(), withdraw.getBusinessCode(),"系统");
|
|
|
+ }else{
|
|
|
+ //转账失败
|
|
|
+ withdraw.setRemitStatus(RemitStatus.REMIT_FAILED);
|
|
|
+ this.baseMapper.updateById( withdraw);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (IOException | GeneralSecurityException e){
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new ServiceException(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|