/** * 设置全部结束 * * @return * @throws WebDataException */ public String setIssueClose() { Map<String, Object> map = new HashMap<String, Object>(); try { AdminUser adminUser = getAdminUser(); if (null == adminUser) { throw new WebDataException("你还没有登录!"); } if (this.id == null) { throw new DataException("期号ID不能为空."); } kenoService.updateIssueState(this.getId(), IssueState.ISSUE_SATE_FINISH); I issueData = kenoService.findIssueDataById(this.getId()); // 同传统彩的期实体传数据 Period period = new Period(); period.setId(issueData.getId()); period.setPeriodNumber(issueData.getPeriodNumber()); // 记录操作日志 eventLogManager.saveSimpleEventLog( period, getLottery(), adminUser, EventLogType.CloseIssue, "期号为ID:" + this.getId()); map.put("success", true); map.put("msg", "期号设置结束成功"); } catch (DataException e) { e.printStackTrace(); map.put("success", false); map.put("msg", e.getMessage()); } catch (Exception e) { e.printStackTrace(); map.put("success", false); map.put("msg", "期号设置结束发生异常!"); } Struts2Utils.renderJson(map); return null; }
/** * 更新开奖号码 * * @return * @throws WebDataException */ public String updateResults() throws WebDataException { AdminUser adminUser = getAdminUser(); if (null == adminUser) { throw new WebDataException("你还没有登录!"); } if (issueData != null && issueData.getId() != null) { if (!StringUtils.isBlank(issueData.getResults())) { String results = issueData.getResults().trim(); boolean result = false; if (Lottery.KLSF.equals(getLottery())) { result = results.matches( "\\d{1,2},\\d{1,2},\\d{1,2},\\d{1,2},\\d{1,2},\\d{1,2},\\d{1,2},\\d{1,2}"); } else if (Lottery.EL11TO5.equals(getLottery()) || Lottery.SDEL11TO5.equals(getLottery()) || Lottery.XJEL11TO5.equals(getLottery())) { result = results.matches("\\d{1,2},\\d{1,2},\\d{1,2},\\d{1,2},\\d{1,2}"); } else if (Lottery.SSC.equals(getLottery())) { result = results.matches("\\d{1,2},\\d{1,2},\\d{1,2},\\d{1,2},\\d{1,2}"); } else if (Lottery.QYH.equals(getLottery())) { result = results.matches("\\d{1,2},\\d{1,2},\\d{1,2},\\d{1,2},\\d{1,2}"); } if (!result) { addActionError("开奖号码格式不正确!"); return error(); } kenoService.updateResults(issueData); addActionMessage("操作成功."); I issueDataTemp = kenoService.findIssueDataById(issueData.getId()); // 同传统彩的期实体传数据 Period period = new Period(); period.setId(issueDataTemp.getId()); period.setPeriodNumber(issueDataTemp.getPeriodNumber()); // 记录操作日志 eventLogManager.saveSimpleEventLog( period, getLottery(), adminUser, EventLogType.SetResult, "期ID为" + issueData.getId() + "开奖号码为" + results + "期实体为" + issueData.toString()); } } return "save"; }