|
|
@ -1907,8 +1907,6 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
valueMap.put("3","");//建设
|
|
|
|
valueMap.put("4","");//绩效
|
|
|
|
valueMap.put("5","");//验收
|
|
|
|
//只要入库项目
|
|
|
|
projectInfo.setType("1"); |
|
|
|
projectInfo.setDutyWorkplace(projectInfo.getDutyWorkplace()); |
|
|
|
ProjectInfoAuthSelect projectInfoAuthSelect = CommonUtils.setGetProjectInfoAuth(projectInfo); |
|
|
|
Page page = new Page(1, 10000); |
|
|
@ -1963,9 +1961,12 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
showStage.setAcceptanceStage(valueMap.get("5")); |
|
|
|
records.add(showStage); |
|
|
|
} |
|
|
|
List<ShowStageOV> sortedRecord = records.stream().filter(x -> x.getSort() != null).sorted(Comparator.comparingInt(ShowStageOV::getSort)).collect(Collectors.toList()); |
|
|
|
List<ShowStageOV> commonRecord = records.stream().filter(x -> x.getSort() == null).collect(Collectors.toList()); |
|
|
|
sortedRecord.addAll(commonRecord); |
|
|
|
//手动分页
|
|
|
|
int fromIndex = (pageNo - 1) * pageSize; |
|
|
|
List<ShowStageOV> currentPageData = records.subList(fromIndex, Math.min(fromIndex + pageSize, records.size())); |
|
|
|
List<ShowStageOV> currentPageData = sortedRecord.subList(fromIndex, Math.min(fromIndex + pageSize, records.size())); |
|
|
|
result.setSize(pageSize).setCurrent(pageNo).setRecords(currentPageData).setTotal(projectAndChildInfoList.size()); |
|
|
|
return result; |
|
|
|
} |
|
|
@ -2034,6 +2035,40 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public void updateSortByImportFile (MultipartFile file) throws Exception { |
|
|
|
ImportParams importParams = new ImportParams(); |
|
|
|
HashMap<String, String> typeMap = new HashMap<>(); |
|
|
|
//表格标题行数,默认0
|
|
|
|
importParams.setTitleRows(0); |
|
|
|
//是否需要校验上传的Excel
|
|
|
|
importParams.setNeedVerify(true); |
|
|
|
ExcelImportResult<ImportSortOV> result = ExcelImportUtil.importExcelMore(file.getInputStream(), ImportSortOV.class, importParams); |
|
|
|
int count=0; |
|
|
|
if (!result.getList().isEmpty()) { |
|
|
|
for (ImportSortOV request : result.getList()) { |
|
|
|
int re; |
|
|
|
HuzhouProjectinfo projectInfo = new HuzhouProjectinfo(); |
|
|
|
projectInfo.setProjectName(request.getName()); |
|
|
|
projectInfo.setSort(request.getSort()); |
|
|
|
String projectId=""; |
|
|
|
//根据项目名称获取id,
|
|
|
|
LambdaQueryWrapper<HuzhouProjectinfo> query=new LambdaQueryWrapper<>(); |
|
|
|
query.eq(HuzhouProjectinfo::getProjectName,request.getName()); |
|
|
|
List<HuzhouProjectinfo> huzhouProjectinfos = projectinfoMapper.selectList(query); |
|
|
|
if (huzhouProjectinfos.size()>0){ |
|
|
|
projectId=huzhouProjectinfos.get(0).getId(); |
|
|
|
LambdaUpdateWrapper<HuzhouProjectinfo> updateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
updateWrapper.eq(HuzhouProjectinfo::getId,projectId); |
|
|
|
updateWrapper.set(HuzhouProjectinfo::getSort, request.getSort()); |
|
|
|
projectinfoMapper.update(null,updateWrapper); |
|
|
|
count=count+1; |
|
|
|
} |
|
|
|
} |
|
|
|
System.out.println("更新成功条数"+count); |
|
|
|
for (ImportSortOV request : result.getFailList()) { |
|
|
|
System.out.println(request); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|