提交 e41eac5b 作者: 恶龙咆哮

修改bug

上级 e87a7d20
package com.mmc.csf.infomation.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 张培
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OnlyRequirementsInfoId {
@ApiModelProperty(value = "订单id")
private Integer requirementsInfoId;
}
......@@ -176,7 +176,7 @@ public class RequirementsServiceImpl implements RequirementsService {
public ResultBody appPublishList() {
List<RequirementsInfoDO> requirementsInfoDOS = requirementsDao.appPublishList();
//远程调用服务一级分类
// List<IndustryTypeDTO> industryTypeDTOS = listIndustry();
// List<IndustryTypeDTO> industryTypeDTOS = listIndustry();
List<RequirementsInfoVO> collect = requirementsInfoDOS.stream().map(RequirementsInfoDO::buildRequirementsInfoVO).collect(Collectors.toList());
/* for (RequirementsInfoVO requirementsInfoVO : collect) {
for (IndustryTypeDTO industryTypeDTO : industryTypeDTOS) {
......@@ -224,11 +224,11 @@ public class RequirementsServiceImpl implements RequirementsService {
}
Integer status = requirementsDao.selectServiceIdByRequireIdAndUserId(id, userAccountId);
if(status == null) {
if (status == null) {
return ResultBody.success(requirementsInfoVO);
}
//如果该飞手被拒绝 需要修改当前订单的状态
if(requirementsDao.selectServiceIdByRequireIdAndUserId(id,userAccountId) == 11) {
if (requirementsDao.selectServiceIdByRequireIdAndUserId(id, userAccountId) == 11) {
requirementsInfoVO.setOrderStatus("170");
}
return ResultBody.success(requirementsInfoVO);
......@@ -735,7 +735,7 @@ public class RequirementsServiceImpl implements RequirementsService {
Integer serviceFlowId = requirementsServiceDO.getServiceFlowId();
if (serviceFlowId != 10) {
return ResultBody.error(ResultEnum.YOU_CANNOT_CANCEL_THE_ORDER_AT_THIS_TIME.getResultMsg());
}else {
} else {
//修改订单所需人数以及订单状态
requirementsDao.updateRequirementsInfoByRefusePilot(requirementsInfoId);
Integer fatherRequireId = requirementsDao.selectFatherRequireIdBySonId(requirementsInfoId);
......@@ -1036,12 +1036,12 @@ public class RequirementsServiceImpl implements RequirementsService {
Boolean condition1 = false;
Boolean condition2 = false;
//如果是多人订单 需要判断每一个子订单是否是在 1,10 状态
if(requirementsDao.selectRequirementsNum(requirementsInfoId) > 1) {
if(requirementsDao.selectServiceFlowIdByFatherId(requirementsInfoId) == 0) {
if (requirementsDao.selectRequirementsNum(requirementsInfoId) > 1) {
if (requirementsDao.selectServiceFlowIdByFatherId(requirementsInfoId) == 0) {
condition2 = true;
condition1 = true;
}
}else {
} else {
condition1 = serviceFlowId == 1;
condition2 = serviceFlowId == 10;
}
......@@ -1081,7 +1081,7 @@ public class RequirementsServiceImpl implements RequirementsService {
requirementsDao.updateInfo(requirementsInfoId, 7);
requirementsDao.updateFlow(requirementsInfoId, 7);
return ResultBody.success(ResultEnum.THE_AMOUNT_OF_THE_MISSION_WILL_BE_RETURNED.getResultMsg());
}else {
} else {
return ResultBody.error(ResultEnum.YOU_CANNOT_CANCEL_THE_ORDER_AT_THIS_TIME.getResultMsg());
}
// if (serviceFlowId != 2 && serviceFlowId != 1) {
......@@ -1282,31 +1282,31 @@ public class RequirementsServiceImpl implements RequirementsService {
* @return
*/
@Override
public ResultBody cancelAll(LiabilityProblemVO liabilityProblemVO, Integer userAccountId,HttpServletRequest request) {
public ResultBody cancelAll(LiabilityProblemVO liabilityProblemVO, Integer userAccountId, HttpServletRequest request) {
RequirementsServiceDO requirementsServiceDO = requirementsDao.customerDroneFlyerCancel(liabilityProblemVO.getRequirementsInfoId());
RequirementsInfoDO requirementsInfoDO = requirementsDao.customerPublisherCancel(liabilityProblemVO.getRequirementsInfoId(), userAccountId);
liabilityProblemVO.setUserAccountId(userAccountId);
if (requirementsInfoDO.getServiceFlowId()==8 ||
requirementsInfoDO.getServiceFlowId()==6 ||
requirementsInfoDO.getServiceFlowId()==7 ||
requirementsInfoDO.getServiceFlowId()==5){
if (requirementsInfoDO.getServiceFlowId() == 8 ||
requirementsInfoDO.getServiceFlowId() == 6 ||
requirementsInfoDO.getServiceFlowId() == 7 ||
requirementsInfoDO.getServiceFlowId() == 5) {
return ResultBody.error("客服不能介入当前状态");
}
if (requirementsServiceDO==null){
if (requirementsServiceDO == null) {
return ResultBody.error("没有人抢单不能判定责任");
}
int i = requirementsDao.selectCustomer(liabilityProblemVO.getRequirementsInfoId());
if (i!=0){
if (i != 0) {
return ResultBody.error("请勿重复判定");
}
requirementsDao.customerServiceIntervention(liabilityProblemVO);
//双方无责
if (liabilityProblemVO.getDuty().equals(1)){
requirementsDao.updateInfo(liabilityProblemVO.getRequirementsInfoId(), 7);
if (liabilityProblemVO.getDuty().equals(1)) {
requirementsDao.updateInfo(liabilityProblemVO.getRequirementsInfoId(), 7);
requirementsDao.updateScene(liabilityProblemVO.getRequirementsInfoId(), 7);
WalletFlowVO walletFlowVO = new WalletFlowVO();
PublisherWalletFlowVO publisherWalletFlowVO = new PublisherWalletFlowVO();
......@@ -1327,7 +1327,7 @@ public class RequirementsServiceImpl implements RequirementsService {
}
//退发布者费用
if (requirementsInfoDO.getWechatPayOrderNumber()!=null){
if (requirementsInfoDO.getWechatPayOrderNumber() != null) {
ApplyRefundVO applyRefundVO = new ApplyRefundVO();
applyRefundVO.setReason("客服介入退款");
applyRefundVO.setRefund(requirementsInfoDO.getWeChat().multiply(new BigDecimal(100)).longValue());
......@@ -1335,7 +1335,7 @@ public class RequirementsServiceImpl implements RequirementsService {
applyRefund(applyRefundVO, request.getHeader("token"));
}
//退飞手费用
if (requirementsServiceDO.getWechatPayOrderNumber()!=null){
if (requirementsServiceDO.getWechatPayOrderNumber() != null) {
ApplyRefundVO applyRefundVO = new ApplyRefundVO();
applyRefundVO.setReason("客服介入退款");
applyRefundVO.setRefund(requirementsServiceDO.getWeChat().multiply(new BigDecimal(100)).longValue());
......@@ -1343,47 +1343,47 @@ public class RequirementsServiceImpl implements RequirementsService {
applyRefund(applyRefundVO, request.getHeader("token"));
}
//退云享金及余额
if (requirementsInfoDO.getCashAmount().compareTo(BigDecimal.ZERO)!=0 ||
requirementsInfoDO.getSalaryAmount().compareTo(BigDecimal.ZERO)!=0 ||
requirementsServiceDO.getCashAmount().compareTo(BigDecimal.ZERO)!=0 ||
requirementsServiceDO.getSalaryAmount().compareTo(BigDecimal.ZERO)!=0){
publisherWalletFlowVO.setModeOfPayment(500);
publisherWalletFlowVO.setUserAccountId(requirementsInfoDO.getUserAccountId());
publisherWalletFlowVO.setOperateUserAccountId(userAccountId);
publisherWalletFlowVO.setCashAmount(requirementsInfoDO.getCashAmount());
publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount());
flyerWalletFlowVO.setModeOfPayment(500);
flyerWalletFlowVO.setUserAccountId(requirementsServiceDO.getPilotCertificationUserId());
flyerWalletFlowVO.setOperateUserAccountId(userAccountId);
flyerWalletFlowVO.setCashAmount(requirementsServiceDO.getCashAmount());
flyerWalletFlowVO.setSalaryAmount(requirementsServiceDO.getSalaryAmount());
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
walletFlowVO.setFlyerWalletFlowVO(flyerWalletFlowVO);
flyerCancel(walletFlowVO,request.getHeader("token"));
//给发布者或者飞手发送信息
this.publicSendMsgPublishInfoAuth(requirementsServiceDO);
this.requirementsInfoInfoAuth(requirementsInfoDO);
return ResultBody.success();
if (requirementsInfoDO.getCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
requirementsInfoDO.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0 ||
requirementsServiceDO.getCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
requirementsServiceDO.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0) {
publisherWalletFlowVO.setModeOfPayment(500);
publisherWalletFlowVO.setUserAccountId(requirementsInfoDO.getUserAccountId());
publisherWalletFlowVO.setOperateUserAccountId(userAccountId);
publisherWalletFlowVO.setCashAmount(requirementsInfoDO.getCashAmount());
publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount());
flyerWalletFlowVO.setModeOfPayment(500);
flyerWalletFlowVO.setUserAccountId(requirementsServiceDO.getPilotCertificationUserId());
flyerWalletFlowVO.setOperateUserAccountId(userAccountId);
flyerWalletFlowVO.setCashAmount(requirementsServiceDO.getCashAmount());
flyerWalletFlowVO.setSalaryAmount(requirementsServiceDO.getSalaryAmount());
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
walletFlowVO.setFlyerWalletFlowVO(flyerWalletFlowVO);
flyerCancel(walletFlowVO, request.getHeader("token"));
//给发布者或者飞手发送信息
this.publicSendMsgPublishInfoAuth(requirementsServiceDO);
this.requirementsInfoInfoAuth(requirementsInfoDO);
return ResultBody.success();
}
}
//发布者责任
if (liabilityProblemVO.getDuty().equals(2)){
// publisherCancel(liabilityProblemVO.getRequirementsInfoId(),requirementsInfoDO.getUserAccountId(),request);
publisherCancelDuty(liabilityProblemVO.getRequirementsInfoId(),requirementsInfoDO.getUserAccountId(),request);
if (liabilityProblemVO.getDuty().equals(2)) {
// publisherCancel(liabilityProblemVO.getRequirementsInfoId(),requirementsInfoDO.getUserAccountId(),request);
publisherCancelDuty(liabilityProblemVO.getRequirementsInfoId(), requirementsInfoDO.getUserAccountId(), request);
requirementsDao.updateInfo(liabilityProblemVO.getRequirementsInfoId(), 7);
requirementsDao.updateScene(liabilityProblemVO.getRequirementsInfoId(), 7);
return ResultBody.success();
}
//飞手责任
if (liabilityProblemVO.getDuty().equals(3)){
// droneFlyerCancel(liabilityProblemVO.getRequirementsInfoId(),requirementsServiceDO.getPilotCertificationUserId(),request);
droneFlyerCancelDuty(liabilityProblemVO.getRequirementsInfoId(),requirementsServiceDO.getPilotCertificationUserId(),request);
if (liabilityProblemVO.getDuty().equals(3)) {
// droneFlyerCancel(liabilityProblemVO.getRequirementsInfoId(),requirementsServiceDO.getPilotCertificationUserId(),request);
droneFlyerCancelDuty(liabilityProblemVO.getRequirementsInfoId(), requirementsServiceDO.getPilotCertificationUserId(), request);
requirementsDao.updateInfo(liabilityProblemVO.getRequirementsInfoId(), 7);
requirementsDao.updateScene(liabilityProblemVO.getRequirementsInfoId(), 7);
return ResultBody.success();
......@@ -1391,7 +1391,7 @@ public class RequirementsServiceImpl implements RequirementsService {
return ResultBody.success();
}
public ResultBody publisherCancelDuty(Integer requirementsInfoId, Integer userAccountId, HttpServletRequest request){
public ResultBody publisherCancelDuty(Integer requirementsInfoId, Integer userAccountId, HttpServletRequest request) {
RequirementsInfoDO requirementsInfoDO = requirementsDao.publisherCancel(requirementsInfoId, userAccountId);
RequirementsServiceDO serviceDO = requirementsDao.serviceReq(requirementsInfoId);
if (serviceDO != null) {
......@@ -1412,181 +1412,180 @@ public class RequirementsServiceImpl implements RequirementsService {
IsNullConvertZeroUtil.checkIsNull(publisherWalletFlowVO);
IsNullConvertZeroUtil.checkIsNull(flyerWalletFlowVO);
BigDecimal orderAmount = requirementsInfoDO.getOrderAmount();
BigDecimal bigDecimal = new BigDecimal(0.7);
//剩余金额
BigDecimal residueOrderAmount = orderAmount.multiply(bigDecimal).setScale(2, BigDecimal.ROUND_HALF_UP);
//先退微信 再退任务佣金 最后退云享金
BigDecimal weChat = requirementsInfoDO.getWeChat();
//微信需要退款多少金额
//微信金额大于扣除之后的金额
BigDecimal refundCashAmount = new BigDecimal(0);
BigDecimal refundSalaryAmount = new BigDecimal(0);
BigDecimal refundWeChat = new BigDecimal(0);
//飞手获得的金额
BigDecimal receiveSalaryAmount = orderAmount.multiply(new BigDecimal(0.2)).setScale(2, BigDecimal.ROUND_HALF_UP);
//需要扣除金额
BigDecimal freeze = orderAmount.multiply(new BigDecimal(0.3)).setScale(2, BigDecimal.ROUND_HALF_UP);
//微信支付金额大于需要退款金额
if (weChat.compareTo(residueOrderAmount) == 1) {
//云享金扣除多少
// publisherWalletFlowVO.setCashAmount(requirementsInfoDO.getCashAmount().negate());
//佣金扣除多少
// publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount().negate());
//违约云享金多少
publisherWalletFlowVO.setYxjCashPledge(requirementsInfoDO.getCashAmount().negate());
//违约佣金
publisherWalletFlowVO.setSalaryCashPledge(requirementsInfoDO.getSalaryAmount().negate());
BigDecimal orderAmount = requirementsInfoDO.getOrderAmount();
BigDecimal bigDecimal = new BigDecimal(0.7);
//剩余金额
BigDecimal residueOrderAmount = orderAmount.multiply(bigDecimal).setScale(2, BigDecimal.ROUND_HALF_UP);
//先退微信 再退任务佣金 最后退云享金
BigDecimal weChat = requirementsInfoDO.getWeChat();
//微信需要退款多少金额
//微信金额大于扣除之后的金额
BigDecimal refundCashAmount = new BigDecimal(0);
BigDecimal refundSalaryAmount = new BigDecimal(0);
BigDecimal refundWeChat = new BigDecimal(0);
//飞手获得的金额
BigDecimal receiveSalaryAmount = orderAmount.multiply(new BigDecimal(0.2)).setScale(2, BigDecimal.ROUND_HALF_UP);
//需要扣除金额
BigDecimal freeze = orderAmount.multiply(new BigDecimal(0.3)).setScale(2, BigDecimal.ROUND_HALF_UP);
//微信支付金额大于需要退款金额
if (weChat.compareTo(residueOrderAmount) == 1) {
//云享金扣除多少
// publisherWalletFlowVO.setCashAmount(requirementsInfoDO.getCashAmount().negate());
//佣金扣除多少
// publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount().negate());
//违约云享金多少
publisherWalletFlowVO.setYxjCashPledge(requirementsInfoDO.getCashAmount().negate());
//违约佣金
publisherWalletFlowVO.setSalaryCashPledge(requirementsInfoDO.getSalaryAmount().negate());
//用户退百分之七十的费用
refundWeChat = residueOrderAmount;
BigDecimal multiply = refundWeChat.multiply(new BigDecimal(100));
Long longWeChat = multiply.longValue();
applyRefundVO.setRefund(longWeChat);
applyRefundVO.setReason("扣除飞手百分之三十的费用");
applyRefundVO.setOutTradeNo(requirementsInfoDO.getWechatPayOrderNumber());
//退款到微信
applyRefund(applyRefundVO, request.getHeader("token"));
}
//微信支付金额小于需要退款金额
if (weChat.compareTo(residueOrderAmount) == -1 ||
weChat.compareTo(refundCashAmount) == 0) {
//优先扣除微信里面的钱
BigDecimal returnToWechat = residueOrderAmount.subtract(requirementsInfoDO.getWeChat());
//用户退百分之七十的费用
refundWeChat = residueOrderAmount;
BigDecimal multiply = refundWeChat.multiply(new BigDecimal(100));
Long longWeChat = multiply.longValue();
applyRefundVO.setRefund(longWeChat);
applyRefundVO.setReason("扣除飞手百分之三十的费用");
applyRefundVO.setOutTradeNo(requirementsInfoDO.getWechatPayOrderNumber());
//退款到微信
applyRefund(applyRefundVO, request.getHeader("token"));
}
//微信支付金额小于需要退款金额
if (weChat.compareTo(residueOrderAmount) == -1 ||
weChat.compareTo(refundCashAmount) == 0) {
//优先扣除微信里面的钱
BigDecimal returnToWechat = residueOrderAmount.subtract(requirementsInfoDO.getWeChat());
BigDecimal residueAmount = new BigDecimal(0);
if (returnToWechat.compareTo(requirementsInfoDO.getSalaryAmount()) == 1) {
//退回佣金
residueAmount = returnToWechat.subtract(requirementsInfoDO.getSalaryAmount());
publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount());
publisherWalletFlowVO.setCashAmount(residueAmount);
publisherWalletFlowVO.setYxjCashPledge(requirementsInfoDO.getCashAmount().subtract(residueAmount).negate());
BigDecimal residueAmount = new BigDecimal(0);
if (returnToWechat.compareTo(requirementsInfoDO.getSalaryAmount()) == 1) {
//退回佣金
residueAmount = returnToWechat.subtract(requirementsInfoDO.getSalaryAmount());
publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount());
publisherWalletFlowVO.setCashAmount(residueAmount);
publisherWalletFlowVO.setYxjCashPledge(requirementsInfoDO.getCashAmount().subtract(residueAmount).negate());
}
if (returnToWechat.compareTo(requirementsInfoDO.getSalaryAmount()) == 0) {
publisherWalletFlowVO.setSalaryAmount(returnToWechat);
}
}
if (returnToWechat.compareTo(requirementsInfoDO.getSalaryAmount()) == 0) {
publisherWalletFlowVO.setSalaryAmount(returnToWechat);
}
//如果退回的佣金小于支付的佣金
if (returnToWechat.compareTo(requirementsInfoDO.getSalaryAmount()) == -1) {
residueAmount = requirementsInfoDO.getSalaryAmount().subtract(returnToWechat);
//one
publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount().subtract(residueAmount));
publisherWalletFlowVO.setSalaryCashPledge(residueAmount.negate());
//修改2
//修改三
//如果退回的佣金小于支付的佣金
if (returnToWechat.compareTo(requirementsInfoDO.getSalaryAmount()) == -1) {
residueAmount = requirementsInfoDO.getSalaryAmount().subtract(returnToWechat);
//one
publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount().subtract(residueAmount));
publisherWalletFlowVO.setSalaryCashPledge(residueAmount.negate());
//修改2
//修改三
if (residueAmount.compareTo(BigDecimal.ZERO) == 1) {
publisherWalletFlowVO.setYxjCashPledge(requirementsInfoDO.getCashAmount().negate());
}
}
//如果退回佣金等于0
if (residueAmount.compareTo(BigDecimal.ZERO) == 0) {
if (residueAmount.compareTo(BigDecimal.ZERO) == 1) {
publisherWalletFlowVO.setYxjCashPledge(requirementsInfoDO.getCashAmount().negate());
}
}
//如果退回佣金等于0
if (residueAmount.compareTo(BigDecimal.ZERO) == 0) {
publisherWalletFlowVO.setYxjCashPledge(requirementsInfoDO.getCashAmount().negate());
}
if (residueAmount.compareTo(BigDecimal.ZERO) == -1) {
publisherWalletFlowVO.setUserAccountId(userAccountId);
publisherWalletFlowVO.setOperateUserAccountId(userAccountId);
publisherWalletFlowVO.setModeOfPayment(300);
publisherWalletFlowVO.setSalaryAmount(residueAmount.negate());
System.out.println(residueAmount);
BigDecimal subtract = requirementsInfoDO.getSalaryAmount().subtract(residueAmount.negate());
publisherWalletFlowVO.setSalaryCashPledge(subtract.negate());
publisherWalletFlowVO.setYxjCashPledge(requirementsInfoDO.getCashAmount().negate());
if (residueAmount.compareTo(BigDecimal.ZERO) == -1) {
publisherWalletFlowVO.setUserAccountId(userAccountId);
publisherWalletFlowVO.setOperateUserAccountId(userAccountId);
publisherWalletFlowVO.setModeOfPayment(300);
publisherWalletFlowVO.setSalaryAmount(residueAmount.negate());
System.out.println(residueAmount);
BigDecimal subtract = requirementsInfoDO.getSalaryAmount().subtract(residueAmount.negate());
publisherWalletFlowVO.setSalaryCashPledge(subtract.negate());
publisherWalletFlowVO.setYxjCashPledge(requirementsInfoDO.getCashAmount().negate());
// BigDecimal subtract = requirementsInfoDO.getSalaryAmount().subtract(residueAmount.negate());
// publisherWalletFlowVO.setSalaryCashPledge(subtract.negate());
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
//flyerCancel(walletFlowVO, request.getHeader("token"));
//退回的佣金大于0
} else if (residueAmount.compareTo(BigDecimal.ZERO) == 1) {
// publisherWalletFlowVO.setCashAmount(residueAmount);
publisherWalletFlowVO.setUserAccountId(userAccountId);
publisherWalletFlowVO.setOperateUserAccountId(userAccountId);
publisherWalletFlowVO.setModeOfPayment(300);
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
//退回任务佣金
//flyerCancel(walletFlowVO, request.getHeader("token"));
// BigDecimal subtract = requirementsInfoDO.getSalaryAmount().subtract(residueAmount.negate());
// publisherWalletFlowVO.setSalaryCashPledge(subtract.negate());
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
//flyerCancel(walletFlowVO, request.getHeader("token"));
//退回的佣金大于0
} else if (residueAmount.compareTo(BigDecimal.ZERO) == 1) {
// publisherWalletFlowVO.setCashAmount(residueAmount);
publisherWalletFlowVO.setUserAccountId(userAccountId);
publisherWalletFlowVO.setOperateUserAccountId(userAccountId);
publisherWalletFlowVO.setModeOfPayment(300);
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
//退回任务佣金
//flyerCancel(walletFlowVO, request.getHeader("token"));
}
BigDecimal weChatAmount = requirementsInfoDO.getWeChat();
long longWeChat = weChatAmount.multiply(new BigDecimal(100)).longValue();
applyRefundVO.setRefund(longWeChat);
applyRefundVO.setReason("退回方式——微信佣金云享金");
applyRefundVO.setOutTradeNo(requirementsInfoDO.getWechatPayOrderNumber());
applyRefund(applyRefundVO, request.getHeader("token"));
}
BigDecimal weChatAmount = requirementsInfoDO.getWeChat();
long longWeChat = weChatAmount.multiply(new BigDecimal(100)).longValue();
applyRefundVO.setRefund(longWeChat);
applyRefundVO.setReason("退回方式——微信佣金云享金");
applyRefundVO.setOutTradeNo(requirementsInfoDO.getWechatPayOrderNumber());
applyRefund(applyRefundVO, request.getHeader("token"));
}
//平台抽取百分之十
//发布者取消
BigDecimal earnings = orderAmount.multiply(new BigDecimal(0.1)).setScale(2, BigDecimal.ROUND_HALF_UP);
BigDecimal orderEarnings = requirementsInfoDO.getOrderEarnings();
BigDecimal add = orderEarnings.add(earnings);
requirementsInfoDO.setOrderEarnings(add);
requirementsDao.updateRequirementsAmount(requirementsInfoDO);
// requirementsDao.insertPlatformOrderEarnings(earnings, requirementsInfoId, userAccountId);
requirementsDao.updatePlatformOrderEarnings(earnings, requirementsInfoId, userAccountId);
//平台抽取百分之十
//发布者取消
BigDecimal earnings = orderAmount.multiply(new BigDecimal(0.1)).setScale(2, BigDecimal.ROUND_HALF_UP);
BigDecimal orderEarnings = requirementsInfoDO.getOrderEarnings();
BigDecimal add = orderEarnings.add(earnings);
requirementsInfoDO.setOrderEarnings(add);
requirementsDao.updateRequirementsAmount(requirementsInfoDO);
// requirementsDao.insertPlatformOrderEarnings(earnings, requirementsInfoId, userAccountId);
requirementsDao.updatePlatformOrderEarnings(earnings, requirementsInfoId, userAccountId);
if (serviceDO.getCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
serviceDO.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0 ||
serviceDO.getWeChat().compareTo(BigDecimal.ZERO) != 0 ||
requirementsInfoDO.getLevelCashAmount().compareTo(BigDecimal.ZERO)!=0||
requirementsInfoDO.getLevelSalaryAmount().compareTo(BigDecimal.ZERO)!=0) {
if (requirementsInfoDO.getOrderLevel().equals("RUSH_ORDER")){
publisherWalletFlowVO.setUrgentYxjAmount(requirementsInfoDO.getLevelCashAmount().negate());
publisherWalletFlowVO.setUrgentSalaryAmount(requirementsInfoDO.getLevelSalaryAmount().negate());
}
if (requirementsInfoDO.getOrderLevel().equals("TOP_ORDER")){
if (serviceDO.getCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
serviceDO.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0 ||
serviceDO.getWeChat().compareTo(BigDecimal.ZERO) != 0 ||
requirementsInfoDO.getLevelCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
requirementsInfoDO.getLevelSalaryAmount().compareTo(BigDecimal.ZERO) != 0) {
if (requirementsInfoDO.getOrderLevel().equals("RUSH_ORDER")) {
publisherWalletFlowVO.setUrgentYxjAmount(requirementsInfoDO.getLevelCashAmount().negate());
publisherWalletFlowVO.setUrgentSalaryAmount(requirementsInfoDO.getLevelSalaryAmount().negate());
}
if (requirementsInfoDO.getOrderLevel().equals("TOP_ORDER")) {
publisherWalletFlowVO.setTopYxjAmount(requirementsInfoDO.getLevelCashAmount().negate());
publisherWalletFlowVO.setTopSalaryAmount(requirementsInfoDO.getLevelSalaryAmount().negate());
}
}
System.out.println(freeze);
//优先扣除微信
BigDecimal weChat1 = requirementsInfoDO.getWeChat();
System.out.println(freeze);
//优先扣除微信
BigDecimal weChat1 = requirementsInfoDO.getWeChat();
//飞手应该获得的金额
publisherWalletFlowVO.setUserAccountId(userAccountId);
publisherWalletFlowVO.setOperateUserAccountId(userAccountId);
publisherWalletFlowVO.setModeOfPayment(300);
publisherWalletFlowVO.setPercentagePenaltyOfOrder(receiveSalaryAmount.negate());
flyerWalletFlowVO.setCashAmount(serviceDO.getCashAmount());
flyerWalletFlowVO.setSalaryAmount(serviceDO.getSalaryAmount());
flyerWalletFlowVO.setUserAccountId(requirementsInfoDO.getPilotCertificationUserId());
flyerWalletFlowVO.setOperateUserAccountId(userAccountId);
flyerWalletFlowVO.setModeOfPayment(300);
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
walletFlowVO.setFlyerWalletFlowVO(flyerWalletFlowVO);
String s = String.valueOf(walletFlowVO);
log.info(s);
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"));
}
//飞手应该获得的金额
publisherWalletFlowVO.setUserAccountId(userAccountId);
publisherWalletFlowVO.setOperateUserAccountId(userAccountId);
publisherWalletFlowVO.setModeOfPayment(300);
publisherWalletFlowVO.setPercentagePenaltyOfOrder(receiveSalaryAmount.negate());
flyerWalletFlowVO.setCashAmount(serviceDO.getCashAmount());
flyerWalletFlowVO.setSalaryAmount(serviceDO.getSalaryAmount());
flyerWalletFlowVO.setUserAccountId(requirementsInfoDO.getPilotCertificationUserId());
flyerWalletFlowVO.setOperateUserAccountId(userAccountId);
flyerWalletFlowVO.setModeOfPayment(300);
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
walletFlowVO.setFlyerWalletFlowVO(flyerWalletFlowVO);
String s = String.valueOf(walletFlowVO);
log.info(s);
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);
requirementsDao.updateInfo(requirementsInfoId, 7);
requirementsDao.updateFlow(requirementsInfoId, 7);
return ResultBody.success(ResultEnum.REFUND_PERCENTAGE.getResultMsg());
requirementsInfoDO.setReceiveSalaryAmount(receiveSalaryAmount);
//给飞手发送短信
this.sendMsgFlyerInfoAuth(requirementsInfoDO);
requirementsDao.updateInfo(requirementsInfoId, 7);
requirementsDao.updateFlow(requirementsInfoId, 7);
return ResultBody.success(ResultEnum.REFUND_PERCENTAGE.getResultMsg());
}
public ResultBody droneFlyerCancelDuty(Integer requirementsInfoId, Integer userAccountId, HttpServletRequest request){
public ResultBody droneFlyerCancelDuty(Integer requirementsInfoId, Integer userAccountId, HttpServletRequest request) {
RequirementsInfoDO infoDO = requirementsDao.publisherCancelFlyer(requirementsInfoId);
RequirementsServiceDO requirementsServiceDO = requirementsDao.droneFlyerCancel(requirementsInfoId, userAccountId);
IsNullConvertZeroUtil.checkIsNull(requirementsServiceDO);
......@@ -1734,6 +1733,7 @@ public class RequirementsServiceImpl implements RequirementsService {
/**
* 给飞手短信
*
* @param requirementsServiceDO
*/
private void publicSendMsgPublishInfoAuth(RequirementsServiceDO requirementsServiceDO) {
......@@ -1953,9 +1953,9 @@ public class RequirementsServiceImpl implements RequirementsService {
publisherWalletFlowVO.setUserAccountId(amountUpdateDO.getUserAccountId());
publisherWalletFlowVO.setOperateUserAccountId(amountUpdateDO.getUserAccountId());
String wechatPayOrderNumber = amountUpdateDO.getWechatPayOrderNumber();
if (wechatPayOrderNumber!=null){
if (wechatPayOrderNumber != null) {
UserPayInfoVO userPayInfoVO = queryUserPayInfo(amountUpdateDO.getWechatPayOrderNumber(), request);
if (!userPayInfoVO.getTradeState().equals("SUCCESS")){
if (!userPayInfoVO.getTradeState().equals("SUCCESS")) {
return ResultBody.error("支付失败,请重新支付");
}
}
......@@ -1968,22 +1968,22 @@ public class RequirementsServiceImpl implements RequirementsService {
requirementsDao.updateScene(amountVO.getRequirementsInfoId(), 8);
requirementsDao.updateInfo(amountVO.getRequirementsInfoId(), 8);
int amountUpdate = requirementsDao.findAmountUpdate(amountUpdateDO.getRequirementsInfoId());
if (amountUpdate!=0){
return ResultBody.error("只能修改一次不能重复修改");
}else{
if (amountUpdate != 0) {
return ResultBody.error("只能修改一次不能重复修改");
} else {
requirementsDao.requirementsAmountUpdate(amountUpdateDO);
}
if (amountUpdateDO.getSalaryAmount().compareTo(BigDecimal.ZERO)!=0 ||
amountUpdateDO.getCashAmount().compareTo(BigDecimal.ZERO)!=0){
if (amountUpdateDO.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0 ||
amountUpdateDO.getCashAmount().compareTo(BigDecimal.ZERO) != 0) {
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
flyerCancelNO(walletFlowVO,request.getHeader("token"));
flyerCancelNO(walletFlowVO, request.getHeader("token"));
}
//倒计时
redisUtil.ins("order_" + requirementsInfoDO.getPublisherNumber(), String.valueOf(requirementsInfoDO), 1, TimeUnit.HOURS);
redisUtil.ins("order_" + requirementsInfoDO.getPublisherNumber(), String.valueOf(requirementsInfoDO), 1, TimeUnit.HOURS);
// redisUtil.ins("order_" + requirementsInfoDO.getPublisherNumber(), String.valueOf(requirementsInfoDO), 1, TimeUnit.MINUTES);
// redisUtil.ins("order_" + requirementsInfoDO.getPublisherNumber(), String.valueOf(requirementsInfoDO), 1, TimeUnit.MINUTES);
return ResultBody.success();
} else {
......@@ -2001,7 +2001,7 @@ public class RequirementsServiceImpl implements RequirementsService {
}
@Override
public ResultBody confirmSettlement(Integer userAccountId, Integer requirementsInfoId,HttpServletRequest request) {
public ResultBody confirmSettlement(Integer userAccountId, Integer requirementsInfoId, HttpServletRequest request) {
RequirementsInfoDO requirementsInfoDO = requirementsDao.publisherCancelFlyers(requirementsInfoId);
ServiceSettleAccountsVO settleAccountsVO = new ServiceSettleAccountsVO();
settleAccountsVO.setRequirementsInfoId(requirementsInfoId);
......@@ -2018,9 +2018,9 @@ public class RequirementsServiceImpl implements RequirementsService {
if (requirementsInfoDO == null) {
return ResultBody.error("结算失败");
}
BigDecimal earnings=BigDecimal.ZERO;
BigDecimal earnings = BigDecimal.ZERO;
//修改金额
if (updateAmount!=null){
if (updateAmount != null) {
//继续支付需要扣除金额
IsNullConvertZeroUtil.checkIsNull(updateAmount);
publisherWalletFlowVO.setCashAmount(requirementsInfoDO.getCashAmount().negate());
......@@ -2028,8 +2028,8 @@ public class RequirementsServiceImpl implements RequirementsService {
publisherWalletFlowVO.setUserAccountId(requirementsInfoDO.getUserAccountId());
publisherWalletFlowVO.setOperateUserAccountId(userAccountId);
publisherWalletFlowVO.setModeOfPayment(1000);
if (updateAmount.getCashAmount().compareTo(BigDecimal.ZERO)!=0||
updateAmount.getSalaryAmount().compareTo(BigDecimal.ZERO)!=0){
if (updateAmount.getCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
updateAmount.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0) {
BigDecimal cash = publisherWalletFlowVO.getCashAmount().negate();
BigDecimal salary = publisherWalletFlowVO.getSalaryAmount().negate();
......@@ -2039,13 +2039,14 @@ public class RequirementsServiceImpl implements RequirementsService {
publisherWalletFlowVO.setSalaryAmount(addSalary.negate());
// publisherWalletFlowVO.setRefundSalaryAmount(updateAmount.getSalaryAmount().negate());
//publisherWalletFlowVO.setRefundCashAmount(updateAmount.getCashAmount().negate());
}if(updateAmount.getReturnCashAmount().compareTo(BigDecimal.ZERO)!=0 ||
updateAmount.getReturnSalaryAmount().compareTo(BigDecimal.ZERO)!=0){
//publisherWalletFlowVO.setRefundCashAmount(updateAmount.getCashAmount().negate());
}
if (updateAmount.getReturnCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
updateAmount.getReturnSalaryAmount().compareTo(BigDecimal.ZERO) != 0) {
publisherWalletFlowVO.setRefundCashAmount(updateAmount.getReturnCashAmount());
publisherWalletFlowVO.setRefundSalaryAmount(updateAmount.getReturnSalaryAmount());
}
if (updateAmount.getReturnWeChat().compareTo(BigDecimal.ZERO)!=0){
if (updateAmount.getReturnWeChat().compareTo(BigDecimal.ZERO) != 0) {
ApplyRefundVO applyRefundVO = new ApplyRefundVO();
applyRefundVO.setReason("飞手确认退款");
applyRefundVO.setOutTradeNo(updateAmount.getWechatPayOrderNumber());
......@@ -2059,7 +2060,7 @@ public class RequirementsServiceImpl implements RequirementsService {
BigDecimal multiply = updateOrderAmount.multiply(new BigDecimal(0.9)).setScale(2, BigDecimal.ROUND_HALF_UP);
publisherWalletFlowVO.setFlyerSalaryAmount(multiply);
//平台收益
earnings = updateOrderAmount.multiply(new BigDecimal(0.1)).setScale(2, BigDecimal.ROUND_HALF_UP);
earnings = updateOrderAmount.multiply(new BigDecimal(0.1)).setScale(2, BigDecimal.ROUND_HALF_UP);
}
flyerWalletFlowVO.setSalaryAmount(serviceDO.getSalaryAmount());
......@@ -2068,7 +2069,7 @@ public class RequirementsServiceImpl implements RequirementsService {
flyerWalletFlowVO.setOperateUserAccountId(userAccountId);
flyerWalletFlowVO.setModeOfPayment(1000);
if (serviceDO.getWeChat().compareTo(BigDecimal.ZERO)!=0){
if (serviceDO.getWeChat().compareTo(BigDecimal.ZERO) != 0) {
ApplyRefundVO applyRefundVO = new ApplyRefundVO();
applyRefundVO.setReason("原路退回");
applyRefundVO.setOutTradeNo(serviceDO.getWechatPayOrderNumber());
......@@ -2081,10 +2082,10 @@ public class RequirementsServiceImpl implements RequirementsService {
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
walletFlowVO.setFlyerWalletFlowVO(flyerWalletFlowVO);
flyerCancelNO(walletFlowVO,request.getHeader("token"));
flyerCancelNO(walletFlowVO, request.getHeader("token"));
BigDecimal orderEarnings = requirementsInfoDO.getOrderEarnings();
BigDecimal add = orderEarnings.add(earnings);
requirementsDao.updateOrderEarnings(add,requirementsInfoId);
requirementsDao.updateOrderEarnings(add, requirementsInfoId);
requirementsDao.updateInfo(requirementsInfoId, 5);
requirementsDao.updateScene(requirementsInfoId, 5);
return ResultBody.success();
......@@ -2354,57 +2355,57 @@ public class RequirementsServiceImpl implements RequirementsService {
IsNullConvertZeroUtil.checkIsNull(serviceDO);
IsNullConvertZeroUtil.checkIsNull(requirementsInfoDO);
if (requirementsInfoDO.getServiceFlowId()==5){
if (requirementsInfoDO.getServiceFlowId() == 5) {
return ResultBody.error("已结算");
}
if (requirementsInfoDO == null) {
return ResultBody.error("结算失败");
}
BigDecimal earnings=BigDecimal.ZERO;
BigDecimal earnings = BigDecimal.ZERO;
//修改金额
if (updateAmount!=null){
if (updateAmount != null) {
//继续支付需要扣除金额
IsNullConvertZeroUtil.checkIsNull(updateAmount);
if (updateAmount.getUpdateOrderAmount().compareTo(updateAmount.getOrderAmount())==-1){
if (updateAmount.getUpdateOrderAmount().compareTo(updateAmount.getOrderAmount()) == -1) {
if (updateAmount.getReturnSalaryAmount().compareTo(BigDecimal.ZERO)!=0){
if (updateAmount.getReturnSalaryAmount().compareTo(BigDecimal.ZERO) != 0) {
BigDecimal orderAmount = updateAmount.getOrderAmount();
BigDecimal returnSalaryAmount = updateAmount.getReturnSalaryAmount();
BigDecimal subtract = orderAmount.subtract(returnSalaryAmount);
publisherWalletFlowVO.setSalaryAmount(subtract.negate());
if (requirementsInfoDO.getSalaryAmount().compareTo(updateAmount.getReturnSalaryAmount())==0){
if (requirementsInfoDO.getSalaryAmount().compareTo(updateAmount.getReturnSalaryAmount()) == 0) {
publisherWalletFlowVO.setSalaryAmount(BigDecimal.ZERO);
}
if (requirementsInfoDO.getSalaryAmount().compareTo(updateAmount.getReturnSalaryAmount())==1){
if (requirementsInfoDO.getSalaryAmount().compareTo(updateAmount.getReturnSalaryAmount()) == 1) {
publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount().subtract(updateAmount.getReturnSalaryAmount()).negate());
}
}else{
} else {
publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount().negate());
}
if (updateAmount.getReturnCashAmount().compareTo(BigDecimal.ZERO)!=0){
if (updateAmount.getReturnCashAmount().compareTo(BigDecimal.ZERO) != 0) {
BigDecimal orderAmount = updateAmount.getOrderAmount();
BigDecimal returnCashAmount = updateAmount.getReturnCashAmount();
BigDecimal subtract = orderAmount.subtract(returnCashAmount);
publisherWalletFlowVO.setCashAmount(subtract.negate());
if (requirementsInfoDO.getCashAmount().compareTo(updateAmount.getReturnCashAmount())==0){
if (requirementsInfoDO.getCashAmount().compareTo(updateAmount.getReturnCashAmount()) == 0) {
publisherWalletFlowVO.setCashAmount(BigDecimal.ZERO);
}
if (updateAmount.getReturnCashAmount().compareTo(requirementsInfoDO.getCashAmount())==-1){
if (updateAmount.getReturnCashAmount().compareTo(requirementsInfoDO.getCashAmount()) == -1) {
BigDecimal cashAmount = requirementsInfoDO.getCashAmount();
BigDecimal returnCashAmount1 = updateAmount.getReturnCashAmount();
BigDecimal subtract1 = cashAmount.subtract(returnCashAmount1);
publisherWalletFlowVO.setCashAmount(subtract1.negate());
}
}else{
} else {
publisherWalletFlowVO.setCashAmount(requirementsInfoDO.getCashAmount().negate());
}
}
if (updateAmount.getUpdateOrderAmount().compareTo(updateAmount.getOrderAmount())==1){
if (updateAmount.getUpdateOrderAmount().compareTo(updateAmount.getOrderAmount()) == 1) {
publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount().negate());
publisherWalletFlowVO.setCashAmount(requirementsInfoDO.getCashAmount().negate());
}
......@@ -2412,8 +2413,8 @@ public class RequirementsServiceImpl implements RequirementsService {
publisherWalletFlowVO.setUserAccountId(requirementsInfoDO.getUserAccountId());
publisherWalletFlowVO.setOperateUserAccountId(agreeVO.getUserAccountId());
publisherWalletFlowVO.setModeOfPayment(1000);
if (updateAmount.getCashAmount().compareTo(BigDecimal.ZERO)!=0||
updateAmount.getSalaryAmount().compareTo(BigDecimal.ZERO)!=0){
if (updateAmount.getCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
updateAmount.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0) {
BigDecimal cash = publisherWalletFlowVO.getCashAmount().negate();
BigDecimal salary = publisherWalletFlowVO.getSalaryAmount().negate();
......@@ -2424,12 +2425,13 @@ public class RequirementsServiceImpl implements RequirementsService {
// publisherWalletFlowVO.setRefundSalaryAmount(updateAmount.getSalaryAmount().negate());
//publisherWalletFlowVO.setRefundCashAmount(updateAmount.getCashAmount().negate());
}if(updateAmount.getReturnCashAmount().compareTo(BigDecimal.ZERO)!=0 ||
updateAmount.getReturnSalaryAmount().compareTo(BigDecimal.ZERO)!=0){
}
if (updateAmount.getReturnCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
updateAmount.getReturnSalaryAmount().compareTo(BigDecimal.ZERO) != 0) {
publisherWalletFlowVO.setRefundCashAmount(updateAmount.getReturnCashAmount());
publisherWalletFlowVO.setRefundSalaryAmount(updateAmount.getReturnSalaryAmount());
}
if (updateAmount.getReturnWeChat().compareTo(BigDecimal.ZERO)!=0){
if (updateAmount.getReturnWeChat().compareTo(BigDecimal.ZERO) != 0) {
ApplyRefundVO applyRefundVO = new ApplyRefundVO();
applyRefundVO.setReason("飞手确认退款");
applyRefundVO.setOutTradeNo(requirementsInfoDO.getWechatPayOrderNumber());
......@@ -2438,7 +2440,6 @@ public class RequirementsServiceImpl implements RequirementsService {
}
//给飞手金额
BigDecimal updateOrderAmount = updateAmount.getUpdateOrderAmount();
......@@ -2457,7 +2458,7 @@ public class RequirementsServiceImpl implements RequirementsService {
/**
* 退飞手金额
*/
if (serviceDO.getWeChat().compareTo(BigDecimal.ZERO)!=0){
if (serviceDO.getWeChat().compareTo(BigDecimal.ZERO) != 0) {
ApplyRefundVO applyRefundVO = new ApplyRefundVO();
applyRefundVO.setReason("原路退回");
applyRefundVO.setOutTradeNo(serviceDO.getWechatPayOrderNumber());
......@@ -2470,18 +2471,16 @@ public class RequirementsServiceImpl implements RequirementsService {
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
walletFlowVO.setFlyerWalletFlowVO(flyerWalletFlowVO);
flyerCancelNO(walletFlowVO,request.getHeader("token"));
flyerCancelNO(walletFlowVO, request.getHeader("token"));
BigDecimal orderEarnings = requirementsInfoDO.getOrderEarnings();
BigDecimal add = orderEarnings.add(earnings);
requirementsDao.updateOrderEarnings(add,agreeVO.getRequirementsInfoId());
requirementsDao.updateOrderEarnings(add, agreeVO.getRequirementsInfoId());
requirementsDao.updateInfo(agreeVO.getRequirementsInfoId(), 5);
requirementsDao.updateScene(agreeVO.getRequirementsInfoId(), 5);
return ResultBody.success();
}
@Override
public ResultBody publishService(ServiceRequirementsVO serviceRequirementsVO, HttpServletRequest request) {
......@@ -2583,7 +2582,7 @@ public class RequirementsServiceImpl implements RequirementsService {
if (!(tempTotalAmount.compareTo(BigDecimal.ZERO) == 0)) {
if (salaryAmt.compareTo(tempTotalAmount) == 1 || salaryAmt.compareTo(tempTotalAmount) == 0) {
// walletFlowVO.setSalaryAmount(tempTotalAmount);
// publisherWalletFlowVO.setTopSalaryAmount(tempTotalAmount);
// publisherWalletFlowVO.setTopSalaryAmount(tempTotalAmount);
if (orderLevelEnum.equals("RUSH_ORDER")) {
publisherWalletFlowVO.setUrgentSalaryAmount(tempTotalAmount);
requirementsInfoDO.setLevelSalaryAmount(tempTotalAmount);
......@@ -2762,7 +2761,7 @@ public class RequirementsServiceImpl implements RequirementsService {
requirementsDao.addPublishService(requirementsInfoDO);
RequirementsAmountDO requirementsAmountDO = new RequirementsAmountDO(requirementsInfoDO);
requirementsDao.addAmount(requirementsAmountDO);
if(sum == 1) {
if (sum == 1) {
requirementsDao.insertPlatformOrderEarnings(new BigDecimal(0), requirementsInfoDO.getId(), 0);
if (requirementsAmountDO.getCashAmount().compareTo(BigDecimal.ZERO) != 0
|| requirementsAmountDO.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0
......@@ -2771,7 +2770,7 @@ public class RequirementsServiceImpl implements RequirementsService {
feignWalletFlow(publisherWalletFlowVO, request.getHeader("token"));
}
return ResultBody.success();
}else {
} else {
//循环添加子订单
for (int i = 0; i < sum; i++) {
ServiceRequirementsSonDO requirementsSonDO = new ServiceRequirementsSonDO(requirementsInfoDO);
......@@ -2849,7 +2848,7 @@ public class RequirementsServiceImpl implements RequirementsService {
@Override
public ServiceRequirementsDO getRepertory(GrabTheOrderVO grabTheOrderVO, HttpServletRequest request) {
return requirementsDao.grabTheOrder(grabTheOrderVO.getRequirementsInfoId());
return requirementsDao.grabTheOrder(grabTheOrderVO.getRequirementsInfoId());
}
......@@ -2859,17 +2858,17 @@ public class RequirementsServiceImpl implements RequirementsService {
//这是这个订单所需要的总人数
Integer requireNum = grabTheOrderVO.getRequireNum();
if(requireNum == null || grabTheOrderVO.getRequirementsInfoId() == null){
if (requireNum == null || grabTheOrderVO.getRequirementsInfoId() == null) {
return ResultBody.error("参数不全");
}
Integer fatherRequireId = null,fatherRepertory=null;
Integer fatherRequireId = null, fatherRepertory = null;
//requireNum >= 2就说明这个订单是分开的有子订单
if(requireNum >= 2) {
if (requireNum >= 2) {
fatherRequireId = grabTheOrderVO.getRequirementsInfoId();
//不让同一个用户对一个多人订单重复下单
if(requirementsDao.selectBooleanByFatherIdAndUserId(fatherRequireId,grabTheOrderVO.getUserAccountId()) > 0) {
if (requirementsDao.selectBooleanByFatherIdAndUserId(fatherRequireId, grabTheOrderVO.getUserAccountId()) > 0) {
return ResultBody.error("不能重复抢一个订单");
}
ServiceRequirementsDO fatherRequirementsInfoDO = requirementsDao.grabTheOrder(fatherRequireId);
......@@ -2884,10 +2883,10 @@ public class RequirementsServiceImpl implements RequirementsService {
//获取没被抢的子订单id
Integer requirementsSonInfoId = requirementsDao.getRequirementsSonInfoId(fatherRequireId);
grabTheOrderVO.setRequirementsInfoId(requirementsSonInfoId);
}else {
} else {
//单人被拒绝后也不能再次抢单
Integer countRefuse = requirementsDao.selectRequirementsRefuse(grabTheOrderVO.getRequirementsInfoId(), grabTheOrderVO.getUserAccountId());
if(countRefuse == 1) {
if (countRefuse == 1) {
return ResultBody.error("不能重复抢一个订单");
}
}
......@@ -3007,20 +3006,23 @@ public class RequirementsServiceImpl implements RequirementsService {
// requirementsServiceDO.setPreemptTotalAmount(add1);
// requirementsServiceDO.setOpenid(openid);
// requirementsServiceDO.setPhoneNum(grabTheOrderVO.getPhoneNum());
//微信是否支付成功
requirementsDao.insertService(requirementsServiceDO);
requirementsInfoDO.setRepertory(repertory - 1);
requirementsDao.updateGrabTheOrder(grabTheOrderVO.getRequirementsInfoId(), requirementsInfoDO.getRepertory());
//微信是否支付成功
requirementsDao.insertService(requirementsServiceDO);
requirementsInfoDO.setRepertory(repertory - 1);
requirementsDao.updateGrabTheOrder(grabTheOrderVO.getRequirementsInfoId(), requirementsInfoDO.getRepertory());
// if (requirementsServiceDO.getCashAmount().compareTo(BigDecimal.ZERO) != 0
// || requirementsServiceDO.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0) {
// walletFlow(flyerWalletFlowVO, request.getHeader("token"));
// }
//如果是多人订单 还要去修改父订单还需多少人字段
if(requireNum >= 2) {
requirementsDao.updateRequirementsInfoRepertory(fatherRequireId,fatherRepertory - 1);
}
//如果是多人订单 还要去修改父订单还需多少人字段
if (requireNum >= 2) {
Integer repertoryNeed = requirementsDao.selectRepertoryByRequireId(fatherRequireId);
requirementsDao.updateRequirementsInfoRepertory(fatherRequireId, repertoryNeed);
}
OnlyRequirementsInfoId onlyRequirementsInfoId = new OnlyRequirementsInfoId();
onlyRequirementsInfoId.setRequirementsInfoId(grabTheOrderVO.getRequirementsInfoId());
return ResultBody.success();
return ResultBody.success(onlyRequirementsInfoId);
// } else {
// //云享金和佣金扣除完成,但是还不足支付订单金额,并且没有选择微信支付,所以支付不合法
// return ResultBody.success("抢单失败");
......@@ -3199,13 +3201,13 @@ public class RequirementsServiceImpl implements RequirementsService {
if (agreeOrder) {
requirementsDao.updateScene(requireId, 2);
requirementsDao.updateInfo(requireId, 2);
}else {
} else {
//修改订单所需人数以及订单状态
requirementsDao.updateRequirementsInfoByRefusePilot(requireId);
Integer fatherRequireId = requirementsDao.selectFatherRequireIdBySonId(requireId);
Integer repertory = requirementsDao.selectRepertoryByRequireId(fatherRequireId);
requirementsDao.updateRequirementsInfoRepertory(fatherRequireId, repertory);
requirementsDao.updateRequirementsService(requireId,param.getPilotCertificationUserId());
requirementsDao.updateRequirementsService(requireId, param.getPilotCertificationUserId());
//TODO 被拒绝后应该退回飞手的押金
}
......@@ -3213,7 +3215,6 @@ public class RequirementsServiceImpl implements RequirementsService {
}
public UserAccountSimpleDTO feignGetUserSimpleInfo(Integer userAccountId, HttpServletRequest request) {
String token = request.getHeader("token");
HttpHeaders headers = new HttpHeaders();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论