公告结构化
This commit is contained in:
@ -0,0 +1,45 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.wps.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class KingSoftWpsPreviewVo {
|
||||||
|
/**
|
||||||
|
* 前端 host
|
||||||
|
*/
|
||||||
|
private String srcWpsNgProxy;
|
||||||
|
/**
|
||||||
|
* 当前编辑用户工号
|
||||||
|
*/
|
||||||
|
private String staffCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件唯一标识
|
||||||
|
*/
|
||||||
|
private String fileKey;
|
||||||
|
/**
|
||||||
|
* 文件名
|
||||||
|
*/
|
||||||
|
private String fileName;
|
||||||
|
/**
|
||||||
|
* 文件下载URL
|
||||||
|
*/
|
||||||
|
private String fileUrl;
|
||||||
|
/**
|
||||||
|
* 文件大小
|
||||||
|
*/
|
||||||
|
private Integer fileSize;
|
||||||
|
/**
|
||||||
|
* 文件创建者工号
|
||||||
|
*/
|
||||||
|
private String fileCreator;
|
||||||
|
/**
|
||||||
|
* 文件创建时间;yyyy-MM-dd HH:mm:ss
|
||||||
|
*/
|
||||||
|
private String fileCreateTime;
|
||||||
|
/**
|
||||||
|
* 文件最近一次修改时间;yyyy-MM-dd HH:mm:ss
|
||||||
|
*/
|
||||||
|
private String fileLastModifiedTime;
|
||||||
|
|
||||||
|
}
|
@ -24,6 +24,7 @@ import com.chinaunicom.mall.ebtp.extend.feign.client.UnicomOAuthClient;
|
|||||||
import com.chinaunicom.mall.ebtp.extend.shortmessage.utils.RSA;
|
import com.chinaunicom.mall.ebtp.extend.shortmessage.utils.RSA;
|
||||||
import com.chinaunicom.mall.ebtp.extend.uniBss.UniBssUtil;
|
import com.chinaunicom.mall.ebtp.extend.uniBss.UniBssUtil;
|
||||||
import com.chinaunicom.mall.ebtp.extend.wps.entity.KingSoftFileSaveVo;
|
import com.chinaunicom.mall.ebtp.extend.wps.entity.KingSoftFileSaveVo;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.wps.entity.KingSoftWpsPreviewVo;
|
||||||
import com.chinaunicom.mall.ebtp.extend.wps.entity.KingSoftWpsRet;
|
import com.chinaunicom.mall.ebtp.extend.wps.entity.KingSoftWpsRet;
|
||||||
import com.chinaunicom.mall.ebtp.extend.wps.entity.KingSoftWpsVo;
|
import com.chinaunicom.mall.ebtp.extend.wps.entity.KingSoftWpsVo;
|
||||||
import com.chinaunicom.mall.ebtp.extend.wps.enums.WpsExceptionEnum;
|
import com.chinaunicom.mall.ebtp.extend.wps.enums.WpsExceptionEnum;
|
||||||
@ -501,42 +502,62 @@ public class WpsServiceImpl implements WpsService {
|
|||||||
@Override
|
@Override
|
||||||
public String getKSWpsUrl(WpsClientInVo in){
|
public String getKSWpsUrl(WpsClientInVo in){
|
||||||
|
|
||||||
KingSoftWpsVo vo = new KingSoftWpsVo();
|
String url = "";
|
||||||
vo.setSrcId(7);
|
String dataJson = "";
|
||||||
vo.setStaffCode("ebtp");
|
String callBackUrl = "";
|
||||||
vo.setFileKey(in.getFileId());
|
byte[] b = getFileByFileId(in.getFileId());
|
||||||
String fileName = in.getFileName();
|
String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
vo.setFileName(fileName);
|
|
||||||
vo.setFileExtension(fileName.substring(fileName.lastIndexOf(".")+1,fileName.length()));
|
|
||||||
vo.setVersion(1);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String url = kswdownloadUrl+"?key="+URLEncoder.encode(getDownloadEncrypt(in.getFileId(),in.getUserToken()), "utf-8");
|
callBackUrl = kswdownloadUrl+"?key="+URLEncoder.encode(getDownloadEncrypt(in.getFileId(),in.getUserToken()), "utf-8");
|
||||||
vo.setDownloadUrl(url);
|
|
||||||
}catch (UnsupportedEncodingException e){
|
}catch (UnsupportedEncodingException e){
|
||||||
log.error("url转换失败",e);
|
log.error("url转换失败",e);
|
||||||
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("url获取失败", true);
|
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("url获取失败", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] b = getFileByFileId(in.getFileId());
|
|
||||||
vo.setSize(b.length);
|
|
||||||
vo.setCreator("ebtp");
|
|
||||||
vo.setModifier("ebtp");
|
|
||||||
String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
||||||
vo.setCreateTime(time);
|
|
||||||
|
|
||||||
//HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
|
||||||
|
|
||||||
vo.setHost(kswhost);
|
|
||||||
|
|
||||||
vo.setLastModifiedTime(time);
|
|
||||||
String url = "";
|
|
||||||
if("9527007".equals(in.getType())){
|
if("9527007".equals(in.getType())){
|
||||||
|
|
||||||
url = kswpsurl;
|
url = kswpsurl;
|
||||||
|
|
||||||
|
KingSoftWpsVo vo = new KingSoftWpsVo();
|
||||||
|
vo.setSrcId(7);
|
||||||
|
vo.setStaffCode("ebtp");
|
||||||
|
vo.setFileKey(in.getFileId());
|
||||||
|
String fileName = in.getFileName();
|
||||||
|
vo.setFileName(fileName);
|
||||||
|
vo.setFileExtension(fileName.substring(fileName.lastIndexOf(".")+1,fileName.length()));
|
||||||
|
vo.setVersion(1);
|
||||||
|
vo.setDownloadUrl(callBackUrl);
|
||||||
|
|
||||||
|
vo.setSize(b.length);
|
||||||
|
vo.setCreator("ebtp");
|
||||||
|
vo.setModifier("ebtp");
|
||||||
|
|
||||||
|
vo.setCreateTime(time);
|
||||||
|
|
||||||
|
//HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
||||||
|
|
||||||
|
vo.setHost(kswhost);
|
||||||
|
vo.setLastModifiedTime(time);
|
||||||
|
|
||||||
|
dataJson = JSON.toJSONString(vo);
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
url = kswpsurl_preview;
|
url = kswpsurl_preview;
|
||||||
|
|
||||||
|
KingSoftWpsPreviewVo vo = new KingSoftWpsPreviewVo();
|
||||||
|
vo.setSrcWpsNgProxy(kswhost);
|
||||||
|
vo.setStaffCode("ebtp");
|
||||||
|
vo.setFileKey(in.getFileId());
|
||||||
|
vo.setFileName(in.getFileName());
|
||||||
|
vo.setFileUrl(callBackUrl);
|
||||||
|
vo.setFileSize(b.length);
|
||||||
|
vo.setFileCreator("ebtp");
|
||||||
|
vo.setFileCreateTime(time);
|
||||||
|
vo.setFileLastModifiedTime(time);
|
||||||
|
|
||||||
|
dataJson = JSON.toJSONString(vo);
|
||||||
}
|
}
|
||||||
String retJson = HttpsUtils.UrlPost(url, "utf-8", JSON.toJSONString(vo));//httpPost(kswpsurl,json);
|
String retJson = HttpsUtils.UrlPost(url, "utf-8", dataJson);//httpPost(kswpsurl,json);
|
||||||
log.info("ret:"+retJson);
|
log.info("ret:"+retJson);
|
||||||
//String retJson = HttpUtils.httpPost(kswpsurl,json);
|
//String retJson = HttpUtils.httpPost(kswpsurl,json);
|
||||||
|
|
||||||
|
@ -30,4 +30,9 @@ public class WpsClientInVo {
|
|||||||
*0 查看 9527007 编辑
|
*0 查看 9527007 编辑
|
||||||
*/
|
*/
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件后缀 初次编辑需要传 doc docx xls ...
|
||||||
|
*/
|
||||||
|
private String fileExtension;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user