Commit bf59a0c0 by Kazuki Nakamura

#51859【eモニポイント連携】会員情報不足時の専用エラー画面作成、郵送受付申請完了画面作成、その他画面レイアウト修正

parent d12e68fb
...@@ -2,11 +2,13 @@ package jp.agentec.sinaburocast.action.user; ...@@ -2,11 +2,13 @@ package jp.agentec.sinaburocast.action.user;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import javax.mail.MessagingException; import javax.mail.MessagingException;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.apache.struts.Globals;
import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages; import org.apache.struts.action.ActionMessages;
import org.apache.struts.util.TokenProcessor; import org.apache.struts.util.TokenProcessor;
...@@ -69,22 +71,6 @@ public class PointUseAction extends AbstractAction { ...@@ -69,22 +71,6 @@ public class PointUseAction extends AbstractAction {
member = memberService.findById(member.memberId); member = memberService.findById(member.memberId);
super.setAuthenticatedToken(member, UserType.USER); super.setAuthenticatedToken(member, UserType.USER);
// メンバー情報バリデーション
if (StringUtil.isBlank(member.zipCode) || member.prefectureId == null || StringUtil.isBlank(member.cityName) || StringUtil.isBlank(member.areaName) || StringUtil.isBlank(member.telno)
|| StringUtil.isBlank(member.firstName) || StringUtil.isBlank(member.lastName) || StringUtil.isBlank(member.firstNameKana) || StringUtil.isBlank(member.lastNameKana)
|| member.genderCd == null || StringUtil.isBlank(member.birthday)) {
ActionMessages messages = (ActionMessages)request.getAttribute(Globals.ERROR_KEY);
if (messages == null) {
messages = new ActionMessages();
}
messages.add("pointUse", new ActionMessage(SinaburoViewUtil.getMessage("errors.E050")));
request.setAttribute(Globals.ERROR_KEY, messages);
session.setAttribute("pointCheckFlg", true);
return "/user/userEdit/";
}
// ポイント交換利用方法取得 // ポイント交換利用方法取得
pointUseForm.giftExchangeInfoList = giftExchangeInfoService.findGiftExchangeInfoList(); pointUseForm.giftExchangeInfoList = giftExchangeInfoService.findGiftExchangeInfoList();
...@@ -98,6 +84,12 @@ public class PointUseAction extends AbstractAction { ...@@ -98,6 +84,12 @@ public class PointUseAction extends AbstractAction {
@Execute(validator = false) @Execute(validator = false)
public String pointUse(){ public String pointUse(){
// 会員情報の確認
String url = memberInfoValidate();
if(url != null) {
return url;
}
String giftExchangeInfoIdStr = request.getParameter("giftExchangeInfoId"); String giftExchangeInfoIdStr = request.getParameter("giftExchangeInfoId");
Integer giftExchangeInfoId = -1; Integer giftExchangeInfoId = -1;
if(giftExchangeInfoIdStr.isEmpty()) { if(giftExchangeInfoIdStr.isEmpty()) {
...@@ -160,11 +152,6 @@ public class PointUseAction extends AbstractAction { ...@@ -160,11 +152,6 @@ public class PointUseAction extends AbstractAction {
@Execute(validator = false) @Execute(validator = false)
public String memberConfirm() { public String memberConfirm() {
Member member = getMember();
if(member == null){
return "/user/login/";
}
// 入力データバリデーション // 入力データバリデーション
if(pointUseForm.memberNum.isEmpty()) { if(pointUseForm.memberNum.isEmpty()) {
addError(SinaburoViewUtil.getMessage("errors.E067")); addError(SinaburoViewUtil.getMessage("errors.E067"));
...@@ -232,10 +219,14 @@ public class PointUseAction extends AbstractAction { ...@@ -232,10 +219,14 @@ public class PointUseAction extends AbstractAction {
*/ */
@Execute(validator = false) @Execute(validator = false)
public String sendEmailForMemberCardReceipt() { public String sendEmailForMemberCardReceipt() {
Member member = getMember();
if(member == null){ // 会員情報の確認
return "/user/login/"; String url = memberInfoValidate();
if(url != null) {
return url;
} }
Member member = getMember();
member = memberService.findById(member.memberId); member = memberService.findById(member.memberId);
// 郵送受付申請情報をDBに登録する // 郵送受付申請情報をDBに登録する
...@@ -256,7 +247,7 @@ public class PointUseAction extends AbstractAction { ...@@ -256,7 +247,7 @@ public class PointUseAction extends AbstractAction {
return "/user/pointUse/confirmOfAddress.html"; return "/user/pointUse/confirmOfAddress.html";
} }
return index(); return "/user/pointUse/memberCardReceiptEnd.html";
} }
/** /**
...@@ -267,12 +258,14 @@ public class PointUseAction extends AbstractAction { ...@@ -267,12 +258,14 @@ public class PointUseAction extends AbstractAction {
*/ */
@Execute(validator = false, validate = "validate", input="/error/doubleAction.html") @Execute(validator = false, validate = "validate", input="/error/doubleAction.html")
public String regist() throws UnsupportedEncodingException, MessagingException { public String regist() throws UnsupportedEncodingException, MessagingException {
Member member = getMember();
if(member == null){ // 会員情報の確認
return "/user/login/"; String url = memberInfoValidate();
if(url != null) {
return url;
} }
Member member = getMember();
member = memberService.findById(member.memberId); member = memberService.findById(member.memberId);
Gift gift = giftService.findById(Integer.parseInt(pointUseForm.giftId)); Gift gift = giftService.findById(Integer.parseInt(pointUseForm.giftId));
...@@ -313,7 +306,7 @@ public class PointUseAction extends AbstractAction { ...@@ -313,7 +306,7 @@ public class PointUseAction extends AbstractAction {
return "/user/pointUse/pointUse.html"; return "/user/pointUse/pointUse.html";
} }
//ポイント利用画面 //ポイント交換完了画面
return "/user/pointUse/pointUseEnd.html"; return "/user/pointUse/pointUseEnd.html";
} }
...@@ -332,4 +325,63 @@ public class PointUseAction extends AbstractAction { ...@@ -332,4 +325,63 @@ public class PointUseAction extends AbstractAction {
return errors; return errors;
} }
/**
* 会員情報の確認
*/
private String memberInfoValidate() {
Member member = getMember();
if(member == null){
return "/user/login/";
}
// 最新のユーザー情報を取得
member = memberService.findById(member.memberId);
super.setAuthenticatedToken(member, UserType.USER);
// メンバー情報バリデーション、
List<String> errMsg = new ArrayList<String>();
// 姓
if(StringUtil.isBlank(member.firstName)) {
errMsg.add(SinaburoViewUtil.getMessage("labels.firstName"));
}
// 名
if(StringUtil.isBlank(member.lastName)) {
errMsg.add(SinaburoViewUtil.getMessage("labels.lastName"));
}
// セイ
if(StringUtil.isBlank(member.firstNameKana)) {
errMsg.add(SinaburoViewUtil.getMessage("labels.firstKana"));
}
// メイ
if(StringUtil.isBlank(member.lastNameKana)) {
errMsg.add(SinaburoViewUtil.getMessage("labels.lastKana"));
}
// 都道府県
if(member.prefectureId == null) {
errMsg.add(SinaburoViewUtil.getMessage("labels.prefectureId"));
}
// 市区町村
if(StringUtil.isBlank(member.cityName)) {
errMsg.add(SinaburoViewUtil.getMessage("labels.cityName"));
}
// 町名・番地(それ以降の住所)
if(StringUtil.isBlank(member.areaName)) {
errMsg.add(SinaburoViewUtil.getMessage("labels.areaName"));
}
// 電話番号
if(StringUtil.isBlank(member.telno)) {
errMsg.add(SinaburoViewUtil.getMessage("labels.telNo"));
}
// 郵便番号
if(StringUtil.isBlank(member.zipCode)) {
errMsg.add(SinaburoViewUtil.getMessage("labels.zipCode"));
}
// 会員情報に不足がある場合、専用のエラー画面に遷移
if(errMsg.size() > 0) {
request.setAttribute("errMsg", StringUtils.join(errMsg, '、'));
return "/user/pointUse/memberInfoError.html";
}
return null;
}
} }
\ No newline at end of file
...@@ -483,15 +483,4 @@ public class UserEditAction extends AbstractAction { ...@@ -483,15 +483,4 @@ public class UserEditAction extends AbstractAction {
return "/user/userEdit/uEditEnd.html"; return "/user/userEdit/uEditEnd.html";
} }
/**
* 郵送先確認画面からの遷移
* @return
* @throws ParseException
*/
@Execute(validator = false)
public String indexFromConfirmAddress() throws ParseException {
userEditForm.cofirmReturn = true;
return index();
}
} }
...@@ -370,6 +370,13 @@ public interface SinaburoConstant { ...@@ -370,6 +370,13 @@ public interface SinaburoConstant {
} }
/**
* Eモニポイント1PあたりのICHICOポイント数
*/
interface ICHICO_PER_POINT{
int POINT = 2;
}
/** 端末タイプ */ /** 端末タイプ */
interface AccessType { interface AccessType {
......
...@@ -77,8 +77,8 @@ public class UserEditForm { ...@@ -77,8 +77,8 @@ public class UserEditForm {
public String birthdayM; public String birthdayM;
public String birthdayD; public String birthdayD;
// 郵送先確認画面へ遷移するかのフラグ // どの画面へ遷移するかのフラグ(0:マイページ、1:ポイント利用画面、2:郵送先確認画面)
public boolean cofirmReturn; public int cofirmReturn = 0;
@Override @Override
public String toString() { public String toString() {
......
...@@ -118,7 +118,7 @@ public class PointGetService extends AbstractService<PointGet> { ...@@ -118,7 +118,7 @@ public class PointGetService extends AbstractService<PointGet> {
if(SinaburoConstant.giftType.ECOBO.equals(gift.giftType)) { if(SinaburoConstant.giftType.ECOBO.equals(gift.giftType)) {
giftExchange.cnt = gift.requiredPoint / SinaburoConstant.ECHOBO_MAI_POINT.MAI1; giftExchange.cnt = gift.requiredPoint / SinaburoConstant.ECHOBO_MAI_POINT.MAI1;
} else { } else {
giftExchange.cnt = gift.requiredPoint * 2; giftExchange.cnt = gift.requiredPoint * SinaburoConstant.ICHICO_PER_POINT.POINT;
} }
giftExchange.applyDate = SinaburoUtil.getTimestamp(); giftExchange.applyDate = SinaburoUtil.getTimestamp();
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<option value="5" #if($!messageRegistForm.messageCd == "5") selected #end>パスワード確認</option> <option value="5" #if($!messageRegistForm.messageCd == "5") selected #end>パスワード確認</option>
<option value="6" #if($!messageRegistForm.messageCd == "6") selected #end>ポイント利用(エコボ満点カード)</option> <option value="6" #if($!messageRegistForm.messageCd == "6") selected #end>ポイント利用(エコボ満点カード)</option>
<option value="9" #if($!messageRegistForm.messageCd == "9") selected #end>ポイント利用(ICHICOポイント)</option> <option value="9" #if($!messageRegistForm.messageCd == "9") selected #end>ポイント利用(ICHICOポイント)</option>
<option value="10" #if($!messageRegistForm.messageCd == "10") selected #end>郵送受付の完了メール</option> <option value="10" #if($!messageRegistForm.messageCd == "10") selected #end>郵送受付申請の完了メール</option>
<option value="7" #if($!messageRegistForm.messageCd == "7") selected #end>会員登録完了済みメール</option> <option value="7" #if($!messageRegistForm.messageCd == "7") selected #end>会員登録完了済みメール</option>
<option value="8" #if($!messageRegistForm.messageCd == "8") selected #end>会員登録確認メール</option> <option value="8" #if($!messageRegistForm.messageCd == "8") selected #end>会員登録確認メール</option>
</select> </select>
......
...@@ -46,7 +46,7 @@ function back(){ ...@@ -46,7 +46,7 @@ function back(){
<table width="740px" border="0" cellspacing="0" cellpadding="0"> <table width="740px" border="0" cellspacing="0" cellpadding="0">
<tr><td width="730px" >現在は下記の住所で登録されています。</td></tr> <tr><td width="730px" >現在は下記の住所で登録されています。</td></tr>
<tr><td><font color="red"><br>&nbsp;住所:$!member.prefecture.prefecture&nbsp;$!member.cityName&nbsp;$!member.areaName&nbsp;$!member.buildingName</font></td></tr> <tr><td><font color="red"><br>&nbsp;住所:$!member.prefecture.prefecture&nbsp;$!member.cityName&nbsp;$!member.areaName&nbsp;$!member.buildingName</font></td></tr>
<tr><td><br>変更が必要な方は<a href="#q('/user/userEdit/indexFromConfirmAddress/')">こちら</a></td></tr> <tr><td><br>変更が必要な方は<a href="#q('/user/userEdit/')?cofirmReturn=2">こちら</a></td></tr>
</table> </table>
<br><br> <br><br>
......
#set($title = "郵送受付申請完了画面")
<!-- preHeader -->
#parse( "/WEB-INF/view/common/preHeader.vm" )
##<!-- JAVASCRIPTはここに記載 -->
<body bgcolor="#B3C9E1" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>
<!-- header -->
<table width="1024" cellspacing="0" cellpadding="0">
<tr>
<TD>#parse( "/WEB-INF/view/common/header.vm" )</TD>
</tr>
<tr>
<TD>
<table width="1024" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="25" background="/em/images/shadowlft2.jpg"><img src="/em/images/spacer.gif" width="25" height="1" border="0"></td>
<td width="1024" bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td align="right" width="155" valign="top">#parse( "/WEB-INF/view/common/menu.vm" )</td>
<td align="left" width="10" background="/em/images/cts_bar.gif"><img src="/em/images/spacer.gif" border="0"></td>
<td align="center" valign="top">
##CONTENT START 各ページコンテンツ
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="ctsTitle">郵送受付申請完了</td>
</tr>
</table>
<!-- Contents Title Table End -->
<form method="post" action="/em/user/pointUse/" >
<BR><BR>
<BR>
<table width="480" border="0" cellpadding="2" cellspacing="1" bgcolor="#004080">
<tr>
<td class="listcts" width="480">
ICHICOポイント磁気カードの郵送受付申請が完了しました
</td>
</tr>
</TABLE>
##CONTENT END 各ページコンテンツ
<!-- Button Table Start 点線-->
<table width="780" border="0" cellspacing="5" cellpadding="0">
<tr>
<td background="/em/images/cts_btnbar.gif"><img src="/em/images/spacer.gif" width="1" height="10" border="0"></td>
</tr>
</table>
<!-- Button Table End -->
</td>
</tr>
</table>
</td>
<td width="25" background="/em/images/shadowrgt2.jpg"><img src="/em/images/spacer.gif" width="25" height="1" border="0"></td>
</tr>
</table>
</TD>
</tr>
<tr>
<TD>#parse( "/WEB-INF/view/common/footer.vm" )</TD>
</tr>
</table>
</center>
</body>
</html>
\ No newline at end of file
...@@ -72,7 +72,7 @@ function memberRegistPage() { ...@@ -72,7 +72,7 @@ function memberRegistPage() {
</TABLE> </TABLE>
#errmsg() #errmsg()
<br>
## 次へ(確認)ボタン ## 次へ(確認)ボタン
<table width="70%" border="0" cellspacing="2" cellpadding="0"> <table width="70%" border="0" cellspacing="2" cellpadding="0">
<TR><TD align="center">アプリ利用者でもカード利用者でもご利用できます。</TD></TR> <TR><TD align="center">アプリ利用者でもカード利用者でもご利用できます。</TD></TR>
......
#set($title = "エラーページ")
<!-- preHeader -->
#parse( "/WEB-INF/view/common/preHeader.vm" )
##<!-- JAVASCRIPTはここに記載 -->
<body bgcolor="#B3C9E1" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>
<!-- header -->
<table width="1024" cellspacing="0" cellpadding="0">
<tr>
<TD>#parse( "/WEB-INF/view/common/header.vm" )</TD>
</tr>
<tr>
<TD>
<table width="1024" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="25" background="/em/images/shadowlft2.jpg"><img src="/em/images/spacer.gif" width="25" height="1" border="0"></td>
<td width="1024" bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td align="right" width="155" valign="top">#parse( "/WEB-INF/view/common/menu.vm" )</td>
<td align="left" width="10" background="/em/images/cts_bar.gif"><img src="/em/images/spacer.gif" border="0"></td>
<td align="center" valign="top">
##タイトル
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="ctsTitle">エラーページ</td>
</tr>
</table>
<!-- Contents Title Table End -->
<form method="post" action="#q('/user/userEdit/')?cofirmReturn=1">
<br><br>
##見出し
<table width="740" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="5"><img src="/em/images/cts_cmt01.gif" width="5" height="23" border="0"></td>
<td width="730" class="attention">エラーメッセージ</td>
<td width="5" align="right"><img src="/em/images/cts_cmt03.gif" width="5" height="23" border="0"></td>
</tr>
##エラーメッセージ
<tr>
<td background="/em/images/cts_cmt02_bg.gif"><img src="/em/images/spacer.gif" width="5" height="5" border="0"></td>
<td><font color="red">$!errMsg&nbsp;が未入力です。</font></td>
<td background="/em/images/cts_cmt03_bg.gif"><img src="/em/images/spacer.gif" width="5" height="5" border="0"></td>
</tr>
<tr>
<td background="/em/images/cts_cmt02_bg.gif"><img src="/em/images/spacer.gif" width="5" height="5" border="0"></td>
<td><br>会員情報をご入力ください。</td>
<td background="/em/images/cts_cmt03_bg.gif"><img src="/em/images/spacer.gif" width="5" height="5" border="0"></td>
</tr>
<tr>
<td><img src="/em/images/cts_cmt02.gif" width="5" height="5" border="0"></td>
<td background="/em/images/cts_cmt04_bg.gif"><img src="/em/images/spacer.gif" width="1" height="5" border="0"></td>
<td><img src="/em/images/cts_cmt04.gif" width="5" height="5" border="0"></td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr><td align="center"><br><input width="150px" class="nextBtn" type="submit" value="会員情報の編集はこちら"></td></tr>
</table>
<br>
##CONTENT END 各ページコンテンツ
<!-- Button Table Start 点線-->
<table width="780" border="0" cellspacing="5" cellpadding="0">
<tr>
<td background="/em/images/cts_btnbar.gif"><img src="/em/images/spacer.gif" width="1" height="10" border="0"></td>
</tr>
</table>
<!-- Button Table End -->
</td>
</tr>
</table>
</td>
<td width="25" background="/em/images/shadowrgt2.jpg"><img src="/em/images/spacer.gif" width="25" height="1" border="0"></td>
</tr>
</table>
</TD>
</tr>
<tr>
<TD>#parse( "/WEB-INF/view/common/footer.vm" )</TD>
</tr>
</table>
</center>
</body>
</html>
\ No newline at end of file
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<input type="hidden" name="giftList[$velocityCount].giftName" value="$gift.giftName"/> <input type="hidden" name="giftList[$velocityCount].giftName" value="$gift.giftName"/>
#end #end
<table width="480" border="0" cellpadding="2" cellspacing="1" bgcolor="#004080"> <table width="650 border="0" cellpadding="2" cellspacing="1" bgcolor="#004080">
<tr> <tr>
<td class="listmenu" width="120" >入力内容確認</td> <td class="listmenu" width="120" >入力内容確認</td>
</tr> </tr>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</table> </table>
<!-- Contents Title Table End --> <!-- Contents Title Table End -->
<form method="post" action="/em/user/pointUse/confirm/" > <form method="post" action="/em/user/pointUse/" >
<BR><BR> <BR><BR>
<BR> <BR>
......
...@@ -50,7 +50,9 @@ ...@@ -50,7 +50,9 @@
</tr> </tr>
</table> </table>
<BR> <BR>
#if($!userEditForm.cofirmReturn) #if($!userEditForm.cofirmReturn == 1)
<a href="#q('/user/pointUse/')" >ポイント利用画面へ戻る</a>
#elseif($!userEditForm.cofirmReturn == 2)
<a href="#q('/user/pointUse/confirmOfAddress/')" >郵送先の確認画面へ戻る</a> <a href="#q('/user/pointUse/confirmOfAddress/')" >郵送先の確認画面へ戻る</a>
#else #else
<a href="#q('/user/myPage/')" >マイページへ戻る</a> <a href="#q('/user/myPage/')" >マイページへ戻る</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment