Merge remote-tracking branch 'origin/master'
This commit is contained in:
+1
-18
@@ -28,7 +28,7 @@ import java.util.Date;
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="onl_cgform_collection对象", description="我的收藏")
|
||||
public class OnlCgformCollection extends BussDocumentLibraryEO implements Serializable {
|
||||
public class OnlCgformCollection implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@@ -60,21 +60,4 @@ public class OnlCgformCollection extends BussDocumentLibraryEO implements Serial
|
||||
@Excel(name = "文档库id", width = 15, dictTable = "buss_document_library", dicText = "id", dicCode = "id")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "id", dicCode = "id")
|
||||
private String documentId;
|
||||
|
||||
/**状态*/
|
||||
@Excel(name = "状态", width = 15, dictTable = "buss_document_library", dicText = "state", dicCode = "state")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "state", dicCode = "state")
|
||||
private String state;
|
||||
|
||||
/**编号*/
|
||||
@Excel(name = "编号", width = 15, dictTable = "buss_document_library", dicText = "serialNumber", dicCode = "serialNumber")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "serialNumber", dicCode = "serialNumber")
|
||||
private String serialNumber;
|
||||
|
||||
/**标题*/
|
||||
@Excel(name = "标题", width = 15, dictTable = "buss_document_library", dicText = "title", dicCode = "title")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "title", dicCode = "title")
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
}
|
||||
|
||||
+41
-2
@@ -691,9 +691,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//数据字典
|
||||
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
||||
//下拉选处理数据字典
|
||||
List records = infoPage.getRecords();
|
||||
for (Object record : records) {
|
||||
List<Map> records = infoPage.getRecords();
|
||||
List<String> idList = new ArrayList<>();
|
||||
for (Map record : records) {
|
||||
Map<String, Object> record1 = (Map) record;
|
||||
idList.add((String) record1.get("id"));
|
||||
for (Map.Entry<String, Object> entry : record1.entrySet()) {
|
||||
List<OnlCgformField> collect = fieldList.stream()
|
||||
.filter(e -> entry.getKey().equals(e.getDictField()))
|
||||
@@ -702,8 +704,45 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
dictItem(sysDictItems, entry, collect);
|
||||
}
|
||||
}
|
||||
//收藏和订阅
|
||||
collectAndSubscribe(records, idList);
|
||||
return infoPage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 收藏和订阅
|
||||
* @param records
|
||||
* @param idList
|
||||
*/
|
||||
private void collectAndSubscribe(List<Map> records, List<String> idList) {
|
||||
//收藏
|
||||
LambdaQueryWrapper<OnlCgformCollection> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(OnlCgformCollection::getDocumentId,idList);
|
||||
List<OnlCgformCollection> collectList = iOnlCgformCollectionService.list(wrapper);
|
||||
List<String> collectIdList = collectList.stream().map(OnlCgformCollection::getDocumentId).collect(Collectors.toList());
|
||||
//订阅
|
||||
LambdaQueryWrapper<OnlCgformSubscribe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(OnlCgformSubscribe::getDocumentId,idList);
|
||||
List<OnlCgformSubscribe> subscribeList = iOnlCgformSubscribeService.list(lambdaQueryWrapper);
|
||||
List<String> subscribeIdList = subscribeList.stream().map(OnlCgformSubscribe::getDocumentId).collect(Collectors.toList());
|
||||
|
||||
for (Map record : records) {
|
||||
Map<String, Object> record1 = (Map) record;
|
||||
String id = (String) record1.get("id");
|
||||
//收藏标识(0-->未收藏 1-->已收藏)
|
||||
if(collectIdList.contains(id)){
|
||||
record1.put("collectFlag","1");
|
||||
}else{
|
||||
record1.put("collectFlag","0");
|
||||
}
|
||||
//订阅标识
|
||||
if(subscribeIdList.contains(id)){
|
||||
record1.put("subscribeFlag","1");
|
||||
}else{
|
||||
record1.put("subscribeFlag","0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
-23
@@ -63,27 +63,4 @@ public class OnlCgformSubscribe implements Serializable {
|
||||
@Excel(name = "文档库id", width = 15, dictTable = "buss_document_library", dicText = "id", dicCode = "id")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "id", dicCode = "id")
|
||||
private String documentId;
|
||||
|
||||
/**状态*/
|
||||
@Excel(name = "状态", width = 15, dictTable = "buss_document_library", dicText = "state", dicCode = "state")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "state", dicCode = "state")
|
||||
private String state;
|
||||
|
||||
/**编号*/
|
||||
@Excel(name = "编号", width = 15, dictTable = "buss_document_library", dicText = "serialNumber", dicCode = "serialNumber")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "serialNumber", dicCode = "serialNumber")
|
||||
private String serialNumber;
|
||||
|
||||
/**标题*/
|
||||
@Excel(name = "标题", width = 15, dictTable = "buss_document_library", dicText = "title", dicCode = "title")
|
||||
@Dict(dictTable = "buss_document_library", dicText = "title", dicCode = "title")
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
/**技术领域*/
|
||||
@Excel(name = "技术领域", width = 15)
|
||||
@Dict(dicCode = "technology_territory")
|
||||
@ApiModelProperty(value = "技术领域")
|
||||
private String technologyTerritory;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user