|
|
@@ -1,15 +1,20 @@
|
|
|
package com.sckw.order.controller;
|
|
|
|
|
|
+import com.sckw.core.exception.BusinessException;
|
|
|
+import com.sckw.core.utils.CollectionUtils;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
-import com.sckw.order.model.vo.req.AddTransportDemandDraftParam;
|
|
|
-import com.sckw.order.model.vo.req.AddTransportDemandParam;
|
|
|
-import com.sckw.order.model.vo.req.UpdateTransportDemandParam;
|
|
|
+import com.sckw.excel.utils.ExcelUtil;
|
|
|
+import com.sckw.order.model.dto.TransportDemandExport;
|
|
|
+import com.sckw.order.model.vo.req.*;
|
|
|
import com.sckw.order.serivce.KwoTransportDemandService;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* @desc: 运需controller
|
|
|
* @author: yzc
|
|
|
@@ -22,6 +27,13 @@ public class KwoTransportDemandController {
|
|
|
|
|
|
private final KwoTransportDemandService kwoTransportDemandService;
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc: 新增运需草稿
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-26 9:42
|
|
|
+ * @Param param:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
@PostMapping(value = "/addDraft", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult addDraft(@RequestBody @Validated AddTransportDemandDraftParam param) {
|
|
|
kwoTransportDemandService.addDraft(param);
|
|
|
@@ -29,6 +41,13 @@ public class KwoTransportDemandController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc: 新增运需上架
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-26 9:42
|
|
|
+ * @Param param:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
@PostMapping(value = "/addShelves", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult addShelves(@RequestBody @Validated AddTransportDemandParam param) {
|
|
|
kwoTransportDemandService.addShelves(param);
|
|
|
@@ -36,15 +55,115 @@ public class KwoTransportDemandController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc: 运需详情
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-26 9:43
|
|
|
+ * @Param id:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
@GetMapping("/detail")
|
|
|
public HttpResult detail(@RequestParam Long id) {
|
|
|
return HttpResult.ok(kwoTransportDemandService.detail(id));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc: 运需修改
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-26 9:43
|
|
|
+ * @Param param:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
@PostMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult update(@RequestBody @Validated UpdateTransportDemandParam param) {
|
|
|
kwoTransportDemandService.update(param);
|
|
|
return HttpResult.ok("运需修改成功!");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc: 运需分页查询
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-26 10:05
|
|
|
+ * @Param param:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/select", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public HttpResult select(@RequestBody @Validated SelectTransportDemandParam param) {
|
|
|
+ return HttpResult.ok(kwoTransportDemandService.select(param));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 运需统计
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-26 10:09
|
|
|
+ * @Param param:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/statistic", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public HttpResult statistic(@RequestBody StatisticTransportDemandParam param) {
|
|
|
+ return HttpResult.ok(kwoTransportDemandService.statistic(param));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 运需导出
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-26 10:09
|
|
|
+ * @Param params:
|
|
|
+ * @Param response:
|
|
|
+ * @return: void
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public void export(@RequestBody ExportTransportDemandParam param, HttpServletResponse response) {
|
|
|
+ List<TransportDemandExport> list = kwoTransportDemandService.export(param);
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
+ throw new BusinessException("导出数据为空!");
|
|
|
+ }
|
|
|
+ ExcelUtil.downData(response, TransportDemandExport.class, list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 运需上架
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-26 10:24
|
|
|
+ * @Param id:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @GetMapping("/putOnShelves")
|
|
|
+ public HttpResult putOnShelves(@RequestParam Long id) {
|
|
|
+ kwoTransportDemandService.putOnShelves(id);
|
|
|
+ return HttpResult.ok("上架成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 运需批量下架
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-26 10:25
|
|
|
+ * @Param ids:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @GetMapping("/batchTakeOffShelves")
|
|
|
+ public HttpResult batchTakeOffShelves(@RequestParam List<Long> ids) {
|
|
|
+ kwoTransportDemandService.batchTakeOffShelves(ids);
|
|
|
+ return HttpResult.ok("批量下架成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 运需批量删除
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-26 10:26
|
|
|
+ * @Param ids:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @GetMapping("/batchDelete")
|
|
|
+ public HttpResult batchDelete(@RequestParam List<Long> ids) {
|
|
|
+ kwoTransportDemandService.batchDelete(ids);
|
|
|
+ return HttpResult.ok("批量删除成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "/demandSquaresList", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public HttpResult demandSquaresList(@RequestBody @Validated TransportDemandSquaresParam param) {
|
|
|
+ return HttpResult.ok(kwoTransportDemandService.demandSquaresList(param));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|