Commit a69f9667 by tang

修改抛出异常为unchecked异常,让事务回滚生效等

parent 7c947ddf
package com.thinkgem.jeesite.modules.commonError;
public class MyException extends Exception {
public class MyException extends RuntimeException {
public MyException() {
}
......
......@@ -115,4 +115,9 @@ public interface UserApiDao {
public Integer getActiveUserNum(UserRequest request);
public Integer checkNoUser();
//修改银行卡信息
void updateCard(CardEntity cardEntity);
CardEntity getCardEntity(Request request);
}
......@@ -256,7 +256,7 @@ public class UserApiService {
}
// 为用户卡注册subMerchantId
String type = "1"; // 默认将卡片添加为对私
String status = "0"; // 新增卡片审核状态均为未审核
String status = "1"; // 新增卡片审核状态均为审核,因取消了后台审核功能
String subMerchantId = null;//registJuHeZhongPay(request, type);
......@@ -267,10 +267,12 @@ public class UserApiService {
userDao.updateCardStatus(cardStatusEntity);
logger.debug("修改完银行卡信息");
CardEntity cardEntity = new CardEntity(IdGen.randomBase62(64), request.getSubMerchantCode(), "D", request.getCardNo(), request.getExpireDate(), request.getCvn2(),request.getCardMobile(), request.getBelongBank(), request.getCardBank(), request.getCardPlace(), "Y", subMerchantId, "", type, status, request.getProvince(), request.getCity());
userDao.addNewCard(cardEntity);
CardEntity cardInfo = userDao.getCardEntity(request);
if(cardInfo == null){
userDao.addNewCard(cardEntity);
}else{
userDao.updateCard(cardEntity);
}
// 查询与实名用户相同推荐人的信息
UserEntity queryUserRecommendEntity = new UserEntity(request.getSubMerchantCode());
......
......@@ -933,4 +933,62 @@
FROM
youka_users
</select>
<update id="updateCard">
UPDATE youka_cards
SET
card_type = #{cardType},
expire_date = #{expireDate},
cvn2 = #{cvn2},
card_mobile = #{cardMobile},
belong_bank = #{belongBank},
card_bank = #{cardBank},
card_place = #{cardPlace},
is_debit = #{isDebit},
card_src = #{cardSrc},
type = #{type},
status = #{status},
province = #{province},
city = #{city}
WHERE
user_code = #{userCode}
AND
card_no = #{cardNo}
</update>
<select id="getCardEntity" resultType="com.thinkgem.jeesite.modules.user.entity.CardEntity">
SELECT
yc.id,
yc.code,
yc.user_code AS userCode,
yc.card_type AS cardType,
yc.card_no AS cardNo,
yc.card_mobile AS cardMobile,
yc.belong_bank AS belongBank,
yb.bank_name AS bankName,
yb.bank_short AS bankShort,
yb.support_pay_channel AS supportPayChannel,
yc.card_bank AS cardBank,
yc.card_place AS cardPlace,
yc.is_debit AS isDebit,
yc.sub_merchant_id AS subMerchantId,
yc.card_src AS cardSrc,
yc.type,
yc.status,
yc.province,
yc.city,
yc.create_date AS created,
yc.create_by AS createdUser,
yc.update_date AS modified,
yc.update_by AS modifiedUser,
yc.del_flag AS delFlag
FROM
youka_cards yc
LEFT JOIN youka_bank yb ON yc.belong_bank = yb.bank_code
WHERE
yc.user_code = #{subMerchantCode}
AND yc.card_no = #{cardNo}
AND yc.del_flag = '0'
LIMIT 1
</select>
</mapper>
\ No newline at end of file
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