lyfO_o
2022-02-10 aee83e0836bfa9647b9bc3dc39644dc8ca66912f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.nanometer.smartlab.service;
 
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;
 
import javax.annotation.Resource;
 
@Service
public class SysWarehouseStatusServiceImpl implements SysWarehouseStatusService {
 
    @Resource
    private SysWarehouseStatusDao sysWarehouseStatusDao;
 
    @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);
    }
}