use of com.netsteadfast.greenstep.po.hbm.TbSysProgMultiName in project bamboobsc by billchen198318.
the class MenuSupportUtils method getProgramMultiName.
public static String getProgramMultiName(TbSysProg sysProg, String localeCode) throws ServiceException, Exception {
if (null == sysProg) {
return "unknown-program";
}
if (LocaleLanguageUtils.getMap().get(localeCode) == null) {
return sysProg.getName();
}
TbSysProgMultiName multiName = new TbSysProgMultiName();
multiName.setProgId(sysProg.getProgId());
multiName.setLocaleCode(localeCode);
multiName = sysProgMultiNameService.findByEntityUK(multiName);
if (multiName != null && !StringUtils.isBlank(multiName.getName()) && YesNo.YES.equals(multiName.getEnableFlag())) {
return multiName.getName();
}
return sysProg.getName();
}
use of com.netsteadfast.greenstep.po.hbm.TbSysProgMultiName in project bamboobsc by billchen198318.
the class SystemProgramLogicServiceImpl method delete.
/**
* 刪除 TB_SYS_PROG 資料
*
* @param sysProg
* @return
* @throws ServiceException
* @throws Exception
*/
@ServiceMethodAuthority(type = { ServiceMethodType.DELETE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<Boolean> delete(SysProgVO sysProg) throws ServiceException, Exception {
if (sysProg == null || StringUtils.isBlank(sysProg.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<SysProgVO> sysProgResult = this.sysProgService.findObjectByOid(sysProg);
if (sysProgResult.getValue() == null) {
throw new ServiceException(sysProgResult.getSystemMessage().getValue());
}
sysProg = sysProgResult.getValue();
Map<String, Object> params = new HashMap<String, Object>();
params.put("progId", sysProg.getProgId());
if (this.sysMenuService.countByParams(params) > 0) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_CANNOT_DELETE));
}
// 刪除 TB_SYS_MENU_ROLE 資料
List<TbSysMenuRole> sysMenuRoleList = this.sysMenuRoleService.findListByParams(params);
for (int i = 0; sysMenuRoleList != null && i < sysMenuRoleList.size(); i++) {
TbSysMenuRole sysMenuRole = sysMenuRoleList.get(i);
this.sysMenuRoleService.delete(sysMenuRole);
}
// 刪除名稱語言資料 tb_sys_prog_multi_name
List<TbSysProgMultiName> progMultiNames = this.sysProgMultiNameService.findListByParams(params);
for (int i = 0; progMultiNames != null && i < progMultiNames.size(); i++) {
this.sysProgMultiNameService.delete(progMultiNames.get(i));
}
return this.sysProgService.deleteObject(sysProg);
}
Aggregations