package com.dy.pipIrrWechat.wechatpay; import com.dy.pipIrrGlobal.daoSe.SeClientMapper; import com.dy.pipIrrGlobal.daoSe.SeOpenIdMapper; import com.dy.pipIrrGlobal.daoSe.SeVcRechargeMapper; import com.dy.pipIrrGlobal.pojoSe.SeClient; import com.dy.pipIrrGlobal.pojoSe.SeOpenId; import com.dy.pipIrrGlobal.pojoSe.SeVcRecharge; import com.dy.pipIrrGlobal.voSe.VoClient; import com.dy.pipIrrWechat.virtualCard.SeClientToVoClient; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * @author ZhuBaoMin * @date 2024-07-16 15:03 * @LastEditTime 2024-07-16 15:03 * @Description */ @Slf4j @Service public class PaymentSv { @Autowired private SeVcRechargeMapper seVcRechargeMapper; @Autowired private SeOpenIdMapper seOpenIdMapper; @Autowired private SeClientMapper seClientMapper; /** * 根据登录态ID获取登录态对象 * @param sessionId * @return */ SeOpenId selectOne(Long sessionId) { return seOpenIdMapper.selectByPrimaryKey(sessionId); } /** * 添加虚拟卡充值记录 * @param po * @return */ Long insertVCRecharge(SeVcRecharge po) { seVcRechargeMapper.insert(po); return po.getId(); } /** * 根据主键获取农户对象 * @param id 农户主键 * @return 农户对象 */ public VoClient getOneClient(Long id) { SeClient seClient = seClientMapper.selectByPrimaryKey(id); VoClient voClient = SeClientToVoClient.INSTANCT.po2vo(seClient); return voClient; } /** * 根据电话号码获取农户ID * @param phoneNumber * @return */ public Long getClientIdByPhone(String phoneNumber) { return seClientMapper.getClientIdByPhone(phoneNumber); } /** * 添加微信用户账户记录 * @param po * @return */ public Long addOpenId(SeOpenId po) { seOpenIdMapper.insert(po); //return po.getClientId(); return po.getId(); } }