无关风月
2025-08-05 2134c13b7b2815983281fdc819e3138ffde1bc48
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -20,7 +20,9 @@
import com.ruoyi.order.enums.OrderStatus;
import com.ruoyi.order.mapper.OrderMapper;
import com.ruoyi.order.model.ChargeOrder;
import com.ruoyi.order.model.Order;
import com.ruoyi.order.service.ChargeOrderService;
import com.ruoyi.order.service.OrderService;
import com.ruoyi.order.util.payment.model.RefundCallbackResult;
import com.ruoyi.order.util.payment.model.UniPayCallbackResult;
@@ -43,6 +45,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -74,6 +77,8 @@
public class OrderController extends BaseController {
    @Resource
    private OrderService orderService;
    @Resource
    private ChargeOrderService chargeOrderService;
    @Resource
    private TokenService tokenService;
    @Resource
@@ -203,6 +208,17 @@
                                                      @ApiParam("页码") @RequestParam("pageNum") Integer pageNum,
                                                      @ApiParam("每一页数据大小") @RequestParam("pageSize") Integer pageSize) {
        return R.ok(orderService.getShopOrderList(content,status,shopId,pageNum,pageSize));
    }
    @PostMapping("/importExpress")
    @ApiOperation(value = "2.0新增导入订单", tags = {"门店后台-订单管理"})
    public R importExpress(@RequestParam("file") MultipartFile file) {
       /* JSONObject jsonObject = JSONObject.parseObject(url);
        String url2 = jsonObject.getString("url");*/
        if (file.isEmpty()) {
            return R.fail("请选择要上传的文件");
        }
        return orderService.importExpress(file);
    }
    @PutMapping("/shopCancelOrder/{orderId}")
@@ -434,7 +450,6 @@
        }
    }
    /**
     * 获取商品销售数量
@@ -442,6 +457,17 @@
     * @param goodsId
     * @return
     */
    @PostMapping(value = "/getList")
    R<List<ChargeOrder>> getList(@RequestParam("siteId") Integer siteId) {
        List<ChargeOrder> list = chargeOrderService.lambdaQuery().eq(ChargeOrder::getPowerStationId, siteId).list();
        return R.ok(list);
    }
    /**
     * 获取商品销售数量
     *
     * @param goodsId
     * @return
     */
    @PostMapping("/getGoodsSaleNum")
    public R<Integer> getGoodsSaleNum(@RequestParam("goodsId") Integer goodsId, @RequestParam("type") Integer type) {
        Integer goodsSaleNum = orderService.getGoodsSaleNum(goodsId, type, null);