| | |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.StandardCopyOption; |
| | | import java.time.Year; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | |
| | | * @return |
| | | */ |
| | | public boolean checkProjectNameAndIdIsUnique(ProjectInfo entity,Long updateId){ |
| | | QueryWrapper<ProjectInfo> queryWrapper = new QueryWrapper<ProjectInfo>(); |
| | | LambdaQueryWrapper<ProjectInfo> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (updateId == null) { |
| | | List<ProjectInfo> list = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProjectInfo::getProjectName, entity.getProjectName()) |
| | |
| | | baseMapper.getPage(query, page); |
| | | List<ProjectInfoVO> records = page.getRecords(); |
| | | List<ProjectVO> list = new ArrayList<>(); |
| | | int year = Year.now().getValue(); |
| | | records.forEach(vo -> { |
| | | ProjectInfoVO.transform(vo); |
| | | ProjectVO projectVO = new ProjectVO(); |
| | |
| | | projectVO.setProjectSubType(dictData.getDictLabel()); |
| | | } |
| | | } |
| | | // 获取本年度的投资金额 |
| | | List<ProjectInfoYearPlan> yearPlans = new LambdaQueryChainWrapper<>(projectInfoYearPlanService.getBaseMapper()) |
| | | .eq(ProjectInfoYearPlan::getProjectInfoId, projectVO.getId()) |
| | | .eq(ProjectInfoYearPlan::getYear, year) |
| | | .list(); |
| | | if (! CollectionUtils.isEmpty(yearPlans)) { |
| | | projectVO.setYearInvestAmount(yearPlans.get(0).getYearTotalMoney()); |
| | | } |
| | | list.add(projectVO); |
| | | }); |
| | | return Result.ok().data(list).total(page.getTotal()); |