查找加盟商接口,改造跟进日志接口

This commit is contained in:
shuo.wang
2025-01-08 14:19:07 +08:00
parent ea9caaa6f1
commit 3579bb5f7c
19 changed files with 154 additions and 24 deletions

View File

@@ -0,0 +1,24 @@
package com.cool.store.enums;
/**
* @Author: WangShuo
* @Date: 2025/01/07/下午2:18
* @Version 1.0
* @注释:
*/
public enum FollowLogTypeEnum {
LINE(1,"线索"),
SHOP(2,"门店");
private int code;
private String desc;
private FollowLogTypeEnum(int code, String desc) {
this.code = code;
this.desc = desc;
}
public int getCode() {
return code;
}
public String getDesc() {
return desc;
}
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.dao;
import com.cool.store.entity.LineFollowLogDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.mapper.LineFollowLogMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
@@ -24,9 +25,9 @@ public class LineFollowLogDAO {
@Resource
private LineFollowLogMapper lineFollowLogMapper;
public Page<LineFollowLogDO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize){
public Page<LineFollowLogDO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize,Integer type){
PageHelper.startPage(pageNum, pageSize);
return lineFollowLogMapper.getFollowLogPage(lineId);
return lineFollowLogMapper.getFollowLogPage(lineId,type);
}
/**
@@ -37,11 +38,19 @@ public class LineFollowLogDAO {
* @param message
* @return
*/
public Long addFollowLog(LineInfoDO lineInfo, String operateUserId, String operateUsername, String message){
public Long addFollowLog(LineInfoDO lineInfo,String operateUserId, String operateUsername, String message,Integer type){
if(Objects.isNull(lineInfo)){
return null;
}
LineFollowLogDO followLog = new LineFollowLogDO(lineInfo.getPartnerId(), lineInfo.getId(), operateUserId, operateUsername, lineInfo.getWorkflowStage(), lineInfo.getWorkflowSubStage(), lineInfo.getWorkflowSubStageStatus(), message);
LineFollowLogDO followLog = new LineFollowLogDO(lineInfo.getPartnerId(), lineInfo.getId(), operateUserId, operateUsername, lineInfo.getWorkflowStage(), lineInfo.getWorkflowSubStage(), lineInfo.getWorkflowSubStageStatus(), message,type);
lineFollowLogMapper.insertSelective(followLog);
return followLog.getId();
}
public Long addFollowLogByShop(ShopInfoDO shopInfoDO, String operateUserId, String operateUsername, String message,Integer type){
if(Objects.isNull(shopInfoDO)){
return null;
}
LineFollowLogDO followLog = new LineFollowLogDO(shopInfoDO.getPartnerId(), shopInfoDO.getId(), operateUserId, operateUsername,null,null,null, message,type);
lineFollowLogMapper.insertSelective(followLog);
return followLog.getId();
}

View File

@@ -15,6 +15,7 @@ import com.cool.store.request.PartnerRequest;
import com.cool.store.request.PointLinePageRequest;
import com.cool.store.request.PublicLineListRequest;
import com.cool.store.utils.RandomEightCharCodeUtils;
import com.cool.store.vo.LineVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Maps;
@@ -26,6 +27,7 @@ import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -198,4 +200,8 @@ public class LineInfoDAO {
}
return lineInfoMapper.batchUpdateInvestmentManager(lineIds, status, investmentManager,regionId);
}
public List<LineVO> getLines(String keyword){
return lineInfoMapper.getLinesByKeyword(keyword);
}
}

View File

@@ -12,5 +12,5 @@ public interface LineFollowLogMapper extends Mapper<LineFollowLogDO> {
* @param lineId
* @return
*/
Page<LineFollowLogDO> getFollowLogPage(@Param("lineId")Long lineId);
Page<LineFollowLogDO> getFollowLogPage(@Param("lineId")Long lineId,@Param("type")Integer type);
}

View File

@@ -8,6 +8,7 @@ import com.cool.store.request.LineListRequest;
import com.cool.store.request.PartnerRequest;
import com.cool.store.request.PointLinePageRequest;
import com.cool.store.request.PublicLineListRequest;
import com.cool.store.vo.LineVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
@@ -125,4 +126,6 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
Integer batchUpdateInvestmentManager(@Param("lineIds") List<Long> lineIds,
@Param("status") Integer status,
@Param("investmentManager") String investmentManager, @Param("regionId") Long regionId);
List<LineVO> getLinesByKeyword(@Param("keyword") String keyword);
}

View File

@@ -14,14 +14,15 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="type" jdbcType="TINYINT" property="type"/>
</resultMap>
<select id="getFollowLogPage" resultMap="BaseResultMap">
select
id, partner_id, line_id, operate_user_id, operate_username, workflow_stage, workflow_sub_stage, workflow_sub_stage_status, message, create_time
id, partner_id, line_id, operate_user_id, operate_username, workflow_stage, workflow_sub_stage, workflow_sub_stage_status, message, create_time,type
from
xfsg_line_follow_log
where
line_id = #{lineId} and deleted = '0' order by create_time desc
line_id = #{lineId} and deleted = '0' and type = #{type} order by create_time desc
</select>
</mapper>

View File

@@ -588,6 +588,19 @@
#{lineId}
</foreach>
</select>
<select id="getLinesByKeyword" resultType="com.cool.store.vo.LineVO">
select
id as lineId,
username,
mobile
from xfsg_line_info
where workflow_sub_stage_status >= 45
<if test="keyword !=null and keyword != ''">
and (mobile like CONCAT('%', #{keyword} ,'%')
or username like CONCAT('%', #{keyword} ,'%'))
</if>
order by id desc
</select>
<update id="batchUpdateInvestmentManager">

View File

@@ -76,10 +76,13 @@ public class LineFollowLogDO {
*/
private Boolean deleted;
//1-线索日志2-门店日志
private Integer type;
public LineFollowLogDO() {
}
public LineFollowLogDO(String partnerId, Long lineId, String operateUserId, String operateUsername, Integer workflowStage, Integer workflowSubStage, Integer workflowSubStageStatus, String message) {
public LineFollowLogDO(String partnerId, Long lineId, String operateUserId, String operateUsername, Integer workflowStage, Integer workflowSubStage, Integer workflowSubStageStatus, String message,Integer type) {
this.partnerId = partnerId;
this.lineId = lineId;
this.operateUserId = operateUserId;
@@ -89,5 +92,6 @@ public class LineFollowLogDO {
this.workflowSubStageStatus = workflowSubStageStatus;
this.message = message;
this.createTime= new Date();
this.type=type;
}
}

View File

@@ -12,10 +12,12 @@ import lombok.Data;
@Data
public class LineFollowLogRequest {
@ApiModelProperty("线索id")
@ApiModelProperty("线索id/shopId")
private Long lineId;
@ApiModelProperty("日志")
private String message;
@ApiModelProperty("1-线索日志2-门店日志")
private Integer type = 1;
}

View File

@@ -0,0 +1,18 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: WangShuo
* @Date: 2025/01/07/下午2:49
* @Version 1.0
* @注释:
*/
@Data
public class LinesRequest {
@ApiModelProperty("姓名/手机号")
private String keyword;
private Integer pageSize = 10;
private Integer pageNum = 1;
}

View File

@@ -0,0 +1,20 @@
package com.cool.store.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: WangShuo
* @Date: 2025/01/07/下午2:31
* @Version 1.0
* @注释:
*/
@Data
public class LineVO {
private Long lineId;
@ApiModelProperty("加盟商名字")
private String username;
@ApiModelProperty("手机号")
private String mobile;
}

View File

@@ -19,7 +19,7 @@ public interface LineFollowService {
* @param pageSize
* @return
*/
PageInfo<LineFollowLogVO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize);
PageInfo<LineFollowLogVO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize,Integer type);
/**
* 新增跟进日志

View File

@@ -5,6 +5,8 @@ import com.cool.store.request.*;
import com.cool.store.vo.*;
import com.github.pagehelper.PageInfo;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2024/3/25 13:45
@@ -97,5 +99,7 @@ public interface LineService {
String getPayPicByLineId(Long lineId);
//增加查询资质审核的意向加盟商或正式加盟商搜索范围为全部
List<LineVO> getLines(LinesRequest request);
}

View File

@@ -2,9 +2,12 @@ package com.cool.store.service.impl;
import com.cool.store.dao.LineFollowLogDAO;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.dao.ShopInfoDAO;
import com.cool.store.entity.LineFollowLogDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.FollowLogTypeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.LineFollowLogRequest;
import com.cool.store.service.LineFollowService;
@@ -30,10 +33,12 @@ public class LineFollowServiceImpl implements LineFollowService {
private LineFollowLogDAO lineFollowLogDAO;
@Resource
private LineInfoDAO lineInfoDAO;
@Resource
private ShopInfoDAO shopInfoDAO;
@Override
public PageInfo<LineFollowLogVO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize) {
Page<LineFollowLogDO> followLogPage = lineFollowLogDAO.getFollowLogPage(lineId, pageNum, pageSize);
public PageInfo<LineFollowLogVO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize,Integer type) {
Page<LineFollowLogDO> followLogPage = lineFollowLogDAO.getFollowLogPage(lineId, pageNum, pageSize,type);
PageInfo resultPage = new PageInfo(followLogPage);
List<LineFollowLogVO> resultList = LineFollowLogVO.convertList(followLogPage);
resultPage.setList(resultList);
@@ -42,10 +47,21 @@ public class LineFollowServiceImpl implements LineFollowService {
@Override
public Long addFollowLog(LineFollowLogRequest followLog, String operateUserId, String operateUsername) {
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(followLog.getLineId());
if(Objects.isNull(lineInfo)){
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
if (followLog.getType().equals(FollowLogTypeEnum.LINE.getCode())){
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(followLog.getLineId());
if(Objects.isNull(lineInfo)){
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
return lineFollowLogDAO.addFollowLog(lineInfo, operateUserId, operateUsername, followLog.getMessage(),followLog.getType());
}
return lineFollowLogDAO.addFollowLog(lineInfo, operateUserId, operateUsername, followLog.getMessage());
if (followLog.getType().equals(FollowLogTypeEnum.SHOP.getCode())){
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(followLog.getLineId());
if (Objects.isNull(shopInfo)){
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
}
return lineFollowLogDAO.addFollowLogByShop(shopInfo,operateUserId,operateUsername, followLog.getMessage(),followLog.getType());
}
return null;
}
}

View File

@@ -497,6 +497,12 @@ public class LineServiceImpl implements LineService {
return regionQrcodeConfigDao.getPayPicByRegionId(bigRegionId);
}
@Override
public List<LineVO> getLines(LinesRequest request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
return lineInfoDAO.getLines(request.getKeyword());
}
/**
* 计算预期时间
* @param startTime

View File

@@ -9,6 +9,7 @@ import com.cool.store.vo.log.LineFollowLogVO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.boot.context.properties.bind.DefaultValue;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -29,8 +30,8 @@ public class LineFollowController {
@ApiOperation("跟进日志分页")
@GetMapping("/page")
public ResponseResult<PageInfo<LineFollowLogVO>> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize){
return ResponseResult.success(lineFollowService.getFollowLogPage(lineId, pageNum, pageSize));
public ResponseResult<PageInfo<LineFollowLogVO>> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize, @RequestParam(value = "type",defaultValue = "1") Integer type){
return ResponseResult.success(lineFollowService.getFollowLogPage(lineId, pageNum, pageSize,type));
}
@ApiOperation("新增跟进日志")

View File

@@ -172,5 +172,9 @@ public class LineInfoController {
return ResponseResult.success(linePayService.skipPay(lineId,CurrentUserHolder.getUser()));
}
@ApiOperation("查询加盟商")
@PostMapping("/getLines")
public ResponseResult<List<LineVO>> getLines(@RequestBody LinesRequest request) {
return ResponseResult.success(lineService.getLines(request));
}
}

View File

@@ -1,10 +1,12 @@
package com.cool.store.controller.webc;
import com.cool.store.request.LinesRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.LinePayService;
import com.cool.store.service.LineService;
import com.cool.store.vo.IntendProcessTotalVO;
import com.cool.store.vo.LineInfoVO;
import com.cool.store.vo.LineVO;
import com.cool.store.vo.interview.AppointmentTimeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -12,10 +14,7 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDate;

View File

@@ -83,5 +83,5 @@ aliyun.sms.accessKeyId=LTAI5tAVZ3r9UtSpLGcmGoQn
aliyun.sms.accessKeySecret=WIMjO4BjVg3YAHwmplq86yOyS2HMpa
aliyun.sms.signName=酷店掌
mybatis.configuration.variables.enterpriseId=28c20a7b42b94171acb1ab3f631d69e1
mybatis.configuration.variables.enterpriseId=5558ce7a3aa84e3590392fcaa8697ffb
enterprise.dingCorpId=ding0006ae30cf81071ea1320dcb25e91351