Commit 82a96eb9 authored by 徐俊's avatar 徐俊

xujun

parent 142c18f6
......@@ -163,28 +163,21 @@
<artifactId>poi-tl</artifactId>
<version>1.10.0</version>
</dependency>
<!-- Apache POI - 用于处理 Microsoft Office 文档 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.3</version>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>5.2.3</version>
<version>4.1.2</version>
</dependency>
<!-- Apache PDFBox - 用于创建和操作 PDF -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.27</version>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
......
......@@ -20,15 +20,18 @@ import org.hibernate.validator.constraints.Length;
@NoArgsConstructor
public class ComDownload extends BaseEntity {
@ApiModelProperty(value = "URL", position = 1 )
@ApiModelProperty(value = "URL", position = 1)
@Length(max=300, message = "URL不能大于300")
private String downloadUrl;
@ApiModelProperty(value = "转换文件URL", position = 2)
@Length(max=300, message = "转换文件URL不能大于300")
private String convertUrl;
/** 附件名 */
@ApiModelProperty(value = "附件名", position = 2 )
@ApiModelProperty(value = "附件名", position = 3)
@Length(max=300, message = "附件名不能大于300")
private String fileName;
/** 后缀 */
@ApiModelProperty(value = "后缀", position = 3 )
@ApiModelProperty(value = "后缀", position = 4)
@Length(max=20, message = "后缀不能大于20")
private String extension;
}
\ No newline at end of file
......@@ -21,6 +21,9 @@ import java.util.List;
@EqualsAndHashCode(callSuper=true)
@ApiModel(description = "附件表DTO")
public class ComDownloadDTO extends BaseDTO {
/** 项目ID */
@ApiModelProperty(value = "项目ID", position = 4)
private String projId;
/** 申请编号 */
@ApiModelProperty(value = "申请编号", position = 4)
private String appNo;
......@@ -36,6 +39,9 @@ public class ComDownloadDTO extends BaseDTO {
/** URL */
@ApiModelProperty(value = "URL", position = 1)
private String downloadUrl;
/** 转换文件URL */
@ApiModelProperty(value = "转换文件URL", position = 2)
private String convertUrl;
/** 附件名 */
@ApiModelProperty(value = "附件名", position = 2)
@Length(max=100, message = "附件名长度不能大于100")
......
......@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
......@@ -37,10 +38,13 @@ public class ComDownloadQueryVO extends PaginationVO {
/** URL */
@ApiModelProperty(value = "URL", position = 1)
private String downloadUrl;
/** URL */
@ApiModelProperty(value = "转换文件URL", position = 2)
private String convertUrl;
/** 附件名 */
@ApiModelProperty(value = "附件名", position = 2)
@ApiModelProperty(value = "附件名", position = 3)
private String fileName;
/** 后缀 */
@ApiModelProperty(value = "后缀", position = 3)
@ApiModelProperty(value = "后缀", position = 4)
private String extension;
}
\ No newline at end of file
......@@ -6,11 +6,11 @@ import com.yiboshi.science.config.annotation.Logs;
import com.yiboshi.science.entity.ComDownload;
import com.yiboshi.science.enumeration.CommonEnum;
import com.yiboshi.science.param.dto.ComDownloadDTO;
import com.yiboshi.science.param.dto.ComPersonDTO;
import com.yiboshi.science.param.query.ComDownloadQueryVO;
import com.yiboshi.science.param.query.ComPersonQueryVO;
import com.yiboshi.science.rest.BaseController;
import com.yiboshi.science.service.ComDownloadService;
import com.yiboshi.science.service.SystemSetService;
import com.yiboshi.science.utils.SystemSetKey;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
......@@ -21,6 +21,10 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.List;
import java.util.UUID;
/**
* 功能:附件表 接口
......@@ -37,6 +41,9 @@ public class ComDownloadController extends BaseController<ComDownloadService, Co
@Autowired
private ComDownloadService ComDownloadService;
@Autowired
private SystemSetService systemSetService;
@ApiOperation(value = "文件上传", httpMethod = "POST", notes = "文件上传")
@PostMapping("/asyncUpload")
// @Logs(value = CommonEnum.logType.fileUpload)
......@@ -60,13 +67,4 @@ public class ComDownloadController extends BaseController<ComDownloadService, Co
return ResponseDataModel.ok(page);
}
@ApiOperation(value = "申报书文件word转pdf", httpMethod = "GET", notes = "申报书文件word转pdf")
@GetMapping
@RequestMapping("/getAllListByPage")
@PreAuthorize("hasAnyRole('ADMIN')")
public ResponseDataModel<String> fileConvert(@Validated ComDownloadQueryVO vo, BindingResult bindingResult) {
return ResponseDataModel.ok("");
}
}
\ No newline at end of file
......@@ -42,4 +42,8 @@ public interface ComDownloadService extends BaseService<ComDownloadQueryVO, ComD
* @return
*/
Pagination<ComDownloadDTO> getAllListByPage(ComDownloadQueryVO vo);
String getFilePath(String basePath);
String getPhysicalPath(String filePath);
}
\ No newline at end of file
......@@ -192,7 +192,7 @@ public class ComDownloadServiceImpl extends BaseServiceImpl<ComDownloadDAO, ComD
* @param basePath
* @return
*/
protected String getFilePath(String basePath) {
public String getFilePath(String basePath) {
if (null != basePath && "" != basePath) {
Calendar rightNow = Calendar.getInstance();
Integer year = rightNow.get(Calendar.YEAR);
......@@ -210,7 +210,7 @@ public class ComDownloadServiceImpl extends BaseServiceImpl<ComDownloadDAO, ComD
* @param filePath
* @return
*/
protected String getPhysicalPath(String filePath) {
public String getPhysicalPath(String filePath) {
String savePath = System.getProperty("user.dir") + filePath;
return savePath;
}
......
......@@ -8,7 +8,7 @@
</sql>
<select id="getAllListByPage" resultType="com.yiboshi.science.param.dto.ComDownloadDTO">
select a.app_no, a.proj_no, a.proj_name, a.report_year, b.file_id, c.*
select a.id as proj_id, a.app_no, a.proj_no, a.proj_name, a.report_year, b.file_id, c.*
from com_project a left join com_project_basic b on a.id = b.proj_id
left join com_download c on b.file_id = c.id
<where>
......
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