成本预算
This commit is contained in:
parent
dc71befc33
commit
29d84ef8fe
@ -281,14 +281,17 @@ public class CostBudgetController {
|
|||||||
public ModelAndView exportXls(@RequestBody Map<String, Object> map) {
|
public ModelAndView exportXls(@RequestBody Map<String, Object> map) {
|
||||||
// Step.1 组装查询条件
|
// Step.1 组装查询条件
|
||||||
String projectSn = MapUtils.getString(map, "projectSn");
|
String projectSn = MapUtils.getString(map, "projectSn");
|
||||||
|
String level = MapUtils.getString(map, "level");
|
||||||
ProjectInfoExtVo projectInfoBySn = projectService.getProjectInfoBySn(projectSn);
|
ProjectInfoExtVo projectInfoBySn = projectService.getProjectInfoBySn(projectSn);
|
||||||
Company company = companyService.getOne(Wrappers.<Company>lambdaQuery().eq(Company::getCompanySn, projectInfoBySn.getCompanySn()));
|
// Company company = companyService.getOne(Wrappers.<Company>lambdaQuery().eq(Company::getCompanySn, projectInfoBySn.getCompanySn()));
|
||||||
map.put("companySn", company.getHeadquartersSn());
|
// map.put("companySn", company.getHeadquartersSn());
|
||||||
map.put("type", projectInfoBySn.getProjectLx());
|
// map.put("type", projectInfoBySn.getProjectLx());
|
||||||
|
map.put("sn", projectSn);
|
||||||
|
map.put("level_type", 3);
|
||||||
QueryWrapper<CostSubject> queryWrapper = QueryGenerator.initPageQueryWrapper(CostSubject.class, map);
|
QueryWrapper<CostSubject> queryWrapper = QueryGenerator.initPageQueryWrapper(CostSubject.class, map);
|
||||||
//Step.2 AutoPoi 导出Excel
|
//Step.2 AutoPoi 导出Excel
|
||||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||||
List<CostBudgetDto> list = costBudgetService.exportList(queryWrapper, projectInfoBySn, true);
|
List<CostBudgetDto> list = costBudgetService.exportList(queryWrapper, projectInfoBySn, true, level);
|
||||||
//导出文件名称
|
//导出文件名称
|
||||||
mv.addObject(NormalExcelConstants.FILE_NAME, "成本科目预算");
|
mv.addObject(NormalExcelConstants.FILE_NAME, "成本科目预算");
|
||||||
mv.addObject(NormalExcelConstants.CLASS, CostBudgetDto.class);
|
mv.addObject(NormalExcelConstants.CLASS, CostBudgetDto.class);
|
||||||
@ -407,7 +410,7 @@ public class CostBudgetController {
|
|||||||
String startUser = object.getString("startUser");
|
String startUser = object.getString("startUser");
|
||||||
String projectSn = object.getJSONArray("projectSn").get(0).toString();
|
String projectSn = object.getJSONArray("projectSn").get(0).toString();
|
||||||
String fileName = object.getJSONArray("file").getJSONObject(0).getString("url");
|
String fileName = object.getJSONArray("file").getJSONObject(0).getString("url");
|
||||||
Integer version = object.getJSONArray("version").getJSONObject(0).getInteger("url");
|
Integer version = object.getJSONArray("version").getInteger(0);
|
||||||
String basePath = fileStorageProperties.getLocal().get(0).getBasePath();
|
String basePath = fileStorageProperties.getLocal().get(0).getBasePath();
|
||||||
MultipartFile multipartFile = FileUtil.getMulFileByPath(basePath + fileName);
|
MultipartFile multipartFile = FileUtil.getMulFileByPath(basePath + fileName);
|
||||||
ProjectInfoExtVo projectInfoBySn = projectService.getProjectInfoBySn(projectSn);
|
ProjectInfoExtVo projectInfoBySn = projectService.getProjectInfoBySn(projectSn);
|
||||||
|
|||||||
@ -20,7 +20,7 @@ public interface ICostBudgetService extends IService<CostBudget> {
|
|||||||
|
|
||||||
List<CostBudgetDto> tree(QueryWrapper<CostSubject> wrapper, String projectSn);
|
List<CostBudgetDto> tree(QueryWrapper<CostSubject> wrapper, String projectSn);
|
||||||
|
|
||||||
List<CostBudgetDto> exportList(QueryWrapper<CostSubject> wrapper, ProjectInfoExtVo projectInfoBySn, boolean flag);
|
List<CostBudgetDto> exportList(QueryWrapper<CostSubject> wrapper, ProjectInfoExtVo projectInfoBySn, boolean flag, String level);
|
||||||
|
|
||||||
boolean updateInfo(CostBudget costBudget);
|
boolean updateInfo(CostBudget costBudget);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,15 +80,18 @@ public class CostBudgetServiceImpl extends ServiceImpl<CostBudgetMapper, CostBud
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CostBudgetDto> exportList(QueryWrapper<CostSubject> wrapper, ProjectInfoExtVo projectInfoBySn, boolean flag) {
|
public List<CostBudgetDto> exportList(QueryWrapper<CostSubject> wrapper, ProjectInfoExtVo projectInfoBySn, boolean flag, String level) {
|
||||||
wrapper.lambda().eq(CostSubject::getParentId, 0);
|
wrapper.lambda().eq(CostSubject::getParentId, 0);
|
||||||
List<CostSubject> list = costSubjectService.list(wrapper);
|
List<CostSubject> list = costSubjectService.list(wrapper);
|
||||||
List<CostBudgetDto> dtoList = convert(list);
|
List<CostBudgetDto> dtoList = convert(list);
|
||||||
if (dtoList.size() > 0) {
|
if (dtoList.size() > 0) {
|
||||||
List<CostSubject> allList = costSubjectService.list();
|
List<CostSubject> allList = costSubjectService.list(Wrappers.<CostSubject>lambdaQuery()
|
||||||
|
.eq(CostSubject::getSn, projectInfoBySn.getProjectSn())
|
||||||
|
.eq(CostSubject::getLevelType, 3));
|
||||||
List<CostBudgetDto> allDtoList = convert(allList);
|
List<CostBudgetDto> allDtoList = convert(allList);
|
||||||
List<CostBudget> budgetList = this.list(Wrappers.<CostBudget>lambdaQuery()
|
List<CostBudget> budgetList = this.list(Wrappers.<CostBudget>lambdaQuery()
|
||||||
.eq(CostBudget::getProjectSn, projectInfoBySn.getProjectSn()));
|
.eq(CostBudget::getProjectSn, projectInfoBySn.getProjectSn())
|
||||||
|
.eq(CostBudget::getVersion, level));
|
||||||
getChildren(dtoList, allDtoList, budgetList, flag);
|
getChildren(dtoList, allDtoList, budgetList, flag);
|
||||||
}
|
}
|
||||||
List<CostBudgetDto> resultList = new ArrayList<>();
|
List<CostBudgetDto> resultList = new ArrayList<>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user