/** * 获取文件内容列表 * * @return */ private List<SimInfo> formatSimInfos(List<SimInfo> list) { UserInfo currentUser = (UserInfo) ActionContext.getContext().getSession().get(Constants.USER_SESSION_KEY); List<SimInfo> ret = new ArrayList<SimInfo>(); for (SimInfo tmp : list) { if (tmp.getSimCardNumber() != null && tmp.getSimCardNumber().length() == 0 && tmp.getIccidElectron() != null && tmp.getIccidElectron().length() == 0 && tmp.getIccidPrint() != null && tmp.getIccidPrint().length() == 0 && tmp.getCellPhone() != null && tmp.getCellPhone().length() == 0 && tmp.getStartUseTime() != null && tmp.getStartUseTime().length() == 0) { // 文件行数据为空 continue; } else { // 主键 tmp.setSimId(UUIDGenerator.getUUID()); // 运营商ID tmp.setBusinessId(simInfo.getBusinessId()); // 创建用户ID tmp.setCreater(currentUser.getUserID()); // 修改用户ID tmp.setModifier(currentUser.getUserID()); // 添加到list中 ret.add(tmp); } } return ret; }
/** * 更新SIM卡信息 * * @return */ public String update() { UserInfo currentUser = (UserInfo) ActionContext.getContext().getSession().get(Constants.USER_SESSION_KEY); if (simInfo != null) { // 设置修改用户 simInfo.setModifier(currentUser.getUserID()); // 设置SIM卡主键值 simInfo.setSimId(simId); // 设置旧SIM卡号值 simInfo.setOldSimCardNumber(simOldNumber); } try { // 修改SIM卡信息 simManageService.updateSimInfo(simInfo); setMessage("sim.update.success"); } catch (BusinessException e) { setMessage("info.db.error"); log.error("Update sim info error:" + e.getMessage()); return ERROR; } catch (Exception e) { setMessage("info.db.error"); log.error("Update sim info error:" + e.getMessage()); return ERROR; } finally { setOperationType(Constants.UPDATE, ModuleId.CLW_M_CS_SIM_MODIFY_MID); addOperationLog("修改SIM卡信息"); } return SUCCESS; }
/** * 删除SIM卡信息 * * @return */ public String delete() { UserInfo currentUser = (UserInfo) ActionContext.getContext().getSession().get(Constants.USER_SESSION_KEY); if (simInfo != null) { // 设置修改用户 simInfo.setModifier(currentUser.getUserID()); // 设置SIM卡主键值 simInfo.setSimId(simId); } try { int countNum = service.getCount("SimManage.getSIMRegisteredCount", simId); if (countNum > 0) { setMessage("sim.delete.notpermission"); log.error("The sim is registered"); return ERROR; } // 删除SIM卡信息 service.update("SimManage.updateSimValid", simInfo); setMessage("sim.delete.success"); } catch (BusinessException e) { setMessage("info.db.error"); log.error("Delete sim error:" + e.getMessage()); return ERROR; } catch (Exception e) { setMessage("info.db.error"); log.error("Delete sim error:" + e.getMessage()); return ERROR; } finally { setOperationType(Constants.DELETE, ModuleId.CLW_M_CS_SIM_DELETE_MID); addOperationLog("删除SIM卡信息"); } return SUCCESS; }