use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.
the class SystemBeanHelpLogicServiceImpl method createExpr.
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysBeanHelpExprVO> createExpr(SysBeanHelpExprVO beanHelpExpr, String helpOid, String expressionOid) throws ServiceException, Exception {
if (beanHelpExpr == null || super.isBlank(helpOid) || super.isBlank(expressionOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysBeanHelpVO sysBeanHelp = new SysBeanHelpVO();
sysBeanHelp.setOid(helpOid);
DefaultResult<SysBeanHelpVO> mResult = this.sysBeanHelpService.findObjectByOid(sysBeanHelp);
if (mResult.getValue() == null) {
throw new ServiceException(mResult.getSystemMessage().getValue());
}
// 查看有沒有資料
sysBeanHelp = mResult.getValue();
SysExpressionVO sysExpression = new SysExpressionVO();
sysExpression.setOid(expressionOid);
DefaultResult<SysExpressionVO> exprResult = this.sysExpressionService.findObjectByOid(sysExpression);
if (exprResult.getValue() == null) {
throw new ServiceException(exprResult.getSystemMessage().getValue());
}
sysExpression = exprResult.getValue();
beanHelpExpr.setHelpOid(sysBeanHelp.getOid());
beanHelpExpr.setExprId(sysExpression.getExprId());
return this.sysBeanHelpExprService.saveObject(beanHelpExpr);
}
use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.
the class SystemBeanHelpLogicServiceImpl method update.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysBeanHelpVO> update(SysBeanHelpVO beanHelp, String systemOid) throws ServiceException, Exception {
if (beanHelp == null || super.isBlank(beanHelp.getOid()) || super.isBlank(systemOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysVO sys = new SysVO();
sys.setOid(systemOid);
DefaultResult<SysVO> sResult = sysService.findObjectByOid(sys);
if (sResult.getValue() == null) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
sys = sResult.getValue();
beanHelp.setSystem(sys.getSysId());
return sysBeanHelpService.updateObject(beanHelp);
}
use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.
the class SystemBeanHelpLogicServiceImpl method createExprMap.
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysBeanHelpExprMapVO> createExprMap(SysBeanHelpExprMapVO beanHelpExprMap, String helpExprOid) throws ServiceException, Exception {
if (beanHelpExprMap == null || super.isBlank(helpExprOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysBeanHelpExprVO sysBeanHelpExpr = new SysBeanHelpExprVO();
sysBeanHelpExpr.setOid(helpExprOid);
DefaultResult<SysBeanHelpExprVO> mResult = this.sysBeanHelpExprService.findObjectByOid(sysBeanHelpExpr);
if (mResult.getValue() == null) {
throw new ServiceException(mResult.getSystemMessage().getValue());
}
// 查看有沒有資料
sysBeanHelpExpr = mResult.getValue();
beanHelpExprMap.setHelpExprOid(sysBeanHelpExpr.getOid());
return this.sysBeanHelpExprMapService.saveObject(beanHelpExprMap);
}
use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.
the class SystemBeanHelpLogicServiceImpl method create.
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysBeanHelpVO> create(SysBeanHelpVO beanHelp, String systemOid) throws ServiceException, Exception {
if (beanHelp == null || super.isBlank(systemOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysVO sys = new SysVO();
sys.setOid(systemOid);
DefaultResult<SysVO> sResult = sysService.findObjectByOid(sys);
if (sResult.getValue() == null) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
sys = sResult.getValue();
beanHelp.setSystem(sys.getSysId());
return sysBeanHelpService.saveObject(beanHelp);
}
use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.
the class SystemBeanHelpLogicServiceImpl method delete.
@ServiceMethodAuthority(type = { ServiceMethodType.DELETE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<Boolean> delete(SysBeanHelpVO beanHelp) throws ServiceException, Exception {
if (beanHelp == null || super.isBlank(beanHelp.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
// delete TB_SYS_BEAN_HELP_EXPR
Map<String, Object> params = new HashMap<String, Object>();
params.put("helpOid", beanHelp.getOid());
List<TbSysBeanHelpExpr> exprList = this.sysBeanHelpExprService.findListByParams(params);
for (int i = 0; exprList != null && i < exprList.size(); i++) {
// delete TB_SYS_BEAN_HELP_EXPR_MAP
TbSysBeanHelpExpr helpExpr = exprList.get(i);
params.clear();
params.put("helpExprOid", helpExpr.getOid());
List<TbSysBeanHelpExprMap> exprMapList = this.sysBeanHelpExprMapService.findListByParams(params);
for (int j = 0; exprMapList != null && j < exprMapList.size(); j++) {
TbSysBeanHelpExprMap helpExprMap = exprMapList.get(j);
this.sysBeanHelpExprMapService.delete(helpExprMap);
}
this.sysBeanHelpExprService.delete(helpExpr);
}
return sysBeanHelpService.deleteObject(beanHelp);
}
Aggregations