Commit e84aa41b authored by luzhuang's avatar luzhuang

pdf大小限制150M 页数不限

parent 9c78cddf
......@@ -55,6 +55,31 @@ public class BNotice extends IdEntity<BNotice> {
@Transient
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 {
* @return
*/
public boolean send(BNotice message, String noticeTitle, String type, String urlType) {
log.debug("------------------------------------BNotice->>>"+message+"<<<---------------------------------------------");
log.debug("------------------------------------BNotice->>>"+message.toString()+"<<<---------------------------------------------");
if("dev".equalsIgnoreCase(serverType)) {
return true;
}
......@@ -138,7 +138,6 @@ public class MTNotificationApiRequestClient {
return false;
}
List<String> haveJurisAccountIds = new ArrayList<>();
List<String> getUserAccountList = new ArrayList<>();
List<Long> getUserAccountLongList = (List<Long>)haveJurisList.getData();
getUserAccountLongList.forEach(getUserAccount ->{
......@@ -146,7 +145,9 @@ public class MTNotificationApiRequestClient {
});
MTUserGetsAccountReqDTO mtUserGetsReqDTO = new MTUserGetsAccountReqDTO(message.getCorpId(),getUserAccountList);
log.debug("----------------------通知-调用accountGetUserHead接口----------------------"+mtUserGetsReqDTO);
List<MTAccountIdRspDTO> mtAccountIdRspDTOList = mtCotactApiRequestClient.accountGetUserHead(mtUserGetsReqDTO);
log.debug("----------------------通知-获取用户头像结果----------------------"+mtAccountIdRspDTOList);
mtAccountIdRspDTOList.forEach(mtAccountIdRspDTO -> {
haveJurisAccountIds.add(mtAccountIdRspDTO.getAccountId());
});
......@@ -185,7 +186,7 @@ public class MTNotificationApiRequestClient {
}});
String json = JSON.toJSONString(mtNotificationSendReqDTO);
log.debug(json);
log.debug("----------------------通知-调用sendMessage接口----------------------"+json);
try {
ret = notificationFeignClient.sendMessage(mtNotificationSendReqDTO, "app", noticeAppId);
......
......@@ -124,7 +124,7 @@ public class FileReadableUtil {
}
FileReadableUtil.closeOtherStream(doc);
}
return pages;
return 1;
}
private static Integer docxReadable(String path){
Integer pages ;
......@@ -163,9 +163,16 @@ public class FileReadableUtil {
LogUtil.fileChangeLog("-----------FileReadableUtil-路径------------"+path);
File file = new File(path);
Long size = file.length();
if("pdf".equals(path.substring(path.lastIndexOf(".") + 1))){
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;
......
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