|
@@ -306,6 +306,66 @@ public class PageServiceImpl implements PageService {
|
|
|
return ResponseJson.success(pageData);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 项目仪器详情页
|
|
|
+ *
|
|
|
+ * @param equipmentId 项目仪器Id
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson<EquipmentVo> getEquipmentDetails(Integer equipmentId) {
|
|
|
+ if (equipmentId == null) {
|
|
|
+ return ResponseJson.error("参数异常:项目仪器Id不能为空!", null);
|
|
|
+ }
|
|
|
+ //仪器详情
|
|
|
+ EquipmentVo equipment = pageMapper.getEquipmentById(equipmentId);
|
|
|
+ if (null != equipment) {
|
|
|
+ Map<String, List<EquipmentParameterVo>> pageContentMap = new HashMap<>();
|
|
|
+ List<EquipmentParameterVo> firstFloorList = pageMapper.getEquipmentParametersByType(equipmentId, 1);
|
|
|
+ List<EquipmentParameterVo> secondFloorList = pageMapper.getEquipmentParametersByType(equipmentId, 2);
|
|
|
+ List<EquipmentParameterVo> underSecondFloorList = pageMapper.getEquipmentParametersByType(equipmentId, 4);
|
|
|
+ List<EquipmentParameterVo> pcDetailList = pageMapper.getEquipmentParametersByType(equipmentId, 3);
|
|
|
+ List<EquipmentParameterVo> crmDetailList = pageMapper.getEquipmentParametersByType(equipmentId, 5);
|
|
|
+ pageContentMap.put("firstFloorList", firstFloorList);
|
|
|
+ pageContentMap.put("secondFloorList", secondFloorList);
|
|
|
+ pageContentMap.put("underSecondFloorList", underSecondFloorList);
|
|
|
+ pageContentMap.put("pcDetailList", pcDetailList);
|
|
|
+ pageContentMap.put("crmDetailList", crmDetailList);
|
|
|
+ equipment.setPageContentMap(pageContentMap);
|
|
|
+ } else {
|
|
|
+ return ResponseJson.error("该仪器不存在", null);
|
|
|
+ }
|
|
|
+ List<PageFloorVo> floorList = pageMapper.getFloorByPageId(equipmentId, 1);
|
|
|
+ if (floorList.size() > 0) {
|
|
|
+ List<PageFloorVo> tempList = new ArrayList<>();
|
|
|
+ floorList.forEach(floor -> {
|
|
|
+ List<ImageLinkVo> imageLinks = pageMapper.getImageLinkByFloorId(floor.getId());
|
|
|
+ //设置链接类型及参数
|
|
|
+ if (StringUtils.isNotEmpty(floor.getLink())) {
|
|
|
+ floor.setLinkType(AppletsLinkUtil.getLinkType(floor.getLink()));
|
|
|
+ floor.setLinkParam(AppletsLinkUtil.getLinkParam(floor.getLinkType(), floor.getLink()));
|
|
|
+ }
|
|
|
+ if (imageLinks.size() > 0) {
|
|
|
+ imageLinks.forEach(img -> {
|
|
|
+ img.setImage(ImageUtils.getImageURL("actType", img.getImage(), 0, domain));
|
|
|
+ //设置链接类型及参数
|
|
|
+ if (StringUtils.isNotEmpty(img.getLink())) {
|
|
|
+ img.setLinkType(AppletsLinkUtil.getLinkType(img.getLink()));
|
|
|
+ img.setLinkParam(AppletsLinkUtil.getLinkParam(img.getLinkType(), img.getLink()));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ floor.setFloorData(imageLinks);
|
|
|
+ } else {
|
|
|
+ tempList.add(floor);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (tempList.size() > 0) {
|
|
|
+ floorList.removeAll(tempList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ equipment.setFloorList(floorList);
|
|
|
+ return ResponseJson.success(equipment);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 设置跳转参数
|
|
|
* @param floorContent FloorContentVo
|