package com.fs.company.controller.qw;


import com.alibaba.fastjson.JSON;
import com.fs.common.annotation.Log;
import com.fs.common.annotation.RepeatSubmit;
import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.core.domain.R;
import com.fs.common.core.page.TableDataInfo;
import com.fs.common.enums.BusinessType;
import com.fs.common.utils.PubFun;
import com.fs.common.utils.ServletUtils;
import com.fs.common.utils.StringUtils;
import com.fs.framework.security.LoginUser;
import com.fs.framework.service.TokenService;
import com.fs.qw.domain.QwGroupChatUser;
import com.fs.qw.domain.QwTag;
import com.fs.qw.mapper.QwTagMapper;
import com.fs.qw.param.QwExternalContactVOTime;
import com.fs.qw.param.QwTagSearchParam;
import com.fs.qw.param.SopExternalContactInfo;
import com.fs.qw.service.IQwExternalContactService;
import com.fs.qw.service.IQwGroupChatUserService;
import com.fs.qw.service.IQwTagService;
import com.fs.qw.service.IQwUserService;
import com.fs.sop.domain.SopUserLogsInfo;
import com.fs.sop.params.BatchSopUserLogsInfoParam;
import com.fs.sop.params.SendUserLogsInfoMsgParam;
import com.fs.sop.service.ISopUserLogsInfoService;
import com.fs.voice.utils.StringUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.function.Predicate;
import java.util.stream.Collectors;

/**
 * sopUserLogsInfoController
 *
 * @author fs
 * @date 2024-12-27
 */
@RestController
@RequestMapping("/qwSop/sopUserLogsInfo")
public class SopUserLogsInfoController extends BaseController
{
    @Autowired
    private ISopUserLogsInfoService sopUserLogsInfoService;

    @Autowired
    private IQwExternalContactService iQwExternalContactService;

    @Autowired
    private IQwTagService iQwTagService;
    @Autowired
    private QwTagMapper qwTagMapper;
    @Autowired
    private IQwGroupChatUserService qwGroupChatUserService;

    private static final Gson GSON = new Gson();
    @Autowired
    private IQwUserService qwUserService;
    @Autowired
    private TokenService tokenService;

