Commit 681724fc by Java-聂换换

HL2通道支付

parent 8a85d934
...@@ -336,8 +336,10 @@ public class PayApiService { ...@@ -336,8 +336,10 @@ public class PayApiService {
} }
// HL2 通道 即JFEN 开卡 // HL2 通道 即JFEN 开卡 需要得参数
public Response openCardJFen(UserRequest request){ public Response openCardJFen(UserRequest request){
Response response = new Response();
CardEntity cardEntity = userService.getCardInfo(request); CardEntity cardEntity = userService.getCardInfo(request);
UserSubMchId userSubMchId = new UserSubMchId(); UserSubMchId userSubMchId = new UserSubMchId();
userSubMchId.setUserCode(request.getSubMerchantCode()); userSubMchId.setUserCode(request.getSubMerchantCode());
...@@ -345,13 +347,61 @@ public class PayApiService { ...@@ -345,13 +347,61 @@ public class PayApiService {
userSubMchId = userService.getUserSubmchid(userSubMchId); userSubMchId = userService.getUserSubmchid(userSubMchId);
UserEntity userEntity = userService.getUserInfo(request); UserEntity userEntity = userService.getUserInfo(request);
UserDetailEntity userDetailEntity = userService.getUserDetailByCode(request.getSubMerchantCode()); UserDetailEntity userDetailEntity = userService.getUserDetailByCode(request.getSubMerchantCode());
// 如果没有注册 则先注册
if(userSubMchId == null){
CardEntity cardEntityDebit = userService.getCardInfoByCode(userEntity);
JSONObject dto = new JSONObject();
String orderId = MakeOrderNum.makeOrderNum();
dto.put("orderId", MakeOrderNum.makeOrderNum());
dto.put("serviceType",1);
dto.put("subMerchantName",userDetailEntity.getRealName()+orderId);
dto.put("subMerchantType","PERSON");
dto.put("businessLicense",userDetailEntity.getRealName()+orderId);
dto.put("legalPersonName",userDetailEntity.getRealName());
dto.put("legalPersonID",userDetailEntity.getIdCard());
dto.put("subMerchantPersonName",userDetailEntity.getRealName());
dto.put("subMerchantPersonPhone",userEntity.getMobile());
dto.put("bankType","TOPRIVATE");
dto.put("accountName",userDetailEntity.getRealName());
dto.put("accountNo",cardEntityDebit.getCardNo());
dto.put("bankName",cardEntityDebit.getBankName());
dto.put("bankProv",cardEntityDebit.getProvince());
dto.put("bankCity",cardEntityDebit.getCity());
dto.put("bankBranch",cardEntityDebit.getCardPlace());
dto.put("bankCode",cardEntityDebit.getBelongBank());
dto.put("timestamp",System.currentTimeMillis());
JSONObject jsonObject = null;
try {
jsonObject = juHeZhongPayJFenService.merchantIn(dto);
} catch (Exception e) {
response.setStatus(ComCode.STATUS_CODE_9998);
response.setMessage(ComCode.STATUS_CODE_9998_DESC);
response.setError(e.getMessage());
return response;
}
if (!"0000".equals(jsonObject.getString("code"))) {
response.setStatus(ComCode.STATUS_CODE_9998);
response.setMessage(jsonObject.getString("msg"));
return response;
}
String subMchId = jsonObject.getString("subMchId");
}
// 获取费率
RateEntity rateEntity = new RateEntity(); RateEntity rateEntity = new RateEntity();
rateEntity.setUserLevel(userEntity.getLevel()); rateEntity.setUserLevel(userEntity.getLevel());
rateEntity.setPayChannel(ComCode.PAYCHANNEL_HL2); rateEntity.setPayChannel(ComCode.PAYCHANNEL_HL2);
rateEntity.setPayMethod("quick"); rateEntity.setPayMethod("quick");
rateEntity = userService.getRateByLevel(rateEntity); rateEntity = userService.getRateByLevel(rateEntity);
Response response = new Response();
JSONObject dto = new JSONObject(); JSONObject dto = new JSONObject();
dto.put("orderId", MakeOrderNum.makeOrderNum()); dto.put("orderId", MakeOrderNum.makeOrderNum());
......
...@@ -39,6 +39,8 @@ public class CardEntity extends BaseEntity implements Serializable { ...@@ -39,6 +39,8 @@ public class CardEntity extends BaseEntity implements Serializable {
private String swpaccid; // HL2通道 开卡唯一标识 private String swpaccid; // HL2通道 开卡唯一标识
private String isOpenCard = "1";
public CardEntity() { public CardEntity() {
} }
...@@ -231,4 +233,12 @@ public class CardEntity extends BaseEntity implements Serializable { ...@@ -231,4 +233,12 @@ public class CardEntity extends BaseEntity implements Serializable {
public void setSwpaccid(String swpaccid) { public void setSwpaccid(String swpaccid) {
this.swpaccid = swpaccid; this.swpaccid = swpaccid;
} }
public String getIsOpenCard() {
return isOpenCard;
}
public void setIsOpenCard(String isOpenCard) {
this.isOpenCard = isOpenCard;
}
} }
...@@ -707,4 +707,9 @@ public class UserApiService { ...@@ -707,4 +707,9 @@ public class UserApiService {
return userDao.getBelongBankByPayChannel(request); return userDao.getBelongBankByPayChannel(request);
} }
public CardEntity getCardInfoByCode(UserEntity userEntity) {
return userDao.getCardInfoByCode(userEntity);
}
} }
...@@ -238,15 +238,22 @@ ...@@ -238,15 +238,22 @@
yc.update_date AS modified, yc.update_date AS modified,
yc.update_by AS modifiedUser, yc.update_by AS modifiedUser,
yc.del_flag AS delFlag yc.del_flag AS delFlag
<if test="payChannel!=null and payChannel != ''">
,if(ycs.swpaccid is null,0,1) AS isOpenCard
</if>
FROM FROM
youka_cards yc youka_cards yc
LEFT JOIN youka_bank yb ON yc.belong_bank = yb.bank_code LEFT JOIN youka_bank yb ON yc.belong_bank = yb.bank_code
<if test="payChannel!=null and payChannel != ''">
LEFT JOIN youka_card_swpaccid ycs ON ycs.card_code = yc.code
</if>
WHERE WHERE
yc.user_code = #{subMerchantCode} yc.user_code = #{subMerchantCode}
AND yc.card_type = #{cardType} AND yc.card_type = #{cardType}
AND yc.del_flag = '0' AND yc.del_flag = '0'
<if test="payChannel!=null and payChannel != ''"> <if test="payChannel!=null and payChannel != ''">
AND yb.support_pay_channel LIKE concat('%',#{payChannel},',%') AND yb.support_pay_channel LIKE concat('%',#{payChannel},',%')
AND ycs.pay_channel = #{payChannel}
</if> </if>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment