From 5864e92e24a5fee0a5fed15b505933ac10df5cf4 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 19 三月 2025 17:53:21 +0800
Subject: [PATCH] 1.零件绑定 2.给对象绑定车间 3.检验对象导入模板讨论及联调导入功能 4.检验对象查询优化

---
 basic-server/src/main/java/com/ruoyi/basic/pojo/WorkShopFile.java                               |    2 
 basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPart.java                                |    9 
 basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPartLog.java                             |   57 +++++
 basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductServiceImpl.java                 |   84 ++++++--
 basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObject.java                        |   10 +
 basic-server/src/main/java/com/ruoyi/basic/service/WorkShopFileService.java                     |    5 
 basic-server/src/main/resources/mapper/StructureTestMapper.xml                                  |    8 
 basic-server/src/main/java/com/ruoyi/basic/dto/ProductPartDto.java                              |   10 +
 basic-server/src/main/java/com/ruoyi/basic/mapper/WorkShopMapper.java                           |    5 
 basic-server/src/main/java/com/ruoyi/basic/service/ProductService.java                          |    3 
 basic-server/src/main/java/com/ruoyi/basic/dto/WorkShopDto.java                                 |    6 
 basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartLogMapper.java                     |    7 
 basic-server/src/main/java/com/ruoyi/basic/mapper/WorkShopFileMapper.java                       |    5 
 basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObjectPart.java                    |    6 
 basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectPartServiceImpl.java |   14 +
 inspect-server/src/main/java/com/ruoyi/inspect/controller/WorkShopController.java               |    6 
 basic-server/src/main/java/com/ruoyi/basic/controller/ProductPartController.java                |   20 ++
 basic-server/src/main/java/com/ruoyi/basic/dto/StructureTestObjectPartDto.java                  |   10 +
 basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectData.java                   |   10 +
 basic-server/src/main/java/com/ruoyi/basic/service/impl/WorkShopFileServiceImpl.java            |    9 
 basic-server/src/main/java/com/ruoyi/basic/controller/CapacityScopeController.java              |   35 ++
 basic-server/src/main/java/com/ruoyi/basic/dto/PageTestObjectDto.java                           |    5 
 basic-server/src/main/java/com/ruoyi/basic/dto/StructureTestObjectDto.java                      |   15 +
 basic-server/src/main/java/com/ruoyi/basic/service/impl/WorkShopServiceImpl.java                |   12 
 basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartServiceImpl.java             |   78 +++++++
 basic-server/src/main/java/com/ruoyi/basic/service/impl/CapacityScopeServiceImpl.java           |   18 
 basic-server/src/main/resources/mapper/ProductPartMapper.xml                                    |   26 ++
 basic-server/src/main/java/com/ruoyi/basic/pojo/WorkShop.java                                   |    4 
 basic-server/src/main/resources/mapper/ProductPartLogMapper.xml                                 |    8 
 basic-server/src/main/java/com/ruoyi/basic/service/ProductPartService.java                      |   14 +
 basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectPartService.java          |    3 
 /dev/null                                                                                       |    6 
 basic-server/src/main/java/com/ruoyi/basic/controller/StructureTestObjectPartController.java    |    8 
 basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartLogServiceImpl.java          |   18 +
 basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectMapper.java                |    2 
 basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartMapper.java                        |   12 +
 basic-server/src/main/java/com/ruoyi/basic/service/WorkShopService.java                         |    7 
 basic-server/src/main/java/com/ruoyi/basic/service/ProductPartLogService.java                   |   10 +
 38 files changed, 483 insertions(+), 84 deletions(-)

diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/CapacityScopeController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/CapacityScopeController.java
index f46439b..b30d50e 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/controller/CapacityScopeController.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/controller/CapacityScopeController.java
@@ -6,6 +6,8 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.dto.ProductDto;
+import com.ruoyi.basic.dto.StructureTestObjectDto;
 import com.ruoyi.common.core.domain.Result;
 import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.system.service.ISysDictTypeService;
@@ -24,6 +26,7 @@
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -61,7 +64,7 @@
 
     @ApiOperation(value = "鑾峰彇椤圭洰妫�楠屽弬鏁板垪琛�")
     @GetMapping("/selectItemParameterList")
-    public Result selectItemParameterList(Page page,StructureItemParameter itemParameter) {
+    public Result selectItemParameterList(Page page, StructureItemParameter itemParameter) {
         return Result.success(capacityScopeService.selectItemParameterList(page, itemParameter));
     }
 
@@ -85,7 +88,7 @@
 
     @ApiOperation(value = "鑾峰彇妫�楠屽璞�")
     @GetMapping("/selectTestObjectList")
-    public Result selectTestObjectList(Page page,PageTestObjectDto pageTestObjectDto) {
+    public Result selectTestObjectList(Page page, PageTestObjectDto pageTestObjectDto) {
         return Result.success(capacityScopeService.selectTestObjectList(page, pageTestObjectDto));
     }
 
@@ -121,7 +124,7 @@
 
     @ApiOperation(value = "缁存姢妫�楠屽璞$殑浜у搧")
     @GetMapping("/selectProductListByObjectId")
-    public Result selectProductListByObjectId(Page page,ProductDTO1 productDTO) {
+    public Result selectProductListByObjectId(Page page, ProductDTO1 productDTO) {
         return Result.success(productService.selectProductListByObjectId(page, productDTO));
     }
 
@@ -382,18 +385,32 @@
 
     @ApiOperation(value = "瀵煎叆妫�楠屽璞�")
     @PostMapping("/importExcel")
-    public Result importExcel(@RequestParam("file") MultipartFile file) {
-        try {
+    public Result importExcel(@RequestParam("file") MultipartFile file){
+        List<String> processedFiles = new ArrayList<>();
+        try (InputStream inputStream = file.getInputStream()) {
+            String fileHash = DigestUtils.md5Hex(inputStream);
+            if (processedFiles.contains(fileHash)) {
+                return Result.success(); // 宸插鐞嗚繃鐨勬枃浠剁洿鎺ヨ烦杩�
+            }
+            processedFiles.add(fileHash);
+
             EasyExcel.read(file.getInputStream(), StructureTestObjectData.class, new StructureTestObjectListener(productService)).sheet().doRead();
         } catch (IOException e) {
-            e.printStackTrace();
+            // 杩欓噷鍙互鏍规嵁瀹為檯鎯呭喌杩涜鏇村畬鍠勭殑閿欒澶勭悊锛屾瘮濡傝褰曟棩蹇楃瓑
+            System.err.println("璇诲彇鏂囦欢鏃跺彂鐢熼敊璇�: " + e.getMessage());
         }
         return Result.success();
     }
 
-    @ApiOperation(value = "鏇存柊杞﹂棿")
+    @ApiOperation(value = "鏇存柊浜у搧杞﹂棿")
     @PostMapping("/updateWorkShop")
-    public Result updateWorkShop(Integer productId,Integer workShopId,String name) {
-        return Result.success(productService.updateWorkShop(productId,workShopId,name));
+    public Result updateWorkShop(@RequestBody ProductDto productDto) {
+        return Result.success(productService.updateWorkShop(productDto.getId(), productDto.getWorkShopId(), productDto.getWorkShopName()));
+    }
+
+    @ApiOperation(value = "鏇存柊妫�娴嬪璞¤溅闂�")
+    @PostMapping("/updateObjectWorkShop")
+    public Result updateObjectWorkShop(@RequestBody StructureTestObjectDto structureTestObjectDto) {
+        return Result.success(productService.updateObjectWorkShop(structureTestObjectDto));
     }
 }
diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/ProductPartController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/ProductPartController.java
index eec4f92..520142a 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/controller/ProductPartController.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/controller/ProductPartController.java
@@ -1,6 +1,7 @@
 package com.ruoyi.basic.controller;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.dto.ProductPartDto;
 import com.ruoyi.common.core.domain.Result;
 import com.ruoyi.basic.pojo.ProductPart;
 import com.ruoyi.basic.service.ProductPartService;
@@ -37,6 +38,13 @@
         return Result.success();
     }
 
+    @ApiOperation(value = "浜у搧闆朵欢澶嶆牳")
+    @PostMapping("/productPartReview")
+    public Result productPartReview(@RequestBody ProductPartDto productPartDto) {
+        productPartService.productPartReviewById(productPartDto);
+        return Result.success();
+    }
+
     @ApiOperation(value = "鍒犻櫎浜у搧闆朵欢")
     @DeleteMapping("/deleteProductPart")
     public Result deleteProductPart(Integer id) {
@@ -44,4 +52,16 @@
         return Result.success();
     }
 
+    @ApiOperation(value = "鎴愬搧杩涘巶妫�楠岄」")
+    @GetMapping("/inspectionItems")
+    public Result inspectionItems(String sample,String productName){
+        return Result.success(productPartService.inspectionItems(sample,productName));
+    }
+
+    @ApiOperation(value = "浜у搧闆朵欢鏃ュ織鏌ヨ")
+    @GetMapping("/productPartLogList")
+    public Result productPartLogList(Page page,Integer id){
+        return Result.success(productPartService.productPartLogList(page,id));
+    }
+
 }
diff --git a/basic-server/src/main/java/com/ruoyi/basic/controller/StructureTestObjectPartController.java b/basic-server/src/main/java/com/ruoyi/basic/controller/StructureTestObjectPartController.java
index 463fb47..285cd65 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/controller/StructureTestObjectPartController.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/controller/StructureTestObjectPartController.java
@@ -2,6 +2,7 @@
 
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.dto.StructureTestObjectPartDto;
 import com.ruoyi.common.core.domain.Result;
 import com.ruoyi.basic.pojo.StructureTestObjectPart;
 import com.ruoyi.basic.service.StructureTestObjectPartService;
@@ -38,6 +39,13 @@
         return Result.success();
     }
 
+    @ApiOperation(value = "妫�楠屽璞¢浂浠跺鏍�")
+    @PostMapping("/testObjectPartReview")
+    public Result testObjectPartReview(@RequestBody StructureTestObjectPartDto structureTestObjectPartDto) {
+        structureTestObjectPartService.testObjectPartReview(structureTestObjectPartDto);
+        return Result.success();
+    }
+
     @ApiOperation(value = "鏇存柊妫�楠屽璞¢浂浠�")
     @PostMapping("/updateTestObjectPart")
     public Result updateTestObjectPart(@RequestBody StructureTestObjectPart structureTestObjectPart) {
diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/PageTestObjectDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/PageTestObjectDto.java
index 684cf46..f970497 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/dto/PageTestObjectDto.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/dto/PageTestObjectDto.java
@@ -1,5 +1,6 @@
 package com.ruoyi.basic.dto;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.ruoyi.basic.pojo.StructureTestObject;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -22,4 +23,8 @@
 
     @ApiModelProperty(value = "闆朵欢鍙�")
     private String partNo;
+
+    @ApiModelProperty(value = "妫�楠屽璞�")
+    @TableField(exist = false)
+    private String sample;
 }
diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/ProductPartDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/ProductPartDto.java
new file mode 100644
index 0000000..638afee
--- /dev/null
+++ b/basic-server/src/main/java/com/ruoyi/basic/dto/ProductPartDto.java
@@ -0,0 +1,10 @@
+package com.ruoyi.basic.dto;
+
+import lombok.Data;
+
+@Data
+public class ProductPartDto {
+
+    private Integer id;
+
+}
diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/StructureTestObjectDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/StructureTestObjectDto.java
new file mode 100644
index 0000000..3d278ba
--- /dev/null
+++ b/basic-server/src/main/java/com/ruoyi/basic/dto/StructureTestObjectDto.java
@@ -0,0 +1,15 @@
+package com.ruoyi.basic.dto;
+
+import lombok.Data;
+
+@Data
+public class StructureTestObjectDto {
+
+    private Integer id;
+
+    private String name;
+
+    private Integer workShopId;
+
+    private String workShopName;
+}
diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/StructureTestObjectPartDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/StructureTestObjectPartDto.java
new file mode 100644
index 0000000..a00effa
--- /dev/null
+++ b/basic-server/src/main/java/com/ruoyi/basic/dto/StructureTestObjectPartDto.java
@@ -0,0 +1,10 @@
+package com.ruoyi.basic.dto;
+
+import lombok.Data;
+
+@Data
+public class StructureTestObjectPartDto {
+
+    private Integer id;
+
+}
diff --git a/basic-server/src/main/java/com/ruoyi/basic/dto/WorkShopDto.java b/basic-server/src/main/java/com/ruoyi/basic/dto/WorkShopDto.java
new file mode 100644
index 0000000..e66e70d
--- /dev/null
+++ b/basic-server/src/main/java/com/ruoyi/basic/dto/WorkShopDto.java
@@ -0,0 +1,6 @@
+package com.ruoyi.basic.dto;
+
+import com.ruoyi.basic.pojo.WorkShop;
+
+public class WorkShopDto extends WorkShop {
+}
diff --git a/basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectData.java b/basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectData.java
index 4fc2fd2..59174b8 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectData.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/excel/StructureTestObjectData.java
@@ -1,6 +1,7 @@
 package com.ruoyi.basic.excel;
 
 import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 @Data
@@ -22,4 +23,13 @@
 
     @ExcelProperty(value = "浜у搧鍚嶇О(EN)")
     private String nameEn;
+
+    @ExcelProperty(value = "瀵硅薄绫诲瀷")
+    private String objectType;
+
+    @ExcelProperty(value = "杞﹂棿鍚嶇Оid")
+    private Integer workShopId;
+
+    @ExcelProperty(value = "杞﹂棿鍚嶇О")
+    private String workShopName;
 }
diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartLogMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartLogMapper.java
new file mode 100644
index 0000000..55f0ea8
--- /dev/null
+++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartLogMapper.java
@@ -0,0 +1,7 @@
+package com.ruoyi.basic.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.basic.pojo.ProductPartLog;
+
+public interface ProductPartLogMapper extends BaseMapper<ProductPartLog> {
+   }
diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartMapper.java
index 9d2943f..e2faa9d 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartMapper.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/ProductPartMapper.java
@@ -3,11 +3,19 @@
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.basic.pojo.ProductPart;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+import java.util.Map;
+
 public interface ProductPartMapper extends BaseMapper<ProductPart> {
     IPage<ProductPart> selectListByProductId(IPage<ProductPart> page,
-                                              @Param("ew") QueryWrapper<ProductPart> ew,
-                                              @Param("productId") Integer productId);
+                                             @Param("ew") QueryWrapper<ProductPart> ew,
+                                             @Param("productId") Integer productId);
+
+    List<Map<String, Object>> inspectionItems(@Param("name") String name);
+
+    IPage<Map<String, Object>> productPartLogList(@Param("page") Page page,@Param("id") Integer id);
 }
diff --git a/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectMapper.java
index 1ada57c..449d6f0 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectMapper.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/StructureTestObjectMapper.java
@@ -16,7 +16,7 @@
  */
 public interface StructureTestObjectMapper extends BaseMapper<StructureTestObject> {
 
-    IPage<PageTestObjectDto> selectTestObjectList(Page page, @Param("ew") QueryWrapper<PageTestObjectDto> ew, @Param("partNo") String partNo);
+    IPage<PageTestObjectDto> selectTestObjectList(Page page, @Param("ew") QueryWrapper<PageTestObjectDto> ew, @Param("specimenName") String specimenName);
 
 }
 
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/WorkShopFileMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/WorkShopFileMapper.java
similarity index 72%
rename from inspect-server/src/main/java/com/ruoyi/inspect/mapper/WorkShopFileMapper.java
rename to basic-server/src/main/java/com/ruoyi/basic/mapper/WorkShopFileMapper.java
index 1ed85b9..1104440 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/WorkShopFileMapper.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/WorkShopFileMapper.java
@@ -1,7 +1,8 @@
-package com.ruoyi.inspect.mapper;
+package com.ruoyi.basic.mapper;
+
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ruoyi.inspect.pojo.WorkShopFile;
+import com.ruoyi.basic.pojo.WorkShopFile;
 
 /**
  * 妫�楠屽崟涓嬬殑闄勪欢鍒楄〃 Mapper 鎺ュ彛
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/WorkShopMapper.java b/basic-server/src/main/java/com/ruoyi/basic/mapper/WorkShopMapper.java
similarity index 79%
rename from inspect-server/src/main/java/com/ruoyi/inspect/mapper/WorkShopMapper.java
rename to basic-server/src/main/java/com/ruoyi/basic/mapper/WorkShopMapper.java
index c89e4ad..26e3110 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/mapper/WorkShopMapper.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/mapper/WorkShopMapper.java
@@ -1,7 +1,8 @@
-package com.ruoyi.inspect.mapper;
+package com.ruoyi.basic.mapper;
+
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ruoyi.inspect.pojo.WorkShop;
+import com.ruoyi.basic.pojo.WorkShop;
 
 /**
  * @description 閽堝琛ㄣ�恮ork_shop(杞﹂棿鍚嶇О)銆戠殑鏁版嵁搴撴搷浣淢apper
diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPart.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPart.java
index 0a29975..b2e9d28 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPart.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPart.java
@@ -27,6 +27,12 @@
     @ApiModelProperty("鑹叉爣")
     private String colorCode;
 
+    @ApiModelProperty("鎴愬搧杩涘巶妫�楠岄」")
+    private String inspectionItem;
+
+    @ApiModelProperty("鏄惁宸插鏍�")
+    private String review;
+
     @ApiModelProperty(value = "鍒涘缓浜篿d")
     @TableField(fill = FieldFill.INSERT)
     private Integer createUser;
@@ -46,4 +52,7 @@
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private LocalDateTime updateTime;
 
+    @ApiModelProperty("妫�楠岄」灏忕被")
+    private String inspectionItemSubclass;
+
 }
diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPartLog.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPartLog.java
new file mode 100644
index 0000000..fce57c5
--- /dev/null
+++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/ProductPartLog.java
@@ -0,0 +1,57 @@
+package com.ruoyi.basic.pojo;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 浜у搧闆朵欢鍙锋棩蹇楄〃(ProductPartLog)瀹炰綋绫�
+ *
+ * @author makejava
+ * @since 2025-03-19 13:47:10
+ */
+@Data
+@TableName("product_part_log")
+public class ProductPartLog implements Serializable {
+    
+    private Integer id;
+    /**
+     * 闆朵欢鍙�
+     */
+    @ApiModelProperty("浜у搧闆朵欢鍙穒d")
+    private Integer productPartId;
+
+    /**
+     * 鎿嶄綔浜哄憳
+     */
+    @ApiModelProperty("鎿嶄綔浜哄憳")
+    private String operName;
+    /**
+     * 鎿嶄綔浜哄憳
+     */
+    @ApiModelProperty("鎿嶄綔浜哄憳id")
+    private Integer operId;
+    /**
+     * 鎿嶄綔鏃堕棿
+     */
+    private LocalDateTime operTime;
+
+    @ApiModelProperty("闆朵欢鍙�")
+    private String partNo;
+
+    @ApiModelProperty("棰滆壊")
+    private String color;
+
+    @ApiModelProperty("鑹叉爣")
+    private String colorCode;
+
+    @ApiModelProperty("鎴愬搧杩涘巶妫�楠岄」")
+    private String inspectionItem;
+
+    @ApiModelProperty("鏄惁宸插鏍�")
+    private String review;
+}
+
diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObject.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObject.java
index d5af3f2..7cc6269 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObject.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObject.java
@@ -58,6 +58,16 @@
     @ApiModelProperty(value = "瀵硅薄绫诲瀷")
     private String objectType;
 
+    /**
+     * 澶栭敭锛歸ork_shop琛╥d
+     */
+    @ApiModelProperty(value = "杞﹂棿id")
+    private Integer workShopId;
+    /**
+     * 杞﹂棿鍚�
+     */
+    @ApiModelProperty(value = "杞﹂棿鍚嶇О")
+    private String workShopName;
 
 }
 
diff --git a/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObjectPart.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObjectPart.java
index a1e500c..5fcc9c2 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObjectPart.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/StructureTestObjectPart.java
@@ -33,6 +33,12 @@
     @ApiModelProperty("鑹叉爣")
     private String colorCode;
 
+    @ApiModelProperty("鎴愬搧杩涘巶妫�楠岄」")
+    private String inspectionItem;
+
+    @ApiModelProperty("鏄惁宸插鏍�")
+    private String review;
+
     @ApiModelProperty(value = "鍒涘缓浜篿d")
     @TableField(fill = FieldFill.INSERT)
     private Integer createUser;
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/pojo/WorkShop.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/WorkShop.java
similarity index 91%
rename from inspect-server/src/main/java/com/ruoyi/inspect/pojo/WorkShop.java
rename to basic-server/src/main/java/com/ruoyi/basic/pojo/WorkShop.java
index ef0c08d..48c124e 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/pojo/WorkShop.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/WorkShop.java
@@ -1,4 +1,4 @@
-package com.ruoyi.inspect.pojo;
+package com.ruoyi.basic.pojo;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -21,7 +21,7 @@
      */
     @ApiModelProperty(value = "涓婚敭id")
     @TableId(type = IdType.AUTO)
-    private Long id;
+    private Integer id;
 
     /**
      * 缂栧彿
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/pojo/WorkShopFile.java b/basic-server/src/main/java/com/ruoyi/basic/pojo/WorkShopFile.java
similarity index 96%
rename from inspect-server/src/main/java/com/ruoyi/inspect/pojo/WorkShopFile.java
rename to basic-server/src/main/java/com/ruoyi/basic/pojo/WorkShopFile.java
index 645b391..9fb5675 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/pojo/WorkShopFile.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/pojo/WorkShopFile.java
@@ -1,4 +1,4 @@
-package com.ruoyi.inspect.pojo;
+package com.ruoyi.basic.pojo;
 
 import com.baomidou.mybatisplus.annotation.*;
 import io.swagger.annotations.ApiModel;
diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/ProductPartLogService.java b/basic-server/src/main/java/com/ruoyi/basic/service/ProductPartLogService.java
new file mode 100644
index 0000000..ddef5ec
--- /dev/null
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/ProductPartLogService.java
@@ -0,0 +1,10 @@
+package com.ruoyi.basic.service;
+
+/**
+ * 浜у搧闆朵欢鍙锋棩蹇楄〃(ProductPartLog)琛ㄦ湇鍔℃帴鍙�
+ *
+ * @author makejava
+ * @since 2025-03-19 13:47:10
+ */
+public interface ProductPartLogService {
+}
diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/ProductPartService.java b/basic-server/src/main/java/com/ruoyi/basic/service/ProductPartService.java
index 3525752..98c578e 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/service/ProductPartService.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/ProductPartService.java
@@ -1,8 +1,14 @@
 package com.ruoyi.basic.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.basic.dto.ProductPartDto;
 import com.ruoyi.basic.pojo.ProductPart;
+import com.ruoyi.basic.pojo.ProductPartLog;
+
+import java.util.List;
+import java.util.Map;
 
 public interface ProductPartService extends IService<ProductPart> {
 
@@ -10,5 +16,11 @@
 
     void addProductPart(ProductPart productPart);
 
-    void updateProductPartById(ProductPart productPart);
+    int updateProductPartById(ProductPart productPart);
+
+    List<Map<String, Object>> inspectionItems(String sample,String productName);
+
+    int productPartReviewById(ProductPartDto productPartDto);
+
+    IPage<ProductPartLog> productPartLogList(Page page, Integer id);
 }
diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/ProductService.java b/basic-server/src/main/java/com/ruoyi/basic/service/ProductService.java
index ce6219d..20c7b91 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/service/ProductService.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/ProductService.java
@@ -4,6 +4,7 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ruoyi.basic.dto.ProductDTO1;
+import com.ruoyi.basic.dto.StructureTestObjectDto;
 import com.ruoyi.basic.excel.StructureTestObjectData;
 import com.ruoyi.basic.pojo.Product;
 
@@ -27,4 +28,6 @@
     void importPartExcel(List<StructureTestObjectData> list);
 
     int updateWorkShop(Integer productId, Integer workShopId, String name);
+
+    int updateObjectWorkShop(StructureTestObjectDto structureTestObjectDto);
 }
diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectPartService.java b/basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectPartService.java
index de84817..5e7890a 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectPartService.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/StructureTestObjectPartService.java
@@ -3,6 +3,7 @@
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.basic.dto.StructureTestObjectPartDto;
 import com.ruoyi.basic.pojo.StructureTestObjectPart;
 
 /**
@@ -18,5 +19,7 @@
     void addTestObjectPart(StructureTestObjectPart structureTestObjectPart);
 
     void updateTestObjectPart(StructureTestObjectPart structureTestObjectPart);
+
+    int testObjectPartReview(StructureTestObjectPartDto structureTestObjectPartDto);
 }
 
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/WorkShopFileService.java b/basic-server/src/main/java/com/ruoyi/basic/service/WorkShopFileService.java
similarity index 76%
rename from inspect-server/src/main/java/com/ruoyi/inspect/service/WorkShopFileService.java
rename to basic-server/src/main/java/com/ruoyi/basic/service/WorkShopFileService.java
index e382d5f..fa257cb 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/WorkShopFileService.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/WorkShopFileService.java
@@ -1,7 +1,8 @@
-package com.ruoyi.inspect.service;
+package com.ruoyi.basic.service;
+
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ruoyi.inspect.pojo.WorkShopFile;
+import com.ruoyi.basic.pojo.WorkShopFile;
 
 /**
  * @description 閽堝琛ㄣ�恮ork_shop_file(杞﹂棿鍚嶇О)銆戠殑鏁版嵁搴撴搷浣淪ervice
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/WorkShopService.java b/basic-server/src/main/java/com/ruoyi/basic/service/WorkShopService.java
similarity index 83%
rename from inspect-server/src/main/java/com/ruoyi/inspect/service/WorkShopService.java
rename to basic-server/src/main/java/com/ruoyi/basic/service/WorkShopService.java
index aeef588..dd39e58 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/WorkShopService.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/WorkShopService.java
@@ -1,10 +1,11 @@
-package com.ruoyi.inspect.service;
+package com.ruoyi.basic.service;
+
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ruoyi.inspect.dto.WorkShopDto;
-import com.ruoyi.inspect.pojo.WorkShop;
+import com.ruoyi.basic.dto.WorkShopDto;
+import com.ruoyi.basic.pojo.WorkShop;
 import org.springframework.web.multipart.MultipartFile;
 
 /**
diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/CapacityScopeServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/CapacityScopeServiceImpl.java
index 4b436aa..5fa1c5b 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/service/impl/CapacityScopeServiceImpl.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/CapacityScopeServiceImpl.java
@@ -51,12 +51,12 @@
 
     @Override
     public IPage<StructureItemParameter> selectItemParameterList(Page page, StructureItemParameter itemParameter) {
-       return structureItemParameterMapper.selectItemParameterList(page, QueryWrappers.queryWrappers(itemParameter));
+        return structureItemParameterMapper.selectItemParameterList(page, QueryWrappers.queryWrappers(itemParameter));
     }
 
     @Override
     public int addItemParameter(StructureItemParameter itemParameter) {
-        if (itemParameter.getBsm().equals("")||itemParameter.getBsm()==null){
+        if (itemParameter.getBsm().equals("") || itemParameter.getBsm() == null) {
             itemParameter.setBsm("0");
         }
         int insert = structureItemParameterMapper.insert(itemParameter);
@@ -75,15 +75,15 @@
 
     @Override
     public IPage<PageTestObjectDto> selectTestObjectList(Page page, PageTestObjectDto pageTestObjectDto) {
-        String partNo = pageTestObjectDto.getPartNo();
-        pageTestObjectDto.setPartNo(null);
-        return structureTestObjectMapper.selectTestObjectList(page, QueryWrappers.queryWrappers(pageTestObjectDto),partNo);
+        String specimenName = pageTestObjectDto.getSample();
+        pageTestObjectDto.setSample(null);
+        return structureTestObjectMapper.selectTestObjectList(page, QueryWrappers.queryWrappers(pageTestObjectDto), specimenName);
     }
 
     @Override
     public int addTestObject(StructureTestObject testObject) {
         Long count = structureTestObjectMapper.selectCount(Wrappers.<StructureTestObject>lambdaQuery().eq(StructureTestObject::getSpecimenName, testObject.getSpecimenName()));
-        if(count.compareTo(0L) > 0){
+        if (count.compareTo(0L) > 0) {
             throw new BaseException("妫�楠屽璞′笉鑳介噸澶�");
         }
 
@@ -121,7 +121,7 @@
             // 鏌ヨ鎵�鏈夊璞′竴鏍风殑妫�楠岄」鐩�
             List<StandardProductList> standardProductLists = standardProductListService.list(Wrappers.<StandardProductList>lambdaUpdate()
                     .eq(StandardProductList::getSampleType, oldTestObject.getSpecimenName()));
-            if (CollectionUtils.isNotEmpty(standardProductLists)){
+            if (CollectionUtils.isNotEmpty(standardProductLists)) {
                 for (StandardProductList standardProductList : standardProductLists) {
                     // 淇敼鎵�鏈夌殑瀵硅薄鍚嶇О鍜屾暟鍨嬬粨鏋�
                     standardProductList.setSampleType(testObject.getSpecimenName());
@@ -159,7 +159,7 @@
         Long count = structureTestObjectMapper.selectCount(Wrappers.<StructureTestObject>lambdaQuery()
                 .eq(StructureTestObject::getSpecimenName, testObject.getSpecimenName())
                 .ne(StructureTestObject::getId, testObject.getId()));
-        if(count.compareTo(0L) > 0){
+        if (count.compareTo(0L) > 0) {
             throw new BaseException("妫�楠屽璞′笉鑳介噸澶�");
         }
 
@@ -168,7 +168,7 @@
 
     @Override
     public List<StructureTestObject> selectTestObjectByName() {
-        return structureTestObjectMapper.selectList(Wrappers.<StructureTestObject>lambdaQuery().select(StructureTestObject::getSpecimenName,StructureTestObject::getId));
+        return structureTestObjectMapper.selectList(Wrappers.<StructureTestObject>lambdaQuery().select(StructureTestObject::getSpecimenName, StructureTestObject::getId));
     }
 
     //璁惧閲岄潰閫夋嫨妫�楠岄」鐩�(鏍戝舰缁撴瀯)
diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartLogServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartLogServiceImpl.java
new file mode 100644
index 0000000..3d6a6c4
--- /dev/null
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartLogServiceImpl.java
@@ -0,0 +1,18 @@
+package com.ruoyi.basic.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.basic.mapper.ProductPartLogMapper;
+import com.ruoyi.basic.pojo.ProductPartLog;
+import com.ruoyi.basic.service.ProductPartLogService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 浜у搧闆朵欢鍙锋棩蹇楄〃(ProductPartLog)琛ㄦ湇鍔″疄鐜扮被
+ *
+ * @author makejava
+ * @since 2025-03-19 13:47:10
+ */
+@Service("productPartLogService")
+public class ProductPartLogServiceImpl extends ServiceImpl<ProductPartLogMapper, ProductPartLog> implements ProductPartLogService {
+
+}
diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartServiceImpl.java
index 5ecfb88..64f659a 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartServiceImpl.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductPartServiceImpl.java
@@ -1,10 +1,15 @@
 package com.ruoyi.basic.service.impl;
 
+import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.basic.dto.ProductPartDto;
+import com.ruoyi.basic.mapper.ProductPartLogMapper;
+import com.ruoyi.basic.pojo.ProductPartLog;
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.QueryWrappers;
 import com.ruoyi.basic.mapper.ProductPartMapper;
@@ -12,22 +17,29 @@
 import com.ruoyi.basic.pojo.ProductPart;
 import com.ruoyi.basic.pojo.StructureTestObjectPart;
 import com.ruoyi.basic.service.ProductPartService;
+import com.ruoyi.common.utils.SecurityUtils;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.Map;
 
 @Transactional
 @Service
 @AllArgsConstructor
 public class ProductPartServiceImpl extends ServiceImpl<ProductPartMapper, ProductPart> implements ProductPartService {
 
-    private  ProductPartMapper productPartMapper;
+    private ProductPartMapper productPartMapper;
     private StructureTestObjectPartMapper structureTestObjectPartMapper;
+
+    private ProductPartLogMapper productPartLogMapper;
 
 
     @Override
-    public IPage<ProductPart> selectByProductId(IPage<ProductPart> page,ProductPart productPart) {
-        return productPartMapper.selectListByProductId(page, QueryWrappers.queryWrappers(productPart),productPart.getProductId());
+    public IPage<ProductPart> selectByProductId(IPage<ProductPart> page, ProductPart productPart) {
+        return productPartMapper.selectListByProductId(page, QueryWrappers.queryWrappers(productPart), productPart.getProductId());
     }
 
     @Override
@@ -36,20 +48,74 @@
             throw new BaseException("缂哄皯浜у搧瀵硅薄id");
         }
         this.isPartNoExist(productPart.getPartNo(), productPart.getProductId(), null);
+        productPart.setReview("寰呭鏍�");
         productPartMapper.insert(productPart);
     }
 
     @Override
-    public void updateProductPartById(ProductPart productPart) {
+    public int updateProductPartById(ProductPart productPart) {
+        if (productPart.getProductId() == null) {
+            throw new BaseException("缂哄皯浜у搧瀵硅薄id");
+        }
+//        this.isPartNoExist(productPart.getPartNo(), productPart.getProductId(), null);
+        if (!"宸插鏍�".equals(productPart.getReview())) {
+            productPart.setReview("寰呭鏍�");
+        }
+        return productPartMapper.updateById(productPart);
+    }
+
+    @Override
+    public List<Map<String, Object>> inspectionItems(String sample, String productName) {
+        // 浼樺厛澶勭悊涓や釜鍙傛暟鍧囬潪绌虹殑鍦烘櫙
+        if (StringUtils.isNotEmpty(productName) && StringUtils.isNotEmpty(sample)) {
+            //鍏堝樊浜у搧锛屾湁杩囨湁鍊肩洿鎺ヨ繑鍥烇紝娌″�煎啀鏌ュぇ绫�
+            List<Map<String, Object>> result = productPartMapper.inspectionItems(productName);
+            return result.isEmpty() ? productPartMapper.inspectionItems(sample) : result;
+        }
+
+        // 鍏朵粬鎯呭喌鐩存帴閫夊彇鏈夋晥鍙傛暟锛堜紭鍏坧roductName锛夋垨绌哄瓧绗︿覆
+        String param = StringUtils.isNotEmpty(productName) ? productName :
+                StringUtils.isNotEmpty(sample) ? sample : "";
+        return productPartMapper.inspectionItems(param);
+
+    }
+
+    @Override
+    public int productPartReviewById(ProductPartDto productPartDto) {
+
+        int userId = SecurityUtils.getUserId().intValue();
+        String username = SecurityUtils.getUsername();
+        ProductPart productPart = productPartMapper.selectById(productPartDto.getId());
         this.isPartNoExist(productPart.getPartNo(), productPart.getProductId(), productPart.getId());
         if (productPart.getProductId() == null) {
             throw new BaseException("缂哄皯浜у搧瀵硅薄id");
         }
-        productPartMapper.updateById(productPart);
+        productPart.setReview("宸插鏍�");
+        int num = productPartMapper.updateById(productPart);
+        if (num > 0) {
+            ProductPartLog productPartLog = new ProductPartLog();
+            productPartLog.setProductPartId(productPart.getId());
+            productPartLog.setOperName(username);
+            productPartLog.setOperId(userId);
+            productPartLog.setOperTime(LocalDateTime.now());
+            productPartLog.setColor(productPart.getColor());
+            productPartLog.setColorCode(productPart.getColorCode());
+            productPartLog.setPartNo(productPart.getPartNo());
+            productPartLog.setInspectionItem(productPart.getInspectionItem());
+            productPartLog.setReview(productPart.getReview());
+            productPartLogMapper.insert(productPartLog);
+        }
+        return num;
+    }
+
+    @Override
+    public IPage<ProductPartLog> productPartLogList(Page page, Integer id) {
+        return productPartLogMapper.selectPage(page, Wrappers.<ProductPartLog>lambdaQuery()
+                .eq(ProductPartLog::getProductPartId, id));
     }
 
     // 鍒ゆ柇闆朵欢鍙锋槸鍚﹀瓨鍦�
-    public void isPartNoExist(String partNo,Integer productId, Integer id) {
+    public void isPartNoExist(String partNo, Integer productId, Integer id) {
         // 闆朵欢鍙峰敮涓� 浣嗕笉蹇呭~
         if (StringUtils.isNotBlank(partNo)) {
             Long count = productPartMapper.selectCount(new LambdaQueryWrapper<ProductPart>()
diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductServiceImpl.java
index ba585df..f144c00 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductServiceImpl.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/ProductServiceImpl.java
@@ -8,19 +8,15 @@
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.basic.dto.StructureTestObjectDto;
+import com.ruoyi.basic.mapper.*;
+import com.ruoyi.basic.service.*;
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.QueryWrappers;
 import com.ruoyi.basic.dto.ProductDTO1;
 import com.ruoyi.basic.excel.StructureTestObjectData;
-import com.ruoyi.basic.mapper.ProductMapper;
-import com.ruoyi.basic.mapper.ProductPartMapper;
-import com.ruoyi.basic.mapper.StandardTreeMapper;
-import com.ruoyi.basic.mapper.StructureTestObjectMapper;
 import com.ruoyi.basic.pojo.*;
-import com.ruoyi.basic.service.LaboratoryService;
-import com.ruoyi.basic.service.ProductService;
-import com.ruoyi.basic.service.StandardProductListService;
-import com.ruoyi.basic.service.StructureItemParameterService;
+import com.ruoyi.common.utils.StringUtils;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -28,10 +24,10 @@
 import java.util.List;
 
 /**
-* @author z1292
-* @description 閽堝琛ㄣ�恜roduct(浜у搧琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
-* @createDate 2024-04-26 01:11:02
-*/
+ * @author z1292
+ * @description 閽堝琛ㄣ�恜roduct(浜у搧琛�)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+ * @createDate 2024-04-26 01:11:02
+ */
 @Service
 @AllArgsConstructor
 public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product>
@@ -45,11 +41,17 @@
 
     private ProductPartMapper productPartMapper;
 
+
     private StandardProductListService standardProductListService;
+
 
     private StandardTreeMapper standardTreeMapper;
 
+
     private StructureItemParameterService structureItemParameterService;
+
+
+    private WorkShopMapper workShopMapper;
 
     @Override
     public IPage<Product> selectProductListByObjectId(Page page, ProductDTO1 product) {
@@ -137,46 +139,74 @@
             StructureTestObject structureTestObject1 = structureTestObjectMapper.selectOne(Wrappers.<StructureTestObject>lambdaQuery()
                     .eq(StructureTestObject::getSpecimenName, i.getSpecimenName())
                     .eq(StructureTestObject::getSpecimenNameEn, i.getSpecimenNameEn()));
-            Laboratory laboratory = laboratoryService.getOne(Wrappers.<Laboratory>lambdaQuery()
-                    .eq(Laboratory::getLaboratoryName, i.getLaboratory()));
-            if (ObjectUtils.isEmpty(laboratory)) {
-                throw new BaseException("鏈壘鍒拌鍦烘墍锛�" + i.getLaboratory() + "锛岃妫�鏌ユ槸鍚﹀瓨鍦ㄨ鍦烘墍锛�");
-            }
+//            Laboratory laboratory = laboratoryService.getOne(Wrappers.<Laboratory>lambdaQuery()
+//                    .eq(Laboratory::getId, i.getLaboratory()));
+//            if (ObjectUtils.isEmpty(laboratory)) {
+//                throw new BaseException("鏈壘鍒拌鍦烘墍锛�" + i.getLaboratory() + "锛岃妫�鏌ユ槸鍚﹀瓨鍦ㄨ鍦烘墍锛�");
+//            }
             // 濡傛灉涓虹┖杩涜鏂板
-            if(ObjectUtils.isEmpty(structureTestObject1)) {
+            if (ObjectUtils.isEmpty(structureTestObject1)) {
                 StructureTestObject structureTestObject = new StructureTestObject();
-                structureTestObject.setLaboratoryId(laboratory.getId());
+                structureTestObject.setLaboratoryId(9);
                 structureTestObject.setSpecimenName(i.getSpecimenName());
                 structureTestObject.setSpecimenNameEn(i.getSpecimenNameEn());
                 structureTestObject.setCode(i.getCode());
+                structureTestObject.setWorkShopName("");
                 structureTestObjectMapper.insert(structureTestObject);
 
                 // 浜у搧
                 Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery()
                         .eq(Product::getName, i.getName())
                         .eq(Product::getNameEn, i.getNameEn()));
-                if (ObjectUtils.isEmpty(product)){
+                if (ObjectUtils.isEmpty(product)) {
                     Product product1 = new Product();
                     product1.setName(i.getName());
                     product1.setNameEn(i.getNameEn());
+                    if (StringUtils.isNotEmpty(i.getWorkShopName())) {
+                        WorkShop workShop = workShopMapper.selectOne(Wrappers.<WorkShop>lambdaQuery().eq(WorkShop::getName, i.getWorkShopName()));
+                        if (workShop == null){
+                            throw new BaseException("璇峰厛缁存姢杞﹂棿淇℃伅");
+                        }else {
+                            product1.setWorkShopId(workShop.getId());
+                        }
+                    }
+                    product1.setWorkShopName(i.getWorkShopName());
                     product1.setObjectId(structureTestObject.getId());
                     baseMapper.insert(product1);
                 }
             } else {
                 structureTestObject1.setCode(i.getCode());
-                structureTestObject1.setLaboratoryId(laboratory.getId());
+                structureTestObject1.setLaboratoryId(9);
                 structureTestObjectMapper.updateById(structureTestObject1);
                 // 浜у搧
                 Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery()
                         .eq(Product::getName, i.getName())
                         .eq(Product::getNameEn, i.getNameEn()));
-                if (ObjectUtils.isEmpty(product)){
+                if (ObjectUtils.isEmpty(product)) {
                     Product product1 = new Product();
+                    if (StringUtils.isNotEmpty(i.getWorkShopName())) {
+                        WorkShop workShop =  workShopMapper.selectOne(Wrappers.<WorkShop>lambdaQuery().eq(WorkShop::getName, i.getWorkShopName()));
+                        if (workShop == null){
+                            throw new BaseException("璇峰厛缁存姢杞﹂棿淇℃伅");
+                        }else {
+                            product1.setWorkShopId(workShop.getId());
+                        }
+                    }
+                    product1.setWorkShopName(i.getWorkShopName());
                     product1.setName(i.getName());
                     product1.setNameEn(i.getNameEn());
                     product1.setObjectId(structureTestObject1.getId());
                     baseMapper.insert(product1);
                 } else {
+                    if (StringUtils.isNotEmpty(i.getWorkShopName())) {
+                        WorkShop workShop =  workShopMapper.selectOne(Wrappers.<WorkShop>lambdaQuery().eq(WorkShop::getName, i.getWorkShopName()));
+                        if (workShop == null){
+                            throw new BaseException("璇峰厛缁存姢杞﹂棿淇℃伅");
+                        }else {
+                            product.setWorkShopId(workShop.getId());
+                        }
+                    }
+                    product.setWorkShopName(i.getWorkShopName());
                     product.setName(i.getName());
                     product.setNameEn(i.getNameEn());
                     product.setObjectId(structureTestObject1.getId());
@@ -187,10 +217,18 @@
     }
 
     @Override
-    public int updateWorkShop(Integer productId, Integer workShopId,String name) {
+    public int updateWorkShop(Integer productId, Integer workShopId, String name) {
         return productMapper.update(null, Wrappers.<Product>lambdaUpdate()
                 .set(Product::getWorkShopId, workShopId)
                 .set(Product::getWorkShopName, name)
                 .eq(Product::getId, productId));
     }
+
+    @Override
+    public int updateObjectWorkShop(StructureTestObjectDto structureTestObjectDto) {
+        return structureTestObjectMapper.update(null, Wrappers.<StructureTestObject>lambdaUpdate()
+                .set(StructureTestObject::getWorkShopId, structureTestObjectDto.getWorkShopId())
+                .set(StructureTestObject::getWorkShopName, structureTestObjectDto.getWorkShopName())
+                .eq(StructureTestObject::getId, structureTestObjectDto.getId()));
+    }
 }
diff --git a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectPartServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectPartServiceImpl.java
index 819ef16..580f05f 100644
--- a/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectPartServiceImpl.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/StructureTestObjectPartServiceImpl.java
@@ -7,6 +7,7 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import com.ruoyi.basic.dto.StructureTestObjectPartDto;
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.QueryWrappers;
 import com.ruoyi.basic.mapper.ProductPartMapper;
@@ -43,6 +44,7 @@
         if (structureTestObjectPart.getTestObjectId() == null) {
             throw new BaseException("缂哄皯浜у搧瀵硅薄id");
         }
+        structureTestObjectPart.setReview("寰呭鏍�");
         baseMapper.insert(structureTestObjectPart);
     }
 
@@ -52,9 +54,21 @@
         if (structureTestObjectPart.getTestObjectId() == null) {
             throw new BaseException("缂哄皯浜у搧瀵硅薄id");
         }
+        structureTestObjectPart.setReview("寰呭鏍�");
         baseMapper.updateById(structureTestObjectPart);
     }
 
+    @Override
+    public int testObjectPartReview(StructureTestObjectPartDto structureTestObjectPartDto) {
+        StructureTestObjectPart structureTestObjectPart = baseMapper.selectById(structureTestObjectPartDto.getId());
+        this.isPartNoExist(structureTestObjectPart.getPartNo(),  structureTestObjectPart.getId());
+        if (structureTestObjectPart.getTestObjectId() == null) {
+            throw new BaseException("缂哄皯浜у搧瀵硅薄id");
+        }
+        structureTestObjectPart.setReview("寰呭鏍�");
+        return baseMapper.updateById(structureTestObjectPart);
+    }
+
     // 鍒ゆ柇闆朵欢鍙锋槸鍚﹀瓨鍦�
     public void isPartNoExist(String partNo, Integer id) {
         // 闆朵欢鍙峰敮涓� 浣嗕笉蹇呭~
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/WorkShopFileServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/WorkShopFileServiceImpl.java
similarity index 67%
rename from inspect-server/src/main/java/com/ruoyi/inspect/service/impl/WorkShopFileServiceImpl.java
rename to basic-server/src/main/java/com/ruoyi/basic/service/impl/WorkShopFileServiceImpl.java
index c9a0f96..bb11804 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/WorkShopFileServiceImpl.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/WorkShopFileServiceImpl.java
@@ -1,9 +1,10 @@
-package com.ruoyi.inspect.service.impl;
+package com.ruoyi.basic.service.impl;
+
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.inspect.mapper.WorkShopFileMapper;
-import com.ruoyi.inspect.pojo.WorkShopFile;
-import com.ruoyi.inspect.service.WorkShopFileService;
+import com.ruoyi.basic.mapper.WorkShopFileMapper;
+import com.ruoyi.basic.pojo.WorkShopFile;
+import com.ruoyi.basic.service.WorkShopFileService;
 import org.springframework.stereotype.Service;
 
 /**
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/WorkShopServiceImpl.java b/basic-server/src/main/java/com/ruoyi/basic/service/impl/WorkShopServiceImpl.java
similarity index 92%
rename from inspect-server/src/main/java/com/ruoyi/inspect/service/impl/WorkShopServiceImpl.java
rename to basic-server/src/main/java/com/ruoyi/basic/service/impl/WorkShopServiceImpl.java
index bf21c2e..7d006b6 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/WorkShopServiceImpl.java
+++ b/basic-server/src/main/java/com/ruoyi/basic/service/impl/WorkShopServiceImpl.java
@@ -1,15 +1,17 @@
-package com.ruoyi.inspect.service.impl;
+package com.ruoyi.basic.service.impl;
 
 import cn.hutool.core.lang.UUID;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.basic.dto.WorkShopDto;
+import com.ruoyi.basic.mapper.WorkShopFileMapper;
+import com.ruoyi.basic.mapper.WorkShopMapper;
+import com.ruoyi.basic.pojo.WorkShop;
+import com.ruoyi.basic.pojo.WorkShopFile;
+import com.ruoyi.basic.service.WorkShopService;
 import com.ruoyi.common.utils.QueryWrappers;
 import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.inspect.dto.WorkShopDto;
-import com.ruoyi.inspect.mapper.*;
-import com.ruoyi.inspect.pojo.*;
-import com.ruoyi.inspect.service.*;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
diff --git a/basic-server/src/main/resources/mapper/ProductPartLogMapper.xml b/basic-server/src/main/resources/mapper/ProductPartLogMapper.xml
new file mode 100644
index 0000000..b25bfbd
--- /dev/null
+++ b/basic-server/src/main/resources/mapper/ProductPartLogMapper.xml
@@ -0,0 +1,8 @@
+<?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.basic.mapper.ProductPartLogMapper">
+
+</mapper>
+
diff --git a/basic-server/src/main/resources/mapper/ProductPartMapper.xml b/basic-server/src/main/resources/mapper/ProductPartMapper.xml
index f883d3c..43e645a 100644
--- a/basic-server/src/main/resources/mapper/ProductPartMapper.xml
+++ b/basic-server/src/main/resources/mapper/ProductPartMapper.xml
@@ -7,4 +7,30 @@
         SELECT * from product_part pp
         where  pp.product_id=#{productId}
     </select>
+    <select id="inspectionItems" resultType="java.util.Map">
+        SELECT DISTINCT
+        sp.inspection_item AS inspectionItem
+        FROM
+        structure_item_parameter sp
+        WHERE 1=1
+        <if test="name != null and name != ''">
+            AND JSON_CONTAINS(sp.sample, concat('"', #{name}, '"'))
+        </if>
+        AND sp.son_laboratory = '鍘熸潗鏂�'
+    </select>
+    <select id="productPartLogList" resultType="java.util.Map">
+        SELECT
+            pp.part_no AS partNo,
+            pp.color,
+            pp.color_code AS colorCode,
+            pp.inspection_item AS inspectionItem,
+            pp.review,
+            pl.oper_name AS operName,
+            pl.oper_time AS operTime
+        FROM
+            product_part pp
+                LEFT JOIN product_part_log pl ON pp.id = pl.product_part_id
+        WHERE
+            pp.id = #{id}
+    </select>
 </mapper>
diff --git a/basic-server/src/main/resources/mapper/StructureTestMapper.xml b/basic-server/src/main/resources/mapper/StructureTestMapper.xml
index a17b51a..ce6bf83 100644
--- a/basic-server/src/main/resources/mapper/StructureTestMapper.xml
+++ b/basic-server/src/main/resources/mapper/StructureTestMapper.xml
@@ -16,15 +16,17 @@
         sto.laboratory_id,
         GROUP_CONCAT(p.name) product,
         sto.specimen_name_en,
-        sto.object_type
+        sto.object_type,
+        sto.work_shop_name,
+        sto.work_shop_id
         from structure_test_object sto
         left join user u1 on sto.create_user = u1.id
         left join user u2 on sto.update_user = u2.id
         left join product p on p.object_id = sto.id
         left join product_part pp on pp.product_id = p.id
         left join structure_test_object_part stop ON stop.test_object_id = sto.id
-        <if test="partNo != null and partNo != ''" >
-            where pp.part_no = #{partNo} or stop.part_no = #{partNo}
+        <if test="specimenName != null and specimenName != ''" >
+            where sto.specimen_name like concat ('%',#{specimenName},'%')
         </if>
         group by sto.id
         ) a
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/controller/WorkShopController.java b/inspect-server/src/main/java/com/ruoyi/inspect/controller/WorkShopController.java
index 8165801..a4ff872 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/controller/WorkShopController.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/controller/WorkShopController.java
@@ -1,10 +1,10 @@
 package com.ruoyi.inspect.controller;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.dto.WorkShopDto;
+import com.ruoyi.basic.service.WorkShopFileService;
+import com.ruoyi.basic.service.WorkShopService;
 import com.ruoyi.common.core.domain.Result;
-import com.ruoyi.inspect.dto.WorkShopDto;
-import com.ruoyi.inspect.service.WorkShopFileService;
-import com.ruoyi.inspect.service.WorkShopService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/dto/WorkShopDto.java b/inspect-server/src/main/java/com/ruoyi/inspect/dto/WorkShopDto.java
deleted file mode 100644
index 91aaea4..0000000
--- a/inspect-server/src/main/java/com/ruoyi/inspect/dto/WorkShopDto.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.ruoyi.inspect.dto;
-
-import com.ruoyi.inspect.pojo.WorkShop;
-
-public class WorkShopDto extends WorkShop {
-}

--
Gitblit v1.9.3