|
@@ -230,6 +230,52 @@ public class PageServiceImpl implements PageService {
|
|
|
return ResponseJson.success(map);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 二级专题页楼层数据
|
|
|
+ *
|
|
|
+ * @param pageId 页面id
|
|
|
+ * @param source 来源 : 1 网站 ; 2 小程序
|
|
|
+ */
|
|
|
+ @Cacheable(value = "getPageFloorData", key = "#userId +'-'+ #pageId +'-'+ #source", unless = "#result == null")
|
|
|
+ @Override
|
|
|
+ public ResponseJson<Map<String, Object>> getPageFloors(Integer pageId, Integer source) {
|
|
|
+ if (pageId == null) {
|
|
|
+ return ResponseJson.error("参数异常: 页面id不能为空!", null);
|
|
|
+ }
|
|
|
+ source = source == null ? 1 : source;
|
|
|
+ List<PageFloorVo> floorList = pageMapper.getFloorByPageId(pageId, source);
|
|
|
+ if (!CollectionUtils.isEmpty(floorList)) {
|
|
|
+ floorList.forEach(floor -> {
|
|
|
+ if (StringUtils.isNotEmpty(floor.getLink())) {
|
|
|
+ floor.setLinkType(AppletsLinkUtil.getLinkType(floor.getLink()));
|
|
|
+ floor.setLinkParam(AppletsLinkUtil.getLinkParam(floor.getLinkType(), floor.getLink()));
|
|
|
+ }
|
|
|
+ List<ImageLinkVo> floorData = pageMapper.getImageLinkByFloorId(floor.getId());
|
|
|
+ if (!CollectionUtils.isEmpty(floorData)) {
|
|
|
+ floorData.forEach(data -> {
|
|
|
+ if (StringUtils.isNotEmpty(data.getLink())) {
|
|
|
+ data.setLinkType(AppletsLinkUtil.getLinkType(data.getLink()));
|
|
|
+ data.setLinkParam(AppletsLinkUtil.getLinkParam(data.getLinkType(), data.getLink()));
|
|
|
+ }
|
|
|
+ data.setImage(ImageUtils.getImageURL("actType", data.getImage(), 0, domain));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ floor.setFloorData(floorData);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 页面详情
|
|
|
+ PageDetailVo topicPage = pageMapper.getPageDetails(pageId, 1);
|
|
|
+ if (topicPage != null && StringUtils.isNotBlank(topicPage.getButtonLink())) {
|
|
|
+ Integer linkType = AppletsLinkUtil.getLinkType(topicPage.getButtonLink());
|
|
|
+ topicPage.setLinkType(linkType);
|
|
|
+ topicPage.setLinkParam(AppletsLinkUtil.getLinkParam(linkType, topicPage.getButtonLink()));
|
|
|
+ }
|
|
|
+ Map<String, Object> map = new HashMap<>(2);
|
|
|
+ map.put("page", topicPage);
|
|
|
+ map.put("floorList", floorList);
|
|
|
+ return ResponseJson.success(map);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 活动专题楼层数据(美博会)
|
|
|
*
|
|
@@ -237,9 +283,9 @@ public class PageServiceImpl implements PageService {
|
|
|
* @param userId 用户id
|
|
|
* @param source 来源 : 1 网站 ; 2 小程序
|
|
|
*/
|
|
|
- @Cacheable(value = "getPageFloorData", key = "#userId +'-'+ #pageId +'-'+ #source", unless = "#result == null")
|
|
|
+ @Cacheable(value = "getPageBeautyData", key = "#userId +'-'+ #pageId +'-'+ #source", unless = "#result == null")
|
|
|
@Override
|
|
|
- public ResponseJson<Map<String, Object>> getPageData(Integer pageId, Integer userId, Integer source) {
|
|
|
+ public ResponseJson<Map<String, Object>> getPageBeautyData(Integer pageId, Integer userId, Integer source) {
|
|
|
if (pageId == null) {
|
|
|
return ResponseJson.error("参数异常: 页面id不能为空!", null);
|
|
|
}
|
|
@@ -247,7 +293,7 @@ public class PageServiceImpl implements PageService {
|
|
|
// 页面数据
|
|
|
CmPageVo page = pageMapper.findCmPageById(pageId);
|
|
|
//轮播图设置链接类型
|
|
|
- if (StringUtils.isNotBlank(page.getHeadLink())) {
|
|
|
+ if (null != page && StringUtils.isNotBlank(page.getHeadLink())) {
|
|
|
Integer linkType = AppletsLinkUtil.getLinkType(page.getHeadLink());
|
|
|
page.setLinkType(linkType);
|
|
|
page.setLinkParam(AppletsLinkUtil.getLinkParam(linkType, page.getHeadLink()));
|
|
@@ -541,12 +587,12 @@ public class PageServiceImpl implements PageService {
|
|
|
* @param equipmentId 项目仪器Id
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResponseJson<EquipmentVo> getEquipmentDetails(Integer equipmentId) {
|
|
|
+ public ResponseJson<PageDetailVo> getEquipmentDetails(Integer equipmentId) {
|
|
|
if (equipmentId == null) {
|
|
|
return ResponseJson.error("参数异常:项目仪器Id不能为空!", null);
|
|
|
}
|
|
|
//仪器详情
|
|
|
- EquipmentVo equipment = pageMapper.getEquipmentById(equipmentId);
|
|
|
+ PageDetailVo equipment = pageMapper.getPageDetails(equipmentId, 2);
|
|
|
if (null != equipment) {
|
|
|
Map<String, List<EquipmentParameterVo>> pageContentMap = new HashMap<>();
|
|
|
List<EquipmentParameterVo> firstFloorList = pageMapper.getEquipmentParametersByType(equipmentId, 1);
|