提交 4f1aea08 作者: xiaowang

打印日志

上级 a49526b4
...@@ -7,6 +7,7 @@ import com.mmc.iuav.user.entity.wallet.WithdrawalLogDO; ...@@ -7,6 +7,7 @@ import com.mmc.iuav.user.entity.wallet.WithdrawalLogDO;
import com.mmc.iuav.user.model.qo.wallet.WalletFlowQO; import com.mmc.iuav.user.model.qo.wallet.WalletFlowQO;
import com.mmc.iuav.user.model.qo.wallet.WithdrawalApplyQO; import com.mmc.iuav.user.model.qo.wallet.WithdrawalApplyQO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -35,7 +36,7 @@ public interface PayWalletDao { ...@@ -35,7 +36,7 @@ public interface PayWalletDao {
List<WithdrawalLogDO> getWithdrawalListByUserAccountId(WalletFlowQO param); List<WithdrawalLogDO> getWithdrawalListByUserAccountId(WalletFlowQO param);
XzWithdrawalApplyDO getWithdrawalApplyById(Integer id); XzWithdrawalApplyDO getWithdrawalApplyByIdOrOuterTradeNo(@Param(value = "id") Integer id, @Param(value = "outerTradeNo") String outerTradeNo);
List<WithdrawalLogDO> listPayWithdrawalLog(Integer id); List<WithdrawalLogDO> listPayWithdrawalLog(Integer id);
......
...@@ -86,28 +86,33 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -86,28 +86,33 @@ public class PayWalletServiceImpl implements PayWalletService {
} }
// 判断状态进行资金的扣减等于100时 发布订单 // 判断状态进行资金的扣减等于100时 发布订单
if (publisherWalletFlowVO != null && publisherWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.PUBLISH_ORDER.getCode())) { if (publisherWalletFlowVO != null && publisherWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.PUBLISH_ORDER.getCode())) {
PayWalletDO publishUpdatePayWallet = new PayWalletDO(); if (publisherWalletFlowVO.getCashAmount().compareTo(new BigDecimal(0)) > 0 ||
publishUpdatePayWallet.setUserAccountId(publisherWalletFlowVO.getUserAccountId()); publisherWalletFlowVO.getSalaryAmount().compareTo(new BigDecimal(0)) > 0) {
publishUpdatePayWallet.setPid(publishWallet.getPid()); PayWalletDO publishUpdatePayWallet = new PayWalletDO();
publishUpdatePayWallet.setCashAmt(publishWallet.getCashAmt().add(publisherWalletFlowVO.getCashAmount()) publishUpdatePayWallet.setUserAccountId(publisherWalletFlowVO.getUserAccountId());
.add(publisherWalletFlowVO.getTopYxjAmount()).add(publisherWalletFlowVO.getUrgentYxjAmount())); publishUpdatePayWallet.setPid(publishWallet.getPid());
publishUpdatePayWallet.setCashFreeze(publishWallet.getCashFreeze().subtract(publisherWalletFlowVO.getCashAmount()) publishUpdatePayWallet.setCashAmt(publishWallet.getCashAmt().add(publisherWalletFlowVO.getCashAmount())
.subtract(publisherWalletFlowVO.getTopYxjAmount()).subtract(publisherWalletFlowVO.getUrgentYxjAmount())); .add(publisherWalletFlowVO.getTopYxjAmount()).add(publisherWalletFlowVO.getUrgentYxjAmount()));
publishUpdatePayWallet.setSalaryAmt(publishWallet.getSalaryAmt().add(publisherWalletFlowVO.getSalaryAmount()) publishUpdatePayWallet.setCashFreeze(publishWallet.getCashFreeze().subtract(publisherWalletFlowVO.getCashAmount())
.add(publisherWalletFlowVO.getTopSalaryAmount()).add(publisherWalletFlowVO.getUrgentSalaryAmount())); .subtract(publisherWalletFlowVO.getTopYxjAmount()).subtract(publisherWalletFlowVO.getUrgentYxjAmount()));
publishUpdatePayWallet.setSalaryFreeze(publishWallet.getSalaryFreeze().subtract(publisherWalletFlowVO.getSalaryAmount()) publishUpdatePayWallet.setSalaryAmt(publishWallet.getSalaryAmt().add(publisherWalletFlowVO.getSalaryAmount())
.subtract(publisherWalletFlowVO.getTopSalaryAmount()).subtract(publisherWalletFlowVO.getUrgentSalaryAmount())); .add(publisherWalletFlowVO.getTopSalaryAmount()).add(publisherWalletFlowVO.getUrgentSalaryAmount()));
int i = payWalletDao.updatePayWallet(publishUpdatePayWallet); publishUpdatePayWallet.setSalaryFreeze(publishWallet.getSalaryFreeze().subtract(publisherWalletFlowVO.getSalaryAmount())
if (i > 0) { .subtract(publisherWalletFlowVO.getTopSalaryAmount()).subtract(publisherWalletFlowVO.getUrgentSalaryAmount()));
PayLogDO payLogDO = buildPayLogDO(publisherWalletFlowVO, null); int i = payWalletDao.updatePayWallet(publishUpdatePayWallet);
payLogDO.setCashAmtPaid(publisherWalletFlowVO.getCashAmount().add(publisherWalletFlowVO.getTopYxjAmount()).add(publisherWalletFlowVO.getUrgentYxjAmount())); if (i > 0) {
payLogDO.setSalaryAmtPaid(publisherWalletFlowVO.getSalaryAmount().add(publisherWalletFlowVO.getTopSalaryAmount()).add(publisherWalletFlowVO.getUrgentSalaryAmount())); PayLogDO payLogDO = buildPayLogDO(publisherWalletFlowVO, null);
// 插入流水记录表 payLogDO.setCashAmtPaid(publisherWalletFlowVO.getCashAmount().add(publisherWalletFlowVO.getTopYxjAmount()).add(publisherWalletFlowVO.getUrgentYxjAmount()));
payWalletDao.insertPayLogDO(payLogDO); payLogDO.setSalaryAmtPaid(publisherWalletFlowVO.getSalaryAmount().add(publisherWalletFlowVO.getTopSalaryAmount()).add(publisherWalletFlowVO.getUrgentSalaryAmount()));
return ResultBody.success(); // 插入流水记录表
payWalletDao.insertPayLogDO(payLogDO);
return ResultBody.success();
} else {
log.error("发布订单时,用户钱包更新失败,用户id是:{},传入参数是:{}", publisherWalletFlowVO.getUserAccountId(), publisherWalletFlowVO);
return ResultBody.error("钱包操作错误");
}
} else { } else {
log.error("发布订单时,用户钱包更新失败,用户id是:{},传入参数是:{}", publisherWalletFlowVO.getUserAccountId(), publisherWalletFlowVO); return ResultBody.success();
return ResultBody.error("钱包操作错误");
} }
} else if (publisherWalletFlowVO != null && publisherWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.CANCEL_ORDER_TAKING.getCode())) { } else if (publisherWalletFlowVO != null && publisherWalletFlowVO.getModeOfPayment().equals(PayMethodEnums.CANCEL_ORDER_TAKING.getCode())) {
// 等于200时 发布方取消订单,无飞手接单 // 等于200时 发布方取消订单,无飞手接单
...@@ -502,7 +507,7 @@ public class PayWalletServiceImpl implements PayWalletService { ...@@ -502,7 +507,7 @@ public class PayWalletServiceImpl implements PayWalletService {
PayLogDO payLogDO = payWalletDao.getPayLogById(id); PayLogDO payLogDO = payWalletDao.getPayLogById(id);
return ResultBody.success(payLogDO.buildUserBillingDetailVO()); return ResultBody.success(payLogDO.buildUserBillingDetailVO());
} else { } else {
XzWithdrawalApplyDO apply = payWalletDao.getWithdrawalApplyById(id); XzWithdrawalApplyDO apply = payWalletDao.getWithdrawalApplyByIdOrOuterTradeNo(id, null);
UserBillingDetailVO detail = apply.buildUserBillingDetailVO(); UserBillingDetailVO detail = apply.buildUserBillingDetailVO();
List<WithdrawalLogDO> rebates = payWalletDao.listPayWithdrawalLog(apply.getId()); List<WithdrawalLogDO> rebates = payWalletDao.listPayWithdrawalLog(apply.getId());
detail.buildSchedules(rebates); detail.buildSchedules(rebates);
......
...@@ -165,7 +165,7 @@ public class WithdrawalServiceImpl implements WithdrawalService { ...@@ -165,7 +165,7 @@ public class WithdrawalServiceImpl implements WithdrawalService {
} }
// 查询申请单信息 // 查询申请单信息
XzWithdrawalApplyDO applyInfo = payWalletDao.getWithdrawalApplyById(id); XzWithdrawalApplyDO applyInfo = payWalletDao.getWithdrawalApplyByIdOrOuterTradeNo(id, null);
if (applyInfo == null) { if (applyInfo == null) {
return ResultBody.error(ResultEnum.WITHDRAWAL_INFO_NOT_FIND_ERROR); return ResultBody.error(ResultEnum.WITHDRAWAL_INFO_NOT_FIND_ERROR);
} }
......
...@@ -266,12 +266,13 @@ public class XzServiceImpl implements XzService { ...@@ -266,12 +266,13 @@ public class XzServiceImpl implements XzService {
@Override @Override
public String xzWithdrawNotify(JSONObject notify) { public String xzWithdrawNotify(JSONObject notify) {
log.info("xzWithdrawNotify获取到的推送结果:{}", notify.toString()); log.info("xzWithdrawNotify获取到的推送结果:{}", notify.toString());
// TODO 会受到两次回调 if ("T".equals(notify.get("isSuccess").toString())) {
if (notify.get("isSuccess").toString().equals("T")) {
String s = decrypt(com.alibaba.fastjson2.JSONObject.parseObject(notify.get("data").toString()).get("bizAESContent").toString()); String s = decrypt(com.alibaba.fastjson2.JSONObject.parseObject(notify.get("data").toString()).get("bizAESContent").toString());
WithdrawalResp.Data data = com.alibaba.fastjson2.JSONObject.parseObject(s, WithdrawalResp.Data.class); WithdrawalResp.Data data = com.alibaba.fastjson2.JSONObject.parseObject(s, WithdrawalResp.Data.class);
// TODO 判断是否已经处理,处理过就不用处理了 log.info("提现回调解密数据内容:{}", data);
if (data.getNotifyType().equals("submitResult")) { // 获取用户提现申请信息
XzWithdrawalApplyDO withdrawCashApplyDetails = payWalletDao.getWithdrawalApplyByIdOrOuterTradeNo(null, data.getOuterTradeNo());
if ("submitResult".equals(data.getNotifyType())) {
// 对上报的数据进行业务校验,例如:是否超限、是否有余额、是否有电签、参数是否准确等等前置校验。如果校验成功,订单进入待发队列等待发放 // 对上报的数据进行业务校验,例如:是否超限、是否有余额、是否有电签、参数是否准确等等前置校验。如果校验成功,订单进入待发队列等待发放
log.info("deal submitResult"); log.info("deal submitResult");
// 根据订单编号修改信息 // 根据订单编号修改信息
...@@ -281,13 +282,15 @@ public class XzServiceImpl implements XzService { ...@@ -281,13 +282,15 @@ public class XzServiceImpl implements XzService {
xzWithdrawalApplyDO.setTradeResult(data.getTradeResult()); xzWithdrawalApplyDO.setTradeResult(data.getTradeResult());
xzWithdrawalApplyDO.setTaxFundId(userSystemConstant.getTaxFundId()); xzWithdrawalApplyDO.setTaxFundId(userSystemConstant.getTaxFundId());
payWalletDao.updateWithdrawalApply(xzWithdrawalApplyDO); payWalletDao.updateWithdrawalApply(xzWithdrawalApplyDO);
} else if (data.getNotifyType().equals("tradeResult")) { } else if ("tradeResult".equals(data.getNotifyType())) {
// 根据银行\微信\支付宝的反馈,推送订单的发放结果,发放成功\发放失败 // 根据银行\微信\支付宝的反馈,推送订单的发放结果,发放成功\发放失败
// todo 待处理 // todo 待处理
log.info("deal tradeResult"); log.info("deal tradeResult");
} }
} else { } else {
log.info("xzWithdrawNotify fail:{}", notify); log.info("xzWithdrawNotify fail:{}", notify);
} }
return "success"; return "success";
} }
......
...@@ -50,6 +50,7 @@ public class WithdrawalResp { ...@@ -50,6 +50,7 @@ public class WithdrawalResp {
private String tradeTime; private String tradeTime;
private String frontLogNo; private String frontLogNo;
private String tradeResult; private String tradeResult;
private String tradeFailCode;
public Data() { public Data() {
} }
...@@ -166,5 +167,12 @@ public class WithdrawalResp { ...@@ -166,5 +167,12 @@ public class WithdrawalResp {
this.tradeResult = tradeResult; this.tradeResult = tradeResult;
} }
public String getTradeFailCode() {
return tradeFailCode;
}
public void setTradeFailCode(String tradeFailCode) {
this.tradeFailCode = tradeFailCode;
}
} }
} }
...@@ -217,38 +217,45 @@ ...@@ -217,38 +217,45 @@
order by create_time DESC order by create_time DESC
limit #{pageNo},#{pageSize} limit #{pageNo},#{pageSize}
</select> </select>
<select id="getWithdrawalApplyById" resultType="com.mmc.iuav.user.entity.XzWithdrawalApplyDO"> <select id="getWithdrawalApplyByIdOrOuterTradeNo" resultType="com.mmc.iuav.user.entity.XzWithdrawalApplyDO">
select id, select id,
user_account_id, user_account_id,
bank_name, bank_name,
bank_remo, bank_remo,
emp_num, emp_num,
emp_name, emp_name,
emp_phone, emp_phone,
license_id, license_id,
license_type, license_type,
`month`, `month`,
notify_url, notify_url,
outer_trade_no, outer_trade_no,
pay_account, pay_account,
pay_amount, pay_amount,
position_name, position_name,
remarks, remarks,
settle_type, settle_type,
tax_fund_id, tax_fund_id,
wechat_app_id, wechat_app_id,
trade_status, trade_status,
trade_time, trade_time,
front_log_no, front_log_no,
trade_fail_code, trade_fail_code,
trade_result, trade_result,
submit_status, submit_status,
error_code, error_code,
error_message, error_message,
charge_amount, charge_amount,
create_time create_time
from xz_withdrawal_apply from xz_withdrawal_apply
where id = #{id} <where>
<if test="id != null">
id = #{id}
</if>
<if test="outerTradeNo != null and outerTradeNo != ''">
outer_trade_no = #{outerTradeNo}
</if>
</where>
</select> </select>
<select id="listPayWithdrawalLog" resultType="com.mmc.iuav.user.entity.wallet.WithdrawalLogDO"> <select id="listPayWithdrawalLog" resultType="com.mmc.iuav.user.entity.wallet.WithdrawalLogDO">
select id, select id,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论