// 删除扫描记录 @WebMethod public ModelAndView deleteScanRecord(Integer id) { ModelAndView mv = new ModelAndView(); ScanRecord po = dao.get(ScanRecord.class, id); if (po != null) { dao.delete(po); } else { throw new GException(PlatformExceptionType.BusinessException, "记录不存在或已经删除"); } mv.data.put("result", "success"); return mv; }
@WebMethod public ModelAndView banUser(int groupId, int uid) { ModelAndView mv = new ModelAndView(); UserGroup po = dao.getUniqueByParams( UserGroup.class, new String[] {"gid", "uid"}, new Object[] {groupId, Integer.valueOf(uid)}); if (po != null) { dao.delete(po); } return mv; }
@WebMethod public ModelAndView delete(int id) { ModelAndView mv = new ModelAndView(); User po = dao.get(User.class, id); if (po != null) { dao.delete(po); dao.execute("delete from UserGroup where uid=?", id); dao.execute("delete from UserRole where uid=?", id); mv.data.put("msg", "删除用户成功"); } return mv; }
// 批量删除扫描记录 @WebMethod public ModelAndView deleteBatchScanRecord(String ids) { ModelAndView mv = new ModelAndView(); if (StringUtils.isEmpty(ids)) { throw new GException(PlatformExceptionType.BusinessException, "参数ids不能为空"); } String[] idArr = ids.split(","); for (String id : idArr) { ScanRecord po = dao.get(ScanRecord.class, Integer.valueOf(id)); if (po != null) { dao.delete(po); } } mv.data.put("result", "success"); return mv; }