提交 27cfaac4 作者: 张小凤

RequirementsServiceImpl(update)

上级 34a8f7e2
...@@ -516,28 +516,7 @@ public class RequirementsServiceImpl implements RequirementsService { ...@@ -516,28 +516,7 @@ public class RequirementsServiceImpl implements RequirementsService {
PublisherWalletFlowVO publisherWalletFlowVO = new PublisherWalletFlowVO(); PublisherWalletFlowVO publisherWalletFlowVO = new PublisherWalletFlowVO();
IsNullConvertZeroUtil.checkIsNull(publisherWalletFlowVO); IsNullConvertZeroUtil.checkIsNull(publisherWalletFlowVO);
ApplyRefundVO applyRefundVO = new ApplyRefundVO(); ApplyRefundVO applyRefundVO = new ApplyRefundVO();
//先退款
if (requirementsInfoDO.getCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
requirementsInfoDO.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0) {
publisherWalletFlowVO.setModeOfPayment(200);
publisherWalletFlowVO.setUserAccountId(requirementsInfoDO.getUserAccountId());
publisherWalletFlowVO.setOperateUserAccountId(requirementsInfoDO.getUserAccountId());
publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount());
publisherWalletFlowVO.setCashAmount(requirementsInfoDO.getCashAmount());
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
flyerCancel(walletFlowVO, request.getHeader("token"));
}
//退回微信的钱
if (requirementsInfoDO.getWechatPayOrderNumber() != null
&& requirementsInfoDO.getWeChat().compareTo(BigDecimal.ZERO) != 0) {
BigDecimal weChat = requirementsInfoDO.getWeChat();
BigDecimal multiply = weChat.multiply(new BigDecimal(100));
Long longWeChat = multiply.longValue();
applyRefundVO.setRefund(longWeChat);
applyRefundVO.setOutTradeNo(requirementsInfoDO.getWechatPayOrderNumber());
applyRefundVO.setReason("退发布者微信支付的任务佣金");
applyRefund(applyRefundVO, request.getHeader("token"));
}
// requirementsDao.updateInfo(requirementsInfoDO.getId(), 7); // requirementsDao.updateInfo(requirementsInfoDO.getId(), 7);
// requirementsDao.updateServiceAmount(requirementsInfoDO.getId()); // requirementsDao.updateServiceAmount(requirementsInfoDO.getId());
RequirementsServiceDO requirementsServiceDO = new RequirementsServiceDO(); RequirementsServiceDO requirementsServiceDO = new RequirementsServiceDO();
...@@ -1351,6 +1330,7 @@ public class RequirementsServiceImpl implements RequirementsService { ...@@ -1351,6 +1330,7 @@ public class RequirementsServiceImpl implements RequirementsService {
IsNullConvertZeroUtil.checkIsNull(publisherWalletFlowVO); IsNullConvertZeroUtil.checkIsNull(publisherWalletFlowVO);
ApplyRefundVO applyRefundVO = new ApplyRefundVO(); ApplyRefundVO applyRefundVO = new ApplyRefundVO();
//用户钱包信息接口 //用户钱包信息接口
ResultBody resultBody = getCurrentUserPayWalletInfo(request); ResultBody resultBody = getCurrentUserPayWalletInfo(request);
GetOrderNumberDTO orderNumberDTO = new GetOrderNumberDTO(); GetOrderNumberDTO orderNumberDTO = new GetOrderNumberDTO();
...@@ -1413,6 +1393,35 @@ public class RequirementsServiceImpl implements RequirementsService { ...@@ -1413,6 +1393,35 @@ public class RequirementsServiceImpl implements RequirementsService {
} }
} }
if (tempTotalAmount.compareTo(BigDecimal.ZERO) == 0) { if (tempTotalAmount.compareTo(BigDecimal.ZERO) == 0) {
if (requirementsEditVO.getWechatPayOrderNumber() != null) {
UserPayInfoVO userPayInfoVO = queryUserPayInfo(requirementsEditVO.getWechatPayOrderNumber(), request);
if (userPayInfoVO.getTradeState() != "SUCCESS") {
return ResultBody.error("支付失败,请重新支付");
}
}
//先退款
if (requirementsInfoDO.getCashAmount().compareTo(BigDecimal.ZERO) != 0 ||
requirementsInfoDO.getSalaryAmount().compareTo(BigDecimal.ZERO) != 0) {
publisherWalletFlowVO.setModeOfPayment(200);
publisherWalletFlowVO.setUserAccountId(requirementsInfoDO.getUserAccountId());
publisherWalletFlowVO.setOperateUserAccountId(requirementsInfoDO.getUserAccountId());
publisherWalletFlowVO.setSalaryAmount(requirementsInfoDO.getSalaryAmount());
publisherWalletFlowVO.setCashAmount(requirementsInfoDO.getCashAmount());
walletFlowVO.setPublisherWalletFlowVO(publisherWalletFlowVO);
flyerCancel(walletFlowVO, request.getHeader("token"));
}
//退回微信的钱
if (requirementsInfoDO.getWechatPayOrderNumber() != null
&& requirementsInfoDO.getWeChat().compareTo(BigDecimal.ZERO) != 0) {
BigDecimal weChat = requirementsInfoDO.getWeChat();
BigDecimal multiply = weChat.multiply(new BigDecimal(100));
Long longWeChat = multiply.longValue();
applyRefundVO.setRefund(longWeChat);
applyRefundVO.setOutTradeNo(requirementsInfoDO.getWechatPayOrderNumber());
applyRefundVO.setReason("退发布者微信支付的任务佣金");
applyRefund(applyRefundVO, request.getHeader("token"));
}
requirementsDao.InsertRequirementsAmountLog(requirementsInfoDO); requirementsDao.InsertRequirementsAmountLog(requirementsInfoDO);
IndustryTypeDTO industryTypeDTO = getIndustryTypeById(requirementsEditVO.getServiceId()); IndustryTypeDTO industryTypeDTO = getIndustryTypeById(requirementsEditVO.getServiceId());
infoDO.setServiceName(industryTypeDTO.getTypeName()); infoDO.setServiceName(industryTypeDTO.getTypeName());
...@@ -2350,10 +2359,19 @@ public class RequirementsServiceImpl implements RequirementsService { ...@@ -2350,10 +2359,19 @@ public class RequirementsServiceImpl implements RequirementsService {
HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(userAccountId), headers); HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(userAccountId), headers);
ResponseEntity<PilotCertificationInteriorDTO> exchange1 = restTemplate.exchange(userApp + "/userapp/pilot/interiorDetailPilot?userAccountId=" + userAccountId, HttpMethod.GET, entity, PilotCertificationInteriorDTO.class); ResponseEntity<PilotCertificationInteriorDTO> exchange1 = restTemplate.exchange(userApp + "/userapp/pilot/interiorDetailPilot?userAccountId=" + userAccountId, HttpMethod.GET, entity, PilotCertificationInteriorDTO.class);
PilotCertificationInteriorDTO body = exchange1.getBody();*/ PilotCertificationInteriorDTO body = exchange1.getBody();*/
public UserPayInfoVO queryUserPayInfo(String orderNo) {
/**
* 通过订单编号查看是否支付成功
*
* @param orderNo
* @return
*/
public UserPayInfoVO queryUserPayInfo(String orderNo, HttpServletRequest request) {
String token = request.getHeader("token");
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON); headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> entity = new HttpEntity<>(null, headers); headers.add("token", token);
HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(orderNo), headers);
ResponseEntity<UserPayInfoVO> exchange = restTemplate.exchange(paymentApp + "/payment/wechat/queryUserPayInfo?orderNo=" + orderNo, HttpMethod.GET, entity, UserPayInfoVO.class); ResponseEntity<UserPayInfoVO> exchange = restTemplate.exchange(paymentApp + "/payment/wechat/queryUserPayInfo?orderNo=" + orderNo, HttpMethod.GET, entity, UserPayInfoVO.class);
UserPayInfoVO body = exchange.getBody(); UserPayInfoVO body = exchange.getBody();
return body; return body;
...@@ -2370,6 +2388,7 @@ public class RequirementsServiceImpl implements RequirementsService { ...@@ -2370,6 +2388,7 @@ public class RequirementsServiceImpl implements RequirementsService {
return industryTypeDTO; return industryTypeDTO;
} }
public String randomOrderCode() { public String randomOrderCode() {
SimpleDateFormat dmDate = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat dmDate = new SimpleDateFormat("yyyyMMddHHmmss");
String ranData = getRandom(6); String ranData = getRandom(6);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论