    /**
     * 查询sopUserLogsInfo列表
     */
    @PreAuthorize("@ss.hasPermi('qw:sop:list')")
    @GetMapping("/list")
    public TableDataInfo list(SopUserLogsInfo sopUserLogsInfo) {
        startPage();
        if (sopUserLogsInfo.getFilterMode() == 1) {
            List<SopUserLogsInfo> list = sopUserLogsInfoService.selectSopUserLogsInfoList(sopUserLogsInfo);

            if (!list.isEmpty()) {
                // 使用并行流提取externalId
                List<Long> externalIdList = list.parallelStream()
                        .map(SopUserLogsInfo::getExternalId)
                        .filter(Objects::nonNull)
                        .collect(Collectors.toList());

                List<QwExternalContactVOTime> qwExternalContactVOTimes =
                        iQwExternalContactService.selectQwExternalContactListVOByIds(externalIdList);

                // 构建联系人信息映射
                Map<Long, SopExternalContactInfo> externalContactInfoMap = qwExternalContactVOTimes.stream()
                        .collect(Collectors.toMap(
                                QwExternalContactVOTime::getId,
                                item -> new SopExternalContactInfo(item.getCreateTime(), item.getTagIds(), item.getRemark(),item.getLevel())
                        ));

                List<String> tagIds = qwExternalContactVOTimes.stream().map(QwExternalContactVOTime::getTagIds).filter(StringUtils::isNotEmpty).flatMap(e -> JSON.parseArray(e, String.class).stream()).collect(Collectors.toList());
                if(!tagIds.isEmpty()){
                    List<QwTag> tagList = qwTagMapper.selectQwTagListByTagIdsNew(tagIds);
                    Map<String, QwTag> tagMap = PubFun.listToMapByGroupObject(tagList, QwTag::getTagId);
                    qwExternalContactVOTimes.forEach(e -> {
                        List<String> tagId = JSON.parseArray(e.getTagIds(), String.class);
                        if(StringUtils.isNotEmpty(tagId)){
                            List<String> tagNameList = tagId.stream().filter(tagMap::containsKey).map(t -> tagMap.get(t).getName()).filter(StringUtils::isNotEmpty).collect(Collectors.toList());
                            e.setTagIdsName(tagNameList);
                        }
                    });
                }
                // 设置联系信息
                list.forEach(item -> {
                    SopExternalContactInfo info = externalContactInfoMap.getOrDefault(
                            item.getExternalId(),
                            new SopExternalContactInfo("无进线时间", "无标签", "无备注",0));
                    item.setInComTime(info.getCreateTime());
                    item.setTagIds(info.getTagIds());
                    item.setRemark(info.getRemark());
                    item.setLevel(info.getLevel());

                });
            }

            // 优化过滤条件
            boolean isRemarkEmpty = StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getRemark());

            Predicate<SopUserLogsInfo> tagFilter = item ->
                    sopUserLogsInfo.getTagIds() == null ||
                            sopUserLogsInfo.getTagIds().isEmpty() ||
                            item.getTagIds().contains(sopUserLogsInfo.getTagIds());

            Predicate<SopUserLogsInfo> remarkFilter = item ->
                    isRemarkEmpty ||
                            item.getRemark().contains(sopUserLogsInfo.getRemark());


            boolean isLevelEmpty = sopUserLogsInfo.getLevel() == null;
            Predicate<SopUserLogsInfo> levelFilter = item ->
                    isLevelEmpty ||
                            (item.getLevel() != null && Objects.equals(item.getLevel(), sopUserLogsInfo.getLevel()) );


            Predicate<SopUserLogsInfo> timeFilter = item -> {
                if (StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getEntryTime())) {
                    return true;
                }
                try {
                    LocalDate entryDate = LocalDate.parse(
                            sopUserLogsInfo.getEntryTime(),
                            DateTimeFormatter.ofPattern("yyyy-MM-dd")
                    );
                    LocalDate createDate = LocalDate.parse(
                            item.getInComTime().substring(0, 10),
                            DateTimeFormatter.ofPattern("yyyy-MM-dd")
                    );
                    return entryDate.equals(createDate);
                } catch (Exception e) {
                    return false;
                }
            };

            if (sopUserLogsInfo.getTagIds() != null || !isRemarkEmpty || !StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getEntryTime()) ||!isLevelEmpty) {
                list = list.stream()
                        .filter(tagFilter.and(remarkFilter).and(timeFilter).and(levelFilter))
                        .collect(Collectors.toList());
            }

            // 处理标签名称
            list.parallelStream().forEach(item -> {
                if (item.getTagIds() != null && !item.getTagIds().equals("[]") && !item.getTagIds().equals("无标签")) {
                    List<String> tagIds = GSON.fromJson(item.getTagIds(), new TypeToken<List<String>>() {}.getType());
                    QwTagSearchParam param = new QwTagSearchParam();
                    param.setTagIds(tagIds);
                    item.setTagIdsName(iQwTagService.selectQwTagListByTagIds(param));
                }

                // 处理 level
                item.setLevelName(getLevel(item.getLevel()));
            });

//            List<SopUserLogsInfo> list = sopUserLogsInfoService.selectSopUserLogsInfoList(sopUserLogsInfo);
//
//            if (!list.isEmpty()) {
//                // 使用并行流提取externalId
//                List<Long> externalIdList = list.parallelStream()
//                        .map(SopUserLogsInfo::getExternalId)
//                        .filter(Objects::nonNull)
//                        .collect(Collectors.toList());
//
//                List<QwExternalContactVOTime> qwExternalContactVOTimes =
//                        iQwExternalContactService.selectQwExternalContactListVOByIds(externalIdList);
//
//                // 构建联系人信息映射
//                Map<Long, SopExternalContactInfo> externalContactInfoMap = qwExternalContactVOTimes.stream()
//                        .collect(Collectors.toMap(
//                                QwExternalContactVOTime::getId,
//                                item -> new SopExternalContactInfo(item.getCreateTime(), item.getTagIds(), item.getRemark(),item.getLevel())
//                        ));
//                List<String> tagIds = qwExternalContactVOTimes.stream().map(QwExternalContactVOTime::getTagIds).filter(StringUtils::isNotEmpty).flatMap(e -> JSON.parseArray(e, String.class).stream()).collect(Collectors.toList());
//                if(!tagIds.isEmpty()){
//                    List<QwTag> tagList = qwTagMapper.selectQwTagListByTagIdsNew(tagIds);
//                    Map<String, QwTag> tagMap = PubFun.listToMapByGroupObject(tagList, QwTag::getTagId);
//                    qwExternalContactVOTimes.forEach(e -> {
//                        List<String> tagId = JSON.parseArray(e.getTagIds(), String.class);
//                        if(StringUtils.isNotEmpty(tagId)){
//                            List<String> tagNameList = tagId.stream().filter(tagMap::containsKey).map(t -> tagMap.get(t).getName()).filter(StringUtils::isNotEmpty).collect(Collectors.toList());
//                            e.setTagIdsName(tagNameList);
//                        }
//                    });
//                }
//                // 设置联系信息
//                list.forEach(item -> {
//                    SopExternalContactInfo info = externalContactInfoMap.getOrDefault(
//                            item.getExternalId(),
//                            new SopExternalContactInfo("无进线时间", "无标签", "无备注",0));
//                    item.setInComTime(info.getCreateTime());
//                    item.setTagIds(info.getTagIds());
//                    item.setRemark(info.getRemark());
//                    item.setLevel(info.getLevel());
//
//                });
//            }
//
//            Predicate<SopUserLogsInfo> tagFilter = item -> {
//                String queryTagIds = sopUserLogsInfo.getTagIds();
//                String itemTagIds = item.getTagIds();
//
//                if (queryTagIds == null || queryTagIds.trim().equals("[]")) {
//                    return true;
//                }
//                List<String> queryTags = parseTagIds(queryTagIds);
//                List<String> itemTags = parseTagIds(itemTagIds);
//
//                // 检查 itemTags 是否包含所有 queryTags（AND 关系）
//                return itemTags.containsAll(queryTags);
//            };
//
//            // 优化过滤条件
//            boolean isRemarkEmpty = StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getRemark());
//            Predicate<SopUserLogsInfo> remarkFilter = item ->
//                    isRemarkEmpty ||
//                            item.getRemark().contains(sopUserLogsInfo.getRemark());
//
//
//            boolean isLevelEmpty = sopUserLogsInfo.getLevel() == null;
//            Predicate<SopUserLogsInfo> levelFilter = item ->
//                    isLevelEmpty ||
//                            (item.getLevel() != null && Objects.equals(item.getLevel(), sopUserLogsInfo.getLevel()) );
//
//
//            Predicate<SopUserLogsInfo> timeFilter = item -> {
//
//                if (StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getInComingSTime())
//                        && StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getInComingETime()) ) {
//                    return true;
//                }
//                try {
//                    LocalDateTime entryDate = LocalDateTime.parse(item.getInComTime(),
//                            DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
//                    );
//                    LocalDateTime inComingSTime = LocalDateTime.parse(sopUserLogsInfo.getInComingSTime(),
//                            DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
//                    );
//
//                    LocalDateTime inComingETime = LocalDateTime.parse(sopUserLogsInfo.getInComingETime(),
//                            DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
//                    );
//
//                    return !entryDate.isBefore(inComingSTime) && !entryDate.isAfter(inComingETime);
//                } catch (Exception e) {
//                    return false;
//                }
//            };
//
//
//            boolean hasTimeFilter = !StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getInComingSTime())
//                    && !StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getInComingETime());
//
//            if (sopUserLogsInfo.getTagIds() != null || !isRemarkEmpty || hasTimeFilter ||!isLevelEmpty) {
//                list = list.stream()
//                        .filter(tagFilter.and(remarkFilter).and(timeFilter).and(levelFilter))
//                        .collect(Collectors.toList());
//            }
//
//            // 处理标签名称
//            list.parallelStream().forEach(item -> {
//                if (item.getTagIds() != null && !item.getTagIds().equals("[]") && !item.getTagIds().equals("无标签")) {
//                    List<String> tagIds = GSON.fromJson(item.getTagIds(), new TypeToken<List<String>>() {}.getType());
//                    QwTagSearchParam param = new QwTagSearchParam();
//                    param.setTagIds(tagIds);
//                    item.setTagIdsName(iQwTagService.selectQwTagListByTagIds(param));
//                }
//
//                // 处理 level
//                item.setLevelName(getLevel(item.getLevel()));
//            });

            return getDataTable(list);
        }
        else {

            List<QwGroupChatUser> list = qwGroupChatUserService.selectByChatId(sopUserLogsInfo);


            if (!list.isEmpty()) {

                List<String> externalIdList = list.stream()
                        .map(QwGroupChatUser::getUserId) // 提取 externalId
                        .filter(StringUtils::isNotEmpty) // 过滤掉 null 值，防止 NullPointerException
                        .distinct()
                        .collect(Collectors.toList()); // 收集到 List

                List<QwExternalContactVOTime> qwExternalContactVOTimes = iQwExternalContactService.selectQwExternalContactListVOByUserIds(externalIdList);


                // 先将 qwExternalContactVOTimes 转换为 Map，key 为 id，value 为 ExternalContactInfo（包含 createTime 和 tagIds）
                Map<String, SopExternalContactInfo> externalContactInfoMap = qwExternalContactVOTimes.stream()
                        .collect(Collectors.toMap(
                                QwExternalContactVOTime::getExternalUserId,
                                item -> new SopExternalContactInfo(item.getCreateTime(), item.getTagIds(), item.getRemark(),item.getLevel())
                        ));

                // 遍历 list，赋值 inComTime 和 tagIds
                list.forEach(item -> {
                    SopExternalContactInfo info = externalContactInfoMap.getOrDefault(item.getUserId(), new SopExternalContactInfo("无进线时间", "无标签", "无备注",0));
                    item.setInComTime(info.getCreateTime());
                    item.setTagIds(info.getTagIds());
                    item.setRemark(info.getRemark());
                });

            }

            if ((sopUserLogsInfo.getTagIds() != null && !sopUserLogsInfo.getTagIds().isEmpty())
                    || !StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getRemark())) {
                list = list.stream()
                        .filter(item ->
                                (sopUserLogsInfo.getTagIds() == null || sopUserLogsInfo.getTagIds().isEmpty() || item.getTagIds().contains(sopUserLogsInfo.getTagIds()))
                                        && (StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getRemark()) || item.getRemark().contains(sopUserLogsInfo.getRemark()))
                        )
                        .collect(Collectors.toList());
            }

            // 处理标签名称
            list.parallelStream().forEach(item -> {
                if (item.getTagIds() != null && !item.getTagIds().equals("[]") && !item.getTagIds().equals("无标签")) {
                    List<String> tagIds = GSON.fromJson(item.getTagIds(), new TypeToken<List<String>>() {}.getType());
                    QwTagSearchParam param = new QwTagSearchParam();
                    param.setTagIds(tagIds);
                    item.setTagIdsName(iQwTagService.selectQwTagListByTagIds(param));
                }
            });
            return getDataTable(list);
