热乎的蠢代码
我不想说了,大家自己看吧。
@Test
public void countErr() {
int number = 1;
Page<DfCatalogueEntity> page = new Page();
page.setSize(1000);
page.setTotal(number);
Page<DfCatalogueEntity> page1 = idfCatalogueService.page(page);
List<DfCatalogueEntity> records = page1.getRecords();
for (DfCatalogueEntity dfCatalogue : records) {
LySDocbaseEntity entity = docbaseService.selectFileEntity(dfCatalogue.getFileId());
if (ObjectUtils.isEmpty(entity)){
log.info(dfCatalogue.getFileId()+dfCatalogue.getCataName()+"概述表中未能找到");
continue;
}
String cqly=entity.getDjlx()+"_"+ entity.getCqly();
DictDataTypeDTO dto = new DictDataTypeDTO();
dto.setDictName(cqly);
List<DictDataVO> dictDataVOS = dossierManageService.queryDictType(dto);
for (DictDataVO dictDataVO : dictDataVOS) {
if (dictDataVO.getDictLabel().equals(dfCatalogue.getCataName())) {
dfCatalogue.setOrderNo(dictDataVO.getDictSort());
}
}
dictDataVOS.forEach(m->{
if (m.getDictLabel().equals(dfCatalogue.getCataName())&&m.getDictSort().equals(dfCatalogue.getOrderNo())){
dfCatalogue.setOrderNo(m.getDictSort());
idfCatalogueService.updateById(dfCatalogue);
log.error(dfCatalogue.getFileId()+dfCatalogue.getCataId()+"更新序号");
}
});
}
}
秉承能查多次,就查多次!