From 0e5bddf6084d3dfb7bcad7217d4320898416eba3 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 23 十月 2025 16:49:12 +0800
Subject: [PATCH] 拆分原材料和外购成品的业务流程(报检、下单、检验)

---
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsOrderInspectionServiceImpl.java                 |   35 ++
 inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsOrderMapper.java                                      |    2 
 inspect-server/src/main/java/com/ruoyi/inspect/dto/IfsPartPropsRecordDTO.java                                  |   13 +
 ruoyi-common/src/main/java/com/ruoyi/common/utils/api/IfsApiUtils.java                                         |    9 
 inspect-server/src/main/java/com/ruoyi/inspect/controller/OutsourcingFinishProductInspectionController.java    |   58 ++++
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java                   |   23 +
 inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsSplitOrderRecordMapper.java                           |    2 
 inspect-server/src/main/java/com/ruoyi/inspect/service/IfsOrderInspectionService.java                          |   20 +
 basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java                                      |    2 
 inspect-server/src/main/resources/mapper/InsOrderMapper.xml                                                    |    5 
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsPartPropsRecordServiceImpl.java                 |  111 ++++++++
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java                           |   85 +++---
 inspect-server/src/main/java/com/ruoyi/inspect/controller/IfsOrderInspectionController.java                    |   40 +++
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java                       |   11 
 inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsProductMapper.java                                    |    2 
 inspect-server/src/main/java/com/ruoyi/inspect/vo/IfsOrderVO.java                                              |   12 
 basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityDto.java                                    |    3 
 inspect-server/src/main/resources/mapper/IfsPartPropsRecordMapper.xml                                          |   24 +
 inspect-server/src/main/java/com/ruoyi/inspect/service/IfsPartPropsRecordService.java                          |   17 +
 basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java                                      |    3 
 inspect-server/src/main/java/com/ruoyi/inspect/controller/IfsPartPropsRecordController.java                    |   35 ++
 inspect-server/src/main/java/com/ruoyi/inspect/controller/RawMaterialOrderController.java                      |   11 
 performance-server/src/main/java/com/ruoyi/performance/mapper/AuxiliaryOutputWorkingHoursMapper.java           |    2 
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/OutsourcingFinishProductInspectionServiceImpl.java |   49 +++
 inspect-server/src/main/java/com/ruoyi/inspect/service/OutsourcingFinishProductInspectionService.java          |   37 ++
 inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsPartPropsRecordMapper.java                            |   20 +
 inspect-server/src/main/java/com/ruoyi/inspect/pojo/IfsPartPropsRecord.java                                    |   66 +++++
 basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantitySupplierDto.java                            |    3 
 inspect-server/src/main/java/com/ruoyi/inspect/service/RawMaterialOrderService.java                            |    2 
 ruoyi-common/src/main/java/com/ruoyi/common/enums/OrderType.java                                               |   44 +++
 30 files changed, 697 insertions(+), 49 deletions(-)

diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityDto.java
index 237224e..83db775 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityDto.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityDto.java
@@ -79,4 +79,7 @@
 
     @ApiModelProperty("妫�楠屼汉")
     private String userName;
+
+    @ApiModelProperty("閿�鍞鍗曞垎绫�")
+    private String orderType;
 }
diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantitySupplierDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantitySupplierDto.java
index 009b268..f8c0db4 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantitySupplierDto.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantitySupplierDto.java
@@ -29,6 +29,9 @@
     @ApiModelProperty("妫�楠屽璞�")
     private String sampleType;
 
+    @ApiModelProperty("閿�鍞鍗曞垎绫诲悕绉�")
+    private String orderTypeName;
+
     @ExcelProperty(index = 7, value = "鏍峰搧鍚嶇О")
     @ApiModelProperty("鏍峰搧鍚嶇О")
     private String sampleName;
diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java
index d824587..150dff8 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java
@@ -9,6 +9,7 @@
 import com.ruoyi.basic.pojo.StandardMethodList;
 import com.ruoyi.basic.pojo.StandardProductList;
 import com.ruoyi.basic.pojo.StandardTree;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -20,6 +21,7 @@
  * @createDate 2024-03-01 15:06:44
  * @Entity com.ruoyi.basic.pojo.StandardTree
  */
