system-card/src/main/java/cn/com/tenlion/systemcard/service/UserService.java

40 lines
1.6 KiB
Java
Raw Normal View History

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;
import ink.wgink.module.wechat.service.miniapp.IMiniappUserCreateHandleService;
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;
@Override
public void handle(UserPO userPO, String s) throws Exception {
/**
* 查询是否已经创建 , 如果创建则不执行
*/
AccountDTO accountDTO = iAccountService.get(userPO.getUserId());
if(accountDTO == null) {
AccountVO accountVO = new AccountVO();
accountVO.setAccountMoney(0);
accountVO.setAccountIntegral(0);
accountVO.setAccountNumber(userPO.getUserUsername());
accountVO.setAccountPassword("");
accountVO.setAccountStatus("1");
accountVO.setAccountUserId(userPO.getUserId());
iAccountService.saveAccount(userPO.getUserId(), accountVO);
}
}
}