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; ...@@ -3,6 +3,7 @@ package com.dsk.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.system.domain.customer.CustomerFollowRecord; import com.dsk.system.domain.customer.CustomerFollowRecord;
import com.dsk.system.domain.customer.dto.CustomerFollowRecordSearchDto; 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.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -18,7 +19,7 @@ import java.util.List; ...@@ -18,7 +19,7 @@ import java.util.List;
@Mapper @Mapper
public interface CustomerFollowRecordMapper extends BaseMapper<CustomerFollowRecord> { 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; ...@@ -3,6 +3,7 @@ package com.dsk.system.service;
import com.dsk.system.domain.customer.CustomerFollowRecord; import com.dsk.system.domain.customer.CustomerFollowRecord;
import com.dsk.system.domain.customer.dto.CustomerFollowRecordSearchDto; import com.dsk.system.domain.customer.dto.CustomerFollowRecordSearchDto;
import com.dsk.system.domain.customer.vo.CustomerFollowRecordListVo;
import java.util.List; import java.util.List;
...@@ -14,7 +15,7 @@ import java.util.List; ...@@ -14,7 +15,7 @@ import java.util.List;
*/ */
public interface ICustomerFollowRecordService { public interface ICustomerFollowRecordService {
List<CustomerFollowRecord> selectList(CustomerFollowRecordSearchDto dto); List<CustomerFollowRecordListVo> selectList(CustomerFollowRecordSearchDto dto);
boolean add(CustomerFollowRecord followRecord); boolean add(CustomerFollowRecord followRecord);
......
...@@ -7,6 +7,7 @@ import com.dsk.common.annotation.DataScope; ...@@ -7,6 +7,7 @@ import com.dsk.common.annotation.DataScope;
import com.dsk.common.utils.SecurityUtils; import com.dsk.common.utils.SecurityUtils;
import com.dsk.system.domain.customer.CustomerFollowRecord; import com.dsk.system.domain.customer.CustomerFollowRecord;
import com.dsk.system.domain.customer.dto.CustomerFollowRecordSearchDto; 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.mapper.CustomerFollowRecordMapper;
import com.dsk.system.service.ICustomerFollowRecordService; import com.dsk.system.service.ICustomerFollowRecordService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -30,19 +31,13 @@ public class CustomerFollowRecordServiceImpl implements ICustomerFollowRecordSer ...@@ -30,19 +31,13 @@ public class CustomerFollowRecordServiceImpl implements ICustomerFollowRecordSer
private CustomerFollowRecordMapper baseMapper; private CustomerFollowRecordMapper baseMapper;
@Override @Override
// @DataScope(deptAlias = "d",userAlias = "u") @DataScope(deptAlias = "d",userAlias = "u")
public List<CustomerFollowRecord> selectList(CustomerFollowRecordSearchDto dto) { public List<CustomerFollowRecordListVo> selectList(CustomerFollowRecordSearchDto dto) {
LambdaQueryWrapper<CustomerFollowRecord> wrapper = Wrappers.lambdaQuery(); if (ObjectUtils.isEmpty(dto.getCustomerId())) {
if (!ObjectUtils.isEmpty(dto.getCustomerId())) { dto.setUserId(SecurityUtils.getUserId());
wrapper.eq(CustomerFollowRecord::getCustomerId, dto.getCustomerId());
} else {
wrapper.eq(CustomerFollowRecord::getUserId, SecurityUtils.getUserId());
} }
wrapper.orderByDesc(CustomerFollowRecord::getCreateTime); // log.debug("dto.params.dataScope{}",dto.getParams().get("dataScope"));
return baseMapper.selectList(wrapper); return baseMapper.selectAuthList(dto);
// dto.setUserId(SecurityUtils.getUserId());
// return baseMapper.selectAuthList(dto);
} }
@Override @Override
......
...@@ -7,16 +7,20 @@ ...@@ -7,16 +7,20 @@
cfr.content, cfr.create_time cfr.content, cfr.create_time
</sql> </sql>
<select id="selectAuthList" resultType="com.dsk.system.domain.customer.CustomerFollowRecord"> <select id="selectAuthList" resultType="com.dsk.system.domain.customer.vo.CustomerFollowRecordListVo">
select select
<include refid="Base_Bean"></include> ct.company_name, u.nick_name,
<include refid="Base_Bean"></include>
from customer_follow_record cfr 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_user u on u.user_id = cfr.user_id
join sys_dept d on d.dept_id = u.dept_id left join sys_dept d on d.dept_id = u.dept_id
where cfr.user_id = #{dto.userId} <where>
<if test="dto.customerId != null and dto.customerId != '' "> and cfr.customer_id = #{dto.customerId} </if> <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>
${params.dataScope} <!-- 数据范围过滤 -->
<if test="dto.params.dataScope != null and dto.params.dataScope != '' "> ${dto.params.dataScope} </if>
</where>
order by cfr.create_time desc order by cfr.create_time desc
</select> </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