generated from root/miduo_server
自动注入
parent
1d95a179db
commit
d84eab26e3
|
@ -1,15 +1,9 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jmfy.dto.CPayOrder;
|
||||
import com.jmfy.dto.CUserDao;
|
||||
import com.jmfy.dto.CUserInfo;
|
||||
import com.jmfy.paramBean.CHRechargeBean;
|
||||
import com.jmfy.paramBean.PaySdkEnum;
|
||||
import com.jmfy.thrift.idl.RPCRequestIFace;
|
||||
import com.jmfy.thrift.idl.Result;
|
||||
import com.jmfy.thrift.pool.ClientAdapterPo;
|
||||
import com.jmfy.thrift.pool.ServiceKey;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
import com.jmfy.util.MD5Util;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
@ -23,9 +17,10 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
|
@ -36,6 +31,8 @@ import java.util.*;
|
|||
public class CHGnRechargeController {
|
||||
@Resource
|
||||
private CUserDao cuserDao;
|
||||
@Resource
|
||||
private PayLogic payLogic;
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(CHGnRechargeController.class);
|
||||
private static Gson gson = new Gson();
|
||||
|
||||
|
@ -112,7 +109,7 @@ public class CHGnRechargeController {
|
|||
String orderNo = data.getOrderno_cp();
|
||||
String amount = String.valueOf(data.getPay_amt());
|
||||
|
||||
return PayLogic.getInstence().initOrder(callbackInfo,orderNo,amount,new Date(),data.getUserid(), PaySdkEnum.CH);
|
||||
return payLogic.initOrder(callbackInfo,orderNo,amount,new Date(),data.getUserid(), PaySdkEnum.CH);
|
||||
}
|
||||
|
||||
private static String getMySign(CHRechargeBean rechargeRequestBean,String appsecret) throws IllegalAccessException {
|
||||
|
|
|
@ -34,6 +34,8 @@ import java.util.*;
|
|||
public class MHTGnWebRechargeController {
|
||||
@Resource
|
||||
private CUserDao cuserDao;
|
||||
@Resource
|
||||
private PayLogic payLogic;
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MHTGnWebRechargeController.class);
|
||||
private static Gson gson = new Gson();
|
||||
|
||||
|
@ -105,7 +107,7 @@ public class MHTGnWebRechargeController {
|
|||
String amount = data.getMhtOrderAmt();
|
||||
Date time = new Date(Long.parseLong(data.getTime())*1000);;
|
||||
|
||||
return PayLogic.getInstence().initOrder(consumerId,orderNo,amount,time,consumerId,PaySdkEnum.MHT);
|
||||
return payLogic.initOrder(consumerId,orderNo,amount,time,consumerId,PaySdkEnum.MHT);
|
||||
}
|
||||
|
||||
private static String getMySign(MHTGnWebRechargeRequestBean rechargeRequestBean,String appsecret) throws IllegalAccessException {
|
||||
|
|
|
@ -39,12 +39,6 @@ public class PayLogic {
|
|||
|
||||
private PayLogic() {
|
||||
}
|
||||
public static PayLogic getInstence() {
|
||||
return InnerClass.instance;
|
||||
}
|
||||
private static class InnerClass {
|
||||
private static final PayLogic instance = new PayLogic();
|
||||
}
|
||||
|
||||
public String initOrder(String collBackInfo, String orderId, String amount, Date time, String openId, PaySdkEnum sdk){
|
||||
try {
|
||||
|
|
|
@ -34,6 +34,8 @@ import java.util.regex.Pattern;
|
|||
public class QuickRechargeController {
|
||||
@Resource
|
||||
private CUserDao cuserDao;
|
||||
@Resource
|
||||
private PayLogic payLogic;
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(QuickRechargeController.class);
|
||||
private static final String callbackkey = "95443521616386247430552526885495";
|
||||
private static final String md5key = "zr2i1hqfp54iijlvk8yjhopxrdq23nb3";
|
||||
|
@ -92,7 +94,7 @@ public class QuickRechargeController {
|
|||
String orderNo = map.get("order_no");
|
||||
String amount = map.get("amount");
|
||||
|
||||
return PayLogic.getInstence().initOrder(callbackInfo,orderNo,amount,new Date(System.currentTimeMillis()),callback[0],PaySdkEnum.QUICK);
|
||||
return payLogic.initOrder(callbackInfo,orderNo,amount,new Date(System.currentTimeMillis()),callback[0],PaySdkEnum.QUICK);
|
||||
}
|
||||
|
||||
public boolean sign(String ntdata0,String sign0,String md5Sign){
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.jmfy.dto.CPayOrder;
|
||||
import com.jmfy.dto.CUserDao;
|
||||
import com.jmfy.dto.CUserInfo;
|
||||
import com.jmfy.paramBean.MHTGnWebRechargeRequestBean;
|
||||
import com.jmfy.paramBean.PaySdkEnum;
|
||||
import com.jmfy.paramBean.XPParamBean;
|
||||
import com.jmfy.thrift.idl.RPCRequestIFace;
|
||||
import com.jmfy.thrift.idl.Result;
|
||||
import com.jmfy.thrift.pool.ClientAdapterPo;
|
||||
import com.jmfy.thrift.pool.ServiceKey;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
import com.jmfy.util.MD5Util;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -21,10 +13,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
|
@ -35,6 +25,8 @@ import java.util.*;
|
|||
public class XPRechargeController {
|
||||
@Resource
|
||||
private CUserDao cuserDao;
|
||||
@Resource
|
||||
private PayLogic payLogic;
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(XPRechargeController.class);
|
||||
private static Gson gson = new Gson();
|
||||
|
||||
|
@ -102,7 +94,7 @@ public class XPRechargeController {
|
|||
String amount = data.getAmount();
|
||||
Date time = new Date(System.currentTimeMillis());
|
||||
|
||||
return PayLogic.getInstence().initOrder(callbackInfo,orderNo,amount,time,data.getOpenId(), PaySdkEnum.XP);
|
||||
return payLogic.initOrder(callbackInfo,orderNo,amount,time,data.getOpenId(), PaySdkEnum.XP);
|
||||
}
|
||||
|
||||
private static String getMySign(XPParamBean paramBean,String appsecret){
|
||||
|
|
Loading…
Reference in New Issue