Commit b977e6ac authored by lcl's avatar lcl

字段补充

parent 9f02200d
package com.dsk.system.domain.customer.vo;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 客户跟进记录列表
*
* @author makejava
* @since 2023-05-18 15:07:59
*/
@Data
public class CustomerFollowRecordListVo implements Serializable {
private static final long serialVersionUID = -17639570424991398L;
private Long id;
/**
* 客户id
*/
private String customerId;
/**
* 客户名称
*/
private String companyName;
/**
* 用户id
*/
private Long userId;
/**
* 用户昵称
*/
private String nickName;
/**
* 拜访方式(visit_mode_type)
*/
private String visitMode;
/**
* 下次拜访时间
*/
private Date nextVisitTime;
/**
* 拜访对象姓名
*/
private String name;
/**
* 拜访对象职务
*/
private String position;
/**
* 拜访内容
*/
private String content;
@TableField(fill = FieldFill.INSERT)
private Date createTime;
}
......@@ -3,6 +3,7 @@ package com.dsk.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.system.domain.customer.CustomerFollowRecord;
import com.dsk.system.domain.customer.dto.CustomerFollowRecordSearchDto;
import com.dsk.system.domain.customer.vo.CustomerFollowRecordListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -18,7 +19,7 @@ import java.util.List;
@Mapper
public interface CustomerFollowRecordMapper extends BaseMapper<CustomerFollowRecord> {
List<CustomerFollowRecord> selectAuthList(@Param("dto") CustomerFollowRecordSearchDto dto);
List<CustomerFollowRecordListVo> selectAuthList(@Param("dto") CustomerFollowRecordSearchDto dto);
}
......@@ -3,6 +3,7 @@ package com.dsk.system.service;
import com.dsk.system.domain.customer.CustomerFollowRecord;
import com.dsk.system.domain.customer.dto.CustomerFollowRecordSearchDto;
import com.dsk.system.domain.customer.vo.CustomerFollowRecordListVo;
import java.util.List;
......@@ -14,7 +15,7 @@ import java.util.List;
*/
public interface ICustomerFollowRecordService {
List<CustomerFollowRecord> selectList(CustomerFollowRecordSearchDto dto);
List<CustomerFollowRecordListVo> selectList(CustomerFollowRecordSearchDto dto);
boolean add(CustomerFollowRecord followRecord);
......
......@@ -7,6 +7,7 @@ import com.dsk.common.annotation.DataScope;
import com.dsk.common.utils.SecurityUtils;
import com.dsk.system.domain.customer.CustomerFollowRecord;
import com.dsk.system.domain.customer.dto.CustomerFollowRecordSearchDto;
import com.dsk.system.domain.customer.vo.CustomerFollowRecordListVo;
import com.dsk.system.mapper.CustomerFollowRecordMapper;
import com.dsk.system.service.ICustomerFollowRecordService;
import lombok.extern.slf4j.Slf4j;
......@@ -30,19 +31,13 @@ public class CustomerFollowRecordServiceImpl implements ICustomerFollowRecordSer
private CustomerFollowRecordMapper baseMapper;
@Override
// @DataScope(deptAlias = "d",userAlias = "u")
public List<CustomerFollowRecord> selectList(CustomerFollowRecordSearchDto dto) {
LambdaQueryWrapper<CustomerFollowRecord> wrapper = Wrappers.lambdaQuery();
if (!ObjectUtils.isEmpty(dto.getCustomerId())) {
wrapper.eq(CustomerFollowRecord::getCustomerId, dto.getCustomerId());
} else {
wrapper.eq(CustomerFollowRecord::getUserId, SecurityUtils.getUserId());
@DataScope(deptAlias = "d",userAlias = "u")
public List<CustomerFollowRecordListVo> selectList(CustomerFollowRecordSearchDto dto) {
if (ObjectUtils.isEmpty(dto.getCustomerId())) {
dto.setUserId(SecurityUtils.getUserId());
}
wrapper.orderByDesc(CustomerFollowRecord::getCreateTime);
return baseMapper.selectList(wrapper);
// dto.setUserId(SecurityUtils.getUserId());
// return baseMapper.selectAuthList(dto);
// log.debug("dto.params.dataScope{}",dto.getParams().get("dataScope"));
return baseMapper.selectAuthList(dto);
}
@Override
......
......@@ -7,16 +7,20 @@
cfr.content, cfr.create_time
</sql>
<select id="selectAuthList" resultType="com.dsk.system.domain.customer.CustomerFollowRecord">
<select id="selectAuthList" resultType="com.dsk.system.domain.customer.vo.CustomerFollowRecordListVo">
select
<include refid="Base_Bean"></include>
ct.company_name, u.nick_name,
<include refid="Base_Bean"></include>
from customer_follow_record cfr
join customer ct on ct.customer_id = cfr.customer_id
join sys_user u on u.user_id = cfr.user_id
join sys_dept d on d.dept_id = u.dept_id
where cfr.user_id = #{dto.userId}
<if test="dto.customerId != null and dto.customerId != '' "> and cfr.customer_id = #{dto.customerId} </if>
<!-- 数据范围过滤 -->
${params.dataScope}
left join sys_dept d on d.dept_id = u.dept_id
<where>
<if test="dto.userId != null "> and cfr.user_id = #{dto.userId} </if>
<if test="dto.customerId != null and dto.customerId != '' "> and cfr.customer_id = #{dto.customerId} </if>
<!-- 数据范围过滤 -->
<if test="dto.params.dataScope != null and dto.params.dataScope != '' "> ${dto.params.dataScope} </if>
</where>
order by cfr.create_time desc
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment