huliguo
2025-07-17 2485a4875adda2ffd0e8cfccdf749f15fe8d48cb
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/OrderController.java
@@ -2,8 +2,6 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.utils.wx.RefundCallbackResult;
import com.ruoyi.system.pojo.dto.AppUserPageDTO;
import com.ruoyi.system.pojo.dto.OrderPageDTO;
import com.ruoyi.system.pojo.vo.*;
import com.ruoyi.system.service.OrderService;
@@ -14,9 +12,7 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@Slf4j
@RestController
@@ -57,41 +53,41 @@
    /**
     * todo redis 企业异常信息
     *  企业异常信息
     */
    @GetMapping("/error/{id}")
    @ApiOperation(value = "查看详情-企业异常信息")
    @PreAuthorize("@ss.hasPermi('order:manage')")
    public R<ErrorVO> error(@PathVariable("id") String id) {
        return R.ok(orderService.error(id));
    public R error(@PathVariable("id") String id) {
        return orderService.error(id);
    }
    /**
     * todo redis 企业变更信息
     *  企业变更信息
     */
    @GetMapping("/change/{id}")
    @ApiOperation(value = "查看详情-企业变更信息")
    @PreAuthorize("@ss.hasPermi('order:manage')")
    public R<ChangeVO> change(@PathVariable("id") String id) {
        return R.ok(orderService.change(id));
    public R change(@PathVariable("id") String id) {
        return orderService.change(id);
    }
    /**
     * todo redis 企业纳税信息
     *  企业纳税信息
     */
    @GetMapping("/tax/{id}")
    @ApiOperation(value = "查看详情-企业纳税信息")
    @PreAuthorize("@ss.hasPermi('order:manage')")
    public R<TaxVO> tax(@PathVariable("id") String id) {
        return R.ok(orderService.tax(id));
    public R tax(@PathVariable("id") String id) {
        return orderService.tax(id);
    }
    /**
     * todo redis 企业发票信息
     * 企业发票信息
     */
    @GetMapping("/invoice/{id}")
    @ApiOperation(value = "查看详情-企业纳税信息")
    @ApiOperation(value = "查看详情-企业发票信息")
    @PreAuthorize("@ss.hasPermi('order:manage')")
    public R<InvoiceVO> invoice(@PathVariable("id") String id) {
        return R.ok(orderService.invoice(id));
    public R invoice(@PathVariable("id") String id) {
        return orderService.invoice(id);
    }
    /**
     *  删除
@@ -127,28 +123,21 @@
        return R.ok();
    }
    /**
     * 订单取消支付回退
     *
     * @param refundCallbackResult
     * @param response
     * 平台取消订单支付回退
     * @return
     */
    @ResponseBody
    @GetMapping("/refundPayMoneyCallback")
    public void refundPayMoneyCallback(RefundCallbackResult refundCallbackResult, HttpServletResponse response) {
        R callback = orderService.refundPayMoneyCallback(refundCallbackResult);
    @PostMapping("/refundPayMoneyCallback")
    public String refundPayMoneyCallback(@RequestBody(required = false) String xmlData) {
        System.out.println("平台取消订单:" + xmlData);
        R callback = orderService.refundPayMoneyCallback(xmlData);
        if (callback.getCode() == 200) {
            response.setStatus(200);
            PrintWriter out = null;
            try {
                out = response.getWriter();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            out.println("success");
            out.flush();
            out.close();
            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>";
        }
    }
}