generated from root/miduo_server
返利代码
parent
19020916f1
commit
1301ab42d6
|
|
@ -4,6 +4,7 @@ import com.google.gson.Gson;
|
|||
import com.jmfy.dao.ServerInfoDao;
|
||||
import com.jmfy.dao.UserInfoDao;
|
||||
import com.jmfy.model.*;
|
||||
import com.jmfy.model.vo.RechargeInfo;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
import com.jmfy.thrift.idl.Result;
|
||||
import com.jmfy.utils.RPCClient;
|
||||
|
|
@ -21,9 +22,7 @@ import javax.annotation.Resource;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
|
|
@ -46,8 +45,8 @@ public class GmController {
|
|||
}
|
||||
|
||||
String cmd = request.getParameter("content");
|
||||
if(cmd.equals("fixOrder")){
|
||||
fixOrder();
|
||||
if(cmd.equals("recharge")){
|
||||
recharge();
|
||||
return 0;
|
||||
}
|
||||
String serverId = request.getParameter("serverId");
|
||||
|
|
@ -153,7 +152,7 @@ public class GmController {
|
|||
return "addHero";
|
||||
}
|
||||
|
||||
|
||||
//修复订单
|
||||
public void fixOrder() {
|
||||
String osName = System.getProperty("os.name");
|
||||
String filePath = "";
|
||||
|
|
@ -225,6 +224,30 @@ public class GmController {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void recharge() throws IOException {
|
||||
String osName = System.getProperty("os.name");
|
||||
String filePath = "";
|
||||
Gson gson = new Gson();
|
||||
if (osName.matches("^(?i)Windows.*$")) {// Window 系统
|
||||
filePath = "conf/";
|
||||
} else {// Linux 系统
|
||||
filePath = "../config/";
|
||||
}
|
||||
BufferedReader in = new BufferedReader(new FileReader(filePath+"rechargeImport.txt"));
|
||||
BufferedWriter out = new BufferedWriter(new FileWriter(filePath+"recharge.json"));
|
||||
String str;
|
||||
while ((str = in.readLine()) != null) {
|
||||
String[] s = str.split("\t");
|
||||
RechargeInfo rechargeInfo = new RechargeInfo(s[0], Double.valueOf(s[1]), 0);
|
||||
String json = gson.toJson(rechargeInfo);
|
||||
System.out.println(s[0]+"||"+s[1]);
|
||||
out.write(json+"\n");
|
||||
}
|
||||
in.close();
|
||||
out.close();
|
||||
}
|
||||
static class CPayOrder {
|
||||
|
||||
private String orderId;//充值回调中的pOrderId
|
||||
|
|
|
|||
Loading…
Reference in New Issue