//            List<QwGroupChatUser> list = qwGroupChatUserService.selectByChatId(sopUserLogsInfo);
//
//
//            if (!list.isEmpty()) {
//
//                List<String> externalIdList = list.stream()
//                        .map(QwGroupChatUser::getUserId) // 提取 externalId
//                        .filter(StringUtils::isNotEmpty) // 过滤掉 null 值，防止 NullPointerException
//                        .distinct()
//                        .collect(Collectors.toList()); // 收集到 List
//
//                List<QwExternalContactVOTime> qwExternalContactVOTimes = iQwExternalContactService.selectQwExternalContactListVOByUserIds(externalIdList);
//
//
//                // 先将 qwExternalContactVOTimes 转换为 Map，key 为 id，value 为 ExternalContactInfo（包含 createTime 和 tagIds）
//                Map<String, SopExternalContactInfo> externalContactInfoMap = qwExternalContactVOTimes.stream()
//                        .collect(Collectors.toMap(
//                                QwExternalContactVOTime::getExternalUserId,
//                                item -> new SopExternalContactInfo(item.getCreateTime(), item.getTagIdsName(), item.getTagIds(), item.getRemark())
//                        ));
//
//                // 遍历 list，赋值 inComTime 和 tagIds
//                list.forEach(item -> {
//                    SopExternalContactInfo info = externalContactInfoMap.getOrDefault(item.getUserId(), new SopExternalContactInfo("无进线时间", "无标签", "无备注"));
//                    item.setInComTime(info.getCreateTime());
//                    item.setTagIds(info.getTagIds());
//                    item.setTagNames(info.getTagNames());
//                    item.setRemark(info.getRemark());
//                });
//
//            }
//
//            if ((sopUserLogsInfo.getTagIds() != null && !sopUserLogsInfo.getTagIds().isEmpty())
//                    || !StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getRemark())) {
//                list = list.stream()
//                        .filter(item ->
//                                (sopUserLogsInfo.getTagIds() == null || sopUserLogsInfo.getTagIds().isEmpty() || item.getTagIds().contains(sopUserLogsInfo.getTagIds()))
//                                        && (StringUtil.strIsNullOrEmpty(sopUserLogsInfo.getRemark()) || item.getRemark().contains(sopUserLogsInfo.getRemark()))
//                        )
//                        .collect(Collectors.toList());
//            }
//            return getDataTable(list);
        }

    }


    private String getLevel(Integer level){

        String levelName = "无";

        if (level != null) {

            switch (level) {
                case 0:
                    levelName = "无";
                    break;
                case 1:
                    levelName = "A";
                    break;
                case 2:
                    levelName = "B";
                    break;
                case 3:
                    levelName = "C";
                    break;
                case 4:
                    levelName = "D";
                    break;
                case 5:
                    levelName = "E";
                    break;
                default:
                    levelName = "无";
            }
        }
        return  levelName;
    }
    private List<String> parseTagIds(String jsonTagIds) {
        if (jsonTagIds == null || jsonTagIds.trim().isEmpty() || jsonTagIds.equals("[]")) {
            return Collections.emptyList();
        }
        // 去掉开头和结尾的 [ ]，然后按 "," 分割
        return Arrays.stream(jsonTagIds.replaceAll("[\\[\\]\"]", "").split(","))
                .map(String::trim)
                .filter(s -> !s.isEmpty())
                .collect(Collectors.toList());
    }
