Commit 17c3b0e8 by chentianzhong

1111

parent 4a359871
......@@ -9,6 +9,8 @@ import cn.hutool.core.util.*;
import cn.hutool.extra.servlet.ServletUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.zq.common.annotation.AnonymousAccess;
import com.zq.common.annotation.rest.AnonymousGetMapping;
import com.zq.common.utils.AssertUtils;
......@@ -75,24 +77,28 @@ public class EmailAttachController {
@ApiOperation("前端调用下载前,判断文件是否是否可以下载")
@AnonymousGetMapping("/preDownload/{id}")
public ResultVo preDownload(HttpServletRequest request, HttpServletResponse response, @PathVariable("id") Long id) {
EmailAttach emailAttach = emailAttachService.getById(id);
AssertUtils.notNull(emailAttach, "获取附件信息失败");
byte[] bytes = null;
if (StrUtil.isNotBlank(emailAttach.getDownloadPath())){
bytes = emailAttachService.downloadNewOaFileByte(emailAttach);
}else{
bytes = emailAttachService.downloadFileByte1(emailAttach);
if (bytes == null){
bytes = emailAttachService.downloadFileByte2(emailAttach);
}
}
String download = emailAttachService.getDownloadPath(emailAttach);
AssertUtils.hasText(download, "下载地址为空");
log.info("下载文件地址:" + download);
try {
byte[] bytes = HttpUtil.downloadBytes(download);
AssertUtils.isTrue(ArrayUtil.isNotEmpty(bytes), "下载文件失败,文件为空");
return ResultVo.success();
} catch (Exception e) {
log.error("下载文件失败:" + e.getLocalizedMessage(), e);
if (profile.contains("wan")) {
return ResultVo.fail("文件可能超过安全时间,禁止从外网访问下载,请从内网查看下载");
} else {
if (bytes == null){
if (profile.contains("wan")){
return ResultVo.fail("文件超过安全时间,禁止从外网访问下载");
}else{
return ResultVo.fail("下载文件失败,文件可能不存在");
}
}
return ResultVo.success();
}
@ApiOperation("pc统一下载附件和移动端旧附件下载")
......@@ -100,23 +106,44 @@ public class EmailAttachController {
public void download(HttpServletRequest request, HttpServletResponse response, @PathVariable("id") Long id) {
EmailAttach emailAttach = emailAttachService.getById(id);
AssertUtils.notNull(emailAttach, "获取附件信息失败");
byte[] bytes = null;
String download = emailAttachService.getDownloadPath(emailAttach);
AssertUtils.hasText(download, "下载地址为空");
log.info("下载文件地址:" +download);
try {
byte[] bytes = HttpUtil.downloadBytes(download);
response.setHeader("Content-Disposition", "attachment;filename*=UTF-8''" + URLEncoder.encode(emailAttach.getAttachName(),"UTF-8"));
response.setCharacterEncoding("UTF-8");
//ServletUtil.write(response, IoUtil.toStream(bytes),"application/octet-stream");
ServletUtil.write(response, IoUtil.toStream(bytes), FileUtil.getMimeType(emailAttach.getAttachName())!=null?FileUtil.getMimeType(emailAttach.getAttachName()):"application/octet-stream");
if (StrUtil.isNotBlank(emailAttach.getDownloadPath())){
bytes = emailAttachService.downloadNewOaFileByte(emailAttach);
}else{
bytes = emailAttachService.downloadFileByte1(emailAttach);
if (bytes == null){
bytes = emailAttachService.downloadFileByte2(emailAttach);
}
}
if (bytes!=null){
response.setHeader("Content-Disposition", "attachment;filename*=UTF-8''" + URLEncoder.encode(emailAttach.getAttachName(),"UTF-8"));
response.setCharacterEncoding("UTF-8");
//ServletUtil.write(response, IoUtil.toStream(bytes),"application/octet-stream");
ServletUtil.write(response,
IoUtil.toStream(bytes),
FileUtil.getMimeType(emailAttach.getAttachName())!=null?FileUtil.getMimeType(emailAttach.getAttachName()):"application/octet-stream");
}else{
if (profile.contains("wan")){
AssertUtils.isTrue(false, "文件超过安全时间,禁止从外网访问下载");
}else{
AssertUtils.isTrue(false, "下载文件失败,文件可能不存在");
}
//ServletUtil.write(response, JSON.toJSONString(fail, SerializerFeature.WriteMapNullValue), "application/json;charset=utf-8");
}
} catch (Exception e) {
log.error("下载文件失败:" + e.getLocalizedMessage(), e);
log.error(e.getLocalizedMessage(), e);
if (profile.contains("wan")){
AssertUtils.isTrue(false, "文件超过安全时间,禁止从外网访问下载");
}else{
AssertUtils.isTrue(false, "下载文件失败,文件可能不存在");
}
//ServletUtil.write(response, JSON.toJSONString(ResultVo.fail("下载文件失败:未知异常"), SerializerFeature.WriteMapNullValue), "application/json;charset=utf-8");
}
}
......
......@@ -12,6 +12,7 @@ import com.zq.email.enums.SearchRangeEnum;
import com.zq.email.enums.WhetherEnum;
import com.zq.email.service.IEmailContentService;
import com.zq.email.service.IEmailPersonService;
import com.zq.email.utils.DateUtils;
import com.zq.email.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -22,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import javax.mail.internet.MimeMessage;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.List;
/**
......@@ -53,6 +55,11 @@ public class EmailController {
public ResultVo total(@RequestBody EmailReqVo vo) {
AssertUtils.notNull(vo.getSearchRange(), "缺少参数:searchRange");
AssertUtils.notNull(vo.getFolderId(), "缺少参数:folderId");
if (vo.getSearchStartTime() ==null && vo.getSearchStopTime()==null){
vo.setSearchStartTime(DateUtils.getRangeStart(0));
vo.setSearchStopTime(LocalDateTime.now());
}
return ResultVo.success(emailPersonService.emailCount(vo));
}
......@@ -61,6 +68,12 @@ public class EmailController {
public ResultVo page(@RequestBody EmailReqVo vo) {
AssertUtils.notNull(vo.getSearchRange(), "缺少参数:searchRange");
AssertUtils.notNull(vo.getFolderId(), "缺少参数:folderId");
if (vo.getSearchStartTime() ==null && vo.getSearchStopTime()==null){
vo.setSearchStartTime(DateUtils.getRangeStart(0));
vo.setSearchStopTime(LocalDateTime.now());
}
return ResultVo.success(emailPersonService.emailPage(vo));
}
......
......@@ -45,6 +45,9 @@ public class EmailContent implements Serializable {
@TableField(exist = false)
private String sendUserPhoto;
@TableField(exist = false)
private String sendUserDeptName;
private String sendUserName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
......
......@@ -71,6 +71,9 @@ public interface AdminFeignClient {
ResultVo<CustomerUserVo> getBypCode(@PathVariable String pCode);
@AnonymousGetMapping("/dept/getDeptWholeName/{deptId}")
public ResultVo<String> getDeptWholeName(@PathVariable("deptId") Long deptId);
......
......@@ -84,6 +84,11 @@ public class AdminFeignFallbackFactory implements FallbackFactory<AdminFeignClie
return ResultVo.fail("admin服务调用异常-->get> getBypCode异常");
}
@Override
public ResultVo<String> getDeptWholeName(Long deptId) {
return ResultVo.fail("admin服务调用异常-->get> getDeptWholeName");
}
};
}
......
......@@ -29,6 +29,18 @@ public interface IEmailAttachService extends IService<EmailAttach> {
String getWpsPreviewUrl(Long id);
String getDownloadPath2(Long id);
String getDownloadPath2(EmailAttach emailAttach);
String getWpsPreviewUrl2(Long id);
byte[] downloadFileByte1(EmailAttach emailAttach);
byte[] downloadFileByte2(EmailAttach emailAttach);
byte[] downloadNewOaFileByte(EmailAttach emailAttach);
void updateAttachByContentId(EmailContent emailContent, List<Long> fileIds);
void addAttachByContentId(EmailContent emailContent, List<MultipartFile> fileList);
......
......@@ -2,11 +2,14 @@ package com.zq.email.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.file.FileNameUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zq.common.utils.AssertUtils;
import com.zq.common.utils.TokenUtils;
import com.zq.common.vo.*;
......@@ -21,6 +24,8 @@ import com.zq.email.vo.EmailEditVo;
import com.zq.email.vo.FileViewVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
......@@ -54,29 +59,49 @@ public class EmailAttachServiceImpl extends ServiceImpl<EmailAttachMapper, Email
if(CollectionUtil.isNotEmpty(vo.getFileIds())) {
//拿到旧附件
//list = this.lambdaQuery().eq(EmailAttach::getEmailContentId, content.getId()).in(EmailAttach::getAttachId, vo.getFileIds()).list();
//list = this.lambdaQuery().in(EmailAttach::getAttachId, vo.getFileIds()).list();
for (String fileId : vo.getFileIds()) {
ResultVo<SysFileUploadVo> uploadFileById = fileFeignClient.copyFile(fileId, EmailConstant.SYSTEM_TAG);
//ResultVo<SysFileUploadVo> uploadFileById = fileFeignClient.getUploadFileById(fileId);
if (uploadFileById.isSuccess() && uploadFileById.getData()!=null){
SysFileUploadVo data = uploadFileById.getData();
EmailAttach emailAttach = EmailAttach.builder()
.emailContentId(content.getId())
.attachId(data.getId())
.attachName(data.getFileName())
.attachSize(data.getSize())
.downloadPath(data.getDownloadPath())
.sendTime(content.getSendTime())
.build();
list.add(emailAttach);
//先判断是不是旧附件
LambdaQueryWrapper<EmailAttach> eq = Wrappers.lambdaQuery(EmailAttach.class)
.eq(EmailAttach::getAttachId, fileId);
EmailAttach emailAttach = this.getOne(eq, false);
if (emailAttach!=null){
if (StrUtil.isNotBlank(emailAttach.getDownloadPath())){
ResultVo<SysFileUploadVo> uploadFileById = fileFeignClient.copyFile(fileId, EmailConstant.SYSTEM_TAG);
//ResultVo<SysFileUploadVo> uploadFileById = fileFeignClient.getUploadFileById(fileId);
if (uploadFileById.isSuccess() && uploadFileById.getData()!=null){
SysFileUploadVo data = uploadFileById.getData();
EmailAttach newAttach = EmailAttach.builder()
.emailContentId(content.getId())
.attachId(data.getId())
.attachName(data.getFileName())
.attachSize(data.getSize())
.downloadPath(data.getDownloadPath())
.sendTime(content.getSendTime())
.build();
list.add(newAttach);
}
}else{
EmailAttach newAttach = EmailAttach.builder()
.emailContentId(content.getId())
.attachId(emailAttach.getAttachId())
.attachName(emailAttach.getAttachName())
//.attachSize(emailAttach.getAttachSize())
//.downloadPath(emailAttach.getDownloadPath())
.sendTime(emailAttach.getSendTime())
.build();
list.add(newAttach);
}
}
}
}
//先检查旧附件
this.lambdaUpdate().eq(EmailAttach::getEmailContentId, content.getId()).remove();
if(CollectionUtil.isNotEmpty(vo.getFileList())) {
ResultVo<UploadFileListRespVo> uploadFileListRespVoResultVo = fileFeignClient.uploadFileList(vo.getFileList().toArray(new MultipartFile[vo.getFileList().size()]),
EmailConstant.SYSTEM_TAG,
......@@ -108,10 +133,17 @@ public class EmailAttachServiceImpl extends ServiceImpl<EmailAttachMapper, Email
List<EmailAttach> attaches = new ArrayList<>();
List<EmailAttach> list = this.lambdaQuery().eq(EmailAttach::getEmailContentId, contentId).orderByAsc(EmailAttach::getId).list();
for (EmailAttach attach : list) {
String download = attach.getDownloadPath();
if (StrUtil.isNotBlank(download) && profile.contains("wan")){
attach.setDownloadPath(download.replaceAll("147.2.3.3", "172.28.1.71"));
}
String downloadPath = getDownloadPath(attach);
attach.setDownloadPath(downloadPath);
// String download = attach.getDownloadPath();
// if (StrUtil.isNotBlank(download)){
// if(profile.contains("wan")) {
// attach.setDownloadPath(download.replaceAll("147.2.3.3", "172.28.1.71"));
// }
// }else{
// attach.setDownloadPath();
//
// }
attaches.add(attach);
}
return attaches;
......@@ -174,6 +206,7 @@ public class EmailAttachServiceImpl extends ServiceImpl<EmailAttachMapper, Email
AssertUtils.notNull(emailAttach, "获取附件信息失败");
AssertUtils.hasText(emailAttach.getAttachName(), "附件名称为空");
String downloadPath = this.getDownloadPath(emailAttach);
String suffix = emailAttach.getAttachName().substring(emailAttach.getAttachName().lastIndexOf(".") + 1);
AssertUtils.hasText(suffix, "错误的文件名称("+emailAttach.getAttachName()+"),导致获取文件类型失败");
......@@ -199,6 +232,92 @@ public class EmailAttachServiceImpl extends ServiceImpl<EmailAttachMapper, Email
}
@Override
public String getDownloadPath2(Long id) {
return null;
}
@Override
public String getDownloadPath2(EmailAttach emailAttach) {
String download = emailAttach.getDownloadPath();
if (StrUtil.isBlank(download)){
String year = DateUtil.format(emailAttach.getSendTime(), "yyyy");
String yearMonth = DateUtil.format(emailAttach.getSendTime(), "yyyyMM");
String yearMonthDate = DateUtil.format(emailAttach.getSendTime(), "yyyyMMdd");
String path = "/" + year + "/" + yearMonth + "/" + yearMonthDate + "/" + emailAttach.getAttachId() + "/" + emailAttach.getAttachId()+"."+FileNameUtil.getSuffix(emailAttach.getAttachName());
if (profile.equals("product") || profile.equals("test")) {
download = "http://147.1.3.87/attwjsf_email" + path;
}else if (profile.equals("wanpro") || profile.equals("wantest")){
download = "http://172.28.1.159:82/attwjsf_yj" + path;
}
}else{
if (profile.equals("wanpro") || profile.equals("wantest")) {
download = download.replaceAll("147.2.3.3", "172.28.1.71");
}else{
download = download.replaceAll("172.28.1.71", "147.2.3.3");
}
}
return download;
}
@Override
public String getWpsPreviewUrl2(Long id) {
return null;
}
@Override
public byte[] downloadFileByte1(EmailAttach emailAttach) {
byte[] bytes = null;
String downloadPath = "";
try {
downloadPath = this.getDownloadPath(emailAttach);
bytes = HttpUtil.downloadBytes(downloadPath);
}catch (Exception e){
log.error(">>>> 1.使用文件名下载文件失败【下载地址:{}, 错误信息:{}", downloadPath, e.getLocalizedMessage());
log.error(e.getLocalizedMessage(), e);
bytes = null;
}
return bytes;
}
@Override
public byte[] downloadFileByte2(EmailAttach emailAttach) {
byte[] bytes = null;
String downloadPath = "";
try {
downloadPath = this.getDownloadPath2(emailAttach);
bytes = HttpUtil.downloadBytes(downloadPath);
}catch (Exception e){
log.error(">>>> 2.使用attachId下载文件失败【下载地址:{}, 错误信息:{}", downloadPath, e.getLocalizedMessage());
log.error(e.getLocalizedMessage(), e);
bytes = null;
}
return bytes;
}
@Override
public byte[] downloadNewOaFileByte(EmailAttach emailAttach) {
String download = emailAttach.getDownloadPath();
byte[] bytes = null;
if (profile.equals("wanpro") || profile.equals("wantest")) {
download = download.replaceAll("147.2.3.3", "172.28.1.71");
}else{
download = download.replaceAll("172.28.1.71", "147.2.3.3");
}
try {
bytes = HttpUtil.downloadBytes(download);
}catch (Exception e){
log.error(">>>> 3.新OA下载文件失败【下载地址:{}, 错误信息:{}", download, e.getLocalizedMessage());
log.error(e.getLocalizedMessage(), e);
bytes = null;
}
return bytes;
}
@Override
public void updateAttachByContentId(EmailContent emailContent, List<Long> fileIds) {
List<EmailAttach> attaches = this.findByContentId(emailContent.getId());
List<Long> attacheIds = attaches.stream().map(e -> e.getId()).collect(Collectors.toList());
......@@ -210,6 +329,7 @@ public class EmailAttachServiceImpl extends ServiceImpl<EmailAttachMapper, Email
public void addAttachByContentId(EmailContent emailContent, List<MultipartFile> fileList) {
Long adminId = TokenUtils.getAdminId();
AssertUtils.notNull(adminId, "登录信息异常");
ResultVo<UploadFileListRespVo> uploadFileListRespVoResultVo = fileFeignClient.uploadFileList(fileList.toArray(new MultipartFile[fileList.size()]),
EmailConstant.SYSTEM_TAG,
adminId,
......
......@@ -83,13 +83,9 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
.eq(vo.getPersonType()!=null, EmailPerson::getPersonType, vo.getPersonType())
.eq(vo.getIsPerson()!=null, EmailPerson::getIsPerson, vo.getIsPerson())
.eq(vo.getIsRead()!=null, EmailPerson::getIsRead, vo.getIsRead())
.eq(vo.getIsSend()!=null, EmailPerson::getIsSend, vo.getIsSend());
if (DateUtils.getRangeStart(vo.getSearchRange()) !=null){
queryWrapper.ge(EmailPerson::getSendTime, DateUtils.getRangeStart(vo.getSearchRange()));
queryWrapper.le(EmailPerson::getSendTime, LocalDateTime.now());
}
.eq(vo.getIsSend()!=null, EmailPerson::getIsSend, vo.getIsSend())
.ge(vo.getSearchStartTime()!=null, EmailPerson::getSendTime, vo.getSearchStartTime())
.le(vo.getSearchStopTime()!=null, EmailPerson::getSendTime, vo.getSearchStopTime());
Integer count = this.count(queryWrapper);
return count!=null?count:0;
}
......@@ -108,13 +104,18 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
.eq(vo.getPersonType()!=null, EmailPerson::getPersonType, vo.getPersonType())
.eq(vo.getIsPerson()!=null, EmailPerson::getIsPerson, vo.getIsPerson())
.eq(vo.getIsRead()!=null, EmailPerson::getIsRead, vo.getIsRead())
.eq(vo.getIsSend()!=null, EmailPerson::getIsSend, vo.getIsSend());
.eq(vo.getIsSend()!=null, EmailPerson::getIsSend, vo.getIsSend())
.ge(vo.getSearchStartTime()!=null, EmailPerson::getSendTime, vo.getSearchStartTime())
.le(vo.getSearchStopTime()!=null, EmailPerson::getSendTime, vo.getSearchStopTime());
// if (DateUtils.getRangeStart(vo.getSearchRange()) !=null){
// queryWrapper.ge(EmailPerson::getSendTime, DateUtils.getRangeStart(vo.getSearchRange()));
// queryWrapper.le(EmailPerson::getSendTime, LocalDateTime.now());
// }
if (DateUtils.getRangeStart(vo.getSearchRange()) !=null){
queryWrapper.ge(EmailPerson::getSendTime, DateUtils.getRangeStart(vo.getSearchRange()));
queryWrapper.le(EmailPerson::getSendTime, LocalDateTime.now());
}
//queryWrapper.orderByAsc(EmailPerson::getIsRead).orderByDesc(EmailPerson::getSendTime);
queryWrapper.orderByDesc(EmailPerson::getSendTime); //.orderByAsc(EmailPerson::getIsRead);
......@@ -134,17 +135,19 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
ResultVo<UserDto> senderVo = adminFeignClient.findById(content.getSendUserId());
if (senderVo.isSuccess() && senderVo.getData() !=null){
UserDto data = senderVo.getData();
UserDto userDto = new UserDto();
if (profile.contains("wan")) {
if (StrUtil.isNotBlank(data.getPhoto())){
String replace = data.getPhoto()
.replace("http://147.1.3.87", "http://172.28.1.159:82")
.replace("http://147.2.3.3", "http://172.28.1.71");
content.setSendUserPhoto(replace);
}
}else{
content.setSendUserPhoto(data.getPhoto());
}
ResultVo<String> deptWholeName = adminFeignClient.getDeptWholeName(data.getDept().getId());
content.setSendUserDeptName(deptWholeName.getData());
}
}
record.setEmailContent(content);
......@@ -170,6 +173,8 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
vo.setIsSend(WhetherEnum.YES.getKey());
Page<EmailPerson> page = new Page<>(vo.getPage(), vo.getSize());
page.setSearchCount(false).setOptimizeCountSql(false);
page = this.baseMapper.selectSearchPage(page, vo);
if (page!=null && page.getRecords()!=null){
for (EmailPerson person : page.getRecords()) {
......@@ -842,7 +847,10 @@ public class EmailPersonServiceImpl extends ServiceImpl<EmailPersonMapper, Email
content.setSendUserPhoto(data.getPhoto());
//userDto.setPhoto(data.getPhoto());
}
ResultVo<String> deptWholeName = adminFeignClient.getDeptWholeName(data.getDept().getId());
content.setSendUserDeptName(deptWholeName.getData());
}
}
person.setEmailContent(content);
}
......
package com.zq.email.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sun.org.apache.xpath.internal.operations.Bool;
import com.zq.common.vo.PageReqVo;
import com.zq.email.constants.EmailConstant;
......@@ -10,7 +11,9 @@ import com.zq.email.enums.WhetherEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
......@@ -81,4 +84,15 @@ public class EmailReqVo extends PageReqVo {
@ApiModelProperty("发送人Id,邮件管理查询用。")
private Long sendUserId;
@ApiModelProperty("查询开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime searchStartTime;
@ApiModelProperty("查询结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime searchStopTime;
}
......@@ -3,7 +3,7 @@ spring:
datasource:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: ${jdbc.driver-class-name}
driverClassName: ${jdbc.db1.driver-class-name}
username: ${jdbc.db1.username}
password: ${jdbc.db1.password}
url: ${jdbc.db1.base-url}/EMAIL
......
......@@ -3,10 +3,10 @@ spring:
datasource:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: ${jdbc.driver-class-name}
driverClassName: ${jdbc.db1.driver-class-name}
username: ${jdbc.db1.username}
password: ${jdbc.db1.password}
url: ${jdbc.db1.base-url}/EMAIL_NEW?ConfigurePath=/opt/db-config/EMAIL/jdbc_new.conf
url: ${jdbc.db1.base-url}/EMAIL_NEW?${jdbc.db1.params}
# 初始连接数
initial-size: 5
# 最小连接数
......
......@@ -3,7 +3,7 @@ spring:
datasource:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: ${jdbc.driver-class-name}
driverClassName: ${jdbc.db1.driver-class-name}
username: ${jdbc.db1.username}
password: ${jdbc.db1.password}
url: ${jdbc.db1.base-url}/EMAIL_NEW
......
server:
port: 8198
max-http-header-size: 4048576
#配置数据源
spring:
application:
......
......@@ -2,7 +2,7 @@
<configuration>
<contextName>logback</contextName>
<property name="log.path" value="/data/logs/${LOG_PATH:-${PROJECT_NAME}}"/>
<property name="log.path" value="/data/logs/email"/>
<!--主要日志文件名-->
<property name="default_log_file" value="email"/>
<!-- 彩色日志依赖的渲染类 -->
......
......@@ -4,7 +4,14 @@
<select id="selectSearchTotal" resultType="integer" parameterType="com.zq.email.vo.EmailSearchReqVo">
SELECT
COUNT(1)
count(*)
FROM
"EMAIL_PERSON" EP1
WHERE
EP1."ID" IN
(
SELECT
EP."ID"
FROM
"EMAIL_PERSON" EP
<where>
......@@ -49,7 +56,6 @@
)
</if>
<!-- 其他文件夹,发件人、标题、内容 -->
<if test="s.sendUserId != null or (s.title!=null and s.title!='') or (s.content!=null and s.content!='')">
AND EP."EMAIL_CONTENT_ID" IN(
SELECT
......@@ -71,7 +77,7 @@
</where>
)
</if>
<!-- 附件名称-->
<if test="s.attachName!=null and s.attachName!=''">
AND EP."EMAIL_CONTENT_ID" IN(
SELECT
......@@ -83,7 +89,8 @@
)
</if>
</where>
GROUP BY EP.id
GROUP BY EP."ID"
)
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment