添加对比任务数据
parent
d305f8a059
commit
399892c140
@ -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,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,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.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,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,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,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,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,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,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,20 @@
|
||||
package com.baiye.modules.scrm.qo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*/
|
||||
@Data
|
||||
public class CircleFriendQO {
|
||||
@Parameter(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Parameter(description = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@Parameter(description = "结束时间")
|
||||
private String endTime;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.baiye.modules.scrm.qo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*/
|
||||
@Data
|
||||
public class ComparisonQO {
|
||||
@Parameter(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Parameter(description = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@Parameter(description = "结束时间")
|
||||
private String endTime;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.baiye.modules.scrm.qo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date 2024-7-11
|
||||
* 机器人客服号码
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class RobotGroupQo {
|
||||
|
||||
private Long userId;
|
||||
|
||||
private String name;
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.baiye.modules.scrm.service;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.service.ExtendService;
|
||||
import com.baiye.modules.scrm.dto.AfterPassingDTO;
|
||||
import com.baiye.modules.scrm.entity.AddFriendPassGreetMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/5
|
||||
*/
|
||||
public interface AddFriendPassGreetMessageService extends ExtendService<AddFriendPassGreetMessage> {
|
||||
|
||||
/**
|
||||
* 添加之后消息
|
||||
* @param taskId
|
||||
* @param afterPassing
|
||||
* @return
|
||||
*/
|
||||
Boolean addAfterMessage(Long taskId, List<AfterPassingDTO> afterPassing);
|
||||
|
||||
/**
|
||||
* 任务ID查询
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
List<AddFriendPassGreetMessage> findByTaskId(Long taskId);
|
||||
|
||||
/**
|
||||
* 修改参数
|
||||
* @param id
|
||||
* @param afterPassing
|
||||
* @return
|
||||
*/
|
||||
Boolean updatePassGreetByTaskId(Long id, List<AfterPassingDTO> afterPassing);
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.baiye.modules.scrm.service;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.service.ExtendService;
|
||||
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.vo.CircleFriendTaskVO;
|
||||
import com.baiye.modules.scrm.vo.ComparisonTaskVO;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/14
|
||||
*/
|
||||
public interface CircleFriendTaskService extends ExtendService<CircleFriendTask> {
|
||||
/**
|
||||
* 创建朋友圈任务
|
||||
*
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
Boolean create(CircleFriendTask entity);
|
||||
|
||||
/**
|
||||
* 修改任务
|
||||
*
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
Boolean update(CircleFriendTask entity);
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
Boolean del(Long taskId);
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
|
||||
PageResult<CircleFriendTaskVO> queryPage(PageParam pageParam, CircleFriendQO qo);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.baiye.modules.scrm.service;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.service.ExtendService;
|
||||
import com.baiye.modules.scrm.entity.ComparisonRecord;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*/
|
||||
public interface ComparisonRecordService extends ExtendService<ComparisonRecord> {
|
||||
/**
|
||||
* 任务ID查询数据
|
||||
* @param taskId
|
||||
* @param flag
|
||||
* @return
|
||||
*/
|
||||
List<ComparisonRecord> selectListByTaskId(Long taskId, Boolean flag);
|
||||
|
||||
/**
|
||||
* id与任务ID查询
|
||||
* @param taskId
|
||||
* @param strings
|
||||
* @return
|
||||
*/
|
||||
List<ComparisonRecord> queryByTaskAndRedBookId(Long taskId, Set<String> strings);
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.baiye.modules.scrm.service;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.service.ExtendService;
|
||||
import com.baiye.modules.scrm.entity.ComparisonTaskLog;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*/
|
||||
public interface ComparisonTaskLogService extends ExtendService<ComparisonTaskLog> {
|
||||
|
||||
/**
|
||||
* 任务ID和用户查询
|
||||
* @param taskId
|
||||
* @param currentUserId
|
||||
* @return
|
||||
*/
|
||||
Long countByUserAndTaskId(Long taskId, Long currentUserId);
|
||||
|
||||
/**
|
||||
* 创建记录
|
||||
* @param taskId
|
||||
* @param currentUserId
|
||||
* @return
|
||||
*/
|
||||
Boolean createTaskLogByTaskIdAndUserId(Long taskId, Long currentUserId);
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.baiye.modules.scrm.service;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.service.ExtendService;
|
||||
import com.baiye.modules.scrm.entity.ComparisonTask;
|
||||
import com.baiye.modules.scrm.qo.ComparisonQO;
|
||||
import com.baiye.modules.scrm.vo.ComparisonTaskVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/16
|
||||
*/
|
||||
public interface ComparisonTaskService extends ExtendService<ComparisonTask> {
|
||||
/**
|
||||
* 创建对比任务
|
||||
*
|
||||
* @param file
|
||||
* @param taskName
|
||||
* @param remark
|
||||
* @return
|
||||
*/
|
||||
Boolean createTask(MultipartFile file, String taskName, String remark);
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
PageResult<ComparisonTaskVO> queryPage(PageParam pageParam, ComparisonQO qo);
|
||||
|
||||
/**
|
||||
* 上传文件追加任务
|
||||
*
|
||||
* @param file
|
||||
* @param taskId
|
||||
* @param isComplete
|
||||
* @return
|
||||
*/
|
||||
Boolean additionalTask(MultipartFile file, Long taskId, Boolean isComplete);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*
|
||||
* @param response
|
||||
* @param taskId
|
||||
*/
|
||||
void exportByTaskId(HttpServletResponse response, Long taskId);
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.baiye.modules.scrm.service;
|
||||
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.service.ExtendService;
|
||||
import com.baiye.modules.scrm.entity.RobotGroup;
|
||||
import com.baiye.modules.scrm.entity.StaticResource;
|
||||
import com.baiye.modules.scrm.qo.RobotGroupQo;
|
||||
import com.baiye.modules.scrm.vo.RobotGroupVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/14
|
||||
*/
|
||||
public interface RobotGroupService extends ExtendService<RobotGroup> {
|
||||
|
||||
/**
|
||||
* 条件查询分组
|
||||
* @param pageParam
|
||||
* @param qo
|
||||
* @return
|
||||
*/
|
||||
PageResult<RobotGroupVO> queryPage(PageParam pageParam, RobotGroupQo qo);
|
||||
|
||||
/**
|
||||
* 查询总数据
|
||||
* @param currentUserId
|
||||
* @return
|
||||
*/
|
||||
List<RobotGroupVO> queryByUserId(Long currentUserId);
|
||||
|
||||
/**
|
||||
* 新增數據
|
||||
* @param entity
|
||||
*/
|
||||
Boolean create(RobotGroup entity);
|
||||
|
||||
/**
|
||||
* 修改分组
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
Boolean update(RobotGroup entity);
|
||||
|
||||
/**
|
||||
* 删除分组
|
||||
* @param groupId
|
||||
* @return
|
||||
*/
|
||||
Boolean del(Long groupId);
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.baiye.modules.scrm.service.impl;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.service.impl.ExtendServiceImpl;
|
||||
import com.baiye.modules.scrm.dto.AfterPassingDTO;
|
||||
import com.baiye.modules.scrm.entity.AddFriendPassGreetMessage;
|
||||
import com.baiye.modules.scrm.mapper.AddFriendPassGreetMessageMapper;
|
||||
import com.baiye.modules.scrm.service.AddFriendPassGreetMessageService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/6/2
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AddFriendPassGreetMessageServiceImpl extends
|
||||
ExtendServiceImpl<AddFriendPassGreetMessageMapper, AddFriendPassGreetMessage> implements AddFriendPassGreetMessageService {
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean addAfterMessage(Long taskId, List<AfterPassingDTO> afterPassing) {
|
||||
for (AfterPassingDTO afterPassingDTO : afterPassing) {
|
||||
AddFriendPassGreetMessage message = new AddFriendPassGreetMessage();
|
||||
message.setTaskId(taskId);
|
||||
message.setType(afterPassingDTO.getType());
|
||||
message.setPassGreetMessage(afterPassingDTO.getPassGreetMessage());
|
||||
baseMapper.insert(message);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AddFriendPassGreetMessage> findByTaskId(Long taskId) {
|
||||
return baseMapper.selectListByTaskId(taskId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updatePassGreetByTaskId(Long id, List<AfterPassingDTO> afterPassing) {
|
||||
Boolean aBoolean = baseMapper.deleteByTaskId(id);
|
||||
if (Boolean.TRUE.equals(aBoolean)){
|
||||
return addAfterMessage(id, afterPassing);
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.baiye.modules.scrm.service.impl;
|
||||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baiye.common.job.handler.ElasticJobHandler;
|
||||
import com.baiye.constant.DefaultNumberConstants;
|
||||
import com.baiye.domain.PageParam;
|
||||
import com.baiye.domain.PageResult;
|
||||
import com.baiye.extend.mybatis.plus.service.impl.ExtendServiceImpl;
|
||||
import com.baiye.modules.scrm.entity.CircleFriendTask;
|
||||
import com.baiye.modules.scrm.mapper.CircleFriendTaskMapper;
|
||||
import com.baiye.modules.scrm.qo.CircleFriendQO;
|
||||
import com.baiye.modules.scrm.service.CircleFriendTaskService;
|
||||
import com.baiye.modules.scrm.service.WeChatService;
|
||||
import com.baiye.modules.scrm.vo.CircleFriendTaskVO;
|
||||
import com.baiye.schedule.handler.SendCircleFriendTaskJob;
|
||||
import com.baiye.util.CronUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/14
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CircleFriendTaskServiceImpl extends ExtendServiceImpl<CircleFriendTaskMapper, CircleFriendTask> implements CircleFriendTaskService {
|
||||
|
||||
@Value("${snowflake.workerId}")
|
||||
private int workerId;
|
||||
|
||||
@Value("${snowflake.datacenterId}")
|
||||
private int datacenterId;
|
||||
|
||||
private final WeChatService weChatService;
|
||||
|
||||
private final ElasticJobHandler elasticJobHandler;
|
||||
|
||||
private final SendCircleFriendTaskJob sendCircleFriendTaskJob;
|
||||
|
||||
@Override
|
||||
public Boolean create(CircleFriendTask entity) {
|
||||
long taskId = IdUtil.getSnowflake(workerId, datacenterId).nextId();
|
||||
if (Boolean.TRUE.equals(entity.getIsNow())) {
|
||||
for (String targetWechat : entity.getExecuteWechatList()) {
|
||||
// 发送文本
|
||||
if (entity.getType() == DefaultNumberConstants.ONE_NUMBER) {
|
||||
weChatService.sendTextCircleFriends
|
||||
(targetWechat, entity.getPictureList(), entity.getTitle(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
|
||||
}
|
||||
// 发送图文链接
|
||||
if (entity.getType() == DefaultNumberConstants.TWO_NUMBER) {
|
||||
weChatService.sendLinkCircleFriends
|
||||
(targetWechat, entity.getSourcePath(), entity.getTitle(), entity.getContent(), entity.getPictureList().get(DefaultNumberConstants.ZERO_NUMBER), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
|
||||
}
|
||||
// 发送视频
|
||||
if (entity.getType() == DefaultNumberConstants.THREE_NUMBER) {
|
||||
weChatService.sendVideoCircleFriends
|
||||
(targetWechat, entity.getSourcePath(), entity.getTitle(), entity.getPictureList().get(DefaultNumberConstants.ZERO_NUMBER), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
|
||||
}
|
||||
|
||||
log.info("============= send text circle friends {} type as {} ============", targetWechat, entity.getType());
|
||||
}
|
||||
return save(entity);
|
||||
}
|
||||
String generatedCronByTime = CronUtil.getCron(entity.getExecutionTime());
|
||||
elasticJobHandler.addJob(entity.getTaskName().concat(StrPool.DASHED).concat(String.valueOf(taskId)), generatedCronByTime, DefaultNumberConstants.ONE_NUMBER, sendCircleFriendTaskJob, String.valueOf(taskId), CharSequenceUtil.EMPTY);
|
||||
return save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(CircleFriendTask entity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean del(Long taskId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CircleFriendTaskVO> queryPage(PageParam pageParam, CircleFriendQO qo) {
|
||||
return baseMapper.queryPage(pageParam, qo);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.baiye.modules.scrm.service.impl;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.service.impl.ExtendServiceImpl;
|
||||
import com.baiye.modules.scrm.entity.ComparisonRecord;
|
||||
import com.baiye.modules.scrm.mapper.ComparisonRecordMapper;
|
||||
import com.baiye.modules.scrm.service.ComparisonRecordService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ComparisonRecordServiceImpl extends ExtendServiceImpl<ComparisonRecordMapper, ComparisonRecord> implements ComparisonRecordService {
|
||||
@Override
|
||||
public List<ComparisonRecord> selectListByTaskId(Long taskId, Boolean flag) {
|
||||
return baseMapper.selectListByTaskId(taskId, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComparisonRecord> queryByTaskAndRedBookId(Long taskId, Set<String> strings) {
|
||||
return baseMapper.selectListByTaskIdAndRedBookId(taskId, strings);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.baiye.modules.scrm.service.impl;
|
||||
|
||||
import com.baiye.extend.mybatis.plus.service.impl.ExtendServiceImpl;
|
||||
import com.baiye.modules.scrm.entity.ComparisonTaskLog;
|
||||
import com.baiye.modules.scrm.mapper.ComparisonTaskLogMapper;
|
||||
import com.baiye.modules.scrm.service.ComparisonTaskLogService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ComparisonTaskLogServiceImpl extends ExtendServiceImpl<ComparisonTaskLogMapper, ComparisonTaskLog> implements ComparisonTaskLogService {
|
||||
@Override
|
||||
public Long countByUserAndTaskId(Long taskId, Long currentUserId) {
|
||||
return baseMapper.countByUserAndTaskId(taskId, currentUserId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean createTaskLogByTaskIdAndUserId(Long taskId, Long currentUserId) {
|
||||
ComparisonTaskLog taskLog = new ComparisonTaskLog();
|
||||
taskLog.setTaskId(taskId);
|
||||
taskLog.setUserId(currentUserId);
|
||||
return this.save(taskLog);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.baiye.modules.scrm.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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.scrm.entity.RobotGroup;
|
||||
import com.baiye.modules.scrm.mapper.RobotGroupMapper;
|
||||
import com.baiye.modules.scrm.qo.RobotGroupQo;
|
||||
import com.baiye.modules.scrm.service.LoginEquipmentService;
|
||||
import com.baiye.modules.scrm.service.RobotGroupService;
|
||||
import com.baiye.modules.scrm.vo.RobotGroupVO;
|
||||
import com.baiye.modules.scrm.vo.WeChatAccountVO;
|
||||
import com.baiye.security.util.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/14
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RobotGroupServiceImpl extends ExtendServiceImpl<RobotGroupMapper, RobotGroup> implements RobotGroupService {
|
||||
|
||||
private final RobotGroupMapper robotGroupMapper;
|
||||
|
||||
private final LoginEquipmentService loginEquipmentService;
|
||||
|
||||
@Override
|
||||
public PageResult<RobotGroupVO> queryPage(PageParam pageParam, RobotGroupQo qo) {
|
||||
PageResult<RobotGroupVO> pageResult = robotGroupMapper.queryPage(pageParam, qo);
|
||||
pageResult.getRecords().forEach(record -> record.setAccountNum(loginEquipmentService.countByRobotId(record.getId())));
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<RobotGroupVO> queryByUserId(Long currentUserId) {
|
||||
List<RobotGroupVO> groupVOList = robotGroupMapper.selectListByUserId(currentUserId);
|
||||
for (RobotGroupVO groupVO : groupVOList) {
|
||||
List<WeChatAccountVO> voList = loginEquipmentService.queryByPacketId(groupVO.getId());
|
||||
Map<String, Object> map = Maps.newConcurrentMap();
|
||||
Iterator<WeChatAccountVO> iterator = voList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
WeChatAccountVO vo = iterator.next();
|
||||
if (StringUtils.isBlank(vo.getWxId())) {
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
if (map.containsKey(vo.getWxId())) {
|
||||
iterator.remove();
|
||||
}
|
||||
map.put(vo.getWxId(), vo.getWxId());
|
||||
}
|
||||
groupVO.setChildren(voList);
|
||||
}
|
||||
return groupVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean create(RobotGroup entity) {
|
||||
|
||||
List<RobotGroup> byName = robotGroupMapper.findByName(entity.getName(), SecurityUtils.getCurrentUserId());
|
||||
if (CollUtil.isNotEmpty(byName)) {
|
||||
throw new BadRequestException("该名称已存在!");
|
||||
}
|
||||
entity.setUserId(SecurityUtils.getCurrentUserId());
|
||||
return this.save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(RobotGroup entity) {
|
||||
List<RobotGroup> byName = robotGroupMapper.findByName(entity.getName(), SecurityUtils.getCurrentUserId());
|
||||
if (CollUtil.isNotEmpty(byName)) {
|
||||
throw new BadRequestException("该名称已存在!");
|
||||
}
|
||||
return this.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean del(Long groupId) {
|
||||
loginEquipmentService.deleteByGroupId(groupId);
|
||||
return SqlHelper.retBool(baseMapper.deleteById(groupId));
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.baiye.modules.scrm.vo;
|
||||
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/20
|
||||
*/
|
||||
@Data
|
||||
public class CircleFriendTaskVO {
|
||||
|
||||
@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 String deferredComment;
|
||||
|
||||
@Schema(title = "是否现在执行")
|
||||
private Boolean isNow;
|
||||
|
||||
@Schema(title = "执行时间")
|
||||
private Date executionTime;
|
||||
|
||||
@Schema(title = "资源地址")
|
||||
private String sourcePath;
|
||||
|
||||
@Schema(title = "图片地址")
|
||||
private List<String> pictureList;
|
||||
|
||||
|
||||
@Schema(title = "执行微信号")
|
||||
private List<String> executeWechatList;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.baiye.modules.scrm.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentFontStyle;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*/
|
||||
|
||||
@Data
|
||||
@HeadRowHeight(30)
|
||||
@ContentRowHeight(15)
|
||||
@ColumnWidth(18)
|
||||
@ContentFontStyle(fontHeightInPoints = (short) 12)
|
||||
public class ComparisonRecordVO {
|
||||
|
||||
|
||||
@ExcelProperty("小红书ID")
|
||||
@ColumnWidth(20)
|
||||
private String redBookId;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.baiye.modules.scrm.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentFontStyle;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@HeadRowHeight(30)
|
||||
@ContentRowHeight(15)
|
||||
@ColumnWidth(18)
|
||||
@ContentFontStyle(fontHeightInPoints = (short) 12)
|
||||
public class ComparisonSummaryVO {
|
||||
@ExcelProperty("id")
|
||||
@ColumnWidth(20)
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("收集日期")
|
||||
@ColumnWidth(20)
|
||||
private String dateStr;
|
||||
|
||||
@ExcelProperty(value = "上传日期")
|
||||
@ColumnWidth(20)
|
||||
@DateTimeFormat("yyyy-MM-dd")
|
||||
private Date createTime;
|
||||
|
||||
@ExcelProperty(value = "建模日期")
|
||||
@ColumnWidth(20)
|
||||
@DateTimeFormat("yyyy-MM-dd")
|
||||
private Date conversionTime;
|
||||
|
||||
@ExcelProperty(value = "小红书ID")
|
||||
@ColumnWidth(20)
|
||||
private String redBookId;
|
||||
|
||||
@ExcelProperty(value = "小红书号")
|
||||
@ColumnWidth(20)
|
||||
private String redBookNo;
|
||||
|
||||
|
||||
@ExcelProperty(value = "项目")
|
||||
@ColumnWidth(20)
|
||||
private String photograph;
|
||||
|
||||
|
||||
@ExcelProperty(value = "对标医生/机构")
|
||||
@ColumnWidth(20)
|
||||
private String institution;
|
||||
|
||||
@ExcelProperty(value = "手机号")
|
||||
@ColumnWidth(20)
|
||||
private String comparisonResult;
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.baiye.modules.scrm.vo;
|
||||
|
||||
import com.baiye.validation.group.UpdateGroup;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
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.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/19
|
||||
*/
|
||||
@Data
|
||||
public class ComparisonTaskVO {
|
||||
|
||||
@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 isDown;
|
||||
|
||||
@Schema(title = "是否完成")
|
||||
private Boolean isComplete;
|
||||
|
||||
|
||||
@Schema(title = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
@Schema(title = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.baiye.modules.scrm.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/6/2
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ComparisonVO {
|
||||
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
@ExcelProperty(value = "日期")
|
||||
private String dateStr;
|
||||
|
||||
/**
|
||||
* 小红书ID
|
||||
*/
|
||||
@ExcelProperty(value = "小红书ID")
|
||||
private String redBookId;
|
||||
|
||||
/**
|
||||
* 小红书号
|
||||
*/
|
||||
@ExcelProperty(value = "小红书号")
|
||||
private String redBookNo;
|
||||
|
||||
/**
|
||||
* 项目
|
||||
*/
|
||||
@ExcelProperty(value = "项目")
|
||||
private String photograph;
|
||||
|
||||
/**
|
||||
* 机构
|
||||
*/
|
||||
@ExcelProperty(value = "对标医生/机构")
|
||||
private String institution;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@ExcelProperty(value = "手机号")
|
||||
private String phone;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.baiye.modules.scrm.vo;
|
||||
|
||||
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
|
||||
* 分组返回结果
|
||||
*/
|
||||
@Data
|
||||
public class RobotGroupVO {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@Schema(title = "分组ID")
|
||||
@NotNull(message = "分组ID", groups = {UpdateGroup.class})
|
||||
private Long id;
|
||||
|
||||
@Schema(title = "user_id")
|
||||
private Long userId;
|
||||
|
||||
@Schema()
|
||||
private Integer groupType;
|
||||
|
||||
@Schema(title = "name")
|
||||
private String name;
|
||||
|
||||
@Schema
|
||||
private String remark;
|
||||
|
||||
private Long accountNum;
|
||||
|
||||
private List<WeChatAccountVO> children;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.baiye.schedule.handler;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baiye.constant.DefaultNumberConstants;
|
||||
import com.baiye.modules.scrm.entity.CircleFriendTask;
|
||||
import com.baiye.modules.scrm.mapper.CircleFriendTaskMapper;
|
||||
import com.baiye.modules.scrm.service.WeChatService;
|
||||
import com.dangdang.ddframe.job.api.ShardingContext;
|
||||
import com.dangdang.ddframe.job.api.simple.SimpleJob;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Enzo
|
||||
* @date : 2024/8/16
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SendCircleFriendTaskJob implements SimpleJob {
|
||||
|
||||
private final WeChatService weChatService;
|
||||
|
||||
private final CircleFriendTaskMapper circleFriendTaskMapper;
|
||||
|
||||
@Override
|
||||
public void execute(ShardingContext shardingContext) {
|
||||
Date now = DateUtil.date();
|
||||
String jobName = shardingContext.getJobName();
|
||||
String taskId = shardingContext.getJobParameter();
|
||||
log.info("{}定时发送朋友圈start task name {} task id {} ...", DateUtil.format(now, DatePattern.NORM_DATETIME_MS_PATTERN), jobName, taskId);
|
||||
if (ObjectUtil.isNotNull(taskId)) {
|
||||
CircleFriendTask circleFriendTask = circleFriendTaskMapper.selectById(Long.parseLong(taskId));
|
||||
if (ObjectUtil.isNotNull(circleFriendTask) && ObjectUtil.isNotNull(circleFriendTask.getId())) {
|
||||
// 判断是否过期
|
||||
if (circleFriendTask.getExecutionTime().before(now)) {
|
||||
circleFriendTask.setSendStatus(DefaultNumberConstants.ONE_NUMBER);
|
||||
circleFriendTaskMapper.updateById(circleFriendTask);
|
||||
return;
|
||||
}
|
||||
for (String targetWechat : circleFriendTask.getExecuteWechatList()) {
|
||||
Boolean result = weChatService.sendTextCircleFriends
|
||||
(targetWechat, circleFriendTask.getPictureList(), circleFriendTask.getTitle(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
|
||||
log.info("============= send text circle friends {} success {} ============", targetWechat, result);
|
||||
}
|
||||
circleFriendTask.setSendStatus(DefaultNumberConstants.ONE_NUMBER);
|
||||
circleFriendTaskMapper.updateById(circleFriendTask);
|
||||
}
|
||||
}
|
||||
log.info("{}定时发送朋友圈end...", DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MS_PATTERN));
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue