From 004ee58feda41620f621db1fb8773f1b56eaf71e Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 30 十二月 2025 14:28:41 +0800
Subject: [PATCH] 外购成品功能迁移v1
---
inspect-server/src/main/java/com/ruoyi/inspect/controller/RawMaterialOrderController.java | 89 ++++++++++++++++++++++++++++++++++----------
1 files changed, 68 insertions(+), 21 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 f75ca3f..85b6577 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
@@ -1,32 +1,34 @@
package com.ruoyi.inspect.controller;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.basic.dto.*;
+import com.ruoyi.basic.dto.IfsInventoryQuantityCheckDto;
+import com.ruoyi.basic.dto.IfsInventoryQuantityDto;
+import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto;
import com.ruoyi.basic.pojo.IfsInventoryQuantity;
import com.ruoyi.common.annotation.PersonalScope;
+import com.ruoyi.common.core.domain.Result;
+import com.ruoyi.common.enums.OrderType;
+import com.ruoyi.common.utils.WxCpUtils;
+import com.ruoyi.framework.exception.ErrorException;
import com.ruoyi.inspect.dto.InsPlaceOrderDto;
-import com.ruoyi.inspect.dto.SampleProductDto;
-import com.ruoyi.inspect.pojo.InsOrder;
+import com.ruoyi.inspect.dto.OrderSplitDTO;
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;
-import com.ruoyi.common.utils.JackSonUtil;
-import com.ruoyi.common.utils.WxCpUtils;
-import com.ruoyi.inspect.dto.CopperInsOrderDto;
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 org.springframework.web.multipart.MultipartFile;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
/**
* @Author zhuo
@@ -56,14 +58,16 @@
@ApiOperation(value = "鍘熸潗鏂欐楠屾煡璇㈡楠屼腑")
@GetMapping("/getIfsByStateOne")
-// @PreAuthorize("@ss.hasPermi('business:order')")
-// @PersonalScope(permsName = "business:order", objectName = IfsInventoryQuantityDto.class, paramName = "createUser")
+ @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));
}
@ApiOperation(value = "鍘熸潗鏂欐楠屾煡璇㈠凡妫�楠�")
@GetMapping("/getIfsByOver")
+ @PreAuthorize("@ss.hasPermi('business:order')")
+ @PersonalScope(permsName = "business:order", objectName = IfsInventoryQuantitySupplierDto.class, paramName = "createUser")
public Result getIfsByOver(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){
return Result.success(rawMaterialOrderService.getIfsByOver(page, ifsInventoryQuantityDto));
}
@@ -100,8 +104,12 @@
@ApiOperation(value = "鎶ユ鎵归噺")
@PostMapping("/inspectionReport")
public Result<?> inspectionReport(@RequestBody Map<String, Object> param) {
- List<Integer> ids = (List<Integer>) param.get("ids");
- return Result.success(rawMaterialOrderService.inspectionReport(ids));
+ List<Long> ids = (List<Long>) param.get("ids");
+ String orderType = Objects.nonNull(param.get("orderType"))?param.get("orderType").toString():"";
+ if(!OrderType.validateValue(orderType)){
+ throw new ErrorException("鎵归噺鎶ユ澶辫触,闈炴硶鐨勯攢鍞鍗曞垎绫绘灇涓�");
+ }
+ return Result.success(rawMaterialOrderService.inspectionReport(ids,orderType));
}
/**
@@ -112,7 +120,7 @@
@ApiOperation(value = "鎾ら攢鎶ユ")
@PostMapping("/revokeInspectionReport")
public Result<?> revokeInspectionReport(@RequestBody Map<String, Object> param) {
- Integer id = (Integer) param.get("id");
+ Long id = Long.parseLong(param.get("id").toString());
return Result.success(rawMaterialOrderService.revokeInspectionReport(id));
}
@@ -136,7 +144,6 @@
@ApiOperation(value = "鎶ユ")
@PostMapping("/inspectionReportOne")
public Result<?> inspectionReportOne(@RequestBody IfsInventoryQuantity ifsInventoryQuantity) {
-
return Result.success(rawMaterialOrderService.inspectionReportOne(ifsInventoryQuantity));
}
@@ -159,7 +166,7 @@
@ApiOperation(value = "鍘熸潗鏂欐挙閿�涓嬪崟")
@GetMapping("/repealRawOrder")
public Result<?> repealRawOrder(@RequestBody Map<String, Object> param){
- Integer ifsInventoryId = (Integer) param.get("ifsInventoryId");
+ Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString());
return Result.success(rawMaterialOrderService.repealRawOrder(ifsInventoryId));
}
@@ -173,7 +180,7 @@
@ApiOperation(value = "浠撳簱鎶ユ鏌ヨ")
@GetMapping("/getWarehouseSubmit")
- public Result getWarehouseSubmit(Page page, IfsInventoryQuantity ifsInventoryQuantity) throws Exception {
+ public Result getWarehouseSubmit(Page page, IfsInventoryQuantity ifsInventoryQuantity) {
return Result.success(rawMaterialOrderService.getWarehouseSubmit(page, ifsInventoryQuantity));
}
@@ -196,7 +203,7 @@
@ApiOperation(value = "鍘熸潗鏂欎笅鍗曟斁琛屽厤妫�")
@PostMapping("/rawOrderRelease")
public Result<?> rawOrderRelease(@RequestBody Map<String, Object> param){
- Integer ifsInventoryId = (Integer) param.get("ifsInventoryId");
+ Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString());
String partDetail = (String) param.get("partDetail");
return Result.success(rawMaterialOrderService.rawOrderRelease(ifsInventoryId, partDetail));
}
@@ -208,7 +215,7 @@
*/
@ApiOperation(value = "鍘熸潗鏂欎笅鍗曢�氱煡鍏嶆鎴栬�呭娆℃楠�")
@GetMapping("/notificationRawOrder")
- public Result<?> notificationRawOrder(Integer ifsInventoryId){
+ public Result<?> notificationRawOrder(Long ifsInventoryId){
return Result.success(rawMaterialOrderService.notificationRawOrder(ifsInventoryId));
}
@@ -217,6 +224,7 @@
@PreAuthorize("@ss.hasPermi('get:Ifs:ByAll')")
@GetMapping("/getIfsByAll")
public Result getIfsByAll(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){
+ ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue());
return Result.success(rawMaterialOrderService.getIfsByOver(page, ifsInventoryQuantityDto));
}
@@ -232,6 +240,7 @@
@GetMapping("/getIfsByFinish")
public Result getIfsByFinish(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) throws Exception {
ifsInventoryQuantityDto.setIsFinish(1);
+ ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue());
return Result.success(rawMaterialOrderService.getIfsByOver(page, ifsInventoryQuantityDto));
}
@@ -264,7 +273,7 @@
@ApiOperation(value = "璁╂鏀捐")
@PostMapping("/concessionRelease")
public Result<?> concessionRelease(@RequestBody Map<String, Object> param){
- Integer ifsInventoryId = (Integer) param.get("ifsInventoryId");
+ Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString());
return Result.success(rawMaterialOrderService.concessionRelease(ifsInventoryId));
}
@@ -300,6 +309,8 @@
@ApiOperation(value = "鍘熸潗鏂欐楠屾煡璇㈠搴︽楠�")
@GetMapping("/getIfsByQuarter")
+ @PreAuthorize("@ss.hasPermi('business:order')")
+ @PersonalScope(permsName = "business:order", objectName = IfsInventoryQuantitySupplierDto.class, paramName = "createUser")
public Result getIfsByQuarter(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){
return Result.success(rawMaterialOrderService.getIfsByQuarter(page, ifsInventoryQuantityDto));
}
@@ -312,8 +323,44 @@
@ApiOperation(value = "鎻愬墠鍏ュ簱")
@PostMapping("/advancedGodown")
public Result<?> advancedGodown(@RequestBody Map<String, Object> param){
- Integer ifsInventoryId = (Integer) param.get("ifsInventoryId");
+ Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString());
return Result.success(rawMaterialOrderService.advancedGodown(ifsInventoryId));
}
+ /**
+ * 涓嬭浇璁㈠崟鎷嗗垎瀵煎叆妯℃澘
+ */
+ @ApiOperation(value = "涓嬭浇璁㈠崟鎷嗗垎瀵煎叆妯℃澘")
+ @GetMapping("/downloadTemplate")
+ public void downloadTemplate(HttpServletResponse response){
+ rawMaterialOrderService.downloadTemplate(response);
+ }
+
+ /**
+ * 涓嬭浇璁㈠崟鎷嗗垎瀵煎叆妯℃澘
+ */
+ @ApiOperation(value = "瀵煎叆璁㈠崟鎷嗗垎鏁版嵁")
+ @PostMapping("/importSplitOrderData")
+ public Result importSplitOrderData(@RequestParam(value = "file") MultipartFile file, @RequestParam("ifsId") Long ifsId, HttpServletRequest request){
+ return rawMaterialOrderService.importSplitOrderData(file,ifsId,request);
+ }
+
+ /**
+ * 纭鎷嗗垎璁㈠崟
+ */
+ @ApiOperation(value = "纭鎷嗗垎璁㈠崟")
+ @PostMapping("/confirmSplitOrder")
+ public Result confirmSplitOrder(@RequestBody OrderSplitDTO orderSplitDTO){
+ return Result.success(rawMaterialOrderService.confirmSplitOrder(orderSplitDTO));
+ }
+
+ /**
+ * 鏍规嵁ifsId鏌ヨ涓嬪崟鏁伴噺
+ */
+ @ApiOperation(value = "鏍规嵁ifsId鏌ヨ涓嬪崟鏁伴噺")
+ @GetMapping("/getOrderCountByIfsId/{ifsId}")
+ public Result getOrderCountByIfsId(@PathVariable("ifsId") Long ifsId){
+ return Result.success(rawMaterialOrderService.getOrderCountByIfsId(ifsId));
+ }
+
}
--
Gitblit v1.9.3