Bläddra i källkod

案件添加场景修改

lyhzzz 3 år sedan
förälder
incheckning
0f7c7038c5
22 ändrade filer med 529 tillägg och 217 borttagningar
  1. 76 0
      src/main/java/com/fdkankan/fusion/controller/CaseTagController.java
  2. 62 0
      src/main/java/com/fdkankan/fusion/controller/CaseTagPointController.java
  3. 0 62
      src/main/java/com/fdkankan/fusion/controller/HotController.java
  4. 3 6
      src/main/java/com/fdkankan/fusion/controller/HotIconController.java
  5. 47 26
      src/main/java/com/fdkankan/fusion/entity/Hot.java
  6. 67 0
      src/main/java/com/fdkankan/fusion/entity/CaseTagPoint.java
  7. 3 3
      src/main/java/com/fdkankan/fusion/generate/AutoGenerate.java
  8. 3 3
      src/main/java/com/fdkankan/fusion/mapper/IHotMapper.java
  9. 22 0
      src/main/java/com/fdkankan/fusion/mapper/ICaseTagPointMapper.java
  10. 3 1
      src/main/java/com/fdkankan/fusion/request/CaseParam.java
  11. 24 0
      src/main/java/com/fdkankan/fusion/response/CaseTagPointVo.java
  12. 9 0
      src/main/java/com/fdkankan/fusion/response/GroupCount.java
  13. 1 1
      src/main/java/com/fdkankan/fusion/service/ICaseNumService.java
  14. 25 0
      src/main/java/com/fdkankan/fusion/service/ICaseTagPointService.java
  15. 20 0
      src/main/java/com/fdkankan/fusion/service/ICaseTagService.java
  16. 0 25
      src/main/java/com/fdkankan/fusion/service/IHotService.java
  17. 12 14
      src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java
  18. 82 0
      src/main/java/com/fdkankan/fusion/service/impl/CaseTagPointServiceImpl.java
  19. 61 0
      src/main/java/com/fdkankan/fusion/service/impl/CaseTagServiceImpl.java
  20. 0 75
      src/main/java/com/fdkankan/fusion/service/impl/HotServiceImpl.java
  21. 1 1
      src/main/resources/mapper/fusion/HotMapper.xml
  22. 8 0
      src/main/resources/mapper/fusion/CaseTagPointMapper.xml

+ 76 - 0
src/main/java/com/fdkankan/fusion/controller/CaseTagController.java