+@Mapper
 public interface StandardTreeMapper extends BaseMapper<StandardTree> {
 
     List<FactoryDto> selectStandardTreeList();
diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java
index 2b592bc..4ed7eca 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java
@@ -27,6 +27,9 @@
     @ApiModelProperty("璁㈠崟鍙�")
     private String orderNo;
 
+    @ApiModelProperty("璁㈠崟绫诲瀷(01raw:鍘熸潗鏂欙紝02wg:澶栬喘鎴愬搧)")
+    private String orderType;
+
     @ApiModelProperty("琛屽彿")
     private String lineNo;
 
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/controller/IfsOrderInspectionController.java b/inspect-server/src/main/java/com/ruoyi/inspect/controller/IfsOrderInspectionController.java
new file mode 100644
index 0000000..8fe3059
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/controller/IfsOrderInspectionController.java
@@ -0,0 +1,40 @@
+package com.ruoyi.inspect.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto;
+import com.ruoyi.common.annotation.PersonalScope;
+import com.ruoyi.common.core.domain.Result;
+import com.ruoyi.inspect.service.IfsOrderInspectionService;
+import com.ruoyi.inspect.service.RawMaterialOrderService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * ifs閿�鍞鍗曟姤妫�controller
+ */
+@RestController
+@RequestMapping("/ifsOrderInspection")
+public class IfsOrderInspectionController {
+
+    @Autowired
+    private IfsOrderInspectionService ifsOrderInspectionService;
+
+    @ApiOperation(value = "閿�鍞鍗曟姤妫�鏌ヨ鍏ㄩ儴")
+    @PreAuthorize("@ss.hasPermi('get:Ifs:ByAll')")
+    @GetMapping("/getIfsByAll")
+    public Result getIfsByAll(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){
+        return Result.success(ifsOrderInspectionService.getIfsByOver(page, ifsInventoryQuantityDto));
+    }
+
+    @ApiOperation(value = "閿�鍞鍗曟姤妫�鏌ョ湅宸插畬鎴愪俊鎭�")
+    @GetMapping("/getIfsByFinish")
+    public Result getIfsByFinish(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) {
+        ifsInventoryQuantityDto.setIsFinish(1);
+        return Result.success(ifsOrderInspectionService.getIfsByOver(page, ifsInventoryQuantityDto));
+    }
+
+}
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/controller/IfsPartPropsRecordController.java b/inspect-server/src/main/java/com/ruoyi/inspect/controller/IfsPartPropsRecordController.java
new file mode 100644
index 0000000..06c86ea
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/controller/IfsPartPropsRecordController.java
@@ -0,0 +1,35 @@
+package com.ruoyi.inspect.controller;
+
+import com.ruoyi.common.core.domain.Result;
+import com.ruoyi.inspect.dto.IfsPartPropsRecordDTO;
+import com.ruoyi.inspect.pojo.IfsPartPropsRecord;
+import com.ruoyi.inspect.service.IfsPartPropsRecordService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * ifs闆朵欢灞炴�ontroller
+ */
+@Api("ifs闆朵欢灞炴��")
+@RestController
+@RequestMapping("/ifsPartProps")
+public class IfsPartPropsRecordController {
+
+    @Autowired
+    private IfsPartPropsRecordService ifsPartPropsRecordService;
+
+    @ApiOperation(value = "鏂板鎴栦繚瀛橀浂浠跺睘鎬�")
+    @PostMapping("/saveOrUpdateProps")
+    public Result saveOrUpdateProps(@RequestBody  IfsPartPropsRecordDTO ifsPartPropsRecord){
+        return Result.success(ifsPartPropsRecordService.saveOrUpdateProps(ifsPartPropsRecord));
+    }
+
+    @ApiOperation(value = "鏌ヨifs璁㈠崟鐨勯浂浠跺睘鎬ц褰�")
+    @GetMapping("/getOneByIfsId/{ifsId}")
+    public Result getOneByIfsId(@PathVariable("ifsId") Long ifsId){
+        return Result.success(ifsPartPropsRecordService.getOneByIfsId(ifsId));
+    }
+
+}
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/controller/OutsourcingFinishProductInspectionController.java b/inspect-server/src/main/java/com/ruoyi/inspect/controller/OutsourcingFinishProductInspectionController.java
new file mode 100644
index 0000000..5590267
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/controller/OutsourcingFinishProductInspectionController.java
@@ -0,0 +1,58 @@
+package com.ruoyi.inspect.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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.inspect.service.OutsourcingFinishProductInspectionService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 澶栬喘鎴愬搧妫�楠宑ontroller
+ */
+@RestController
+@RequestMapping("/outsourcingFinishProduct")
+public class OutsourcingFinishProductInspectionController {
+
+    @Autowired
+    private OutsourcingFinishProductInspectionService outsourcingFinishProductInspectionService;
+
+    @ApiOperation(value = "浠撳簱鎶ユ鏌ヨ")
+    @GetMapping("/getWarehouseSubmit")
+    public Result getWarehouseSubmit(Page page, IfsInventoryQuantity ifsInventoryQuantity) {
+        return Result.success(outsourcingFinishProductInspectionService.getWarehouseSubmit(page, ifsInventoryQuantity));
+    }
+
+    @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(outsourcingFinishProductInspectionService.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(outsourcingFinishProductInspectionService.getIfsByOver(page, ifsInventoryQuantityDto));
+    }
+
+    @ApiOperation(value = "鍘熸潗鏂欐姤妫�鏌ヨ鍏ㄩ儴")
+    @PreAuthorize("@ss.hasPermi('get:Ifs:ByAll')")
+    @GetMapping("/getIfsByAll")
+    public Result getIfsByAll(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){
+        return Result.success(outsourcingFinishProductInspectionService.getIfsByOver(page, ifsInventoryQuantityDto));
+    }
+
+
+
+}
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 b1f7a65..bf78e7f 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
@@ -7,6 +7,8 @@
 import com.ruoyi.basic.dto.*;
 import com.ruoyi.basic.pojo.IfsInventoryQuantity;
 import com.ruoyi.common.annotation.PersonalScope;
+import com.ruoyi.common.enums.OrderType;
+import com.ruoyi.framework.exception.ErrorException;
 import com.ruoyi.inspect.dto.InsPlaceOrderDto;
 import com.ruoyi.inspect.dto.OrderSplitDTO;
 import com.ruoyi.inspect.dto.SampleProductDto;
@@ -31,6 +33,7 @@
 import java.io.File;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 /**
  * @Author zhuo
@@ -106,7 +109,11 @@
     @PostMapping("/inspectionReport")
     public Result<?> inspectionReport(@RequestBody Map<String, Object> param) {
         List<Long> ids = (List<Long>) param.get("ids");
-        return Result.success(rawMaterialOrderService.inspectionReport(ids));
+        String orderType = Objects.nonNull(param.get("ids"))?param.get("ids").toString():"";
+        if(!OrderType.validateValue(orderType)){
+            throw new ErrorException("鎵归噺鎶ユ澶辫触,闈炴硶鐨勯攢鍞鍗曞垎绫绘灇涓�");
+        }
+        return Result.success(rawMaterialOrderService.inspectionReport(ids,orderType));
     }
 
     /**
@@ -221,6 +228,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));
     }
 
@@ -236,6 +244,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));
     }
 
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/dto/IfsPartPropsRecordDTO.java b/inspect-server/src/main/java/com/ruoyi/inspect/dto/IfsPartPropsRecordDTO.java
new file mode 100644
index 0000000..6d78d3b
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/dto/IfsPartPropsRecordDTO.java
@@ -0,0 +1,13 @@
+package com.ruoyi.inspect.dto;
+
+import com.ruoyi.inspect.pojo.IfsPartPropsRecord;
+import lombok.Data;
+
+@Data
+public class IfsPartPropsRecordDTO extends IfsPartPropsRecord {
+
+    private String partNo;
+
+    private String lotBatchNo;
+
+}
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsPartPropsRecordMapper.java b/inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsPartPropsRecordMapper.java
new file mode 100644
index 0000000..7e7b986
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsPartPropsRecordMapper.java
@@ -0,0 +1,20 @@
+package com.ruoyi.inspect.mapper;
+
+import com.ruoyi.inspect.pojo.IfsPartPropsRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @author 27233
+* @description 閽堝琛ㄣ�恑fs_part_props_record(ifs璁㈠崟闆朵欢灞炴�ц褰曡〃)銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2025-10-23 15:00:34
+* @Entity com.ruoyi.inspect.pojo.IfsPartPropsRecord
+*/
+@Mapper
+public interface IfsPartPropsRecordMapper extends BaseMapper<IfsPartPropsRecord> {
+
+}
+
+
+
+
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsSplitOrderRecordMapper.java b/inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsSplitOrderRecordMapper.java
index 1aa56b6..98e719b 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsSplitOrderRecordMapper.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsSplitOrderRecordMapper.java
@@ -2,6 +2,7 @@
 
 import com.ruoyi.inspect.pojo.IfsSplitOrderRecord;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
 * @author 27233
@@ -9,6 +10,7 @@
 * @createDate 2025-09-23 11:20:20
 * @Entity com.ruoyi.inspect.pojo.IfsSplitOrderRecord
 */
+@Mapper
 public interface IfsSplitOrderRecordMapper extends BaseMapper<IfsSplitOrderRecord> {
 
 }
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsOrderMapper.java b/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsOrderMapper.java
index a727014..1d69e5e 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsOrderMapper.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsOrderMapper.java
@@ -12,6 +12,7 @@
 import com.ruoyi.inspect.vo.IfsOrderVO;
 import com.ruoyi.inspect.vo.InsOrderPrintingVo;
 import com.ruoyi.inspect.vo.SampleDefectsFatherVo;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -24,6 +25,7 @@
  * @createDate 2024-03-12 16:17:55
  * @Entity com.yuanchu.mom.pojo.InsOrder
  */
+@Mapper
 public interface InsOrderMapper extends BaseMapper<InsOrder> {
 
     //鑾峰彇妫�楠屼笅鍗曟暟鎹�
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsProductMapper.java b/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsProductMapper.java
index d3e7fe3..6b87a62 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsProductMapper.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsProductMapper.java
@@ -8,6 +8,7 @@
 import com.ruoyi.inspect.dto.SampleProductRawAnalysisDto;
 import com.ruoyi.inspect.pojo.InsProduct;
 import com.ruoyi.inspect.pojo.InsProductDeviationWarningDetail;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -19,6 +20,7 @@
 * @createDate 2024-03-08 09:45:03
 * @Entity com.yuanchu.mom.pojo.InsProduct
 */
+@Mapper
 public interface InsProductMapper extends BaseMapper<InsProduct> {
 
     int selectOrderManDay(@Param("orderId") Integer orderId);
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/pojo/IfsPartPropsRecord.java b/inspect-server/src/main/java/com/ruoyi/inspect/pojo/IfsPartPropsRecord.java
new file mode 100644
index 0000000..1e422ec
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/pojo/IfsPartPropsRecord.java
@@ -0,0 +1,66 @@
+package com.ruoyi.inspect.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import lombok.Data;
+
+/**
+ * ifs璁㈠崟闆朵欢灞炴�ц褰曡〃
+ * @TableName ifs_part_props_record
+ */
+@TableName(value ="ifs_part_props_record")
+@Data
+public class IfsPartPropsRecord implements Serializable {
+    /**
+     * 涓婚敭id
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * ifs璁㈠崟id
+     */
+    private Long ifsInventoryId;
+
+    /**
+     * 杞藉叿缂栧彿
+     */
+    private String drumNo;
+
+    /**
+     * 璧峰绫虫爣
+     */
+    private BigDecimal startMeterMark;
+
+    /**
+     * 鎴绫虫爣
+     */
+    private BigDecimal endMeterMark;
+
+    /**
+     * 缁濈紭棰滆壊
+     */
+    private String insulationColor;
+
+    /**
+     * 澶栨姢棰滆壊
+     */
+    private String outerColor;
+
+    /**
+     * 鍗板瓧淇℃伅
+     */
+    private String letteringInfo;
+
+    /**
+     * ifs闆朵欢灞炴�ф洿鏂版爣璇�
+     */
+    private Boolean partPropsFlag;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/IfsOrderInspectionService.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/IfsOrderInspectionService.java
new file mode 100644
index 0000000..4400e9b
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/IfsOrderInspectionService.java
@@ -0,0 +1,20 @@
+package com.ruoyi.inspect.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto;
+import org.springframework.stereotype.Component;
+
+@Component
+public interface IfsOrderInspectionService {
+
+    /**
+     * 鏌ヨ宸叉楠�
+     * @param page
+     * @param ifsInventoryQuantityDto
+     * @return
+     */
+    IPage<IfsInventoryQuantitySupplierDto> getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto);
+
+
+}
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/IfsPartPropsRecordService.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/IfsPartPropsRecordService.java
new file mode 100644
index 0000000..8d70c77
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/IfsPartPropsRecordService.java
@@ -0,0 +1,17 @@
+package com.ruoyi.inspect.service;
+
+import com.ruoyi.inspect.dto.IfsPartPropsRecordDTO;
+import com.ruoyi.inspect.pojo.IfsPartPropsRecord;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author 27233
+* @description 閽堝琛ㄣ�恑fs_part_props_record(ifs璁㈠崟闆朵欢灞炴�ц褰曡〃)銆戠殑鏁版嵁搴撴搷浣淪ervice
+* @createDate 2025-10-23 15:00:34
+*/
+public interface IfsPartPropsRecordService extends IService<IfsPartPropsRecord> {
+
+    boolean saveOrUpdateProps(IfsPartPropsRecordDTO ifsPartPropsRecord);
+
+    IfsPartPropsRecord getOneByIfsId(Long ifsId);
+}
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/OutsourcingFinishProductInspectionService.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/OutsourcingFinishProductInspectionService.java
new file mode 100644
index 0000000..f645597
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/OutsourcingFinishProductInspectionService.java
@@ -0,0 +1,37 @@
+package com.ruoyi.inspect.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.dto.IfsInventoryQuantityDto;
+import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto;
+import com.ruoyi.basic.pojo.IfsInventoryQuantity;
+import org.springframework.stereotype.Component;
+
+@Component
+public interface OutsourcingFinishProductInspectionService {
+
+    /**
+     * 鎶ユ鏌ヨ
+     * @param page
+     * @param ifsInventoryQuantity
+     * @return
+     */
+    IPage<IfsInventoryQuantity> getWarehouseSubmit(Page page, IfsInventoryQuantity ifsInventoryQuantity);
+
+    /**
+     * 鏌ヨ宸叉楠�
+     * @param page
+     * @param ifsInventoryQuantityDto
+     * @return
+     */
+    IPage<IfsInventoryQuantitySupplierDto>  getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto);
+
+    /**
+     * 鏌ヨ妫�楠屽��
+     * @param page
+     * @param ifsInventoryQuantityDto
+     * @return
+     */
+    IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto);
+
+}
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/RawMaterialOrderService.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/RawMaterialOrderService.java
index a884031..c8d88f0 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/RawMaterialOrderService.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/RawMaterialOrderService.java
@@ -42,7 +42,7 @@
      */
     IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto);
 
