| | |
| | | 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); |
| | |
| | | fileService.saveBatch(fileList); |
| | | |
| | | //添加项目中标单位 |
| | | saveUnit(projectInfoWinUnitForm); |
| | | saveUnit(entity.getId(),form.getWinUnitList()); |
| | | |
| | | return Result.ok("添加成功").data(entity.getId()); |
| | | } |
| | | |
| | |
| | | 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)) { |
| | |
| | | |
| | | 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) { |