zouyu
2025-09-24 2bb12b1ca40b29b7edcf06ef3f3d6de24dde1c4c
inspect-server/src/main/java/com/ruoyi/inspect/controller/RawMaterialOrderController.java
@@ -1,5 +1,6 @@
package com.ruoyi.inspect.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -7,6 +8,7 @@
import com.ruoyi.basic.pojo.IfsInventoryQuantity;
import com.ruoyi.common.annotation.PersonalScope;
import com.ruoyi.inspect.dto.InsPlaceOrderDto;
import com.ruoyi.inspect.dto.OrderSplitDTO;
import com.ruoyi.inspect.dto.SampleProductDto;
import com.ruoyi.inspect.pojo.InsOrder;
import com.ruoyi.inspect.pojo.RawMaterialOrderTemplate;
@@ -22,7 +24,9 @@
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;
@@ -45,7 +49,7 @@
    @ApiOperation(value = "更具零件号获取标准树")
    @GetMapping("/selectStandardTreeListByPartNo")
    public Result selectStandardTreeListByPartNo(String partNo) {
        return Result.success(rawMaterialOrderService.selectStandardTreeListByPartNo(partNo));
        return rawMaterialOrderService.selectStandardTreeListByPartNo(partNo);
    }
    @ApiOperation(value = "原材料检验查询代下单")
@@ -56,14 +60,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));
    }
@@ -91,7 +97,6 @@
        return Result.success(rawMaterialOrderTemplateService.delRawMaterOrderTemplate(id));
    }
    /**
     * 报检批量
     * @param param 原材料id
@@ -100,7 +105,7 @@
    @ApiOperation(value = "报检批量")
    @PostMapping("/inspectionReport")
    public Result<?> inspectionReport(@RequestBody Map<String, Object> param) {
        List<Integer> ids = (List<Integer>) param.get("ids");
        List<Long> ids = (List<Long>) param.get("ids");
        return Result.success(rawMaterialOrderService.inspectionReport(ids));
    }
@@ -112,7 +117,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 +141,6 @@
    @ApiOperation(value = "报检")
    @PostMapping("/inspectionReportOne")
    public Result<?> inspectionReportOne(@RequestBody IfsInventoryQuantity ifsInventoryQuantity) {
        return Result.success(rawMaterialOrderService.inspectionReportOne(ifsInventoryQuantity));
    }
@@ -159,7 +163,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));
    }
@@ -196,7 +200,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 +212,7 @@
     */
    @ApiOperation(value = "原材料下单通知免检或者多次检验")
    @GetMapping("/notificationRawOrder")
    public Result<?> notificationRawOrder(Integer ifsInventoryId){
    public Result<?> notificationRawOrder(Long ifsInventoryId){
        return Result.success(rawMaterialOrderService.notificationRawOrder(ifsInventoryId));
    }
@@ -264,7 +268,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 +304,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 +318,35 @@
    @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));
    }
}