|
@@ -78,7 +78,8 @@ public class MchServiceImpl extends BaseServiceImpl<Mch, Long> implements MchSer
|
|
|
mch.setLogin_name(login_name);
|
|
|
|
|
|
// String alt_mch_name = "test1_" + adminId + "@mianhuatang.com";
|
|
|
- String alt_mch_name = mch.getLegal_person();
|
|
|
+// String alt_mch_name = mch.getLegal_person();
|
|
|
+ String alt_mch_name = mch.getBank_account_name();
|
|
|
mch.setAlt_mch_name(alt_mch_name);
|
|
|
mch.setAlt_mch_short_name("");
|
|
|
|
|
@@ -221,6 +222,10 @@ public class MchServiceImpl extends BaseServiceImpl<Mch, Long> implements MchSer
|
|
|
// 企业用对公账户
|
|
|
requestData.put("bank_account_type", JoinpayConstant.bank_account_type4);
|
|
|
mch.setBank_account_type(JoinpayConstant.bank_account_type4);
|
|
|
+ String alt_mch_name = bank_account_name;
|
|
|
+ requestData.put("alt_mch_name", alt_mch_name);
|
|
|
+// requestData.put("alt_mch_name", AESUtil.encrypt(alt_mch_name, aes_key1 , aes_key2 ));
|
|
|
+
|
|
|
}else if(JoinpayConstant.alt_merchant_type1== alt_merchant_type){
|
|
|
// 个人用借记卡
|
|
|
requestData.put("bank_account_type", JoinpayConstant.bank_account_type1);
|
|
@@ -237,8 +242,10 @@ public class MchServiceImpl extends BaseServiceImpl<Mch, Long> implements MchSer
|
|
|
mch.setBank_account_name(bank_account_name);
|
|
|
mch.setBank_account_no(bank_account_no);
|
|
|
mch.setBank_channel_no(bank_channel_no);
|
|
|
-
|
|
|
-
|
|
|
+ if(alt_merchant_type==12){
|
|
|
+ String alt_mch_name = bank_account_name;
|
|
|
+ mch.setAlt_mch_name(alt_mch_name);
|
|
|
+ }
|
|
|
JSONObject requestJson = new JSONObject(new TreeMap<String, Object>());
|
|
|
requestJson.put("method", "altmch.modify");
|
|
|
requestJson.put("version", "1.0");
|
|
@@ -768,6 +775,94 @@ public class MchServiceImpl extends BaseServiceImpl<Mch, Long> implements MchSer
|
|
|
|
|
|
return back;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 传送身份证图片
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String sendCardBusiness(Mch mch, String cardPositive, String cardNegative, String tradeLicence, String openAccountLicence) {
|
|
|
+
|
|
|
+// String url = "https://www.joinpay.com/allocFunds";
|
|
|
+ String url = "https://upload.joinpay.com/allocFunds";
|
|
|
+
|
|
|
+ if(StringUtils.isEmpty(mch.getAlt_mch_no())){
|
|
|
+ return "找不到商家编号";
|
|
|
+ }
|
|
|
+// String card_positive = ImageToBase64ByLocal(cardPositive);
|
|
|
+ String card_positive = cardPositive;
|
|
|
+// String card_negative = ImageToBase64ByLocal(cardNegative);
|
|
|
+ String card_negative = cardNegative;
|
|
|
+ String trade_licence = tradeLicence;
|
|
|
+ String open_account_licence = openAccountLicence;
|
|
|
+
|
|
|
+ JSONObject requestData = new JSONObject(new LinkedHashMap());
|
|
|
+ requestData.put("alt_mch_no" , mch.getAlt_mch_no());
|
|
|
+ requestData.put("card_positive" , card_positive);
|
|
|
+ requestData.put("card_negative" , card_negative);
|
|
|
+ requestData.put("trade_licence" , trade_licence);
|
|
|
+ requestData.put("open_account_licence" , open_account_licence);
|
|
|
+
|
|
|
+ JSONObject requestJson = new JSONObject(new TreeMap<String, Object>());
|
|
|
+ requestJson.put("method", "altMchPics.uploadPic");
|
|
|
+ requestJson.put("version", "1.0");
|
|
|
+ requestJson.put("data", requestData);
|
|
|
+ // 32位随机字符串
|
|
|
+ String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
|
|
|
+ requestJson.put("rand_str", uuid);
|
|
|
+ requestJson.put("sign_type", JoinpayConstant.sign_type_MD5);
|
|
|
+ requestJson.put("mch_no", JoinpayConstant.mch_no);
|
|
|
+
|
|
|
+ String sign = createMD5Sign(requestJson , JoinpayConstant.key);
|
|
|
+ requestJson.put("sign", sign.toUpperCase());
|
|
|
+ logger.info("请求参数:" + requestJson);
|
|
|
+ String back=null;
|
|
|
+ org.json.JSONObject jsonObject;
|
|
|
+ try {
|
|
|
+
|
|
|
+ jsonObject = HttpClientUtils.postJson(url, requestJson.toString());
|
|
|
+ logger.info("响应参数:" + jsonObject);
|
|
|
+
|
|
|
+ // 判断请求是否正确,受理成功
|
|
|
+ if(jsonObject.has("resp_code")){
|
|
|
+ String resp_code = jsonObject.getString("resp_code");
|
|
|
+ mch.setResp_code(resp_code);
|
|
|
+ }else{
|
|
|
+ return "请求失败";
|
|
|
+ }
|
|
|
+ // 处理data
|
|
|
+ if(jsonObject.has("data")){
|
|
|
+ org.json.JSONObject data = jsonObject.getJSONObject("data");
|
|
|
+ String biz_code = data.getString("biz_code");
|
|
|
+ if(biz_code.equals("B100000")){
|
|
|
+ String approve_status = "审核中";
|
|
|
+ mch.setApprove_status(approve_status);
|
|
|
+ mch.setApprove_note("");
|
|
|
+ back = approve_status;
|
|
|
+ }
|
|
|
+ if(biz_code.equals("B100002")){
|
|
|
+ String approve_status = "上传失败";
|
|
|
+ String approve_note = data.getString("biz_msg");
|
|
|
+ mch.setApprove_note(approve_note);
|
|
|
+ mch.setApprove_status(approve_status);
|
|
|
+ back = approve_status;
|
|
|
+ }
|
|
|
+ if(biz_code.equals("B101017")){
|
|
|
+ String approve_status = "上传失败";
|
|
|
+ String approve_note = data.getString("biz_msg");
|
|
|
+ mch.setApprove_note(approve_note);
|
|
|
+ mch.setApprove_status(approve_status);
|
|
|
+ back = approve_status;
|
|
|
+ }
|
|
|
+ update(mch);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ return back;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 查询身份证照片审核状态
|