This commit is contained in:
zhangchenbiao
2024-04-09 11:31:54 +08:00
parent b9aa62f758
commit e4de100cd6
37 changed files with 1323 additions and 59 deletions

View File

@@ -97,6 +97,11 @@ public class EnterpriseUserDAO {
return userList.stream().filter(o->!StringUtils.isAnyBlank(o.getMobile(), o.getName())).collect(Collectors.toMap(k -> k.getUserId(), Function.identity()));
}
public Map<String, EnterpriseUserDO> getUserInfoMap(List<String> userIds){
List<EnterpriseUserDO> userList = getUserInfoByUserIds(userIds);
return userList.stream().collect(Collectors.toMap(k -> k.getUserId(), Function.identity()));
}
public EnterpriseUserDO selectByMobile(String mobile) {
return enterpriseUserMapper.selectByMobile( mobile);
}

View File

@@ -167,4 +167,8 @@ public class HyOpenAreaInfoDAO {
return hyOpenAreaInfoMapper.updateByPrimaryKeySelective( hyOpenAreaInfoDO);
}
public Map<Long, HyOpenAreaInfoDO> getCityMap(List<Long> wantShopAreaIds) {
List<HyOpenAreaInfoDO> openAreaInfoList = selectByIds(wantShopAreaIds);
return openAreaInfoList.stream().collect(Collectors.toMap(k->k.getId(), v->v, (k1, k2)->k1));
}
}

View File

@@ -10,8 +10,11 @@ import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.request.LineListRequest;
import com.cool.store.request.PartnerRequest;
import com.cool.store.request.PointLinePageRequest;
import com.cool.store.request.PublicLineListRequest;
import com.cool.store.vo.PublicLineListVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@@ -128,8 +131,9 @@ public class LineInfoDAO {
lineInfoMapper.insertOrUpdate(lineInfoParam);
}
public List<LineInfoDO> getLineListByDevelopmentManager(String developmentManager) {
return Lists.newArrayList();
public Page<LineInfoDO> getLinePageByDevelopmentManager(PointLinePageRequest request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
return lineInfoMapper.getLinePageByDevelopmentManager(request);
}

View File

@@ -57,4 +57,11 @@ public class PointAuditRecordDAO {
}
return pointAuditRecordMapper.deletePointAuditRecord(pointId, cycleCount);
}
public List<PointAuditRecordDO> getPointAllAuditRecord(Long pointId) {
if(Objects.isNull(pointId)){
return Lists.newArrayList();
}
return pointAuditRecordMapper.getPointAllAuditRecord(pointId);
}
}

View File

@@ -1,11 +1,25 @@
package com.cool.store.dao;
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.PointPageRequest;
import com.cool.store.request.RecommendPointPageRequest;
import com.cool.store.utils.StringUtil;
import com.cool.store.vo.point.PointHomePageDataVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author zhangchenbiao
@@ -35,4 +49,45 @@ public class PointInfoDAO {
public Integer updatePointInfo(PointInfoDO shopPointInfo) {
return pointInfoMapper.updateByPrimaryKeySelective(shopPointInfo);
}
public PointHomePageDataVO getMyPointData(String userId) {
return pointInfoMapper.getMyPointData(userId);
}
/**
* 获取我的铺位
* @param request
* @return
*/
public Page<PointInfoDO> getMyPointPage(PointPageRequest request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
return pointInfoMapper.getMyPointPage(request);
}
public Map<Long, Integer> getSelectedShopNumMap(List<Long> lineIds) {
if(CollectionUtils.isEmpty(lineIds)){
return Maps.newHashMap();
}
List<LineCountDTO> selectedShopNum = pointInfoMapper.getSelectedShopNum(lineIds);
return selectedShopNum.stream().collect(Collectors.toMap(k->k.getLineId(), v->v.getSelectedShopNum()));
}
public List<PointInfoDO> getPointListByIds(List<Long> pointIds){
if(CollectionUtils.isEmpty(pointIds)){
return Lists.newArrayList();
}
return pointInfoMapper.getPointListByIds(pointIds);
}
public Page<PointInfoDO> getRecommendPointList(RecommendPointPageRequest request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
return pointInfoMapper.getRecommendPointList(request);
}
public Integer updateSelectedDevelopmentManager(Long lineId, String developmentManager) {
if(Objects.isNull(lineId) || StringUtils.isBlank(developmentManager)){
return null;
}
return pointInfoMapper.updateSelectedDevelopmentManager(lineId, developmentManager);
}
}