-    int inspectionReport(List<Long> ids);
+    int inspectionReport(List<Long> ids,String orderType);
 
     int revokeInspectionReport(Long id);
 
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsOrderInspectionServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsOrderInspectionServiceImpl.java
new file mode 100644
index 0000000..5b05f88
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsOrderInspectionServiceImpl.java
@@ -0,0 +1,35 @@
+package com.ruoyi.inspect.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto;
+import com.ruoyi.basic.mapper.StandardTreeMapper;
+import com.ruoyi.common.enums.OrderType;
+import com.ruoyi.common.utils.QueryWrappers;
+import com.ruoyi.inspect.service.IfsOrderInspectionService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 閿�鍞鍗曟姤妫�service
+ */
+@Slf4j
+@Service
+public class IfsOrderInspectionServiceImpl implements IfsOrderInspectionService {
+
+    @Autowired
+    private StandardTreeMapper standardTreeMapper;
+
+    @Override
+    public IPage<IfsInventoryQuantitySupplierDto> getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) {
+        // todo: 鍙湅鎴�
+        String beginDeclareDate = ifsInventoryQuantityDto.getBeginDeclareDate();
+        String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate();
+        ifsInventoryQuantityDto.setBeginDeclareDate(null);
+        ifsInventoryQuantityDto.setEndDeclareDate(null);
+        IPage<IfsInventoryQuantitySupplierDto> ifsByOver = standardTreeMapper.getIfsByOver(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate);
+        ifsByOver.getRecords().forEach(r->r.setOrderTypeName(OrderType.getLabelByValue(r.getOrderType())));
+        return ifsByOver;
+    }
+}
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsPartPropsRecordServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsPartPropsRecordServiceImpl.java
new file mode 100644
index 0000000..bc4f41f
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsPartPropsRecordServiceImpl.java
@@ -0,0 +1,111 @@
+package com.ruoyi.inspect.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.basic.mapper.IfsInventoryQuantityMapper;
+import com.ruoyi.basic.pojo.IfsInventoryQuantity;
+import com.ruoyi.common.core.domain.Result;
+import com.ruoyi.common.utils.api.IfsApiUtils;
+import com.ruoyi.inspect.dto.IfsPartPropsRecordDTO;
+import com.ruoyi.inspect.mapper.IfsSplitOrderRecordMapper;
+import com.ruoyi.inspect.pojo.IfsPartPropsRecord;
+import com.ruoyi.inspect.pojo.IfsSplitOrderRecord;
+import com.ruoyi.inspect.service.IfsPartPropsRecordService;
+import com.ruoyi.inspect.mapper.IfsPartPropsRecordMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+/**
+* @author 27233
+* @description 閽堝琛ㄣ�恑fs_part_props_record(ifs璁㈠崟闆朵欢灞炴�ц褰曡〃)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+* @createDate 2025-10-23 15:00:34
+*/
+@Slf4j
+@Service
+public class IfsPartPropsRecordServiceImpl extends ServiceImpl<IfsPartPropsRecordMapper, IfsPartPropsRecord>
+    implements IfsPartPropsRecordService{
+
+    @Autowired
+    private IfsApiUtils ifsApiUtils;
+
+    @Autowired
+    private IfsInventoryQuantityMapper ifsInventoryQuantityMapper;
+
+    @Autowired
+    private IfsSplitOrderRecordMapper ifsSplitOrderRecordMapper;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean saveOrUpdateProps(IfsPartPropsRecordDTO ifsPartPropsRecord) {
+        if(Objects.isNull(ifsPartPropsRecord)){
+            throw new RuntimeException("鍙傛暟涓嶈兘涓虹┖");
+        }
+        //鍒ゆ柇鏄柊澧炶繕鏄洿鏂�
+        String actionType = Objects.isNull(ifsPartPropsRecord.getId())?"New":"Modify";
+        Map<String, Object> inAttrMap = new HashMap<>();
+        inAttrMap.put("RECORD_ID", UUID.randomUUID().toString());
+        inAttrMap.put("SYSCODE", "LIMS");
+        inAttrMap.put("SYSMODEL", "搴撳瓨鐗╂枡鎵规灞炴�т慨鏀�");
+        HashMap<String, Object> batchInfoMap = new HashMap<>();
+        batchInfoMap.put("CONTRACT","ZTNS");//鍩�
+        batchInfoMap.put("PART_NO",ifsPartPropsRecord.getPartNo());//闆朵欢鍙�
+        batchInfoMap.put("LOT_BATCH_NO",ifsPartPropsRecord.getLotBatchNo());//鎵规鍙�
+        batchInfoMap.put("ATTR1",ifsPartPropsRecord.getDrumNo());//杞藉叿缂栧彿
+        batchInfoMap.put("ATTR2",ifsPartPropsRecord.getStartMeterMark());//璧峰绫虫爣
+        batchInfoMap.put("ATTR3",ifsPartPropsRecord.getEndMeterMark());//鎴绫虫爣
+        batchInfoMap.put("ATTR4", ifsPartPropsRecord.getInsulationColor());//缁濈紭棰滆壊
+        batchInfoMap.put("ATTR5",ifsPartPropsRecord.getOuterColor());//澶栨姢棰滆壊
+        batchInfoMap.put("ATTR8",ifsPartPropsRecord.getLetteringInfo());//鍗板瓧淇℃伅
+        batchInfoMap.put("ACTION_TYPE",actionType);//鎿嶄綔绫诲瀷
+        inAttrMap.put("BATCH_INFO", Collections.singletonList(batchInfoMap));
+        Result result = ifsApiUtils.importPartLotAttr(JSONUtil.toJsonStr(inAttrMap));
+        if(result.getCode()!=200){
+            throw new RuntimeException("搴撳瓨鐗╂枡鎵规灞炴�ф洿鏂板け璐ワ細"+result.getMessage());
+        }
+        return this.saveOrUpdate(ifsPartPropsRecord);
+    }
+
+    @Override
+    public IfsPartPropsRecord getOneByIfsId(Long ifsId) {
+        //鏌ヨifs璁㈠崟淇℃伅
+        IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsId);
+        if(Objects.isNull(ifsInventoryQuantity)){
+            throw new RuntimeException("鏈壘鍒板搴旂殑IFS璁㈠崟淇℃伅");
+        }
+        //鍒ゆ柇鏄惁鏄媶鍒嗚鍗�
+        if(ifsInventoryQuantity.getIsSplitOrder().equals(1)){
+            //鏌ヨ鎷嗗垎璁板綍
+            IfsSplitOrderRecord splitRecord = ifsSplitOrderRecordMapper.selectOne(Wrappers.<IfsSplitOrderRecord>lambdaQuery()
+                    .eq(IfsSplitOrderRecord::getOrderNo, ifsInventoryQuantity.getOrderNo())
+                    .eq(IfsSplitOrderRecord::getPartNo, ifsInventoryQuantity.getPartNo())
+                    .eq(IfsSplitOrderRecord::getReleaseNo, ifsInventoryQuantity.getReleaseNo())
+                    .eq(IfsSplitOrderRecord::getLineNo, ifsInventoryQuantity.getLineNo())
+                    .eq(IfsSplitOrderRecord::getReceiptNo, ifsInventoryQuantity.getReceiptNo())
+                    .eq(IfsSplitOrderRecord::getLotBatchNo, ifsInventoryQuantity.getUpdateBatchNo())
+                    .eq(IfsSplitOrderRecord::getOrderNo, ifsInventoryQuantity.getOrderNo())
+            );
+            if(Objects.isNull(splitRecord)){
+                throw new RuntimeException("鏈壘鍒伴浂浠剁殑鎷嗗垎淇℃伅");
+            }
+            IfsPartPropsRecord ifsPartPropsRecord = new IfsPartPropsRecord();
+            ifsPartPropsRecord.setDrumNo(splitRecord.getDrumNo());
+            ifsPartPropsRecord.setLetteringInfo(splitRecord.getLetteringInfo());
+            ifsPartPropsRecord.setInsulationColor(splitRecord.getInsulationColor());
+            ifsPartPropsRecord.setOuterColor(splitRecord.getOuterColor());
+            ifsPartPropsRecord.setDrumNo(splitRecord.getDrumNo());
+            ifsPartPropsRecord.setDrumNo(splitRecord.getDrumNo());
+            return ifsPartPropsRecord;
+        }
+        return this.getOne(Wrappers.<IfsPartPropsRecord>lambdaQuery().eq(IfsPartPropsRecord::getIfsInventoryId,ifsId).last("limit 1"));
+    }
+}
+
+
+
+
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
index a3f4888..7f470f3 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -11,6 +11,7 @@
 import com.alibaba.fastjson.JSONObject;
 import com.aspose.words.License;
 import com.aspose.words.SaveFormat;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@@ -168,9 +169,7 @@
     public IPage<InsOrderPlanVO> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) {
         // todo: 浠呯湅鑷繁鎴栬�呭疄楠屽
         //鑾峰彇褰撳墠浜烘墍灞炲疄楠屽id
-
         String laboratory = null;
-
         String userName = null;
         Integer userId = null;
         if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId())) {
@@ -181,8 +180,14 @@
         Integer isCheck = insOrderPlanDTO.getIsCheck();
         insOrderPlanDTO.setIsCheck(null);
         String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//璇曢獙瀹�
+        QueryWrapper<InsOrderPlanDTO> queryWrapper = QueryWrappers.queryWrappers(insOrderPlanDTO);
+        if(ObjectUtils.isEmpty(insOrderPlanDTO.getTypeSource())){
+            queryWrapper.isNull("ifs_inventory_id");//濮旀墭璇曢獙鏌ヨ闈瀒fs鎶ユ璁㈠崟
+        }else{
+            queryWrapper.isNotNull("ifs_inventory_id");
+        }
         IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page,
-                QueryWrappers.queryWrappers(insOrderPlanDTO),
+                queryWrapper,
                 userName,
                 userId,
                 sonLaboratory,
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java
index a06a1c6..7d550f7 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java
@@ -26,6 +26,7 @@
 import com.ruoyi.common.constant.InsOrderTypeConstants;
 import com.ruoyi.common.core.domain.Result;
 import com.ruoyi.common.core.domain.entity.User;
+import com.ruoyi.common.enums.OrderType;
 import com.ruoyi.common.numgen.NumberGenerator;
 import com.ruoyi.common.utils.*;
 import com.ruoyi.common.utils.api.IfsApiUtils;
@@ -311,9 +312,10 @@
                 }
             }
         });
