危化品全生命周期管理后端
“djh”
2025-03-06 9c4cd9c77bb92b22a2099c56afb0b5dc3c898470
修改
已修改10个文件
61 ■■■■■ 文件已修改
hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzHazmatBasic.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/HzProductBasic.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/java/com/gkhy/hazmat/system/domain/vo/HzSecientificVo.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatBasicServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzProductBasicServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/resources/mapper/system/HzEntryRecordMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/resources/mapper/system/HzHazmatBasicMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/resources/mapper/system/HzProductBasicMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/resources/mapper/system/HzProductEntryRecordMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/resources/mapper/system/HzSecientificMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
}
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;
}
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;
    }
}
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);
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());
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>
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">
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">
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>
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>