记得上下班打卡 | git大法好,push需谨慎

Commit 8c995d99 authored by jiangxiulong's avatar jiangxiulong

refund-31

parent f024ac72
package com.liquidnet.service.feign.kylin.api;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dto.vo.KylinPerformanceVo;
import feign.hystrix.FallbackFactory;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@Component
@FeignClient(name = "liquidnet-service-kylin",
contextId = "", path = "",
fallback = FallbackFactory.Default.class)
public interface FeignKylinOrderRefundClient {
@PostMapping("admin/refund/apply")
@ApiOperation("申请退款")
ResponseDto<Object> refundApply(
@RequestBody String orderTicketsId,
@RequestBody String orderRefundBatchesId,
@RequestBody String refundData,
@RequestBody String reason
);
@PostMapping("admin/refund/cancel")
@ApiOperation("取消退款")
ResponseDto<Object> refundApply(@RequestBody List orderRefundsIdList);
@PostMapping("admin/refund/reapply")
@ApiOperation("再次提交审核")
ResponseDto<Object> refundReapply(@RequestBody List orderRefundsIdList);
@PostMapping("admin/refund/review")
@ApiOperation("一审运营 审核/驳回")
ResponseDto<Object> refundReview(@RequestBody List orderRefundsIdList, @RequestBody Integer status, @RequestBody String reject);
@PostMapping("admin/refund/execute")
@ApiOperation("二审财务 审核(执行退款)/驳回")
ResponseDto<Object> refundExecute(@RequestBody List orderRefundsIdList, @RequestBody Integer status, @RequestBody String refuse);
}
......@@ -159,8 +159,8 @@ public class KylinOrderRefundAdminController {
}
}
@PostMapping("refundCompleted")
@ApiOperation("主动关闭订单,完成退款")
// @PostMapping("refundCompleted")
// @ApiOperation("主动关闭订单,完成退款")
@ApiImplicitParams({
@ApiImplicitParam(type = "body", dataType = "Integer", name = "orderRefundsId", value = "退款id", required = true)
})
......
......@@ -375,38 +375,46 @@ public class KylinRefundsStatusServiceImpl {
);
// 开始执行退款
/*MultiValueMap<String, String> param = new LinkedMultiValueMap();
param.put("id", refundIds);
String postUrl = "sss";
String token = "sss";
MultiValueMap<String, String> headers = new LinkedMultiValueMap();
headers.add("Authorization", token);*/
headers.add("token", token);
/*for (KylinOrderRefunds refund: refundList) {
KylinOrderTickets oderInfo = kylinOrderTicketsMapper.selectCount(
for (KylinOrderRefunds refund: refundList) {
KylinOrderTickets oderInfo = kylinOrderTicketsMapper.selectOne(
new QueryWrapper<KylinOrderTickets>()
.eq("order_tickets_id", orderTicketsId)
.eq("order_tickets_id", refund.getOrderTicketsId())
);
$params = [
'code' => $refund->pay_code,
'order_refund_code' => $refund->order_refund_code,
'price' => $refund->price,
'reason' => $refund->reason,
'notify_url' => config('currency.API_REFUND_CALLBACK_URL')
];
$result = zhengzai::payRefund($params);
HashMap<String, Object> params = new HashMap();
params.put("code", oderInfo.getPayCode());
params.put("order_refund_code", refund.getOrderRefundCode());
params.put("price", refund.getPrice());
params.put("reason", refund.getReason());
params.put("notify_url", "sdadurl");
params.put("sign", "qwrertasf");
MultiValueMap<String, String> allParams = new LinkedMultiValueMap();
allParams.put("headers", (List<String>) headers);
allParams.put("form_params", (List<String>) params);
// start
// TODO: 2021/5/31 待整理
params.put("form_params", "qwrertasf");
String postResult = HttpUtil.post(postUrl, allParams, headers);
JsonNode postResultNew = JsonUtils.fromJson(postResult, JsonNode.class);
// 请求提审接口结果
if (postResultNew.get("message").toString() != "OK") {
KylinOrderRefunds kylinOrderRefundsErr = new KylinOrderRefunds();
kylinOrderRefundsErr.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_ERROR);
kylinOrderRefundsErr.setRefundError("通知退款中心失败");
kylinOrderRefundsErr.setRefundAt(LocalDateTime.now());
kylinOrderRefundsMapper.update(
kylinOrderRefundsErr,
new UpdateWrapper<KylinOrderRefunds>().eq("order_refunds_id", refund.getOrderTicketsId())
);
}
}
String postResult = HttpUtil.post(postUrl, param, headers);
JsonNode postResultNew = JsonUtils.fromJson(postResult, JsonNode.class);
// 请求提审接口结果
if (postResultNew.get("message").toString() != "OK") {
throw new Exception("申请退款出错");
}*/
return true;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment