lyfO_o
2022-02-10 aee83e0836bfa9647b9bc3dc39644dc8ca66912f
src/main/java/com/nanometer/smartlab/service/SysWarehouseStatusServiceImpl.java
@@ -2,6 +2,9 @@
import com.nanometer.smartlab.dao.SysWarehouseStatusDao;
import com.nanometer.smartlab.entity.SysWarehouseStatus;
import com.nanometer.smartlab.exception.BusinessException;
import com.nanometer.smartlab.exception.ExceptionEnumCode;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -15,6 +18,12 @@
    @Override
    public void addOne(SysWarehouseStatus one) {
        if (one.getTemperature() == null || one.getHumidity() == null || one.getSelectDate() == null) {
            throw new BusinessException(ExceptionEnumCode.PARAM_NULL, "参数不能为空");
        }
        if (StringUtils.isBlank(one.getName()) || StringUtils.isBlank(one.getType())) {
            throw new BusinessException(ExceptionEnumCode.PARAM_NULL, "字符不能为空");
        }
        sysWarehouseStatusDao.insertOne(one);
    }
}