• R/O
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision10 (tree)
Time2015-06-25 15:59:43
Authorckoshien

Log Message

総当たり表の実装完了

Change Summary

Incremental Difference

--- trunk/JCBLScore/src/main/webapp/WEB-INF/struts-config.xml (revision 9)
+++ trunk/JCBLScore/src/main/webapp/WEB-INF/struts-config.xml (revision 10)
@@ -14,6 +14,8 @@
1414 <!-- ================================= Global Exception Definitions -->
1515
1616 <global-exceptions>
17+ <exception path="/WEB-INF/view/systemErr.jsp" key="errors.system"
18+ type="java.lang.Exception"/>
1719 </global-exceptions>
1820
1921 <!-- =================================== Global Forward Definitions -->
@@ -25,8 +27,8 @@
2527
2628 <action-mappings>
2729 </action-mappings>
28-
2930
31+
3032 <!-- ===================================== Controller Configuration -->
3133
3234 <controller
--- trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/action/ResultAction.java (revision 9)
+++ trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/action/ResultAction.java (revision 10)
@@ -8,6 +8,7 @@
88 import org.seasar.struts.annotation.Execute;
99
1010 import cx.myhome.ckoshien.dto.BattingResultDto;
11+import cx.myhome.ckoshien.dto.GameResultDto;
1112 import cx.myhome.ckoshien.dto.PitchingResultDto;
1213 import cx.myhome.ckoshien.entity.League;
1314 import cx.myhome.ckoshien.form.ResultForm;
@@ -14,6 +15,7 @@
1415 import cx.myhome.ckoshien.service.BattingSumService;
1516 import cx.myhome.ckoshien.service.LeagueService;
1617 import cx.myhome.ckoshien.service.PitchingService;
18+import cx.myhome.ckoshien.service.ResultService;
1719
1820 public class ResultAction {
1921
@@ -30,7 +32,14 @@
3032 @Resource
3133 public PitchingService pitchingService;
3234 public List<PitchingResultDto> pitchingResultList;
35+public List<GameResultDto> resultList;
36+@Resource
37+public ResultService resultService;
38+public int length;
39+public List<GameResultDto> opponentList;
40+public List<GameResultDto> resultList2;
3341
42+
3443 @Execute(validator = false)
3544 public String index(){
3645 leagueList=leagueService.findAllOrderById();
@@ -44,7 +53,12 @@
4453 }catch(NumberFormatException e){
4554 return "index&redirect=true";
4655 }
47- battingResultList=battingSumService.findByPeriod(league.beginDate, league.endDate);
56+
57+ resultList=resultService.findGameResult(Integer.parseInt(resultForm.id));
58+ resultList2=resultList;
59+ length=resultList.size();
60+ opponentList=resultService.findOpponentResult(Integer.parseInt(resultForm.id));
61+ battingResultList=battingSumService.findByPeriod(league.beginDate, league.endDate);
4862 pitchingResultList=pitchingService.findByPeriod(league.beginDate, league.endDate);
4963 return "stats.jsp";
5064 }
--- trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/action/GameSummaryAction.java (revision 9)
+++ trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/action/GameSummaryAction.java (revision 10)
@@ -1,9 +1,5 @@
11 package cx.myhome.ckoshien.action;
22
3-import java.text.ParseException;
4-import java.text.SimpleDateFormat;
5-import java.util.ArrayList;
6-import java.util.Calendar;
73 import java.util.List;
84 import java.sql.Date;
95 import javax.annotation.Resource;
@@ -12,8 +8,6 @@
128 import org.seasar.struts.annotation.ActionForm;
139 import org.seasar.struts.annotation.Execute;
1410
15-import sun.org.mozilla.javascript.internal.regexp.SubString;
16-
1711 import cx.myhome.ckoshien.dto.BattingResultDto;
1812 import cx.myhome.ckoshien.entity.BattingSum;
1913 import cx.myhome.ckoshien.entity.Game;
@@ -24,7 +18,6 @@
2418 import cx.myhome.ckoshien.entity.Team;
2519 import cx.myhome.ckoshien.form.BattingSumForm;
2620 import cx.myhome.ckoshien.form.GameSummaryForm;
27-import cx.myhome.ckoshien.form.PlayerForm;
2821 import cx.myhome.ckoshien.logic.GameSummaryLogic;
2922 import cx.myhome.ckoshien.service.BattingSumService;
3023 import cx.myhome.ckoshien.service.GameService;
@@ -108,7 +101,9 @@
108101 game.leagueId=leagueList.get(i).id;
109102 break;
110103 }
104+
111105 }
106+
112107 gameService.insert(game);
113108 battingSumForm = Beans.createAndCopy(BattingSumForm.class, gameSummaryForm).execute();
114109 for(int i=0;i<battingSumForm.atBats.size();i++){
--- trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/service/ResultService.java (revision 9)
+++ trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/service/ResultService.java (revision 10)
@@ -60,4 +60,15 @@
6060 .getResultList();
6161 return resultList;
6262 }
63+
64+ public List<GameResultDto> findOpponentResult(Integer leagueId){
65+ Map<String, Object> param = new HashMap<String, Object>();
66+ param.put("leagueId", leagueId);
67+ resultList=
68+ jdbcManager
69+ .selectBySqlFile(GameResultDto.class, "cx.myhome.ckoshien.sql.Opponent.sql", param)
70+ .getResultList();
71+ return resultList;
72+ }
73+
6374 }
\ No newline at end of file
--- trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/form/GameSummaryForm.java (revision 9)
+++ trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/form/GameSummaryForm.java (revision 10)
@@ -2,6 +2,7 @@
22
33 import java.util.List;
44
5+import org.seasar.struts.annotation.IntRange;
56 import org.seasar.struts.annotation.Required;
67
78 public class GameSummaryForm {
--- trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/dto/GameResultDto.java (revision 9)
+++ trunk/JCBLScore/src/main/java/cx/myhome/ckoshien/dto/GameResultDto.java (revision 10)
@@ -3,6 +3,7 @@
33 public class GameResultDto {
44 public Integer teamId;
55 public String teamName;
6+ public String shortName;
67 public Integer gameCount;
78 public Integer win;
89 public Integer lose;
@@ -10,4 +11,5 @@
1011 public Double percentage;
1112 public Integer points;
1213 public Integer leagueId;
14+ public Integer opponent;
1315 }
--- trunk/JCBLScore/src/main/resources/cx/myhome/ckoshien/sql/Opponent.sql (nonexistent)
+++ trunk/JCBLScore/src/main/resources/cx/myhome/ckoshien/sql/Opponent.sql (revision 10)
@@ -0,0 +1,10 @@
1+SELECT
2+ team_id,
3+ opponent,
4+ sum(win) as win,
5+ sum(lose) as lose,
6+ sum(draw) as draw,
7+ league_id
8+ FROM result
9+ WHERE league_id=/*leagueId*/
10+ group by team_id,opponent;
\ No newline at end of file
--- trunk/JCBLScore/src/main/resources/cx/myhome/ckoshien/sql/GameResult.sql (revision 9)
+++ trunk/JCBLScore/src/main/resources/cx/myhome/ckoshien/sql/GameResult.sql (revision 10)
@@ -1,6 +1,7 @@
11 SELECT
22 r.team_id,
33 team_name,
4+ short_name,
45 sum(win)+sum(lose)+sum(draw) as game_count,
56 sum(win) as win,
67 sum(lose)as lose,