在线支付

  得到请求参数(金额、商户号、签名、returnURLadviceUrl)

commonPayConfig = payMentService.getPaymentHuichao();  

//参数得到

configVo = payMentService.getHuichaoparameter(getSession(),charge, commonPayConfig);

             

(configVo 即请求信息)

二、发送请求

<%@ page contentType="text/html;charset=UTF-8"%>

<html>

    <head>

       <title>汇潮支付</title>

       <meta http-equiv="Content-Type"content="text/html; charset=utf-8">

    </head>

    <body onLoad="document.E_FORM.submit();">

       <form action="https://pay.ecpss.cn/sslpayment"method="post"

           name="E_FORM">

//https…. 为回潮支付接口url

           <input type="hidden"name="MerNo" value="${configVo.merchantCode}">

           <input type="hidden"name="BillNo" value="${configVo.billNo}">

           <input type="hidden"name="Amount" value="${configVo.amount}">

           <input type="hidden"name="ReturnURL" value="${configVo.returnUrl}">

           <input type="hidden"name="AdviceURL" value="${configVo.adviceUrl}">

           <input type="hidden"name="MD5info" value="${configVo.md5info}">

           <input type="hidden"name="Remark" value="${configVo.remark}">

           <input type="hidden"name="shippingFirstName" value="">

           <input type="hidden"name="shippingLastName" value="">

           <input type="hidden"name="shippingEmail" value="">

           <input type="hidden"name="shippingPhone" value="">

           <input type="hidden"name="shippingZipcode" value="">

           <input type="hidden"name="shippingAddress" value="">

           <input type="hidden"name="shippingCity" value="">

           <input type="hidden"name="shippingSstate" value="">

           <input type="hidden"name="shippingCountry" value="">

           <input type="hidden"name="products" value="${configVo.products}">

       </form>

    </body>

</html>

 

 

 

三、在返回页面(同步returnUrl、异步adviceUrl)进行数据处理(充值。。。等)

(1)returnUrl

package com.ebt.web.fn.network;

 

import java.math.BigDecimal;

 

import javax.jms.Session;

import javax.servlet.http.HttpServlet;

importjavax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpSession;

 

importorg.apache.struts2.ServletActionContext;

 

import com.ebt.domain.fn.Charge;

import com.ebt.domain.fn.VDealerAccount;

import com.ebt.framework.BaseAction;

importcom.ebt.framework.ResubmissionSupport;

importcom.ebt.framework.TransactionSupport;

import com.ebt.pub.AppContext;

import com.ebt.pub.Tools;

import com.ebt.service.fn.AccountService;

import com.ebt.service.fn.ChargeService;

importcom.ebt.service.fn.ChargeServiceFactory;

importcom.ebt.service.fn.EBT2DealerCollectionService;

import com.ebt.vo.fn.CollectionConditionVO;

import com.ebt.vo.fn.EcpssRespEntityVo;

import com.ebt.vo.sys.user.SysUserVO;

/**

 * 第三方接口返回接收

 *

 *@author 梁鹏

 *

 */

public class PayReturnAction extendsBaseAction implements TransactionSupport,ResubmissionSupport{

 

         privateChargeService chargeService = ChargeServiceFactory.getChargeService();

         privateCollectionConditionVO conditionVo;

         privateEBT2DealerCollectionService ebt2DealerCollectionService;

        

         privateBigDecimal afterAmount;

         privateAccountService accountService;

        

         Chargecharge;

        

         publicboolean required() {

                   if(sActionType == null || "".equals(sActionType)) {

                            returnfalse;

                   }else {

                            returntrue;

                   }

         }

        

