Commit da9b475f authored by libin's avatar libin

提现

parent 5670a68a
......@@ -17,10 +17,12 @@ import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import com.github.wxiaoqi.security.common.constant.UserConstant;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.ClientUtil;
import com.github.wxiaoqi.security.common.util.OrderUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.app.entity.vo.WithDrawRuleVo;
import com.xxfc.platform.app.feign.ConfigFeign;
import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.universal.vo.FundPayVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
......@@ -91,6 +93,9 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
@Autowired
RabbitTemplate rabbitTemplate;
@Autowired
private ThirdFeign thirdFeign;
private Snowflake snowflake;
private DateTimeFormatter dateTimeFormatter;
......@@ -385,11 +390,14 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数不能为空");
}
MyWalletCath cath = myWalletCathBiz.selectById(cathId);
cath.getUserId();
if (cath == null) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "提现记录不存在");
}
if (cath.getStauts() == WithDrawStatusEnum.AUDIT.getCode()){
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "提现记录已审核");
}
Integer userId = cath.getUserId();
MyWallet wallet = new MyWallet();
wallet.setUserId(userId);
......@@ -404,16 +412,24 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
}else {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String host = StringUtils.defaultIfBlank(request.getHeader("userHost"), ClientUtil.getClientIp(request));
String cono = OrderUtil.GetOrderNumber("");
FundPayVo fundPayVo = FundPayVo.builder()
.amount(cath.getCathType() == 0 ? String.valueOf(cath.getRealAmount().multiply(new BigDecimal(100)).doubleValue()) : String.format("%.2f", cath.getRealAmount().doubleValue()))
.payeeAccount(cath.getAccountNumber())
.orderNo(cath.getOrderNo())
.orderNo(cono)
.payerShowName("欣新房车网络科技(广东)股份有限公司")
.remark("提现转账")
.type(cath.getCathType())
.creatIp(host)
.build();
sendPayMessage(fundPayVo);
ObjectRestResponse<String> response = thirdFeign.transferAccount(fundPayVo);
if (response.getStatus() == 200){
withDrawProcess(cath.getOrderNo(),response.getData(),"",true);
}else {
withDrawProcess(cath.getOrderNo(),response.getData(),response.getMessage(),false);
}
log.info("发送提现消息成功:【{}】", fundPayVo);
}
} else {
......
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