| | |
| | | @TableField(exist = false) |
| | | private String companyName; |
| | | |
| | | @ApiModelProperty("危化品特性类别") |
| | | @TableField(exist = false) |
| | | private String riskType; |
| | | |
| | | @ApiModelProperty("危化品分类信息id") |
| | | @TableField("secientific_id") |
| | | private Integer secientificId; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String companyName; |
| | | |
| | | @ApiModelProperty("危化品特性类别") |
| | | @TableField(exist = false) |
| | | private String riskType; |
| | | |
| | | @ApiModelProperty("危化品分类信息id") |
| | | @TableField("secientific_id") |
| | | private Integer secientificId; |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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) { |
| | |
| | | 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("更新危化品基础信息失败"); |
| | |
| | | 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); |
| | |
| | | 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("产品编号已存在"); |
| | |
| | | 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("更新成品基础信息失败"); |
| | |
| | | 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()); |
| | |
| | | <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> |
| | |
| | | <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"> |
| | |
| | | <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"> |
| | |
| | | <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> |
| | |
| | | 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> |