use of com.netsteadfast.greenstep.po.hbm.TbSysCode in project bamboobsc by billchen198318.
the class PdcaType method loadMapData.
private static void loadMapData() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("type", CODE_TYPE);
Map<String, String> orderParams = new HashMap<String, String>();
orderParams.put("code", "ASC");
try {
List<TbSysCode> codes = sysCodeService.findListByParams(params, null, orderParams);
for (TbSysCode code : codes) {
if (code.getCode().equals(PLAN_CODE)) {
pdcaMap.put(PLAN, code.getName());
}
if (code.getCode().equals(DO_CODE)) {
pdcaMap.put(DO, code.getName());
}
if (code.getCode().equals(CHECK_CODE)) {
pdcaMap.put(CHECK, code.getName());
}
if (code.getCode().equals(ACTION_CODE)) {
pdcaMap.put(ACTION, code.getName());
}
}
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.netsteadfast.greenstep.po.hbm.TbSysCode in project bamboobsc by billchen198318.
the class FormulaMode method loadReturnModeMapData.
private static void loadReturnModeMapData() {
returnModeMap.clear();
Map<String, Object> params = new HashMap<String, Object>();
params.put("type", CODE_TYPE);
Map<String, String> orderParams = new HashMap<String, String>();
orderParams.put("code", "ASC");
try {
List<TbSysCode> codes = sysCodeService.findListByParams(params, null, orderParams);
for (TbSysCode code : codes) {
if (MODE_DEFAULT_CODE.equals(code.getCode())) {
returnModeMap.put(MODE_DEFAULT, code.getName());
}
if (MODE_CUSTOM_CODE.equals(code.getCode())) {
returnModeMap.put(MODE_CUSTOM, code.getName());
}
}
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
if (returnModeMap.size() != 2) {
returnModeMap.clear();
returnModeMap.put(MODE_DEFAULT, MODE_DEFAULT);
returnModeMap.put(MODE_CUSTOM, MODE_CUSTOM);
}
}
use of com.netsteadfast.greenstep.po.hbm.TbSysCode in project bamboobsc by billchen198318.
the class ReportPropertySaveOrUpdateAction method updateSysCode.
private void updateSysCode(String code, String value) throws ServiceException, Exception {
TbSysCode sysCode = new TbSysCode();
sysCode.setCode(code);
sysCode.setType(BscReportCode.CODE_TYPE);
sysCode = this.sysCodeService.findByEntityUK(sysCode);
if (null == sysCode || StringUtils.isBlank(sysCode.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
}
sysCode.setParam1(value);
this.sysCodeService.update(sysCode);
}
use of com.netsteadfast.greenstep.po.hbm.TbSysCode in project bamboobsc by billchen198318.
the class SysMessageUtil method get.
public static String get(String code) {
if (code == null || "".equals(code)) {
return "";
}
if (sysMsgMap.get(code) != null) {
return sysMsgMap.get(code);
}
init();
if (jdbcTemplate == null) {
return "";
}
String message = null;
TbSysCode sysCode = new TbSysCode();
sysCode.setCode(code);
Map<String, Object> queryMap = getQuery(sysCode);
if (queryMap == null) {
return "";
}
try {
message = jdbcTemplate.queryForObject(((String) queryMap.get(SqlGenerateUtil.RETURN_SQL)), (Object[]) queryMap.get(SqlGenerateUtil.RETURN_PARAMS), String.class);
if (message != null) {
sysMsgMap.put(code, message);
}
} catch (EmptyResultDataAccessException eda) {
System.out.println(eda.getMessage().toString());
} catch (Exception e) {
e.printStackTrace();
}
return message == null ? code : message;
}
use of com.netsteadfast.greenstep.po.hbm.TbSysCode in project bamboobsc by billchen198318.
the class BscMeasureDataFrequency method loadMapData.
private static void loadMapData() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("type", CODE_TYPE);
Map<String, String> orderParams = new HashMap<String, String>();
orderParams.put("code", "ASC");
try {
List<TbSysCode> codes = sysCodeService.findListByParams(params, null, orderParams);
for (TbSysCode code : codes) {
if (code.getCode().equals(FREQUENCY_DAY_CODE)) {
frequencyMap.put(FREQUENCY_DAY, code.getName());
}
if (code.getCode().equals(FREQUENCY_WEEK_CODE)) {
frequencyMap.put(FREQUENCY_WEEK, code.getName());
}
if (code.getCode().equals(FREQUENCY_MONTH_CODE)) {
frequencyMap.put(FREQUENCY_MONTH, code.getName());
}
if (code.getCode().equals(FREQUENCY_QUARTER_CODE)) {
frequencyMap.put(FREQUENCY_QUARTER, code.getName());
}
if (code.getCode().equals(FREQUENCY_HALF_OF_YEAR_CODE)) {
frequencyMap.put(FREQUENCY_HALF_OF_YEAR, code.getName());
}
if (code.getCode().equals(FREQUENCY_YEAR_CODE)) {
frequencyMap.put(FREQUENCY_YEAR, code.getName());
}
}
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations