use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class ClearTempDataJobImpl method executeInternal.
@Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
if (ContextLoader.getCurrentWebApplicationContext() == null) {
log.warn("ApplicationContext no completed, AppContext.getApplicationContext() == null");
return;
}
log.info("begin....");
try {
/**
* document reference:
* com.netsteadfast.greenstep.support.CleanTempUploadForContextInitAndDestroy.java
*/
this.loginForBackgroundProgram();
List<SysVO> systems = ApplicationSiteUtils.getSystems();
if (systems == null || systems.size() < 1) {
return;
}
for (SysVO sys : systems) {
UploadSupportUtils.cleanTempUpload(sys.getSysId());
}
/**
* document reference:
* com.netsteadfast.greenstep.bsc.support.CleanJasperReportTempDataForContextInitAndDestroy.java
*
*/
NamedParameterJdbcTemplate namedParameterJdbcTemplate = (NamedParameterJdbcTemplate) AppContext.getBean("namedParameterJdbcTemplate");
Map<String, Object> paramMap = new HashMap<String, Object>();
namedParameterJdbcTemplate.update("delete from bb_swot_report_mst", paramMap);
namedParameterJdbcTemplate.update("delete from bb_swot_report_dtl", paramMap);
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
this.logoutForBackgroundProgram();
} catch (Exception e) {
e.printStackTrace();
}
}
log.info("end....");
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class ApplicationSiteUtils method configureHost.
@SuppressWarnings("unchecked")
public static void configureHost(String sysId, String logConfFileFullPath) {
String logValue = FSUtils.readStr(logConfFileFullPath).trim();
if (!StringUtils.isBlank(logValue) && UPDATE_HOST_ONLY_FIRST_ONE.equals(Constants.getApplicationSiteHostUpdateMode())) {
// has before start log file, and UPDATE_HOST_ONLY_FIRST_ONE mode
FSUtils.writeStr2(logConfFileFullPath, UPDATE_HOST_ONLY_FIRST_ONE);
return;
}
ISysService<SysVO, TbSys, String> sysService = (ISysService<SysVO, TbSys, String>) AppContext.getBean("core.service.SysService");
SysVO sys = new SysVO();
sys.setSysId(sysId);
try {
DefaultResult<SysVO> result = sysService.findByUK(sys);
if (result.getValue() == null) {
System.out.println(result.getSystemMessage().getValue());
return;
}
sys = result.getValue();
// 2016-06-29 rem
/*
String port = "";
String tmp[] = sys.getHost().split(":");
if ( tmp!=null && tmp.length==2 ) {
port = tmp[1];
}
*/
// 2016-06-29 add
String port = String.valueOf(HostUtils.getHttpPort());
String hostAddress = HostUtils.getHostAddress();
sys.setHost(hostAddress);
if (!StringUtils.isBlank(port)) {
sys.setHost(hostAddress + ":" + port);
}
sysService.updateObject(sys);
if (UPDATE_HOST_ALWAYS.equals(Constants.getApplicationSiteHostUpdateMode())) {
FSUtils.writeStr2(logConfFileFullPath, UPDATE_HOST_ALWAYS);
} else {
FSUtils.writeStr2(logConfFileFullPath, UPDATE_HOST_ONLY_FIRST_ONE);
}
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class ApplicationSiteUtils method getSystemsCheckCrossSiteWithTestConnection.
@SuppressWarnings("unchecked")
public static List<SysVO> getSystemsCheckCrossSiteWithTestConnection(HttpServletRequest request) {
ISysService<SysVO, TbSys, String> sysService = (ISysService<SysVO, TbSys, String>) AppContext.getBean("core.service.SysService");
List<SysVO> sysList = null;
try {
sysList = sysService.findListVOByParams(null);
for (SysVO sys : sysList) {
if (checkCrossSite(sys.getHost().toLowerCase(), request)) {
sys.setCrossSiteFlag(YesNo.YES);
} else {
sys.setCrossSiteFlag(YesNo.NO);
}
if (checkTestConnection(sys.getHost(), sys.getContextPath(), request)) {
sys.setTestFlag(YesNo.YES);
} else {
sys.setTestFlag(YesNo.NO);
}
}
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return sysList;
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class SystemProgramLogicServiceImpl method create.
/**
* 產生 TB_SYS_PROG 資料
*
* @param sys
* @param iconOid
* @return
* @throws ServiceException
* @throws Exception
*/
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysProgVO> create(SysProgVO sysProg, String sysOid, String iconOid) throws ServiceException, Exception {
SysVO sys = new SysVO();
sys.setOid(sysOid);
DefaultResult<SysVO> sysResult = this.sysService.findObjectByOid(sys);
if (sysResult.getValue() == null) {
throw new ServiceException(sysResult.getSystemMessage().getValue());
}
sys = sysResult.getValue();
SysIconVO sysIcon = new SysIconVO();
sysIcon.setOid(iconOid);
DefaultResult<SysIconVO> iconResult = this.sysIconService.findObjectByOid(sysIcon);
if (iconResult.getValue() == null) {
throw new ServiceException(iconResult.getSystemMessage().getValue());
}
sysIcon = iconResult.getValue();
sysProg.setProgSystem(sys.getSysId());
sysProg.setIcon(sysIcon.getIconId());
return this.sysProgService.saveObject(sysProg);
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class SystemWebServiceConfigLogicServiceImpl method update.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysWsConfigVO> update(SysWsConfigVO config, String systemOid) throws ServiceException, Exception {
if (config == null || super.isBlank(config.getOid()) || super.isBlank(systemOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<SysWsConfigVO> oldResult = this.sysWsConfigService.findObjectByOid(config);
if (oldResult.getValue() == null) {
throw new ServiceException(oldResult.getSystemMessage().getValue());
}
SysVO sys = new SysVO();
sys.setOid(systemOid);
DefaultResult<SysVO> sResult = this.sysService.findObjectByOid(sys);
if (sResult.getValue() == null) {
throw new ServiceException(sResult.getSystemMessage().getValue());
}
sys = sResult.getValue();
config.setWsId(oldResult.getValue().getWsId());
config.setSystem(sys.getSysId());
if (super.defaultString(config.getDescription()).length() > MAX_DESCRIPTION_LENGTH) {
config.setDescription(config.getDescription().substring(0, MAX_DESCRIPTION_LENGTH));
}
return this.sysWsConfigService.updateObject(config);
}
Aggregations