Wechat business - ordinary users open as personal businesses

 

1 Only supports opening as a personal merchant, not an enterprise merchant verifyType == 1

return WebResult.success("redirect:/verify/merchantVerify.html?flag="+flag, 0);

 

2 Business logic for successful execution of authentication

//Insert personal merchant table This is the payment code of httpclient call

merchantVerifyService.addPersonCustVerify(personCustVerifyView,getCurrentUserId(), getCurrentUserMobile())

 

//Initialize wallet

try {

  // The following record will add a merchantUser

merchantUserService.buildMerchantUser(getCurrentUsername(), personCustVerifyView.getName(), 1,getCurrentUserId(),personCustVerifyView.getIdCode());

merchantUserService.addSuccessStep(getCurrentUserId());  // redis操作

merchantUserService.setMerchant(getCurrentUsername());  // redis操作

} catch (PayException e) {

LOGGER.error("Failed to initialize personal merchant wallet: ", e.getMessage());

}

merchantUserService.updateVerifyStep(getCurrentUserId(), 0); // change step

 

======================================================

addMerchantUser: userId can be uniquely indexed to avoid duplicate records  

addMerchantUser is a local call of the merchant platform:

<insert id="addMerchantUser" >

INSERT INTO busi_merchant_cooperator (qb_account,name,contacts,contact_number

,email,in_time,status,shop_type,apply_from,id_card_num)

VALUES (#{userName}, #{shopName}, #{shopName},

#{mobile}, #{email}, now(),2,#{verifyType},1,#{idCard});

</insert>

 

================

@Override

@Transactional(rollbackFor = Exception.class)

public void buildMerchant4Api(String shopName, String userName, Long userId, String mobile, String email, String idCode) throws PayException {

try {

addMerchantUser(shopName, mobile, email, userName, 1, userId, idCode);

} catch (DuplicateKeyException e) {

//Added unreviewed in the background, self-certified by the front desk

// logger.error("("+userName+") Merchant has submitted authentication, update information: ", e);

updateMerchantUser(shopName, mobile, email, userName, 1, userId, idCode);

}

}

 

========================== 

// The logic of the client, calling the service of the merchant platform. In the past, the user was called here, and the business division was unreasonable.

query_user_info_url=http://user.qbao.com/api/

stringBuffer.append(config.getQueryUserInfoUrl()).append("add/merchant/").append(shopName).append("/").append(userName).append("/").append(verifyType);

 

==========================================================

<select id="selectCasUserByName" resultType="CasUser">

select * from

QW_CAS_USER where USERNAME=#{username}

</select>

 

 

redirect:http://enterprise.qbao.com/merchantUser/merchantUcIndex.html?_merchant_user_id_=3972916

Result r = enterpriseFacade.qryDefaultMerchant(userId);

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327064776&siteId=291194637