|
@@ -1,11 +1,22 @@
|
|
|
package com.sckw.freight.controller;
|
|
package com.sckw.freight.controller;
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
+import com.sckw.freight.entity.freight.KwpLedgerLogistics;
|
|
|
|
|
+import com.sckw.freight.entity.kll.KllOrder;
|
|
|
|
|
+import com.sckw.freight.mapper.kll.KllOrderMapper;
|
|
|
|
|
+import com.sckw.freight.model.vo.request.RequestPageInfo;
|
|
|
|
|
+import com.sckw.freight.model.vo.request.TestModel;
|
|
|
|
|
+import com.sckw.freight.model.vo.response.ResponsePageData;
|
|
|
|
|
+import com.sckw.freight.service.freight.IKwpLedgerLogisticsService;
|
|
|
|
|
+import com.sckw.freight.service.kll.IKllOrderService;
|
|
|
import com.sckw.freight.util.DateTimeUtil;
|
|
import com.sckw.freight.util.DateTimeUtil;
|
|
|
import com.sckw.freight.util.R;
|
|
import com.sckw.freight.util.R;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @Author xucaiqin
|
|
* @Author xucaiqin
|
|
@@ -15,11 +26,46 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("/index")
|
|
@RequestMapping("/index")
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
public class IndexController {
|
|
public class IndexController {
|
|
|
-
|
|
|
|
|
- @GetMapping("")
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ IKwpLedgerLogisticsService iKwpLedgerLogisticsService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ IKllOrderService iKllOrderService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ KllOrderMapper kllOrderMapper;
|
|
|
|
|
+ @GetMapping("/index")
|
|
|
public R<String> index() {
|
|
public R<String> index() {
|
|
|
return R.ok(DateTimeUtil.formatYMD());
|
|
return R.ok(DateTimeUtil.formatYMD());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @PostMapping("/t1")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public R<TestModel> index(@RequestBody TestModel testModel) {
|
|
|
|
|
+ return R.ok(testModel);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/t2")
|
|
|
|
|
+ public R<List<KwpLedgerLogistics>> getDbData( ) {
|
|
|
|
|
+ List<KwpLedgerLogistics> list = iKwpLedgerLogisticsService.list();
|
|
|
|
|
+ return R.ok(list);
|
|
|
|
|
+ }
|
|
|
|
|
+ @GetMapping("/t3")
|
|
|
|
|
+ public R< KllOrder> getkllData( ) {
|
|
|
|
|
+ KllOrder list = iKllOrderService.getById(167);
|
|
|
|
|
+ return R.ok(list);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ @PostMapping("/page")
|
|
|
|
|
+ public R<ResponsePageData<KllOrder>> getPageData(@RequestBody RequestPageInfo requestPageInfo) {
|
|
|
|
|
+ // 创建分页对象
|
|
|
|
|
+ Page<KllOrder> page = new Page<>(requestPageInfo.getPage(), requestPageInfo.getPageSize());
|
|
|
|
|
+ // 执行分页查询
|
|
|
|
|
+ IPage<KllOrder> orderPage = kllOrderMapper.selectPage(page, null);
|
|
|
|
|
+
|
|
|
|
|
+ ResponsePageData<KllOrder> responsePageData = new ResponsePageData<>();
|
|
|
|
|
+ responsePageData.setPage(orderPage.getCurrent());
|
|
|
|
|
+ responsePageData.setPageSize(orderPage.getSize());
|
|
|
|
|
+ responsePageData.setList(orderPage.getRecords());
|
|
|
|
|
+ responsePageData.setPages(orderPage.getPages());
|
|
|
|
|
+ return R.ok(responsePageData);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|