|
@@ -25,6 +25,7 @@ import com.jeeplus.test.projectRecords.constant.enums.YesOrNoEnum;
|
|
|
import com.jeeplus.test.projectRecords.domain.Project;
|
|
|
import com.jeeplus.test.projectRecords.service.ProjectService;
|
|
|
import com.jeeplus.sys.service.UserService;
|
|
|
+import com.jeeplus.test.projectRecords.service.dto.FileUploadListDTO;
|
|
|
import com.jeeplus.test.projectRecords.service.dto.ProjectDTO;
|
|
|
import com.jeeplus.test.projectRecords.service.mapstruct.ProjectWrapper;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -160,6 +161,12 @@ public class ProjectController {
|
|
|
return ResponseEntity.badRequest().body("不可使用已存在的文号");
|
|
|
}
|
|
|
}
|
|
|
+ //文件状态
|
|
|
+ if (CollectionUtils.isNotEmpty(projectDTO.getWorkAttachments())) {
|
|
|
+ pro.setFileUploadType("1");
|
|
|
+ } else {
|
|
|
+ pro.setFileUploadType("0");
|
|
|
+ }
|
|
|
|
|
|
projectService.save(pro);//新增
|
|
|
}else{
|
|
@@ -173,8 +180,12 @@ public class ProjectController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
LambdaUpdateWrapper<Project> wrapper = projectService.getLambdaUpdateWrapper(projectDTO);
|
|
|
+ if (CollectionUtils.isNotEmpty(projectDTO.getWorkAttachments())) {
|
|
|
+ wrapper.set(Project::getFileUploadType, "1");
|
|
|
+ } else {
|
|
|
+ wrapper.set(Project::getFileUploadType, "0");
|
|
|
+ }
|
|
|
projectService.update (pro,wrapper);//修改
|
|
|
}
|
|
|
//项目id处理
|
|
@@ -184,7 +195,6 @@ public class ProjectController {
|
|
|
//oss上传文件相关
|
|
|
ossService.saveMsg(projectDTO.getWorkAttachments());
|
|
|
}
|
|
|
-
|
|
|
return ResponseEntity.ok ("保存项目成功");
|
|
|
}
|
|
|
|
|
@@ -605,9 +615,6 @@ public class ProjectController {
|
|
|
String time=formatter.format(userProjectDTO.getReimbursementDate());
|
|
|
userProjectDTO.setReimbursementDateUi(time);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
return userProjectDTO;
|
|
|
}
|
|
|
|
|
@@ -660,7 +667,29 @@ public class ProjectController {
|
|
|
|
|
|
@GetMapping("proportion")
|
|
|
@ApiOperation(value = "项目完成比例")
|
|
|
- public String proportion(String itemType) {
|
|
|
- return projectService.proportion(itemType);
|
|
|
+ public String proportion(Project project) throws Exception{
|
|
|
+ QueryWrapper<Project> queryWrapper = QueryWrapperGenerator.buildQueryCondition(project, Project.class);
|
|
|
+ return projectService.proportion(queryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出项目数据
|
|
|
+ *
|
|
|
+ * @param projectDTO
|
|
|
+ * @param response
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @GetMapping("exportFileUploadList")
|
|
|
+ @ApiOperation(value = "导出项目文件上传比例excel")
|
|
|
+ public void exportFileUploadList(ProjectDTO projectDTO, HttpServletResponse response) throws Exception {
|
|
|
+ Project project = ProjectWrapper.INSTANCE.toEntity (projectDTO);
|
|
|
+ QueryWrapper<Project> queryWrapper = QueryWrapperGenerator.buildQueryCondition( project, Project.class );
|
|
|
+ List<FileUploadListDTO> list = projectService.exportFileUploadList(queryWrapper);
|
|
|
+ if(ProjectTypeEnum.ASSESS.getValue().equals(projectDTO.getItemType())){
|
|
|
+ EasyPoiUtil.exportExcel(list, "评估项目上传比例报告", "评估项目上传比例报告", FileUploadListDTO.class, "", response );
|
|
|
+ }
|
|
|
+ if(ProjectTypeEnum.CONSULTATION.getValue().equals(projectDTO.getItemType())){
|
|
|
+ EasyPoiUtil.exportExcel(list, "咨询项目上传比例报告", "咨询项目上传比例报告", FileUploadListDTO.class, "", response );
|
|
|
+ }
|
|
|
}
|
|
|
}
|