package com.sifang.modules.sys.service;

import com.jfinal.plugin.activerecord.Record;
import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
import com.sifang.modules.sys.dao.WindSnowPressureLevelDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WindSnowPressureLevelService {
    @Autowired
    private WindSnowPressureLevelDao windSnowPressureLevelDao;

    public Record findPressureLevel(String province,String city ,String area) {
        Record record = windSnowPressureLevelDao.findPressureLevel(province, city, area);
        if ("陕西省".equals(province)){
            record = new Record();
            record.set("wind_pressure","-");
            record.set("snow_pressure","-");
            record.set("pressure_level","低风雪压地区");
        }
//        if (record != null) {
//            String windPressure = record.getStr("wind_pressure");
//            if (StringUtil.isNotBlank(windPressure) && !"-".equals(windPressure)){
//                record.set("wind_pressure",windPressure+"kN/㎡");
//            }
//            String snowPressure = record.getStr("snow_pressure");
//            if (StringUtil.isNotBlank(snowPressure) && !"-".equals(windPressure)){
//                record.set("snow_pressure",snowPressure+"kN/㎡");
//            }
//        }
        return record;
    }
}
