zhanghua
2024-12-09 99a3c99d3e3bc046b3fcb0f23051d91a0c2edba0
项目库添加“使用状态”字段
5个文件已修改
43 ■■■■ 已修改文件
business/src/main/java/com/ycl/controller/ProjectInfoController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/domain/entity/ProjectInfo.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/domain/form/ProjectInfoForm.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/ProjectInfoService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/controller/ProjectInfoController.java
@@ -44,12 +44,14 @@
    public Result add(@RequestBody @Validated(Add.class) ProjectInfoForm form) {
        return projectInfoService.add(form);
    }
    @PostMapping("/document")
    @ApiOperation(value = "添加相关文件", notes = "添加相关文件")
//    @PreAuthorize("hasAuthority('projectInfo:add')")
    public Result addDoc(@RequestBody @Validated(Add.class) DocumentInfoForm form) {
        return projectInfoService.addDoc(form);
    }
    @PutMapping
    @ApiOperation(value = "修改", notes = "修改")
//    @PreAuthorize("hasAuthority('projectInfo:edit')")
@@ -84,12 +86,14 @@
    public Result detail(@PathVariable("id") Integer id) {
        return projectInfoService.detail(id);
    }
    @GetMapping("/document/{id}")
    @ApiOperation(value = "相关文件详情", notes = "相关文件详情")
//    @PreAuthorize("hasAuthority('projectInfo:detail')")
    public Result docDetail(@PathVariable("id") Integer id) {
        return projectInfoService.docDetail(id);
    }
    @GetMapping("/list")
//    @PreAuthorize("hasAuthority('projectInfo:list')")
    @ApiOperation(value = "列表", notes = "列表")
@@ -99,12 +103,15 @@
    /**
     * 生成项目编号
     *
     * @return 项目编号
     */
    @GetMapping("/getProjectCode")
    public Result generateProjectCode() {
        return Result.ok().data(ProjectCodeGenerator.generateProjectCode());
    };
    }
    ;
    @GetMapping("/getManagerFlag/{recordId}")
    public Result getManagerFlag(@PathVariable("recordId") Integer recordId) {
@@ -113,17 +120,19 @@
    /**
     * 导出模板
     *
     * @param response
     * @return
     */
    @PostMapping("/export/template")
    public void exportTemplate(HttpServletResponse response) throws IOException {
        List<String> fieldList = new ArrayList<>();
        OutputExcelUtils.export(response, "导入模板", "项目信息", null, ProjectExcelTemplate.class ,fieldList);
        OutputExcelUtils.export(response, "导入模板", "项目信息", null, ProjectExcelTemplate.class, fieldList);
    }
    /**
     * 项目导出
     *
     * @param response
     * @throws IOException
     */
@@ -131,4 +140,11 @@
    public void export(HttpServletResponse response, ProjectExportQuery query) throws IOException {
        projectInfoService.export(response, query);
    }
    @PutMapping("usedStatus/{id}/{usedStatus}")
    @ApiOperation(value = "修改使用状态", notes = "修改使用状态")
//    @PreAuthorize("hasAuthority('projectInfo:edit')")
    public Result updateUsedStatus(@PathVariable Integer id, @PathVariable Integer usedStatus) {
        return projectInfoService.updateUsedStatus(id, usedStatus);
    }
}
business/src/main/java/com/ycl/domain/entity/ProjectInfo.java
@@ -141,5 +141,7 @@
    /** 创建人 */
    private Long createBy;
    @TableField("used_status")
    /** 使用状态(0:草稿,1:提交,2:审核通过,-1:驳回) */
    private Integer usedStatus;
}
business/src/main/java/com/ycl/domain/form/ProjectInfoForm.java
@@ -121,6 +121,9 @@
    @ApiModelProperty("联系方式")
    private String contact;
    @ApiModelProperty("使用状态")
    private Integer usedStatus;
    public static ProjectInfo getEntityByForm(@NonNull ProjectInfoForm form, ProjectInfo entity) {
        if(entity == null) {
          entity = new ProjectInfo();
business/src/main/java/com/ycl/service/ProjectInfoService.java
@@ -82,4 +82,6 @@
    Result getManagerFlag(Integer recordId);
    void export(HttpServletResponse response, ProjectExportQuery query) throws IOException;
    Result updateUsedStatus(Integer id, Integer usedStatus);
}
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -447,12 +447,12 @@
                                //审批计划书
                                item.setApprovalPlan(file.getOriginalName());
                            }
                        }else if(FileTypeEnum.DOCUMENT_INFO.equals(file.getType())){
                        } else if (FileTypeEnum.DOCUMENT_INFO.equals(file.getType())) {
                            if (file.getBusId().equals(item.getId())) {
                                //相关文书
                                item.setDocuments(file.getOriginalName());
                            }
                        }else if(FileTypeEnum.INVEST_POLICY.equals(file.getType())){
                        } else if (FileTypeEnum.INVEST_POLICY.equals(file.getType())) {
                            if (file.getBusId().equals(item.getPolicyId())) {
                                //符合产业政策附件
                                item.setPolicyComplianceAttachment(file.getOriginalName());
@@ -519,4 +519,14 @@
            }
        }
    }
    @Override
    public Result updateUsedStatus(Integer id, Integer usedStatus) {
        ProjectInfo entity = baseMapper.selectById(id);
        // 为空抛IllegalArgumentException,做全局异常处理
        Assert.notNull(entity, "记录不存在");
        entity.setUsedStatus(usedStatus);
        baseMapper.updateById(entity);
        return Result.ok("删除成功");
    }
}