-        //鏄惁涓哄師鏉愭枡涓嬪崟
-        if (insOrder.getTypeSource() != null && insOrder.getTypeSource().equals(1)) {
-            // 鍘熸潗鏂欎笅鍗�: 濮旀墭浜哄氨鏄姤妫�浜�, 鐢熶骇鍗曚綅灏辨槸渚涘簲鍟嗗崟浣�
+
+        //鍘熸潗鏂欎笅鍗曟垨澶栬喘鎴愬搧涓嬪崟
+        if (Objects.nonNull(insOrder.getTypeSource())&&Objects.nonNull(insOrder.getIfsInventoryId())) {
+            // 濮旀墭浜哄氨鏄姤妫�浜�, 鐢熶骇鍗曚綅灏辨槸渚涘簲鍟嗗崟浣�
             IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(insOrder.getIfsInventoryId());
             Integer declareUserId = ifsInventoryQuantity.getDeclareUserId();
             User user = userMapper.selectById(declareUserId);
@@ -351,47 +353,51 @@
             upInsOrderOfState(insOrder);
 
             // 鍒嗛厤妫�楠屼汉
-            upInsOrder(insOrder.getId(), null, appointed != null ? appointed.toString() : null, SecurityUtils.getUserId().intValue(), "鍘熸潗鏂�");
+            String sonLaboratory = insOrder.getTypeSource().equals(1)?"鍘熸潗鏂�":"鎴愬搧瀹為獙瀹�";
+            upInsOrder(insOrder.getId(), null, appointed != null ? appointed.toString() : null, SecurityUtils.getUserId().intValue(), sonLaboratory);
 
-            // 鏍规嵁闆朵欢鍙峰垽鏂槸鍚︽槸杈呮潗
-            boolean isRaw = false;
-            StructureTestObject productObject = insOrderMapper.selectProductByPartNo(ifsInventoryQuantity.getPartNo());
-            // 鏌ヨ浜у搧
-            if (productObject != null && StrUtil.isNotBlank(productObject.getObjectType()) && productObject.getObjectType().equals("1")) {
-                isRaw = true;
-            } else {
-            // 鏌ヨ瀵硅薄
-                StructureTestObject testObject = insOrderMapper.selectByPartNo(ifsInventoryQuantity.getPartNo());
-                if (testObject != null && StrUtil.isNotBlank(testObject.getObjectType()) && testObject.getObjectType().equals("1")) {
+            //鏄惁涓哄師鏉愭枡涓嬪崟
+            if(insOrder.getTypeSource().equals(1)){
+                // 鏍规嵁闆朵欢鍙峰垽鏂槸鍚︽槸杈呮潗
+                boolean isRaw = false;
+                StructureTestObject productObject = insOrderMapper.selectProductByPartNo(ifsInventoryQuantity.getPartNo());
+                // 鏌ヨ浜у搧
+                if (productObject != null && StrUtil.isNotBlank(productObject.getObjectType()) && productObject.getObjectType().equals("1")) {
                     isRaw = true;
+                } else {
+                // 鏌ヨ瀵硅薄
+                    StructureTestObject testObject = insOrderMapper.selectByPartNo(ifsInventoryQuantity.getPartNo());
+                    if (testObject != null && StrUtil.isNotBlank(testObject.getObjectType()) && testObject.getObjectType().equals("1")) {
+                        isRaw = true;
+                    }
                 }
-            }
 
-            if (isRaw) {
-                // 鑾峰彇褰撳墠瀛e害鐨勫紑濮嬫椂闂村拰缁撴潫鏃堕棿
-                LocalDateTime now = LocalDateTime.now();
-                // 鑾峰彇褰撳墠鏈堜唤
-                int month = now.getMonthValue();
-                // 纭畾褰撳墠瀛e害鐨勫紑濮嬫湀浠�
-                int startMonth = (month - 1) / 3 * 3 + 1;
-                // 鏋勯�犲搴︾殑寮�濮嬫椂闂�
-                LocalDateTime startOfQuarter = LocalDateTime.of(now.getYear(), Month.of(startMonth), 1, 0, 0);
-                // 璁$畻涓嬩竴涓搴︾殑寮�濮嬫椂闂�
-                LocalDateTime startOfNextQuarter = startOfQuarter.plusMonths(3);
-                // 璁$畻褰撳墠瀛e害鐨勭粨鏉熸椂闂�
-                LocalDateTime endOfQuarter = startOfNextQuarter.minusSeconds(1);
+                if (isRaw) {
+                    // 鑾峰彇褰撳墠瀛e害鐨勫紑濮嬫椂闂村拰缁撴潫鏃堕棿
+                    LocalDateTime now = LocalDateTime.now();
+                    // 鑾峰彇褰撳墠鏈堜唤
+                    int month = now.getMonthValue();
+                    // 纭畾褰撳墠瀛e害鐨勫紑濮嬫湀浠�
+                    int startMonth = (month - 1) / 3 * 3 + 1;
+                    // 鏋勯�犲搴︾殑寮�濮嬫椂闂�
+                    LocalDateTime startOfQuarter = LocalDateTime.of(now.getYear(), Month.of(startMonth), 1, 0, 0);
+                    // 璁$畻涓嬩竴涓搴︾殑寮�濮嬫椂闂�
+                    LocalDateTime startOfNextQuarter = startOfQuarter.plusMonths(3);
+                    // 璁$畻褰撳墠瀛e害鐨勭粨鏉熸椂闂�
+                    LocalDateTime endOfQuarter = startOfNextQuarter.minusSeconds(1);
 
-                // 鏍规嵁涓嬪崟鐨勮鏍煎瀷鍙峰垽鏂槸鍚︿负瀛e害棣栨鍑虹幇
-                Integer count = ifsInventoryQuantityMapper.selectIsFirst(insOrder.getPartDetail(),
-                        ifsInventoryQuantity.getSupplierName(),
-                        startOfNextQuarter,
-                        endOfQuarter);
+                    // 鏍规嵁涓嬪崟鐨勮鏍煎瀷鍙峰垽鏂槸鍚︿负瀛e害棣栨鍑虹幇
+                    Integer count = ifsInventoryQuantityMapper.selectIsFirst(insOrder.getPartDetail(),
+                            ifsInventoryQuantity.getSupplierName(),
+                            startOfNextQuarter,
+                            endOfQuarter);
 
-                if(count == 0) {
-                    ifsInventoryQuantity.setIsFirst(1);
-                    ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate()
-                            .eq(IfsInventoryQuantity::getId, insOrder.getIfsInventoryId())
-                            .set(IfsInventoryQuantity::getIsFirst, 1));
+                    if(count == 0) {
+                        ifsInventoryQuantity.setIsFirst(1);
+                        ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate()
+                                .eq(IfsInventoryQuantity::getId, insOrder.getIfsInventoryId())
+                                .set(IfsInventoryQuantity::getIsFirst, 1));
+                    }
                 }
             }
         }
@@ -1207,7 +1213,8 @@
          * TODO 鍚庣画闇�瑕佽皟鐢↖FS鐨勬帴鍙� 绉诲叆鐨勫簱浣嶅彿 toLocation
          */
         // 妫�楠屽悗绉诲簱
-        toLocation = "1301";
+        //1301:鍘熸潗鏂欏悎鏍煎簱锛孋P-02-001:鎴愬搧搴�
+        toLocation = StringUtils.equals(inventoryQuantity.getOrderType(), OrderType.RAW.getValue())?"1301":"CP-02-001";
         Map<String, Object> moveResultMap = new HashMap<>();
         List<Map<String, Object>> moveResultList = new ArrayList<>();
         Map<String, Object> moveMap = new HashMap<>();
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/OutsourcingFinishProductInspectionServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/OutsourcingFinishProductInspectionServiceImpl.java
new file mode 100644
index 0000000..240141d
--- /dev/null
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/OutsourcingFinishProductInspectionServiceImpl.java
@@ -0,0 +1,49 @@
+package com.ruoyi.inspect.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.dto.IfsInventoryQuantityDto;
+import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto;
+import com.ruoyi.basic.mapper.StandardTreeMapper;
+import com.ruoyi.basic.pojo.IfsInventoryQuantity;
+import com.ruoyi.common.enums.OrderType;
+import com.ruoyi.common.utils.QueryWrappers;
+import com.ruoyi.inspect.service.OutsourcingFinishProductInspectionService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 澶栬喘鎴愬搧妫�楠宻erviceImpl
+ */
+@Slf4j
+@Service
+public class OutsourcingFinishProductInspectionServiceImpl implements OutsourcingFinishProductInspectionService {
+
+    @Autowired
+    private StandardTreeMapper standardTreeMapper;
+
+    @Override
+    public IPage<IfsInventoryQuantity> getWarehouseSubmit(Page page, IfsInventoryQuantity ifsInventoryQuantity) {
+        ifsInventoryQuantity.setOrderType(OrderType.WG.getValue());
+        return standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity));
+    }
+
+    @Override
+    public IPage<IfsInventoryQuantitySupplierDto> getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) {
+        String beginDeclareDate = ifsInventoryQuantityDto.getBeginDeclareDate();
+        String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate();
+        ifsInventoryQuantityDto.setBeginDeclareDate(null);
+        ifsInventoryQuantityDto.setEndDeclareDate(null);
+        ifsInventoryQuantityDto.setOrderType(OrderType.WG.getValue());
+        IPage<IfsInventoryQuantitySupplierDto> ifsByOver = standardTreeMapper.getIfsByOver(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate);
+        ifsByOver.getRecords().forEach(r->r.setOrderTypeName(OrderType.getLabelByValue(r.getOrderType())));
+        return ifsByOver;
+    }
+
+    @Override
+    public IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto) {
+        ifsInventoryQuantityDto.setOrderType(OrderType.WG.getValue());
+        return standardTreeMapper.getIfsByStateOne(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto));
+    }
+}
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
index 0215407..2fc3082 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
@@ -25,6 +25,7 @@
 import com.ruoyi.common.core.domain.Result;
 import com.ruoyi.common.core.domain.entity.User;
 import com.ruoyi.common.config.WechatProperty;
