From d25dedf68957b7024b17e0cb573725e016fdab8a Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期三, 23 十月 2024 20:23:17 +0800 Subject: [PATCH] 2024-10-23 朱宝民 微信支付信息初始化迁移 --- pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 56 insertions(+), 4 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java index 249facb..bed8576 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java @@ -1,5 +1,7 @@ package com.dy.sso.busi; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dy.pipIrrGlobal.daoBa.BaCaptchaMapper; import com.dy.pipIrrGlobal.daoBa.BaUserMapper; import com.dy.pipIrrGlobal.pojoBa.BaUser; import lombok.extern.slf4j.Slf4j; @@ -7,11 +9,14 @@ import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; @Slf4j @Service public class SsoSv { - private BaUserMapper baUserMapper; @Autowired @@ -19,11 +24,42 @@ this.baUserMapper = baUserMapper ; } + @Autowired + private BaCaptchaMapper baCaptchaMapper; + + /** + * 闇�瑕丅aUserMapper.xml + * @param uuid 缁欑櫥褰曟垚鍔熺殑鐢ㄦ埛璧嬪�煎叾token + * @param phone 鐢ㄦ埛鎵嬫満鍙� + * @param password 鐢ㄦ埛瀵嗙爜 + * @return 鐧诲綍鎴愬姛鐢ㄦ埛 + */ //褰撴湭娉ㄨВ@Transactional鏃讹紝浼氳緭鍑烘棩蹇楋細SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@46727a0c] was not registered for synchronization because synchronization is not active - //@Transactional + @Transactional @Cacheable(cacheNames=CacheConstants.cacheNames, key="'" + CacheConstants.loginUserKeyPrefix + "' + #uuid", sync=true) - public BaUser login(String uuid, String phone, String password){ + public BaUser loginWithMapperXml(String uuid, String phone, String password){ return this.baUserMapper.login(phone, password) ; + } + + /** + * 涓嶉渶瑕� BaUserMapper.xml + * @param uuid 缁欑櫥褰曟垚鍔熺殑鐢ㄦ埛璧嬪�煎叾token + * @param phone 鐢ㄦ埛鎵嬫満鍙� + * @param password 鐢ㄦ埛瀵嗙爜 + * @return 鐧诲綍鎴愬姛鐢ㄦ埛 + */ + //褰撴湭娉ㄨВ@Transactional鏃讹紝浼氳緭鍑烘棩蹇楋細SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@46727a0c] was not registered for synchronization because synchronization is not active + @Transactional + @Cacheable(cacheNames=CacheConstants.cacheNames, key="'" + CacheConstants.loginUserKeyPrefix + "' + #uuid", sync=true) + public BaUser loginWithOutMapperXml(String uuid, String phone, String password){ + QueryWrapper<BaUser> qw = new QueryWrapper<>(); + //QueryWrapper<DemoMp> queryWrapper = Wrappers.<DemoMp>query() ; + qw.select("id", "name", "phone", "orgTag", "supperAdmin") + .eq("disabled", 0) + .eq("deleted", 0) + .eq("phone", phone) + .eq("password", password); + return this.baUserMapper.selectOne(qw) ; } @CacheEvict(cacheNames=CacheConstants.cacheNames, key="'" + CacheConstants.loginUserKeyPrefix + "' + #uuid") @@ -32,8 +68,24 @@ @Cacheable(cacheNames=CacheConstants.cacheNames, key="'" + CacheConstants.loginUserKeyPrefix + "' + #uuid") public BaUser getByUuid(String uuid){ - //姝ゆ柟娉曠洰鐨勬槸鐩存帴浠庣紦瀛樹腑璇诲彇锛屽鏋滅紦瀛樻棤姝ゅ�硷紝璇存槑鏁版嵁琚竻妤氫簡锛岃繑鍥瀗ull鍊硷紝闇�瑕侀噸鏂扮櫥褰� + //姝ゆ柟娉曠洰鐨勬槸鐩存帴浠庣紦瀛樹腑璇诲彇锛屽鏋滅紦瀛樻棤姝ゅ�硷紝璇存槑鏁版嵁琚竻闄や簡锛岃繑鍥瀗ull鍊硷紝闇�瑕侀噸鏂扮櫥褰� return null ; } + /** + * 寰楀埌鎵�鏈夌敤鎴锋墜鏈哄彿 + * @return + */ + public List<String> getPhones(){ + return baUserMapper.getPhones() ; + } + + /** + * 渚濇嵁楠岃瘉鐮乼oken鑾峰彇楠岃瘉瀛楃 + * @param token + * @return + */ + public Map getCodeByToken(String token) { + return baCaptchaMapper.getCodeByToken(token); + } } -- Gitblit v1.8.0