Compare commits
3 Commits
ef95d08200
...
399892c140
Author | SHA1 | Date |
---|---|---|
bynt | 399892c140 | 1 month ago |
bynt | d305f8a059 | 2 months ago |
bynt | 795bff59c9 | 3 months ago |
@ -0,0 +1,108 @@
|
||||
package com.baiye.modules.customer.controller;
|
||||
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.modules.customer.entity.CustomerUserInfo;
|
||||
import com.baiye.modules.customer.service.CustomerUserService;
|
||||
import com.baiye.modules.scrm.dto.CustomerAddRobotDTO;
|
||||
import com.baiye.modules.scrm.dto.CustomerUserInfoDTO;
|
||||
import com.baiye.modules.scrm.qo.AccountQo;
|
||||
import com.baiye.modules.scrm.qo.CustomerUserQo;
|
||||
import com.baiye.modules.scrm.vo.CustomerUserInfoVO;
|
||||
import com.baiye.modules.scrm.vo.WeChatAccountVO;
|
||||
import com.baiye.result.BaseResultCode;
|
||||
import com.baiye.result.R;
|
||||
import com.baiye.security.util.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.function.ServerResponse;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
*/
|
||||
@Tag(name = "客服相关接口")
|
||||
@RestController
|
||||
@RequestMapping("/customer/user")
|
||||
@RequiredArgsConstructor
|
||||
public class CustomerInfoController {
|
||||
|
||||
private final CustomerUserService customerUserService;
|
||||
|
||||
|
||||
@Operation(summary = "保存客服账号")
|
||||
@PostMapping("/create")
|
||||
public R<Void> save(@RequestBody @Validated CustomerUserInfoDTO customerUserInfoDTO) {
|
||||
Boolean saveCustomerInfo = customerUserService.saveCustomerInfo(customerUserInfoDTO, SecurityUtils.getCurrentUserId());
|
||||
return saveCustomerInfo.equals(Boolean.TRUE) ? R.ok() : R.failed(BaseResultCode.UPDATE_DATABASE_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "分页查询数据")
|
||||
@GetMapping("/page")
|
||||
public R<PageResult<CustomerUserInfoVO>> getCustomerPage(@Validated PageParam pageParam, CustomerUserQo qo) {
|
||||
return R.ok(customerUserService.queryPage(pageParam, qo));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "获取客服详情")
|
||||
@GetMapping("/detail")
|
||||
public R<CustomerUserInfo> getDetail(@RequestParam Long id) {
|
||||
return R.ok(customerUserService.getById(id));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "获取主次详情")
|
||||
@GetMapping("listMasterDetailByCustomerId")
|
||||
public R<Map<String, Object>> listMasterDetailByCustomerId(Long customerId) {
|
||||
return R.ok(customerUserService.listMasterDetailByCustomerId(customerId));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "获取主账号")
|
||||
@GetMapping("listRobotByCustomerId")
|
||||
public List<WeChatAccountVO> listRobotBYCustomerId(Long customerId) {
|
||||
return customerUserService.listRobotByCustomerId(customerId);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "添加主账号")
|
||||
@PostMapping(value = "addMasterRobots")
|
||||
public R<Boolean> batchAddMasterByRobots(@RequestBody CustomerAddRobotDTO addRobot) {
|
||||
return R.ok(customerUserService.addMasterRobots(addRobot));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "获取次级账号")
|
||||
@GetMapping(value = "acquisition/secondary")
|
||||
public R<List<WeChatAccountVO>> acquisitionSecondary(Long customerId) {
|
||||
return R.ok(customerUserService.acquisitionSecondary(customerId));
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "删除客服")
|
||||
public R<String> deleteByUserId(@PathVariable("id") Long customerId) {
|
||||
return Boolean.TRUE.equals(customerUserService.del(customerId)) ? R.ok() : R.failed(BaseResultCode.UPDATE_DATABASE_ERROR, "删除失败");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量移除主账号、微信
|
||||
*/
|
||||
@Operation(summary = "批量移除主账号、微信")
|
||||
@PostMapping(value = "delDeviceJoinCustomer")
|
||||
public R<Boolean> batchRemoveMasterByRobots(@RequestBody CustomerAddRobotDTO addRobot) {
|
||||
return R.ok(customerUserService.batchRemoveMasterByRobots(addRobot));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.baiye.modules.customer.controller;
|
||||
|
||||
|
||||
|
||||
import com.baiye.modules.customer.service.CustomerVisibleRangeService;
|
||||
import com.baiye.modules.scrm.dto.CustomerVisibleRangeDTO;
|
||||
import com.baiye.result.R;
|
||||
import com.baiye.security.util.SecurityUtils;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.function.ServerResponse;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 客服消息可见范围
|
||||
* </p>
|
||||
*
|
||||
* @author hans
|
||||
* @since 2023-02-27
|
||||
*/
|
||||
@Tag(name = "次级账号配置")
|
||||
@RestController
|
||||
@RequestMapping("/customer/visible/range")
|
||||
@RequiredArgsConstructor
|
||||
public class CustomerVisibleRangeController {
|
||||
|
||||
private final CustomerVisibleRangeService customerVisibleRangeService;
|
||||
|
||||
/**
|
||||
* 保存客服可见的群和好友
|
||||
*/
|
||||
@PostMapping(value = "/save")
|
||||
public R<Boolean> save(@RequestBody CustomerVisibleRangeDTO customerVisibleRangeVO) {
|
||||
|
||||
return R.ok(customerVisibleRangeService.createVisibleRange(customerVisibleRangeVO));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.baiye.modules.customer.controller;
|
||||
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.modules.customer.service.CustomerRobotWxLabelService;
|
||||
import com.baiye.modules.scrm.dto.CustomerWxLabelDTO;
|
||||
import com.baiye.modules.scrm.qo.AccountQo;
|
||||
import com.baiye.modules.scrm.qo.RobotWxLabelQO;
|
||||
import com.baiye.modules.scrm.vo.CustomerWxLabelVO;
|
||||
import com.baiye.modules.scrm.vo.WeChatAccountVO;
|
||||
import com.baiye.result.BaseResultCode;
|
||||
import com.baiye.result.R;
|
||||
import com.baiye.security.util.SecurityUtils;
|
||||
import com.baiye.validation.group.CreateGroup;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
*/
|
||||
@Tag(name = "标签")
|
||||
@RestController
|
||||
@RequestMapping("/customer/label")
|
||||
@RequiredArgsConstructor
|
||||
public class CustomerWxLabelController {
|
||||
|
||||
private final CustomerRobotWxLabelService customerRobotWxLabelService;
|
||||
|
||||
|
||||
@GetMapping("/account/page")
|
||||
@Operation(summary = "分页查询")
|
||||
public R<PageResult<WeChatAccountVO>> getClueRecordPage(@Validated PageParam pageParam, AccountQo qo) {
|
||||
qo.setUserId(SecurityUtils.getCurrentUserId());
|
||||
return R.ok(customerRobotWxLabelService.queryAccountPage(pageParam, qo));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询")
|
||||
public R<PageResult<CustomerWxLabelVO>> getClueRecordPage(@Validated PageParam pageParam, RobotWxLabelQO qo) {
|
||||
qo.setUserId(SecurityUtils.getCurrentUserId());
|
||||
return R.ok(customerRobotWxLabelService.queryPage(pageParam, qo));
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "创建标签", description = "创建标签")
|
||||
public R<Boolean> save(@Validated({CreateGroup.class}) @RequestBody CustomerWxLabelDTO labelDTO) {
|
||||
return R.ok(customerRobotWxLabelService.add(labelDTO, SecurityUtils.getCurrentUserId()));
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/del/{id}")
|
||||
@Operation(summary = "删除标签")
|
||||
public R<String> deleteByUserId(@PathVariable("id") Long id) {
|
||||
return Boolean.TRUE.equals(customerRobotWxLabelService.del(id)) ? R.ok() : R.failed(BaseResultCode.UPDATE_DATABASE_ERROR, "删除失败");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.baiye.modules.customer.converter;
|
||||
|
||||
import com.baiye.modules.customer.entity.CustomerRobotWxLabel;
|
||||
import com.baiye.modules.scrm.vo.CustomerWxLabelVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/26
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerRobotWxLabelConverter {
|
||||
|
||||
CustomerRobotWxLabelConverter INSTANCE = Mappers.getMapper(CustomerRobotWxLabelConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转vo
|
||||
*
|
||||
* @param userInfo
|
||||
* @return
|
||||
*/
|
||||
CustomerWxLabelVO entityToVo(CustomerRobotWxLabel userInfo);
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.baiye.modules.customer.converter;
|
||||
|
||||
import com.baiye.modules.customer.entity.CustomerUserInfo;
|
||||
import com.baiye.modules.scrm.vo.CustomerUserInfoVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/3/28
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerUserConverter {
|
||||
|
||||
CustomerUserConverter INSTANCE = Mappers.getMapper(CustomerUserConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转vo
|
||||
*
|
||||
* @param userInfo
|
||||
* @return
|
||||
*/
|
||||
CustomerUserInfoVO entityToVo(CustomerUserInfo userInfo);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.baiye.modules.customer.entity;
|
||||
|
||||
import com.baiye.entity.BaseEntity;
|
||||
import com.baiye.entity.LogicDeletedBaseEntity;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/8
|
||||
*/
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@TableName(value = "tb_customer_join_robot", autoResultMap = true)
|
||||
public class CustomerJoinRobot extends LogicDeletedBaseEntity {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@Schema(title = "ID")
|
||||
@NotNull(message = "ID不能为空", groups = { UpdateGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客服ID
|
||||
*/
|
||||
@TableField("customer_id")
|
||||
private Long customerId;
|
||||
|
||||
/**
|
||||
* 客服账号
|
||||
*/
|
||||
@TableField("customer_account")
|
||||
private String customerAccount;
|
||||
|
||||
/**
|
||||
* 机器人ID
|
||||
*/
|
||||
@TableField("robot_id")
|
||||
private Long robotId;
|
||||
|
||||
/**
|
||||
* 机器人微信ID
|
||||
*/
|
||||
@TableField("robot_wx_id")
|
||||
private String robotWxId;
|
||||
|
||||
/**
|
||||
* 删除标记位
|
||||
*/
|
||||
@TableField("del_flag")
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.baiye.modules.customer.entity;
|
||||
|
||||
import com.baiye.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 客服消息可见范围
|
||||
* </p>
|
||||
*
|
||||
* @author hans
|
||||
* @since 2023-02-27
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@TableName(value = "tb_customer_visible_range", autoResultMap = true)
|
||||
public class CustomerVisibleRange extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("user_id")
|
||||
private Long customerId;
|
||||
|
||||
@TableField("user_id")
|
||||
private Long userId;
|
||||
|
||||
@TableField("account")
|
||||
private String account;
|
||||
|
||||
@TableField("wechat_id")
|
||||
private String wechatId;
|
||||
|
||||
@TableField("friend_wx_id")
|
||||
private String friendWxId;
|
||||
|
||||
@TableField("friend_wx_img")
|
||||
private String friendWxImg;
|
||||
|
||||
@TableField("friend_wx_nick")
|
||||
private String friendWxNick;
|
||||
|
||||
@TableField("friend_all_enable")
|
||||
private Boolean friendAllEnable;
|
||||
|
||||
@TableField("group_all_enable")
|
||||
private Boolean groupAllEnable;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.baiye.modules.customer.feign;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/9
|
||||
* @since https://blog.csdn.net/u014635374/article/details/118338358
|
||||
*/
|
||||
@FeignClient(name = "customerFeign", url = "${feign.request.url}" + "/customer")
|
||||
public interface CustomerInfoFeign {
|
||||
|
||||
/**
|
||||
* 查询账号
|
||||
* @param account
|
||||
*/
|
||||
@GetMapping(value = "/query/account")
|
||||
void getUsers(@RequestParam("account") String account);
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.baiye.modules.customer.feign;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/12
|
||||
*/
|
||||
@FeignClient(name = "customerVisibleFeign", url = "${feign.request.url}" + "/customer/visible")
|
||||
public interface CustomerVisibleFeign {
|
||||
|
||||
/**
|
||||
* 新建设备
|
||||
*
|
||||
* @param account
|
||||
*/
|
||||
@GetMapping(value = "/account")
|
||||
void createNewDevice(@RequestParam("account") String account);
|
||||
|
||||
/**
|
||||
* 创建客服
|
||||
*
|
||||
* @param dtoAccount
|
||||
*/
|
||||
@GetMapping(value = "/add")
|
||||
void addCustomer(@RequestParam("account") String dtoAccount);
|
||||
|
||||
/**
|
||||
* 新增客服设备
|
||||
*
|
||||
* @param account
|
||||
* @param stringList
|
||||
*/
|
||||
@PostMapping(value = "/device")
|
||||
void newDeviceConversation(@RequestParam("account") String account, @RequestParam("wxIds") List<String> stringList);
|
||||
|
||||
/**
|
||||
* 清除数据
|
||||
*
|
||||
* @param account
|
||||
* @param wechatId
|
||||
* @param friendWxIds
|
||||
*/
|
||||
@PostMapping(value = "/clear")
|
||||
void clearCustomerVisibleRanges(@RequestParam("account") String account, @RequestParam("wechatId") String wechatId, @RequestParam("friendWxIds") List<String> friendWxIds);
|
||||
}
|
||||
|
@ -0,0 +1,87 @@
|
||||
package com.baiye.modules.customer.mapper;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.customer.entity.CustomerJoinRobot;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/8
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerJoinRobotMapper extends ExtendMapper<CustomerJoinRobot> {
|
||||
/**
|
||||
* 主账号Id查询
|
||||
*
|
||||
* @param customerId
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
default List<CustomerJoinRobot> selectListByCustomerId(Long customerId, Integer number) {
|
||||
return selectList(WrappersX.lambdaQueryX(CustomerJoinRobot.class).eq(CustomerJoinRobot::getCustomerId, customerId).eq(CustomerJoinRobot::getDelFlag, number));
|
||||
}
|
||||
|
||||
/**
|
||||
* 客服ID删除数据
|
||||
*
|
||||
* @param customerId
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
default int deleteByCustomerId(Long customerId, List<Long> list) {
|
||||
LambdaUpdateWrapper<CustomerJoinRobot> wrapper = WrappersX.lambdaUpdate(CustomerJoinRobot.class);
|
||||
wrapper.eq((CustomerJoinRobot::getCustomerId), customerId);
|
||||
|
||||
if (CollUtil.isNotEmpty(list)){
|
||||
wrapper.in(CustomerJoinRobot::getRobotId, list);
|
||||
}
|
||||
return this.delete(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客服id查询
|
||||
*
|
||||
* @param customerId
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
default Long selectCountByCustomerId(Long customerId, Integer number) {
|
||||
return this.selectCount(WrappersX.lambdaQueryX(CustomerJoinRobot.class).eq
|
||||
(CustomerJoinRobot::getCustomerId, customerId).eq(CustomerJoinRobot::getDelFlag, number));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id
|
||||
* @param robotIds
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
default Integer cancelCustomerIdByIdsIn(Long id, List<Long> robotIds, Integer number) {
|
||||
LambdaUpdateWrapper<CustomerJoinRobot> wrapper = WrappersX.lambdaUpdate(CustomerJoinRobot.class);
|
||||
wrapper.eq(CustomerJoinRobot::getCustomerId, id).in(CustomerJoinRobot::getRobotId, robotIds);
|
||||
wrapper.set(CustomerJoinRobot::getDelFlag, number);
|
||||
return update(null, wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改不可删除
|
||||
*
|
||||
* @param customerId
|
||||
* @param list
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
default Integer updateByCustomerIdAndRobotId(Long customerId, List<Long> list, Integer number) {
|
||||
LambdaUpdateWrapper<CustomerJoinRobot> wrapper = WrappersX.lambdaUpdate(CustomerJoinRobot.class);
|
||||
wrapper.set(CustomerJoinRobot::getDelFlag, number);
|
||||
wrapper.eq(CustomerJoinRobot::getCustomerId, customerId).in(CustomerJoinRobot::getId, list);
|
||||
return update(null, wrapper);
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.baiye.modules.customer.mapper;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.conditions.query.LambdaQueryWrapperX;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.customer.converter.CustomerRobotWxLabelConverter;
|
||||
import com.baiye.modules.customer.entity.CustomerRobotWxLabel;
|
||||
import com.baiye.modules.scrm.qo.AccountQo;
|
||||
import com.baiye.modules.scrm.qo.RobotWxLabelQO;
|
||||
import com.baiye.modules.scrm.vo.CustomerWxLabelVO;
|
||||
import com.baiye.modules.scrm.vo.WeChatAccountVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/8
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerRobotWxLabelMapper extends ExtendMapper<CustomerRobotWxLabel> {
|
||||
|
||||
PageResult<WeChatAccountVO> selectAccountPage(@Param("page") Page<WeChatAccountVO> weChatAccountVOPage, @Param("qo") AccountQo qo);
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
default PageResult<CustomerWxLabelVO> queryPage(PageParam pageParam, RobotWxLabelQO qo) {
|
||||
IPage<CustomerRobotWxLabel> page = this.prodPage(pageParam);
|
||||
LambdaQueryWrapperX<CustomerRobotWxLabel> wrapperX = WrappersX.lambdaQueryX(CustomerRobotWxLabel.class);
|
||||
if (StringUtils.isNotBlank(qo.getStartTime()) && StringUtils.isNotBlank(qo.getEndTime())) {
|
||||
wrapperX.between(CustomerRobotWxLabel::getCreateTime, qo.getStartTime(), qo.getEndTime());
|
||||
}
|
||||
wrapperX.eqIfPresent(CustomerRobotWxLabel::getUserId, qo.getUserId());
|
||||
wrapperX.likeIfPresent(CustomerRobotWxLabel::getLabelName, qo.getLabelName());
|
||||
wrapperX.likeIfPresent(CustomerRobotWxLabel::getWechatId, qo.getWxId()).orderByDesc(CustomerRobotWxLabel::getId);
|
||||
this.selectPage(page, wrapperX);
|
||||
IPage<CustomerWxLabelVO> voPage = page.convert(CustomerRobotWxLabelConverter.INSTANCE::entityToVo);
|
||||
return new PageResult<>(voPage.getRecords(), voPage.getTotal());
|
||||
}
|
||||
|
||||
default Long selectCountByWechatId(String wxId) {
|
||||
LambdaUpdateWrapper<CustomerRobotWxLabel> wrapper = WrappersX.lambdaUpdate(CustomerRobotWxLabel.class);
|
||||
wrapper.eq(CustomerRobotWxLabel::getWechatId, wxId);
|
||||
return this.selectCount(wrapper);
|
||||
}
|
||||
|
||||
default Long selectCountByLabelNameAndUserId(String labelName, Long userId) {
|
||||
LambdaUpdateWrapper<CustomerRobotWxLabel> wrapper = WrappersX.lambdaUpdate(CustomerRobotWxLabel.class);
|
||||
wrapper.eq(CustomerRobotWxLabel::getLabelName, labelName).eq(CustomerRobotWxLabel::getUserId, userId);
|
||||
return this.selectCount(wrapper);
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.baiye.modules.customer.mapper;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baiye.constant.DefaultNumberConstants;
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.conditions.query.LambdaQueryWrapperX;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.customer.converter.CustomerUserConverter;
|
||||
import com.baiye.modules.customer.entity.CustomerUserInfo;
|
||||
import com.baiye.modules.scrm.converter.AddFriendTaskConverter;
|
||||
import com.baiye.modules.scrm.entity.AddFriendTask;
|
||||
import com.baiye.modules.scrm.qo.CustomerUserQo;
|
||||
import com.baiye.modules.scrm.vo.AddFriendTaskVO;
|
||||
import com.baiye.modules.scrm.vo.CustomerUserInfoVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date 2024-5-31
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerUserInfoMapper extends ExtendMapper<CustomerUserInfo> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询账号
|
||||
*
|
||||
* @param account
|
||||
* @return
|
||||
*/
|
||||
default Long queryCountByAccount(String account) {
|
||||
return this.selectCount(WrappersX.lambdaQueryX(CustomerUserInfo.class).eq(CustomerUserInfo::getAccount, account));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
default PageResult<CustomerUserInfoVO> queryPage(PageParam pageParam, CustomerUserQo qo) {
|
||||
IPage<CustomerUserInfo> page = this.prodPage(pageParam);
|
||||
LambdaQueryWrapperX<CustomerUserInfo> wrapperX = WrappersX.lambdaQueryX(CustomerUserInfo.class);
|
||||
if (StringUtils.isNotBlank(qo.getStartTime()) && StringUtils.isNotBlank(qo.getEndTime())) {
|
||||
wrapperX.between(CustomerUserInfo::getCreateTime, qo.getStartTime(), qo.getEndTime());
|
||||
}
|
||||
wrapperX.eqIfPresent(CustomerUserInfo::getUserId, qo.getUserId());
|
||||
wrapperX.likeIfPresent(CustomerUserInfo::getAccount, qo.getAccount()).orderByDesc(CustomerUserInfo::getId);
|
||||
this.selectPage(page, wrapperX);
|
||||
IPage<CustomerUserInfoVO> voPage = page.convert(CustomerUserConverter.INSTANCE::entityToVo);
|
||||
return new PageResult<>(voPage.getRecords(), voPage.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 账号查询集合
|
||||
*
|
||||
* @param account
|
||||
* @return
|
||||
*/
|
||||
default CustomerUserInfo queryByAccount(String account) {
|
||||
List<CustomerUserInfo> customerUserInfos =
|
||||
this.selectList(WrappersX.lambdaQueryX(CustomerUserInfo.class).eq(CustomerUserInfo::getAccount, account).orderByAsc(CustomerUserInfo::getId));
|
||||
|
||||
if (CollUtil.isNotEmpty(customerUserInfos)) {
|
||||
return customerUserInfos.get(DefaultNumberConstants.ZERO_NUMBER);
|
||||
}
|
||||
return new CustomerUserInfo();
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.baiye.modules.customer.mapper;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.conditions.query.LambdaQueryWrapperX;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.customer.entity.CustomerVisibleRange;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/8
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerVisibleRangeMapper extends ExtendMapper<CustomerVisibleRange> {
|
||||
|
||||
/**
|
||||
* 查询已存在数据
|
||||
*
|
||||
* @param customerId
|
||||
* @param wechatId
|
||||
* @return
|
||||
*/
|
||||
default List<CustomerVisibleRange> listByAccountAndWeChatId(Long customerId, String wechatId) {
|
||||
|
||||
LambdaQueryWrapperX<CustomerVisibleRange> wrapperX = WrappersX.lambdaQueryX
|
||||
(CustomerVisibleRange.class).eq(CustomerVisibleRange::getCustomerId, customerId).eq(CustomerVisibleRange::getWechatId, wechatId);
|
||||
return selectList(wrapperX);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param customerId
|
||||
* @param removeList
|
||||
* @return
|
||||
*/
|
||||
default Boolean removeByCustomerAndFriendWxId(Long customerId, List<String> removeList){
|
||||
LambdaUpdateWrapper<CustomerVisibleRange> wrapperX = WrappersX.lambdaUpdate
|
||||
(CustomerVisibleRange.class).eq(CustomerVisibleRange::getCustomerId, customerId).in(CustomerVisibleRange::getFriendWxId, removeList);
|
||||
return SqlHelper.retBool(delete(wrapperX));
|
||||
}
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.baiye.modules.customer.service;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.service.ExtendService;
|
||||
import com.baiye.modules.customer.entity.CustomerJoinRobot;
|
||||
import com.baiye.modules.scrm.entity.WeChatAccount;
|
||||
import com.baiye.modules.scrm.vo.WeChatAccountVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/8
|
||||
*/
|
||||
public interface CustomerJoinRobotService extends ExtendService<CustomerJoinRobot> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
* @param id
|
||||
* @param account
|
||||
* @param values
|
||||
* @return
|
||||
*/
|
||||
Boolean saveCustomerJoinRobot(Long id, String account, List<WeChatAccount> values);
|
||||
|
||||
/**
|
||||
* 根据客服ID删除次级客服
|
||||
*
|
||||
* @param customerId
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteRobotInfoByCustomerId(Long customerId, List<Long> list);
|
||||
|
||||
/**
|
||||
* 根据客服ID查询次级账号
|
||||
* @param customerId
|
||||
* @return
|
||||
*/
|
||||
List<WeChatAccountVO> queryWeAccountByCustomer(Long customerId);
|
||||
|
||||
/**
|
||||
* 查询包含多少账号
|
||||
* @param customerId
|
||||
* @return
|
||||
*/
|
||||
Long getCountByCustomerId(Long customerId);
|
||||
|
||||
/**
|
||||
* 查询客服连接账号
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<CustomerJoinRobot> queryCustomerByCustomerId(Long id);
|
||||
|
||||
/**
|
||||
* 取消次级账号
|
||||
* @param id
|
||||
* @param robotIds
|
||||
* @return
|
||||
*/
|
||||
Boolean cancelCustomerIdByIdsIn(Long id, List<Long> robotIds);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param customerId
|
||||
* @param list
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByCustomerIdAndRobotId(Long customerId, List<Long> list, Integer number);
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.baiye.modules.customer.service;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.service.ExtendService;
|
||||
import com.baiye.modules.customer.entity.CustomerRobotWxLabel;
|
||||
import com.baiye.modules.scrm.dto.CustomerWxLabelDTO;
|
||||
import com.baiye.modules.scrm.qo.AccountQo;
|
||||
import com.baiye.modules.scrm.qo.RobotWxLabelQO;
|
||||
import com.baiye.modules.scrm.vo.CustomerWxLabelVO;
|
||||
import com.baiye.modules.scrm.vo.WeChatAccountVO;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/26
|
||||
*/
|
||||
public interface CustomerRobotWxLabelService extends ExtendService<CustomerRobotWxLabel> {
|
||||
|
||||
/**
|
||||
* 分页查询账号
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
PageResult<WeChatAccountVO> queryAccountPage(PageParam pageParam, AccountQo qo);
|
||||
|
||||
/**
|
||||
* 分页查询标签
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
PageResult<CustomerWxLabelVO> queryPage(PageParam pageParam, RobotWxLabelQO qo);
|
||||
|
||||
/**
|
||||
* 创建标签
|
||||
*
|
||||
* @param labelDTO
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
Boolean add(CustomerWxLabelDTO labelDTO, Long userId);
|
||||
|
||||
|
||||
|
||||
Boolean del(Long id);
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package com.baiye.modules.customer.service;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.service.ExtendService;
|
||||
import com.baiye.modules.customer.entity.CustomerUserInfo;
|
||||
import com.baiye.modules.scrm.dto.CustomerAddRobotDTO;
|
||||
import com.baiye.modules.scrm.dto.CustomerUserInfoDTO;
|
||||
import com.baiye.modules.scrm.qo.CustomerUserQo;
|
||||
import com.baiye.modules.scrm.vo.CustomerUserInfoVO;
|
||||
import com.baiye.modules.scrm.vo.WeChatAccountVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/5
|
||||
*/
|
||||
public interface CustomerUserService extends ExtendService<CustomerUserInfo> {
|
||||
|
||||
/**
|
||||
* 添加客服信息
|
||||
*
|
||||
* @param userInfoDTO
|
||||
* @param currentUserId
|
||||
* @return
|
||||
*/
|
||||
Boolean saveCustomerInfo(CustomerUserInfoDTO userInfoDTO, Long currentUserId);
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
PageResult<CustomerUserInfoVO> queryPage(PageParam pageParam, CustomerUserQo qo);
|
||||
|
||||
/**
|
||||
* 主次详情
|
||||
*
|
||||
* @param customerId
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> listMasterDetailByCustomerId(Long customerId);
|
||||
|
||||
|
||||
/**
|
||||
* 添加主账号
|
||||
*
|
||||
* @param addRobot
|
||||
* @return
|
||||
*/
|
||||
Boolean addMasterRobots(CustomerAddRobotDTO addRobot);
|
||||
|
||||
/**
|
||||
* 批量删除机器人
|
||||
*
|
||||
* @param addRobot
|
||||
* @return
|
||||
*/
|
||||
Boolean batchRemoveMasterByRobots(CustomerAddRobotDTO addRobot);
|
||||
|
||||
/**
|
||||
* 删除客服账号
|
||||
*
|
||||
* @param customerId
|
||||
* @return
|
||||
*/
|
||||
Boolean del(Long customerId);
|
||||
|
||||
/**
|
||||
* 获取主账号
|
||||
*
|
||||
* @param customerId
|
||||
* @return
|
||||
*/
|
||||
List<WeChatAccountVO> listRobotByCustomerId(Long customerId);
|
||||
|
||||
/**
|
||||
* 获取次级账号
|
||||
* @param customerId
|
||||
* @return
|
||||
*/
|
||||
List<WeChatAccountVO> acquisitionSecondary(Long customerId);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.baiye.modules.customer.service;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.service.ExtendService;
|
||||
import com.baiye.modules.customer.entity.CustomerVisibleRange;
|
||||
import com.baiye.modules.scrm.dto.CustomerVisibleRangeDTO;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/18
|
||||
*/
|
||||
public interface CustomerVisibleRangeService extends ExtendService<CustomerVisibleRange> {
|
||||
/**
|
||||
* 保存客服可见范围
|
||||
*
|
||||
* @param customerVisibleRangeVO
|
||||
* @return
|
||||
*/
|
||||
Boolean createVisibleRange(CustomerVisibleRangeDTO customerVisibleRangeVO );
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.baiye.modules.customer.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baiye.constant.DefaultNumberConstants;
|
||||
import com.baiye.extend.mybatis.plus.service.impl.ExtendServiceImpl;
|
||||
import com.baiye.modules.customer.entity.CustomerJoinRobot;
|
||||
import com.baiye.modules.customer.service.CustomerJoinRobotService;
|
||||
import com.baiye.modules.customer.mapper.CustomerJoinRobotMapper;
|
||||
import com.baiye.modules.scrm.entity.WeChatAccount;
|
||||
import com.baiye.modules.scrm.service.WechatAccountService;
|
||||
import com.baiye.modules.scrm.vo.WeChatAccountVO;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/8
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CustomerJoinRobotServiceImpl extends
|
||||
ExtendServiceImpl<CustomerJoinRobotMapper, CustomerJoinRobot> implements CustomerJoinRobotService {
|
||||
|
||||
|
||||
private final WechatAccountService wechatAccountService;
|
||||
|
||||
@Override
|
||||
public Boolean saveCustomerJoinRobot(Long customerId, String account, List<WeChatAccount> values) {
|
||||
List<CustomerJoinRobot> listByCustomerId = baseMapper.selectListByCustomerId(customerId, DefaultNumberConstants.ONE_NUMBER);
|
||||
// 同步群成员
|
||||
Map<Long, CustomerJoinRobot> robotMap =
|
||||
listByCustomerId.stream().distinct().collect(Collectors.toMap(CustomerJoinRobot::getRobotId, robot -> robot));
|
||||
for (WeChatAccount chatAccount : values) {
|
||||
CustomerJoinRobot joinRobot = new CustomerJoinRobot();
|
||||
CustomerJoinRobot customerJoinRobot = robotMap.get(chatAccount.getId());
|
||||
joinRobot.setCustomerId(customerId);
|
||||
joinRobot.setCustomerAccount(account);
|
||||
joinRobot.setRobotId(chatAccount.getId());
|
||||
joinRobot.setRobotWxId(chatAccount.getWxId());
|
||||
joinRobot.setDelFlag(DefaultNumberConstants.ONE_NUMBER);
|
||||
if (ObjectUtil.isNotNull(customerJoinRobot)) {
|
||||
joinRobot.setId(customerJoinRobot.getId());
|
||||
baseMapper.updateById(joinRobot);
|
||||
}
|
||||
if (ObjectUtil.isNull(customerJoinRobot)
|
||||
|| ObjectUtil.isNull(customerJoinRobot.getId())) {
|
||||
baseMapper.insert(joinRobot);
|
||||
}
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteRobotInfoByCustomerId(Long customerId, List<Long> list) {
|
||||
return SqlHelper.retBool(baseMapper.deleteByCustomerId(customerId, list));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WeChatAccountVO> queryWeAccountByCustomer(Long customerId) {
|
||||
List<CustomerJoinRobot> customerJoinRobots = baseMapper.selectListByCustomerId(customerId, DefaultNumberConstants.ONE_NUMBER);
|
||||
List<Long> accountIdList = customerJoinRobots.stream().map(CustomerJoinRobot::getRobotId).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(accountIdList)) {
|
||||
return wechatAccountService.findByBatchId(accountIdList);
|
||||
}
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getCountByCustomerId(Long customerId) {
|
||||
return baseMapper.selectCountByCustomerId(customerId, DefaultNumberConstants.ONE_NUMBER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomerJoinRobot> queryCustomerByCustomerId(Long id) {
|
||||
return baseMapper.selectListByCustomerId(id, DefaultNumberConstants.ONE_NUMBER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean cancelCustomerIdByIdsIn(Long id, List<Long> robotIds) {
|
||||
return SqlHelper.retBool(baseMapper.cancelCustomerIdByIdsIn(id, robotIds, DefaultNumberConstants.ZERO_NUMBER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByCustomerIdAndRobotId(Long customerId, List<Long> list, Integer number) {
|
||||
return SqlHelper.retBool(baseMapper.updateByCustomerIdAndRobotId(customerId, list, number));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.baiye.modules.customer.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baiye.constant.DefaultNumberConstants;
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.exception.BadRequestException;
|
||||
import com.baiye.extend.mybatis.plus.service.impl.ExtendServiceImpl;
|
||||
import com.baiye.modules.customer.entity.CustomerRobotWxLabel;
|
||||
import com.baiye.modules.customer.mapper.CustomerRobotWxLabelMapper;
|
||||
import com.baiye.modules.customer.service.CustomerRobotWxLabelService;
|
||||
import com.baiye.modules.scrm.dto.CustomerWxLabelDTO;
|
||||
import com.baiye.modules.scrm.qo.AccountQo;
|
||||
import com.baiye.modules.scrm.qo.RobotWxLabelQO;
|
||||
import com.baiye.modules.scrm.service.WeChatService;
|
||||
import com.baiye.modules.scrm.vo.CustomerWxLabelVO;
|
||||
import com.baiye.modules.scrm.vo.WeChatAccountVO;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/8
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CustomerRobotWxLabelServiceImpl extends
|
||||
ExtendServiceImpl<CustomerRobotWxLabelMapper, CustomerRobotWxLabel> implements CustomerRobotWxLabelService {
|
||||
|
||||
private final WeChatService wechatService;
|
||||
|
||||
@Override
|
||||
public PageResult<WeChatAccountVO> queryAccountPage(PageParam pageParam, AccountQo qo) {
|
||||
return baseMapper.selectAccountPage(new Page<>(pageParam.getPage(), pageParam.getSize()), qo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CustomerWxLabelVO> queryPage(PageParam pageParam, RobotWxLabelQO qo) {
|
||||
return baseMapper.queryPage(pageParam, qo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean add(CustomerWxLabelDTO labelDTO, Long userId) {
|
||||
Long count = baseMapper.selectCountByLabelNameAndUserId(labelDTO.getLabelName(), userId);
|
||||
if (count > DefaultNumberConstants.ZERO_NUMBER) {
|
||||
throw new BadRequestException("该标签已存在 请勿重复填写");
|
||||
}
|
||||
Integer weChatLabel = wechatService.addWeChatLabel(labelDTO.getWechatId(), labelDTO.getLabelName());
|
||||
if (weChatLabel > DefaultNumberConstants.ZERO_NUMBER) {
|
||||
CustomerRobotWxLabel wxLabel = new CustomerRobotWxLabel();
|
||||
BeanUtil.copyProperties(labelDTO, wxLabel);
|
||||
wxLabel.setUserId(userId);
|
||||
return save(wxLabel);
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean del(Long id) {
|
||||
CustomerRobotWxLabel customerRobotWxLabel = baseMapper.selectById(id);
|
||||
if (ObjectUtil.isNotNull(customerRobotWxLabel)) {
|
||||
wechatService.deleteWeChatLabel(customerRobotWxLabel.getWechatId(), Lists.newArrayList(customerRobotWxLabel.getLabelId()));
|
||||
return removeById(id);
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,228 @@
|
||||
package com.baiye.modules.customer.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baiye.constant.CacheConstant;
|
||||
import com.baiye.constant.DefaultNumberConstants;
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.exception.BadRequestException;
|
||||
import com.baiye.extend.mybatis.plus.service.impl.ExtendServiceImpl;
|
||||
import com.baiye.modules.customer.entity.CustomerJoinRobot;
|
||||
import com.baiye.modules.customer.entity.CustomerUserInfo;
|
||||
import com.baiye.modules.customer.feign.CustomerVisibleFeign;
|
||||
import com.baiye.modules.customer.mapper.CustomerUserInfoMapper;
|
||||
import com.baiye.modules.customer.service.CustomerJoinRobotService;
|
||||
import com.baiye.modules.customer.service.CustomerUserService;
|
||||
import com.baiye.modules.scrm.dto.CustomerAddRobotDTO;
|
||||
import com.baiye.modules.scrm.dto.CustomerUserInfoDTO;
|
||||
import com.baiye.modules.scrm.entity.WeChatAccount;
|
||||
import com.baiye.modules.scrm.qo.CustomerUserQo;
|
||||
import com.baiye.modules.scrm.service.WechatAccountService;
|
||||
import com.baiye.modules.scrm.vo.CustomerUserInfoVO;
|
||||
import com.baiye.modules.scrm.vo.WeChatAccountVO;
|
||||
import com.baiye.security.util.SecurityUtils;
|
||||
import com.baiye.util.RedisUtils;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/5
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CustomerUserServiceImpl extends ExtendServiceImpl<CustomerUserInfoMapper, CustomerUserInfo> implements CustomerUserService {
|
||||
|
||||
private final CustomerJoinRobotService customerJoinRobotService;
|
||||
|
||||
private final CustomerUserInfoMapper customerUserInfoMapper;
|
||||
|
||||
private final WechatAccountService wechatAccountService;
|
||||
|
||||
private final CustomerVisibleFeign customerVisibleFeign;
|
||||
|
||||
private final RedisUtils redisUtils;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean saveCustomerInfo(CustomerUserInfoDTO userInfoDTO, Long currentUserId) {
|
||||
userInfoDTO.setUserId(currentUserId);
|
||||
String dtoAccount = userInfoDTO.getAccount();
|
||||
List<Long> robotIds = userInfoDTO.getRobotIds();
|
||||
CustomerUserInfo userInfo = customerUserInfoMapper.queryByAccount(userInfoDTO.getAccount().trim());
|
||||
if (ObjectUtil.isNotNull(userInfo) && ObjectUtil.isNotNull(userInfo.getId()) && !userInfo.getId().equals(userInfoDTO.getId())) {
|
||||
throw new BadRequestException("该账号已被使用!");
|
||||
}
|
||||
if (CollUtil.isNotEmpty(robotIds)) {
|
||||
// 添加次级账号
|
||||
List<WeChatAccount> weChatAccounts = wechatAccountService.listByIds(robotIds);
|
||||
// 次账号添加
|
||||
if (ObjectUtil.isNotNull(userInfoDTO.getId())) {
|
||||
Set<Long> saveAccountId;
|
||||
CustomerUserInfo customerUserInfo = baseMapper.selectById(userInfoDTO.getId());
|
||||
if (ObjectUtil.isNotNull(customerUserInfo) && ObjectUtil.isNotNull(customerUserInfo.getId())) {
|
||||
// 是主客服的设备
|
||||
Set<Long> customerSet = weChatAccounts.stream().filter(k -> userInfo.getId().equals(k.getCustomerId())).map(WeChatAccount::getId).collect(Collectors.toSet());
|
||||
// 去除主客服设备
|
||||
saveAccountId = Sets.newHashSet(Sets.difference(Sets.newHashSet(robotIds), customerSet));
|
||||
Set<Long> customerJoinRobots =
|
||||
customerJoinRobotService.queryCustomerByCustomerId(customerUserInfo.getId()).stream().map(CustomerJoinRobot::getRobotId).collect(Collectors.toSet());
|
||||
// 去除已经添加的设备
|
||||
List<Long> saveList = Lists.newArrayList(Sets.difference(saveAccountId, customerJoinRobots));
|
||||
// 取消的客服设备
|
||||
List<Long> cancelList = Lists.newArrayList(Sets.difference(customerJoinRobots, saveAccountId));
|
||||
// 给设备分配次客服
|
||||
if (CollUtil.isNotEmpty(saveList)) {
|
||||
List<WeChatAccount> accountList = weChatAccounts.stream().filter(k -> saveList.contains(k.getId())).collect(Collectors.toList());
|
||||
// 同步数据
|
||||
customerJoinRobotService.saveCustomerJoinRobot(customerUserInfo.getId(), customerUserInfo.getAccount(), accountList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(cancelList)) {
|
||||
// 取消数据
|
||||
customerJoinRobotService.cancelCustomerIdByIdsIn(customerUserInfo.getId(), cancelList);
|
||||
}
|
||||
userInfoDTO.setRobotSubNum(Integer.valueOf(customerJoinRobotService.getCountByCustomerId(userInfoDTO.getId()).toString()));
|
||||
}
|
||||
List<String> stringList = weChatAccounts.stream().map(WeChatAccount::getWxId).collect(Collectors.toList());
|
||||
customerVisibleFeign.newDeviceConversation(dtoAccount, stringList);
|
||||
}
|
||||
}
|
||||
String cacheKey = CacheConstant.APP_KEY_CUSTOMER.concat(CacheConstant.CUSTOMER_ACCOUNT).concat(userInfoDTO.getAccount());
|
||||
redisUtils.del(cacheKey);
|
||||
|
||||
// 同步新增客服
|
||||
customerVisibleFeign.addCustomer(dtoAccount);
|
||||
// 创建新设备
|
||||
customerVisibleFeign.createNewDevice(userInfoDTO.getAccount());
|
||||
if (ObjectUtil.isNotNull(userInfo) && ObjectUtil.isNotNull(userInfo.getId())) {
|
||||
BeanUtil.copyProperties(userInfoDTO, userInfo);
|
||||
return SqlHelper.retBool(customerUserInfoMapper.updateById(userInfo));
|
||||
}
|
||||
CustomerUserInfo info = new CustomerUserInfo();
|
||||
BeanUtil.copyProperties(userInfoDTO, info);
|
||||
info.setIsEnable(Boolean.TRUE);
|
||||
return SqlHelper.retBool(customerUserInfoMapper.insert(info));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageResult<CustomerUserInfoVO> queryPage(PageParam pageParam, CustomerUserQo qo) {
|
||||
qo.setUserId(SecurityUtils.getCurrentUserId());
|
||||
PageResult<CustomerUserInfoVO> pageResult = baseMapper.queryPage(pageParam, qo);
|
||||
pageResult.getRecords().forEach(result -> {
|
||||
List<WeChatAccountVO> byCustomerId = wechatAccountService.findByCustomerId(result.getId());
|
||||
List<CustomerJoinRobot> joinRobots = customerJoinRobotService.queryCustomerByCustomerId(result.getId());
|
||||
List<Long> robotCustomerList = joinRobots.stream().map(CustomerJoinRobot::getRobotId).collect(Collectors.toList());
|
||||
robotCustomerList.addAll(byCustomerId.stream().map(WeChatAccountVO::getId).collect(Collectors.toList()));
|
||||
result.setRobotNum(Integer.valueOf(wechatAccountService.getCountByCustomerId(result.getId()).toString()));
|
||||
result.setRobotSubNum(Integer.valueOf(customerJoinRobotService.getCountByCustomerId(result.getId()).toString()));
|
||||
result.setRobotIds(robotCustomerList);
|
||||
});
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean addMasterRobots(CustomerAddRobotDTO addRobot) {
|
||||
CustomerUserInfo userInfo = baseMapper.selectById(addRobot.getCustomerId());
|
||||
if (ObjectUtil.isNotNull(userInfo)) {
|
||||
// 设置设备主客服
|
||||
Map<Boolean, List<CustomerAddRobotDTO.ChangePrimaryDTO>> listMap = addRobot.getData().stream().collect(
|
||||
Collectors.groupingBy(CustomerAddRobotDTO.ChangePrimaryDTO::getIsPrimary));
|
||||
|
||||
for (Map.Entry<Boolean, List<CustomerAddRobotDTO.ChangePrimaryDTO>> booleanListEntry : listMap.entrySet()) {
|
||||
List<Long> list = booleanListEntry.getValue().stream().map(CustomerAddRobotDTO.ChangePrimaryDTO::getId).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
// 主改次
|
||||
if (Boolean.FALSE.equals(booleanListEntry.getKey())) {
|
||||
// 修改主动
|
||||
wechatAccountService.cancelCustomerIdByRobotIds(addRobot.getCustomerId(), list);
|
||||
List<WeChatAccount> weChatAccounts = wechatAccountService.listByIds(list);
|
||||
customerJoinRobotService.saveCustomerJoinRobot(addRobot.getCustomerId(), userInfo.getAccount(), weChatAccounts);
|
||||
}
|
||||
if (Boolean.TRUE.equals(booleanListEntry.getKey())) {
|
||||
// 取消所有次级
|
||||
wechatAccountService.updateByCustomerIdAndIds(userInfo.getId(), list);
|
||||
customerJoinRobotService.cancelCustomerIdByIdsIn(userInfo.getId(), list);
|
||||
}
|
||||
}
|
||||
}
|
||||
userInfo.setRobotNum(Integer.valueOf(wechatAccountService.getCountByCustomerId(userInfo.getId()).toString()));
|
||||
userInfo.setRobotSubNum(Integer.valueOf(customerJoinRobotService.getCountByCustomerId(userInfo.getId()).toString()));
|
||||
return this.updateById(userInfo);
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean batchRemoveMasterByRobots(CustomerAddRobotDTO addRobot) {
|
||||
Long customerId = addRobot.getCustomerId();
|
||||
Integer removeEnable = addRobot.getRemoveEnable();
|
||||
List<Long> robotIds = addRobot.getRobotIds();
|
||||
CustomerUserInfo customerUserInfo = this.baseMapper.selectById(customerId);
|
||||
if (ObjectUtil.isNotNull(customerUserInfo) && ObjectUtil.isNotNull(customerUserInfo.getId())) {
|
||||
Boolean result = removeEnable == DefaultNumberConstants.TWO_NUMBER
|
||||
? customerJoinRobotService.cancelCustomerIdByIdsIn(customerId, robotIds) :
|
||||
wechatAccountService.cancelCustomerIdByRobotIds(customerId, robotIds);
|
||||
log.info("================ the cancel result {} ================", result);
|
||||
customerUserInfo.setRobotNum(Integer.valueOf(wechatAccountService.getCountByCustomerId(customerId).toString()));
|
||||
customerUserInfo.setRobotSubNum(Integer.valueOf(customerJoinRobotService.getCountByCustomerId(customerId).toString()));
|
||||
this.baseMapper.updateById(customerUserInfo);
|
||||
// 设备更新同步
|
||||
customerVisibleFeign.createNewDevice(customerUserInfo.getAccount());
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean del(Long customerId) {
|
||||
CustomerUserInfo customerUserInfo = baseMapper.selectById(customerId);
|
||||
if (ObjectUtil.isNotNull(customerUserInfo) && ObjectUtil.isNotNull(customerUserInfo.getId())) {
|
||||
List<WeChatAccountVO> robotInfos = wechatAccountService.findByCustomerId(customerId);
|
||||
if (CollUtil.isNotEmpty(robotInfos)) {
|
||||
throw new BadRequestException("当前客户下有存在机器人配置,请先删除");
|
||||
}
|
||||
// 极联删除次级账号客服
|
||||
customerJoinRobotService.deleteRobotInfoByCustomerId(customerId, Lists.newArrayList());
|
||||
// 设备更新同步
|
||||
customerVisibleFeign.createNewDevice(customerUserInfo.getAccount());
|
||||
return this.removeById(customerId);
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<WeChatAccountVO> listRobotByCustomerId(Long customerId) {
|
||||
return wechatAccountService.findByCustomerId(customerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WeChatAccountVO> acquisitionSecondary(Long customerId) {
|
||||
return customerJoinRobotService.queryWeAccountByCustomer(customerId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listMasterDetailByCustomerId(Long customerId) {
|
||||
List<WeChatAccountVO> masterCustomerList = wechatAccountService.findByCustomerId(customerId);
|
||||
List<WeChatAccountVO> subCustomerList = customerJoinRobotService.queryWeAccountByCustomer(customerId);
|
||||
return ImmutableMap.of("masterCustomerList", masterCustomerList, "subCustomerList", subCustomerList);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.baiye.modules.customer.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baiye.constant.DefaultNumberConstants;
|
||||
import com.baiye.extend.mybatis.plus.service.impl.ExtendServiceImpl;
|
||||
import com.baiye.modules.customer.entity.CustomerUserInfo;
|
||||
import com.baiye.modules.customer.entity.CustomerVisibleRange;
|
||||
import com.baiye.modules.customer.feign.CustomerVisibleFeign;
|
||||
import com.baiye.modules.customer.mapper.CustomerVisibleRangeMapper;
|
||||
import com.baiye.modules.customer.service.CustomerUserService;
|
||||
import com.baiye.modules.customer.service.CustomerVisibleRangeService;
|
||||
import com.baiye.modules.scrm.dto.CustomerVisibleRangeDTO;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/18
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CustomerVisibleRangeServiceImpl extends
|
||||
ExtendServiceImpl<CustomerVisibleRangeMapper, CustomerVisibleRange> implements CustomerVisibleRangeService {
|
||||
|
||||
|
||||
private final CustomerUserService customerUserService;
|
||||
|
||||
private final CustomerVisibleFeign customerVisibleFeign;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean createVisibleRange(CustomerVisibleRangeDTO customerVisibleRangeVO) {
|
||||
|
||||
List<CustomerVisibleRange> arrayList = Lists.newArrayList();
|
||||
CustomerUserInfo userInfo = customerUserService.getById(customerVisibleRangeVO.getCustomerId());
|
||||
|
||||
if (ObjectUtil.isNotNull(userInfo) && ObjectUtil.isNotNull(userInfo.getId())) {
|
||||
List<CustomerVisibleRangeDTO.SelectRobotWxInfoVo> wxInfoVos = customerVisibleRangeVO.getWxInfoVos();
|
||||
|
||||
List<String> stringList = wxInfoVos.stream().map(CustomerVisibleRangeDTO.SelectRobotWxInfoVo::getWxId).distinct().collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(stringList)) {
|
||||
stringList.add(StringPool.ASTERISK);
|
||||
}
|
||||
// 已存在数据
|
||||
List<CustomerVisibleRange> customerVisibleRanges = baseMapper.listByAccountAndWeChatId(customerVisibleRangeVO.getCustomerId(), customerVisibleRangeVO.getWechatId());
|
||||
Set<String> presenceCustomer = customerVisibleRanges.stream().map(CustomerVisibleRange::getFriendWxId).collect(Collectors.toSet());
|
||||
|
||||
Map<String, CustomerVisibleRangeDTO.SelectRobotWxInfoVo> infoVoMap = wxInfoVos.stream().collect(Collectors.toMap(CustomerVisibleRangeDTO.SelectRobotWxInfoVo::getWxId, wxInfoVo -> wxInfoVo));
|
||||
|
||||
Set<String> saveWxId = infoVoMap.keySet();
|
||||
List<String> removeList = Lists.newArrayList(Sets.difference(presenceCustomer, saveWxId));
|
||||
|
||||
// 删除已经存在数据
|
||||
infoVoMap.keySet().removeIf(presenceCustomer::contains);
|
||||
if (CollUtil.isNotEmpty(infoVoMap.values())) {
|
||||
CustomerVisibleRange range;
|
||||
// 保存数据
|
||||
for (Map.Entry<String, CustomerVisibleRangeDTO.SelectRobotWxInfoVo> voEntry : infoVoMap.entrySet()) {
|
||||
range = new CustomerVisibleRange();
|
||||
CustomerVisibleRangeDTO.SelectRobotWxInfoVo wxInfoVo = voEntry.getValue();
|
||||
range.setUserId(userInfo.getId());
|
||||
range.setAccount(customerVisibleRangeVO.getAccount());
|
||||
range.setWechatId(customerVisibleRangeVO.getWechatId());
|
||||
range.setFriendWxId(wxInfoVo.getWxId());
|
||||
range.setFriendWxImg(wxInfoVo.getWxImg());
|
||||
range.setFriendWxNick(wxInfoVo.getWxNick());
|
||||
range.setFriendAllEnable(customerVisibleRangeVO.getFriendAllEnable());
|
||||
range.setGroupAllEnable(customerVisibleRangeVO.getGroupAllEnable());
|
||||
arrayList.add(range);
|
||||
}
|
||||
baseMapper.insertBatchSomeColumn(arrayList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(removeList)) {
|
||||
this.baseMapper.removeByCustomerAndFriendWxId(customerVisibleRangeVO.getCustomerId(), removeList);
|
||||
}
|
||||
|
||||
customerVisibleFeign.clearCustomerVisibleRanges(customerVisibleRangeVO.getAccount(), customerVisibleRangeVO.getWechatId(), removeList);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.baiye.modules.scrm.controller;
|
||||
|
||||
import com.baiye.constant.DefaultNumberConstants;
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.modules.scrm.entity.CircleFriendTask;
|
||||
import com.baiye.modules.scrm.qo.CircleFriendQO;
|
||||
import com.baiye.modules.scrm.qo.ComparisonQO;
|
||||
import com.baiye.modules.scrm.service.CircleFriendTaskService;
|
||||
import com.baiye.modules.scrm.vo.CircleFriendTaskVO;
|
||||
import com.baiye.modules.scrm.vo.ComparisonTaskVO;
|
||||
import com.baiye.result.BaseResultCode;
|
||||
import com.baiye.result.R;
|
||||
import com.baiye.security.util.SecurityUtils;
|
||||
import com.baiye.validation.group.CreateGroup;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/15
|
||||
*/
|
||||
|
||||
@Tag(name = "朋友圈")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/circle/friend")
|
||||
@AllArgsConstructor
|
||||
public class CircleFriendTaskController {
|
||||
|
||||
|
||||
private final CircleFriendTaskService circleFriendTaskService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询记录")
|
||||
public R<PageResult<CircleFriendTaskVO>> robotGroupPage(@Validated PageParam pageParam, CircleFriendQO qo) {
|
||||
qo.setUserId(SecurityUtils.getCurrentUserId());
|
||||
return R.ok(circleFriendTaskService.queryPage(pageParam, qo));
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public R<Object> add(@Validated({CreateGroup.class}) @RequestBody CircleFriendTask entity) {
|
||||
circleFriendTaskService.create(entity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public R<Object> update(@Validated({UpdateGroup.class}) @RequestBody CircleFriendTask entity) {
|
||||
circleFriendTaskService.update(entity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "ID删除任务")
|
||||
public R<Void> deleteByUserId(@PathVariable("id") Long taskId) {
|
||||
return Boolean.TRUE.equals(circleFriendTaskService.del(taskId)) ? R.ok() : R.failed(BaseResultCode.UPDATE_DATABASE_ERROR, "删除失败");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.baiye.modules.scrm.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baiye.constant.DefaultNumberConstants;
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.modules.scrm.dto.CreateAddFriendTaskDTO;
|
||||
import com.baiye.modules.scrm.qo.ComparisonQO;
|
||||
import com.baiye.modules.scrm.qo.RobotGroupQo;
|
||||
import com.baiye.modules.scrm.service.ComparisonTaskService;
|
||||
import com.baiye.modules.scrm.vo.ComparisonTaskVO;
|
||||
import com.baiye.modules.scrm.vo.RobotGroupVO;
|
||||
import com.baiye.result.R;
|
||||
import com.baiye.security.util.SecurityUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/16
|
||||
*/
|
||||
@Tag(name = "对比任务")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/comparison/task")
|
||||
@AllArgsConstructor
|
||||
public class ComparisonTaskController {
|
||||
|
||||
private final ComparisonTaskService comparisonTaskService;
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询记录")
|
||||
public R<PageResult<ComparisonTaskVO>> robotGroupPage(@Validated PageParam pageParam, ComparisonQO qo) {
|
||||
qo.setUserId(SecurityUtils.getWhichUserId() ==
|
||||
DefaultNumberConstants.ONE_NUMBER ? SecurityUtils.getCurrentUserId() : SecurityUtils.getWhichUserId());
|
||||
return R.ok(comparisonTaskService.queryPage(pageParam, qo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/create/task")
|
||||
@Operation(summary = "创建任务")
|
||||
public R<String> createTestTask(MultipartFile file, String taskName,String remark) {
|
||||
return Boolean.TRUE.equals(comparisonTaskService.createTask(file, taskName, remark)) ? R.ok() : R.failed("创建任务失败");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/additional")
|
||||
@Operation(summary = "追加任务")
|
||||
public R<String> createTestTask(MultipartFile file, Long taskId,Boolean isComplete) {
|
||||
return Boolean.TRUE.equals(comparisonTaskService.additionalTask(file, taskId, isComplete)) ? R.ok() : R.failed("追加任务失败");
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/export")
|
||||
@Operation(summary = "导出数据")
|
||||
public void export(HttpServletResponse response, Long taskId) {
|
||||
comparisonTaskService.exportByTaskId(response, taskId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.baiye.modules.scrm.controller;
|
||||
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baiye.constant.DefaultNumberConstants;
|
||||
import com.baiye.result.R;
|
||||
import com.baiye.system.properties.MinioConfig;
|
||||
import com.baiye.system.util.MinioUtil;
|
||||
import io.minio.messages.Bucket;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/4
|
||||
*/
|
||||
@Tag(name = "文件相关接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/file")
|
||||
@RequiredArgsConstructor
|
||||
public class FileController {
|
||||
|
||||
|
||||
private final MinioUtil minioUtil;
|
||||
|
||||
private final MinioConfig prop;
|
||||
|
||||
@Operation(summary = "查看存储bucket是否存在")
|
||||
@GetMapping("/bucketExists")
|
||||
public R<Boolean> bucketExists(@RequestParam("bucketName") String bucketName) {
|
||||
return R.ok(minioUtil.bucketExists(bucketName));
|
||||
}
|
||||
|
||||
@Operation(summary = "创建存储bucket")
|
||||
@GetMapping("/makeBucket")
|
||||
public R<Boolean> makeBucket(String bucketName) {
|
||||
return R.ok(minioUtil.makeBucket(bucketName));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除存储bucket")
|
||||
@GetMapping("/removeBucket")
|
||||
public R<Boolean> removeBucket(String bucketName) {
|
||||
return R.ok(minioUtil.removeBucket(bucketName));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取全部bucket")
|
||||
@GetMapping("/getAllBuckets")
|
||||
public R<List<Bucket>> getAllBuckets() {
|
||||
return R.ok(minioUtil.getAllBuckets());
|
||||
}
|
||||
|
||||
@Operation(summary = "文件上传返回url")
|
||||
@PostMapping("/upload")
|
||||
public R<String> upload(@RequestParam("file") MultipartFile file) {
|
||||
String filename = minioUtil.upload(file);
|
||||
if (ObjectUtil.isNotNull(filename)) {
|
||||
return R.ok((prop.getEndpoint() + prop.getBucketName() +StrPool.SLASH + filename));
|
||||
}
|
||||
return R.failed("上传文件失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "图片/视频预览")
|
||||
@GetMapping("/preview")
|
||||
public R<String> preview(@RequestParam("fileName") String fileName) {
|
||||
return R.ok(minioUtil.preview(fileName));
|
||||
}
|
||||
|
||||
@Operation(summary = "文件下载")
|
||||
@GetMapping("/download")
|
||||
public R<Object> download(@RequestParam("fileName") String fileName, HttpServletResponse res) {
|
||||
minioUtil.download(fileName, res);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "删除文件")
|
||||
@PostMapping("/delete")
|
||||
public R<Object> remove(String url) {
|
||||
String objName = url.substring(url.lastIndexOf(prop.getBucketName().concat
|
||||
(StrPool.SLASH)) + prop.getBucketName().length() + DefaultNumberConstants.ONE_NUMBER);
|
||||
minioUtil.remove(objName);
|
||||
return R.ok(objName);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.baiye.modules.scrm.controller;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.modules.scrm.qo.RobotCustomerQo;
|
||||
import com.baiye.modules.scrm.service.RobotCustomerService;
|
||||
import com.baiye.modules.scrm.vo.RobotCustomerVO;
|
||||
import com.baiye.result.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/11
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@Tag(name = "获取好友记录")
|
||||
@RequestMapping("/robot/customer")
|
||||
public class RobotCustomerController {
|
||||
|
||||
private final RobotCustomerService robotCustomerService;
|
||||
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询记录")
|
||||
public R<PageResult<RobotCustomerVO>> getClueRecordPage(@Validated PageParam pageParam, RobotCustomerQo qo) {
|
||||
return R.ok(robotCustomerService.queryPage(pageParam, qo));
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.baiye.modules.scrm.controller;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.modules.scrm.entity.RobotGroup;
|
||||
import com.baiye.modules.scrm.qo.RobotGroupQo;
|
||||
import com.baiye.modules.scrm.service.RobotGroupService;
|
||||
import com.baiye.modules.scrm.vo.RobotGroupVO;
|
||||
import com.baiye.result.BaseResultCode;
|
||||
import com.baiye.result.R;
|
||||
import com.baiye.security.util.SecurityUtils;
|
||||
import com.baiye.validation.group.CreateGroup;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/14
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Tag(name = "分组管理")
|
||||
@RequestMapping("/robot/group")
|
||||
@RequiredArgsConstructor
|
||||
public class RobotGroupController {
|
||||
|
||||
private final RobotGroupService robotGroupService;
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询记录")
|
||||
public R<PageResult<RobotGroupVO>> robotGroupPage(@Validated PageParam pageParam, RobotGroupQo qo) {
|
||||
qo.setUserId(SecurityUtils.getCurrentUserId());
|
||||
return R.ok(robotGroupService.queryPage(pageParam, qo));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/add")
|
||||
public R<Object> add(@Validated({CreateGroup.class}) @RequestBody RobotGroup entity) {
|
||||
robotGroupService.create(entity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public R<Object> update(@Validated({ UpdateGroup.class }) @RequestBody RobotGroup entity) {
|
||||
robotGroupService.update(entity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "ID删除任务")
|
||||
public R<Void> deleteByUserId(@PathVariable("id") Long groupId) {
|
||||
return Boolean.TRUE.equals(robotGroupService.del(groupId)) ? R.ok() : R.failed(BaseResultCode.UPDATE_DATABASE_ERROR, "删除失败");
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "查询所有数据")
|
||||
public R<List<RobotGroupVO>> robotGroupList() {
|
||||
return R.ok(robotGroupService.queryByUserId(SecurityUtils.getCurrentUserId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.baiye.modules.scrm.controller;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.modules.scrm.dto.StaticResourceDTO;
|
||||
import com.baiye.modules.scrm.entity.StaticResource;
|
||||
import com.baiye.modules.scrm.qo.ResourceQo;
|
||||
import com.baiye.modules.scrm.service.StaticResourceService;
|
||||
import com.baiye.modules.scrm.vo.StaticResourceVO;
|
||||
import com.baiye.result.BaseResultCode;
|
||||
import com.baiye.result.R;
|
||||
import com.baiye.validation.group.CreateGroup;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date 2023-12-6
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Tag(name = "素材管理")
|
||||
@RequestMapping("/static/resource")
|
||||
@RequiredArgsConstructor
|
||||
public class StaticResourceController {
|
||||
|
||||
private final StaticResourceService staticResourceService;
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询")
|
||||
public R<PageResult<StaticResourceVO>> queryPage(@Validated PageParam pageParam, ResourceQo qo) {
|
||||
return R.ok(staticResourceService.queryPage(pageParam, qo));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/add")
|
||||
public R<Object> add(@Validated({CreateGroup.class}) @RequestBody StaticResource entity) {
|
||||
staticResourceService.create(entity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public R<Object> update(@Validated({ UpdateGroup.class }) @RequestBody StaticResourceDTO resourceDTO) {
|
||||
staticResourceService.update(resourceDTO);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "ID删除任务")
|
||||
public R<Void> deleteByUserId(@PathVariable("id") Long resourceId) {
|
||||
return Boolean.TRUE.equals(staticResourceService.del(resourceId)) ? R.ok() : R.failed(BaseResultCode.UPDATE_DATABASE_ERROR, "删除失败");
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.baiye.modules.scrm.controller;
|
||||
|
||||
import com.baiye.modules.scrm.dto.PacketDTO;
|
||||
import com.baiye.modules.scrm.service.WechatAccountService;
|
||||
import com.baiye.result.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/16
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/wechat/account")
|
||||
@RequiredArgsConstructor
|
||||
public class WeChatAccountController {
|
||||
|
||||
private final WechatAccountService wechatAccountService;
|
||||
|
||||
@PostMapping("/update/packet")
|
||||
@Operation(summary = "修改分组")
|
||||
public R<Boolean> updatePacketById(@RequestBody PacketDTO dto) {
|
||||
return R.ok(wechatAccountService.updatePacketById(dto));
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.baiye.modules.scrm.converter;
|
||||
|
||||
import com.baiye.modules.scrm.entity.AddFriend;
|
||||
import com.baiye.modules.scrm.entity.PayOrder;
|
||||
import com.baiye.modules.scrm.vo.AddFriendPageVO;
|
||||
import com.baiye.modules.scrm.vo.PayOrderVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/3/28
|
||||
*/
|
||||
@Mapper
|
||||
public interface AddFriendConverter {
|
||||
|
||||
AddFriendConverter INSTANCE = Mappers.getMapper(AddFriendConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转vo
|
||||
*
|
||||
* @param addFriend
|
||||
* @return
|
||||
*/
|
||||
AddFriendPageVO entityToVo(AddFriend addFriend);
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.baiye.modules.scrm.converter;
|
||||
|
||||
import com.baiye.modules.scrm.entity.CircleFriendTask;
|
||||
import com.baiye.modules.scrm.entity.ComparisonTask;
|
||||
import com.baiye.modules.scrm.vo.CircleFriendTaskVO;
|
||||
import com.baiye.modules.scrm.vo.ComparisonTaskVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/3/28
|
||||
*/
|
||||
@Mapper
|
||||
public interface CircleFriendTaskConverter {
|
||||
|
||||
CircleFriendTaskConverter INSTANCE = Mappers.getMapper(CircleFriendTaskConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转vo
|
||||
*
|
||||
* @param circleFriendTask
|
||||
* @return
|
||||
*/
|
||||
CircleFriendTaskVO entityToVo(CircleFriendTask circleFriendTask);
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.baiye.modules.scrm.converter;
|
||||
|
||||
import com.baiye.modules.scrm.entity.ComparisonTask;
|
||||
import com.baiye.modules.scrm.entity.PayOrder;
|
||||
import com.baiye.modules.scrm.vo.ComparisonTaskVO;
|
||||
import com.baiye.modules.scrm.vo.ComparisonVO;
|
||||
import com.baiye.modules.scrm.vo.PayOrderVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/3/28
|
||||
*/
|
||||
@Mapper
|
||||
public interface ComparisonConverter {
|
||||
|
||||
ComparisonConverter INSTANCE = Mappers.getMapper(ComparisonConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转vo
|
||||
*
|
||||
* @param comparisonTask
|
||||
* @return
|
||||
*/
|
||||
ComparisonTaskVO entityToVo(ComparisonTask comparisonTask);
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.baiye.modules.scrm.converter;
|
||||
|
||||
import com.baiye.modules.scrm.entity.PayOrder;
|
||||
import com.baiye.modules.scrm.entity.RobotCustomer;
|
||||
import com.baiye.modules.scrm.vo.PayOrderVO;
|
||||
import com.baiye.modules.scrm.vo.RobotCustomerVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/3/28
|
||||
*/
|
||||
@Mapper
|
||||
public interface RobotCustomerConverter {
|
||||
|
||||
RobotCustomerConverter INSTANCE = Mappers.getMapper(RobotCustomerConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转vo
|
||||
*
|
||||
* @param payOrder
|
||||
* @return
|
||||
*/
|
||||
RobotCustomerVO entityToVo(RobotCustomer payOrder);
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.baiye.modules.scrm.converter;
|
||||
|
||||
import com.baiye.modules.scrm.entity.RobotGroup;
|
||||
import com.baiye.modules.scrm.vo.RobotGroupVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/3/28
|
||||
*/
|
||||
@Mapper
|
||||
public interface RobotGroupConverter {
|
||||
|
||||
RobotGroupConverter INSTANCE = Mappers.getMapper(RobotGroupConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转vo
|
||||
*
|
||||
* @param robotGroup
|
||||
* @return
|
||||
*/
|
||||
RobotGroupVO entityToVo(RobotGroup robotGroup);
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.baiye.modules.scrm.converter;
|
||||
|
||||
import com.baiye.modules.scrm.entity.StaticResource;
|
||||
import com.baiye.modules.scrm.vo.StaticResourceVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/2
|
||||
*/
|
||||
@Mapper
|
||||
public interface StaticResourceConverter {
|
||||
|
||||
StaticResourceConverter INSTANCE = Mappers.getMapper(StaticResourceConverter.class);
|
||||
|
||||
/**
|
||||
* 实体转vo
|
||||
*
|
||||
* @param resource
|
||||
* @return
|
||||
*/
|
||||
StaticResourceVO entityToVo(StaticResource resource);
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.baiye.modules.scrm.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/5
|
||||
*/
|
||||
@Data
|
||||
public class AfterPassingDTO {
|
||||
|
||||
private String passGreetMessage;
|
||||
|
||||
private Integer type;
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.baiye.modules.scrm.dto;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/18
|
||||
*/
|
||||
@Data
|
||||
public class CustomerVisibleRangeDTO {
|
||||
|
||||
private Integer userId;
|
||||
|
||||
private String account;
|
||||
|
||||
private Long customerId;
|
||||
|
||||
private String wechatId;
|
||||
|
||||
private String friendWxId;
|
||||
|
||||
private String friendWxImg;
|
||||
|
||||
private String friendWxNick;
|
||||
|
||||
private Boolean friendAllEnable;
|
||||
|
||||
private Boolean groupAllEnable;
|
||||
|
||||
|
||||
List<SelectRobotWxInfoVo> wxInfoVos;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
public static class SelectRobotWxInfoVo {
|
||||
|
||||
private int robotId;
|
||||
|
||||
private String wxId;
|
||||
|
||||
private String wxNick;
|
||||
|
||||
private String wxImg;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.baiye.modules.scrm.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/15
|
||||
*/
|
||||
@Data
|
||||
public class PacketDTO {
|
||||
private List<Long> idList;
|
||||
|
||||
private Long packetId;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.baiye.modules.scrm.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/6/13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class SaveComparisonDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.baiye.modules.scrm.dto;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.converter.JsonStringArrayTypeHandler;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/2
|
||||
*/
|
||||
@Data
|
||||
public class StaticResourceDTO {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 资源地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
|
||||
/**
|
||||
* 业务标签
|
||||
*/
|
||||
private List<String> serviceLabel;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.baiye.modules.scrm.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/6/27
|
||||
*/
|
||||
@Data
|
||||
public class WeChatInformationDTO {
|
||||
|
||||
private String alias;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private Integer sex;
|
||||
|
||||
private String userName;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.baiye.modules.scrm.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/26
|
||||
*/
|
||||
@Data
|
||||
public class WeChatLabelDTO {
|
||||
|
||||
private Integer labelId;
|
||||
|
||||
private String labelName;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.baiye.modules.scrm.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/18
|
||||
*/
|
||||
@Data
|
||||
public class WeChatLoginInfoDTO {
|
||||
private String code;
|
||||
|
||||
private String deviceImEi;
|
||||
|
||||
private String deviceToken;
|
||||
|
||||
private String flag;
|
||||
|
||||
private String host;
|
||||
|
||||
private String loginName;
|
||||
|
||||
private Integer loginType;
|
||||
|
||||
private String msgSyncKey;
|
||||
|
||||
private Boolean newDevice;
|
||||
|
||||
private Boolean newWxLogin;
|
||||
|
||||
private String nickname;
|
||||
|
||||
private String pit;
|
||||
|
||||
private Integer protoVer;
|
||||
|
||||
private Boolean pushLogin;
|
||||
|
||||
private String randomId;
|
||||
|
||||
private String reConnectReason;
|
||||
|
||||
private String reConnectReqId;
|
||||
|
||||
private String result;
|
||||
|
||||
private String settings;
|
||||
|
||||
private String smallHeadImgUrl;
|
||||
|
||||
private String softwareId;
|
||||
|
||||
private String token;
|
||||
|
||||
|
||||
private String wxId;
|
||||
|
||||
private String wxVersion;
|
||||
|
||||
private String wxdat;
|
||||
|
||||
private String wxid;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.baiye.modules.scrm.entity;
|
||||
|
||||
import com.baiye.entity.BaseEntity;
|
||||
import com.baiye.extend.mybatis.plus.alias.TableAlias;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/6/17
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName(value = "tb_add_friend_frequently_record")
|
||||
@Schema(title = "添加频繁记录")
|
||||
@TableAlias("ar")
|
||||
public class AddFriendFrequentlyRecord extends BaseEntity {
|
||||
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@Schema(title = "ID")
|
||||
@NotNull(message = "ID不能为空", groups = { UpdateGroup.class })
|
||||
private Long id;
|
||||
|
||||
@Schema(title = "add_friend_id")
|
||||
private Long addFriendId;
|
||||
|
||||
@Schema(title = "target_wechat")
|
||||
private String targetWechat;
|
||||
|
||||
@Schema(title = "trumpet_wechat")
|
||||
private String trumpetWechat;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.baiye.modules.scrm.entity;
|
||||
|
||||
import com.baiye.entity.BaseEntity;
|
||||
import com.baiye.extend.mybatis.plus.alias.TableAlias;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/5
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName(value = "tb_add_friend_pass_greet_message")
|
||||
@Schema(title = "添加之后语句")
|
||||
@TableAlias("am")
|
||||
public class AddFriendPassGreetMessage extends BaseEntity {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@Schema(title = "ID")
|
||||
@NotNull(message = "ID不能为空", groups = { UpdateGroup.class })
|
||||
private Long id;
|
||||
|
||||
private Long taskId;
|
||||
|
||||
private Integer type;
|
||||
|
||||
@Schema(title = "通过之后消息")
|
||||
private String passGreetMessage;
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.baiye.modules.scrm.entity;
|
||||
|
||||
import com.baiye.entity.LogicDeletedBaseEntity;
|
||||
import com.baiye.extend.mybatis.plus.alias.TableAlias;
|
||||
import com.baiye.extend.mybatis.plus.converter.JsonStringArrayTypeHandler;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/13
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName(value = "tb_circle_friend_task")
|
||||
@Schema(title = "朋友圈任务")
|
||||
@TableAlias("ct")
|
||||
public class CircleFriendTask extends LogicDeletedBaseEntity {
|
||||
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@Schema(title = "ID")
|
||||
@NotNull(message = "ID不能为空", groups = { UpdateGroup.class })
|
||||
private Long id;
|
||||
|
||||
@Schema(title = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(title = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(title = "发送状态")
|
||||
private Integer sendStatus;
|
||||
|
||||
@Schema(title = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(title = "内容")
|
||||
private String content;
|
||||
|
||||
@Schema(title = "类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(title = "延后时间")
|
||||
private Integer deferredTime;
|
||||
|
||||
|
||||
@Schema(title = "是否现在执行")
|
||||
private Boolean isNow;
|
||||
|
||||
@Schema(title = "执行时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date executionTime;
|
||||
|
||||
@Schema(title = "资源地址")
|
||||
private String sourcePath;
|
||||
|
||||
|
||||
@Schema(title = "延后评论")
|
||||
@TableField(value = "deferred_comment", typeHandler = JsonStringArrayTypeHandler.class)
|
||||
private List<String> deferredComment;
|
||||
|
||||
@Schema(title = "图片地址")
|
||||
@TableField(value = "picture_list", typeHandler = JsonStringArrayTypeHandler.class)
|
||||
private List<String> pictureList;
|
||||
|
||||
|
||||
@TableField(value = "execute_wechat_list", typeHandler = JsonStringArrayTypeHandler.class)
|
||||
@Schema(title = "执行微信号")
|
||||
private List<String> executeWechatList;
|
||||
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package com.baiye.modules.scrm.entity;
|
||||
|
||||
import com.baiye.entity.BaseEntity;
|
||||
import com.baiye.extend.mybatis.plus.alias.TableAlias;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName(value = "tb_comparison_record", autoResultMap = true)
|
||||
@Schema(title = "对比记录")
|
||||
@TableAlias("cr")
|
||||
public class ComparisonRecord extends BaseEntity {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.INPUT)
|
||||
@Schema(title = "线索ID")
|
||||
@NotNull(message = "id")
|
||||
private Long id;
|
||||
|
||||
@Schema(title = "任务ID")
|
||||
private Long taskId;
|
||||
|
||||
|
||||
@Schema(title = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
|
||||
@Schema(description = "日期")
|
||||
private String dateStr;
|
||||
|
||||
|
||||
@Schema(description = "小红书ID")
|
||||
private String redBookId;
|
||||
|
||||
|
||||
@Schema(description = "小红书号")
|
||||
private String redBookNo;
|
||||
|
||||
|
||||
@Schema(description = "项目")
|
||||
private String photograph;
|
||||
|
||||
|
||||
@Schema( description = "机构")
|
||||
private String institution;
|
||||
|
||||
@Schema( description = "建模时间")
|
||||
private Date conversionTime;
|
||||
|
||||
|
||||
@Schema( description = "对比结果")
|
||||
private String comparisonResult;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ComparisonRecord that = (ComparisonRecord) o;
|
||||
return Objects.equals(redBookId, that.redBookId) && Objects.equals(redBookNo, that.redBookNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(redBookId, redBookNo);
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.baiye.modules.scrm.entity;
|
||||
|
||||
import com.baiye.entity.BaseEntity;
|
||||
import com.baiye.extend.mybatis.plus.alias.TableAlias;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/16
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName(value = "tb_comparison_task", autoResultMap = true)
|
||||
@Schema(title = "对比")
|
||||
@TableAlias("ct")
|
||||
public class ComparisonTask extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.INPUT)
|
||||
@Schema(title = "线索ID")
|
||||
@NotNull(message = "分发ID不能为空", groups = {UpdateGroup.class})
|
||||
private Long id;
|
||||
|
||||
@Schema(title = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
|
||||
@Schema(title = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(title = "父类ID")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(title = "线索备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(title = "是否完成")
|
||||
private Boolean isComplete;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.baiye.modules.scrm.entity;
|
||||
|
||||
import com.baiye.entity.BaseEntity;
|
||||
import com.baiye.extend.mybatis.plus.alias.TableAlias;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/16
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@TableName(value = "tb_down_comparison_log", autoResultMap = true)
|
||||
@Schema(title = "下载日志")
|
||||
@TableAlias("cl")
|
||||
public class ComparisonTaskLog extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.INPUT)
|
||||
@Schema(title = "线索ID")
|
||||
@NotNull(message = "分发ID不能为空", groups = {UpdateGroup.class})
|
||||
private Long id;
|
||||
|
||||
@Schema(title = "任务名称")
|
||||
private Long taskId;
|
||||
|
||||
|
||||
@Schema(title = "任务名称")
|
||||
private Long userId;
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.baiye.modules.scrm.entity;
|
||||
|
||||
import com.baiye.entity.LogicDeletedBaseEntity;
|
||||
import com.baiye.extend.mybatis.plus.alias.TableAlias;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/14
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableAlias("rg")
|
||||
@TableName(value = "tb_robot_group")
|
||||
public class RobotGroup extends LogicDeletedBaseEntity {
|
||||
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@Schema(title = "分组ID")
|
||||
@NotNull(message = "分组ID", groups = { UpdateGroup.class })
|
||||
private Long id;
|
||||
|
||||
@Schema(title = "user_id")
|
||||
private Long userId;
|
||||
|
||||
@TableField("group_type")
|
||||
private Integer groupType;
|
||||
|
||||
@Schema(title = "name")
|
||||
@NotBlank
|
||||
private String name;
|
||||
|
||||
@TableField
|
||||
private String remark;
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.baiye.modules.scrm.entity;
|
||||
|
||||
import com.baiye.entity.BaseEntity;
|
||||
import com.baiye.extend.mybatis.plus.alias.TableAlias;
|
||||
import com.baiye.extend.mybatis.plus.converter.JsonStringArrayTypeHandler;
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/2
|
||||
* 静态资源
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableAlias("sr")
|
||||
@TableName(value = "tb_static_resource", autoResultMap = true)
|
||||
public class StaticResource extends BaseEntity implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@Schema(title = "id")
|
||||
@NotNull(message = "id", groups = {UpdateGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@TableField("title")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField("type")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 资源地址
|
||||
*/
|
||||
@TableField("url")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
@TableField("file_url")
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@TableField("content")
|
||||
private String content;
|
||||
|
||||
|
||||
/**
|
||||
* 业务标签
|
||||
*/
|
||||
@TableField(value = "service_label", typeHandler = JsonStringArrayTypeHandler.class)
|
||||
private List<String> serviceLabel;
|
||||
}
|
@ -1,46 +1,48 @@
|
||||
package com.baiye.modules.scrm.entity;
|
||||
|
||||
import com.baiye.entity.BaseEntity;
|
||||
import com.baiye.extend.mybatis.plus.alias.TableAlias;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Enzo
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@TableAlias("we")
|
||||
@TableName("tb_wechat_equipment")
|
||||
@Schema(title = "微信账号设备")
|
||||
public class WeChatEquipment implements Serializable {
|
||||
public class WeChatEquipment extends BaseEntity implements Serializable {
|
||||
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(title = "用户id")
|
||||
private Long accountId;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(title = "用户id")
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 角色Code
|
||||
*/
|
||||
@Schema(title = "设备id")
|
||||
private Long equipmentId;
|
||||
/**
|
||||
* 角色Code
|
||||
*/
|
||||
@Schema(title = "设备id")
|
||||
private Long equipmentId;
|
||||
|
||||
|
||||
@Schema(title = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(title = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.baiye.modules.scrm.mapper;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.C;
|
||||
import com.baiye.constant.DefaultNumberConstants;
|
||||
import com.baiye.extend.mybatis.plus.conditions.query.LambdaQueryWrapperX;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.scrm.entity.ActiveAddFriedRecord;
|
||||
import com.baiye.modules.scrm.entity.AddFriendFrequentlyRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date 2024-5-31
|
||||
*/
|
||||
@Mapper
|
||||
public interface AddFriendFrequentlyRecordMapper extends ExtendMapper<AddFriendFrequentlyRecord> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询今日数据
|
||||
*
|
||||
* @param trumpetWechat
|
||||
* @param dateTime
|
||||
* @return
|
||||
*/
|
||||
default AddFriendFrequentlyRecord countByTrumpetWechatAndDate(String trumpetWechat, DateTime dateTime) {
|
||||
List<AddFriendFrequentlyRecord> selectList = selectList(WrappersX.lambdaQueryX(AddFriendFrequentlyRecord.class).eq
|
||||
(AddFriendFrequentlyRecord::getTrumpetWechat, trumpetWechat).gt(AddFriendFrequentlyRecord::getCreateTime, dateTime).orderByDesc(AddFriendFrequentlyRecord::getId));
|
||||
if (CollUtil.isNotEmpty(selectList)) {
|
||||
return selectList.get(DefaultNumberConstants.ZERO_NUMBER);
|
||||
}
|
||||
return new AddFriendFrequentlyRecord();
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.baiye.modules.scrm.mapper;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.scrm.entity.AddFriendPassGreetMessage;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/5
|
||||
*/
|
||||
@Mapper
|
||||
public interface AddFriendPassGreetMessageMapper extends ExtendMapper<AddFriendPassGreetMessage> {
|
||||
default List<AddFriendPassGreetMessage> selectListByTaskId(Long taskId){
|
||||
return this.selectList(WrappersX.lambdaQueryX(AddFriendPassGreetMessage.class).eq
|
||||
(AddFriendPassGreetMessage::getTaskId, taskId).orderByAsc(AddFriendPassGreetMessage::getId));
|
||||
}
|
||||
|
||||
default Boolean deleteByTaskId(Long id){
|
||||
LambdaUpdateWrapper<AddFriendPassGreetMessage> wrapper = WrappersX.lambdaUpdate(AddFriendPassGreetMessage.class);
|
||||
wrapper.eq(AddFriendPassGreetMessage::getTaskId, id);
|
||||
return SqlHelper.retBool(this.delete(wrapper));
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.baiye.modules.scrm.mapper;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.conditions.query.LambdaQueryWrapperX;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.scrm.converter.CircleFriendTaskConverter;
|
||||
import com.baiye.modules.scrm.converter.ComparisonConverter;
|
||||
import com.baiye.modules.scrm.entity.CircleFriendTask;
|
||||
import com.baiye.modules.scrm.entity.ComparisonTask;
|
||||
import com.baiye.modules.scrm.qo.CircleFriendQO;
|
||||
import com.baiye.modules.scrm.qo.ComparisonQO;
|
||||
import com.baiye.modules.scrm.vo.CircleFriendTaskVO;
|
||||
import com.baiye.modules.scrm.vo.ComparisonTaskVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/13
|
||||
*/
|
||||
@Mapper
|
||||
public interface CircleFriendTaskMapper extends ExtendMapper<CircleFriendTask> {
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
default PageResult<CircleFriendTaskVO> queryPage(PageParam pageParam, CircleFriendQO qo){
|
||||
IPage<CircleFriendTask> page = this.prodPage(pageParam);
|
||||
LambdaQueryWrapperX<CircleFriendTask> wrapperX = WrappersX.lambdaQueryX(CircleFriendTask.class);
|
||||
if (StringUtils.isNotBlank(qo.getStartTime()) && StringUtils.isNotBlank(qo.getEndTime())) {
|
||||
wrapperX.between(CircleFriendTask::getCreateTime, qo.getStartTime(), qo.getEndTime());
|
||||
}
|
||||
wrapperX.eqIfPresent(CircleFriendTask::getUserId, qo.getUserId()).orderByDesc(CircleFriendTask::getId);
|
||||
this.selectPage(page, wrapperX);
|
||||
IPage<CircleFriendTaskVO> voPage = page.convert(CircleFriendTaskConverter.INSTANCE::entityToVo);
|
||||
return new PageResult<>(voPage.getRecords(), voPage.getTotal());
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.baiye.modules.scrm.mapper;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.conditions.query.LambdaQueryWrapperX;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.scrm.entity.ComparisonRecord;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*/
|
||||
@Mapper
|
||||
public interface ComparisonRecordMapper extends ExtendMapper<ComparisonRecord> {
|
||||
|
||||
|
||||
default List<ComparisonRecord> selectListByTaskId(Long taskId, Boolean flag){
|
||||
LambdaQueryWrapperX<ComparisonRecord> wrapperX = WrappersX.lambdaQueryX(ComparisonRecord.class);
|
||||
if (Boolean.FALSE.equals(flag)){
|
||||
wrapperX.select(ComparisonRecord::getRedBookId);
|
||||
}
|
||||
wrapperX.eq(ComparisonRecord::getTaskId, taskId);
|
||||
return selectList(wrapperX);
|
||||
}
|
||||
|
||||
default List<ComparisonRecord> selectListByTaskIdAndRedBookId(Long taskId, Set<String> strings){
|
||||
LambdaQueryWrapperX<ComparisonRecord> wrapperX = WrappersX.lambdaQueryX(ComparisonRecord.class);
|
||||
wrapperX.eq(ComparisonRecord::getTaskId, taskId).in(ComparisonRecord::getRedBookId, strings);
|
||||
return selectList(wrapperX);
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.baiye.modules.scrm.mapper;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.conditions.query.LambdaQueryWrapperX;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.scrm.entity.ComparisonTaskLog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*/
|
||||
@Mapper
|
||||
public interface ComparisonTaskLogMapper extends ExtendMapper<ComparisonTaskLog> {
|
||||
default Long countByUserAndTaskId(Long taskId, Long currentUserId){
|
||||
LambdaQueryWrapperX<ComparisonTaskLog> wrapperX = WrappersX.lambdaQueryX();
|
||||
return this.selectCount(wrapperX.eq(ComparisonTaskLog::getTaskId, taskId).eq(ComparisonTaskLog::getUserId, currentUserId));
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.baiye.modules.scrm.mapper;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.conditions.query.LambdaQueryWrapperX;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.scrm.converter.ComparisonConverter;
|
||||
import com.baiye.modules.scrm.entity.ComparisonTask;
|
||||
import com.baiye.modules.scrm.qo.ComparisonQO;
|
||||
import com.baiye.modules.scrm.vo.ComparisonTaskVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/16
|
||||
*/
|
||||
@Mapper
|
||||
public interface ComparisonTaskMapper extends ExtendMapper<ComparisonTask> {
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
default PageResult<ComparisonTaskVO> queryPage(PageParam pageParam, ComparisonQO qo) {
|
||||
IPage<ComparisonTask> page = this.prodPage(pageParam);
|
||||
LambdaQueryWrapperX<ComparisonTask> wrapperX = WrappersX.lambdaQueryX(ComparisonTask.class);
|
||||
if (StringUtils.isNotBlank(qo.getStartTime()) && StringUtils.isNotBlank(qo.getEndTime())) {
|
||||
wrapperX.between(ComparisonTask::getCreateTime, qo.getStartTime(), qo.getEndTime());
|
||||
}
|
||||
wrapperX.eqIfPresent(ComparisonTask::getParentId, qo.getUserId()).orderByDesc(ComparisonTask::getId);
|
||||
this.selectPage(page, wrapperX);
|
||||
IPage<ComparisonTaskVO> voPage = page.convert(ComparisonConverter.INSTANCE::entityToVo);
|
||||
return new PageResult<>(voPage.getRecords(), voPage.getTotal());
|
||||
}
|
||||
|
||||
default int setCompleteById(Long taskId) {
|
||||
return this.update(null, WrappersX.lambdaUpdate(ComparisonTask.class).eq
|
||||
(ComparisonTask::getId, taskId).set(ComparisonTask::getIsComplete, Boolean.TRUE));
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.baiye.modules.scrm.mapper;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.conditions.query.LambdaQueryWrapperX;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.scrm.converter.PayOrderConverter;
|
||||
import com.baiye.modules.scrm.converter.RobotCustomerConverter;
|
||||
import com.baiye.modules.scrm.entity.PayOrder;
|
||||
import com.baiye.modules.scrm.entity.RobotCustomer;
|
||||
import com.baiye.modules.scrm.qo.RobotCustomerQo;
|
||||
import com.baiye.modules.scrm.vo.PayOrderVO;
|
||||
import com.baiye.modules.scrm.vo.RobotCustomerVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/7/9
|
||||
*/
|
||||
@Mapper
|
||||
public interface RobotCustomerMapper extends ExtendMapper<RobotCustomer> {
|
||||
/**
|
||||
* 好友ID微信ID查询
|
||||
*
|
||||
* @param list
|
||||
* @param wxId
|
||||
* @return
|
||||
*/
|
||||
default List<String> selectListByWxId(List<String> list, String wxId) {
|
||||
LambdaQueryWrapperX<RobotCustomer> select =
|
||||
WrappersX.lambdaQueryX(RobotCustomer.class).select(RobotCustomer::getFriendId).eq(RobotCustomer::getWechatId, wxId).in(RobotCustomer::getFriendId, list);
|
||||
return this.selectList(select).stream().map(RobotCustomer::getFriendId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除好友
|
||||
*
|
||||
* @param removeList
|
||||
* @return
|
||||
*/
|
||||
default int deleteByWeChatId(List<String> removeList) {
|
||||
return this.delete(WrappersX.lambdaQueryX
|
||||
(RobotCustomer.class).in(RobotCustomer::getFriendId, removeList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
default PageResult<RobotCustomerVO> queryPage(PageParam pageParam, RobotCustomerQo qo){
|
||||
IPage<RobotCustomer> page = this.prodPage(pageParam);
|
||||
LambdaQueryWrapperX<RobotCustomer> wrapperX = WrappersX.lambdaQueryX(RobotCustomer.class);
|
||||
|
||||
wrapperX.eqIfPresent(RobotCustomer::getWechatId, qo.getWxId()).likeIfPresent(RobotCustomer::getFriendId, qo.getFriendId()).likeIfPresent(RobotCustomer::getFriendName, qo.getFriendNickname()).orderByDesc(RobotCustomer::getId);
|
||||
this.selectPage(page, wrapperX);
|
||||
IPage<RobotCustomerVO> voPage = page.convert(RobotCustomerConverter.INSTANCE::entityToVo);
|
||||
return new PageResult<>(voPage.getRecords(), voPage.getTotal());
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.baiye.modules.scrm.mapper;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.conditions.query.LambdaQueryWrapperX;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.scrm.converter.RobotGroupConverter;
|
||||
import com.baiye.modules.scrm.entity.RobotGroup;
|
||||
import com.baiye.modules.scrm.qo.RobotGroupQo;
|
||||
import com.baiye.modules.scrm.vo.RobotGroupVO;
|
||||
import com.baiye.modules.scrm.vo.WeChatAccountVO;
|
||||
import com.baiye.security.userdetails.User;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/14
|
||||
*/
|
||||
@Mapper
|
||||
public interface RobotGroupMapper extends ExtendMapper<RobotGroup> {
|
||||
|
||||
/**
|
||||
* 条件分页查询数据
|
||||
*
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
default PageResult<RobotGroupVO> queryPage(PageParam pageParam, RobotGroupQo qo) {
|
||||
IPage<RobotGroup> page = this.prodPage(pageParam);
|
||||
LambdaQueryWrapperX<RobotGroup> wrapperX = WrappersX.lambdaQueryX(RobotGroup.class);
|
||||
|
||||
wrapperX.eqIfPresent(RobotGroup::getUserId, qo.getUserId()).likeIfPresent(RobotGroup::getName, qo.getName()).orderByDesc(RobotGroup::getId);
|
||||
this.selectPage(page, wrapperX);
|
||||
IPage<RobotGroupVO> voPage = page.convert(RobotGroupConverter.INSTANCE::entityToVo);
|
||||
return new PageResult<>(voPage.getRecords(), voPage.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*
|
||||
* @param name
|
||||
* @param currentUserId
|
||||
* @return
|
||||
*/
|
||||
default List<RobotGroup> findByName(String name, Long currentUserId) {
|
||||
return this.selectList(WrappersX.lambdaUpdate(RobotGroup.class).eq
|
||||
(RobotGroup::getName, name).eq(RobotGroup::getUserId, currentUserId));
|
||||
}
|
||||
|
||||
default List<RobotGroupVO> selectListByUserId(Long currentUserId){
|
||||
List<RobotGroup> groupList = this.selectList(WrappersX.lambdaUpdate(RobotGroup.class).eq
|
||||
(RobotGroup::getUserId, currentUserId).eq(RobotGroup::getUserId, currentUserId));
|
||||
return Convert.toList(RobotGroupVO.class, groupList);
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.baiye.modules.scrm.mapper;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.conditions.query.LambdaQueryWrapperX;
|
||||
import com.baiye.extend.mybatis.plus.mapper.ExtendMapper;
|
||||
import com.baiye.extend.mybatis.plus.toolkit.WrappersX;
|
||||
import com.baiye.modules.scrm.converter.PayOrderConverter;
|
||||
import com.baiye.modules.scrm.converter.StaticResourceConverter;
|
||||
import com.baiye.modules.scrm.entity.PayOrder;
|
||||
import com.baiye.modules.scrm.entity.StaticResource;
|
||||
import com.baiye.modules.scrm.qo.ResourceQo;
|
||||
import com.baiye.modules.scrm.vo.PayOrderVO;
|
||||
import com.baiye.modules.scrm.vo.StaticResourceVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date 2024-7-2
|
||||
*/
|
||||
@Mapper
|
||||
public interface StaticResourceMapper extends ExtendMapper<StaticResource> {
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
default PageResult<StaticResourceVO> queryPage(PageParam pageParam, ResourceQo qo){
|
||||
IPage<StaticResource> page = this.prodPage(pageParam);
|
||||
LambdaQueryWrapperX<StaticResource> wrapperX = WrappersX.lambdaQueryX(StaticResource.class);
|
||||
if (StringUtils.isNotBlank(qo.getStartTime()) && StringUtils.isNotBlank(qo.getEndTime())) {
|
||||
wrapperX.between(StaticResource::getCreateTime, qo.getStartTime(), qo.getEndTime());
|
||||
}
|
||||
wrapperX.eqIfPresent(StaticResource::getUserId, qo.getUserId());
|
||||
wrapperX.likeIfPresent(StaticResource::getTitle, qo.getTitle()).orderByDesc(StaticResource::getId);
|
||||
this.selectPage(page, wrapperX);
|
||||
IPage<StaticResourceVO> voPage = page.convert(StaticResourceConverter.INSTANCE::entityToVo);
|
||||
return new PageResult<>(voPage.getRecords(), voPage.getTotal());
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.baiye.modules.scrm.qo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/3/29
|
||||
*/
|
||||
@Data
|
||||
public class AddFriendQo {
|
||||
|
||||
|
||||
@Parameter(description = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@Parameter(description = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
@Parameter(description = "微信小号")
|
||||
private String trumpetWechat;
|
||||
|
||||
|
||||
@Parameter(description = "对方微信")
|
||||
private String targetWechat;
|
||||
|
||||
@Schema(title = "任务ID")
|
||||
private Long taskId;
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue