From cddc46a1ba318426cf01ae3fd354807c3b3b2465 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期三, 17 四月 2024 13:44:14 +0800
Subject: [PATCH] 调整模板功能;生成检验人员的三层架构文件

---
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java   |    8 +-
 inspect-server/src/main/java/com/yuanchu/mom/service/InsProductUserService.java          |   13 ++++
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsProductUserServiceImpl.java |   22 +++++++
 inspect-server/src/main/java/com/yuanchu/mom/pojo/StandardProductList.java               |    2 
 inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProductUser.java                    |   37 ++++++++++++
 inspect-server/src/main/java/com/yuanchu/mom/mapper/InsProductUserMapper.java            |   18 ++++++
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java   |    9 +-
 inspect-server/src/main/resources/mapper/StandardTreeMapper.xml                          |    3 
 inspect-server/src/main/resources/mapper/InsProductUserMapper.xml                        |   18 ++++++
 9 files changed, 122 insertions(+), 8 deletions(-)

diff --git a/inspect-server/src/main/java/com/yuanchu/mom/mapper/InsProductUserMapper.java b/inspect-server/src/main/java/com/yuanchu/mom/mapper/InsProductUserMapper.java
new file mode 100644
index 0000000..4e61db5
--- /dev/null
+++ b/inspect-server/src/main/java/com/yuanchu/mom/mapper/InsProductUserMapper.java
@@ -0,0 +1,18 @@
+package com.yuanchu.mom.mapper;
+
+import com.yuanchu.mom.pojo.InsProductUser;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author z1292
+* @description 閽堝琛ㄣ�恑ns_product_user(妫�楠岄」鐩殑浜哄憳妫�楠岃褰�)銆戠殑鏁版嵁搴撴搷浣淢apper
+* @createDate 2024-04-17 13:42:44
+* @Entity com.yuanchu.mom.pojo.InsProductUser
+*/
+public interface InsProductUserMapper extends BaseMapper<InsProductUser> {
+
+}
+
+
+
+
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProductUser.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProductUser.java
new file mode 100644
index 0000000..82c88e9
--- /dev/null
+++ b/inspect-server/src/main/java/com/yuanchu/mom/pojo/InsProductUser.java
@@ -0,0 +1,37 @@
+package com.yuanchu.mom.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 妫�楠岄」鐩殑浜哄憳妫�楠岃褰�
+ * @TableName ins_product_user
+ */
+@TableName(value ="ins_product_user")
+@Data
+public class InsProductUser implements Serializable {
+    /**
+     * 
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    @TableField(fill = FieldFill.INSERT)
+    private Integer createUser;
+
+    @ApiModelProperty("鍒涘缓鏃堕棿")
+    @TableField(fill = FieldFill.INSERT)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createTime;
+
+    /**
+     * 澶栭敭锛歩ns_product琛╥d
+     */
+    private Integer insProductId;
+}
\ No newline at end of file
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/pojo/StandardProductList.java b/inspect-server/src/main/java/com/yuanchu/mom/pojo/StandardProductList.java
index 10706d8..a833fc9 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/pojo/StandardProductList.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/pojo/StandardProductList.java
@@ -185,4 +185,6 @@
 
     @ApiModelProperty("1锛氭湁鏁� 0锛氭棤鏁�")
     private Integer state;
+
+    private String dic;
 }
\ No newline at end of file
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/InsProductUserService.java b/inspect-server/src/main/java/com/yuanchu/mom/service/InsProductUserService.java
new file mode 100644
index 0000000..da19dc8
--- /dev/null
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/InsProductUserService.java
@@ -0,0 +1,13 @@
+package com.yuanchu.mom.service;
+
+import com.yuanchu.mom.pojo.InsProductUser;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author z1292
+* @description 閽堝琛ㄣ�恑ns_product_user(妫�楠岄」鐩殑浜哄憳妫�楠岃褰�)銆戠殑鏁版嵁搴撴搷浣淪ervice
+* @createDate 2024-04-17 13:42:44
+*/
+public interface InsProductUserService extends IService<InsProductUser> {
+
+}
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
index 85b7357..08ed607 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -479,14 +479,15 @@
                 JSONObject sheet = JSON.parseObject(JSON.toJSONString(JSON.parseArray(JSON.toJSONString(JSON.parseObject(thing).get("data"))).get(0)));
                 JSONObject config = JSON.parseObject(JSON.toJSONString(sheet.get("config")));
                 List<JSONObject> cellData = JSON.parseArray(JSON.toJSONString(sheet.get("celldata")), JSONObject.class);
-                List<JSONObject> tableData = new ArrayList<>();
+//                List<JSONObject> tableData = new ArrayList<>();
                 Map<String, Object> style = new HashMap<>();
                 style.put("rowlen", config.get("rowlen"));
                 style.put("columnlen", config.get("columnlen"));
                 int r = -1;
-                if (BeanUtil.isNotEmpty(cellData)) {
+                /*if (BeanUtil.isNotEmpty(cellData)) {
                     for (JSONObject o : cellData) {
                         JSONObject v = JSON.parseObject(JSON.toJSONString(o.get("v")));
+                        tableData.add(o);
                         if (BeanUtil.isNotEmpty(v.get("ps"))) {
                             JSONObject ps = JSON.parseObject(JSON.toJSONString(v.get("ps")));
                             if (ps.get("value").equals("妫�楠岄」") && v.get("v").equals(product.getInspectionItem())) {
@@ -504,8 +505,8 @@
                             }
                         }
                     }
-                }
-                product.setTemplate(tableData);
+                }*/
+                product.setTemplate(cellData);
                 product.setStyle(style);
             }
         }
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsProductUserServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsProductUserServiceImpl.java
new file mode 100644
index 0000000..64802e1
--- /dev/null
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsProductUserServiceImpl.java
@@ -0,0 +1,22 @@
+package com.yuanchu.mom.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.pojo.InsProductUser;
+import com.yuanchu.mom.service.InsProductUserService;
+import com.yuanchu.mom.mapper.InsProductUserMapper;
+import org.springframework.stereotype.Service;
+
+/**
+* @author z1292
+* @description 閽堝琛ㄣ�恑ns_product_user(妫�楠岄」鐩殑浜哄憳妫�楠岃褰�)銆戠殑鏁版嵁搴撴搷浣淪ervice瀹炵幇
+* @createDate 2024-04-17 13:42:44
+*/
+@Service
+public class InsProductUserServiceImpl extends ServiceImpl<InsProductUserMapper, InsProductUser>
+    implements InsProductUserService{
+
+}
+
+
+
+
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java
index eaf6522..4e5b974 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java
@@ -22,6 +22,7 @@
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
 
@@ -150,7 +151,7 @@
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void reTreeBySampleType(String sampleType) {
-//        Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
+        Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
         CompletableFuture.supplyAsync(() -> {
             List<StandardProductList> productList = standardTreeMapper.getStandardProductListBySample(sampleType);
             List<StandardProductList> productList1 = JSON.parseArray(JSON.toJSONString(productList), StandardProductList.class);
@@ -173,9 +174,10 @@
                                 int count2 = 0;
                                 for (StandardProductList pl2 : productList) {
                                     if (Objects.equals(pl1.getInspectionItemSubclass(), pl2.getInspectionItemSubclass()) && Objects.equals(pl1.getInspectionItem(), pl2.getInspectionItem())) {
-                                        pl2.setUpdateUser(null);
-                                        pl2.setUpdateTime(null);
+                                        pl2.setUpdateUser(userId);
+                                        pl2.setUpdateTime(LocalDateTime.now());
                                         pl2.setId(pl1.getId());
+                                        pl2.setSample(tree.getSample());
                                         standardProductListMapper.updateById(pl2);
                                         break;
                                     } else {
diff --git a/inspect-server/src/main/resources/mapper/InsProductUserMapper.xml b/inspect-server/src/main/resources/mapper/InsProductUserMapper.xml
new file mode 100644
index 0000000..d04fe31
--- /dev/null
+++ b/inspect-server/src/main/resources/mapper/InsProductUserMapper.xml
@@ -0,0 +1,18 @@
+<?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.yuanchu.mom.mapper.InsProductUserMapper">
+
+    <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.InsProductUser">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="createUser" column="create_user" jdbcType="INTEGER"/>
+            <result property="createTime" column="create_time" jdbcType="VARCHAR"/>
+            <result property="insProductId" column="ins_product_id" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,create_user,create_time,
+        ins_product_id
+    </sql>
+</mapper>
diff --git a/inspect-server/src/main/resources/mapper/StandardTreeMapper.xml b/inspect-server/src/main/resources/mapper/StandardTreeMapper.xml
index fd9986f..34c8d68 100644
--- a/inspect-server/src/main/resources/mapper/StandardTreeMapper.xml
+++ b/inspect-server/src/main/resources/mapper/StandardTreeMapper.xml
@@ -93,7 +93,8 @@
                man_day,
                sample,
                bsm,
-               template_id
+               template_id,
+               dic
         from structure_item_parameter sp
         left join structure_test_object sto on sto.id = sp.sample
         where sto.specimen_name = #{sampleType}

--
Gitblit v1.9.3