|
@@ -1,7 +1,9 @@
|
|
|
package com.project.zcustom.controller.engineering;
|
|
|
|
|
|
+import com.project.common.config.ProjectConfig;
|
|
|
import com.project.common.core.controller.BaseController;
|
|
|
import com.project.common.core.domain.AjaxResult;
|
|
|
+import com.project.common.utils.file.FileUploadUtils;
|
|
|
import com.project.zcustom.domain.addional.LargeIssue;
|
|
|
import com.project.zcustom.domain.addional.LargePlan;
|
|
|
import com.project.zcustom.service.unit.ILargeIssueService;
|
|
@@ -78,8 +80,10 @@ public class PlatProjectCheckController extends BaseController {
|
|
|
* 近一周问题列表
|
|
|
*/
|
|
|
@GetMapping("/getIssueListLastWeek/{appOrg}")
|
|
|
- public AjaxResult getIssueListLastWeek(@PathVariable String appOrg, @RequestParam(required = false, name = "day") Date day) {
|
|
|
- return AjaxResult.success("查询成功", largeIssueService.getIssueListLastWeek(appOrg, day));
|
|
|
+ public AjaxResult getIssueListLastWeek(@PathVariable String appOrg,
|
|
|
+ @RequestParam(required = false, name = "day") Date day,
|
|
|
+ @RequestParam(required = false, name = "status") Integer status) {
|
|
|
+ return AjaxResult.success("查询成功", largeIssueService.getIssueListLastWeek(appOrg, day,status));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -94,7 +98,15 @@ public class PlatProjectCheckController extends BaseController {
|
|
|
* 更改问题状态
|
|
|
* */
|
|
|
@PostMapping("/changeIssueStatus")
|
|
|
- public AjaxResult changeIssueStatus(@RequestPart("issue") LargeIssue entity, @RequestPart(value = "file") MultipartFile multipartFile) {
|
|
|
+ public AjaxResult changeIssueStatus(@RequestPart("issue") LargeIssue entity, @RequestPart(value = "file") MultipartFile file) {
|
|
|
+ try {
|
|
|
+ // 上传文件路径
|
|
|
+ String filePath = ProjectConfig.getUploadPath();
|
|
|
+ // 上传并返回新文件名称
|
|
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
+ entity.setImagePath(fileName);
|
|
|
+ }catch (Exception e){
|
|
|
+ }
|
|
|
return toAjax(largeIssueService.updateById(entity));
|
|
|
}
|
|
|
|
|
@@ -106,13 +118,13 @@ public class PlatProjectCheckController extends BaseController {
|
|
|
if (!multipartFile.isEmpty()) {
|
|
|
try {
|
|
|
String originalFilename = multipartFile.getOriginalFilename();
|
|
|
- Path path = Paths.get(uploadDirectory, originalFilename);
|
|
|
+ /*Path path = Paths.get(uploadDirectory, originalFilename);
|
|
|
|
|
|
Files.createDirectories(path.getParent());
|
|
|
multipartFile.transferTo(path);
|
|
|
- entity.setImagePath(path.toString());
|
|
|
+ entity.setImagePath(path.toString());*/
|
|
|
|
|
|
- } catch (IOException e) {
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return AjaxResult.error("文件上传失败");
|
|
|
}
|