分发员查询客户分发业务员

master
yqy 9 months ago
parent e07890a8e8
commit 6cb8a75157

@ -80,7 +80,10 @@ public class ClueDTO {
@Schema(title = "渠道类型渠道类型(1 手动创建 2文件上传 3飞鱼回传 4话单回传 5 api回传)")
private Integer channelType;
public ClueDTO(Long clueId, String originName, String nid, String remark, String otherClue, Long assignedBy, String assignedName, Long createBy, Boolean isNewClue, Long companyId, Integer sex, String customInformation, List<String> channelIdentifying, Integer channelType) {
@Schema(title = "客户ID")
private Long customId;
public ClueDTO(Long clueId, String originName, String nid, String remark, String otherClue, Long assignedBy, String assignedName, Long createBy, Boolean isNewClue, Long companyId, Integer sex, String customInformation, List<String> channelIdentifying, Integer channelType, Long customId) {
this.clueId = clueId;
this.originName = originName;
this.nid = nid;
@ -95,5 +98,6 @@ public class ClueDTO {
this.customInformation = customInformation;
this.channelIdentifying = channelIdentifying;
this.channelType = channelType;
this.customId = customId;
}
}

@ -87,4 +87,7 @@ public class ClueEntity extends LogicDeletedBaseEntity {
@Schema(title = "渠道类型渠道类型(1 手动创建 2文件上传 3飞鱼回传 4话单回传 5 api回传)")
private Integer channelType;
@Schema(title = "客户ID")
private Long customId;
}

@ -64,6 +64,7 @@ public interface ClueMapper extends ExtendMapper<ClueEntity> {
.likeIfPresent(ClueEntity::getClueLabelName, qo.getClueLabelName())
.eqIfPresent(ClueEntity::getAssignedBy, qo.getAssignedBy())
.eqIfPresent(ClueEntity::getCompanyId, qo.getCompanyId())
.eqIfPresent(ClueEntity::getCustomId, qo.getCustomId())
.inIfPresent(ClueEntity::getAssignedBy, (Object[]) qo.getSalesmanArray())
.orderByDesc(ClueEntity::getCreateTime);
if (StringUtils.isNotBlank(qo.getStartTime()) && StringUtils.isNotBlank(qo.getEndTime())) {
@ -80,4 +81,5 @@ public interface ClueMapper extends ExtendMapper<ClueEntity> {
List<HomePageDTO> distributorsAssignedClueByTime(@Param("qo") HomePageQo homePageQo);
List<Long> findCustomId(@Param("assignedBy") Long assignedBy, @Param("createBy")Long createBy);
}

@ -56,7 +56,8 @@ public interface CustomMapper extends ExtendMapper<CustomEntity> {
.eqIfPresent(CustomEntity::getType, qo.getType())
.eqIfPresent(CustomEntity::getDistributorId, qo.getDistributorId())
.gtIfPresent(CustomEntity::getEnrollStatus, qo.getGreaterStatus())
.eqIfPresent(CustomEntity::getEnrollStatus, qo.getEnrollStatus());
.eqIfPresent(CustomEntity::getEnrollStatus, qo.getEnrollStatus())
.inIfPresent(CustomEntity::getCustomId, qo.getCustomIds());
if (StringUtils.isNotBlank(qo.getDistributeStartTime()) && StringUtils.isNotBlank(qo.getDistributeEndTime())) {
wrapperX.between(CustomEntity::getDistributeTime, qo.getDistributeStartTime(), qo.getDistributeEndTime());
}

@ -34,8 +34,9 @@ public class ClueQo {
@Schema(title = "业务类型")
private Integer salesmanType;
@Schema(title = "业务员id")
private Long[] salesmanArray;
@Schema(title = "客户ID")
private Long customId;
}

@ -5,6 +5,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springdoc.api.annotations.ParameterObject;
import java.util.List;
@Data
@Schema(title = "客户查询对象")
@ParameterObject
@ -60,4 +62,10 @@ public class CustomQo {
@Schema(description = "审核类型 2初审 3复审")
private Integer type;
@Schema(title = "业务员ID")
private Long salesmanUserId;
@Schema(title = "客户ID集合")
private List<Long> customIds;
}

@ -58,4 +58,11 @@ public interface ClueService extends ExtendService<ClueEntity> {
* @return
*/
Boolean changeEffective(Long id, Integer effective);
/**
* ID
* @param assignedBy ID
* @param createBy
*/
List<Long> findCustomId(Long assignedBy, Long createBy);
}

@ -209,7 +209,6 @@ public class ClueServiceImpl extends ExtendServiceImpl<ClueMapper, ClueEntity> i
@Override
public List<ClueVO> queryList(ClueQo qo) {
// 扩展数据
if (qo.getNid() != null) {
qo.setNid(AESUtils.encrypt(qo.getNid(), securityProperties.getPasswordSecretKey()));
}
@ -234,4 +233,9 @@ public class ClueServiceImpl extends ExtendServiceImpl<ClueMapper, ClueEntity> i
return SqlHelper.retBool(this.baseMapper.update(null,wrapper));
}
@Override
public List<Long> findCustomId(Long assignedBy, Long createBy) {
return baseMapper.findCustomId(assignedBy, createBy);
}
}

@ -16,9 +16,11 @@ import com.baiye.modules.distribute.entity.CustomEntity;
import com.baiye.modules.distribute.entity.CustomStoreEntity;
import com.baiye.modules.distribute.entity.StoreEntity;
import com.baiye.modules.distribute.mapper.CustomMapper;
import com.baiye.modules.distribute.qo.ClueQo;
import com.baiye.modules.distribute.qo.CustomQo;
import com.baiye.modules.distribute.service.*;
import com.baiye.modules.distribute.vo.AddressDTO;
import com.baiye.modules.distribute.vo.ClueVO;
import com.baiye.modules.distribute.vo.CustomStoreVO;
import com.baiye.modules.distribute.vo.CustomVO;
import com.baiye.polling.QueueBalance;
@ -78,6 +80,10 @@ public class CustomServiceImpl extends ExtendServiceImpl<CustomMapper, CustomEnt
@Override
public PageResult<CustomVO> queryPage(PageParam pageParam, CustomQo qo) {
if (qo.getSalesmanType() == DefaultNumberConstants.TWO_NUMBER && qo.getSalesmanUserId() != null){
List<Long> customIdList = clueService.findCustomId(qo.getSalesmanUserId(), SecurityUtils.getCurrentUserId());
qo.setCustomIds(customIdList);
}
return baseMapper.queryPage(pageParam, qo);
}
@ -113,6 +119,13 @@ public class CustomServiceImpl extends ExtendServiceImpl<CustomMapper, CustomEnt
BeanUtils.copyProperties(customEntity, customVO);
if (CollUtil.isNotEmpty(customEntity.getSalesmanUserId())){
customVO.setSalesmanUserId(customEntity.getSalesmanUserId().stream().map(Long::parseLong).collect(Collectors.toList()));
ClueQo clueQo = new ClueQo();
clueQo.setCustomId(id);
List<ClueVO> clueVOS = clueService.queryList(clueQo);
if (CollUtil.isNotEmpty(clueVOS)){
customVO.setUserNameList(clueVOS.stream().map(ClueVO::getAssignedName).collect(Collectors.toList()));
}
}
List<CustomStoreVO> customStoreVOList = new ArrayList<>();
@ -176,7 +189,7 @@ public class CustomServiceImpl extends ExtendServiceImpl<CustomMapper, CustomEnt
if (Boolean.TRUE.equals(result)) {
ClueDTO clueDTO = new ClueDTO(clueId, customEntity.getChannelName(), phone, customEntity.getRemark(),
otherClue, entity.getUserId(), username, currentUserId, Boolean.TRUE, companyId, customEntity.getSex(),
customEntity.getCustomInformation(), customEntity.getChannelIdentifying(), customEntity.getChannelType());
customEntity.getCustomInformation(), customEntity.getChannelIdentifying(), customEntity.getChannelType(),dto.getCustomId());
list.add(clueDTO);
}
}
@ -193,7 +206,7 @@ public class CustomServiceImpl extends ExtendServiceImpl<CustomMapper, CustomEnt
Long clueId = IdUtil.getSnowflake(workerId, datacenterId).nextId();
ClueDTO clueDTO = new ClueDTO(clueId, customEntity.getChannelName(), phone, customEntity.getRemark(), null, userId,
username, currentUserId, Boolean.TRUE, companyId, customEntity.getSex(), customEntity.getCustomInformation(),
customEntity.getChannelIdentifying(), customEntity.getChannelType());
customEntity.getChannelIdentifying(), customEntity.getChannelType(), dto.getCustomId());
list.add(clueDTO);
}
}

@ -86,4 +86,7 @@ public class CustomVO {
@Schema(title = "业务员ID集合")
private List<Object> salesmanUserId;
@Schema(title = "业务员用户名")
private List<String> userNameList;
}

@ -5,7 +5,7 @@ spring:
application:
name: @artifactId@
profiles:
active: prod
active: dev
# 天爱图形验证码

@ -97,4 +97,12 @@
</if>
GROUP BY createTime
</select>
<select id="findCustomId" resultType="java.lang.Long">
SELECT custom_id
FROM tb_clue
where assigned_by = #{assignedBy}
and create_by = #{createBy}
group by custom_id
</select>
</mapper>

Loading…
Cancel
Save