not a generic type of lits
public <T> T getUserNum(Map<String,Object> param);
A layered concept of code, controller assembly, data return data, general logic branches
@RequestMapping(value = "/addUser")
public String addUser(Model model,TbCusUserBeanVo tbCusUserBeanVo, @RequestParam(value="rolesKey") String rolesKey,@RequestParam(value="pz") String[] pz,HttpServletRequest request, HttpSession session) throws Exception {
if(tbCusUserBeanVo==null){
return null;
}
tbCusUserBeanVo.setCustomerKey(BigDecimal.valueOf(Long.valueOf(customerKey)));
try{
Map<String,Object> param =new HashMap<String,Object>();
param.put("CUSTOMER_KEY", tbCusUserBeanVo.getCustomerKey());
Map userNum = accountService.getUserNum (param);
if (userNum == null) {
accountService.addOperateUser(tbCusUserBeanVo, rolesKey, pz);
}else{
int i =((BigDecimal)userNum.get("COUNT")).intValue();
if(((BigDecimal)userNum.get("SET_USER_NUM")).intValue()<i+1){
throw new Exception("Add at most:"+((BigDecimal)userNum.get("SET_USER_NUM")).intValue()+"sub-accounts");
}else{
accountService.addOperateUser(tbCusUserBeanVo, rolesKey, pz);
}
}
}catch(Exception e){
e.printStackTrace ();
return null;
}
return "";
}