From 9c4cd9c77bb92b22a2099c56afb0b5dc3c898470 Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: 星期四, 06 三月 2025 08:25:04 +0800
Subject: [PATCH] 修改

---
 hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatBasicServiceImpl.java  |    6 +++
 hazmat-system/src/main/resources/mapper/system/HzProductBasicMapper.xml                        |    5 ++
 hazmat-system/src/main/resources/mapper/system/HzHazmatBasicMapper.xml                         |    4 +
 hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/vo/HzSecientificVo.java              |    9 +++-
 hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzProductBasicServiceImpl.java |    6 +++
 hazmat-system/src/main/resources/mapper/system/HzSecientificMapper.xml                         |    2 
 hazmat-system/src/main/resources/mapper/system/HzEntryRecordMapper.xml                         |    6 +++
 hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzProductBasic.java                  |    8 ++++
 hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzHazmatBasic.java                   |    9 ++++
 hazmat-system/src/main/resources/mapper/system/HzProductEntryRecordMapper.xml                  |    6 +++
 10 files changed, 56 insertions(+), 5 deletions(-)

diff --git a/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzHazmatBasic.java b/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzHazmatBasic.java
index 4ac234e..ae0d91c 100644
--- a/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzHazmatBasic.java
+++ b/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzHazmatBasic.java
@@ -165,5 +165,14 @@
     @TableField(exist = false)
     private String companyName;
 
+    @ApiModelProperty("危化品特性类别")
+    @TableField(exist = false)
+    private String riskType;
+
+    @ApiModelProperty("危化品分类信息id")
+    @TableField("secientific_id")
+    private Integer secientificId;
+
+
 
 }
diff --git a/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzProductBasic.java b/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzProductBasic.java
index 23a7514..bd4ed79 100644
--- a/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzProductBasic.java
+++ b/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzProductBasic.java
@@ -142,5 +142,13 @@
     @TableField(exist = false)
     private String companyName;
 
+    @ApiModelProperty("危化品特性类别")
+    @TableField(exist = false)
+    private String riskType;
+
+    @ApiModelProperty("危化品分类信息id")
+    @TableField("secientific_id")
+    private Integer secientificId;
+
 
 }
diff --git a/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/vo/HzSecientificVo.java b/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/vo/HzSecientificVo.java
index 9617cf7..b97ba5b 100644
--- a/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/vo/HzSecientificVo.java
+++ b/hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/vo/HzSecientificVo.java
@@ -5,11 +5,16 @@
 import lombok.Getter;
 import lombok.Setter;
 
-@Getter
-@Setter
+
 public class HzSecientificVo extends HzSecientific {
 
     private String peculiarityType;
 
+    public String getPeculiarityType() {
+        return peculiarityType;
+    }
 
+    public void setPeculiarityType(String peculiarityType) {
+        this.peculiarityType = peculiarityType;
+    }
 }
diff --git a/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatBasicServiceImpl.java b/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatBasicServiceImpl.java
index 5a41154..6ff2ff0 100644
--- a/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatBasicServiceImpl.java
+++ b/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatBasicServiceImpl.java
@@ -83,6 +83,7 @@
         HzSecientificVo hzSecientificVo = secientificMapper.selectBySecientificName(hazmatBasic.getName());
         hazmatBasic.setPeculiarityType(hzSecientificVo!=null? hzSecientificVo.getPeculiarityType() : null);
         hazmatBasic.setPeculiarityNumber(hzSecientificVo!=null? hzSecientificVo.getPeculiarityNumber() : 0);
+        hazmatBasic.setSecientificId(hzSecientificVo!=null? hzSecientificVo.getId() : null);
 
         int row = baseMapper.insert(hazmatBasic);
         if (row < 1) {
@@ -99,6 +100,10 @@
         SysUser currentUser = SecurityUtils.getLoginUser().getUser();
         checkUserAllowed(hazmatBasic,currentUser);
         hazmatBasic.setUpdateBy(currentUser.getUsername());
+        HzSecientificVo hzSecientificVo = secientificMapper.selectBySecientificName(hazmatBasic.getName());
+        hazmatBasic.setPeculiarityType(hzSecientificVo!=null? hzSecientificVo.getPeculiarityType() : null);
+        hazmatBasic.setPeculiarityNumber(hzSecientificVo!=null? hzSecientificVo.getPeculiarityNumber() : 0);
+        hazmatBasic.setSecientificId(hzSecientificVo!=null? hzSecientificVo.getId() : null);
         int row=baseMapper.updateById(hazmatBasic);
         if(row<1){
             throw new ApiException("更新危化品基础信息失败");
@@ -170,6 +175,7 @@
             HzSecientificVo hzSecientificVo = secientificMapper.selectBySecientificName(hazmatBasic.getName());
             hazmatBasic.setPeculiarityType(hzSecientificVo!=null? hzSecientificVo.getPeculiarityType() : "");
             hazmatBasic.setPeculiarityNumber(hzSecientificVo!=null? hzSecientificVo.getPeculiarityNumber() : 0);
+            hazmatBasic.setSecientificId(hzSecientificVo!=null? hzSecientificVo.getId() : null);
 
             hazmatBasic.setKind(kind);
             hazmatBasic.setMinPackage(minPackage);
diff --git a/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzProductBasicServiceImpl.java b/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzProductBasicServiceImpl.java
index 877a54f..a759119 100644
--- a/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzProductBasicServiceImpl.java
+++ b/hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzProductBasicServiceImpl.java
@@ -79,6 +79,7 @@
         HzSecientificVo hzSecientificVo = secientificMapper.selectBySecientificName(productBasic.getName());
         productBasic.setPeculiarityType(hzSecientificVo!=null? hzSecientificVo.getPeculiarityType() : null);
         productBasic.setPeculiarityNumber(hzSecientificVo!=null ? hzSecientificVo.getPeculiarityNumber() : 0);
+        productBasic.setSecientificId(hzSecientificVo!=null? hzSecientificVo.getId() : null);
 
         if (!checkProductSnUnique(productBasic)) {
             throw new ApiException("产品编号已存在");
@@ -99,6 +100,10 @@
         SysUser currentUser = SecurityUtils.getLoginUser().getUser();
         checkUserAllowed(productBasic,currentUser);
         productBasic.setUpdateBy(currentUser.getUsername());
+        HzSecientificVo hzSecientificVo = secientificMapper.selectBySecientificName(productBasic.getName());
+        productBasic.setPeculiarityType(hzSecientificVo!=null? hzSecientificVo.getPeculiarityType() : null);
+        productBasic.setPeculiarityNumber(hzSecientificVo!=null ? hzSecientificVo.getPeculiarityNumber() : 0);
+        productBasic.setSecientificId(hzSecientificVo!=null? hzSecientificVo.getId() : null);
         int row=baseMapper.updateById(productBasic);
         if(row<1){
             throw new ApiException("更新成品基础信息失败");
@@ -169,6 +174,7 @@
             HzSecientificVo hzSecientificVo = secientificMapper.selectBySecientificName(productBasic.getName());
             productBasic.setPeculiarityType(hzSecientificVo!=null? hzSecientificVo.getPeculiarityType() : null);
             productBasic.setPeculiarityNumber(hzSecientificVo!=null ? hzSecientificVo.getPeculiarityNumber() : 0);
+            productBasic.setSecientificId(hzSecientificVo!=null? hzSecientificVo.getId() : null);
             productBasic.setKind(kind);
             productBasic.setMinPackage(minPackage);
             productBasic.setCompanyId(currentUser.getCompanyId());
diff --git a/hazmat-system/src/main/resources/mapper/system/HzEntryRecordMapper.xml b/hazmat-system/src/main/resources/mapper/system/HzEntryRecordMapper.xml
index 58c19e9..fb410f4 100644
--- a/hazmat-system/src/main/resources/mapper/system/HzEntryRecordMapper.xml
+++ b/hazmat-system/src/main/resources/mapper/system/HzEntryRecordMapper.xml
@@ -79,6 +79,12 @@
             <if test="state != null">
                 AND a.state= #{state}
             </if>
+            <if test="params.warehouseId !=null">
+                and a.warehouse_id = #{params.warehouseId}
+            </if>
+            <if test="params.cupboardId !=null">
+                and a.cupboard_id = #{params.cupboardId}
+            </if>
         </where>
         order by a.id desc
     </select>
diff --git a/hazmat-system/src/main/resources/mapper/system/HzHazmatBasicMapper.xml b/hazmat-system/src/main/resources/mapper/system/HzHazmatBasicMapper.xml
index eb0373a..863ce60 100644
--- a/hazmat-system/src/main/resources/mapper/system/HzHazmatBasicMapper.xml
+++ b/hazmat-system/src/main/resources/mapper/system/HzHazmatBasicMapper.xml
@@ -31,14 +31,16 @@
         <result property="remark"         column="remark"          />
         <result property="maxEntry"         column="max_entry"          />
         <result property="companyName"         column="company_name"          />
+        <result property="riskType" column="risk_type"/>
     </resultMap>
 
     <sql id="selectHazmatBasicVo">
         select a.id, a.name, a.cas, a.hazmat_type,a.min_package, a.kind,a.hazmat_character,a.supplier,a.manufacturer,a.hazmat_format,a.metering,
                a.unit,a.price,a.per_box,a.safe_num,a.threshold,a.product_sn,a.company_id,a.version,a.peculiarity_type,a.peculiarity_number, a.create_by, a.create_time,
-               a.update_by, a.update_time, a.remark,a.max_entry,b.name as company_name
+               a.update_by, a.update_time, a.remark,a.max_entry,b.name as company_name,hs.risk_type
         from hz_hazmat_basic a
         left join sys_company b on b.id=a.company_id
+        LEFT JOIN hz_secientific hs ON a.secientific_id = hs.id
     </sql>
 
     <update id="deleteHazmatBasicById" parameterType="java.lang.Long">
diff --git a/hazmat-system/src/main/resources/mapper/system/HzProductBasicMapper.xml b/hazmat-system/src/main/resources/mapper/system/HzProductBasicMapper.xml
index 45150fd..940e82a 100644
--- a/hazmat-system/src/main/resources/mapper/system/HzProductBasicMapper.xml
+++ b/hazmat-system/src/main/resources/mapper/system/HzProductBasicMapper.xml
@@ -29,13 +29,16 @@
         <result property="remark"         column="remark"          />
         <result property="maxEntry"         column="max_entry"          />
         <result property="companyName"         column="company_name"          />
+        <result property="riskType" column="risk_type"/>
     </resultMap>
 
     <sql id="selectProductBasicVo">
         select a.id, a.name, a.cas, a.product_type, a.min_package,a.kind,a.product_character,a.supplier,a.manufacturer,a.product_format,a.metering,
-               a.unit,a.price,a.per_box,a.product_sn,a.company_id,a.version,a.peculiarity_type,a.peculiarity_number, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,a.max_entry,b.name as company_name
+               a.unit,a.price,a.per_box,a.product_sn,a.company_id,a.version,a.peculiarity_type,a.peculiarity_number,
+               a.create_by, a.create_time, a.update_by, a.update_time, a.remark,a.max_entry,b.name as company_name,hs.risk_type
         from hz_product_basic a
         left join sys_company b on b.id=a.company_id
+        LEFT JOIN hz_secientific hs ON a.secientific_id = hs.id
     </sql>
 
     <update id="deleteProductBasicById" parameterType="java.lang.Long">
diff --git a/hazmat-system/src/main/resources/mapper/system/HzProductEntryRecordMapper.xml b/hazmat-system/src/main/resources/mapper/system/HzProductEntryRecordMapper.xml
index 5a3048b..0fd3ff1 100644
--- a/hazmat-system/src/main/resources/mapper/system/HzProductEntryRecordMapper.xml
+++ b/hazmat-system/src/main/resources/mapper/system/HzProductEntryRecordMapper.xml
@@ -70,6 +70,12 @@
             <if test="companyId != null">
                 AND a.company_id =#{companyId}
             </if>
+            <if test="params.warehouseId !=null">
+                and a.warehouse_id =#{params.warehouseId}
+            </if>
+            <if test="params.cupboardId !=null">
+                and a.cupboard_id = #{params.cupboardId}
+            </if>
         </where>
         order by a.id desc
     </select>
diff --git a/hazmat-system/src/main/resources/mapper/system/HzSecientificMapper.xml b/hazmat-system/src/main/resources/mapper/system/HzSecientificMapper.xml
index 893e518..78738e2 100644
--- a/hazmat-system/src/main/resources/mapper/system/HzSecientificMapper.xml
+++ b/hazmat-system/src/main/resources/mapper/system/HzSecientificMapper.xml
@@ -22,7 +22,7 @@
                 LEFT JOIN hz_peculiarity hp ON hs.peculiarity_number = hp.peculiarity_number
         <where>
             <if test="secientificName!=null and secientificName!=''">
-                and secientific_name =#{secientificName}
+                and hs.secientific_name like  concat('%',#{secientificName},'%')
             </if>
             and hs.del_flag = 0
         </where>

--
Gitblit v1.9.2