xml
1 /ggzyjy_tongliao_v3/src/dsfzf/struts2/zfcg_dsfzf.xml 2 3 <?xml version="1.0" encoding="UTF-8" ?> 4 <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> 5 <struts> 6 <package name="zfcg_dsfzf" extends="dsfzf" namespace="/"> 7 <default-interceptor-ref name="defaultHyzxStack"/> 8 <!-- 政府采购第三方支付管理 start --> 9 <!-- <action name="dsfzfMaintenanceIndex" class="dsfzfManagerAction" 10 method="dsfzfMaintenanceIndex"> 11 <result name="success">/dsfzf/zfcg/dsfzfMaintenanceIndex.jsp</result> 12 <interceptor-ref name="defaultStack"></interceptor-ref> 13 </action> --> 14 <action name="recvPayResult" class="dsfzfManagerAction" 15 method="recvPayResult"> 16 <!-- <result name="success">/dsfzf/tlt/recvPayResult.jsp</result> --> 17 <interceptor-ref name="defaultStack"></interceptor-ref> 18 </action> 19 <action name="displayPayResult" class="dsfzfManagerAction" 20 method="displayPayResult"> 21 <result name="success">/dsfzf/tlt/displayPayResult.jsp</result> 22 <interceptor-ref name="defaultStack"></interceptor-ref> 23 </action> 24 25 <!-- 招标文件下载时进入第三方支付页面 --> 26 <action name="zbFilePayFees" class="dsfzfManagerAction" method="zbFilePayFees"> 27 <result name="success">/dsfzf/zfcg/zbFilePayFees.jsp</result> 28 <!-- <interceptor-ref name="defaultStack"></interceptor-ref> --> 29 </action> 30 31 <action name="viewPackageDetail" class="dsfzfManagerAction" method="viewPackageDetail"> 32 <result name="success">/dsfzf/zfcg/packageDetail.jsp</result> 33 <interceptor-ref name="defaultStack"></interceptor-ref> 34 </action> 35 36 <!-- 进入支付银行选择页面 --> 37 <action name="netPay" class="dsfzfManagerAction" method="netPay"> 38 <result name="success">/dsfzf/zfcg/zfcgNetPay.jsp</result> 39 <!-- <interceptor-ref name="defaultStack"></interceptor-ref> --> 40 </action> 41 42 <!-- 进入扫码支付页面 --> 43 <action name="netQrPay" class="dsfzfManagerAction" method="netPay"> 44 <result name="success">/dsfzf/zfcg/zfcgNetQrPay.jsp</result> 45 </action> 46 47 <!-- 根据pack_Id/member_Id查询是否选择过哪种支付方式 --> 48 <action name="viewNetQrPayInfo" class="dsfzfManagerAction" method="viewNetQrPayInfo"> 49 <interceptor-ref name="defaultStack"></interceptor-ref> 50 </action> 51 52 <!-- 判断用户是否已付款 --> 53 <action name="hasPayed" class="dsfzfManagerAction" method="hasPayed"> 54 <interceptor-ref name="defaultStack"></interceptor-ref> 55 </action> 56 57 <!-- 确认网上支付 --> 58 <action name="confirmNetPay" class="dsfzfManagerAction" method="confirmNetPay"> 59 <result name="success">/dsfzf/zfcg/confirmNetPay.jsp</result> 60 <interceptor-ref name="defaultStack"></interceptor-ref> 61 </action> 62 63 <!-- 查看招标文件下载历史 --> 64 <action name="viewZbfileDown" class="dsfzfManagerAction" method="viewZbfileDown"> 65 <result name="success">/dsfzf/zfcg/viewZbfileDown.jsp</result> 66 <!-- <interceptor-ref name="defaultStack"></interceptor-ref> --> 67 </action> 68 69 <!-- 查看支付情况详细 --> 70 <action name="viewPayInfo" class="dsfzfManagerAction" method="viewPayInfo"> 71 <result name="success">/dsfzf/zfcg/viewPayInfo.jsp</result> 72 <!-- <interceptor-ref name="defaultStack"></interceptor-ref> --> 73 </action> 74 75 <!-- 查看支付列表 --> 76 <action name="viewPayInfoList" class="dsfzfManagerAction" method="viewPayInfoList"> 77 <result name="success">/dsfzf/zfcg/viewPayInfoList.jsp</result> 78 <!-- <interceptor-ref name="defaultStack"></interceptor-ref> --> 79 </action> 80 81 <!-- 下载招标文件 --> 82 <action name="downloadZbFile" class="dsfzfManagerAction" method="downloadZbFile"> 83 <result name="TENDERFILE">/dsfzf/zfcg/downloadZbFile.jsp</result> 84 <result name="PREQUALIFICATION">/dsfzf/zfcg/downloadZgysFile.jsp</result> 85 <!-- <interceptor-ref name="defaultStack"></interceptor-ref> --> 86 </action> 87 88 <action name="downloadZfcgZbFile" class="dsfzfManagerAction" method="downloadZfcgZbFile"> 89 <interceptor-ref name="defaultStack"></interceptor-ref> 90 </action> 91 92 <action name="createOrder" class="dsfzfManagerAction" 93 method="createOrder"> 94 <result name="success">/dsfzf/tlt/post.jsp</result> 95 <result name="hasPaid">/dsfzf/tlt/successPaid.jsp</result> 96 <!-- <interceptor-ref name="defaultStack"></interceptor-ref> --> 97 </action> 98 99 <action name="createQrOrder" class="dsfzfManagerAction" 100 method="createQrOrder"> 101 <result name="success">/dsfzf/tlt/qr_post.jsp</result> 102 <result name="hasPaid">/dsfzf/tlt/successPaid.jsp</result> 103 </action> 104 105 <!-- 标书费缴纳查询 --> 106 <action name="queryTBFileFeePayList" class="dsfzfManagerAction" method="queryTBFileFeePayList"> 107 <result name="success">/dsfzf/zfcg/tBFileFeePayList.jsp</result> 108 </action> 109 <!-- 查看支付情况详细 --> 110 <action name="viewPayDetailInfo" class="dsfzfManagerAction" method="viewPayDetailInfo"> 111 <result name="success">/dsfzf/zfcg/viewPayDetailInfo.jsp</result> 112 <!-- <interceptor-ref name="defaultStack"></interceptor-ref> --> 113 </action> 114 <!-- 政府采购第三方支付管理 end --> 115 </package> 116 </struts>
jsp
1 /ggzyjy_tongliao_v3/WebRoot/dsfzf/zfcg/zfcgNetQrPay.jsp 2 3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4 <html xmlns="http://www.w3.org/1999/xhtml"> 5 <%@ taglib uri="/struts-tags" prefix="s"%> 6 <%@ page language="java" pageEncoding="GBK"%> 7 <head> 8 <%@ include file="../../include/heard.inc"%> 9 <script type="text/javascript">alert(1) 10 function goBack() { 11 history.go(-1); 12 } 13 14 // 下一步 15 function nextStep(payType) { 16 jQuery('#payType').val(payType); 17 //jQuery('#form1').submit(); 18 var memberId = '<s:property value="getLoginUserId()"/>'; 19 var payTypeStr = jQuery('#payType').val(); 20 var packId = jQuery('#packId').val(); 21 var tenderFileId = jQuery('#tenderFileId').val(); 22 var productId = jQuery('#productId').val(); 23 var productFee = jQuery('#productFee').val(); 24 $.ajax({ 25 type: "POST", 26 url: "viewNetQrPayInfo.action?random="+Math.random(), 27 data: "packId=" + packId + "&memberId=" + memberId+ "&payType=" + payType, 28 success: function(msg){ 29 if(msg == "5") { //可以支付 30 $.ajax({ 31 type: "POST", 32 url: "hasPayed.action?random="+Math.random(), 33 data: "packId=" + packId + "&memberId=" + memberId+"&productId="+productId, 34 success: function(msg){ 35 if ("1" == msg) { 36 Dialog.alert("您可直接下载招标文件!",windowload); 37 } else if ("2" == msg) { 38 Dialog.alert("您已支付过标书费,可直接下载招标文件!",windowload); 39 } else { 40 var url = "createQrOrder.action?payType="+payTypeStr+"&packId="+packId+"&tenderFileId="+tenderFileId+"&productId="+ productId+"&productFee="+productFee; 41 var diag = new Dialog(); 42 diag.Width = 800; 43 diag.Height = 600; 44 diag.Title = '扫码支付'; 45 diag.URL = './'+url; 46 diag.CancelEvent=function(){ 47 48 $.ajax({ 49 type: "POST", 50 url: "hasPayed.action?random="+Math.random(), 51 data: "packId=" + packId + "&memberId=" + memberId+"&productId="+productId, 52 success: function(msg){ 53 if ("1" == msg) { 54 Dialog.alert("您可直接下载招标文件!",windowload); 55 } else if ("2" == msg) { 56 Dialog.alert("您已支付过标书费,可直接下载招标文件!",windowload); 57 } else { 58 Dialog.alert("支付异常!"); 59 } 60 } 61 }); 62 }; 63 diag.show(); 64 } 65 } 66 }); 67 } else if(msg == "4"){ 68 if(payType == "W01") { 69 Dialog.alert("订单已绑定至支付宝支付,不可选择微信支付方式!"); 70 }else if( "A01" == payType ){ 71 Dialog.alert("订单已绑定至微信支付,不可选择支付宝支付方式!"); 72 } 73 }else{ 74 Dialog.alert( "操作失败!"); 75 } 76 } 77 }); 78 } 79 80 function windowload(){ 81 window.location.reload(); 82 } 83 84 85 </script> 86 <style type="text/css"> 87 .bankDiv{vertical-align: middle;} 88 .bankDiv ul li{height: 50px;float: left;margin-right: 20px;width: 20%;} 89 .bankDiv ul li label {display: block;width: 100%;height: 100%;} 90 .bankDiv img{width: 80%;margin-top: 5px;} 91 92 .bank_position {margin-top: 16px;float: left;} 93 .formTab img{ vertical-align:middle; padding:0; margin:0; float:none;} 94 </style> 95 </head> 96 97 <body id="mouseRight"> 98 <div class="mainDiv"> 99 <dl class="mtab"> 100 <dt> 101 <p class="position">当前位置:<a>政府采购</a><a>项目管理</a><a>领取招标文件</a><a>网上支付</a></p> 102 <a href="javascript:goBack()" class="back">返回</a> 103 </dt> 104 <dd> 105 <table width="100%" border="0" cellpadding="0" cellspacing="0" class="formTab"> 106 <tr> 107 <td class="txtR" colspan="4"> 108 <center style="font-size:15px;">项目信息</center> 109 </td> 110 </tr> 111 <tr> 112 <td width="15%" class="txtR">项目编号:</td> 113 <td width="35%"><s:property value="cgInfProject.proCode"/></td> 114 <td width="15%" class="txtR">项目名称:</td> 115 <td width="35%"><s:property value="cgInfProject.proName"/></td> 116 </tr> 117 <tr> 118 <td width="15%" class="txtR">分包编号:</td> 119 <td width="35%"><s:property value="cgInfSubpakage.packCode"/></td> 120 <td width="15%" class="txtR">分包名称:</td> 121 <td width="35%"><s:property value="cgInfSubpakage.packName"/></td> 122 </tr> 123 <tr> 124 <td width="15%" class="txtR">支付费用:</td> 125 <td width="35%"> 126 <%-- <span style="color:red"><s:property value="cgTenderFile.fileSellingPrice"/></span> --%> 127 <s:property value="@dsfzf.util.tlt.TltUtil@getPayAmount(cgTenderFile.fileSellingPrice)" escape="false"/> 128 </td> 129 <td width="15%" class="txtR">费用类别:</td> 130 <td width="35%"><span style="color:red"> 131 <s:property value="@dsfzf.util.tlt.TltDict@PRODUCTMAP[productId]" /> 132 </span></td> 133 </tr> 134 <tr> 135 <td width="15%" class="txtR">支付单位:</td> 136 <td colspan="3"><s:property value="payUnit"/></td> 137 </tr> 138 <s:if test="@util.BaseParameter@NO eq payFlag"> 139 <tr> 140 <td class="txtR" colspan="4"> 141 <center style="font-size:15px;color:green;">你已选择<s:property value='@dsfzf.util.tlt.TltDict@payTypeMap[payType]'/>,请点击选择“支付宝支付”或“微信支付”具体扫码支付方式</center> 142 </td> 143 </tr> 144 <tr> 145 <td colspan="4"> 146 <form id="form1" action="createQrOrder.action" method="post"> 147 <input type="hidden" name="packId" id="packId" value= "<s:property value='cgInfSubpakage.packId'/>" /> 148 <input type="hidden" name="tenderFileId" id="tenderFileId" value= "<s:property value='cgTenderFile.tenderFileId'/>" /> 149 <input type="hidden" name="payType" id="payType" value= "<s:property value='payType'/>" /> 150 <input type="hidden" name="productId" id="productId" value= "<s:property value='productId'/>" /> 151 <input type="hidden" name="productFee" id="productFee" value= "<s:property value='cgTenderFile.fileSellingPrice'/>" /> 152 </form> 153 <div align="center" > 154 <img onclick="nextStep('<s:property value="@dsfzf.util.tlt.TltDict@payType_zfb"/>');" src="dsfzf/images/zfbback.png" title="支付宝支付" alt="支付宝支付" style="width: 60px;height: 60px;cursor: pointer;" /> 155 156 <img onclick="nextStep('<s:property value="@dsfzf.util.tlt.TltDict@payType_wx"/>');" src="dsfzf/images/wxback.png" title="微信支付" alt="微信支付" style="width: 60px;height: 60px;cursor: pointer;" /> 157 </div> 158 159 </td> 160 </tr> 161 </s:if> 162 <s:else> 163 <tr> 164 <td class="txtR" colspan="4"> 165 <center style="font-size:15px;color:green;"> 166 您已支付过 <s:property value="@dsfzf.util.tlt.TltDict@PRODUCTMAP[productId]" />,可直接下载文件! 167 </center> 168 </td> 169 </tr> 170 </s:else> 171 </table> 172 173 </dd> 174 </dl> 175 </div> 176 </body> 177 </html>
action
1 /** 2 * 根据pack_Id/member_Id查询是否选择过哪种支付方式 3 * @author lihy 4 * @date 2017-5-11 5 * @return 6 */ 7 public void viewNetQrPayInfo() { 8 try { 9 DsfzfOrderInfo dsfzfOrderInfo = new DsfzfOrderInfo(); 10 dsfzfOrderInfo.setPackId(packId); 11 dsfzfOrderInfo.setMemberId(memberId); 12 dsfzfOrderInfo = dsfzfOrderInfoService.getDsfzfOrderInfo(dsfzfOrderInfo); 13 if(dsfzfOrderInfo != null) { 14 //判断 是否已点击过 支付宝或微信 15 if(!payType.equals(dsfzfOrderInfo.getPayType())){ 16 returnAjaxInfo("4");//不可以支付,弹窗提示选择正确支付方式 17 }else{//可以支付 18 returnAjaxInfo("5"); 19 } 20 }else{//可以支付 21 returnAjaxInfo("5"); 22 } 23 } catch (Exception e) { 24 e.printStackTrace(); 25 } 26 }