+import com.ruoyi.common.enums.OrderType;
 import com.ruoyi.common.utils.LimsDateUtil;
 import com.ruoyi.common.utils.QueryWrappers;
 import com.ruoyi.common.utils.SecurityUtils;
@@ -152,11 +153,15 @@
 
     @Override
     public IPage<IfsInventoryQuantity> getWarehouseSubmit(IPage<IfsInventoryQuantity> page, IfsInventoryQuantity ifsInventoryQuantity) {
+        if(ifsInventoryQuantity.getIsInspect().equals(1)){
+            ifsInventoryQuantity.setOrderType(OrderType.RAW.getValue());
+        }
         return standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity));
     }
 
     @Override
     public IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto) {
+        ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue());
         return standardTreeMapper.getIfsByStateOne(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto));
     }
 
@@ -167,13 +172,14 @@
      * @return
      */
     @Override
-    public int inspectionReport(List<Long> ids) {
+    public int inspectionReport(List<Long> ids,String orderType) {
         Integer userId = SecurityUtils.getUserId().intValue();
         ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate()
                 .in(IfsInventoryQuantity::getId, ids)
                 .set(IfsInventoryQuantity::getDeclareUser, userMapper.selectById(userId).getName())
                 .set(IfsInventoryQuantity::getDeclareUserId, userId)
                 .set(IfsInventoryQuantity::getIsInspect, 1)
+                .set(IfsInventoryQuantity::getOrderType,orderType)
                 .set(IfsInventoryQuantity::getDeclareDate, LocalDateTime.now())
         );
         threadPoolTaskExecutor.execute(() -> {
@@ -235,6 +241,10 @@
     @Override
     public int inspectionReportOne(IfsInventoryQuantity ifsInventoryQuantity) {
         Integer userId = SecurityUtils.getUserId().intValue();
+        boolean validateValue = OrderType.validateValue(ifsInventoryQuantity.getOrderType());
+        if(!validateValue){
+            throw new ErrorException("鎶ユ澶辫触锛岄潪娉曠殑閿�鍞鍗曞垎绫绘灇涓�");
+        }
         ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate()
                 .eq(IfsInventoryQuantity::getId, ifsInventoryQuantity.getId())
                 .set(IfsInventoryQuantity::getDeclareUser, userMapper.selectById(userId).getName())
@@ -242,6 +252,7 @@
                 .set(IfsInventoryQuantity::getIsInspect, 1)
                 .set(IfsInventoryQuantity::getDeclareDate, LocalDateTime.now())
                 .set(IfsInventoryQuantity::getUpdateBatchNo, ifsInventoryQuantity.getUpdateBatchNo())
+                .set(IfsInventoryQuantity::getOrderType,ifsInventoryQuantity.getOrderType())
         );
 
         threadPoolTaskExecutor.execute(() -> {
@@ -393,8 +404,9 @@
         String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate();
         ifsInventoryQuantityDto.setBeginDeclareDate(null);
         ifsInventoryQuantityDto.setEndDeclareDate(null);
-
+        ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue());
         IPage<IfsInventoryQuantitySupplierDto> ifsByOver = standardTreeMapper.getIfsByOver(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate);
+        ifsByOver.getRecords().forEach(r->r.setOrderTypeName(OrderType.getLabelByValue(r.getOrderType())));
         return ifsByOver;
     }
 
@@ -511,6 +523,9 @@
         ifsInventoryQuantity.setIsSource(0);
         ifsInventoryQuantity.setState(0);
         ifsInventoryQuantity.setIsFinish(0);
+        if(!OrderType.validateValue(ifsInventoryQuantity.getOrderType())){
+            throw new ErrorException("鏂板鎶ユ淇℃伅澶辫触锛岄潪娉曠殑閿�鍞鍗曞垎绫绘灇涓�");
+        }
         ifsInventoryQuantityMapper.insert(ifsInventoryQuantity);
     }
 
@@ -771,7 +786,7 @@
         String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate();
         ifsInventoryQuantityDto.setBeginDeclareDate(null);
         ifsInventoryQuantityDto.setEndDeclareDate(null);
-
+        ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue());
         return standardTreeMapper.getIfsByQuarter(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate);
     }
 
@@ -923,7 +938,7 @@
         if(Objects.nonNull(splitOrderList) && !splitOrderList.isEmpty()){
             List<Long> ids = splitOrderList.stream().map(IfsInventoryQuantity::getId).collect(Collectors.toList());
             ids.add(ifsInventoryQuantity.getId());
-            this.inspectionReport(ids);
+            this.inspectionReport(ids,OrderType.RAW.getValue());
         }
         //鍕鹃�夊悓姝ュ埌MES锛屼繚瀛樿鍗曟媶鍒嗚褰�
         if(orderSplitDTO.getPushToMes()){
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/vo/IfsOrderVO.java b/inspect-server/src/main/java/com/ruoyi/inspect/vo/IfsOrderVO.java
index a8ff832..d34319a 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/vo/IfsOrderVO.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/vo/IfsOrderVO.java
@@ -36,4 +36,16 @@
      */
     @ApiModelProperty("鏄惁鏄媶鍒嗚鍗�(0:鍚� 1:鏄�)")
     private Integer isSplitOrder;
+
+
+    /**
+     * ifs璁㈠崟鍒嗙被(01raw:鍘熸潗鏂� 02wg:澶栬喘鎴愬搧)
+     */
+    @ApiModelProperty("ifs璁㈠崟鍒嗙被(01raw:鍘熸潗鏂� 02wg:澶栬喘鎴愬搧)")
+    private String ifsOrderType;
+
+    private String partNo;
+
+    private String lotBatchNo;
+
 }
