Commit 3bd032ed authored by libin's avatar libin

Merge branch 'master-auto-pay' into dev

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