//    /**
//     * 导出sopUserLogsInfo列表
//     */
//    @PreAuthorize("@ss.hasPermi('qw:sop:export')")
//    @Log(title = "sopUserLogsInfo", businessType = BusinessType.EXPORT)
//    @GetMapping("/export")
//    public AjaxResult export(SopUserLogsInfo sopUserLogsInfo)
//    {
//        List<SopUserLogsInfoVOE> list = sopUserLogsInfoService.selectSopUserLogsInfoListVO(sopUserLogsInfo);
//
//        if (!list.isEmpty()){
//
//            List<Long> externalIdList = list.stream()
//                    .map(SopUserLogsInfoVOE::getExternalId) // 提取 externalId
//                    .filter(Objects::nonNull) // 过滤掉 null 值，防止 NullPointerException
//                    .collect(Collectors.toList()); // 收集到 List
//
//            List<QwExternalContactVOTime> qwExternalContactVOTimes = iQwExternalContactService.selectQwExternalContactListVOByIds(externalIdList);
//
//
//            // 先将 qwExternalContactVOTimes 转换为 Map，key 为 id，value 为 ExternalContactInfo（包含 createTime 和 tagIds）
//            Map<Long, SopExternalContactInfoEx> externalContactInfoMap = qwExternalContactVOTimes.stream()
//                    .collect(Collectors.toMap(
//                            QwExternalContactVOTime::getId,
//                            item -> new SopExternalContactInfoEx(item.getCreateTime(),item.getRemark(),item.getFsUserId(),item.getAvatar())
//                    ));
//
//            // 遍历 list，赋值 inComTime 和 tagIds
//            list.forEach(item -> {
//                SopExternalContactInfoEx info = externalContactInfoMap.getOrDefault(item.getExternalId(), new SopExternalContactInfoEx("无进线时间","无备注","未绑定小程序账号","无头像"));
//                item.setInComTime(info.getCreateTime());
//                item.setRemark(info.getRemark());
//                item.setFsUserId(info.getFsUserId());
//                item.setAvatar(info.getAvatar());
//            });
//
//        }
//
//        ExcelUtil<SopUserLogsInfoVOE> util = new ExcelUtil<SopUserLogsInfoVOE>(SopUserLogsInfoVOE.class);
//        return util.exportExcel(list, "营期数据");
//    }

    /**
     * 获取sopUserLogsInfo详细信息
     */
    @PreAuthorize("@ss.hasPermi('qw:sop:list')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return AjaxResult.success(sopUserLogsInfoService.selectSopUserLogsInfoById(id));
    }

    /**
     * 修改sopUserLogsInfo 修改营期
     */
    @PreAuthorize("@ss.hasPermi('qw:sopUserLogsInfo:edit')")
    @Log(title = "updateSopUserLogsInfo", businessType = BusinessType.UPDATE)
    @PostMapping("/batchUpdateSopUserLogsInfoToTime")
    public R edit(@RequestBody BatchSopUserLogsInfoParam param)
    {
        return sopUserLogsInfoService.batchUpdateSopUserLogsInfoToTime(param);
    }

    /**
     * 一键群发sopUserLogsInfo
     */
    @PreAuthorize("@ss.hasPermi('qw:sopUserLogsInfo:msg')")
    @Log(title = "sendMsgSopUserLogsInfo", businessType = BusinessType.INSERT,isSaveRequestData=false)
    @PostMapping("/sendUserLogsInfoMsg")
    @RepeatSubmit
    public R sendUserLogsInfoMsg(@RequestBody SendUserLogsInfoMsgParam param)
    {
        return sopUserLogsInfoService.sendUserLogsInfoMsg(param);
    }

    /**
     * 一键群发sopUserLogsInfo
     */
    @PreAuthorize("@ss.hasPermi('qw:sopUserLogsInfo:msgSchedule')")
    @Log(title = "sendUserLogsInfoMsgType", businessType = BusinessType.INSERT,isSaveRequestData=false)
    @PostMapping("/sendUserLogsInfoMsgType")
    @RepeatSubmit
    public R sendUserLogsInfoMsgType(@RequestBody SendUserLogsInfoMsgParam param)
    {
        return sopUserLogsInfoService.sendUserLogsInfoMsgType(param);
    }

    /**
     * 一键群发sopUserLogsInfo
     */
    @PreAuthorize("@ss.hasPermi('qw:sopUserLogsInfo:msgSop')")
    @Log(title = "sendUserLogsInfoMsgSop", businessType = BusinessType.INSERT,isSaveRequestData=false)
    @PostMapping("/sendUserLogsInfoMsgSop")
    @RepeatSubmit
    public R sendUserLogsInfoMsgSop(@RequestBody SendUserLogsInfoMsgParam param)
    {
        if (param.getIsMine() != null && param.getIsMine() == 1) {
            //我的sop
            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
            //查询qwUserId
            List<String> qwUserIds = qwUserService.selectQwUserListByCompanyUserId(loginUser.getUser().getUserId(), param.getCorpId());
            if (qwUserIds != null && !qwUserIds.isEmpty()) {
                param.setQwUserIds(qwUserIds);
            }
        }
        return sopUserLogsInfoService.sendUserLogsInfoMsgSop(param);
    }


    /**
     * 删除sopUserLogsInfo
     */
    @PreAuthorize("@ss.hasPermi('qw:sopUserLogsInfo:remove')")
    @Log(title = "deleteSopUserLogsInfo", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(sopUserLogsInfoService.deleteSopUserLogsInfoByIds(ids));
    }
}
