package com.ruoyi.web.controller.system;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.system.pojo.dto.OrderPageDTO;
|
import com.ruoyi.system.pojo.vo.*;
|
import com.ruoyi.system.service.OrderService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
|
@Slf4j
|
@RestController
|
@RequestMapping("/system/order")
|
@Api( tags = "后台-订单管理")
|
public class OrderController {
|
@Resource
|
private OrderService orderService;
|
|
/**
|
* 分页
|
*/
|
@PostMapping("/getOrderPage")
|
@ApiOperation(value = "订单分页")
|
@PreAuthorize("@ss.hasPermi('order:manage')")
|
public R<IPage<OrderPageVO>> getOrderPage(@RequestBody OrderPageDTO dto) {
|
return R.ok(orderService.getOrderPage(dto));
|
}
|
/**
|
* 查看详情
|
*/
|
@GetMapping("/detail/{id}")
|
@ApiOperation(value = "查看详情-基础信息")
|
@PreAuthorize("@ss.hasPermi('order:manage')")
|
public R<OrderDetailVO> detail(@PathVariable("id") String id) {
|
return R.ok(orderService.detail(id));
|
}
|
|
/**
|
* 企业工商信息
|
*/
|
@GetMapping("/business/{id}")
|
@ApiOperation(value = "查看详情-企业工商信息")
|
@PreAuthorize("@ss.hasPermi('order:manage')")
|
public R<BusinessVO> business(@PathVariable("id") String id) {
|
return R.ok(orderService.business(id));
|
}
|
|
|
/**
|
* 企业异常信息
|
*/
|
@GetMapping("/error/{id}")
|
@ApiOperation(value = "查看详情-企业异常信息")
|
@PreAuthorize("@ss.hasPermi('order:manage')")
|
public R error(@PathVariable("id") String id) {
|
return orderService.error(id);
|
}
|
/**
|
* 企业变更信息
|
*/
|
@GetMapping("/change/{id}")
|
@ApiOperation(value = "查看详情-企业变更信息")
|
@PreAuthorize("@ss.hasPermi('order:manage')")
|
public R change(@PathVariable("id") String id) {
|
return orderService.change(id);
|
}
|
/**
|
* 企业纳税信息
|
*/
|
@GetMapping("/tax/{id}")
|
@ApiOperation(value = "查看详情-企业纳税信息")
|
@PreAuthorize("@ss.hasPermi('order:manage')")
|
public R tax(@PathVariable("id") String id) {
|
return orderService.tax(id);
|
}
|
|
/**
|
* 企业发票信息
|
*/
|
@GetMapping("/invoice/{id}")
|
@ApiOperation(value = "查看详情-企业发票信息")
|
@PreAuthorize("@ss.hasPermi('order:manage')")
|
public R invoice(@PathVariable("id") String id) {
|
return orderService.invoice(id);
|
}
|
/**
|
* 删除
|
*/
|
@DeleteMapping("/delete/{id}")
|
@ApiOperation(value = "删除")
|
@PreAuthorize("@ss.hasPermi('order:manage')")
|
public R delete(@PathVariable("id") String id) {
|
orderService.delete(id);
|
return R.ok();
|
}
|
|
|
/**
|
* 上、下架
|
*/
|
@PutMapping("/shelves/{id}")
|
@ApiOperation(value = "上、下架")
|
@PreAuthorize("@ss.hasPermi('order:manage')")
|
public R shelves(@PathVariable("id") String id) {
|
orderService.shelves(id);
|
return R.ok();
|
}
|
|
/**
|
* 取消交易
|
*/
|
@PutMapping("/cancel/{id}")
|
@ApiOperation(value = "取消交易")
|
@PreAuthorize("@ss.hasPermi('order:manage')")
|
public R cancel(@PathVariable("id") String id) {
|
orderService.cancel(id);
|
return R.ok();
|
}
|
|
|
/**
|
* 平台取消订单支付回退
|
* @return
|
*/
|
@ResponseBody
|
@PostMapping("/refundPayMoneyCallback")
|
public String refundPayMoneyCallback(@RequestBody(required = false) String xmlData) {
|
System.out.println("平台取消订单:" + xmlData);
|
R callback = orderService.refundPayMoneyCallback(xmlData);
|
if (callback.getCode() == 200) {
|
return "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
|
}else {
|
System.err.println("支付回退错误:"+callback.getMsg());
|
return "<xml><return_code><![CDATA[FAIL]]></return_code></xml>";
|
}
|
}
|
}
|