fuliqi
2025-02-19 f6f038ba68b51318fe558b94dee8b6ff96574f65
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -105,7 +105,6 @@
        ProjectInfo entity = ProjectInfoForm.getEntityByForm(form, null);
        Long userId = SecurityUtils.getUserId();
        Long deptId = SecurityUtils.getDeptId();
        List<ProjectInfoWinUnitForm> projectInfoWinUnitForm = form.getWinUnitList();
        entity.setProjectOwnerUnit(deptId);
        entity.setCreateBy(userId);
        entity.setUpdateBy(userId);
@@ -124,7 +123,8 @@
        fileService.saveBatch(fileList);
        //添加项目中标单位
        saveUnit(projectInfoWinUnitForm);
        saveUnit(entity.getId(),form.getWinUnitList());
        return Result.ok("添加成功").data(entity.getId());
    }
@@ -177,15 +177,16 @@
        unitWrapper.eq("project_info_id",form.getId());
        projectInfoWinUnitService.remove(unitWrapper);
        //添加项目中标单位
        saveUnit(projectInfoWinUnitForm);
        saveUnit(entity.getId(),projectInfoWinUnitForm);
        return Result.ok("修改成功");
    }
    private void saveUnit(List<ProjectInfoWinUnitForm> projectInfoWinUnitForm) {
    private void saveUnit(Long id,List<ProjectInfoWinUnitForm> projectInfoWinUnitForm) {
        List<ProjectInfoWinUnit> projectInfoWinUnits = new ArrayList<>();
        for (ProjectInfoWinUnitForm winUnitForm : projectInfoWinUnitForm) {
            ProjectInfoWinUnit projectInfoWinUnit = ProjectInfoWinUnitForm.getEntityByForm(winUnitForm, null);
            projectInfoWinUnit.setProjectInfoId(id);
            projectInfoWinUnits.add(projectInfoWinUnit);
        }
        if (!CollectionUtils.isEmpty(projectInfoWinUnits)) {
@@ -327,6 +328,8 @@
        List<File> files = fileMapper.selectList(fileQueryWrapper);
        vo.setFileList(files);
        //中标单位
        List<ProjectInfoWinUnitVO> unitVOS = new ArrayList<>();
        List<ProjectInfoWinUnit> unitList = projectInfoWinUnitService.list(new QueryWrapper<ProjectInfoWinUnit>().eq("project_info_id", id));
        for (ProjectInfoWinUnit projectInfoWinUnit : unitList) {