コード例 #1
0
 /**
  * <passcount> <lost0>1</lost0> <lost1>3</lost1> <lost2>2</lost2> <lost3>0</lost3> <mode>0</mode>
  * <multiple>1</multiple> <periodId>66</periodId> <schemeCost>12</schemeCost>
  * <schemeId>82</schemeId> <sponsorId>2</sponsorId> <sponsorName>111</sponsorName>
  * <state>2</state> <prize>2</prize> <units>6</units> <passcount>6</passcount>
  * <version>0</version> </passcount>
  */
 @Override
 public void visit(Element node) {
   if (null == zcSchemeWonInfo) {
     zcSchemeWonInfo = new ZcSchemeWonInfo();
     zcSchemeWonInfo.setLottery(this.getLottery());
     zcSchemeWonInfo.setPlayType(this.getPlayType());
   }
   if (StringUtils.isNotBlank(node.getText())) {
     if ("lost0".equals(node.getName())) {
       zcSchemeWonInfo.setLost0(Integer.valueOf(node.getText()));
     }
     if ("lost1".equals(node.getName())) {
       zcSchemeWonInfo.setLost1(Integer.valueOf(node.getText()));
     }
     if ("lost2".equals(node.getName())) {
       zcSchemeWonInfo.setLost2(Integer.valueOf(node.getText()));
     }
     if ("lost3".equals(node.getName())) {
       zcSchemeWonInfo.setLost3(Integer.valueOf(node.getText()));
     }
     if ("multiple".equals(node.getName())) {
       zcSchemeWonInfo.setMultiple(Integer.valueOf(node.getText()));
     }
     if ("periodId".equals(node.getName())) {
       zcSchemeWonInfo.setPeriodId(Long.valueOf(node.getText()));
     }
     if ("schemeCost".equals(node.getName())) {
       zcSchemeWonInfo.setSchemeCost(Integer.valueOf(node.getText()));
     }
     if ("schemeId".equals(node.getName())) {
       zcSchemeWonInfo.setSchemeId(Long.valueOf(node.getText()));
     }
     if ("sponsorId".equals(node.getName())) {
       zcSchemeWonInfo.setSponsorId(Long.valueOf(node.getText()));
     }
     if ("sponsorName".equals(node.getName())) {
       zcSchemeWonInfo.setSponsorName(node.getText().trim());
     }
     if ("units".equals(node.getName())) {
       zcSchemeWonInfo.setUnits(Integer.valueOf(node.getText()));
     }
     if ("mode".equals(node.getName())) {
       zcSchemeWonInfo.setMode(SalesMode.valueOfOrdinal(Integer.valueOf(node.getText())));
     }
     if ("state".equals(node.getName())) {
       zcSchemeWonInfo.setState(SchemeState.valueOfOrdinal(Integer.valueOf(node.getText())));
     }
     if ("prize".equals(node.getName())) {
       zcSchemeWonInfo.setPrize(BigDecimalUtil.valueOf(Double.valueOf(node.getText())));
     }
     if ("pc".equals(node.getName())) {
       zcSchemeWonInfo.setPasscount(Integer.valueOf(node.getText()));
     }
   }
 }
コード例 #2
0
  public List<PrizeItem> getPrizeItemList(Welfare3dWinUnit winUnit) {
    List<PrizeItem> list = new ArrayList<PrizeItem>();

    Integer unit = winUnit.getWinUnits();
    Integer prize = this.getUnitPrize();
    if (unit != null && unit > 0) {
      list.add(new PrizeItem(new WinItem("直选", unit), BigDecimalUtil.valueOf(prize)));
    }
    unit = winUnit.getG3WinUnits();
    prize = this.getG3UnitPrize();
    if (unit != null && unit > 0) {
      list.add(new PrizeItem(new WinItem("组三", unit), BigDecimalUtil.valueOf(prize)));
    }

    unit = winUnit.getG6WinUnits();
    prize = this.getG6UnitPrize();
    if (unit != null && unit > 0) {
      list.add(new PrizeItem(new WinItem("组六", unit), BigDecimalUtil.valueOf(prize)));
    }

    return list;
  }