style: 在线编辑代码整理
This commit is contained in:
+107
-85
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.onlyoffice.controller;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -12,6 +13,7 @@ import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.onlyoffice.entity.BusProcessModelHis;
|
||||
import com.jero.modules.onlyoffice.entity.OnlineFileLog;
|
||||
import com.jero.modules.onlyoffice.mapper.BusProcessModelHisMapper;
|
||||
import com.jero.modules.onlyoffice.mapper.OnlineFileLogDao;
|
||||
import com.jero.modules.onlyoffice.service.IBusProcessModelHisService;
|
||||
import com.jero.modules.onlyoffice.service.LawsUserInfoService;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
@@ -21,7 +23,6 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -33,51 +34,55 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Scanner;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* onlyoffice前端控制器
|
||||
* </p>
|
||||
*/
|
||||
@Api(tags="onlyoffice操作")
|
||||
@Api(tags = "onlyOffice操作")
|
||||
@RestController
|
||||
@RequestMapping("/onlyoffice")
|
||||
public class OnlyofficeController {
|
||||
@RequestMapping("/onlyOffice")
|
||||
public class OnlyOfficeController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(OnlyofficeController.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(OnlyOfficeController.class);
|
||||
|
||||
@Value("${file.path}")
|
||||
private String standEditFilePath;//文件存储路径
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private IBusProcessModelHisService busProcessModelHisService;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private LawsUserInfoService lawsUserInfoService;
|
||||
|
||||
@Resource
|
||||
private BusProcessModelHisMapper busProcessModelHisMapper;
|
||||
@Resource
|
||||
private IOSSFileService ossFileService;
|
||||
|
||||
@Resource
|
||||
private OnlineFileLogDao onlineFileLogDao;
|
||||
|
||||
/**
|
||||
* 文件后缀黑名单
|
||||
*/
|
||||
@Value(value="${jero.fileSuffixLimits}")
|
||||
@Value(value = "${jero.fileSuffixLimits}")
|
||||
private String[] fileSuffixLimits;
|
||||
|
||||
@ApiOperation(value = "分页查询")
|
||||
@GetMapping("/pageList")
|
||||
public Result<IPage<BusProcessModelHis>> pageList(HttpServletRequest req, BusProcessModelHis processModelHis,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
QueryWrapper<BusProcessModelHis> queryWrapper = QueryGenerator.initQueryWrapper(processModelHis, req.getParameterMap());
|
||||
Page<BusProcessModelHis> page = new Page<>(pageNo, pageSize);
|
||||
IPage<BusProcessModelHis> pageList = busProcessModelHisService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@@ -85,11 +90,11 @@ public class OnlyofficeController {
|
||||
@PostMapping("/delete")
|
||||
public Result<String> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
if(StringUtils.isBlank(id)){
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return Result.error("参数不识别!");
|
||||
}
|
||||
boolean ok = busProcessModelHisService.removeById(id);
|
||||
if(ok) {
|
||||
if (ok) {
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
return Result.OK();
|
||||
@@ -102,9 +107,9 @@ public class OnlyofficeController {
|
||||
@PostMapping("/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(StringUtils.isBlank(ids)) {
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
return Result.error("参数不识别!");
|
||||
}else {
|
||||
} else {
|
||||
this.busProcessModelHisService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -112,16 +117,16 @@ public class OnlyofficeController {
|
||||
|
||||
|
||||
@ApiOperation(value = "|onlyOffice接收文件")
|
||||
@PostMapping("/recieveFile")
|
||||
public void recieveFile(HttpServletRequest request, HttpServletResponse response, String fileNm, String standNo, String fileId,String standName,String key){
|
||||
logger.info("**********进入recieveFile接收文档接口************");
|
||||
logger.info("**********fileNm************"+fileNm+"=======");
|
||||
logger.info("**********standNo************"+standNo+"=======");
|
||||
logger.info("**********fileId************"+fileId+"=======");
|
||||
logger.info("**********standName************"+standName+"=======");
|
||||
logger.info("**********key************"+key+"=======");
|
||||
@PostMapping("/receiveFile")
|
||||
public void receiveFile(HttpServletRequest request, HttpServletResponse response, String fileNm, String standNo, String fileId, String standName, String key) {
|
||||
logger.info("**********进入receiveFile接收文档接口************");
|
||||
logger.info("**********fileNm************" + fileNm + "=======");
|
||||
logger.info("**********standNo************" + standNo + "=======");
|
||||
logger.info("**********fileId************" + fileId + "=======");
|
||||
logger.info("**********standName************" + standName + "=======");
|
||||
logger.info("**********key************" + key + "=======");
|
||||
try {
|
||||
PrintWriter writer = response.getWriter();
|
||||
PrintWriter writer = response.getWriter();
|
||||
String body = "";
|
||||
try {
|
||||
Scanner scanner = new Scanner(request.getInputStream());
|
||||
@@ -150,32 +155,30 @@ public class OnlyofficeController {
|
||||
try {
|
||||
logger.info("**********onlyoffice接收文档接口获得downloadUri************" + downloadUri);
|
||||
if (StringUtils.isNotEmpty(downloadUri)) {
|
||||
downloadUri = downloadUri.replace("laws.sinotruk.com","onlyoffice-sa2of.yf-grp:8080");
|
||||
downloadUri = downloadUri.replace("onlyoffice.sinotruk.com","onlyoffice-sa2of.yf-grp:8080");
|
||||
downloadUri = downloadUri.replace("laws.sinotruk.com", "onlyoffice-sa2of.yf-grp:8080");
|
||||
downloadUri = downloadUri.replace("onlyoffice.sinotruk.com", "onlyoffice-sa2of.yf-grp:8080");
|
||||
BusProcessModelHis modelHis = busProcessModelHisService.getById(fileId);
|
||||
String editFilePath = modelHis.getEditFilePath();
|
||||
StringBuilder builder=new StringBuilder();
|
||||
builder.append(standEditFilePath);
|
||||
builder.append(editFilePath);
|
||||
String saveFileUrl = builder.toString();
|
||||
String saveFileUrl = standEditFilePath +
|
||||
editFilePath;
|
||||
logger.info("**********onlyoffice文档下载路径************" + downloadUri);
|
||||
logger.info("**********onlyoffice文档保存本地路径************" + saveFileUrl);
|
||||
HttpUtil.downloadFileFromUrl(downloadUri,saveFileUrl);
|
||||
HttpUtil.downloadFileFromUrl(downloadUri, saveFileUrl);
|
||||
//File file = new File(saveFileUrl);
|
||||
//downloadNetFile(downloadUri, file);
|
||||
// 更新在线编辑当前节点编辑状态
|
||||
busProcessModelHisService.modelHisOneUpdStatusById(fileId);
|
||||
Object keyObj = jsonObj.get("key");
|
||||
if(keyObj!=null){
|
||||
Object keyObj = jsonObj.get("key");
|
||||
if (keyObj != null) {
|
||||
key = keyObj.toString();
|
||||
logger.info("**********key************"+key+"=======");
|
||||
}
|
||||
lawsUserInfoService.selectOnlineFile(fileId,standName,key);
|
||||
logger.info("**********key************" + key + "=======");
|
||||
}
|
||||
lawsUserInfoService.selectOnlineFile(fileId, standName, key);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
saved = 1;
|
||||
logger.info("**********onlyoffice接收文档接口异常************" + ex.getMessage());
|
||||
logger.error(ex.getMessage(),ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
} else if (status == 4) {
|
||||
logger.info("**********onlyoffice接收文档接口开始修改文件状态状态4************");
|
||||
@@ -187,21 +190,21 @@ public class OnlyofficeController {
|
||||
|
||||
} catch (IOException e) {
|
||||
logger.info("**********onlyoffice接收文档接口异常************" + e.getMessage());
|
||||
logger.error(e.getMessage(),e);
|
||||
logger.error(e.getMessage(), e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|onlyOffice接收文件")
|
||||
@PostMapping("/recieveFileBefore")
|
||||
public void recieveFileBefore(HttpServletRequest request, HttpServletResponse response,String key, String fileNm, String standNo, String pid, String taskId ,String standName){
|
||||
logger.info("**********进入recieveFileBefore接收文档接口************");
|
||||
logger.info("**********fileNm************"+fileNm+"=======");
|
||||
logger.info("**********standNo************"+standNo+"=======");
|
||||
logger.info("**********pid************"+pid+"=======");
|
||||
logger.info("**********taskId************"+taskId+"=======");
|
||||
logger.info("**********standName************"+standName+"=======");
|
||||
logger.info("**********key************"+key+"=======");
|
||||
@PostMapping("/receiveFileBefore")
|
||||
public void receiveFileBefore(HttpServletRequest request, HttpServletResponse response, String key, String fileNm, String standNo, String pid, String taskId, String standName) {
|
||||
logger.info("**********进入receiveFileBefore接收文档接口************");
|
||||
logger.info("**********fileNm************" + fileNm + "=======");
|
||||
logger.info("**********standNo************" + standNo + "=======");
|
||||
logger.info("**********pid************" + pid + "=======");
|
||||
logger.info("**********taskId************" + taskId + "=======");
|
||||
logger.info("**********standName************" + standName + "=======");
|
||||
logger.info("**********key************" + key + "=======");
|
||||
|
||||
try {
|
||||
PrintWriter writer = response.getWriter();
|
||||
@@ -226,39 +229,37 @@ public class OnlyofficeController {
|
||||
int status = (Integer) jsonObj.get("status");
|
||||
|
||||
int saved = 0;
|
||||
if (status == 2 || status == 3 ||status == 6)//MustSave, Corrupted
|
||||
if (status == 2 || status == 3 || status == 6)//MustSave, Corrupted
|
||||
{
|
||||
String downloadUri = (String) jsonObj.get("url");
|
||||
|
||||
try {
|
||||
logger.info("**********onlyoffice接收文档接口获得downloadUri************" + downloadUri);
|
||||
if (StringUtils.isNotEmpty(downloadUri)) {
|
||||
StringBuilder builder=new StringBuilder();
|
||||
builder.append(standEditFilePath);
|
||||
builder.append(standNo).append("/");
|
||||
builder.append(fileNm);
|
||||
String saveFileUrl = builder.toString();
|
||||
String saveFileUrl = standEditFilePath +
|
||||
standNo + "/" +
|
||||
fileNm;
|
||||
File file = new File(saveFileUrl);
|
||||
downloadNetFile(downloadUri, file);
|
||||
// 更新在线编辑当前节点编辑状态
|
||||
busProcessModelHisService.modelHisOneUpdStatus(pid,taskId);
|
||||
busProcessModelHisService.modelHisOneUpdStatus(pid, taskId);
|
||||
QueryWrapper<BusProcessModelHis> objectQueryWrapper = new QueryWrapper<>();
|
||||
objectQueryWrapper.eq("P_ID",pid);
|
||||
objectQueryWrapper.eq("TASK_ID",taskId);
|
||||
objectQueryWrapper.eq("P_ID", pid);
|
||||
objectQueryWrapper.eq("TASK_ID", taskId);
|
||||
BusProcessModelHis busProcessModelHis = busProcessModelHisMapper.selectOne(objectQueryWrapper);
|
||||
if(busProcessModelHis!=null){
|
||||
if (busProcessModelHis != null) {
|
||||
Object keyObj = jsonObj.get("key");
|
||||
if(keyObj!=null){
|
||||
if (keyObj != null) {
|
||||
key = keyObj.toString();
|
||||
logger.info("**********key************"+key+"=======");
|
||||
logger.info("**********key************" + key + "=======");
|
||||
}
|
||||
lawsUserInfoService.selectOnlineFile(busProcessModelHis.getId(), standName,key);
|
||||
lawsUserInfoService.selectOnlineFile(busProcessModelHis.getId(), standName, key);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
saved = 1;
|
||||
logger.info("**********onlyoffice接收文档接口异常************" + ex.getMessage());
|
||||
logger.error(ex.getMessage(),ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
} else if (status == 4) {
|
||||
logger.info("**********onlyoffice接收文档接口开始修改文件状态状态4************");
|
||||
@@ -270,12 +271,11 @@ public class OnlyofficeController {
|
||||
|
||||
} catch (IOException e) {
|
||||
logger.info("**********onlyoffice接收文档接口异常************" + e.getMessage());
|
||||
logger.error(e.getMessage(),e);
|
||||
return;
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public void downloadNetFile(String downloadUrl, File file) {
|
||||
public void downloadNetFile(String downloadUrl, File file) {
|
||||
try {
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(file);
|
||||
URL url = new URL(downloadUrl);
|
||||
@@ -295,8 +295,7 @@ public class OnlyofficeController {
|
||||
|
||||
@GetMapping("/processEditFile")
|
||||
public BusProcessModelHis processEditFile(String id) {
|
||||
BusProcessModelHis modelHisOne = busProcessModelHisService.processEditFile(id);
|
||||
return modelHisOne;
|
||||
return busProcessModelHisService.processEditFile(id);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|model| 传入 模板文档名称(不带后缀)默认 docx")
|
||||
@@ -309,31 +308,27 @@ public class OnlyofficeController {
|
||||
@ApiOperation(value = "根据路径下载文件")
|
||||
@GetMapping("/downLoadFile")
|
||||
public void downLoadFile(@RequestParam(name = "path") String path, HttpServletResponse response) {
|
||||
busProcessModelHisService.downLoadFile(path,response);
|
||||
busProcessModelHisService.downLoadFile(path, response);
|
||||
}
|
||||
|
||||
@GetMapping("/processModelHisOneUpdStatus")
|
||||
public BusProcessModelHis modelHisOneUpdStatus(String pid,String taskId) {
|
||||
BusProcessModelHis modelHisOne = busProcessModelHisService.modelHisOneUpdStatus(pid,taskId);
|
||||
return modelHisOne;
|
||||
public BusProcessModelHis modelHisOneUpdStatus(String pid, String taskId) {
|
||||
return busProcessModelHisService.modelHisOneUpdStatus(pid, taskId);
|
||||
}
|
||||
|
||||
@GetMapping("/processModelHisOneCount")
|
||||
public BusProcessModelHis modelHisOneCount(String pid) {
|
||||
BusProcessModelHis modelHisOne = busProcessModelHisService.modelHisOneCount(pid);
|
||||
return modelHisOne;
|
||||
return busProcessModelHisService.modelHisOneCount(pid);
|
||||
}
|
||||
|
||||
@GetMapping("/processModelHisOne")
|
||||
public BusProcessModelHis modelHisOne(String pid,String taskId) {
|
||||
BusProcessModelHis modelHisOne = busProcessModelHisService.modelHisOne(pid,taskId);
|
||||
return modelHisOne;
|
||||
public BusProcessModelHis modelHisOne(String pid, String taskId) {
|
||||
return busProcessModelHisService.modelHisOne(pid, taskId);
|
||||
}
|
||||
|
||||
@GetMapping("/processModelHisList")
|
||||
public List<BusProcessModelHis> evaluationHisList(String pid) {
|
||||
List<BusProcessModelHis> processModelHisList = busProcessModelHisService.modelHisList(pid);
|
||||
return processModelHisList;
|
||||
return busProcessModelHisService.modelHisList(pid);
|
||||
}
|
||||
|
||||
@PostMapping("/selectOnlineFile")
|
||||
@@ -341,8 +336,35 @@ public class OnlyofficeController {
|
||||
return busProcessModelHisService.selectOnlineFile(onlineFileId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据在线文件Id查询所有onlyoffice历史文件")
|
||||
@GetMapping("/getAllOnlyOfficeHisFileById")
|
||||
public Result<List<Map<String, String>>> getAllOnlyOfficeHisFileById(String fileId, String fileName) {
|
||||
List<Map<String, String>> fileList = new ArrayList<>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
LambdaQueryWrapper<OnlineFileLog> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(OnlineFileLog::getHisId, fileId);
|
||||
wrapper.eq(OnlineFileLog::getValidFlag, "0");
|
||||
wrapper.orderByDesc(OnlineFileLog::getCreateTime);
|
||||
List<OnlineFileLog> onlineFileLogList = onlineFileLogDao.selectList(wrapper);
|
||||
if (!onlineFileLogList.isEmpty()) {
|
||||
for (OnlineFileLog onlineFileLog : onlineFileLogList) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("id", onlineFileLog.getId());
|
||||
map.put("fileName", fileName);
|
||||
map.put("attFileId", onlineFileLog.getAttFileId());
|
||||
map.put("createTime", sdf.format(onlineFileLog.getCreateTime()));
|
||||
map.put("fileKey", onlineFileLog.getFileKey());
|
||||
fileList.add(map);
|
||||
}
|
||||
return Result.OK(fileList);
|
||||
}
|
||||
return Result.error("历史文件为空");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 文件上传统一方法
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
@@ -362,22 +384,22 @@ public class OnlyofficeController {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = multipartRequest.getFile("file");
|
||||
if(file==null) {
|
||||
if (file == null) {
|
||||
return result;
|
||||
}
|
||||
// 文件类型是否处于黑名单
|
||||
if(CommonUtils.limitFileSuffix(file.getOriginalFilename(),fileSuffixLimits)){
|
||||
if (CommonUtils.limitFileSuffix(file.getOriginalFilename(), fileSuffixLimits)) {
|
||||
result.setMessage("该文件类型不允许上传");
|
||||
result.setSuccess(false);
|
||||
result.setCode(0);
|
||||
return result;
|
||||
}
|
||||
if(oConvertUtils.isEmpty(bizPath)){
|
||||
if (oConvertUtils.isEmpty(bizPath)) {
|
||||
bizPath = "";
|
||||
}
|
||||
// 本地上传
|
||||
savePath = CommonUtils.uploadLocal(file,bizPath,standEditFilePath);
|
||||
if(oConvertUtils.isNotEmpty(savePath)){
|
||||
savePath = CommonUtils.uploadLocal(file, bizPath, standEditFilePath);
|
||||
if (oConvertUtils.isNotEmpty(savePath)) {
|
||||
//上传成功 进行数据库存储
|
||||
OSSFile ossFile = new OSSFile();
|
||||
// 文件名
|
||||
@@ -389,7 +411,7 @@ public class OnlyofficeController {
|
||||
result.setMessage(savePath);
|
||||
result.setResult(ossFile);
|
||||
result.setSuccess(true);
|
||||
}else {
|
||||
} else {
|
||||
result.setMessage("上传失败!");
|
||||
result.setSuccess(false);
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import java.util.Date;
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
// TODO 等在线编辑正式上线时,把该部分去掉,此部分在正式功能中无用
|
||||
public class AttFileEO implements Serializable{
|
||||
public class AttFileEO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1284335706608668758L;
|
||||
|
||||
@@ -25,9 +25,9 @@ public class AttFileEO implements Serializable{
|
||||
private String fileSuffix;
|
||||
private String filePath;
|
||||
private Integer validFlag;
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date creationTime;
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
private String tableName;
|
||||
@@ -53,19 +53,28 @@ public class AttFileEO implements Serializable{
|
||||
* <li>modifyTime -> modify_time</li>
|
||||
*/
|
||||
public static String fieldToColumn(String fieldName) {
|
||||
if (fieldName == null){
|
||||
if (fieldName == null) {
|
||||
return null;
|
||||
}
|
||||
switch (fieldName) {
|
||||
case "id": return "id";
|
||||
case "fileName": return "file_name";
|
||||
case "oldFileName": return "old_file_name";
|
||||
case "fileSuffix": return "file_suffix";
|
||||
case "filePath": return "file_path";
|
||||
case "validFlag": return "valid_flag";
|
||||
case "creationTime": return "creation_time";
|
||||
case "modifyTime": return "modify_time";
|
||||
default: return null;
|
||||
case "id":
|
||||
return "id";
|
||||
case "fileName":
|
||||
return "file_name";
|
||||
case "oldFileName":
|
||||
return "old_file_name";
|
||||
case "fileSuffix":
|
||||
return "file_suffix";
|
||||
case "filePath":
|
||||
return "file_path";
|
||||
case "validFlag":
|
||||
return "valid_flag";
|
||||
case "creationTime":
|
||||
return "creation_time";
|
||||
case "modifyTime":
|
||||
return "modify_time";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,123 +91,164 @@ public class AttFileEO implements Serializable{
|
||||
* <li>modify_time -> modifyTime</li>
|
||||
*/
|
||||
public static String columnToField(String columnName) {
|
||||
if (columnName == null){
|
||||
if (columnName == null) {
|
||||
return null;
|
||||
}
|
||||
switch (columnName) {
|
||||
case "id": return "id";
|
||||
case "file_name": return "fileName";
|
||||
case "old_file_name": return "oldFileName";
|
||||
case "file_suffix": return "fileSuffix";
|
||||
case "file_path": return "filePath";
|
||||
case "valid_flag": return "validFlag";
|
||||
case "creation_time": return "creationTime";
|
||||
case "modify_time": return "modifyTime";
|
||||
default: return null;
|
||||
case "id":
|
||||
return "id";
|
||||
case "file_name":
|
||||
return "fileName";
|
||||
case "old_file_name":
|
||||
return "oldFileName";
|
||||
case "file_suffix":
|
||||
return "fileSuffix";
|
||||
case "file_path":
|
||||
return "filePath";
|
||||
case "valid_flag":
|
||||
return "validFlag";
|
||||
case "creation_time":
|
||||
return "creationTime";
|
||||
case "modify_time":
|
||||
return "modifyTime";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** **/
|
||||
public String getId() {
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public String getId() {
|
||||
int tableNameIndex = this.id.lastIndexOf("_");
|
||||
if(tableNameIndex!= -1){
|
||||
if (tableNameIndex != -1) {
|
||||
String tableName = this.id.substring(0, tableNameIndex);
|
||||
this.tableName=tableName;
|
||||
}else{
|
||||
logger.error("文件ID格式错误:"+this.id);
|
||||
this.tableName = tableName;
|
||||
} else {
|
||||
logger.error("文件ID格式错误:" + this.id);
|
||||
}
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/** **/
|
||||
public void setId(String id) {
|
||||
if(tableName!=null && !tableName.isEmpty()){
|
||||
this.id = tableName+"_"+id;
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setId(String id) {
|
||||
if (tableName != null && !tableName.isEmpty()) {
|
||||
this.id = tableName + "_" + id;
|
||||
}
|
||||
//此处注意保存时表结构是否存在
|
||||
this.id=id;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public String getFileName() {
|
||||
return this.fileName;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public String getOldFileName() {
|
||||
return this.oldFileName;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setOldFileName(String oldFileName) {
|
||||
this.oldFileName = oldFileName;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public String getFileSuffix() {
|
||||
return this.fileSuffix;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setFileSuffix(String fileSuffix) {
|
||||
this.fileSuffix = fileSuffix;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public String getFilePath() {
|
||||
return this.filePath;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public Integer getValidFlag() {
|
||||
return this.validFlag;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setValidFlag(Integer validFlag) {
|
||||
this.validFlag = validFlag;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public Date getCreationTime() {
|
||||
return this.creationTime;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setCreationTime(Date creationTime) {
|
||||
this.creationTime = creationTime;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public Date getModifyTime() {
|
||||
return this.modifyTime;
|
||||
}
|
||||
|
||||
/** **/
|
||||
/**
|
||||
*
|
||||
**/
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
if(this.tableName !=null && !this.tableName.isEmpty()){
|
||||
if (this.tableName != null && !this.tableName.isEmpty()) {
|
||||
return this.tableName;
|
||||
}else{
|
||||
} else {
|
||||
int tableNameIndex = this.id.lastIndexOf("_");
|
||||
if(tableNameIndex !=-1){
|
||||
if (tableNameIndex != -1) {
|
||||
String tableName = this.id.substring(0, tableNameIndex);
|
||||
this.tableName=tableName;
|
||||
}else{
|
||||
logger.error("文件ID格式错误:"+this.id);
|
||||
this.tableName = tableName;
|
||||
} else {
|
||||
logger.error("文件ID格式错误:" + this.id);
|
||||
}
|
||||
return this.tableName;
|
||||
}
|
||||
|
||||
+22
-38
@@ -66,10 +66,10 @@ public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> i
|
||||
}
|
||||
|
||||
String fileName = file.getName();
|
||||
String fileSuffix = fileName.substring(fileName.lastIndexOf(".")+1, fileName.length());
|
||||
String newFileName = fileId +"."+ fileSuffix;
|
||||
String fileSuffix = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length());
|
||||
String newFileName = fileId + "." + fileSuffix;
|
||||
File saveFile = new File(FileSavePath + newFileName);
|
||||
FileUtils.copyFile(file,saveFile);
|
||||
FileUtils.copyFile(file, saveFile);
|
||||
//开始存储文件信息
|
||||
String tableName = UUIDUtils.getAttTable();
|
||||
int existTable = this.baseMapper.existTable(tableName);
|
||||
@@ -94,9 +94,9 @@ public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> i
|
||||
attFileVo.setFileSuffix(fileSuffix);
|
||||
attFileVo.setOldFileName(fileName);
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
log.error(e.getMessage(), e);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return attFileVo;
|
||||
}
|
||||
@@ -114,43 +114,43 @@ public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> i
|
||||
* 根据ID获取文件信息
|
||||
*/
|
||||
AttFileEO attFileEO = new AttFileEO();
|
||||
AttFileEO attFileInfo=null;
|
||||
AttFileEO attFileInfo = null;
|
||||
try {
|
||||
attFileEO.setId(attId);
|
||||
attFileInfo = this.baseMapper.selectFileInfoById(attFileEO);
|
||||
attFileInfo = this.baseMapper.selectFileInfoById(attFileEO);
|
||||
return attFileInfo;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return attFileEO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttFileEO updateFileInfo(String attId,String name) {
|
||||
public AttFileEO updateFileInfo(String attId, String name) {
|
||||
/**
|
||||
* 根据ID获取文件信息
|
||||
*/
|
||||
AttFileEO attFileEO = new AttFileEO();
|
||||
AttFileEO attFileInfo=null;
|
||||
AttFileEO attFileInfo = null;
|
||||
try {
|
||||
attFileEO.setId(attId);
|
||||
attFileInfo = this.baseMapper.selectFileInfoById(attFileEO);
|
||||
if (name.contains(".")) {
|
||||
int suffixIndex = name.lastIndexOf(".");
|
||||
String newSuffix = name.substring(suffixIndex+1).trim();
|
||||
if (StringUtils.equals(newSuffix.toUpperCase(),attFileInfo.getFileSuffix().toUpperCase())) {
|
||||
String newSuffix = name.substring(suffixIndex + 1).trim();
|
||||
if (StringUtils.equals(newSuffix.toUpperCase(), attFileInfo.getFileSuffix().toUpperCase())) {
|
||||
attFileInfo.setOldFileName(name);
|
||||
}else {
|
||||
String filename = name.substring(0,suffixIndex).trim();
|
||||
attFileInfo.setOldFileName(filename+"."+attFileInfo.getFileSuffix());
|
||||
} else {
|
||||
String filename = name.substring(0, suffixIndex).trim();
|
||||
attFileInfo.setOldFileName(filename + "." + attFileInfo.getFileSuffix());
|
||||
}
|
||||
}else {
|
||||
attFileInfo.setOldFileName(name.trim()+"."+attFileEO.getFileSuffix());
|
||||
} else {
|
||||
attFileInfo.setOldFileName(name.trim() + "." + attFileEO.getFileSuffix());
|
||||
}
|
||||
this.baseMapper.updateFileInfoById(attFileInfo);
|
||||
return attFileInfo;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return attFileInfo;
|
||||
}
|
||||
@@ -158,28 +158,12 @@ public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> i
|
||||
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
if(StringUtils.isNotBlank(id)){
|
||||
String[] s = id.split("_");
|
||||
if (StringUtils.isNotBlank(id)) {
|
||||
String[] s = id.split("_");
|
||||
List<String> asList = Arrays.asList(s);
|
||||
String str = "att_file_"+asList.get(2);
|
||||
baseMapper.deleteByIdInfo(str,id);
|
||||
String str = "att_file_" + asList.get(2);
|
||||
baseMapper.deleteByIdInfo(str, id);
|
||||
}
|
||||
}
|
||||
|
||||
public static void copyFile1(String srcPath, String destPath) throws IOException {
|
||||
// 打开输入流
|
||||
FileInputStream fis = new FileInputStream(srcPath);
|
||||
// 打开输出流
|
||||
FileOutputStream fos = new FileOutputStream(destPath);
|
||||
// 读取和写入信息
|
||||
int len = 0;
|
||||
while ((len = fis.read()) != -1) {
|
||||
fos.write(len);
|
||||
}
|
||||
// 关闭流 先开后关 后开先关
|
||||
fos.close(); // 后开先关
|
||||
fis.close(); // 先开后关
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+58
-55
@@ -2,6 +2,7 @@ package com.jero.modules.onlyoffice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.util.MinioUtil;
|
||||
import com.jero.modules.onlyoffice.entity.BusProcessModelHis;
|
||||
import com.jero.modules.onlyoffice.entity.OnlineFileLog;
|
||||
import com.jero.modules.onlyoffice.mapper.BusProcessModelHisMapper;
|
||||
@@ -13,10 +14,11 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -46,40 +48,41 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
@Value("${file.sourceFilePath}")
|
||||
private String sourceFilePath;
|
||||
|
||||
@Resource
|
||||
private MinioUtil minioUtil;
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis saveEditFile(String model){
|
||||
public BusProcessModelHis saveEditFile(String model) {
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
try {
|
||||
|
||||
String preUuid2 = UUID.randomUUID().toString();
|
||||
String changUuid = preUuid2.substring(0,8);
|
||||
String taskId = "task_"+changUuid;
|
||||
String topId = "top_"+changUuid;
|
||||
String changUuid = preUuid2.substring(0, 8);
|
||||
String taskId = "task_" + changUuid;
|
||||
String topId = "top_" + changUuid;
|
||||
|
||||
StringBuilder builderModel=new StringBuilder();
|
||||
StringBuilder builderModel = new StringBuilder();
|
||||
builderModel.append("model").append("/");
|
||||
builderModel.append("model").append("/");
|
||||
|
||||
|
||||
File dir = new File(filePath+builderModel.toString());
|
||||
File dir = new File(filePath + builderModel.toString());
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
}
|
||||
String fileName = model+".docx";
|
||||
String fileName = model + ".docx";
|
||||
modelHis.setFileName(fileName);
|
||||
StringBuilder builder=new StringBuilder();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("model").append("/");
|
||||
builder.append(taskId).append("/");
|
||||
|
||||
File file = new File(filePath+builder.toString());
|
||||
File file = new File(filePath + builder.toString());
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
|
||||
String targetPath = builder.toString()+taskId+"_"+topId+"_node.docx";
|
||||
String targetPath = builder.toString() + taskId + "_" + topId + "_node.docx";
|
||||
|
||||
File sourceFile = new File(sourceFilePath);
|
||||
File targetFile = new File(filePath+targetPath);
|
||||
File targetFile = new File(filePath + targetPath);
|
||||
FileUtils.copyFile(sourceFile, targetFile);
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
||||
@@ -87,7 +90,7 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
modelHis.setPId(topId);
|
||||
modelHis.setEditFilePath(targetPath);
|
||||
this.baseMapper.insert(modelHis);
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
return modelHis;
|
||||
@@ -98,17 +101,17 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
BusProcessModelHis busProcessModelHis = baseMapper.selectById(onlineFileId);
|
||||
OnlineFileLog onlineFileLog = new OnlineFileLog();
|
||||
byte[] bytes = new byte[0];
|
||||
if(busProcessModelHis!=null){
|
||||
//获取当前文件路径 返回文件路径的数字组
|
||||
if (busProcessModelHis != null) {
|
||||
//获取当前文件路径 返回文件路径的数字组
|
||||
try {
|
||||
String editFilePath = busProcessModelHis.getEditFilePath();
|
||||
File file = new File(filePath+editFilePath);
|
||||
File file = new File(filePath + editFilePath);
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(1024);
|
||||
byte [] aByte = new byte[1024];
|
||||
byte[] aByte = new byte[1024];
|
||||
int n;
|
||||
while ((n = fileInputStream.read(aByte)) != -1){
|
||||
byteArrayOutputStream.write(aByte,0,n);
|
||||
while ((n = fileInputStream.read(aByte)) != -1) {
|
||||
byteArrayOutputStream.write(aByte, 0, n);
|
||||
}
|
||||
bytes = byteArrayOutputStream.toByteArray();
|
||||
} catch (IOException e) {
|
||||
@@ -116,13 +119,13 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
}
|
||||
onlineFileLog.setHisId(busProcessModelHis.getId());
|
||||
onlineFileLog.setFilePath(busProcessModelHis.getEditFilePath());
|
||||
if(StringUtils.isNotBlank(busProcessModelHis.getEditFilePath())){
|
||||
if (StringUtils.isNotBlank(busProcessModelHis.getEditFilePath())) {
|
||||
String[] split = busProcessModelHis.getEditFilePath().split("\\.");
|
||||
onlineFileLog.setFileSuffix(split[1]);
|
||||
}
|
||||
if(StringUtils.isNotBlank(busProcessModelHis.getEditFilePath())){
|
||||
if (StringUtils.isNotBlank(busProcessModelHis.getEditFilePath())) {
|
||||
String[] split = busProcessModelHis.getEditFilePath().split("/");
|
||||
String[] split1 = split[2].split("\\.");
|
||||
String[] split1 = split[2].split("\\.");
|
||||
onlineFileLog.setOldFileName(split1[0]);
|
||||
}
|
||||
onlineFileLog.setBytes(bytes);
|
||||
@@ -136,8 +139,8 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
OutputStream outputStream = null;
|
||||
try {
|
||||
File file = new File(filePath + path);
|
||||
inputStream = new BufferedInputStream(new FileInputStream(file));
|
||||
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1"));
|
||||
inputStream = new BufferedInputStream(Files.newInputStream(file.toPath()));
|
||||
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"), "iso-8859-1"));
|
||||
response.setContentType("application/force-download");// 设置强制下载不打开
|
||||
outputStream = response.getOutputStream();
|
||||
byte[] buf = new byte[1024];
|
||||
@@ -146,10 +149,9 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
outputStream.write(buf, 0, len);
|
||||
}
|
||||
response.flushBuffer();
|
||||
}catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
log.error("预览文件失败" + e.getMessage());
|
||||
response.setStatus(404);
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
@@ -171,15 +173,16 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
|
||||
/**
|
||||
* 企标流程文件存储
|
||||
*
|
||||
* @param pid
|
||||
* @param taskId
|
||||
* @param fileSuffix
|
||||
* @param filePath 文件存储路径
|
||||
* @param filePath 文件存储路径
|
||||
* @throws IOException
|
||||
*/
|
||||
public String saveProcessFile(String filePath,String pid,String taskId,String fileSuffix){
|
||||
public String saveProcessFile(String filePath, String pid, String taskId, String fileSuffix) {
|
||||
|
||||
String fileSavePath = "bussEdit"+ getUUIDPath(pid,taskId);
|
||||
String fileSavePath = "bussEdit" + getUUIDPath(pid, taskId);
|
||||
String newFileName = "";
|
||||
try {
|
||||
|
||||
@@ -190,17 +193,17 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
|
||||
newFileName = fileSavePath + taskId + "_" + pid + "_node." + fileSuffix;
|
||||
File saveFile = new File(filePath + newFileName);
|
||||
FileUtils.write(saveFile, "","UTF-8");
|
||||
FileUtils.write(saveFile, "", "UTF-8");
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
logger.error(e.getMessage(),e);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return newFileName;
|
||||
return newFileName;
|
||||
}
|
||||
|
||||
public static String getUUIDPath(String pid,String taskId){
|
||||
StringBuilder builder=new StringBuilder();
|
||||
public static String getUUIDPath(String pid, String taskId) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("/");
|
||||
builder.append(pid).append("/");
|
||||
// builder.append(taskId).append("/");
|
||||
@@ -208,7 +211,7 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis modelHisOneUpdStatusById(String id){
|
||||
public BusProcessModelHis modelHisOneUpdStatusById(String id) {
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
modelHis.setId(id);
|
||||
modelHis.setEditStatus("1");
|
||||
@@ -217,13 +220,13 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis modelHisOneUpdStatus(String pid,String taskId){
|
||||
public BusProcessModelHis modelHisOneUpdStatus(String pid, String taskId) {
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("P_ID",pid);
|
||||
wrapper.eq("TASK_ID",taskId);
|
||||
wrapper.eq("P_ID", pid);
|
||||
wrapper.eq("TASK_ID", taskId);
|
||||
List<BusProcessModelHis> hisList = this.baseMapper.selectList(wrapper);
|
||||
if(!hisList.isEmpty()){
|
||||
if (!hisList.isEmpty()) {
|
||||
modelHis = hisList.get(0);
|
||||
modelHis.setEditStatus("1");
|
||||
this.baseMapper.updateById(modelHis);
|
||||
@@ -232,13 +235,13 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis modelHisOneCount(String pid){
|
||||
public BusProcessModelHis modelHisOneCount(String pid) {
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("P_ID",pid);
|
||||
wrapper.eq("EDIT_TYPE","count");
|
||||
wrapper.eq("P_ID", pid);
|
||||
wrapper.eq("EDIT_TYPE", "count");
|
||||
List<BusProcessModelHis> hisList = this.baseMapper.selectList(wrapper);
|
||||
if(!hisList.isEmpty()){
|
||||
if (!hisList.isEmpty()) {
|
||||
modelHis = hisList.get(0);
|
||||
StringBuffer downloadFileUrl = new StringBuffer();
|
||||
downloadFileUrl.append(downloadUrl).append(modelHis.getEditFilePath() == null ? "" : modelHis.getEditFilePath());
|
||||
@@ -248,9 +251,9 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis processEditFile(String id){
|
||||
BusProcessModelHis modelHis = this.baseMapper.selectById(id);
|
||||
if(StringUtils.isNotBlank(modelHis.getId())){
|
||||
public BusProcessModelHis processEditFile(String id) {
|
||||
BusProcessModelHis modelHis = this.baseMapper.selectById(id);
|
||||
if (StringUtils.isNotBlank(modelHis.getId())) {
|
||||
StringBuffer downloadFileUrl = new StringBuffer();
|
||||
downloadFileUrl.append(downloadUrl).append(modelHis.getEditFilePath() == null ? "" : modelHis.getEditFilePath());
|
||||
modelHis.setDownLoadUrl(downloadFileUrl.toString());
|
||||
@@ -259,13 +262,13 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessModelHis modelHisOne(String pid,String taskId){
|
||||
public BusProcessModelHis modelHisOne(String pid, String taskId) {
|
||||
BusProcessModelHis modelHis = new BusProcessModelHis();
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("P_ID",pid);
|
||||
wrapper.eq("TASK_ID",taskId);
|
||||
wrapper.eq("P_ID", pid);
|
||||
wrapper.eq("TASK_ID", taskId);
|
||||
List<BusProcessModelHis> hisList = this.baseMapper.selectList(wrapper);
|
||||
if(!hisList.isEmpty()){
|
||||
if (!hisList.isEmpty()) {
|
||||
modelHis = hisList.get(0);
|
||||
StringBuffer downloadFileUrl = new StringBuffer();
|
||||
downloadFileUrl.append(downloadUrl).append(modelHis.getEditFilePath() == null ? "" : modelHis.getEditFilePath());
|
||||
@@ -275,9 +278,9 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusProcessModelHis> modelHisList(String pid){
|
||||
public List<BusProcessModelHis> modelHisList(String pid) {
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("P_ID",pid);
|
||||
wrapper.eq("P_ID", pid);
|
||||
return this.baseMapper.selectList(wrapper);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user