|
|
|
@ -2,6 +2,7 @@ package com.zdxt.knowledge.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.google.common.collect.ImmutableMap; |
|
|
|
import com.zdxt.auth.dto.UserBean; |
|
|
|
import com.zdxt.auth.dto.ZdxtFileBean; |
|
|
|
import com.zdxt.auth.feign.FileUploadApi; |
|
|
|
@ -23,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
/** |
|
|
|
@ -42,6 +44,13 @@ public class SceneTabServiceImpl implements ISceneTabService { |
|
|
|
@Autowired |
|
|
|
private ZdxtFileCommonApi zdxtFileCommonApi; |
|
|
|
|
|
|
|
static Map<String, String> TYPE_TAB = ImmutableMap.<String, String>builder() |
|
|
|
.put("pages/index/index", "home") |
|
|
|
.put("pages/scan/scan", "scan") |
|
|
|
.put("pages/knowledge/knowledge", "know") |
|
|
|
.put("pages/my/my", "my") |
|
|
|
.build(); |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询 |
|
|
|
* |
|
|
|
@ -83,6 +92,9 @@ public class SceneTabServiceImpl implements ISceneTabService { |
|
|
|
sceneTab.setCreateTime(DateUtils.getNowDate()); |
|
|
|
} |
|
|
|
sceneTab.setGuid(StringUtils.getUUID()); |
|
|
|
if (!StringUtils.isEmpty(sceneTab.getPagePath())) { |
|
|
|
sceneTab.setType(TYPE_TAB.get(sceneTab.getPagePath())); |
|
|
|
} |
|
|
|
int result = sceneTabMapper.insertSceneTab(sceneTab); |
|
|
|
// 上传文件,并在附件表中添加记录
|
|
|
|
if (result > 0 && ObjectUtil.isNotEmpty(files)) { |
|
|
|
|