This commit is contained in:
2025-09-06 18:20:23 +08:00
parent 8562eb52bd
commit 014fd519a3
2 changed files with 27 additions and 36 deletions

View File

@@ -39,27 +39,7 @@ public class JDOrderController extends BaseController {
private final static String skey = "2192057370ef8140c201079969c956a3"; private final static String skey = "2192057370ef8140c201079969c956a3";
private final static String requestUrl = "http://192.168.8.88:6666/jd/"; private final static String requestUrl = "http://192.168.8.88:6666/jd/";
/**
* 列表查询(分页)
*/
@org.springframework.web.bind.annotation.GetMapping("/list")
public TableDataInfo list(JDOrder query) {
startPage();
java.util.List<JDOrder> list = jdOrderService.selectJDOrderList(query);
TableDataInfo dataTable = getDataTable(list);
List<JDOrder> rows = (List<JDOrder>) dataTable.getRows();
for (JDOrder jdOrder : rows) {
OrderRows orderRows = orderRowsService.selectOrderRowsByOrderId(jdOrder.getOrderId());
if (orderRows != null) {
jdOrder.setProPriceAmount(orderRows.getProPriceAmount());
jdOrder.setFinishTime(orderRows.getFinishTime());
} else {
jdOrder.setProPriceAmount(0.0);
}
}
return dataTable;
}
@PostMapping("/generatePromotionContent") @PostMapping("/generatePromotionContent")

View File

@@ -4,6 +4,8 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.jarvis.domain.OrderRows;
import com.ruoyi.jarvis.service.IOrderRowsService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
@@ -24,18 +26,35 @@ import com.ruoyi.common.core.page.TableDataInfo;
@RequestMapping("/system/jdorder") @RequestMapping("/system/jdorder")
public class JDOrderListController extends BaseController public class JDOrderListController extends BaseController
{ {
@Autowired
private IJDOrderService jdOrderService; private final IJDOrderService jdOrderService;
private final IOrderRowsService orderRowsService;
public JDOrderListController(IJDOrderService jdOrderService, IOrderRowsService orderRowsService) {
this.jdOrderService = jdOrderService;
this.orderRowsService = orderRowsService;
}
/** /**
* 查询JD订单列表 * 查询JD订单列表
*/ */
@GetMapping("/list") @org.springframework.web.bind.annotation.GetMapping("/list")
public TableDataInfo list(JDOrder jdOrder) public TableDataInfo list(JDOrder query) {
{
startPage(); startPage();
List<JDOrder> list = jdOrderService.selectJDOrderList(jdOrder); java.util.List<JDOrder> list = jdOrderService.selectJDOrderList(query);
return getDataTable(list); TableDataInfo dataTable = getDataTable(list);
List<JDOrder> rows = (List<JDOrder>) dataTable.getRows();
for (JDOrder jdOrder : rows) {
OrderRows orderRows = orderRowsService.selectOrderRowsByOrderId(jdOrder.getOrderId());
if (orderRows != null) {
jdOrder.setProPriceAmount(orderRows.getProPriceAmount());
jdOrder.setFinishTime(orderRows.getFinishTime());
} else {
jdOrder.setProPriceAmount(0.0);
}
}
return dataTable;
} }
/** /**
@@ -48,7 +67,7 @@ public class JDOrderListController extends BaseController
String fileName = "JD订单数据"; String fileName = "JD订单数据";
List<JDOrder> list = jdOrderService.selectJDOrderList(jdOrder); List<JDOrder> list = jdOrderService.selectJDOrderList(jdOrder);
// 设置响应头,指定文件名 // 设置响应头,指定文件名
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
@@ -90,13 +109,5 @@ public class JDOrderListController extends BaseController
return toAjax(jdOrderService.updateJDOrder(jdOrder)); return toAjax(jdOrderService.updateJDOrder(jdOrder));
} }
/**
* 删除JD订单
*/
@Log(title = "JD订单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(jdOrderService.deleteJDOrderByIds(ids));
} }
} }