Explorar o código

标签管理,达人拉黑代码迁移

wangxy hai 2 días
pai
achega
995c3c348a
Modificáronse 27 ficheiros con 885 adicións e 34 borrados
  1. 142 0
      fs-company/src/main/java/com/fs/company/controller/company/CompanyTagManageController.java
  2. 15 1
      fs-company/src/main/java/com/fs/user/FsUserAdminController.java
  3. 30 2
      fs-service/src/main/java/com/fs/company/domain/CompanyTag.java
  4. 13 0
      fs-service/src/main/java/com/fs/company/mapper/CompanyTagMapper.java
  5. 17 0
      fs-service/src/main/java/com/fs/company/param/CompanyTagManageParam.java
  6. 11 0
      fs-service/src/main/java/com/fs/company/service/ICompanyTagService.java
  7. 29 1
      fs-service/src/main/java/com/fs/company/service/impl/CompanyTagServiceImpl.java
  8. 34 0
      fs-service/src/main/java/com/fs/company/vo/CompanyTagManageVO.java
  9. 27 0
      fs-service/src/main/java/com/fs/company/vo/CompanyTagMemberExportVO.java
  10. 5 0
      fs-service/src/main/java/com/fs/course/domain/FsUserCompanyUser.java
  11. 1 1
      fs-service/src/main/java/com/fs/course/mapper/FsUserVideoMapper.java
  12. 10 0
      fs-service/src/main/java/com/fs/course/param/FsBlackAndReportParam.java
  13. 61 0
      fs-service/src/main/java/com/fs/course/param/FsBlackTalentParam.java
  14. 59 0
      fs-service/src/main/java/com/fs/course/param/FsBlackVideoParam.java
  15. 11 1
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCompanyUserServiceImpl.java
  16. 8 1
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java
  17. 2 0
      fs-service/src/main/java/com/fs/course/vo/FsUserVideoListUVO.java
  18. 24 7
      fs-service/src/main/java/com/fs/his/service/impl/FsUserProjectTagServiceImpl.java
  19. 5 5
      fs-service/src/main/java/com/fs/his/service/impl/FsUserServiceImpl.java
  20. 0 5
      fs-service/src/main/java/com/fs/store/vo/h5/FsUserPageListExportVO.java
  21. 11 0
      fs-service/src/main/resources/db/20260612-销售后台标签管理.sql
  22. 175 1
      fs-service/src/main/resources/mapper/company/CompanyTagMapper.xml
  23. 1 0
      fs-service/src/main/resources/mapper/company/CompanyTagUserMapper.xml
  24. 1 1
      fs-service/src/main/resources/mapper/his/FsStoreOrderFinanceAuditMapper.xml
  25. 67 1
      fs-service/src/main/resources/mapper/his/FsUserMapper.xml
  26. 4 7
      fs-service/src/main/resources/mapper/his/FsUserProjectTagMapper.xml
  27. 122 0
      fs-user-app/src/main/java/com/fs/app/controller/FsBlackTalentController.java

+ 142 - 0
fs-company/src/main/java/com/fs/company/controller/company/CompanyTagManageController.java

@@ -0,0 +1,142 @@
+package com.fs.company.controller.company;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyTag;
+import com.fs.company.param.CompanyTagManageParam;
+import com.fs.company.service.ICompanyTagService;
+import com.fs.company.vo.CompanyTagManageVO;
+import com.fs.company.vo.CompanyTagMemberExportVO;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.security.SecurityUtils;
+import com.fs.store.vo.h5.FsUserPageListExportVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.fs.his.utils.PhoneUtil.decryptAutoPhoneMk;
+
+@RestController
+@RequestMapping("/company/tagManage")
+public class CompanyTagManageController extends BaseController {
+
+    @Autowired
+    private ICompanyTagService companyTagService;
+
+    @PreAuthorize("@ss.hasPermi('company:tagManage:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanyTagManageParam param) {
+        startPage();
+        param.setCompanyId(getLoginCompanyId());
+        List<CompanyTagManageVO> list = companyTagService.selectCompanyTagManageList(param);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('company:tagManage:export')")
+    @Log(title = "标签管理", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanyTagManageParam param) {
+        param.setCompanyId(getLoginCompanyId());
+        List<CompanyTagManageVO> list = companyTagService.selectCompanyTagManageList(param);
+        List<CompanyTagMemberExportVO> exportList = new ArrayList<>();
+        for (CompanyTagManageVO vo : list) {
+            CompanyTagMemberExportVO exportVO = new CompanyTagMemberExportVO();
+            exportVO.setTagName(vo.getTagName());
+            exportVO.setTagType(vo.getTagType());
+            exportVO.setStatus(vo.getStatus());
+            exportVO.setCreateTime(vo.getCreateTime());
+            exportVO.setIsUsed(vo.getUserCount() != null && vo.getUserCount() > 0);
+            exportList.add(exportVO);
+        }
+        ExcelUtil<CompanyTagMemberExportVO> util = new ExcelUtil<>(CompanyTagMemberExportVO.class);
+        return util.exportExcel(exportList, "标签信息");
+    }
+
+    @PreAuthorize("@ss.hasPermi('company:tagManage:add')")
+    @Log(title = "标签管理", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody CompanyTag companyTag) {
+        if (StringUtils.isBlank(companyTag.getTag())) {
+            return AjaxResult.error("标签名称不能为空");
+        }
+        companyTag.setCompanyId(getLoginCompanyId());
+        companyTag.setTagType(0);
+        companyTag.setStatus(0);
+        return toAjax(companyTagService.insertCompanyTag(companyTag));
+    }
+
+    @PreAuthorize("@ss.hasPermi('company:tagManage:edit')")
+    @Log(title = "标签管理", businessType = BusinessType.UPDATE)
+    @PutMapping("/status")
+    public AjaxResult updateStatus(@RequestBody CompanyTag companyTag) {
+        if (companyTag.getTagId() == null || companyTag.getStatus() == null) {
+            return AjaxResult.error("参数不能为空");
+        }
+        CompanyTag dbTag = companyTagService.selectCompanyTagById(companyTag.getTagId());
+        if (dbTag == null || !getLoginCompanyId().equals(dbTag.getCompanyId())) {
+            return AjaxResult.error("标签不存在");
+        }
+        CompanyTag update = new CompanyTag();
+        update.setTagId(companyTag.getTagId());
+        update.setStatus(companyTag.getStatus());
+        return toAjax(companyTagService.updateCompanyTag(update));
+    }
+
+    @PreAuthorize("@ss.hasPermi('company:tagManage:remove')")
+    @Log(title = "标签管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{tagId}")
+    public AjaxResult remove(@PathVariable Long tagId) {
+        CompanyTag dbTag = companyTagService.selectCompanyTagById(tagId);
+        if (dbTag == null || !getLoginCompanyId().equals(dbTag.getCompanyId())) {
+            return AjaxResult.error("标签不存在");
+        }
+        if (!companyTagService.canDeleteCompanyTag(tagId, getLoginCompanyId())) {
+            return AjaxResult.error("标签已使用,不能删除");
+        }
+        return toAjax(companyTagService.deleteCompanyTagById(tagId));
+    }
+
+    @PreAuthorize("@ss.hasPermi('company:tagManage:export')")
+    @Log(title = "标签管理", businessType = BusinessType.EXPORT)
+    @GetMapping("/download/{tagId}")
+    public AjaxResult download(@PathVariable Long tagId) {
+        CompanyTag dbTag = companyTagService.selectCompanyTagById(tagId);
+        if (dbTag == null || !getLoginCompanyId().equals(dbTag.getCompanyId())) {
+            return AjaxResult.error("标签不存在");
+        }
+        List<FsUserPageListExportVO> list = companyTagService.selectCompanyTagMemberList(tagId, getLoginCompanyId());
+        for (FsUserPageListExportVO vo : list) {
+            vo.setPhone(decryptAutoPhoneMk(vo.getPhone()));
+        }
+        ExcelUtil<FsUserPageListExportVO> util = new ExcelUtil<>(FsUserPageListExportVO.class);
+        return util.exportExcel(list, dbTag.getTag() + "-项目会员");
+    }
+
+    @PreAuthorize("@ss.hasPermi('company:tagManage:list')")
+    @GetMapping("/detail/{tagId}")
+    public TableDataInfo detail(@PathVariable Long tagId) {
+        CompanyTag dbTag = companyTagService.selectCompanyTagById(tagId);
+        if (dbTag == null || !getLoginCompanyId().equals(dbTag.getCompanyId())) {
+            return getDataTable(new java.util.ArrayList<>());
+        }
+        startPage();
+        List<FsUserPageListExportVO> list = companyTagService.selectCompanyTagMemberList(tagId, getLoginCompanyId());
+        for (FsUserPageListExportVO vo : list) {
+            vo.setPhone(decryptAutoPhoneMk(vo.getPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    private Long getLoginCompanyId() {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        return loginUser.getCompany().getCompanyId();
+    }
+}

+ 15 - 1
fs-company/src/main/java/com/fs/user/FsUserAdminController.java

@@ -22,6 +22,7 @@ import com.fs.framework.service.TokenService;
 import com.fs.his.domain.FsExportTask;
 import com.fs.his.domain.FsUser;
 import com.fs.his.service.IFsExportTaskService;
+import com.fs.his.service.IFsUserProjectTagService;
 import com.fs.his.service.IFsUserService;
 import com.fs.his.utils.PhoneUtil;
 import com.fs.his.utils.RandomUtil;
@@ -32,6 +33,7 @@ import com.fs.qw.dto.FsUserTransferParamDTO;
 import com.fs.qw.service.ICustomerTransferApprovalService;
 import com.fs.store.param.h5.FsUserPageListExportParam;
 import com.fs.store.param.h5.FsUserPageListParam;
+import com.fs.store.param.h5.TagListParam;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -75,6 +77,9 @@ public class FsUserAdminController extends BaseController {
     @Autowired
     private IFsUserCompanyUserService fsUserCompanyUserService;
 
+    @Autowired
+    private IFsUserProjectTagService fsUserProjectTagService;
+
     @PreAuthorize("@ss.hasPermi('user:fsUser:list')")
     @PostMapping("/list")
     @ApiOperation("会员列表(与移动端使用的相同查询)")
@@ -156,6 +161,15 @@ public class FsUserAdminController extends BaseController {
         return fsUserService.selectFsUserPageListNew(param);
     }
 
+    @PreAuthorize("@ss.hasPermi('user:fsUser:list') or @ss.hasPermi('user:fsUser:myList')")
+    @GetMapping("/tagList")
+    @ApiOperation("项目会员可用标签列表")
+    public AjaxResult tagList(TagListParam param) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        param.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(fsUserProjectTagService.getTagList(param));
+    }
+
     @PostMapping("/auditUser")
     @ApiOperation("审核用户(移除小黑屋)")
     public R auditUser(@RequestBody String[] userIds) {
@@ -222,7 +236,7 @@ public class FsUserAdminController extends BaseController {
     /**
      * 修改用户
      */
-    @PreAuthorize("@ss.hasPermi('user:fsUser:edit')")
+    @PreAuthorize("@ss.hasPermi('user:fsUser:edit') or @ss.hasPermi('user:myUser:edit')")
     @Log(title = "用户", businessType = BusinessType.UPDATE)
     @PutMapping("/member")
     public AjaxResult editMemberUser(@RequestBody FsUserCompanyUser fsUser)

+ 30 - 2
fs-service/src/main/java/com/fs/company/domain/CompanyTag.java

@@ -1,7 +1,5 @@
 package com.fs.company.domain;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -28,6 +26,14 @@ public class CompanyTag extends BaseEntity
     @Excel(name = "标签")
     private String tag;
 
+    /** 状态:0启用,1禁用 */
+    @Excel(name = "状态", readConverterExp = "0=启用,1=禁用")
+    private Integer status;
+
+    /** 标签类型:0管理员创建,1营期自动标签 */
+    @Excel(name = "标签类型", readConverterExp = "0=管理员创建,1=营期自动标签")
+    private Integer tagType;
+
     public void setTagId(Long tagId)
     {
         this.tagId = tagId;
@@ -56,12 +62,34 @@ public class CompanyTag extends BaseEntity
         return tag;
     }
 
+    public Integer getStatus()
+    {
+        return status;
+    }
+
+    public void setStatus(Integer status)
+    {
+        this.status = status;
+    }
+
+    public Integer getTagType()
+    {
+        return tagType;
+    }
+
+    public void setTagType(Integer tagType)
+    {
+        this.tagType = tagType;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
             .append("tagId", getTagId())
             .append("companyId", getCompanyId())
             .append("tag", getTag())
+            .append("status", getStatus())
+            .append("tagType", getTagType())
             .append("createTime", getCreateTime())
             .toString();
     }

+ 13 - 0
fs-service/src/main/java/com/fs/company/mapper/CompanyTagMapper.java

@@ -1,6 +1,9 @@
 package com.fs.company.mapper;
 
 import com.fs.company.domain.CompanyTag;
+import com.fs.company.param.CompanyTagManageParam;
+import com.fs.company.vo.CompanyTagManageVO;
+import com.fs.store.vo.h5.FsUserPageListExportVO;
 import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Param;
 
@@ -82,4 +85,14 @@ public interface CompanyTagMapper
     Map<Long,CompanyTag> queryAllTagMap();
 
     List<CompanyTag> selectCompanyTagByList(@Param("params") Map<String, Object> params);
+
+    List<CompanyTagManageVO> selectCompanyTagManageList(@Param("param") CompanyTagManageParam param);
+
+    int countCompanyTagUsed(@Param("tagId") Long tagId, @Param("companyId") Long companyId);
+
+    List<FsUserPageListExportVO> selectCompanyTagMemberExportList(@Param("tagId") Long tagId, @Param("companyId") Long companyId);
+
+    List<FsUserPageListExportVO> selectCompanyTagMemberList(@Param("tagId") Long tagId, @Param("companyId") Long companyId);
+
+    List<Long> selectEnabledTagIds(@Param("tagIds") List<Long> tagIds);
 }

+ 17 - 0
fs-service/src/main/java/com/fs/company/param/CompanyTagManageParam.java

@@ -0,0 +1,17 @@
+package com.fs.company.param;
+
+import lombok.Data;
+
+@Data
+public class CompanyTagManageParam {
+
+    private String tagName;
+
+    private Long projectId;
+
+    private Integer status;
+
+    private String employeeName;
+
+    private Long companyId;
+}

+ 11 - 0
fs-service/src/main/java/com/fs/company/service/ICompanyTagService.java

@@ -1,6 +1,9 @@
 package com.fs.company.service;
 
 import com.fs.company.domain.CompanyTag;
+import com.fs.company.param.CompanyTagManageParam;
+import com.fs.company.vo.CompanyTagManageVO;
+import com.fs.store.vo.h5.FsUserPageListExportVO;
 
 import java.util.List;
 import java.util.Map;
@@ -79,4 +82,12 @@ public interface ICompanyTagService
     String findUserTagByUserId(Long userId,Long companyUserId);
 
     List<CompanyTag> selectCompanyTagByList(Map<String, Object> params);
+
+    List<CompanyTagManageVO> selectCompanyTagManageList(CompanyTagManageParam param);
+
+    boolean canDeleteCompanyTag(Long tagId, Long companyId);
+
+    List<FsUserPageListExportVO> selectCompanyTagMemberExportList(Long tagId, Long companyId);
+
+    List<FsUserPageListExportVO> selectCompanyTagMemberList(Long tagId, Long companyId);
 }

+ 29 - 1
fs-service/src/main/java/com/fs/company/service/impl/CompanyTagServiceImpl.java

@@ -3,11 +3,13 @@ package com.fs.company.service.impl;
 import com.fs.common.utils.DateUtils;
 import com.fs.company.domain.CompanyTag;
 import com.fs.company.mapper.CompanyTagMapper;
+import com.fs.company.param.CompanyTagManageParam;
 import com.fs.company.service.ICompanyTagService;
+import com.fs.company.vo.CompanyTagManageVO;
+import com.fs.store.vo.h5.FsUserPageListExportVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
@@ -57,6 +59,12 @@ public class CompanyTagServiceImpl implements ICompanyTagService
     public int insertCompanyTag(CompanyTag companyTag)
     {
         companyTag.setCreateTime(DateUtils.getNowDate());
+        if (companyTag.getStatus() == null) {
+            companyTag.setStatus(0);
+        }
+        if (companyTag.getTagType() == null) {
+            companyTag.setTagType(0);
+        }
         return companyTagMapper.insertCompanyTag(companyTag);
     }
 
@@ -137,4 +145,24 @@ public class CompanyTagServiceImpl implements ICompanyTagService
     public List<CompanyTag> selectCompanyTagByList(Map<String, Object> params) {
         return companyTagMapper.selectCompanyTagByList(params);
     }
+
+    @Override
+    public List<CompanyTagManageVO> selectCompanyTagManageList(CompanyTagManageParam param) {
+        return companyTagMapper.selectCompanyTagManageList(param);
+    }
+
+    @Override
+    public boolean canDeleteCompanyTag(Long tagId, Long companyId) {
+        return companyTagMapper.countCompanyTagUsed(tagId, companyId) == 0;
+    }
+
+    @Override
+    public List<FsUserPageListExportVO> selectCompanyTagMemberExportList(Long tagId, Long companyId) {
+        return companyTagMapper.selectCompanyTagMemberExportList(tagId, companyId);
+    }
+
+    @Override
+    public List<FsUserPageListExportVO> selectCompanyTagMemberList(Long tagId, Long companyId) {
+        return companyTagMapper.selectCompanyTagMemberList(tagId, companyId);
+    }
 }

+ 34 - 0
fs-service/src/main/java/com/fs/company/vo/CompanyTagManageVO.java

@@ -0,0 +1,34 @@
+package com.fs.company.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class CompanyTagManageVO {
+
+    private Long tagId;
+
+    @Excel(name = "标签名称")
+    private String tagName;
+
+    @Excel(name = "标注人数")
+    private Integer userCount;
+
+    @Excel(name = "使用销售姓名")
+    private String companyUserNames;
+
+    @Excel(name = "状态", readConverterExp = "0=启用,1=禁用")
+    private Integer status;
+
+    @Excel(name = "标签类型", readConverterExp = "0=管理员创建,1=营期自动标签")
+    private Integer tagType;
+
+    private Boolean canDelete;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+}

+ 27 - 0
fs-service/src/main/java/com/fs/company/vo/CompanyTagMemberExportVO.java

@@ -0,0 +1,27 @@
+package com.fs.company.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class CompanyTagMemberExportVO {
+
+    @Excel(name = "标签名称")
+    private String tagName;
+
+    @Excel(name = "标签来源", readConverterExp = "0=管理员创建,1=营期自动标签")
+    private Integer tagType;
+
+    @Excel(name = "状态", readConverterExp = "0=启用,1=禁用")
+    private Integer status;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @Excel(name = "是否使用", readConverterExp = "true=是,false=否")
+    private Boolean isUsed;
+}

+ 5 - 0
fs-service/src/main/java/com/fs/course/domain/FsUserCompanyUser.java

@@ -75,6 +75,11 @@ public class FsUserCompanyUser {
      * 修改时间
      */
     private LocalDateTime updateTime;
+    /**
+     * 页面编辑标签ID集合
+     */
+    @TableField(exist = false)
+    private java.util.List<Long> tagIds;
 
 
 }

+ 1 - 1
fs-service/src/main/java/com/fs/course/mapper/FsUserVideoMapper.java

@@ -132,7 +132,7 @@ public interface FsUserVideoMapper
     int minusFavorite(Long videoId);
 
     @Select({"<script> " +
-            "select v.video_id as id,v.title,v.description as msg,t.nick_name as username,t.avatar as headImg, " +
+            "select v.video_id as id,v.title,v.description as msg,t.user_id as userId,t.nick_name as username,t.avatar as headImg, " +
             "v.thumbnail as cover,v.url as src,v.likes as likeNum,v.comments as smsNum,v.favorite_num," +
             "v.create_time,v.views as playNumber,v.product_id,p.img_url,p.package_name,v.upload_type,v.shares,v.add_num from fs_user_video v " +
             "left join fs_user_talent t on t.talent_id = v.talent_id " +

+ 10 - 0
fs-service/src/main/java/com/fs/course/param/FsBlackAndReportParam.java

@@ -0,0 +1,10 @@
+package com.fs.course.param;
+
+import lombok.Data;
+
+@Data
+public class FsBlackAndReportParam {
+    private Long userId;
+    private String type;
+    private String style;
+}

+ 61 - 0
fs-service/src/main/java/com/fs/course/param/FsBlackTalentParam.java

@@ -0,0 +1,61 @@
+package com.fs.course.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class FsBlackTalentParam {
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 达人id */
+    @Excel(name = "达人id")
+    private Long talentId;
+    /** 举报说明(拉黑为空) */
+    @Excel(name = "举报说明", readConverterExp = "拉=黑为空")
+    private String reportDesc;
+
+    /** 是否审核-1:驳回,0:待审核,1:通过(拉黑不需要审核) */
+    @Excel(name = "是否审核-1:驳回,0:待审核,1:通过", readConverterExp = "拉=黑不需要审核")
+    private String isAudit;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date auditTime;
+
+    /** 审核人 */
+    @Excel(name = "审核人")
+    private Long auditUser;
+
+    /** 审核说明 */
+    @Excel(name = "审核说明")
+    private String auditDesc;
+
+    /** 类型1:拉黑,2:举报 */
+    @Excel(name = "类型1:拉黑,2:举报")
+    private String type;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date creatTime;
+
+    @Excel(name = "联系方式")
+    private String phone;
+
+    /** 图片地址 */
+    @Excel(name = "图片地址")
+    private String urls;
+
+    @Excel(name = "投诉模板id")
+    private Long templateId;
+
+    //交易截图
+    private String tradeImage;
+
+
+}

+ 59 - 0
fs-service/src/main/java/com/fs/course/param/FsBlackVideoParam.java

@@ -0,0 +1,59 @@
+package com.fs.course.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+@Data
+public class FsBlackVideoParam {
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+
+    /** 类型1:拉黑,2:举报 */
+    @Excel(name = "类型1:拉黑,2:举报")
+    private String type;
+
+    /** 举报说明(拉黑为空) */
+    @Excel(name = "举报说明", readConverterExp = "拉=黑为空")
+    private String reportDesc;
+
+    /** 是否审核-1:驳回,0:待审核,1:通过(拉黑不需要审核) */
+    @Excel(name = "是否审核-1:驳回,0:待审核,1:通过", readConverterExp = "拉=黑不需要审核")
+    private String isAudit;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date auditTime;
+
+    /** 审核人 */
+    @Excel(name = "审核人")
+    private Long auditUser;
+
+    /** 审核说明 */
+    @Excel(name = "审核说明")
+    private String auditDesc;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date creatTime;
+
+    /** 短视频id */
+    @Excel(name = "短视频id")
+    private Long videoId;
+
+    @Excel(name = "联系方式")
+    private String phone;
+
+    /** 图片地址 */
+    @Excel(name = "图片地址")
+    private String urls;
+
+    @Excel(name = "投诉模板id")
+    private Long templateId;
+
+}

+ 11 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsUserCompanyUserServiceImpl.java

@@ -7,9 +7,12 @@ import com.fs.common.exception.CustomException;
 import com.fs.course.domain.FsUserCompanyUser;
 import com.fs.course.mapper.FsUserCompanyUserMapper;
 import com.fs.course.service.IFsUserCompanyUserService;
+import com.fs.his.service.IFsUserProjectTagService;
 import com.fs.qw.dto.UserProjectDTO;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+
 import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Map;
@@ -24,6 +27,9 @@ import java.util.Objects;
 @Service
 public class FsUserCompanyUserServiceImpl extends ServiceImpl<FsUserCompanyUserMapper, FsUserCompanyUser> implements IFsUserCompanyUserService {
 
+    @Resource
+    private IFsUserProjectTagService fsUserProjectTagService;
+
     /**
      * 查询微信用户和销售关系
      *
@@ -78,7 +84,11 @@ public class FsUserCompanyUserServiceImpl extends ServiceImpl<FsUserCompanyUserM
     @Override
     public int updateFsUserCompanyUser(FsUserCompanyUser fsUserCompanyUser)
     {
-        return baseMapper.updateFsUserCompanyUser(fsUserCompanyUser);
+        int rows = baseMapper.updateFsUserCompanyUser(fsUserCompanyUser);
+        if (fsUserCompanyUser.getId() != null && fsUserCompanyUser.getTagIds() != null) {
+            fsUserProjectTagService.addUserProjectTag(fsUserCompanyUser.getId(), fsUserCompanyUser.getTagIds());
+        }
+        return rows;
     }
 
     /**

+ 8 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -4401,13 +4401,20 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService {
             List<CompanyTag> existingTags = companyTagMapper.selectCompanyTagList(queryTag);
 
             if (!CollectionUtils.isEmpty(existingTags)) {
-                return existingTags.get(0);
+                CompanyTag existingTag = existingTags.get(0);
+                if (existingTag.getStatus() != null && existingTag.getStatus() == 1) {
+                    log.info("营期标签已禁用,不再自动绑定:companyId={}, tag={}, tagId={}", companyId, periodName, existingTag.getTagId());
+                    return null;
+                }
+                return existingTag;
             }
 
             // 创建新标签
             CompanyTag newTag = new CompanyTag();
             newTag.setCompanyId(companyId);
             newTag.setTag(periodName);
+            newTag.setStatus(0);
+            newTag.setTagType(1);
             newTag.setCreateTime(new Date());
             companyTagMapper.insertCompanyTag(newTag);
             

+ 2 - 0
fs-service/src/main/java/com/fs/course/vo/FsUserVideoListUVO.java

@@ -10,9 +10,11 @@ import java.util.List;
 public class FsUserVideoListUVO {
     private String id; // _id
     private String username;//2.视频拥有者名称
+    private Long userId;//用户id
     private String headImg;//3.发布者头像
     private String cover;//视频封面
     private String title;//4.第一行标题
+    private Long duration;//时长
     private String msg;//5.第二行内容
     private String state = "pause";//6.初始状态标志(不改)
     private Integer like = 0; //7.是否是自己喜欢,0不喜欢,1喜欢。默认不喜欢

+ 24 - 7
fs-service/src/main/java/com/fs/his/service/impl/FsUserProjectTagServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.company.domain.CompanyUser;
+import com.fs.company.mapper.CompanyTagMapper;
 import com.fs.company.mapper.CompanyUserMapper;
 import com.fs.his.domain.FsUserProjectTag;
 import com.fs.his.mapper.FsUserProjectTagMapper;
@@ -24,6 +25,9 @@ public class FsUserProjectTagServiceImpl extends ServiceImpl<FsUserProjectTagMap
     @Resource
     private CompanyUserMapper companyUserMapper;
 
+    @Resource
+    private CompanyTagMapper companyTagMapper;
+
     /**
      * 添加用户项目标签
      * @param id        用户项目ID
@@ -37,8 +41,12 @@ public class FsUserProjectTagServiceImpl extends ServiceImpl<FsUserProjectTagMap
                 .eq(FsUserProjectTag::getUserCompanyUserId, id);
         baseMapper.delete(deleteWrapper);
 
-        // 添加新标签
-        List<FsUserProjectTag> tagList = tagIds.stream().distinct().map(tagId -> {
+        List<Long> enabledTagIds = filterEnabledTagIds(tagIds);
+        if (enabledTagIds.isEmpty()) {
+            return;
+        }
+
+        List<FsUserProjectTag> tagList = enabledTagIds.stream().distinct().map(tagId -> {
             FsUserProjectTag userProjectTag = new FsUserProjectTag();
             userProjectTag.setUserCompanyUserId(id);
             userProjectTag.setTagId(tagId);
@@ -68,9 +76,13 @@ public class FsUserProjectTagServiceImpl extends ServiceImpl<FsUserProjectTagMap
             return;
         }
 
-        // 添加新标签
+        List<Long> enabledTagIds = filterEnabledTagIds(tagIds);
+        if (enabledTagIds.isEmpty()) {
+            return;
+        }
+
         List<FsUserProjectTag> tagList = ids.stream().map(id ->
-                tagIds.stream().distinct().map(tagId -> {
+                enabledTagIds.stream().distinct().map(tagId -> {
             FsUserProjectTag userProjectTag = new FsUserProjectTag();
             userProjectTag.setUserCompanyUserId(id);
             userProjectTag.setTagId(tagId);
@@ -94,12 +106,17 @@ public class FsUserProjectTagServiceImpl extends ServiceImpl<FsUserProjectTagMap
         params.put("keywords", Optional.ofNullable(param.getKeyword()).map(keyword -> keyword.split(",")).orElse(null));
 
         CompanyUser companyUser = companyUserMapper.selectCompanyUserById(param.getUserId());
-        if (Objects.nonNull(companyUser) && companyUser.isAdmin()) {
+        if (Objects.nonNull(companyUser)) {
             params.put("companyId", companyUser.getCompanyId());
-        } else {
-            params.put("companyUserId", param.getUserId());
         }
 
         return baseMapper.getTagList(params);
     }
+
+    private List<Long> filterEnabledTagIds(List<Long> tagIds) {
+        if (tagIds == null || tagIds.isEmpty()) {
+            return Collections.emptyList();
+        }
+        return companyTagMapper.selectEnabledTagIds(tagIds);
+    }
 }

+ 5 - 5
fs-service/src/main/java/com/fs/his/service/impl/FsUserServiceImpl.java

@@ -1350,11 +1350,11 @@ public class FsUserServiceImpl implements IFsUserService {
         if (item.getPhone() != null) {
             item.setPhone(ParseUtils.parsePhone(item.getPhone()));
         }
-        String userTagByUserId = null;
-        if (item.getUserId() != null && item.getCompanyUserId() != null) {
-            userTagByUserId = companyTagCacheService
-                    .findUserTagByUserId(item.getUserId(), item.getCompanyUserId());
-        }
+        String userTagByUserId = userProjectTagService.list(Wrappers.<FsUserProjectTag>lambdaQuery()
+                .eq(FsUserProjectTag::getUserCompanyUserId, id))
+                .stream()
+                .map(tag -> String.valueOf(tag.getTagId()))
+                .collect(Collectors.joining(","));
         if (StringUtils.isNotEmpty(userTagByUserId)) {
             String[] split = userTagByUserId.split(",");
             Set<String> tagNames = new HashSet<>();

+ 0 - 5
fs-service/src/main/java/com/fs/store/vo/h5/FsUserPageListExportVO.java

@@ -33,15 +33,12 @@ public class FsUserPageListExportVO {
     private String phone;
 
     @ApiModelProperty(value = "看课数量")
-    @Excel(name = "看课数量")
     private Long watchCourseCount;
 
     @ApiModelProperty(value = "缺课数量")
-    @Excel(name = "缺课数量")
     private Long missCourseCount;
 
     @ApiModelProperty(value = "参与营期数量")
-    @Excel(name = "参与营期数量")
     private Long partCourseCount;
 
     @ApiModelProperty(value = "状态:1为正常,0为禁止")
@@ -49,7 +46,6 @@ public class FsUserPageListExportVO {
     private Integer status;
 
     @ApiModelProperty(value = "用户状态,1-正常;2-停止;3-未看")
-    @Excel(name = "看课状态", readConverterExp = "1=正常看课,2=停止看课,3=未看课,null=未知状态")
     private Long courseCountStatus;
 
     @ApiModelProperty(value = "标签名称")
@@ -58,7 +54,6 @@ public class FsUserPageListExportVO {
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "最后一次看课时间")
-    @Excel(name = "最后看课时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date lastWatchDate;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

+ 11 - 0
fs-service/src/main/resources/db/20260612-销售后台标签管理.sql

@@ -0,0 +1,11 @@
+ALTER TABLE company_tag
+    ADD COLUMN status tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态:0启用,1禁用' AFTER tag,
+    ADD COLUMN tag_type tinyint(1) NOT NULL DEFAULT 0 COMMENT '标签类型:0管理员创建,1营期自动标签' AFTER status;
+
+UPDATE company_tag SET status = 0 WHERE status IS NULL;
+UPDATE company_tag SET tag_type = 0 WHERE tag_type IS NULL;
+
+UPDATE company_tag ct
+INNER JOIN fs_user_course_period fucp ON fucp.period_name = ct.tag
+SET ct.tag_type = 1
+WHERE ct.tag_type = 0;

+ 175 - 1
fs-service/src/main/resources/mapper/company/CompanyTagMapper.xml

@@ -8,11 +8,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="tagId"    column="tag_id"    />
         <result property="companyId"    column="company_id"    />
         <result property="tag"    column="tag"    />
+        <result property="status"    column="status"    />
+        <result property="tagType"    column="tag_type"    />
         <result property="createTime"    column="create_time"    />
     </resultMap>
 
     <sql id="selectCompanyTagVo">
-        select tag_id, company_id, tag, create_time from company_tag
+        select tag_id, company_id, tag, status, tag_type, create_time from company_tag
     </sql>
 
     <select id="selectCompanyTagList" parameterType="CompanyTag" resultMap="CompanyTagResult">
@@ -20,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="companyId != null "> and company_id = #{companyId}</if>
             <if test="tag != null  and tag != ''"> and tag = #{tag}</if>
+            <if test="status != null "> and status = #{status}</if>
         </where>
     </select>
 
@@ -98,11 +101,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="companyId != null">company_id,</if>
             <if test="tag != null">tag,</if>
+            <if test="status != null">status,</if>
+            <if test="tagType != null">tag_type,</if>
             <if test="createTime != null">create_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="companyId != null">#{companyId},</if>
             <if test="tag != null">#{tag},</if>
+            <if test="status != null">#{status},</if>
+            <if test="tagType != null">#{tagType},</if>
             <if test="createTime != null">#{createTime},</if>
          </trim>
     </insert>
@@ -112,6 +119,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="companyId != null">company_id = #{companyId},</if>
             <if test="tag != null">tag = #{tag},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="tagType != null">tag_type = #{tagType},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
         </trim>
         where tag_id = #{tagId}
@@ -128,4 +137,169 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </delete>
 
+    <select id="selectCompanyTagManageList" resultType="com.fs.company.vo.CompanyTagManageVO">
+        select
+            ct.tag_id as tagId,
+            ct.tag as tagName,
+            ifnull(ct.status, 0) as status,
+            ifnull(ct.tag_type, 0) as tagType,
+            ct.create_time as createTime,
+            (
+                select count(distinct upt_count.user_company_user_id)
+                from fs_user_project_tag upt_count
+                inner join fs_user_company_user fucu_count on fucu_count.id = upt_count.user_company_user_id
+                inner join fs_user fu_count on fu_count.user_id = fucu_count.user_id and fu_count.is_del = 0
+                where upt_count.tag_id = ct.tag_id
+                <if test="param.companyId != null">
+                    and fucu_count.company_id = #{param.companyId}
+                </if>
+            ) as userCount,
+            (
+                select group_concat(distinct cu_name.nick_name order by cu_name.nick_name separator ',')
+                from fs_user_project_tag upt_name
+                inner join fs_user_company_user fucu_name on fucu_name.id = upt_name.user_company_user_id
+                inner join fs_user fu_name on fu_name.user_id = fucu_name.user_id and fu_name.is_del = 0
+                left join company_user cu_name on cu_name.user_id = fucu_name.company_user_id
+                where upt_name.tag_id = ct.tag_id
+                <if test="param.companyId != null">
+                    and fucu_name.company_id = #{param.companyId}
+                </if>
+            ) as companyUserNames,
+            case when count(upt.id) = 0 then true else false end as canDelete
+        from company_tag ct
+        left join fs_user_project_tag upt on upt.tag_id = ct.tag_id
+        left join fs_user_company_user fucu on fucu.id = upt.user_company_user_id
+        left join company_user cu on cu.user_id = fucu.company_user_id
+        <where>
+            <if test="param.companyId != null">
+                and ct.company_id = #{param.companyId}
+            </if>
+            <if test="param.tagName != null and param.tagName != ''">
+                and ct.tag like concat('%', #{param.tagName}, '%')
+            </if>
+            <if test="param.status != null">
+                and ifnull(ct.status, 0) = #{param.status}
+            </if>
+            <if test="param.projectId != null">
+                and fucu.project_id = #{param.projectId}
+            </if>
+            <if test="param.employeeName != null and param.employeeName != ''">
+                and cu.nick_name like concat('%', #{param.employeeName}, '%')
+            </if>
+        </where>
+        group by ct.tag_id
+        order by ct.create_time desc, ct.tag_id desc
+    </select>
+
+    <select id="countCompanyTagUsed" resultType="int">
+        select count(1)
+        from fs_user_project_tag upt
+        inner join fs_user_company_user fucu on fucu.id = upt.user_company_user_id
+        where upt.tag_id = #{tagId}
+        <if test="companyId != null">
+            and fucu.company_id = #{companyId}
+        </if>
+    </select>
+
+    <select id="selectCompanyTagMemberExportList" resultType="com.fs.store.vo.h5.FsUserPageListExportVO">
+        select
+            fu.user_id as userId,
+            fucu.project_id as projectId,
+            fu.nick_name as nickname,
+            fu.phone as phone,
+            fcc.watch_course_count as watchCourseCount,
+            fcc.miss_course_count as missCourseCount,
+            fcc.part_course_count as partCourseCount,
+            fucu.status as status,
+            fcc.status as courseCountStatus,
+            tag_names.tag as tag,
+            fcc.last_watch_date as lastWatchDate,
+            fucu.update_time as createTime,
+            fucu.remark as remark,
+            cu.nick_name as companyUserNickName,
+            fu.integral as integral,
+            if(fu.pay_count > 0, 1, 0) as isBuy,
+            fu.source as source,
+            fu.login_device as loginDevice,
+            fu.app_create_time as appCreateTime,
+            case when (fu.app_create_time is not null or fu.source is not null and fu.source != '' or fu.login_device is not null and fu.login_device != '') then 1 else 0 end as isDownloadApp
+        from (select distinct user_company_user_id from fs_user_project_tag where tag_id = #{tagId}) upt
+        inner join fs_user_company_user fucu on fucu.id = upt.user_company_user_id
+        inner join fs_user fu on fu.user_id = fucu.user_id and fu.is_del = 0
+        left join company_user cu on cu.user_id = fucu.company_user_id
+        left join (
+            select
+                user_id,
+                project_id,
+                max(watch_course_count) as watch_course_count,
+                max(miss_course_count) as miss_course_count,
+                max(part_course_count) as part_course_count,
+                max(status) as status,
+                max(last_watch_date) as last_watch_date
+            from fs_user_course_count
+            group by user_id, project_id
+        ) fcc on fcc.user_id = fucu.user_id and fcc.project_id = fucu.project_id
+        left join (
+            select
+                upt_inner.user_company_user_id,
+                group_concat(ct.tag order by ct.tag_id separator ',') as tag
+            from fs_user_project_tag upt_inner
+            inner join company_tag ct on ct.tag_id = upt_inner.tag_id
+            group by upt_inner.user_company_user_id
+        ) tag_names on tag_names.user_company_user_id = fucu.id
+        where 1 = 1
+        <if test="companyId != null">
+            and fucu.company_id = #{companyId}
+        </if>
+        order by fucu.update_time desc
+    </select>
+
+    <select id="selectCompanyTagMemberList" resultType="com.fs.store.vo.h5.FsUserPageListExportVO">
+        select
+            fu.user_id as userId,
+            fucu.project_id as projectId,
+            fu.nick_name as nickname,
+            fu.phone as phone,
+            fucu.status as status,
+            tag_names.tag as tag,
+            fucu.update_time as createTime,
+            fucu.remark as remark,
+            cu.nick_name as companyUserNickName,
+            fu.integral as integral,
+            if(fu.pay_count > 0, 1, 0) as isBuy,
+            fu.source as source,
+            fu.login_device as loginDevice,
+            fu.app_create_time as appCreateTime,
+            case when (fu.app_create_time is not null or fu.source is not null and fu.source != '' or fu.login_device is not null and fu.login_device != '') then 1 else 0 end as isDownloadApp
+        from (select distinct user_company_user_id from fs_user_project_tag where tag_id = #{tagId}) upt
+        inner join fs_user_company_user fucu on fucu.id = upt.user_company_user_id
+        inner join fs_user fu on fu.user_id = fucu.user_id and fu.is_del = 0
+        left join company_user cu on cu.user_id = fucu.company_user_id
+        left join (
+            select
+                upt_inner.user_company_user_id,
+                group_concat(ct.tag order by ct.tag_id separator ',') as tag
+            from fs_user_project_tag upt_inner
+            inner join company_tag ct on ct.tag_id = upt_inner.tag_id
+            group by upt_inner.user_company_user_id
+        ) tag_names on tag_names.user_company_user_id = fucu.id
+        where 1 = 1
+        <if test="companyId != null">
+            and fucu.company_id = #{companyId}
+        </if>
+        order by fucu.update_time desc
+    </select>
+
+    <select id="selectEnabledTagIds" resultType="java.lang.Long">
+        select tag_id
+        from company_tag
+        where ifnull(status, 0) = 0
+        <if test="tagIds != null and tagIds.size() > 0">
+            and tag_id in
+            <foreach item="tagId" collection="tagIds" open="(" separator="," close=")">
+                #{tagId}
+            </foreach>
+        </if>
+    </select>
+
 </mapper>

+ 1 - 0
fs-service/src/main/resources/mapper/company/CompanyTagUserMapper.xml

@@ -123,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         inner join fs_user_project_tag ft on ct.tag_id =ft.tag_id
         inner join fs_user_company_user fucu on fucu.id = ft.user_company_user_id
         where fucu.user_id = #{params.userId}
+            and ifnull(ct.status, 0) = 0
             <if test="params.companyId != null">
                 and fucu.company_id = #{params.companyId}
             </if>

+ 1 - 1
fs-service/src/main/resources/mapper/his/FsStoreOrderFinanceAuditMapper.xml

@@ -73,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectByOrderId" parameterType="Long" resultMap="FsStoreOrderFinanceAuditResult">
         <include refid="selectFsStoreOrderFinanceAuditVo"/>
-        where order_id = #{orderId}
+        where so.order_id = #{orderId}
         order by create_time desc
         limit 1
     </select>

+ 67 - 1
fs-service/src/main/resources/mapper/his/FsUserMapper.xml

@@ -391,7 +391,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ucu.project_id,
         fs_user.integral,
         if(fs_user.pay_count>0,1,0) as isBuy,
-        fs_user.app_create_time
+        fs_user.app_create_time,
+        (select group_concat(cast(upt.tag_id as char) order by upt.tag_id separator ',') from fs_user_project_tag upt where upt.user_company_user_id = ucu.id) as tagIds,
+        (select group_concat(ct.tag order by ct.tag_id separator ',') from fs_user_project_tag upt inner join company_tag ct on ct.tag_id = upt.tag_id where upt.user_company_user_id = ucu.id) as tag
         FROM
         fs_user
         left join fs_user_company_user ucu on ucu.user_id = fs_user.user_id
@@ -441,6 +443,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="projectId != null">
                 AND ucu.project_id = #{projectId}
             </if>
+            <if test="tagIds != null and tagIds.length > 0">
+                AND EXISTS (
+                    select 1 from fs_user_project_tag upt_filter
+                    where upt_filter.user_company_user_id = ucu.id
+                    and upt_filter.tag_id in
+                    <foreach collection="tagIds" item="tagId" open="(" separator="," close=")">
+                        #{tagId}
+                    </foreach>
+                )
+            </if>
+            <if test="isNullTag != null and isNullTag">
+                AND NOT EXISTS (
+                    select 1 from fs_user_project_tag upt_filter
+                    where upt_filter.user_company_user_id = ucu.id
+                )
+            </if>
             <if test="appCreateTimeStart != null and appCreateTimeEnd != null">
                 AND fs_user.app_create_time BETWEEN #{appCreateTimeStart} AND #{appCreateTimeEnd}
             </if>
@@ -510,6 +528,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="projectId != null">
                 AND ucu.project_id = #{projectId}
             </if>
+            <if test="tagIds != null and tagIds.length > 0">
+                AND EXISTS (
+                    select 1 from fs_user_project_tag upt_filter
+                    where upt_filter.user_company_user_id = ucu.id
+                    and upt_filter.tag_id in
+                    <foreach collection="tagIds" item="tagId" open="(" separator="," close=")">
+                        #{tagId}
+                    </foreach>
+                )
+            </if>
+            <if test="isNullTag != null and isNullTag">
+                AND NOT EXISTS (
+                    select 1 from fs_user_project_tag upt_filter
+                    where upt_filter.user_company_user_id = ucu.id
+                )
+            </if>
             <if test="appCreateTimeStart != null and appCreateTimeEnd != null">
                 AND fs_user.app_create_time BETWEEN #{appCreateTimeStart} AND #{appCreateTimeEnd}
             </if>
@@ -2616,6 +2650,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="projectId != null">
                 AND ucu.project_id = #{projectId}
             </if>
+            <if test="tagIds != null and tagIds.length > 0">
+                AND EXISTS (
+                    select 1 from fs_user_project_tag upt_filter
+                    where upt_filter.user_company_user_id = ucu.id
+                    and upt_filter.tag_id in
+                    <foreach collection="tagIds" item="tagId" open="(" separator="," close=")">
+                        #{tagId}
+                    </foreach>
+                )
+            </if>
+            <if test="isNullTag != null and isNullTag">
+                AND NOT EXISTS (
+                    select 1 from fs_user_project_tag upt_filter
+                    where upt_filter.user_company_user_id = ucu.id
+                )
+            </if>
             <if test="appCreateTimeStart != null and appCreateTimeEnd != null">
                 AND fs_user.app_create_time BETWEEN #{appCreateTimeStart} AND #{appCreateTimeEnd}
             </if>
@@ -2693,6 +2743,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="projectId != null">
                 AND ucu.project_id = #{projectId}
             </if>
+            <if test="tagIds != null and tagIds.length > 0">
+                AND EXISTS (
+                    select 1 from fs_user_project_tag upt_filter
+                    where upt_filter.user_company_user_id = ucu.id
+                    and upt_filter.tag_id in
+                    <foreach collection="tagIds" item="tagId" open="(" separator="," close=")">
+                        #{tagId}
+                    </foreach>
+                )
+            </if>
+            <if test="isNullTag != null and isNullTag">
+                AND NOT EXISTS (
+                    select 1 from fs_user_project_tag upt_filter
+                    where upt_filter.user_company_user_id = ucu.id
+                )
+            </if>
             <if test="appCreateTimeStart != null and appCreateTimeEnd != null">
                 AND fs_user.app_create_time BETWEEN #{appCreateTimeStart} AND #{appCreateTimeEnd}
             </if>

+ 4 - 7
fs-service/src/main/resources/mapper/his/FsUserProjectTagMapper.xml

@@ -5,18 +5,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <mapper namespace="com.fs.his.mapper.FsUserProjectTagMapper">
 
     <select id="getTagList" resultType="com.fs.store.vo.h5.CompanyUserTagListVO">
-        select distinct
+        select
             tag.tag_id,
             tag.tag tagName
         from company_tag tag
-        inner join fs_user_project_tag upt on tag.tag_id = upt.tag_id
-        inner join fs_user_company_user ucu on ucu.id = upt.user_company_user_id
         <where>
+            and ifnull(tag.status, 0) = 0
             <if test="params.companyId != null">
-                and ucu.company_id = #{params.companyId}
-            </if>
-            <if test="params.companyUserId != null">
-                and ucu.company_user_id = #{params.companyUserId}
+                and tag.company_id = #{params.companyId}
             </if>
             <if test="params.keywords != null and params.keywords.length > 0 ">
                 and
@@ -25,5 +21,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 </foreach>
             </if>
         </where>
+        order by tag.create_time desc, tag.tag_id desc
     </select>
 </mapper>

+ 122 - 0
fs-user-app/src/main/java/com/fs/app/controller/FsBlackTalentController.java

@@ -0,0 +1,122 @@
+package com.fs.app.controller;
+
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.utils.StringUtils;
+import com.fs.course.domain.FsBlackTalent;
+import com.fs.course.param.FsBlackAndReportParam;
+import com.fs.course.param.FsBlackTalentParam;
+import com.fs.course.param.FsBlackVideoParam;
+import com.fs.course.service.IFsBlackTalentService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.Map;
+
+@Api("达人或短视频被拉黑举报接口")
+@RestController
+@RequestMapping("/app/blackTalent")
+public class FsBlackTalentController extends AppBaseController{
+    @Autowired
+    private IFsBlackTalentService blackTalentService;
+    @ApiOperation("拉黑达人")
+    @PostMapping("/addBlackTalent")
+    public R addBlackTalent(@RequestBody FsBlackTalentParam blackTalentParam) {
+        String userId = getUserId();
+        FsBlackTalent fsBlackTalent = new FsBlackTalent();
+        fsBlackTalent.setUserId(Long.parseLong(userId));
+        fsBlackTalent.setCreatTime(new Date());
+        fsBlackTalent.setTalentId(blackTalentParam.getTalentId());
+        fsBlackTalent.setType(blackTalentParam.getType());
+        fsBlackTalent.setStyle("1");
+        if (blackTalentService.addBlack(fsBlackTalent)>0){
+            return R.ok();
+        }
+        return R.error();
+    }
+
+    @ApiOperation("拉黑视频")
+    @PostMapping("/addBlackVideo")
+    public R addBlackTalent(@RequestBody FsBlackVideoParam blackVideoParam) {
+        String userId = getUserId();
+        FsBlackTalent fsBlackTalent = new FsBlackTalent();
+        fsBlackTalent.setUserId(Long.parseLong(userId));
+        fsBlackTalent.setCreatTime(new Date());
+        fsBlackTalent.setVideoId(blackVideoParam.getVideoId());
+        fsBlackTalent.setType(blackVideoParam.getType());
+        fsBlackTalent.setStyle("2");
+        if (blackTalentService.addBlack(fsBlackTalent)>0){
+            return R.ok();
+        }
+        return R.error();
+    }
+
+    @ApiOperation("举报达人")
+    @PostMapping("/addReportTalent")
+    public R addReportTalent(@RequestBody FsBlackTalentParam blackTalentParam) {
+        String userId = getUserId();
+        FsBlackTalent fsBlackTalent = new FsBlackTalent();
+        fsBlackTalent.setUserId(Long.parseLong(userId));
+        fsBlackTalent.setCreatTime(new Date());
+        fsBlackTalent.setTalentId(blackTalentParam.getTalentId());
+        fsBlackTalent.setType(blackTalentParam.getType());
+        fsBlackTalent.setReportDesc(blackTalentParam.getReportDesc());
+        fsBlackTalent.setPhone(blackTalentParam.getPhone());
+        fsBlackTalent.setUrls(blackTalentParam.getUrls());
+        fsBlackTalent.setTemplateId(blackTalentParam.getTemplateId());
+        fsBlackTalent.setTradeImage(blackTalentParam.getTradeImage());
+        fsBlackTalent.setStyle("1");
+        fsBlackTalent.setIsAudit("0");
+
+        if (blackTalentService.addBlack(fsBlackTalent)>0){
+            return R.ok();
+        }
+        return R.error();
+    }
+
+    @ApiOperation("举报视频")
+    @PostMapping("/addReportVideo")
+    public R addReportVideo(@RequestBody FsBlackVideoParam blackVideoParam) {
+        String userId = getUserId();
+        FsBlackTalent fsBlackTalent = new FsBlackTalent();
+        fsBlackTalent.setUserId(Long.parseLong(userId));
+        fsBlackTalent.setCreatTime(new Date());
+        fsBlackTalent.setVideoId(blackVideoParam.getVideoId());
+        fsBlackTalent.setType(blackVideoParam.getType());
+        fsBlackTalent.setReportDesc(blackVideoParam.getReportDesc());
+        fsBlackTalent.setPhone(blackVideoParam.getPhone());
+        fsBlackTalent.setUrls(blackVideoParam.getUrls());
+        fsBlackTalent.setTemplateId(blackVideoParam.getTemplateId());
+        fsBlackTalent.setStyle("2");
+        fsBlackTalent.setIsAudit("0");
+
+        if (blackTalentService.addBlack(fsBlackTalent)>0){
+            return R.ok();
+        }
+        return R.error();
+    }
+    @ApiOperation("取消拉黑")
+    @PostMapping("/cancelBlack")
+    public R cancelBlack(@RequestBody Map<String,String> map){
+        String userId = getUserId();
+        String videoId = map.get("videoId");
+        String talentId = map.get("talentId");
+        if (StringUtils.isNotEmpty(videoId)){
+            blackTalentService.deleteFsBlackVideo(userId,videoId);
+            return R.ok();
+        }
+        if (StringUtils.isNotEmpty(talentId)){
+            blackTalentService.deleteFsBlackTalent(userId,talentId);
+            return R.ok();
+        }
+        return R.error("参数错误");
+    }
+    @ApiOperation("获取拉黑获取报的达人及视频")
+    @GetMapping("/getBlack")
+    public TableDataInfo getBlack(FsBlackAndReportParam blackAndReportParam){
+        return null;
+    }
+}