diff --git a/inspect-server/src/main/resources/mapper/IfsPartPropsRecordMapper.xml b/inspect-server/src/main/resources/mapper/IfsPartPropsRecordMapper.xml
new file mode 100644
index 0000000..c29c7a1
--- /dev/null
+++ b/inspect-server/src/main/resources/mapper/IfsPartPropsRecordMapper.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.inspect.mapper.IfsPartPropsRecordMapper">
+
+    <resultMap id="BaseResultMap" type="com.ruoyi.inspect.pojo.IfsPartPropsRecord">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="ifsInventoryId" column="ifs_inventory_id" jdbcType="BIGINT"/>
+            <result property="drumNo" column="drum_no" jdbcType="VARCHAR"/>
+            <result property="startMeterMark" column="start_meter_mark" jdbcType="DECIMAL"/>
+            <result property="endMeterMark" column="end_meter_mark" jdbcType="DECIMAL"/>
+            <result property="insulationColor" column="insulation_color" jdbcType="VARCHAR"/>
+            <result property="outerColor" column="outer_color" jdbcType="VARCHAR"/>
+            <result property="letteringInfo" column="lettering_info" jdbcType="VARCHAR"/>
+            <result property="partPropsFlag" column="part_props_flag" jdbcType="BIT"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,ifs_inventory_id,drum_no,
+        start_meter_mark,end_meter_mark,insulation_color,
+        outer_color,lettering_info,part_props_flag
+    </sql>
+</mapper>
diff --git a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
index 6f39cfc..78b65f5 100644
--- a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -474,7 +474,10 @@
                 isor.insulation_color,
                 isor.outer_color,
                 isor.drum_no,
