2021-09-02 10:33:27 +08:00
|
|
|
package cn.com.tenlion.systemcard.service;
|
|
|
|
|
|
|
|
import cn.com.tenlion.systemcard.pojo.dtos.account.AccountDTO;
|
|
|
|
import cn.com.tenlion.systemcard.pojo.vos.account.AccountVO;
|
|
|
|
import cn.com.tenlion.systemcard.service.account.IAccountService;
|
|
|
|
import cn.com.tenlion.systemcard.service.cardcharge.ICardChargeService;
|
|
|
|
import ink.wgink.module.wechat.pojo.pay.v3.PayNoticeCiphertext;
|
2021-09-07 18:12:38 +08:00
|
|
|
import ink.wgink.module.wechat.pojo.pos.miniapp.MiniappUserPO;
|
2021-09-02 10:33:27 +08:00
|
|
|
import ink.wgink.module.wechat.service.miniapp.IMiniappUserCreateHandleService;
|
2021-09-07 18:12:38 +08:00
|
|
|
import ink.wgink.module.wechat.service.miniapp.IMiniappUserService;
|
2021-09-02 10:33:27 +08:00
|
|
|
import ink.wgink.module.wechat.service.pay.v3.IPayNoticeService;
|
|
|
|
import ink.wgink.service.user.pojo.pos.UserPO;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.context.annotation.Primary;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@Primary
|
|
|
|
public class UserService implements IMiniappUserCreateHandleService {
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private IAccountService iAccountService;
|
|
|
|
|
2021-09-07 18:12:38 +08:00
|
|
|
@Autowired
|
|
|
|
private IMiniappUserService iMiniappUserService;
|
|
|
|
|
2021-09-02 10:33:27 +08:00
|
|
|
@Override
|
|
|
|
public void handle(UserPO userPO, String s) throws Exception {
|
|
|
|
/**
|
|
|
|
* 查询是否已经创建 , 如果创建则不执行
|
|
|
|
*/
|
|
|
|
AccountDTO accountDTO = iAccountService.get(userPO.getUserId());
|
2021-09-07 18:12:38 +08:00
|
|
|
MiniappUserPO miniappUserPO = iMiniappUserService.getPO(userPO.getUserId());
|
2021-09-02 10:33:27 +08:00
|
|
|
if(accountDTO == null) {
|
|
|
|
AccountVO accountVO = new AccountVO();
|
|
|
|
accountVO.setAccountMoney(0);
|
|
|
|
accountVO.setAccountIntegral(0);
|
2021-09-07 18:12:38 +08:00
|
|
|
accountVO.setAccountNumber(miniappUserPO.getUserCode());
|
2021-09-02 10:33:27 +08:00
|
|
|
accountVO.setAccountPassword("");
|
|
|
|
accountVO.setAccountStatus("1");
|
|
|
|
accountVO.setAccountUserId(userPO.getUserId());
|
|
|
|
iAccountService.saveAccount(userPO.getUserId(), accountVO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|