From 4c521b8f1fcc538f59cc0001dcf6649b0dee4880 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期四, 17 八月 2023 17:05:25 +0800
Subject: [PATCH] 生产订单
---
inventory-server/src/main/java/com/yuanchu/mom/controller/ConsignmentController.java | 26 ++------------------------
1 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/inventory-server/src/main/java/com/yuanchu/mom/controller/ConsignmentController.java b/inventory-server/src/main/java/com/yuanchu/mom/controller/ConsignmentController.java
index fef686e..8bfd65b 100644
--- a/inventory-server/src/main/java/com/yuanchu/mom/controller/ConsignmentController.java
+++ b/inventory-server/src/main/java/com/yuanchu/mom/controller/ConsignmentController.java
@@ -16,6 +16,7 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.yuanchu.mom.service.ConsignmentService;
@@ -51,17 +52,12 @@
})
@GetMapping("/selSale")
public Result selSale(String orderNumber) {
- //鍙湁閿�鍞崟瀹℃牳閫氳繃涔嬪悗鎵嶈兘鍙戣揣
- Sale sale = saleService.getOne(Wrappers.<Sale>query().eq("order_number", orderNumber));
- if (ObjectUtils.isEmpty(sale.getType()) || sale.getType() != 1 ) {
- return Result.fail("鍙湁閿�鍞崟瀹℃牳閫氳繃涔嬪悗鎵嶈兘鍙戣揣!");
- }
return Result.success(saleService.selSale(orderNumber));
}
@ApiOperation(value = "鏂板鎴愬搧鍙戣揣")
@PostMapping("/addCon")
- public Result addCon(@RequestHeader("token") String token, @RequestBody ConsignmentDto consignmentDto) throws Exception {
+ public Result addCon(@RequestHeader("token") String token, @Validated @RequestBody ConsignmentDto consignmentDto) throws Exception {
Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
return Result.success(consignmentService.addCon(data.get("name").replaceAll("\"", ""), consignmentDto));
}
@@ -84,25 +80,7 @@
return Result.success(map);
}
- @ApiOperation(value = "鏍规嵁鍙戣揣id鍒犻櫎")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "id", value = "鍙戣揣id", dataTypeClass = Integer.class, required = true)
- })
- @PostMapping("/delCon")
- public Result delCon(Integer id) {
- consignmentService.delCon(id);
- return Result.success();
- }
- @ApiOperation(value = "鎵归噺鍒犻櫎")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "ids", value = "ids", dataTypeClass = Integer.class, dataType = "List", required = true)
- })
- @PostMapping("/delAllCon")
- public Result delAllCon(@RequestParam("ids") List<Integer> ids) {
- consignmentService.delAllCon(ids);
- return Result.success();
- }
}
--
Gitblit v1.9.3