提交 4f1aea08 作者: xiaowang

打印日志

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