Commit e84aa41b authored by luzhuang's avatar luzhuang

pdf大小限制150M 页数不限

parent 9c78cddf
...@@ -55,6 +55,31 @@ public class BNotice extends IdEntity<BNotice> { ...@@ -55,6 +55,31 @@ public class BNotice extends IdEntity<BNotice> {
@Transient @Transient
private String userId; private String userId;
@Override
public String toString() {
return "BNotice{" +
"infoType='" + infoType + '\'' +
", infoText='" + infoText + '\'' +
", recipientId='" + recipientId + '\'' +
", senderId='" + senderId + '\'' +
", readFlag='" + readFlag + '\'' +
", queryParam='" + queryParam + '\'' +
", recipientIds=" + recipientIds +
", lessonId='" + lessonId + '\'' +
", headPic='" + headPic + '\'' +
", senderName='" + senderName + '\'' +
", userId='" + userId + '\'' +
", businessId='" + businessId + '\'' +
", token='" + token + '\'' +
", remarks='" + remarks + '\'' +
", createBy='" + createBy + '\'' +
", createDate=" + createDate +
", updateBy='" + updateBy + '\'' +
", updateDate=" + updateDate +
", delFlag='" + delFlag + '\'' +
", flag='" + flag + '\'' +
", corpId='" + corpId + '\'' +
'}';
}
} }
...@@ -85,7 +85,7 @@ public class MTNotificationApiRequestClient { ...@@ -85,7 +85,7 @@ public class MTNotificationApiRequestClient {
* @return * @return
*/ */
public boolean send(BNotice message, String noticeTitle, String type, String urlType) { public boolean send(BNotice message, String noticeTitle, String type, String urlType) {
log.debug("------------------------------------BNotice->>>"+message+"<<<---------------------------------------------"); log.debug("------------------------------------BNotice->>>"+message.toString()+"<<<---------------------------------------------");
if("dev".equalsIgnoreCase(serverType)) { if("dev".equalsIgnoreCase(serverType)) {
return true; return true;
} }
...@@ -138,7 +138,6 @@ public class MTNotificationApiRequestClient { ...@@ -138,7 +138,6 @@ public class MTNotificationApiRequestClient {
return false; return false;
} }
List<String> haveJurisAccountIds = new ArrayList<>(); List<String> haveJurisAccountIds = new ArrayList<>();
List<String> getUserAccountList = new ArrayList<>(); List<String> getUserAccountList = new ArrayList<>();
List<Long> getUserAccountLongList = (List<Long>)haveJurisList.getData(); List<Long> getUserAccountLongList = (List<Long>)haveJurisList.getData();
getUserAccountLongList.forEach(getUserAccount ->{ getUserAccountLongList.forEach(getUserAccount ->{
...@@ -146,7 +145,9 @@ public class MTNotificationApiRequestClient { ...@@ -146,7 +145,9 @@ public class MTNotificationApiRequestClient {
}); });
MTUserGetsAccountReqDTO mtUserGetsReqDTO = new MTUserGetsAccountReqDTO(message.getCorpId(),getUserAccountList); MTUserGetsAccountReqDTO mtUserGetsReqDTO = new MTUserGetsAccountReqDTO(message.getCorpId(),getUserAccountList);
log.debug("----------------------通知-调用accountGetUserHead接口----------------------"+mtUserGetsReqDTO);
List<MTAccountIdRspDTO> mtAccountIdRspDTOList = mtCotactApiRequestClient.accountGetUserHead(mtUserGetsReqDTO); List<MTAccountIdRspDTO> mtAccountIdRspDTOList = mtCotactApiRequestClient.accountGetUserHead(mtUserGetsReqDTO);
log.debug("----------------------通知-获取用户头像结果----------------------"+mtAccountIdRspDTOList);
mtAccountIdRspDTOList.forEach(mtAccountIdRspDTO -> { mtAccountIdRspDTOList.forEach(mtAccountIdRspDTO -> {
haveJurisAccountIds.add(mtAccountIdRspDTO.getAccountId()); haveJurisAccountIds.add(mtAccountIdRspDTO.getAccountId());
}); });
...@@ -185,7 +186,7 @@ public class MTNotificationApiRequestClient { ...@@ -185,7 +186,7 @@ public class MTNotificationApiRequestClient {
}}); }});
String json = JSON.toJSONString(mtNotificationSendReqDTO); String json = JSON.toJSONString(mtNotificationSendReqDTO);
log.debug(json); log.debug("----------------------通知-调用sendMessage接口----------------------"+json);
try { try {
ret = notificationFeignClient.sendMessage(mtNotificationSendReqDTO, "app", noticeAppId); ret = notificationFeignClient.sendMessage(mtNotificationSendReqDTO, "app", noticeAppId);
......
...@@ -124,7 +124,7 @@ public class FileReadableUtil { ...@@ -124,7 +124,7 @@ public class FileReadableUtil {
} }
FileReadableUtil.closeOtherStream(doc); FileReadableUtil.closeOtherStream(doc);
} }
return pages; return 1;
} }
private static Integer docxReadable(String path){ private static Integer docxReadable(String path){
Integer pages ; Integer pages ;
...@@ -163,10 +163,17 @@ public class FileReadableUtil { ...@@ -163,10 +163,17 @@ public class FileReadableUtil {
LogUtil.fileChangeLog("-----------FileReadableUtil-路径------------"+path); LogUtil.fileChangeLog("-----------FileReadableUtil-路径------------"+path);
File file = new File(path); File file = new File(path);
Long size = file.length(); Long size = file.length();
if (size > (long)(1024 * 1024 * fileMaxSize)){ if("pdf".equals(path.substring(path.lastIndexOf(".") + 1))){
throw new ServiceException(400,"该文件超过最大"+fileMaxSize+"M限制"); if (size > (long)(1024 * 1024 * 150)){
throw new ServiceException(400,"该文件超过最大"+150+"M限制");
}
}else{
if (size > (long)(1024 * 1024 * fileMaxSize)){
throw new ServiceException(400,"该文件超过最大"+fileMaxSize+"M限制");
}
} }
Integer pages = -1; Integer pages = -1;
switch (path.substring(path.lastIndexOf(".") + 1)) { switch (path.substring(path.lastIndexOf(".") + 1)) {
......
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