Sfoglia il codice sorgente

feat:渠道绑定查询调整

chenjianhua 1 settimana fa
parent
commit
7003d4de07

+ 9 - 7
service-base/src/main/java/com/simuwang/base/common/util/FileUtil.java

@@ -2,6 +2,7 @@ package com.simuwang.base.common.util;
 
 import cn.hutool.core.exceptions.ExceptionUtil;
 import jakarta.mail.Part;
+import org.apache.commons.io.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -56,14 +57,15 @@ public class FileUtil {
     }
 
     public static void saveFile(File saveFile, Part part) throws Exception {
-        BufferedOutputStream bos = new BufferedOutputStream( new FileOutputStream(saveFile) );
-        byte[] buff = new byte[2048];
+//        BufferedOutputStream bos = new BufferedOutputStream( new FileOutputStream(saveFile) );
+//        byte[] buff = new byte[2048];
         InputStream is = part.getInputStream();
-        int ret = 0;
-        while( (ret = is.read(buff)) > 0 ){
-            bos.write(buff, 0, ret);
-        }
-        bos.close();
+//        int ret = 0;
+//        while( (ret = is.read(buff)) > 0 ){
+//            bos.write(buff, 0, ret);
+//        }
+        FileUtils.copyInputStreamToFile(is, saveFile);
+//        bos.close();
         is.close();
     }
 }

+ 2 - 7
service-base/src/main/resources/mapper/daq/ChannelMapper.xml

@@ -39,20 +39,15 @@
                info.channel_name,
                info.channel_remark
         from channel_info info
-        join user_channel_mapping e
-        on info.id = e.channel_id
-        where info.isvalid=1 and e.isvalid=1
+        where info.isvalid=1
         <if test="userId !=null and userId !=''">
             and e.user_id=#{userId}
         </if>
-        group by info.id,info.channel_name,info.channel_remark
         limit #{offset},#{pageSize}
     </select>
     <select id="countChannelInfo" resultType="java.lang.Long">
         select count(distinct info.id) from channel_info info
-        join user_channel_mapping e
-        on info.id = e.channel_id
-        where info.isvalid=1 and e.isvalid=1
+        where info.isvalid=1
         <if test="userId !=null and userId !=''">
             and e.user_id=#{userId}
         </if>