-                iiq.is_split_order
+                iiq.is_split_order,
+                iiq.order_type AS ifs_order_type,
+                iiq.part_no,
+                iiq.update_batch_no AS lot_batch_no
         from ins_order io left join ifs_inventory_quantity iiq on io.ifs_inventory_id=iiq.id
                           left join ifs_split_order_record isor
                                     on iiq.order_no=isor.order_no
diff --git a/performance-server/src/main/java/com/ruoyi/performance/mapper/AuxiliaryOutputWorkingHoursMapper.java b/performance-server/src/main/java/com/ruoyi/performance/mapper/AuxiliaryOutputWorkingHoursMapper.java
index 97e9e39..b331be6 100644
--- a/performance-server/src/main/java/com/ruoyi/performance/mapper/AuxiliaryOutputWorkingHoursMapper.java
+++ b/performance-server/src/main/java/com/ruoyi/performance/mapper/AuxiliaryOutputWorkingHoursMapper.java
@@ -8,6 +8,7 @@
 import com.ruoyi.performance.dto.AuxiliaryOriginalHoursLookDto;
 import com.ruoyi.performance.dto.AuxiliaryOutputWorkingHoursDto;
 import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -21,6 +22,7 @@
  * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
  * @since 2024-05-28 03:48:48
  */
+@Mapper
 public interface AuxiliaryOutputWorkingHoursMapper extends BaseMapper<AuxiliaryOutputWorkingHours> {
 
     IPage<AuxiliaryOutputWorkingHoursDto> selectAuxiliaryOutputWorkingHours(Page page, @Param("ew") QueryWrapper<AuxiliaryOutputWorkingHoursDto> ew, @Param("ids") List<Long> ids);
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/OrderType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/OrderType.java
new file mode 100644
index 0000000..de83896
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/OrderType.java
@@ -0,0 +1,44 @@
+package com.ruoyi.common.enums;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum OrderType {
+
+    RAW("鍘熸潗鏂�","01raw"),
+    WG("澶栬喘鎴愬搧","02wg");
+
+    private String label,value;
+
+    public String getLabel() {
+        return label;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    OrderType(String label, String value) {
+        this.label = label;
+        this.value = value;
+    }
+
+    public static boolean validateValue(String value){
+        boolean flag = false;
+        for (OrderType orderType : OrderType.values()) {
+            if(StringUtils.isNotBlank(value)&&StringUtils.equals(orderType.getValue(),value)){
+                flag = true;
+            }
+        }
+        return flag;
+    }
+
+    public static String getLabelByValue(String value){
+        for (OrderType orderType : OrderType.values()) {
+            if(validateValue(value)&&StringUtils.equals(orderType.getValue(), value)){
+                return orderType.getLabel();
+            }
+        }
+        return "";
+    }
+
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/api/IfsApiUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/api/IfsApiUtils.java
index ca4d3a9..70551e6 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/api/IfsApiUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/api/IfsApiUtils.java
@@ -91,6 +91,15 @@
         return getResult("QUERY_INVENTORY_INFO_STD", inAttr, ifsProperties.getCustorderPort(), "鏌ヨ搴撳瓨淇℃伅-->");
     }
 
+    /**
+     * 搴撳瓨鐗╂枡鎵规灞炴�ф柊澧炰慨鏀规帴鍙�
+     *
+     * @param inAttr
+     * @return
+     */
+    public Result importPartLotAttr(String inAttr) {
+        return getResult("IMPORT_PART_LOT_ATTR_STD", inAttr, ifsProperties.getCustorder(), "搴撳瓨鐗╂枡鎵规灞炴�ф柊澧炰慨鏀规帴鍙�-->");
+    }
 
     /**
      * 閫氱敤鎺ュ彛

--
Gitblit v1.9.3