|
|
@@ -2,6 +2,7 @@ package com.fs.app.controller;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.fs.app.annotation.Login;
|
|
|
import com.fs.app.utils.JwtUtils;
|
|
|
import com.fs.common.annotation.Log;
|
|
|
@@ -33,6 +34,7 @@ import com.fs.store.service.IFsExpressService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
@@ -51,6 +53,7 @@ import static com.fs.live.service.impl.LiveServiceImpl.to16Hex;
|
|
|
* @author fs
|
|
|
* @date 2025-07-08
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
@RestController
|
|
|
@RequestMapping("/app/live/liveOrder")
|
|
|
public class LiveOrderController extends AppBaseController
|
|
|
@@ -69,6 +72,8 @@ public class LiveOrderController extends AppBaseController
|
|
|
@ApiOperation("物流查询多运单号")
|
|
|
@PostMapping("/getExpressMulti")
|
|
|
public R getExpressMulti( @Validated @RequestBody FsStoreOrderExpressParam param){
|
|
|
+ log.info("物流查询多运单号 请求参数: {}", JSON.toJSONString(param));
|
|
|
+
|
|
|
LiveOrder order=liveOrderService.selectLiveOrderByOrderId(String.valueOf(param.getOrderId()));
|
|
|
if (ObjectUtil.isNull(order)) {
|
|
|
throw new CustomException("订单不存在");
|
|
|
@@ -83,6 +88,8 @@ public class LiveOrderController extends AppBaseController
|
|
|
@ApiOperation("物流查询")
|
|
|
@PostMapping("/getExpress")
|
|
|
public R getExpress( @Validated @RequestBody FsStoreOrderExpressParam param){
|
|
|
+ log.info("物流查询 参数: {}", JSON.toJSONString(param));
|
|
|
+
|
|
|
LiveOrder order=liveOrderService.selectLiveOrderByOrderId(String.valueOf(param.getOrderId()));
|
|
|
if (ObjectUtil.isNull(order)) {
|
|
|
throw new CustomException("订单不存在");
|
|
|
@@ -102,6 +109,8 @@ public class LiveOrderController extends AppBaseController
|
|
|
@GetMapping("/list")
|
|
|
public R list(LiveOrder liveOrder)
|
|
|
{
|
|
|
+ log.info("查询订单列表 参数: {}", JSON.toJSONString(liveOrder));
|
|
|
+
|
|
|
PageHelper.startPage(Integer.parseInt(ServletUtils.getParameter("pageNum")) ,Integer.parseInt(ServletUtils.getParameter("pageSize")) );
|
|
|
try {
|
|
|
liveOrder.setUserId(getUserId());
|
|
|
@@ -121,6 +130,8 @@ public class LiveOrderController extends AppBaseController
|
|
|
@GetMapping("/export")
|
|
|
public AjaxResult export(LiveOrder liveOrder)
|
|
|
{
|
|
|
+ log.info("订单导出 参数: {}", JSON.toJSONString(liveOrder));
|
|
|
+
|
|
|
List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
|
|
|
ExcelUtil<LiveOrder> util = new ExcelUtil<LiveOrder>(LiveOrder.class);
|
|
|
return util.exportExcel(list, "订单数据");
|
|
|
@@ -133,12 +144,16 @@ public class LiveOrderController extends AppBaseController
|
|
|
@GetMapping(value = "/info/{orderId}")
|
|
|
public AjaxResult getInfo(@PathVariable("orderId") String orderId)
|
|
|
{
|
|
|
+ log.info("获取订单详细信息 参数: {}",orderId);
|
|
|
+
|
|
|
return AjaxResult.success(liveOrderService.selectLiveOrderByOrderId(orderId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation("确认订单")
|
|
|
@PostMapping("/confirm")
|
|
|
public R confirm(@Validated @RequestBody LiveOrderConfirmParam param, HttpServletRequest request){
|
|
|
+ log.info("确认订单 参数: {}", JSON.toJSONString(param));
|
|
|
+
|
|
|
param.setUserId(Long.parseLong(getUserId()));
|
|
|
return liveOrderService.confirmOrder(param);
|
|
|
}
|
|
|
@@ -149,6 +164,8 @@ public class LiveOrderController extends AppBaseController
|
|
|
@RepeatSubmit
|
|
|
public R buy(@RequestBody LiveOrder liveOrder)
|
|
|
{
|
|
|
+ log.info("购物车购买 参数: {}", JSON.toJSONString(liveOrder));
|
|
|
+
|
|
|
liveOrder.setUserId(getUserId());
|
|
|
return liveOrderService.buy(liveOrder);
|
|
|
}
|
|
|
@@ -162,6 +179,8 @@ public class LiveOrderController extends AppBaseController
|
|
|
@RepeatSubmit
|
|
|
public R add(@RequestBody LiveOrder liveOrder)
|
|
|
{
|
|
|
+ log.info("新增订单: {}", JSON.toJSONString(liveOrder));
|
|
|
+
|
|
|
liveOrder.setUserId(getUserId());
|
|
|
return liveOrderService.createLiveOrder(liveOrder);
|
|
|
}
|
|
|
@@ -170,6 +189,7 @@ public class LiveOrderController extends AppBaseController
|
|
|
@ApiOperation("计算订单金额")
|
|
|
@PostMapping("/computed")
|
|
|
public R computed(@Validated @RequestBody LiveOrderComputedParam param){
|
|
|
+ log.info("计算订单金额 {}",JSON.toJSONString(param));
|
|
|
|
|
|
LiveOrderComputeDTO dto=liveOrderService.computedOrder(Long.parseLong(getUserId()),param);
|
|
|
return R.ok().put("data",dto);
|
|
|
@@ -195,6 +215,7 @@ public class LiveOrderController extends AppBaseController
|
|
|
@Deprecated
|
|
|
public R getExpress(@PathVariable("id") Long id)
|
|
|
{
|
|
|
+ log.info("查看物流状态 {}",id);
|
|
|
|
|
|
LiveOrder order=liveOrderService.selectLiveOrderByOrderId(String.valueOf(id));
|
|
|
ExpressInfoDTO expressInfoDTO=null;
|
|
|
@@ -218,6 +239,8 @@ public class LiveOrderController extends AppBaseController
|
|
|
@PostMapping(value = "/pay")
|
|
|
public void pay(LiveOrder liveOrder)
|
|
|
{
|
|
|
+ log.info("支付订单 参数: {}",liveOrder);
|
|
|
+
|
|
|
liveOrderService.handlePay(liveOrder);
|
|
|
}
|
|
|
|
|
|
@@ -244,6 +267,8 @@ public class LiveOrderController extends AppBaseController
|
|
|
@Log(title = "退款", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/refundOrderMoney")
|
|
|
public synchronized R refundOrderMoney(@Validated @RequestBody LiveOrderRefundParam param, HttpServletRequest request) {
|
|
|
+ log.info("退款 {}",JSON.toJSONString(param));
|
|
|
+
|
|
|
return liveOrderService.refundOrderMoney(param.getOrderId());
|
|
|
}
|
|
|
|
|
|
@@ -255,6 +280,8 @@ public class LiveOrderController extends AppBaseController
|
|
|
@RepeatSubmit
|
|
|
public R cancelConfirm(@PathVariable String orderId,@PathVariable String type)
|
|
|
{
|
|
|
+ log.info("订单确认 参数 orderId: {} type: {}", orderId, type);
|
|
|
+
|
|
|
LiveOrder byId = liveOrderService.getById(orderId);
|
|
|
List<Map<String, String>> allCodeDescMap = null;
|
|
|
if (type.equals("0"))
|
|
|
@@ -268,6 +295,7 @@ public class LiveOrderController extends AppBaseController
|
|
|
@GetMapping(value = "/liveOrderUser/{liveId}")
|
|
|
public R liveOrderUser(@PathVariable String liveId)
|
|
|
{
|
|
|
+ log.info("正在购买的用户 参数: {}",liveId);
|
|
|
return liveOrderService.liveOrderUser(liveId);
|
|
|
}
|
|
|
|
|
|
@@ -275,6 +303,8 @@ public class LiveOrderController extends AppBaseController
|
|
|
@ApiOperation("取消订单")
|
|
|
@PostMapping("/cancelOrder")
|
|
|
public R cancelOrder(@Validated @RequestBody LiveOrderCancelParam param, HttpServletRequest request){
|
|
|
+ log.info("取消订单 参数: {}",JSON.toJSONString(param));
|
|
|
+
|
|
|
LiveOrder order=liveOrderService.selectLiveOrderByOrderId(String.valueOf(param.getOrderId()));
|
|
|
if (ObjectUtil.isNull(order)) {
|
|
|
throw new CustomException("订单不存在");
|
|
|
@@ -287,6 +317,8 @@ public class LiveOrderController extends AppBaseController
|
|
|
@ApiOperation("完成订单")
|
|
|
@PostMapping("/finishOrder")
|
|
|
public R finishOrder(@Validated @RequestBody LiveOrderCancelParam param, HttpServletRequest request){
|
|
|
+ log.info("完成订单 参数: {}",JSON.toJSONString(param));
|
|
|
+
|
|
|
return liveOrderService.finishOrder(param.getOrderId());
|
|
|
}
|
|
|
@ApiOperation("完成订单")
|