View File

@@ -1,12 +1,17 @@
package com.cool.store.dao;
import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.entity.PointRecommendDO;
import com.cool.store.enums.point.PointRecommendStatus;
import com.cool.store.mapper.PointRecommendMapper;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -22,6 +27,12 @@ public class PointRecommendDAO {
@Resource
private PointRecommendMapper pointRecommendMapper;
/**
* 更新推荐状态
* @param pointId
* @param status
* @return
*/
public Integer updateRecommendStatus(Long pointId, PointRecommendStatus status) {
if(Objects.isNull(status)){
return 0;
@@ -29,6 +40,13 @@ public class PointRecommendDAO {
return pointRecommendMapper.updateShopPointRecommendStatus(pointId, status.getCode());
}
/**
* 更新推荐状态
* @param pointId
* @param status
* @param statusList
* @return
*/
public Integer updateRecommendStatusByStatusAndPointId(Long pointId, PointRecommendStatus status, List<PointRecommendStatus> statusList) {
if(Objects.isNull(status) || CollectionUtils.isEmpty(statusList)){
return 0;
@@ -37,4 +55,41 @@ public class PointRecommendDAO {
return pointRecommendMapper.updateRecommendStatusByStatusAndPointId(pointId, status.getCode(), statusCodeList);
}
/**
* 获取已推门店数量
* @param lineIds
* @return
*/
public Map<Long, Integer> getPushShopNumMap(List<Long> lineIds) {
if(CollectionUtils.isEmpty(lineIds)){
return Maps.newHashMap();
}
List<LineCountDTO> pushShopNumMap = pointRecommendMapper.getPushShopNumMap(lineIds);
return pushShopNumMap.stream().collect(Collectors.toMap(k->k.getLineId(), v->v.getRecommendShopNum()));
}
/**
* 获取推荐列表
* @param lineId
* @return
*/
public List<PointRecommendDO> getRecommendPointList(Long lineId) {
if(Objects.isNull(lineId)){
return Lists.newArrayList();
}
return pointRecommendMapper.getRecommendPointList(lineId);
}
public Integer addRecommendPoint(List<PointRecommendDO> recommendList) {
return pointRecommendMapper.batchInsert(recommendList);
}
/**
* 删除未选择的推荐铺位
* @param lineId
* @return
*/
public Integer deleteUnselectedRecommendPointByLineId(Long lineId) {
return pointRecommendMapper.deleteUnselectedRecommendPointByLineId(lineId);
}
}

View File

@@ -5,7 +5,9 @@ import com.cool.store.entity.LineInfoDO;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.request.LineListRequest;
import com.cool.store.request.PartnerRequest;
import com.cool.store.request.PointLinePageRequest;
import com.cool.store.request.PublicLineListRequest;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
@@ -76,4 +78,11 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
Integer batchUpdateInterviewWorkflowStage(@Param("lineIds") List<Long> lineIds, @Param("workflowSubStage")Integer workflowSubStage, @Param("workflowSubStageStatus")Integer workflowSubStageStatus);
/**
* 选址人员获取蓄水池状态的加盟商
* @param request
* @return
*/
Page<LineInfoDO> getLinePageByDevelopmentManager(@Param("request") PointLinePageRequest request);
}

View File

@@ -31,4 +31,11 @@ public interface PointAuditRecordMapper extends Mapper<PointAuditRecordDO> {
* @return
*/
Integer deletePointAuditRecord(@Param("pointId") Long pointId, @Param("cycleCount") Integer cycleCount);
/**
* 获取点位所有的审批记录
* @param pointId
* @return
*/
List<PointAuditRecordDO> getPointAllAuditRecord(@Param("pointId") Long pointId);
}

View File

@@ -1,7 +1,60 @@
package com.cool.store.mapper;
import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.request.PointPageRequest;
import com.cool.store.request.RecommendPointPageRequest;
import com.cool.store.vo.point.PointHomePageDataVO;
import com.cool.store.vo.point.PointPageVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
import java.util.Map;
public interface PointInfoMapper extends Mapper<PointInfoDO> {
/**
* 获取我的数据
* @param userId
* @return
*/
PointHomePageDataVO getMyPointData(@Param("userId") String userId);
/**
* 获取我的铺位分页
* @param request
* @return
*/
Page<PointInfoDO> getMyPointPage(@Param("request") PointPageRequest request);
/**
* 获取线索选择门店数
* @param lineIds
* @return
*/
List<LineCountDTO> getSelectedShopNum(@Param("lineIds") List<Long> lineIds);
/**
* 获取铺位详情
* @param pointIds
* @return
*/
List<PointInfoDO> getPointListByIds(@Param("pointIds") List<Long> pointIds);
/**
* 获取推荐铺位分页
* @param request
* @return
*/
Page<PointInfoDO> getRecommendPointList(@Param("request") RecommendPointPageRequest request);
/**
* 更新铺位的拓展经理
* @param lineId
* @param developmentManager
* @return
*/
Integer updateSelectedDevelopmentManager(@Param("lineId") Long lineId, @Param("developmentManager")String developmentManager);
}

View File

@@ -1,10 +1,12 @@
package com.cool.store.mapper;
import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.entity.PointRecommendDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
import java.util.Map;
public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
@@ -23,4 +25,32 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
* @return
*/
Integer updateRecommendStatusByStatusAndPointId(@Param("pointId") Long pointId, @Param("status") Integer status, @Param("statusList") List<Integer> statusList);
/**
* 获取体检店铺数量
* @param lineIds
* @return
*/
List<LineCountDTO> getPushShopNumMap(@Param("lineIds") List<Long> lineIds);
/**
* 获取推荐列表
* @param lineId
* @return
*/
List<PointRecommendDO> getRecommendPointList(@Param("lineId") Long lineId);
/**
* 批量新增
* @param recommendList
* @return
*/
Integer batchInsert(@Param("recommendList") List<PointRecommendDO> recommendList);
/**
* 删除线索为推进的铺位
* @param lineId
* @return
*/
Integer deleteUnselectedRecommendPointByLineId(@Param("lineId") Long lineId);
}

View File

@@ -459,5 +459,12 @@
</foreach>
and workflow_sub_stage_status = 15 and workflow_sub_stage = 5
</update>
<select id="getLinePageByDevelopmentManager" resultMap="BaseResultMap">
select * from xfsg_line_info where deleted = 0 and development_manager = #{request.developmentManager} and join_status = 1
<if test="request.keyword != null and request.keyword!=''">
and (username like #{request.keyword} or mobile like #{request.keyword})
</if>
</select>
</mapper>

View File

@@ -121,6 +121,15 @@
</if>
order by node_no asc
</select>
<select id="getPointAllAuditRecord" resultMap="BaseResultMap">
select
id, point_id, node_no, cycle_count, action_remark, handler_user_id, handler_user_ids, receive_task_time, finish_task_time, audit_status, sign_time, sign_address, picture_url, reason
from
xfsg_point_audit_record
where
point_id = #{pointId} and deleted = 0
order by cycle_count asc, node_no asc
</select>
<update id="deletePointAuditRecord">
update xfsg_point_audit_record set deleted = 1 where point_id = #{pointId} and cycle_count = #{cycleCount} and audit_status = 0

View File

@@ -24,4 +24,96 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="allColumn">
id, point_code, point_name, region_id, shop_id, line_id, point_area, longitude, latitude, address, development_manager, operate_user_id, development_time, point_status, point_score, select_status, submit_audit_count, is_line_upload
</sql>
<select id="getMyPointData" resultType="com.cool.store.vo.point.PointHomePageDataVO">
select
sum(if(point_status != 7, 1, 0)) as myPoint,
sum(if(point_status in (4, 5, 6), 1, 0)) as poolPoint,
sum(if(point_status = 1, 1, 0)) as collectPoint,
sum(if(point_status = 2, 1, 0)) as evaluatePoint,
sum(if(point_status in (3, 4), 1, 0)) as waitAuditPoint,
sum(if(point_status = 7, 1, 0)) as signPoint
from xfsg_point_info
where deleted = 0 and development_manager = #{userId}
</select>
<select id="getMyPointPage" resultMap="BaseResultMap">
select
pi.id,
pi.point_name,
pi.point_code,
pi.region_id,
pi.point_status,
pi.point_score,
pi.point_area,
pi.development_manager,
pi.operate_user_id,
pi.development_time,
pi.select_status
from xfsg_point_info pi
where pi.deleted = 0 and pi.development_manager = #{request.developmentManager}
<if test="request.keyword != null and request.keyword != ''">
and (pi.point_code like concat('%', #{request.keyword}, '%') or pi.point_name like concat('%', #{request.keyword}, '%'))
</if>
<if test="request.developmentStartTime != null and request.developmentStartTime != ''">
and pi.development_time >= #{request.developmentStartTime}
</if>
<if test="request.developmentEndTime != null and request.developmentEndTime != ''">
<![CDATA[and pi.development_time <= #{request.developmentEndTime}]]>
</if>
<if test="request.pointStatus != null and request.pointStatus != ''">
and pi.point_status = #{request.pointStatus}
</if>
<if test="request.storageStatus != null and request.storageStatus == 1">
and pi.point_status in (4,5,6,7)
</if>
<if test="request.storageStatus != null and request.storageStatus == 2">
and pi.point_status in (1,2,3,7)
</if>
<if test="request.operateUserId != null and request.operateUserId != ''">
and pi.operate_user_id = #{request.operateUserId}
</if>
</select>
<select id="getSelectedShopNum" resultType="com.cool.store.dto.point.LineCountDTO">
select
line_id as lineId,
count(1) as selectedShopNum
from xfsg_point_info
where deleted = 0 and select_status = 1 and line_id in
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
#{lineId}
</foreach>
group by line_id
</select>
<select id="getPointListByIds" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from xfsg_point_info
where deleted = 0 and id in
<foreach collection="pointIds" item="pointId" index="index" open="(" separator="," close=")">
#{pointId}
</foreach>
</select>
<select id="getRecommendPointList" resultType="com.cool.store.entity.PointInfoDO">
select
<include refid="allColumn"/>
from xfsg_point_info
where deleted = 0 and point_status in (4,5) and development_manager = #{request.developmentManager}
<if test="request.pointStatus != null and request.pointStatus != ''">
and point_status = #{request.pointStatus}
</if>
</select>
<update id="updateSelectedDevelopmentManager">
update
xfsg_point_info
set
development_manager = #{developmentManager}
where
line_id = #{lineId} and select_status = '1' and deleted = 0
</update>
</mapper>

View File

@@ -12,14 +12,54 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<update id="updateShopPointRecommendStatus">
update xfsg_point_recommend set status = #{status} where point_id = #{pointId}
update xfsg_point_recommend set status = #{status} where point_id = #{pointId} and deleted = 0
</update>
<update id="updateRecommendStatusByStatusAndPointId">
update xfsg_point_recommend set status = #{status} where point_id = #{pointId} and status in
update xfsg_point_recommend set status = #{status} where point_id = #{pointId} and deleted = 0 and status in
<foreach collection="statusList" item="status" index="index" open="(" separator="," close=")">
#{status}
</foreach>
</update>
<select id="getPushShopNumMap" resultType="com.cool.store.dto.point.LineCountDTO">
select
line_id as lineId,
count(1) as recommendShopNum
from
xfsg_point_recommend
where
deleted = 0 and line_id in
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
#{lineId}
</foreach>
group by line_id
</select>
<select id="getRecommendPointList" resultMap="BaseResultMap">
select
id,
point_id as pointId,
line_id as lineId,
development_manager as developmentManager,
status,
reason
from
xfsg_point_recommend
where
line_id = #{lineId} and deleted = 0
</select>
<insert id="batchInsert">
<foreach collection="recommendList" item="item" index="index" separator=";">
insert into xfsg_point_recommend (line_id, point_id, development_manager, status)
values (#{item.lineId}, #{item.pointId}, #{item.developmentManager}, #{item.status})
</foreach>
</insert>
<update id="deleteUnselectedRecommendPointByLineId">
update xfsg_point_recommend set deleted = 1 where line_id = #{lineId} and deleted = 0 and status in (0,2)
</update>
</mapper>