Search in sources :

Example 21 with SysConfig

use of com.itrus.portal.db.SysConfig in project portal by ixinportal.

the class SystemConfigService method getCdnUrl.

/**
 * 获取CDN地址
 * @return
 */
public String getCdnUrl() {
    String type = SystemConfigService.CDN_URL;
    SysConfig sysConfig = sqlSession.selectOne("com.itrus.portal.db.SysConfigMapper.selectByType", type);
    if (sysConfig != null) {
        return sysConfig.getConfig();
    } else {
        return null;
    }
}
Also used : SysConfig(com.itrus.portal.db.SysConfig)

Example 22 with SysConfig

use of com.itrus.portal.db.SysConfig in project portal by ixinportal.

the class SystemConfigService method getpdfsrc.

public String getpdfsrc() {
    String type = SystemConfigService.PDF_SRC;
    SysConfig sysConfig = sqlSession.selectOne("com.itrus.portal.db.SysConfigMapper.selectByType", type);
    if (sysConfig != null) {
        return sysConfig.getConfig();
    } else {
        return null;
    }
}
Also used : SysConfig(com.itrus.portal.db.SysConfig)

Example 23 with SysConfig

use of com.itrus.portal.db.SysConfig in project portal by ixinportal.

the class SystemConfigService method isTimedTaskHost.

/**
 * 判断本机是否是定时任务的执行主机,是则返回true,不是则返回false
 * hgh
 * @return
 */
public Boolean isTimedTaskHost() {
    Boolean flag = false;
    SysConfig sysConfigHost = getRainfoHost();
    if (null == sysConfigHost) {
        // 没有配置,直接返回
        return flag;
    }
    String host = sysConfigHost.getConfig();
    host = host.replaceAll(" ", "");
    String[] hosts = host.split(",");
    // 获取本机主机名称
    InetAddress ia = null;
    try {
        ia = ia.getLocalHost();
    } catch (UnknownHostException e1) {
        e1.printStackTrace();
        return flag;
    }
    String hostName = ia.getHostName();
    boolean flag_check = false;
    for (String str : hosts) {
        if (hostName.equals(str.replaceAll(" ", ""))) {
            return true;
        }
    }
    // 判断本地主机名称是否与系统配置的同步主机名称一致,不一致则返回
    if (!flag_check) {
        return flag;
    }
    return flag;
}
Also used : SysConfig(com.itrus.portal.db.SysConfig) UnknownHostException(java.net.UnknownHostException) InetAddress(java.net.InetAddress)

Example 24 with SysConfig

use of com.itrus.portal.db.SysConfig in project portal by ixinportal.

the class SystemConfigService method getEnclosureUrl.

public String getEnclosureUrl() throws Exception {
    // 读取系统配置信息 获取附加文件地址
    String type = SystemConfigService.ENCLOSURE;
    SysConfig sysConfig = sqlSession.selectOne("com.itrus.portal.db.SysConfigMapper.selectByType", type);
    if (sysConfig != null) {
        return sysConfig.getConfig();
    } else {
        throw new Exception("没有配置终端后台地址!");
    }
}
Also used : SysConfig(com.itrus.portal.db.SysConfig) UnknownHostException(java.net.UnknownHostException)

Example 25 with SysConfig

use of com.itrus.portal.db.SysConfig in project portal by ixinportal.

the class SystemConfigService method getMaxImageProject.

public Long getMaxImageProject() {
    // 读取系统配置信息 获取个人实名认证地址
    String type = SystemConfigService.MAX_IMAGE_PROJECT;
    SysConfig sysConfig = sqlSession.selectOne("com.itrus.portal.db.SysConfigMapper.selectByType", type);
    if (sysConfig != null) {
        return Long.parseLong(sysConfig.getConfig());
    } else {
        return null;
    }
}
Also used : SysConfig(com.itrus.portal.db.SysConfig)

Aggregations

SysConfig (com.itrus.portal.db.SysConfig)33 UnknownHostException (java.net.UnknownHostException)15 InetAddress (java.net.InetAddress)9 HashMap (java.util.HashMap)7 Date (java.util.Date)5 Scheduled (org.springframework.scheduling.annotation.Scheduled)5 UserInfoServiceException (com.itrus.portal.exception.UserInfoServiceException)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 ApplicationInfo (com.itrus.portal.db.ApplicationInfo)2 Charging (com.itrus.portal.db.Charging)2 Product (com.itrus.portal.db.Product)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 LinkedMultiValueMap (org.springframework.util.LinkedMultiValueMap)2 JSONObject (com.alibaba.fastjson.JSONObject)1 AppService (com.itrus.portal.db.AppService)1 AuditSystemConfig (com.itrus.portal.db.AuditSystemConfig)1 AuditSystemConfigExample (com.itrus.portal.db.AuditSystemConfigExample)1 Bill (com.itrus.portal.db.Bill)1 BusinessLicense (com.itrus.portal.db.BusinessLicense)1 Certification (com.itrus.portal.db.Certification)1