Commit 85d4eb5e by 水库浪子

修改群发相关BUG

1 parent 407f5b4f
...@@ -9,6 +9,7 @@ import com.linkwechat.common.core.domain.FileVo; ...@@ -9,6 +9,7 @@ import com.linkwechat.common.core.domain.FileVo;
import com.linkwechat.common.utils.StringUtils; import com.linkwechat.common.utils.StringUtils;
import com.linkwechat.common.utils.file.FileUploadUtils; import com.linkwechat.common.utils.file.FileUploadUtils;
import com.linkwechat.common.utils.file.FileUtils; import com.linkwechat.common.utils.file.FileUtils;
import com.linkwechat.common.utils.file.MimeTypeUtils;
import com.linkwechat.framework.web.domain.server.SysFile; import com.linkwechat.framework.web.domain.server.SysFile;
import com.linkwechat.framework.web.service.FileService; import com.linkwechat.framework.web.service.FileService;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -120,8 +121,9 @@ public class CommonController { ...@@ -120,8 +121,9 @@ public class CommonController {
* 通用上传请求 * 通用上传请求
*/ */
@PostMapping("/common/uploadFile2Cos") @PostMapping("/common/uploadFile2Cos")
public AjaxResult uploadFile2Cos(MultipartFile file) throws Exception { public AjaxResult uploadFile2Cos(MultipartFile file){
try { try {
SysFile sysFile SysFile sysFile
= fileService.upload(file); = fileService.upload(file);
return AjaxResult.success( return AjaxResult.success(
...@@ -131,7 +133,7 @@ public class CommonController { ...@@ -131,7 +133,7 @@ public class CommonController {
.build() .build()
); );
} catch (Exception e) { } catch (Exception e) {
return AjaxResult.error(e.getMessage()); return AjaxResult.error("不支持当前文件上传或文件过大建议传20MB以内的文件");
} }
} }
......
...@@ -6,6 +6,7 @@ import com.linkwechat.common.config.RuoYiConfig; ...@@ -6,6 +6,7 @@ import com.linkwechat.common.config.RuoYiConfig;
import com.linkwechat.common.utils.OsUtils; import com.linkwechat.common.utils.OsUtils;
import com.linkwechat.common.utils.file.FileUploadUtils; import com.linkwechat.common.utils.file.FileUploadUtils;
import com.linkwechat.common.utils.file.FileUtils; import com.linkwechat.common.utils.file.FileUtils;
import com.linkwechat.common.utils.file.MimeTypeUtils;
import com.linkwechat.framework.web.domain.server.SysFile; import com.linkwechat.framework.web.domain.server.SysFile;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -42,7 +43,10 @@ public class FileService { ...@@ -42,7 +43,10 @@ public class FileService {
* @return * @return
* @throws IOException * @throws IOException
*/ */
public SysFile upload(MultipartFile file) throws IOException { public SysFile upload(MultipartFile file) throws Exception {
try {
FileUploadUtils.assertAllowed(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
String fileName=""; String fileName="";
String imgUrlPrefix=""; String imgUrlPrefix="";
if(ruoYiConfig.getFile().isStartCosUpload()){//开启云上传 if(ruoYiConfig.getFile().isStartCosUpload()){//开启云上传
...@@ -61,6 +65,13 @@ public class FileService { ...@@ -61,6 +65,13 @@ public class FileService {
.fileName(fileName) .fileName(fileName)
.imgUrlPrefix(imgUrlPrefix) .imgUrlPrefix(imgUrlPrefix)
.build(); .build();
}catch (Exception e){
throw e;
}
} }
......
...@@ -288,6 +288,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -288,6 +288,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null and userId !=''"> <if test="userId != null and userId !=''">
AND wfcr.user_id=#{userId} AND wfcr.user_id=#{userId}
</if> </if>
ORDER BY wfcr.create_time ASC limit 1
</select> </select>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
wcm.chat_type, wcm.chat_type,
wcm.setting_time, wcm.setting_time,
wcm.expect_send, wcm.expect_send,
wcm.actual_send, (SELECT count(*) FROM `we_customer_messgaeResult` wcmr where wcmr.message_id=wcm.message_id and `status`=1) as actual_send,
wcm.timed_task, wcm.timed_task,
wcm.msgid, wcm.msgid,
wcm.check_status wcm.check_status
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!