私海列表 逻辑修改
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.SuperAdminConfigDO;
|
||||
import com.cool.store.mapper.SuperAdminConfigMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/11/9 14:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class SuperAdminConfigDAO {
|
||||
|
||||
@Resource
|
||||
SuperAdminConfigMapper superAdminConfigMapper;
|
||||
|
||||
public SuperAdminConfigDO selectByPrimaryKey(Long id){
|
||||
if (id==null){
|
||||
return null;
|
||||
}
|
||||
return superAdminConfigMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
|
||||
public SuperAdminConfigDO isSuperAdmin(String userId){
|
||||
return superAdminConfigMapper.isSuperAdmin(userId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.SuperAdminConfigDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-11-09 02:24
|
||||
*/
|
||||
public interface SuperAdminConfigMapper {
|
||||
|
||||
SuperAdminConfigDO selectByPrimaryKey(Long id);
|
||||
|
||||
SuperAdminConfigDO isSuperAdmin(@Param("userId") String userId);
|
||||
}
|
||||
@@ -598,11 +598,6 @@
|
||||
<if test="storeKeyword!=null and storeKeyword!='' and storeKeywordType!=null and storeKeywordType=='partnerMobile'">
|
||||
AND hpuinfo.recommend_partner_mobile like concat('%',#{storeKeyword},'%')
|
||||
</if>
|
||||
<if test="userIdList!=null and userIdList.size>0 and developmentManagerList!=null and developmentManagerList.size==0">
|
||||
<foreach collection="userIdList" item="userId" open="and hpli.investment_manager in (" close=")" separator=",">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userPortraitIdList!=null and userPortraitIdList.size>0 and userPortraitQueryType!=null and userPortraitQueryType=='contains'">
|
||||
<foreach collection="userPortraitIdList" separator="or" open="and (" close=")" item="userPortraitId">
|
||||
bi.user_portrait like concat("%,", #{userPortraitId}, ",%")
|
||||
@@ -630,6 +625,11 @@
|
||||
<if test="userChannelQueryType!=null and userChannelQueryType == 'blank' ">
|
||||
AND hpuinfo.user_channel_id is null
|
||||
</if>
|
||||
<if test="userIdList!=null and userIdList.size>0 and developmentManagerList!=null and developmentManagerList.size==0">
|
||||
<foreach collection="userIdList" item="userId" open="and hpli.investment_manager in (" close=")" separator=",">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userIdList!=null and userIdList.size==0 and developmentManagerList!=null and developmentManagerList.size>0">
|
||||
<foreach collection="developmentManagerList" item="developmentManager" open="and hpli.development_manager in (" close=")" separator=",">
|
||||
#{developmentManager}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.SuperAdminConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.SuperAdminConfigDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="super_admin_user_id" jdbcType="VARCHAR" property="superAdminUserId" />
|
||||
<result column="deleted" jdbcType="TINYINT" property="deleted" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, super_admin_user_id, deleted, create_time, update_time, create_user_id, update_user_id
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List"></include>
|
||||
from super_admin_config where
|
||||
id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
<select id="isSuperAdmin" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List"></include>
|
||||
from super_admin_config
|
||||
where deleted = 0 and super_admin_user_id = #{userId} limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -29,7 +29,7 @@
|
||||
<!-- targetPackage:mapper接口生成的位置 -->
|
||||
<javaClientGenerator targetPackage="com.cool.store.mapper" targetProject="coolstore-partner-dao/src/main/java" type="XMLMAPPER" />
|
||||
|
||||
<table tableName="${table.name}" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
|
||||
<table tableName="super_admin_config" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
|
||||
enableSelectByExample="false" selectByExampleQueryId="false">
|
||||
<generatedKey column="id" sqlStatement="Mysql" identity="true" type=""/>
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-11-09 02:24
|
||||
*/
|
||||
@Table(name = "super_admin_config")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SuperAdminConfigDO implements Serializable {
|
||||
@ApiModelProperty("")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("超管用户ID")
|
||||
private String superAdminUserId;
|
||||
|
||||
@ApiModelProperty("删除标志 0-正常 1-删除")
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("新建人ID")
|
||||
private String createUserId;
|
||||
|
||||
@ApiModelProperty("更新人ID")
|
||||
private String updateUserId;
|
||||
}
|
||||
@@ -33,6 +33,7 @@ public interface EnterpriseUserService {
|
||||
|
||||
|
||||
|
||||
|
||||
List<EnterpriseUserSingleInfoVO> getDevelopmentDirectorList(String wantShopArea);
|
||||
|
||||
/**
|
||||
|
||||
@@ -98,6 +98,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
HyFollowTaskDAO hyFollowTaskDAO;
|
||||
@Resource
|
||||
private HyPartnerIntentInfoDAO hyPartnerIntentInfoDAO;
|
||||
@Resource
|
||||
SuperAdminConfigDAO superAdminConfigDAO;
|
||||
|
||||
@Autowired
|
||||
private WechatMiniAppService wechatMiniAppService;
|
||||
@@ -633,8 +635,16 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
public PageInfo<PrivateSeaLineListVo> privateSeaLineList(String userId, PrivateSeaLineListRequest request,Boolean allPrivateSeaFlag) {
|
||||
//allPrivateSeaFlag 为true的时候 查询全量私海
|
||||
UserPositionAndUserScopeDTO userIdsByScope = new UserPositionAndUserScopeDTO();
|
||||
if (!allPrivateSeaFlag){
|
||||
userIdsByScope = enterpriseUserService.getUserIdsByScope(userId);
|
||||
//如果是查询团队线索 判断是否是超管 不是超管 判断是是否是主管
|
||||
if (allPrivateSeaFlag){
|
||||
//如果不是超管 查询个人数据或者主管数据 如果是超管 查询所有数据
|
||||
if (!isSuperAdmin(userId)){
|
||||
userIdsByScope = enterpriseUserService.getUserIdsByScope(userId);
|
||||
}
|
||||
}else {
|
||||
//如果是查询我的线索 只需要查询招商经理或者开发经理是我的线索
|
||||
userIdsByScope.setDevelopmentUserIds(Arrays.asList(userId));
|
||||
userIdsByScope.setInvestmentUserIds(Arrays.asList(userId));
|
||||
}
|
||||
String intentAreaName = getIntentAreaName(request.getIntentAreaId());
|
||||
PageHelper.startPage(request.getPageNum(),request.getPageSize());
|
||||
@@ -671,6 +681,15 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
return privateLineList;
|
||||
}
|
||||
|
||||
private Boolean isSuperAdmin(String userId){
|
||||
SuperAdminConfigDO superAdmin = superAdminConfigDAO.isSuperAdmin(userId);
|
||||
if (superAdmin!=null){
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PartnerLineBaseInfoVO getPartnerLinBaseInfo(String partnerId) {
|
||||
PartnerLineBaseInfoVO lineBaseInfoVO = new PartnerLineBaseInfoVO();
|
||||
|
||||
Reference in New Issue
Block a user