提交 ce388fa0 作者: 张小凤

Requirements(update)

上级 d476659a
......@@ -185,4 +185,6 @@ public interface RequirementsDao {
void updateOrderEarnings(BigDecimal orderAmount, Integer id);
void updatePlatformorderAmount(BigDecimal bigDecimal2, Integer id);
RequirementsServiceDO serviceReq(Integer requirementsInfoId);
}
......@@ -939,6 +939,8 @@ public class RequirementsServiceImpl implements RequirementsService {
@Override
public ResultBody publisherCancel(Integer requirementsInfoId, Integer userAccountId, HttpServletRequest request) {
RequirementsInfoDO requirementsInfoDO = requirementsDao.publisherCancel(requirementsInfoId, userAccountId);
RequirementsServiceDO serviceDO = requirementsDao.serviceReq(requirementsInfoId);
IsNullConvertZeroUtil.checkIsNull(serviceDO);
if (requirementsInfoDO == null) {
return ResultBody.error("当前订单不存在");
}
......@@ -995,7 +997,8 @@ public class RequirementsServiceImpl implements RequirementsService {
BigDecimal refundWeChat = new BigDecimal(0);
//微信支付金额大于需要退款金额
if (weChat.compareTo(residueOrderAmount) == 1) {
refundWeChat = refundCashAmount;
//用户退百分之七十的费用
refundWeChat = residueOrderAmount;
BigDecimal multiply = refundWeChat.multiply(new BigDecimal(100));
Long longWeChat = multiply.longValue();
applyRefundVO.setRefund(longWeChat);
......@@ -1017,6 +1020,7 @@ public class RequirementsServiceImpl implements RequirementsService {
publisherWalletFlowVO.setOperateUserAccountId(userAccountId);
publisherWalletFlowVO.setModeOfPayment(300);
publisherWalletFlowVO.setSalaryAmount(residueAmount);
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
flyerCancel(walletFlowVO, request.getHeader("token"));
} else if (residueAmount.compareTo(BigDecimal.ZERO) == 1) {
publisherWalletFlowVO.setCashAmount(residueAmount);
......@@ -1045,11 +1049,34 @@ public class RequirementsServiceImpl implements RequirementsService {
requirementsDao.updateRequirementsAmount(requirementsInfoDO);
// requirementsDao.insertPlatformOrderEarnings(earnings, requirementsInfoId, userAccountId);
requirementsDao.updatePlatformOrderEarnings(earnings, requirementsInfoId, userAccountId);
flyerWalletFlowVO.setSalaryAmount(receiveSalaryAmount);
flyerWalletFlowVO.setUserAccountId(requirementsInfoDO.getPilotCertificationUserId());
flyerWalletFlowVO.setOperateUserAccountId(userAccountId);
flyerWalletFlowVO.setModeOfPayment(300);
flyerCancel(walletFlowVO, request.getHeader("token"));
if (serviceDO.getCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
serviceDO.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0) {
//飞手应该获得的金额
publisherWalletFlowVO.setUserAccountId(userAccountId);
publisherWalletFlowVO.setOperateUserAccountId(userAccountId);
publisherWalletFlowVO.setModeOfPayment(300);
publisherWalletFlowVO.setPercentagePenaltyOfOrder(receiveSalaryAmount);
flyerWalletFlowVO.setCashAmount(serviceDO.getCashAmount());
flyerWalletFlowVO.setSalaryAmount(serviceDO.getSalaryAmount());
flyerWalletFlowVO.setUserAccountId(requirementsInfoDO.getPilotCertificationUserId());
flyerWalletFlowVO.setOperateUserAccountId(userAccountId);
flyerWalletFlowVO.setModeOfPayment(300);
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
walletFlowVO.setFlyerWalletFlowVO(flyerWalletFlowVO);
flyerCancel(walletFlowVO, request.getHeader("token"));
}
if (serviceDO.getWechatPayOrderNumber() != null) {
ApplyRefundVO arv = new ApplyRefundVO();
arv.setReason("全额退款");
arv.setRefund(serviceDO.getWeChat().multiply(new BigDecimal(100)).longValue());
arv.setOutTradeNo(serviceDO.getWechatPayOrderNumber());
applyRefund(arv, request.getHeader("token"));
}
requirementsInfoDO.setReceiveSalaryAmount(receiveSalaryAmount);
//给飞手发送短信
this.sendMsgFlyerInfoAuth(requirementsInfoDO);
......
......@@ -1225,4 +1225,10 @@
set is_deleted=1
where requirements_info_id = #{requirementsInfoId}
</update>
<select id="serviceReq" resultType="com.mmc.csf.release.entity.requirements.RequirementsServiceDO">
select cash_amount, we_chat, salary_amount, wechat_pay_order_number, preempt_total_amount
from requirements_service
where requirements_info_id = #{requirementsInfoId}
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论