add 获取列表表头
This commit is contained in:
+10
@@ -11,6 +11,8 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@@ -41,4 +43,12 @@ public class LawsBasicInfoController extends JeroController<LawsBasicInfo, ILaws
|
|||||||
public Result<IPage<Map<String,Object>>> getForeignStandardPage(@RequestBody Map<String,Object> parameter) {
|
public Result<IPage<Map<String,Object>>> getForeignStandardPage(@RequestBody Map<String,Object> parameter) {
|
||||||
return Result.OK(lawsBasicInfoService.getForeignStandardPage(parameter));
|
return Result.OK(lawsBasicInfoService.getForeignStandardPage(parameter));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "获取列表表头")
|
||||||
|
@ApiOperation(value="获取列表表头", notes="获取列表表头")
|
||||||
|
@GetMapping(value = "getListHeader")
|
||||||
|
public Result<List<Map<String,Object>>> getListHeader(@RequestParam(name="flag") String flag) {
|
||||||
|
return Result.OK(lawsBasicInfoService.getListHeader(flag));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+8
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.jero.modules.laws.regulation.entity.LawsBasicInfo;
|
import com.jero.modules.laws.regulation.entity.LawsBasicInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,4 +27,11 @@ public interface ILawsBasicInfoService extends IService<LawsBasicInfo> {
|
|||||||
* @Description: 标准法规库(海外标准)-分页列表查询
|
* @Description: 标准法规库(海外标准)-分页列表查询
|
||||||
**/
|
**/
|
||||||
IPage<Map<String,Object>> getForeignStandardPage(Map<String, Object> parameter);
|
IPage<Map<String,Object>> getForeignStandardPage(Map<String, Object> parameter);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/8/23 9:37
|
||||||
|
* @Description: 获取列表表头
|
||||||
|
**/
|
||||||
|
List<Map<String, Object>> getListHeader(String flag);
|
||||||
}
|
}
|
||||||
|
|||||||
+52
-2
@@ -117,7 +117,7 @@ public class LawsBasicInfoServiceImpl extends ServiceImpl<LawsBasicInfoMapper, L
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 列表显示的时候,将ids替换成names
|
||||||
if(!fileIdLidt.isEmpty()){
|
if(!fileIdLidt.isEmpty()){
|
||||||
List<OSSFile> fileInfos = ossFileService.getFileInfos(StringUtils.join(fileIdLidt, ","));
|
List<OSSFile> fileInfos = ossFileService.getFileInfos(StringUtils.join(fileIdLidt, ","));
|
||||||
if(!fileInfos.isEmpty()){
|
if(!fileInfos.isEmpty()){
|
||||||
@@ -137,7 +137,8 @@ public class LawsBasicInfoServiceImpl extends ServiceImpl<LawsBasicInfoMapper, L
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//收藏和订阅
|
||||||
|
//collectAndSubscribe(records, idList);
|
||||||
return infoPage;
|
return infoPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,6 +152,55 @@ public class LawsBasicInfoServiceImpl extends ServiceImpl<LawsBasicInfoMapper, L
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/8/23 9:37
|
||||||
|
* @Description: 获取列表表头
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> getListHeader(String flag) {
|
||||||
|
LanguageEnum language = MessageUtils.getLanguage();
|
||||||
|
// 获取当前表字段集合
|
||||||
|
List<LawsTag> fieldList = getFieldList(flag);
|
||||||
|
// 筛选出用于列表显示的字段(isShowList **列表是否显示0否 1是*)
|
||||||
|
fieldList = fieldList.stream().filter(lawsTag -> YesOrNoEnum.YES.getInteger()
|
||||||
|
.equals(lawsTag.getIsShowList())).collect(Collectors.toList());
|
||||||
|
List<Map<String, Object>> resultList = new java.util.ArrayList<>();
|
||||||
|
for (LawsTag lawsTag : fieldList) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
// 字段属性为输入框(链接)的点击跳转标识
|
||||||
|
if(FieldTypeEnum.TEXT_LINK.getValue().equals(lawsTag.getFieldShowType())){
|
||||||
|
map.put("urlClick","true");
|
||||||
|
}
|
||||||
|
// 字段名
|
||||||
|
String dbFieldName = lawsTag.getDbFieldName();
|
||||||
|
// 字段名为标准号、标准名称的点击跳转标识
|
||||||
|
if ("standard_num".equals(dbFieldName) || "standard_name".equals(dbFieldName)) {
|
||||||
|
//跳转详情的标识
|
||||||
|
map.put("click", "true");
|
||||||
|
}
|
||||||
|
// 字段为发布日期、实施日期、新车型实施日期、在产车实施日期、标准状态的有排序箭头标识
|
||||||
|
// 注:先写两个做下记号,数据库里面有sort_flag字段做标识,后面可以删掉下面两个判断。
|
||||||
|
// 发布日期
|
||||||
|
if ("release_date".equals(lawsTag.getDbFieldName())) {
|
||||||
|
map.put("sort", "true"); //列表排序标识
|
||||||
|
}
|
||||||
|
// 实施日期
|
||||||
|
if ("implement_date".equals(lawsTag.getDbFieldName())) {
|
||||||
|
map.put("sort", "true"); //列表排序标识
|
||||||
|
}
|
||||||
|
// 用于排序传参以及列表表头显示
|
||||||
|
map.put("db_field_name", lawsTag.getDbFieldName()); //字段名
|
||||||
|
if (LanguageEnum.CN.equals(language)) {
|
||||||
|
map.put("db_field_txt", lawsTag.getDbFieldTxt());//字段中文名
|
||||||
|
} else {
|
||||||
|
map.put("db_field_txt", lawsTag.getDbFieldEnName());//字段英文名
|
||||||
|
}
|
||||||
|
resultList.add(map);
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: liao
|
* @Author: liao
|
||||||
* @Date: 2023/8/22 13:41
|
* @Date: 2023/8/22 13:41
|
||||||
|
|||||||
Reference in New Issue
Block a user