/** * 获取文件内容列表 * * @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 addSim() { UserInfo currentUser = (UserInfo) ActionContext.getContext().getSession().get(Constants.USER_SESSION_KEY); if (simInfo != null) { // 设置创建用户 simInfo.setCreater(currentUser.getUserID()); // 设置主键值 simInfo.setSimId(UUIDGenerator.getUUID()); } try { // 创建SIM卡信息 service.insert("SimManage.mergeSimInfos", simInfo); setMessage("sim.create.success"); } catch (BusinessException e) { setMessage("info.db.error"); log.error(e.getMessage()); return ERROR; } catch (Exception e) { setMessage("info.db.error"); log.error(e.getMessage()); return ERROR; } finally { setOperationType(Constants.INSERT, ModuleId.CLW_M_CS_SIM_ADD_MID); addOperationLog("新建SIM卡信息"); } return SUCCESS; }