Commit 681724fc by Java-聂换换

HL2通道支付

parent 8a85d934
......@@ -336,8 +336,10 @@ public class PayApiService {
}
// HL2 通道 即JFEN 开卡
// HL2 通道 即JFEN 开卡 需要得参数
public Response openCardJFen(UserRequest request){
Response response = new Response();
CardEntity cardEntity = userService.getCardInfo(request);
UserSubMchId userSubMchId = new UserSubMchId();
userSubMchId.setUserCode(request.getSubMerchantCode());
......@@ -345,13 +347,61 @@ public class PayApiService {
userSubMchId = userService.getUserSubmchid(userSubMchId);
UserEntity userEntity = userService.getUserInfo(request);
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.setUserLevel(userEntity.getLevel());
rateEntity.setPayChannel(ComCode.PAYCHANNEL_HL2);
rateEntity.setPayMethod("quick");
rateEntity = userService.getRateByLevel(rateEntity);
Response response = new Response();
JSONObject dto = new JSONObject();
dto.put("orderId", MakeOrderNum.makeOrderNum());
......
......@@ -39,6 +39,8 @@ public class CardEntity extends BaseEntity implements Serializable {
private String swpaccid; // HL2通道 开卡唯一标识
private String isOpenCard = "1";
public CardEntity() {
}
......@@ -231,4 +233,12 @@ public class CardEntity extends BaseEntity implements Serializable {
public void setSwpaccid(String swpaccid) {
this.swpaccid = swpaccid;
}
public String getIsOpenCard() {
return isOpenCard;
}
public void setIsOpenCard(String isOpenCard) {
this.isOpenCard = isOpenCard;
}
}
......@@ -707,4 +707,9 @@ public class UserApiService {
return userDao.getBelongBankByPayChannel(request);
}
public CardEntity getCardInfoByCode(UserEntity userEntity) {
return userDao.getCardInfoByCode(userEntity);
}
}
......@@ -238,15 +238,22 @@
yc.update_date AS modified,
yc.update_by AS modifiedUser,
yc.del_flag AS delFlag
<if test="payChannel!=null and payChannel != ''">
,if(ycs.swpaccid is null,0,1) AS isOpenCard
</if>
FROM
youka_cards yc
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
yc.user_code = #{subMerchantCode}
AND yc.card_type = #{cardType}
AND yc.del_flag = '0'
<if test="payChannel!=null and payChannel != ''">
AND yb.support_pay_channel LIKE concat('%',#{payChannel},',%')
AND ycs.pay_channel = #{payChannel}
</if>
</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