try {
String mid ="";
String tid ="";
if ("SPB".equals(aaa.get("adapterid_1"))) {
System.out.println("modify SPBUPOP Start !");
if (isSPBUPOPexist) {
System.out.println("Got SPBUPOP data!");
try {
if ("1".equals(request.getParameter("SPBUPOP_Enable"))) {
System.out.println("update SPBUPOP status = A !");
spbupopstmt = spbupop_conn.prepareStatement(
"UPDATE B2BMERCONFIG SET STATUS = 'A',MACKEY = ? WHERE MERID = ? ");
spbupopstmt.setString(1, request.getParameter("MacKeyID"));
spbupopstmt.setString(2, merid);
spbupopstmt.executeUpdate();
aaa.set("SPBUPOP_Enable", "1");
aaa.set("MacKeyID_4", request.getParameter("MacKeyID"));
} else {
System.out.println("change SPBUPOP status = L !");
spbupopstmt = spbupop_conn.prepareStatement(
"UPDATE B2BMERCONFIG SET STATUS = 'L' WHERE MERID = ? ");
spbupopstmt.setString(1, merid);
spbupopstmt.executeUpdate();
aaa.set("SPBUPOP_Enable", "0");
}
} catch (Exception e) {
System.out.println("Exception : " + e);
out.println((e.getMessage()));
}
} else {
System.out.println("no SPBUPOP data!");
if ("1".equals(request.getParameter("SPBUPOP_Enable"))){
try {
pstmt = con.prepareStatement(
"INSERT INTO TPMERRISK ( MERID, RISKID, ENABLE ) VALUES ( ?,'SPBUPOP','1')");
pstmt.setString(1, merid);
pstmt.executeUpdate();
} catch (Exception e) {
System.out.println("Exception : " + e);
out.println((e.getMessage()));
}
try {
System.out.println("add SPBUPOP_STATUS !");
pstmtt = conn.prepareStatement("select * from B2BMERMAPPING where MERID=?");
pstmtt.setString(1, merid);
rs = pstmtt.executeQuery();
if(rs.next()){
aaa.set("AcqMerID_4", rs.getString("ACQMERID"));
aaa.set("AcqTerminalID_4", rs.getString("ACQTERMINALID"));
mid = rs.getString("ACQMERID");
tid = rs.getString("ACQTERMINALID");
}
System.out.println("mid : " + mid);
System.out.println("tid : " + tid);
spbupopstmt = spbupop_conn.prepareStatement("INSERT INTO B2BMERCONFIG "
+ "( MERID, MERNAME, MERNUM, PUBKEY, MERTYPE, "
+ "CURRENCY, SETTLEHOUR, CUTOFFMONTH, CUTOFFDAY, "
+ "AUTOSETTLE, SETTLENUMS, AUTOTERM, STATUS, MACKEY ) VALUES ( ?,?,?,'Public_Key','SSL','901',?,'P',0,'N',0,'N','A',? )");
spbupopstmt.setString(1, aaa.get("MerID_1"));
System.out.println(aaa.get("MerID_1"));
spbupopstmt.setString(2, request.getParameter("mername"));
System.out.println(request.getParameter("mername"));
spbupopstmt.setString(3, aaa.get("MerID_1"));
System.out.println(aaa.get("MerID_1"));
spbupopstmt.setString(4, request.getParameter("SettleHour"));
System.out.println(request.getParameter("SettleHour"));
spbupopstmt.setString(5, request.getParameter("MacKeyID_4"));
System.out.println(request.getParameter("MacKeyID_4"));
spbupopstmt.executeUpdate();
System.out.println("INSERT INTO B2BMERCONFIG OK !");
spbupopstmt = spbupop_conn.prepareStatement(
"INSERT INTO B2BMERMAPPING ( MERID, ACQUIRERID, ACQMERID, MCCCODE,ACQTERMINALID ) VALUES ( ?,'888888',?,'4011',?)");
spbupopstmt.setString(1, aaa.get("MerID_1"));
spbupopstmt.setString(2, aaa.get("AcqMerID_4"));
spbupopstmt.setString(3, aaa.get("AcqTerminalID_4"));
spbupopstmt.executeUpdate();
aaa.set("SPBUPOP_Enable", "1");
System.out.println("INSERT INTO B2BMERMAPPING OK !");
} catch (Exception e) {
System.out.println("Exception : " + e);
out.println((e.getMessage()));
}
}
System.out.println("update SPBUPOP status end !");
}
}
} catch (Exception e) {
System.out.println("Exception : " + e);
}