         protectedString perform() throws Exception {

                  

                   HttpServletRequestrequest = ServletActionContext.getRequest();

                  

                   EcpssRespEntityVores = new EcpssRespEntityVo();

                   res.setBillNo(request.getParameter("BillNo"));

                   res.setAmount(request.getParameter("Amount"));

                   res.setResult(request.getParameter("Result"));

                   res.setMd5info(request.getParameter("MD5info"));

                   res.setSignMD5info(request.getParameter("SignMD5info"));

                   res.setSucceed(request.getParameter("Succeed"));

                  

                   charge= chargeService.getChargeBean("chargeBillNo", res.getBillNo());

                  

                    if (Tools.eq(res.getSucceed(),"88")){

                           

                             //修改状态 以及添加流水账  并且 更改虚拟账户余额

                             if(charge != null){

                                      

                                             SysUserVOuser = AppContext.getCurrentUser();

                                            

                                             conditionVo= new CollectionConditionVO();

                                             conditionVo.setPartyId(charge.getBelongId());

                                               conditionVo.setRoleType(Long.parseLong(user.getRoleType()));

                                               conditionVo.setReceiveAmount(newBigDecimal(res.getAmount()));

                                            

                                             chargeService.synChargeMethod(charge,res,conditionVo,ebt2DealerCollectionService,user);

                                            

                                             //页面参数

                                             VDealerAccountaccount = accountService.loadDealerAccount(user.getPartyId());

                                               afterAmount= account.getAmount();

 

                                     }

                             return SUCCESS;

                   }

                   returnERROR;

                  

         }

 

         publicEBT2DealerCollectionService getEbt2DealerCollectionService() {

                   returnebt2DealerCollectionService;

         }

 

         publicvoid setEbt2DealerCollectionService(

                            EBT2DealerCollectionServiceebt2DealerCollectionService) {

                   this.ebt2DealerCollectionService= ebt2DealerCollectionService;

         }

 

         publicCollectionConditionVO getConditionVo() {

                   returnconditionVo;

         }

 

         publicvoid setConditionVo(CollectionConditionVO conditionVo) {

                   this.conditionVo= conditionVo;

         }

 

         publicBigDecimal getAfterAmount() {

                   returnafterAmount;

         }

 

         publicvoid setAfterAmount(BigDecimal afterAmount) {

                   this.afterAmount= afterAmount;

         }

 

         publicAccountService getAccountService() {

                   returnaccountService;

         }

 

         publicvoid setAccountService(AccountService accountService) {

                   this.accountService= accountService;

         }

 

         publicCharge getCharge() {

                   returncharge;

         }

 

         publicvoid setCharge(Charge charge) {

                   this.charge= charge;

         }

        

        

}

(2)adviceUrl

package com.ebt.web.fn.network;

 

import java.lang.reflect.Field;

import java.math.BigDecimal;

import java.util.Date;

 

importjavax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

 

importorg.apache.commons.beanutils.BeanUtils;

import org.apache.log4j.LogManager;

import org.apache.log4j.Logger;

importorg.apache.struts2.ServletActionContext;

importorg.springframework.beans.BeansException;

import org.springframework.context.ApplicationContext;

importorg.springframework.transaction.PlatformTransactionManager;

importorg.springframework.transaction.TransactionDefinition;

importorg.springframework.transaction.TransactionStatus;

import org.springframework.transaction.TransactionUsageException;

importorg.springframework.transaction.support.DefaultTransactionDefinition;

importorg.springframework.web.struts.ActionSupport;

 

import com.ebt.dao.sys.TSysUserDAO;

import com.ebt.dao.sys.TSysUserDAOFactory;

import com.ebt.domain.fn.Charge;

import com.ebt.domain.sys.TSysUser;

importcom.ebt.framework.ApplicationContextUtils;

import com.ebt.pub.Tools;

import com.ebt.service.fn.ChargeService;

importcom.ebt.service.fn.ChargeServiceFactory;

import com.ebt.service.fn.EBT2DealerCollectionService;

import com.ebt.service.fn.TransService;

importcom.ebt.service.fn.impl.EBT2DealerCollectionServiceImpl;

import com.ebt.vo.fn.CollectionConditionVO;

import com.ebt.vo.fn.EcpssRespEntityVo;

 