@@ -0,0 +1,76 @@
+package com.fdkankan.fusion.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.entity.CaseTag;
+import com.fdkankan.fusion.entity.CaseTagPoint;
+import com.fdkankan.fusion.exception.BusinessException;
+import com.fdkankan.fusion.service.ICaseTagPointService;
+import com.fdkankan.fusion.service.ICaseTagService;
+import com.fdkankan.fusion.service.IHotIconService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2022-08-08
+ */
+@RestController
+@RequestMapping("/caseTag")
+public class CaseTagController {
+
+    @Autowired
+    ICaseTagService caseTagService;
+    @Autowired
+    IHotIconService hotIconService;
+
+
+    @PostMapping("/add")
+    public ResultData add(@RequestBody CaseTag caseTag){
+        if(caseTag.getHotIconId()==null ||  StringUtils.isEmpty(caseTag.getHotIconUrl())
+              ||caseTag.getCaseId() == null  || StringUtils.isEmpty(caseTag.getTagTitle())){
+            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        //新增时取消icon上次使用标识,增加使用次数,设置新的上次使用标识
+        if(caseTag.getHotIconId() !=null){
+            hotIconService.addUseNum(caseTag.getHotIconId());
+        }
+        caseTagService.save(caseTag);
+        return ResultData.ok();
+    }
+
+    @GetMapping("/allList")
+    public ResultData allList(@RequestParam(required = false) Integer caseId,
+                              @RequestParam(required = false)String tagTitle){
+        return ResultData.ok(caseTagService.allList(caseId,tagTitle));
+    }
+
+    @PostMapping("/delete")
+    public ResultData delete(@RequestBody CaseTag caseTag){
+        if(caseTag.getTagId() == null){
+            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        caseTagService.removeById(caseTag.getTagId());
+        return ResultData.ok();
+    }
+    @PostMapping("/updateSort")
+    public ResultData updateSort(@RequestBody CaseTag caseTag){
+        if(caseTag.getTagId() == null || caseTag.getSort() == null){
+            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        LambdaUpdateWrapper<CaseTag> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(CaseTag::getTagId,caseTag.getTagId()).set(CaseTag::getSort,caseTag.getSort());
+        caseTagService.update(wrapper);
+        return ResultData.ok();
+    }
+
+
+}
+

+ 62 - 0
src/main/java/com/fdkankan/fusion/controller/CaseTagPointController.java

@@ -0,0 +1,62 @@
+package com.fdkankan.fusion.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.entity.CaseTag;
+import com.fdkankan.fusion.entity.CaseTagPoint;
+import com.fdkankan.fusion.exception.BusinessException;
+import com.fdkankan.fusion.service.ICaseTagPointService;
+import com.fdkankan.fusion.service.ICaseTagService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2022-08-08
+ */
+@RestController
+@RequestMapping("/caseTagPoint")
+public class CaseTagPointController {
+
+    @Autowired
+    ICaseTagPointService caseTagPointService;
+
+
+    @PostMapping("/place")
+    public ResultData place(@RequestBody CaseTagPoint caseTagPoint){
+        caseTagPointService.place(caseTagPoint);
+        return ResultData.ok();
+    }
+
+    @GetMapping("/allList")
+    public ResultData allList(@RequestParam(required = false) Integer tagId){
+        return ResultData.ok(caseTagPointService.allList(tagId));
+    }
+
+    @PostMapping("/updateSort")
+    public ResultData updateSort(@RequestBody CaseTagPoint caseTagPoint){
+        if(caseTagPoint.getTagPointId() == null || caseTagPoint.getSort() == null){
+            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        LambdaUpdateWrapper<CaseTagPoint> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(CaseTagPoint::getTagPointId,caseTagPoint.getTagPointId() ).set(CaseTagPoint::getSort,caseTagPoint.getSort());
+        caseTagPointService.update(wrapper);
+        return ResultData.ok();
+    }
+    @PostMapping("/delete")
+    public ResultData delete(@RequestBody CaseTagPoint caseTagPoint){
+        if(caseTagPoint.getTagPointId() == null ){
+            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        caseTagPointService.removeById(caseTagPoint.getTagPointId());
+        return ResultData.ok();
+    }
+}
+

+ 0 - 62
src/main/java/com/fdkankan/fusion/controller/HotController.java

@@ -1,62 +0,0 @@
-package com.fdkankan.fusion.controller;
-
-
-import cn.hutool.jwt.JWT;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.response.ResultData;
-import com.fdkankan.common.util.JwtUtil;
-import com.fdkankan.fusion.entity.Hot;
-import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.fusion.service.IHotIconService;
-import com.fdkankan.fusion.service.IHotService;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author 
- * @since 2022-08-03
- */
-@RestController
-@RequestMapping("/hot")
-public class HotController {
-
-    @Autowired
-    IHotService hotService;
-    @Autowired
-    IHotIconService hotIconService;
-
-    @GetMapping("/list")
-    public ResultData list(@RequestParam(required = false)Integer fusionId, @RequestParam(required = false) Integer caseId){
-        return ResultData.ok(hotService.getList(fusionId,caseId));
-    }
-
-    @PostMapping("/addOrUpdate")
-    public ResultData save(@RequestBody Hot hot,@RequestHeader String token){
-        if(hot.getFusionId() == null || StringUtils.isEmpty(hot.getHotTitle())
-                || hot.getHotIconId() == null || StringUtils.isEmpty(hot.getHotIconUrl())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
-        }
-        //新增时取消icon上次使用标识,增加使用次数,设置新的上次使用标识
-        if(hot.getHotId()==null){
-            hotIconService.addUseNum(hot.getHotIconId());
-        }
-        hotService.saveOrUpdate(hot);
-        return ResultData.ok();
-    }
-
-    @PostMapping("/delete")
-    public ResultData delete(@RequestBody Hot hot){
-        if(hot.getHotId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
-        }
-        hotService.removeById(hot);
-        return ResultData.ok();
-    }
-
-}
-

+ 3 - 6
src/main/java/com/fdkankan/fusion/controller/HotIconController.java

@@ -1,15 +1,13 @@
 package com.fdkankan.fusion.controller;
 
 
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.common.response.Result;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.common.util.JwtUtil;
 import com.fdkankan.fusion.entity.HotIcon;
+import com.fdkankan.fusion.service.ICaseTagService;
 import com.fdkankan.fusion.service.IHotIconService;
-import com.fdkankan.fusion.service.IHotService;
 import com.fdkankan.fusion.service.impl.UploadService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,7 +32,7 @@ public class HotIconController {
     @Autowired
     IHotIconService hotIconService;
     @Autowired
-    IHotService hotService;
+    ICaseTagService caseTagService;
     @Autowired
     UploadService uploadService;
 
@@ -71,8 +69,7 @@ public class HotIconController {
         if(hotIcon.getIconId() == null){
             throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
         }
-
-        hotService.updateDefaultIcon(hotIcon.getIconId());
+        caseTagService.updateDFHotIcon(hotIcon.getIconId());
         hotIconService.removeById(hotIcon.getIconId());
         return ResultData.ok();
     }

+ 47 - 26
src/main/java/com/fdkankan/fusion/entity/Hot.java

@@ -16,61 +16,83 @@ import lombok.Setter;
  * </p>
  *
  * @author 
- * @since 2022-08-03
+ * @since 2022-08-08
  */
 @Getter
 @Setter
-@TableName("t_hot")
-public class Hot implements Serializable {
+@TableName("t_case_tag")
+public class CaseTag implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
     /**
-     * 热点id
+     * 标注表
      */
-    @TableId(value = "hot_id", type = IdType.AUTO)
-    private Integer hotId;
+    @TableId(value = "tag_id", type = IdType.AUTO)
+    private Integer tagId;
 
     /**
-     * 热点标题
+     * 标题
      */
-    @TableField("hot_title")
-    private String hotTitle;
+    @TableField("tag_title")
+    private String tagTitle;
 
     /**
-     * 热点内容json
+     * 描述
      */
-    @TableField("hot_msg")
-    private String hotMsg;
+    @TableField("tag_describe")
+    private String tagDescribe;
 
     /**
-     * 热点附件链接json
+     * 遗留部位
      */
-    @TableField("hot_info")
-    private String hotInfo;
+    @TableField("leave_behind")
+    private String leaveBehind;
 
     /**
-     * 热点位置
+     * 提取方法
      */
-    @TableField("hot_point")
-    private String hotPoint;
+    @TableField("get_method")
+    private String getMethod;
 
-    @TableField("fusion_id")
-    private Integer fusionId;
+    /**
+     * 提取人
+     */
+    @TableField("get_user")
+    private String getUser;
 
     /**
-     * 热点icon链接
+     * 标注图片集
      */
-    @TableField("hot_icon_id")
-    private Integer hotIconId;
+    @TableField("tag_img_url")
+    private String tagImgUrl;
+
     /**
-     * 热点icon链接
+     * 热点iconurl
      */
     @TableField("hot_icon_url")
     private String hotIconUrl;
+
     /**
-     * 热点icon链接
+     * 热点iconid
      */
+    @TableField("hot_icon_id")
+    private Integer hotIconId;
+    /**
+     * 案件id
+     */
+    @TableField("case_id")
+    private Integer caseId;
+    /**
+     * 放置数量
+     */
+    @TableField("place_num")
+    private Long placeNum;
+    /**
+     * 排序
+     */
+    @TableField("sort")
+    private Integer sort;
 
     @TableField("tb_status")
     @TableLogic
@@ -83,5 +105,4 @@ public class Hot implements Serializable {
     private String updateTime;
 
 
-
 }

+ 67 - 0
src/main/java/com/fdkankan/fusion/entity/CaseTagPoint.java

@@ -0,0 +1,67 @@
+package com.fdkankan.fusion.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2022-08-08
+ */
+@Getter
+@Setter
+@TableName("t_case_tag_point")
+public class CaseTagPoint implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 标注位置表
+     */
+    @TableId("tag_point_id")
+    private Integer tagPointId;
+
+    /**
+     * 位置名称
+     */
+    @TableField("tag_point_title")
+    private String tagPointTitle;
+
+    /**
+     * 位置json
+     */
+    @TableField("tag_point")
+    private String tagPoint;
+
+    /**
+     * 标注id
+     */
+    @TableField("tag_id")
+    private Integer tagId;
+    /**
+     * 排序
+     */
+    @TableField("sort")
+    private Integer sort;
+
+    @TableField("tb_status")
+    @TableLogic
+    private Integer tbStatus;
+
+    @TableField("create_time")
+    private String createTime;
+
+    @TableField("update_time")
+    private String updateTime;
+
+
+}

+ 3 - 3
src/main/java/com/fdkankan/fusion/generate/AutoGenerate.java

@@ -18,7 +18,7 @@ public class AutoGenerate {
         String path =System.getProperty("user.dir") ;
 
         generate(path,"fusion", getTables(new String[]{
-                "t_fusion_num",
+                "t_case_tag_point",
         }));
 
 //        generate(path,"goods", getTables(new String[]{
@@ -46,8 +46,8 @@ public class AutoGenerate {
 
 
     public static void  generate(String path,String moduleName,  List<String> tables){
-        FastAutoGenerator.create("jdbc:mysql://127.0.0.1:3306/fd_fusion",
-                "root","123456")
+        FastAutoGenerator.create("jdbc:mysql://192.168.0.47:13306/fd_fusion",
+                "root","4dkk2020cuikuan%")
                 .globalConfig(builder -> {
                     builder.author("")               //作者
                             .outputDir(path+"\\src\\main\\java")    //输出路径(写到java目录)

+ 3 - 3
src/main/java/com/fdkankan/fusion/mapper/IHotMapper.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.mapper;
 
-import com.fdkankan.fusion.entity.Hot;
+import com.fdkankan.fusion.entity.CaseTag;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 
@@ -10,9 +10,9 @@ import org.apache.ibatis.annotations.Mapper;
  * </p>
  *
  * @author 
- * @since 2022-08-03
+ * @since 2022-08-08
  */
 @Mapper
-public interface IHotMapper extends BaseMapper<Hot> {
+public interface ICaseTagMapper extends BaseMapper<CaseTag> {
 
 }

+ 22 - 0
src/main/java/com/fdkankan/fusion/mapper/ICaseTagPointMapper.java

@@ -0,0 +1,22 @@
+package com.fdkankan.fusion.mapper;
+
+import com.fdkankan.fusion.entity.CaseTagPoint;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fdkankan.fusion.response.GroupCount;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2022-08-08
+ */
+@Mapper
+public interface ICaseTagPointMapper extends BaseMapper<CaseTagPoint> {
+
+    List<GroupCount> getGroupByTagId();
+}

+ 3 - 1
src/main/java/com/fdkankan/fusion/request/CaseParam.java

@@ -3,9 +3,11 @@ package com.fdkankan.fusion.request;
 import com.fdkankan.common.request.RequestBase;
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 public class CaseParam extends RequestBase {
     private Integer caseId;
     private String caseTitle;
-    private SceneNumParam sceneNumParam;
+    private List<SceneNumParam> sceneNumParam;
 }

+ 24 - 0
src/main/java/com/fdkankan/fusion/response/CaseTagPointVo.java

@@ -0,0 +1,24 @@
+package com.fdkankan.fusion.response;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fdkankan.fusion.entity.CaseTag;
+import lombok.Data;
+
+@Data
+public class CaseTagPointVo extends CaseTag {
+    /**
+     * 标注位置表
+     */
+    private Integer tagPointId;
+
+    /**
+     * 位置名称
+     */
+    private String tagPointTitle;
+
+    /**
+     * 位置json
+     */
+    private String tagPoint;
+}

+ 9 - 0
src/main/java/com/fdkankan/fusion/response/GroupCount.java

@@ -0,0 +1,9 @@
+package com.fdkankan.fusion.response;
+
+import lombok.Data;
+
+@Data
+public class GroupCount {
+    private Integer id;
+    private Long count;
+}

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/ICaseNumService.java

@@ -20,7 +20,7 @@ public interface ICaseNumService extends IService<CaseNumEntity> {
     List<CaseNumEntity> getByCaseId(Integer caseId);
 
 
-    void addBatch(Integer caseId, SceneNumParam sceneNumParam);
+    void addBatch(Integer caseId, List<SceneNumParam> sceneNumParam);
 
     void deleteByCaseId(Integer caseId);
 

+ 25 - 0
src/main/java/com/fdkankan/fusion/service/ICaseTagPointService.java

@@ -0,0 +1,25 @@
+package com.fdkankan.fusion.service;
+
+import com.fdkankan.fusion.entity.CaseTagPoint;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.HashMap;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2022-08-08
+ */
+public interface ICaseTagPointService extends IService<CaseTagPoint> {
+
+    HashMap<Integer, Long> getGroupByTagId();
+
+    Long getCountByTagId(Integer tagId);
+
+    void place(CaseTagPoint caseTagPoint);
+
+    Object allList(Integer tagId);
+}

+ 20 - 0
src/main/java/com/fdkankan/fusion/service/ICaseTagService.java

@@ -0,0 +1,20 @@
+package com.fdkankan.fusion.service;
+
+import com.fdkankan.fusion.entity.CaseTag;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.fusion.entity.CaseTagPoint;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2022-08-08
+ */
+public interface ICaseTagService extends IService<CaseTag> {
+
+    Object allList(Integer caseId, String tagTitle);
+
+    void updateDFHotIcon(Integer iconId);
+}

+ 0 - 25
src/main/java/com/fdkankan/fusion/service/IHotService.java

@@ -1,25 +0,0 @@
-package com.fdkankan.fusion.service;
-
-import com.fdkankan.fusion.entity.Hot;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-import java.util.List;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 
- * @since 2022-08-03
- */
-public interface IHotService extends IService<Hot> {
-
-    /**
-     * 重置为默认icon
-     * @param iconId id
-     */
-    void updateDefaultIcon(Integer iconId);
-
-    List<Hot> getList(Integer fusionId,Integer caseId);
-}

+ 12 - 14
src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java

@@ -48,24 +48,22 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
 
 
     @Override
-    public void addBatch(Integer caseId, SceneNumParam sceneNumParam) {
+    public void addBatch(Integer caseId, List<SceneNumParam> sceneNumParam) {
+
+        this.deleteByCaseId(caseId);
 
-        List<CaseNumEntity> caseNumEntityList = this.getByCaseId(caseId);
         List<CaseNumEntity> newCaseNums = new ArrayList<>();
-        for (String num : sceneNumParam.getNumList()) {
-            if(caseNumEntityList.size() >0){
-                List<String> inNums = caseNumEntityList.parallelStream().map(CaseNumEntity::getNum).collect(Collectors.toList());
-                if(inNums.contains(num)){
-                    continue;
-                }
+        for (SceneNumParam param : sceneNumParam) {
+            for (String num : param.getNumList()) {
+                CaseNumEntity caseNumEntity = new CaseNumEntity();
+                caseNumEntity.setCaseId(caseId);
+                caseNumEntity.setNumType(param.getType());
+                caseNumEntity.setNum(num);
+                caseNumEntity.setGlbUrl(getGlbUrl(param.getType(),num));
+                newCaseNums.add(caseNumEntity);
             }
-            CaseNumEntity caseNumEntity = new CaseNumEntity();
-            caseNumEntity.setCaseId(caseId);
-            caseNumEntity.setNumType(sceneNumParam.getType());
-            caseNumEntity.setNum(num);
-            caseNumEntity.setGlbUrl(getGlbUrl(sceneNumParam.getType(),num));
-            newCaseNums.add(caseNumEntity);
         }
+
         if(newCaseNums.size() >0){
             this.saveBatch(newCaseNums);
         }

+ 82 - 0
src/main/java/com/fdkankan/fusion/service/impl/CaseTagPointServiceImpl.java

@@ -0,0 +1,82 @@
+package com.fdkankan.fusion.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.entity.CaseTag;
+import com.fdkankan.fusion.entity.CaseTagPoint;
+import com.fdkankan.fusion.exception.BusinessException;
+import com.fdkankan.fusion.mapper.ICaseTagPointMapper;
+import com.fdkankan.fusion.response.CaseTagPointVo;
+import com.fdkankan.fusion.response.GroupCount;
+import com.fdkankan.fusion.service.ICaseTagPointService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.fusion.service.ICaseTagService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2022-08-08
+ */
+@Service
+public class CaseTagPointServiceImpl extends ServiceImpl<ICaseTagPointMapper, CaseTagPoint> implements ICaseTagPointService {
+
+    @Autowired
+    ICaseTagService caseTagService;
+
+    @Override
+    public HashMap<Integer, Long> getGroupByTagId() {
+        List<GroupCount> list = this.getBaseMapper().getGroupByTagId();
+        HashMap<Integer,Long> map = new HashMap<>();
+        list.forEach(entity -> map.put(entity.getId(),entity.getCount()));
+        return map;
+    }
+
+    @Override
+    public void place(CaseTagPoint caseTagPoint) {
+        if(caseTagPoint.getTagId() == null || StringUtils.isEmpty(caseTagPoint.getTagPoint())){
+            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+        }
+        if(StringUtils.isEmpty(caseTagPoint.getTagPointTitle())){
+            Long count = this.getCountByTagId(caseTagPoint.getTagId());
+            caseTagPoint.setTagPointTitle("位置"+count+1);
+        }
+        this.save(caseTagPoint);
+    }
+
+    @Override
+    public Long getCountByTagId(Integer tagId) {
+        LambdaQueryWrapper<CaseTagPoint> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseTagPoint::getTagId,tagId);
+        return this.count(wrapper);
+    }
+
+    @Override
+    public Object allList(Integer tagId) {
+        CaseTag caseTag = caseTagService.getById(tagId);
+        if(caseTag == null){
+            return new ArrayList<>();
+        }
+        LambdaQueryWrapper<CaseTagPoint> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseTagPoint::getTagId,tagId);
+        List<CaseTagPoint> list = this.list(wrapper);
+        List<CaseTagPointVo> caseTagPointVoList = new ArrayList<>();
+        for (CaseTagPoint caseTagPoint : list) {
+            CaseTagPointVo caseTagPointVo = new CaseTagPointVo();
+            BeanUtils.copyProperties(caseTagPoint,caseTagPointVo);
+            BeanUtils.copyProperties(caseTag,caseTagPointVo);
+            caseTagPointVoList.add(caseTagPointVo);
+        }
+        return caseTagPointVoList;
+    }
+}

+ 61 - 0
src/main/java/com/fdkankan/fusion/service/impl/CaseTagServiceImpl.java

@@ -0,0 +1,61 @@
+package com.fdkankan.fusion.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.entity.CaseTag;
+import com.fdkankan.fusion.entity.CaseTagPoint;
+import com.fdkankan.fusion.entity.HotIcon;
+import com.fdkankan.fusion.exception.BusinessException;
+import com.fdkankan.fusion.mapper.ICaseTagMapper;
+import com.fdkankan.fusion.service.ICaseTagPointService;
+import com.fdkankan.fusion.service.ICaseTagService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.fusion.service.IHotIconService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2022-08-08
+ */
+@Service
+public class CaseTagServiceImpl extends ServiceImpl<ICaseTagMapper, CaseTag> implements ICaseTagService {
+
+    @Autowired
+    ICaseTagPointService caseTagPointService;
+    @Autowired
+    IHotIconService hotIconService;
+
+    @Override
+    public Object allList(Integer caseId, String tagTitle) {
+        LambdaQueryWrapper<CaseTag> wrapper = new LambdaQueryWrapper<>();
+        if(StringUtils.isNotBlank(tagTitle)){
+            wrapper.like(CaseTag::getTagTitle,tagTitle);
+        }
+        wrapper.orderByDesc(CaseTag::getSort);
+        wrapper.orderByDesc(CaseTag::getCreateTime);
+        List<CaseTag> list = this.list(wrapper);
+        HashMap<Integer,Long> countMap = caseTagPointService.getGroupByTagId();
+        list.forEach(entity -> entity.setPlaceNum(countMap.get(entity.getTagId())));
+        return list;
+    }
+
+    @Override
+    public void updateDFHotIcon(Integer iconId) {
+        HotIcon defaultIcon = hotIconService.getDefaultIcon();
+        LambdaUpdateWrapper<CaseTag> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(CaseTag::getHotIconId,iconId)
+                .set(CaseTag::getHotIconId,defaultIcon.getIconId())
+                .set(CaseTag::getHotIconUrl,defaultIcon.getIconUrl());
+        this.update(wrapper);
+    }
+}

+ 0 - 75
src/main/java/com/fdkankan/fusion/service/impl/HotServiceImpl.java

@@ -1,75 +0,0 @@
-package com.fdkankan.fusion.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.util.JwtUtil;
-import com.fdkankan.fusion.common.ResultCode;
-import com.fdkankan.fusion.entity.CaseFusion;
-import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.fusion.entity.Hot;
-import com.fdkankan.fusion.entity.HotIcon;
-import com.fdkankan.fusion.mapper.IHotMapper;
-import com.fdkankan.fusion.service.ICaseFusionService;
-import com.fdkankan.fusion.service.ICaseService;
-import com.fdkankan.fusion.service.IHotIconService;
-import com.fdkankan.fusion.service.IHotService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author 
- * @since 2022-08-03
- */
-@Service
-public class HotServiceImpl extends ServiceImpl<IHotMapper, Hot> implements IHotService {
-
-    @Autowired
-    IHotIconService hotIconService;
-    @Autowired
-    ICaseFusionService caseFusionService;
-
-    @Override
-    public void updateDefaultIcon(Integer iconId) {
-        HotIcon hotIcon = hotIconService.getDefaultIcon();
-        if(hotIcon == null){
-            throw new BusinessException(ResultCode.SYSTEM_HOT_ICON_NOT_EXIST);
-        }
-        if(iconId.equals(hotIcon.getIconId())){
-            throw new BusinessException(ResultCode.SYSTEM_HOT_ICON_NOT_DELETE);
-        }
-        LambdaUpdateWrapper<Hot> wrapper = new LambdaUpdateWrapper<>();
-        wrapper.eq(Hot::getHotIconId,iconId)
-                .set(Hot::getHotIconId,hotIcon.getIconId())
-                .set(Hot::getHotIconUrl,hotIcon.getIconUrl());
-        this.update(wrapper);
-    }
-
-    @Override
-    public List<Hot> getList(Integer fusionId,Integer caseId) {
-        if(fusionId == null && caseId == null){
-            return new ArrayList<>();
-        }
-        LambdaQueryWrapper<Hot> wrapper = new LambdaQueryWrapper<>();
-        if(fusionId != null){
-            wrapper.eq(Hot::getFusionId,fusionId);
-        }else {
-            List<CaseFusion> list = caseFusionService.getListByCaseId(caseId);
-            List<Integer> fusionIds = list.parallelStream().map(CaseFusion::getFusionId).collect(Collectors.toList());
-            if(fusionIds.size() <=0){
-                return new ArrayList<>();
-            }
-            wrapper.in(Hot::getFusionId,fusionIds);
-        }
-        wrapper.orderByDesc(Hot::getCreateTime);
-        return this.list(wrapper);
-    }
-}

+ 1 - 1
src/main/resources/mapper/fusion/HotMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.fdkankan.fusion.mapper.IHotMapper">
+<mapper namespace="com.fdkankan.fusion.mapper.ICaseTagMapper">
 
 </mapper>

+ 8 - 0
src/main/resources/mapper/fusion/CaseTagPointMapper.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.fusion.mapper.ICaseTagPointMapper">
+
+    <select id="getGroupByTagId" resultType="com.fdkankan.fusion.response.GroupCount">
+        select tag_id as id,count(*) as count from t_case_tag_point  group by tag_id
+    </select>
+</mapper>