feat: There is no way the,
This commit is contained in:
+63
-4
@@ -1,18 +1,38 @@
|
||||
package com.adc.da.convert.otConvert.controller;
|
||||
|
||||
|
||||
import com.adc.da.att.controller.AttFileEOController;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.att.vo.AttFileVo;
|
||||
import com.adc.da.convert.common.AsposeOfficeConvertUtils;
|
||||
import com.adc.da.convert.mq.CreateConvertMQService;
|
||||
import com.adc.da.convert.otConvert.service.IOtConvertService;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.convert.otConvert.entity.OtConvert;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -24,12 +44,51 @@ import com.adc.da.base.web.BaseController;
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "|OtConvert| 文档转换")
|
||||
@RequestMapping("/OtConvert")
|
||||
@RequestMapping("/${restPath}/OtConvert")
|
||||
public class OtConvertController extends BaseController<OtConvert> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(OtConvertController.class);
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Value("${upload.file.white.lists}")
|
||||
private String uploadFileWhiteLists; //上传文件白名单
|
||||
|
||||
@Autowired
|
||||
private IOtConvertService iOtConvertService;
|
||||
|
||||
@Autowired
|
||||
private IAttFileEOService attFileEOService;
|
||||
|
||||
@Autowired
|
||||
private CreateConvertMQService createConvertMQService;
|
||||
|
||||
@ApiOperation(value = "|OtActConvertEO|根据文件ID获取流程转换文档")
|
||||
@GetMapping(value = "/getConvertFileByAttId")
|
||||
public ResponseMessage getConvertFileByAttId(String attId) throws Exception {
|
||||
// 根据attId查到地址
|
||||
if(StringUtils.isNotBlank(attId)){
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("ACT_FILE_ID",attId);
|
||||
List<OtConvert> resultList = iOtConvertService.list(wrapper);
|
||||
if(resultList!=null && !resultList.isEmpty()){
|
||||
OtConvert convertEO = resultList.get(0);
|
||||
if(StringUtils.isNotBlank(convertEO.getConvertFileId())){
|
||||
AttFileEO attFileEO = attFileEOService.getFileInfo(convertEO.getConvertFileId());
|
||||
convertEO.setConvertFileInfo(attFileEO);
|
||||
return Result.success(convertEO);
|
||||
}else{
|
||||
return Result.success("-100","查询的转件文件未找到,请检查状态",convertEO);
|
||||
}
|
||||
}else{
|
||||
return Result.error("-1","查询的转换记录不存在",null);
|
||||
}
|
||||
}else{
|
||||
return Result.error("-1","查询的转换文档ID不存在",null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author super_liu
|
||||
* @Description 查询文件信息
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.adc.da.convert.otConvert.entity;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>OT_ACT_CONVERT OtActConvertEOEntity<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2021-03-19 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
public class OtActConvertEO extends BaseEntity {
|
||||
|
||||
private String id;
|
||||
private String actFileId;
|
||||
private String convertState;
|
||||
private String convertFileId;
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
@org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
// 转换后文件信息
|
||||
private AttFileEO ConvertFileInfo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* java字段名转换为原始数据库列名。<b>如果不存在则返回null</b><br>
|
||||
* <p>字段列表:</p>
|
||||
* <li>id -> id</li>
|
||||
* <li>actFileId -> act_file_id</li>
|
||||
* <li>convertState -> convert_state</li>
|
||||
* <li>convertFileId -> convert_file_id</li>
|
||||
* <li>createTime -> create_time</li>
|
||||
* <li>modifyTime -> modify_time</li>
|
||||
*/
|
||||
public static String fieldToColumn(String fieldName) {
|
||||
if (fieldName == null) { return null; };
|
||||
switch (fieldName) {
|
||||
case "id": return "id";
|
||||
case "actFileId": return "act_file_id";
|
||||
case "convertState": return "convert_state";
|
||||
case "convertFileId": return "convert_file_id";
|
||||
case "createTime": return "create_time";
|
||||
case "modifyTime": return "modify_time";
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 原始数据库列名转换为java字段名。<b>如果不存在则返回null</b><br>
|
||||
* <p>字段列表:</p>
|
||||
* <li>id -> id</li>
|
||||
* <li>act_file_id -> actFileId</li>
|
||||
* <li>convert_state -> convertState</li>
|
||||
* <li>convert_file_id -> convertFileId</li>
|
||||
* <li>create_time -> createTime</li>
|
||||
* <li>modify_time -> modifyTime</li>
|
||||
*/
|
||||
public static String columnToField(String columnName) {
|
||||
if (columnName == null) { return null; };
|
||||
switch (columnName) {
|
||||
case "id": return "id";
|
||||
case "act_file_id": return "actFileId";
|
||||
case "convert_state": return "convertState";
|
||||
case "convert_file_id": return "convertFileId";
|
||||
case "create_time": return "createTime";
|
||||
case "modify_time": return "modifyTime";
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 主键 **/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/** 主键 **/
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/** 流程中待转换文件ID **/
|
||||
public String getActFileId() {
|
||||
return this.actFileId;
|
||||
}
|
||||
|
||||
/** 流程中待转换文件ID **/
|
||||
public void setActFileId(String actFileId) {
|
||||
this.actFileId = actFileId;
|
||||
}
|
||||
|
||||
/** 转换状态:LODING:待转换 SUCCESS:成功 ERROR:错误 **/
|
||||
public String getConvertState() {
|
||||
return this.convertState;
|
||||
}
|
||||
|
||||
/** 转换状态:LODING:待转换 SUCCESS:成功 ERROR:错误 **/
|
||||
public void setConvertState(String convertState) {
|
||||
this.convertState = convertState;
|
||||
}
|
||||
|
||||
/** 转换后文件ID **/
|
||||
public String getConvertFileId() {
|
||||
return this.convertFileId;
|
||||
}
|
||||
|
||||
/** 转换后文件ID **/
|
||||
public void setConvertFileId(String convertFileId) {
|
||||
this.convertFileId = convertFileId;
|
||||
}
|
||||
|
||||
/** 数据创建时间 **/
|
||||
public Date getCreateTime() {
|
||||
return this.createTime;
|
||||
}
|
||||
|
||||
/** 数据创建时间 **/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
/** 数据修改时间 **/
|
||||
public Date getModifyTime() {
|
||||
return this.modifyTime;
|
||||
}
|
||||
|
||||
/** 数据修改时间 **/
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
|
||||
public AttFileEO getConvertFileInfo() {
|
||||
return ConvertFileInfo;
|
||||
}
|
||||
|
||||
public void setConvertFileInfo(AttFileEO convertFileInfo) {
|
||||
ConvertFileInfo = convertFileInfo;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.adc.da.convert.otConvert.entity;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
@@ -62,5 +63,7 @@ public class OtConvert extends BaseEntity {
|
||||
@TableField("VALID_FLAG")
|
||||
private Integer validFlag;
|
||||
|
||||
|
||||
// 转换后文件信息
|
||||
@TableField(exist = false)
|
||||
private AttFileEO ConvertFileInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user