public class PayAdviceAction extendsActionSupport{

        

         privateChargeService chargeService = ChargeServiceFactory.getChargeService();

         privateCollectionConditionVO conditionVo;

         EBT2DealerCollectionServiceebt2DealerCollectionService = new EBT2DealerCollectionServiceImpl();

         TSysUserDAOdao = TSysUserDAOFactory.getTSysUserDAO();

        

         publicLogger log = LogManager.getLogger(PayAdviceAction.class);

        

         privatePlatformTransactionManager txService;

         privateApplicationContext applicationContext = ApplicationContextUtils.getInstance().getApplicationContext();

         privateTransactionStatus transactionStatus;

 

         publicString perform() throws Exception {

                  

                   //注入对象

                   inject();

                   //清空事务信息,为下一次事务做好准备?

                   TransServicetransService = (TransService) applicationContext

                                     .getBean("transService");

                   transService.clear();

                  

                   HttpServletRequestrequest = ServletActionContext.getRequest();

                   HttpServletResponseresponse = ServletActionContext.getResponse();

                  

                   EcpssRespEntityVores = new EcpssRespEntityVo();

                   res.setBillNo(request.getParameter("BillNo"));

                   res.setAmount(request.getParameter("Amount"));

                   res.setResult(request.getParameter("Result"));

                   res.setMd5info(request.getParameter("MD5info"));

                   res.setSignMD5info(request.getParameter("SignMD5info"));

                   res.setSucceed(request.getParameter("Succeed"));

                  

                   Chargecharge = chargeService.getChargeBean("chargeBillNo",res.getBillNo());

                  

                   log.debug("start-------------------------------PayAdviceAction--------");

                  

                    if (Tools.eq(res.getSucceed(),"88")){

                             

                             log.debug("one-------------------------------PayAdviceAction--------");

                           

                             //修改状态 以及添加流水账  并且 更改虚拟账户余额

                             if(charge != null){

                                      log.debug("two-------------------------------PayAdviceAction--------");

                                            

                                               try{

                                                        beginTrans();

                                                       

                                                        TSysUser user = (TSysUser)dao.loadByProperty(TSysUser.class, "partyId",charge.getBelongId()).get(0);

                                                       

                                                       conditionVo= new CollectionConditionVO();

                                                       conditionVo.setPartyId(charge.getBelongId());

                                                        conditionVo.setRoleType(Long.parseLong(user.getRoleType()));

                                                        conditionVo.setReceiveAmount(newBigDecimal(res.getAmount()));

                                                       

                                                        chargeService.synChargeMethod(charge,res,conditionVo,ebt2DealerCollectionService,user);

                                                       

                                                        commitTrans();

                                               }catch (Exception e) {

                                                        rollbackTrans();

                                               }

                                     }

                             

                             response.getWriter().print("ok");

                   }else{

                            response.getWriter().print("error!");

                   }

                    

                   returnnull;

         }

        

        

         /**

          * 开始事务操作

          */

         protectedvoid beginTrans() {

                   txService= (PlatformTransactionManager) applicationContext.getBean("transactionManager");

                   DefaultTransactionDefinitiondef = new DefaultTransactionDefinition();

                   def.setName("mytrans");

                   def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);

                   transactionStatus= txService.getTransaction(def);

         }

 

         /**

          * 提交事务操作

          */

         protectedvoid commitTrans() {

                   if(txService == null || transactionStatus == null) {

                            thrownew TransactionUsageException("没有开启事务,提交事务失败");

                   }

                   txService.commit(transactionStatus);

         }

 

         /**

          * 回滚事务操作

          */

         protectedvoid rollbackTrans() {

                   if(txService == null || transactionStatus == null) {

                            thrownew TransactionUsageException("没有开启事务,回滚事务失败");

                   }

                   txService.rollback(transactionStatus);

         }

 

         publicEBT2DealerCollectionService getEbt2DealerCollectionService() {

                   returnebt2DealerCollectionService;

         }

 

         publicvoid setEbt2DealerCollectionService(

                            EBT2DealerCollectionServiceebt2DealerCollectionService) {

                   this.ebt2DealerCollectionService= ebt2DealerCollectionService;

         }

        

         /**

          * 需要使用注入方法的Service字段后缀

          */

         privatestatic final String SERVICE_NAME_POSTFIX = "Service";

        

         /**

          * 需要使用注入方法的Dao字段的后缀

          */

         privatestatic final String DAO_NAME_POSTFIX = "Dao";

        

         privatevoid inject() {

                   ActionSupportaction = this;

                   //获得所有定义的字段的名称

                   Field[]f = action.getClass().getDeclaredFields();

                   for(int i = 0; i < f.length; i++) {

                            StringpropertyName = f[i].getName();

                            //根据字段的名字,判断是否使用注入方法

                            //判断依据:

                            //1 名称格式为 xxxxService,例如:policyService

                            //2 名称格式为 xxxxDao,例如:prdtDao

                            if(propertyName.lastIndexOf(SERVICE_NAME_POSTFIX) == propertyName

                                               .length()

                                               -SERVICE_NAME_POSTFIX.length()

                                               ||propertyName.lastIndexOf(DAO_NAME_POSTFIX) == propertyName

                                                                 .length()

                                                                 -DAO_NAME_POSTFIX.length()) {

                                     try{

                                               //

                                               ObjectbeanInstance = applicationContext

                                                                 .getBean(propertyName);

                                               if(beanInstance != null) {

                                                        BeanUtils.setProperty(action,propertyName,

                                                                           beanInstance);

                                                        log.info("Bean[ " + f[i].getName() + " ] 注入成功");

                                                        //f[i].set(action, beanInstance);

                                               }

                                     }catch (BeansException e) {

                                               log.fatal("Bean[ " + f[i].getName() + " ] 没有定义");

                                     }catch (Exception e) {

                                               log.fatal("Bean[ " + f[i].getName() + " ] 注入失败");

                                               log.error("",e);

                                     }

                            }

                   }

         }

}

Stkcd [股票代码] ShortName [股票简称] Accper [统计截止日期] Typrep [报表类型编码] Indcd [行业代码] Indnme [行业名称] Source [公告来源] F060101B [净利润现金净含量] F060101C [净利润现金净含量TTM] F060201B [营业收入现金含量] F060201C [营业收入现金含量TTM] F060301B [营业收入现金净含量] F060301C [营业收入现金净含量TTM] F060401B [营业利润现金净含量] F060401C [营业利润现金净含量TTM] F060901B [筹资活动债权人现金净流量] F060901C [筹资活动债权人现金净流量TTM] F061001B [筹资活动股东现金净流量] F061001C [筹资活动股东现金净流量TTM] F061201B [折旧摊销] F061201C [折旧摊销TTM] F061301B [公司现金流1] F061302B [公司现金流2] F061301C [公司现金流TTM1] F061302C [公司现金流TTM2] F061401B [股权现金流1] F061402B [股权现金流2] F061401C [股权现金流TTM1] F061402C [股权现金流TTM2] F061501B [公司自由现金流(原有)] F061601B [股权自由现金流(原有)] F061701B [全部现金回收率] F061801B [营运指数] F061901B [资本支出与折旧摊销比] F062001B [现金适合比率] F062101B [现金再投资比率] F062201B [现金满足投资比率] F062301B [股权自由现金流] F062401B [企业自由现金流] Indcd1 [行业代码1] Indnme1 [行业名称1] 季度数据,所有沪深北上市公司的 分别包含excel、dta数据文件格式及其说明,便于不同软件工具对数据的分析应用 数据来源:基于上市公司年报及公告数据整理,或相关证券交易所、各部委、省、市数据 数据范围:基于沪深北证上市公司 A股(主板、中小企业板、创业板、科创板等)数据整理计算
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值