新增接口
This commit is contained in:
@@ -4,6 +4,7 @@ import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
|
||||
import com.cool.store.dto.point.LineCountDTO;
|
||||
import com.cool.store.entity.PointInfoDO;
|
||||
import com.cool.store.mapper.PointInfoMapper;
|
||||
import com.cool.store.request.AllPointPageRequest;
|
||||
import com.cool.store.request.PointPageRequest;
|
||||
import com.cool.store.request.RecommendPointPageRequest;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
@@ -90,4 +91,9 @@ public class PointInfoDAO {
|
||||
}
|
||||
return pointInfoMapper.updateSelectedDevelopmentManager(lineId, developmentManager);
|
||||
}
|
||||
|
||||
public Page<PointInfoDO> getTeamPointPage(AllPointPageRequest request) {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
return pointInfoMapper.getTeamPointPage(request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.point.LineCountDTO;
|
||||
import com.cool.store.entity.PointInfoDO;
|
||||
import com.cool.store.request.AllPointPageRequest;
|
||||
import com.cool.store.request.PointPageRequest;
|
||||
import com.cool.store.request.RecommendPointPageRequest;
|
||||
import com.cool.store.vo.point.PointHomePageDataVO;
|
||||
@@ -57,4 +58,11 @@ public interface PointInfoMapper extends Mapper<PointInfoDO> {
|
||||
* @return
|
||||
*/
|
||||
Integer updateSelectedDevelopmentManager(@Param("lineId") Long lineId, @Param("developmentManager")String developmentManager);
|
||||
|
||||
/**
|
||||
* 获取团队铺位
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
Page<PointInfoDO> getTeamPointPage(@Param("request") AllPointPageRequest request);
|
||||
}
|
||||
@@ -84,6 +84,8 @@ public interface RegionMapper {
|
||||
*/
|
||||
List<String> getSubIdsByRegionIds( @Param("regionPaths")List<String> regionPaths);
|
||||
|
||||
List<String> getSubRegionIdsByRegionIds( @Param("regionIds")List<String> regionIds);
|
||||
|
||||
List<String> getSubIdsByRegionpaths( @Param("regionPaths")List<String> regionPaths);
|
||||
|
||||
List<String> getRegionPathByRegionIds( @Param("regionIds")List<String> regionIds);
|
||||
|
||||
@@ -88,6 +88,12 @@
|
||||
<if test="request.createEndTime != null and request.createEndTime != ''">
|
||||
<![CDATA[and create_time <= #{request.createEndTime}]]>
|
||||
</if>
|
||||
<if test="request.regionIds != null and request.regionIds.size() > 0">
|
||||
and region_id in
|
||||
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getSelectedShopNum" resultType="com.cool.store.dto.point.LineCountDTO">
|
||||
select
|
||||
@@ -131,4 +137,52 @@
|
||||
line_id = #{lineId} and select_status = '1' and deleted = 0
|
||||
</update>
|
||||
|
||||
<select id="getTeamPointPage" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
point_name,
|
||||
point_code,
|
||||
address,
|
||||
region_id,
|
||||
point_status,
|
||||
point_score,
|
||||
point_area,
|
||||
development_manager,
|
||||
operate_user_id,
|
||||
development_time,
|
||||
select_status,
|
||||
create_time,
|
||||
update_time
|
||||
from
|
||||
xfsg_point_info
|
||||
where deleted = 0 and point_status in (4,5,6,7)
|
||||
<if test="request.keyword != null and request.keyword != ''">
|
||||
and (point_code like concat('%', #{request.keyword}, '%') or point_name like concat('%', #{request.keyword}, '%'))
|
||||
</if>
|
||||
<if test="request.developmentManager != null and request.developmentManager != ''">
|
||||
and development_manager = #{request.developmentManager}
|
||||
</if>
|
||||
<if test="request.pointStatus != null and request.pointStatus != ''">
|
||||
and point_status = #{request.pointStatus}
|
||||
</if>
|
||||
<if test="request.createStartTime != null and request.createStartTime != ''">
|
||||
and create_time >= #{request.createStartTime}
|
||||
</if>
|
||||
<if test="request.createEndTime != null and request.createEndTime != ''">
|
||||
<![CDATA[and create_time <= #{request.createEndTime}]]>
|
||||
</if>
|
||||
<if test="request.regionIds != null and request.regionIds.size() > 0">
|
||||
and region_id in
|
||||
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
|
||||
and region_id in
|
||||
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -274,6 +274,17 @@
|
||||
<foreach collection="regionPaths" separator=" or " open="(" close=")" item="region" > region_path like concat(#{region}, "%")</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getSubRegionIdsByRegionIds" resultType="string">
|
||||
select
|
||||
id
|
||||
from
|
||||
region_${enterpriseId}
|
||||
where
|
||||
deleted = 0
|
||||
and
|
||||
<foreach collection="regionIds" separator=" or " open="(" close=")" item="region" > region_path like concat("%", #{region}, "%")</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getSubIdsByRegionpaths" resultType="string">
|
||||
select
|
||||
id
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import com.cool.store.common.PageBasicInfo;
|
||||
import com.cool.store.enums.point.PointStatusEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: PointPageRequest
|
||||
* @Description:
|
||||
* @date 2024-04-08 10:28
|
||||
*/
|
||||
@Data
|
||||
public class AllPointPageRequest extends PageBasicInfo {
|
||||
|
||||
@ApiModelProperty("铺位名称或编号")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("选择区域")
|
||||
private List<String> regionIds;
|
||||
|
||||
@ApiModelProperty(value = "拓展专员")
|
||||
private String developmentManager;
|
||||
|
||||
@ApiModelProperty("1.采集中、2.已评估、3.待审核、5.已审核、6.已签约、7.已失效")
|
||||
private Integer pointStatus;
|
||||
|
||||
@ApiModelProperty("创建时间-开始")
|
||||
private String createStartTime;
|
||||
|
||||
@ApiModelProperty("创建时间-结束")
|
||||
private String createEndTime;
|
||||
|
||||
@ApiModelProperty(value = "当前登录用户", hidden = true)
|
||||
private String curUserId;
|
||||
|
||||
@ApiModelProperty(value = "管辖区域",hidden = true)
|
||||
private List<String> authRegionIds;
|
||||
|
||||
}
|
||||
@@ -23,6 +23,9 @@ public class PointPageRequest extends PageBasicInfo {
|
||||
@ApiModelProperty("铺位名称或编号")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("选择区域")
|
||||
private List<String> regionIds;
|
||||
|
||||
@ApiModelProperty("营运人员")
|
||||
private String operateUserId;
|
||||
|
||||
|
||||
@@ -14,6 +14,9 @@ public class PointDetailVO {
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long pointId;
|
||||
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("铺位名称")
|
||||
private String pointName;
|
||||
|
||||
@@ -231,6 +234,7 @@ public class PointDetailVO {
|
||||
public static PointDetailVO convertVO(PointInfoDO pointInfo, PointDetailInfoDO pointDetailInfo) {
|
||||
PointDetailVO result = new PointDetailVO();
|
||||
result.setPointId(pointInfo.getId());
|
||||
result.setShopId(pointInfo.getShopId());
|
||||
result.setPointName(pointInfo.getPointName());
|
||||
result.setPointCode(pointInfo.getPointCode());
|
||||
result.setLongitude(pointInfo.getLongitude());
|
||||
|
||||
@@ -137,6 +137,13 @@ public interface PointService {
|
||||
*/
|
||||
PageInfo<PointPageVO> getMyPointPage(PointPageRequest request);
|
||||
|
||||
/**
|
||||
* 获取团队铺位
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PointPageVO> getTeamPointPage(AllPointPageRequest request);
|
||||
|
||||
/**
|
||||
* 获取审批记录
|
||||
* @param pointId
|
||||
|
||||
@@ -33,4 +33,11 @@ public interface RegionService {
|
||||
|
||||
List<RegionDO> listByThirdRegionType(Long parentId, String thirdRegionType);
|
||||
|
||||
/**
|
||||
* 获取当前区域regionId 和所有子区域regionId
|
||||
* @param regionIds
|
||||
* @return
|
||||
*/
|
||||
List<String> getSubRegionIdsByRegionIds(List<String> regionIds);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,13 @@ public interface UserAuthMappingService {
|
||||
*/
|
||||
List<UserAuthMappingDO> listUserAuthMappingByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 获取用户授权的所有区域id
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<String> getAuthRegionIdAndSubRegionIdByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 提供 根据职位 意向区域 查 对应人的接口 同时返回人名字
|
||||
* @param userRoleEnum
|
||||
|
||||
@@ -10,10 +10,7 @@ import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.service.LabelService;
|
||||
import com.cool.store.service.RegionService;
|
||||
import com.cool.store.service.PointService;
|
||||
import com.cool.store.service.UserAuthMappingService;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.AuditInfoVO;
|
||||
@@ -80,6 +77,8 @@ public class PointServiceImpl implements PointService {
|
||||
private ShopRentInfoDAO shopRentInfoDAO;
|
||||
@Resource
|
||||
private LineAuditInfoDAO lineAuditInfoDAO;
|
||||
@Resource
|
||||
private SysRoleService sysRoleService;
|
||||
@Value("${mybatis.configuration.variables.enterpriseId}")
|
||||
private String enterpriseId;
|
||||
|
||||
@@ -416,6 +415,13 @@ public class PointServiceImpl implements PointService {
|
||||
|
||||
@Override
|
||||
public PageInfo<PointPageVO> getMyPointPage(PointPageRequest request) {
|
||||
if(CollectionUtils.isNotEmpty(request.getRegionIds())){
|
||||
if(request.getRegionIds().contains(CommonConstants.ROOT_DEPT_ID_STR)){
|
||||
request.setRegionIds(null);
|
||||
}else{
|
||||
request.setRegionIds(regionService.getSubRegionIdsByRegionIds(request.getRegionIds()));
|
||||
}
|
||||
}
|
||||
List<PointPageVO> resultList = new ArrayList();
|
||||
Page<PointInfoDO> pointPage = pointInfoDAO.getMyPointPage(request);
|
||||
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
|
||||
@@ -430,6 +436,32 @@ public class PointServiceImpl implements PointService {
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PointPageVO> getTeamPointPage(AllPointPageRequest request){
|
||||
if(!sysRoleService.checkIsAdmin(request.getCurUserId())){
|
||||
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(request.getCurUserId()));
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(request.getRegionIds())){
|
||||
if(request.getRegionIds().contains(CommonConstants.ROOT_DEPT_ID_STR)){
|
||||
request.setRegionIds(null);
|
||||
}else{
|
||||
request.setRegionIds(regionService.getSubRegionIdsByRegionIds(request.getRegionIds()));
|
||||
}
|
||||
}
|
||||
List<PointPageVO> resultList = new ArrayList();
|
||||
Page<PointInfoDO> pointPage = pointInfoDAO.getTeamPointPage(request);
|
||||
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
|
||||
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||
resultList = PointPageVO.convertVO(pointPage.getResult(), userNameMap, regionNameMap);
|
||||
}
|
||||
PageInfo resultPage = new PageInfo(pointPage);
|
||||
resultPage.setList(resultList);
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PointAuditRecordVO> getPointAllAuditRecord(Long pointId) {
|
||||
List<PointAuditRecordDO> auditRecordList = pointAuditRecordDAO.getPointAllAuditRecord(pointId);
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.cool.store.utils.RedisConstantUtil;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import com.cool.store.vo.RegionPathNameVO;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -148,4 +149,16 @@ public class RegionServiceImpl implements RegionService {
|
||||
}
|
||||
return regionDao.listByThirdRegionType(parentId, thirdRegionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSubRegionIdsByRegionIds(List<String> regionIds) {
|
||||
if(CollectionUtils.isEmpty(regionIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<String> subRegionIds = regionMapper.getSubRegionIdsByRegionIds(regionIds);
|
||||
if(CollectionUtils.isNotEmpty(subRegionIds)){
|
||||
regionIds.addAll(subRegionIds);
|
||||
}
|
||||
return regionIds;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,20 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
|
||||
return userAuthMappingMapper.listUserAuthMappingByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAuthRegionIdAndSubRegionIdByUserId(String userId){
|
||||
List<UserAuthMappingDO> userAuthMapping = listUserAuthMappingByUserId(userId);
|
||||
if(CollectionUtils.isEmpty(userAuthMapping)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<String> regionIds = userAuthMapping.stream().map(UserAuthMappingDO::getMappingId).collect(Collectors.toList());
|
||||
List<String> subRegionIds = regionMapper.getSubRegionIdsByRegionIds(regionIds);
|
||||
if(CollectionUtils.isNotEmpty(subRegionIds)){
|
||||
regionIds.addAll(subRegionIds);
|
||||
}
|
||||
return regionIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供 根据职位 意向区域 查 对应人的接口 同时返回人名字
|
||||
* @param userRoleEnum
|
||||
|
||||
@@ -134,6 +134,13 @@ public class PointController {
|
||||
return ResponseResult.success(pointService.getMyPointPage(request));
|
||||
}
|
||||
|
||||
@ApiOperation("全部铺位")
|
||||
@PostMapping("/getTeamPointPage")
|
||||
public ResponseResult<PageInfo<PointPageVO>> getTeamPointPage(@RequestBody @Validated AllPointPageRequest request) {
|
||||
request.setCurUserId(CurrentUserHolder.getUserId());
|
||||
return ResponseResult.success(pointService.getTeamPointPage(request));
|
||||
}
|
||||
|
||||
@ApiOperation("获取单个铺位审批记录")
|
||||
@GetMapping("/getAuditRecord")
|
||||
public ResponseResult<List<PointAuditRecordVO>> getPointAllAuditRecord(@RequestParam("pointId")Long pointId) {
|
||||
|
||||
Reference in New Issue
Block a user