Browse Source

Merge remote-tracking branch 'origin/master'

zhaoxian 10 months ago
parent
commit
fa2874f39a

+ 3 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java

@@ -71,6 +71,9 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
         queryWrapper.eq("account_id", accountId).orderByDesc("create_time");
         queryWrapper.last("limit 1");
         CtopOauthToken one = this.getOne(queryWrapper);
+        if(Check.isNull(one)){
+            return null;
+        }
         if (one.getMediaId().equals("2") || one.getMediaId().equals("4")) {
             OauthAgentToken tokenByAppId = agentTokenService.getTokenByAppId(one.getAppId());
             if (!Check.isNull(tokenByAppId)) {

+ 3 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/controller/FinancePaymentPoolController.java

@@ -250,6 +250,9 @@ public class FinancePaymentPoolController {
     public Result<Object> queryAccountBalance(Long accountId, String media) {
         try {
             CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(oauthToken)) {
+                return Result.ok(0);
+            }
             if ("1".equals(media)) {
                 JSONObject fundData = byteDanceGetAccountFundService.getAccountFundBy(oauthToken, accountId);
                 if (Check.isNull(fundData)) {

+ 27 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/xml/FinancePaymentPoolMapper.xml

@@ -107,6 +107,7 @@
     </select>
 
     <select id="queryPoolAccountList" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT * from (
         select
         account_id as 'id',
         auth_name as 'name',
@@ -129,6 +130,32 @@
             </when>
         </choose>
         group by account_id
+        union all
+
+        select
+        cast(account_id as char) as 'id',
+        auth_name as 'name',
+        media_id as 'mediaId'
+        from ctop_qianbao_config
+        Where advertiser_id in
+        <foreach item="item" index="index" collection="advertiserIds"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        <if test="projectId != null and projectId != '' ">
+            AND project_id = #{projectId}
+        </if>
+        <choose>
+            <when test="type != 11 ">
+                AND media_id = #{type}
+            </when>
+            <when test="type == 11 ">
+                AND (media_id = 1 or media_id = 2 )
+            </when>
+        </choose>
+        group by account_id
+        ) t GROUP BY t.id
+
     </select>
 
 </mapper>