From 1bea882533f08dc2fc8597c830e4e7a20eb8fc48 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 22 二月 2025 14:10:57 +0800
Subject: [PATCH] 资源要求-8修改
---
inspect-server/src/main/java/com/ruoyi/inspect/controller/RawMaterialOrderController.java | 39 +++++++++++++++++++++++----------------
1 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/controller/RawMaterialOrderController.java b/inspect-server/src/main/java/com/ruoyi/inspect/controller/RawMaterialOrderController.java
index 5ec41ee..1211049 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/controller/RawMaterialOrderController.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/controller/RawMaterialOrderController.java
@@ -5,9 +5,12 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.basic.dto.*;
import com.ruoyi.basic.pojo.IfsInventoryQuantity;
+import com.ruoyi.common.annotation.PersonalScope;
+import com.ruoyi.inspect.dto.InsPlaceOrderDto;
import com.ruoyi.inspect.dto.SampleProductDto;
import com.ruoyi.inspect.pojo.InsOrder;
import com.ruoyi.inspect.pojo.RawMaterialOrderTemplate;
+import com.ruoyi.inspect.service.InsOrderService;
import com.ruoyi.inspect.service.RawMaterialOrderService;
import com.ruoyi.inspect.service.RawMaterialOrderTemplateService;
import com.ruoyi.common.core.domain.Result;
@@ -17,6 +20,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@@ -34,6 +38,7 @@
@Api(tags = "鍘熸潗鏂欎笅鍗�")
public class RawMaterialOrderController {
+ private InsOrderService insOrderService;
private RawMaterialOrderService rawMaterialOrderService;
private RawMaterialOrderTemplateService rawMaterialOrderTemplateService;
@@ -51,6 +56,8 @@
@ApiOperation(value = "鍘熸潗鏂欐楠屾煡璇㈡楠屼腑")
@GetMapping("/getIfsByStateOne")
+// @PreAuthorize("@ss.hasPermi('business:order')")
+// @PersonalScope(permsName = "business:order", objectName = IfsInventoryQuantityDto.class, paramName = "createUser")
public Result getIfsByStateOne(Page page, IfsInventoryQuantityDto ifsInventoryQuantityDto){
return Result.success(rawMaterialOrderService.getIfsByStateOne(page, ifsInventoryQuantityDto));
}
@@ -75,7 +82,7 @@
@ApiOperation(value = "閫氳繃鍘熸潗鏂欐楠屽崟妯℃澘id鑾峰彇妫�楠屽崟妯℃澘鍐呭")
@GetMapping("/selectRawMaterOrderTemplateById")
public Result<?> selectRawMaterOrderTemplateById(Integer id) {
- return Result.success("鎴愬姛", rawMaterialOrderTemplateService.selectRawMaterOrderTemplateById(id));
+ return Result.success(rawMaterialOrderTemplateService.selectRawMaterOrderTemplateById(id));
}
@ApiOperation(value = "鍒犻櫎鍘熸潗鏂欐楠屽崟妯℃澘")
@@ -99,7 +106,7 @@
/**
* 鍙栨秷鎶ユ
- * @param param 鍘熸潗鏂欎笅鍗�
+ * @param param
* @return
*/
@ApiOperation(value = "鎾ら攢鎶ユ")
@@ -141,7 +148,7 @@
@ApiOperation(value = "鑾峰彇閾滀骇涓氶摼妫�娴嬫暟鎹�")
@GetMapping("/getIndustryChain")
public Result<?> getIndustryChain(Integer id) {
- return Result.success("鎴愬姛", rawMaterialOrderService.getIndustryChain(id));
+ return Result.success(rawMaterialOrderService.getIndustryChain(id));
}
/**
@@ -159,12 +166,8 @@
@ApiOperation(value = "鍘熸潗鏂欎笅鍗曞厤妫�")
@PostMapping("/addExemptionOrder")
- public Result<?> addExemptionOrder(String str) {
- Map<String, Object> map = JSON.parseObject(str, Map.class);
- JSONArray jsonArray = JSON.parseArray(map.get("list")+"");
- List<SampleProductDto> list = jsonArray.toJavaList(SampleProductDto.class);
- InsOrder insOrder = JSON.parseObject(JSON.toJSONString(map.get("insOrder")), InsOrder.class);
- return Result.success(rawMaterialOrderService.addExemptionOrder(list, insOrder));
+ public Result<?> addExemptionOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) {
+ return Result.success(rawMaterialOrderService.addExemptionOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getInsOrder()));
}
@@ -176,7 +179,7 @@
/**
* 鍙栨秷鎶ユ
- * @param id 鍘熸潗鏂欎笅鍗�
+ * @param id
* @return
*/
@ApiOperation(value = "鍒犻櫎鍘熸潗鏂欐姤妫�淇℃伅")
@@ -238,14 +241,18 @@
return Result.success();
}
+
+
+ @ApiOperation(value = "閾滃崟涓濅笅鍗�")
+ @PostMapping("/addRawCopperOrder")
+ public Result<?> addRawCopperOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) {
+ return Result.success(insOrderService.addRawCopperOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getCopperInsOrder()));
+ }
+
@ApiOperation(value = "閾滃崟涓濅笅鍗曞厤妫�")
@PostMapping("/addRawCopperOrderExemptionOrder")
- public Result<?> addRawCopperOrderExemptionOrder(String str) {
- Map<String, Object> map = JSON.parseObject(str, Map.class);
- JSONArray jsonArray = JSON.parseArray(map.get("list")+"");
- List<SampleProductDto> list = jsonArray.toJavaList(SampleProductDto.class);
- CopperInsOrderDto CopperInsOrder = JSON.parseObject(JSON.toJSONString(map.get("insOrder")), CopperInsOrderDto.class);
- return Result.success(rawMaterialOrderService.addRawCopperOrderExemptionOrder(list, CopperInsOrder));
+ public Result<?> addRawCopperOrderExemptionOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) {
+ return Result.success(rawMaterialOrderService.addRawCopperOrderExemptionOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getCopperInsOrder()));
}
/**
--
Gitblit v1.9.3