GitBucket
4.23.0
Toggle navigation
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
yn-bftl-byx
/
thirdparty
Browse code
修复bug
master
1 parent
9cf5280
commit
cdd8de3f288c0af0792ae8edd43b726efbf3fee1
steven
authored
on 16 Oct
Patch
Showing
2 changed files
src/main/java/com/yn/bftl/thirdparty/common/repository/ThirdPartyPaySetRepository.java
src/main/java/com/yn/bftl/thirdparty/modules/business/util/ThirdPartyConfigUtil.java
Ignore Space
Show notes
View
src/main/java/com/yn/bftl/thirdparty/common/repository/ThirdPartyPaySetRepository.java
package com.yn.bftl.thirdparty.common.repository; import com.yn.bftl.common.modules.configuration.entity.ThirdPartyPaySet; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface ThirdPartyPaySetRepository extends JpaRepository<ThirdPartyPaySet, Long> { ThirdPartyPaySet findFirstByCompanyIsNullOrderByIdDesc(); /** * 查询-根据企业ID获取第三方配置 * * @param companyId 企业ID * @return 第三方配置 * @author huabiao * @create 2023/6/21 15:27 */ ThirdPartyPaySet findFirstByCompanyId(Long companyId); List<ThirdPartyPaySet> findAllByOrderById(); }
package com.yn.bftl.thirdparty.common.repository; import com.yn.bftl.common.modules.configuration.entity.ThirdPartyPaySet; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface ThirdPartyPaySetRepository extends JpaRepository<ThirdPartyPaySet, Long> { ThirdPartyPaySet findFirstByCompanyIsNullOrderByIdDesc(); /** * 查询-根据企业ID获取第三方配置 * * @param companyId 企业ID * @return 第三方配置 * @author huabiao * @create 2023/6/21 15:27 */ ThirdPartyPaySet findFirstByCompanyId(Long companyId); ThirdPartyPaySet findFirstOrderById(); }
Ignore Space
Show notes
View
src/main/java/com/yn/bftl/thirdparty/modules/business/util/ThirdPartyConfigUtil.java
package com.yn.bftl.thirdparty.modules.business.util; import com.yn.bftl.common.modules.configuration.entity.ThirdPartyPaySet; import com.yn.bftl.thirdparty.common.repository.ThirdPartyPaySetRepository; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.List; /** * 第三方配置工具类 * * @author huabiao * @create 2023/7/8 15:14 **/ @Component public class ThirdPartyConfigUtil { @Resource private ThirdPartyPaySetRepository thirdPartyPaySetRepository; /*** * 获取第三方平台配置 * * @return ThirdPartyPaySet * @author huabiao * @ 2023/7/8 15:14 */ public ThirdPartyPaySet getPlatform() { List<ThirdPartyPaySet> thirdPartyPaySetList = thirdPartyPaySetRepository.findAllByOrderById(); return thirdPartyPaySetList != null ? thirdPartyPaySetList.get(0) : null; } /** * 获取第三方企业配置 * * @param companyId * @return ThirdPartyPaySet * @author huabiao * @create 2023/7/8 15:15 */ public ThirdPartyPaySet getCompany(Long companyId) { return thirdPartyPaySetRepository.findFirstByCompanyId(companyId); } }
package com.yn.bftl.thirdparty.modules.business.util; import com.yn.bftl.common.modules.configuration.entity.ThirdPartyPaySet; import com.yn.bftl.thirdparty.common.repository.ThirdPartyPaySetRepository; import org.springframework.stereotype.Component; import javax.annotation.Resource; /** * 第三方配置工具类 * * @author huabiao * @create 2023/7/8 15:14 **/ @Component public class ThirdPartyConfigUtil { @Resource private ThirdPartyPaySetRepository thirdPartyPaySetRepository; /*** * 获取第三方平台配置 * * @return ThirdPartyPaySet * @author huabiao * @ 2023/7/8 15:14 */ public ThirdPartyPaySet getPlatform() { return thirdPartyPaySetRepository.findFirstOrderById(); } /** * 获取第三方企业配置 * * @param companyId * @return ThirdPartyPaySet * @author huabiao * @create 2023/7/8 15:15 */ public ThirdPartyPaySet getCompany(Long companyId) { return thirdPartyPaySetRepository.findFirstByCompanyId(companyId); } }
Show line notes below