fix
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/04/02/16:44
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public enum OpTypeEnum {
|
||||
//操作类型: 1(新增), 2(更新), 3(删除)
|
||||
INSERT(1, "新增"),
|
||||
UPDATE(2, "更新"),
|
||||
DELETE(3, "删除");
|
||||
|
||||
private Integer code;
|
||||
private String name;
|
||||
|
||||
OpTypeEnum(Integer code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.dao;
|
||||
|
||||
import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.MiniShopDTO;
|
||||
import com.cool.store.dto.point.LineCountDTO;
|
||||
import com.cool.store.entity.PointInfoDO;
|
||||
import com.cool.store.mapper.PointInfoMapper;
|
||||
@@ -18,6 +19,7 @@ import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -120,12 +122,26 @@ public class PointInfoDAO {
|
||||
return pointInfoMapper.recyclePoint(pointId);
|
||||
}
|
||||
|
||||
public List<MiniPointPageVO> getMiniPointPage(MiniPointPageRequest request ) {
|
||||
List<MiniPointPageVO> pointInfoDOPage = pointInfoMapper.MiniPointPageVO(request);
|
||||
public List<MiniPointPageVO> getMiniPointPage(String eid,MiniPointPageRequest request ) {
|
||||
List<MiniPointPageVO> pointInfoDOPage = pointInfoMapper.MiniPointPageVO(eid,request);
|
||||
if(CollectionUtils.isEmpty(pointInfoDOPage)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
return pointInfoDOPage ;
|
||||
}
|
||||
|
||||
public List<MiniPointPageVO> getPointByOpportunityPointCode(String code){
|
||||
if (StringUtils.isBlank(code)){
|
||||
return null;
|
||||
}
|
||||
return pointInfoMapper.getPointByOpportunityPointCode(code);
|
||||
}
|
||||
|
||||
public List<MiniShopDTO> getShopByOpportunityPointCode(String eid,String code){
|
||||
if (StringUtils.isBlank(code)){
|
||||
return null;
|
||||
}
|
||||
return pointInfoMapper.getShopByOpportunityPointCode(eid,code);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.MiniShopDTO;
|
||||
import com.cool.store.dto.point.LineCountDTO;
|
||||
import com.cool.store.entity.PointInfoDO;
|
||||
import com.cool.store.request.AllPointPageRequest;
|
||||
@@ -96,5 +97,19 @@ public interface PointInfoMapper extends Mapper<PointInfoDO> {
|
||||
* @Date: 2025/3/31
|
||||
* @description:获取铺位部分数据
|
||||
*/
|
||||
List<MiniPointPageVO> MiniPointPageVO(@Param("request") MiniPointPageRequest request);
|
||||
List<MiniPointPageVO> MiniPointPageVO(@Param("enterpriseId") String enterpriseId , @Param("request") MiniPointPageRequest request);
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/4/2
|
||||
* @description:根据机会点code获取铺位信息
|
||||
*/
|
||||
List<MiniPointPageVO> getPointByOpportunityPointCode(@Param("code") String code);
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/4/2
|
||||
* @description:根据机会点code获取门店信息
|
||||
*/
|
||||
List<MiniShopDTO> getShopByOpportunityPointCode(@Param("enterpriseId") String enterpriseId, @Param("code") String code);
|
||||
}
|
||||
@@ -238,15 +238,43 @@
|
||||
c.picture_obj as pictureObj,
|
||||
a.point_area as pointArea,
|
||||
c.landlord_mobile as landlordMobile,
|
||||
c.month_rent as monthRent
|
||||
c.month_rent as monthRent,
|
||||
d.store_name as openShopName
|
||||
from xfsg_point_info a
|
||||
left join xfsg_point_recommend b on a.id = b.point_id
|
||||
left JOIN xfsg_shop_info b ON a.shop_id = b.id
|
||||
LEFT JOIN xfsg_point_detail_info c on a.id = c.point_id
|
||||
left JOIN store_${enterpriseId} d ON b.shop_code = d.store_num
|
||||
<if test="request.areaCode!=null and request!=''">
|
||||
and (a.province_code = #{request.areaCode} or a.city_code = #{request.areaCode} or a.district_code =
|
||||
#{request.areaCode})
|
||||
</if>
|
||||
</select>
|
||||
<select id="getPointByOpportunityPointCode" resultType="com.cool.store.vo.point.MiniPointPageVO">
|
||||
select a.id as pointId,
|
||||
a.point_name as pointName,
|
||||
a.point_code as pointCode,
|
||||
a.longitude as longitude,
|
||||
a.latitude as latitude,
|
||||
a.address as address,
|
||||
a.create_time as createTime,
|
||||
a.opportunity_point_code as opportunityPointCode,
|
||||
a.opportunity_point_name as opportunityPointName,
|
||||
c.picture_obj as pictureObj,
|
||||
a.point_area as pointArea,
|
||||
c.landlord_mobile as landlordMobile,
|
||||
c.month_rent as monthRent
|
||||
from xfsg_point_info a
|
||||
LEFT JOIN xfsg_point_detail_info c on a.id = c.point_id
|
||||
where a.opportunity_point_code = #{code}
|
||||
</select>
|
||||
<select id="getShopByOpportunityPointCode" resultType="com.cool.store.dto.MiniShopDTO">
|
||||
select c.shop_name as shopName,
|
||||
c.store_address as address
|
||||
from xfsg_point_info a
|
||||
inner join xfsg_shop b on a.shop_id = b.id
|
||||
inner join store_${enterpriseId} c on b.shop_code = c.store_num
|
||||
where a.opportunity_point_code = #{code}
|
||||
</select>
|
||||
|
||||
<update id="recyclePoint">
|
||||
update xfsg_point_info set line_id = null, shop_id = null, select_status = 0, update_time = now(), point_status
|
||||
|
||||
@@ -1,207 +1,211 @@
|
||||
<?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.PointRecommendMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointRecommendDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId" />
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
||||
<result column="point_id" jdbcType="BIGINT" property="pointId" />
|
||||
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager" />
|
||||
<result column="status" jdbcType="TINYINT" property="status" />
|
||||
<result column="reason" jdbcType="VARCHAR" property="reason" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointRecommendDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId"/>
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
|
||||
<result column="point_id" jdbcType="BIGINT" property="pointId"/>
|
||||
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager"/>
|
||||
<result column="status" jdbcType="TINYINT" property="status"/>
|
||||
<result column="reason" jdbcType="VARCHAR" property="reason"/>
|
||||
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="allColumn">
|
||||
id, line_id,shop_id, point_id, development_manager, status, reason, deleted, create_time, update_time
|
||||
</sql>
|
||||
<sql id="allColumn">
|
||||
id, line_id,shop_id, point_id, development_manager, status, reason, deleted, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<update id="updateShopPointRecommendStatus">
|
||||
update xfsg_point_recommend set status = #{status} where point_id = #{pointId} and deleted = 0
|
||||
<if test="excludeStatus != null and excludeStatus.size()>0">
|
||||
and status not in
|
||||
<foreach collection="excludeStatus" separator="," open="(" close=")" item="status">
|
||||
#{status}
|
||||
</foreach>
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateShopPointRecommendStatus">
|
||||
update xfsg_point_recommend set status = #{status} where point_id = #{pointId} and deleted = 0
|
||||
<if test="excludeStatus != null and excludeStatus.size()>0">
|
||||
and status not in
|
||||
<foreach collection="excludeStatus" separator="," open="(" close=")" item="status">
|
||||
#{status}
|
||||
</foreach>
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="updateRecommendStatusByStatusAndPointId">
|
||||
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>
|
||||
<update id="updateRecommendStatusByStatusAndPointId">
|
||||
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="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="getShopPushPointNumMap" resultType="com.cool.store.dto.point.ShopCountDTO">
|
||||
select
|
||||
shop_id as shopId,
|
||||
count(1) as recommendShopNum
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
deleted = 0 and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
group by shop_id
|
||||
</select>
|
||||
<select id="getShopPushPointNumMap" resultType="com.cool.store.dto.point.ShopCountDTO">
|
||||
select
|
||||
shop_id as shopId,
|
||||
count(1) as recommendShopNum
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
deleted = 0 and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
group by shop_id
|
||||
</select>
|
||||
|
||||
<select id="getRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
point_id,
|
||||
line_id,
|
||||
development_manager,
|
||||
status,
|
||||
reason
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
line_id = #{lineId} and deleted = 0
|
||||
</select>
|
||||
<select id="getRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
point_id,
|
||||
line_id,
|
||||
development_manager,
|
||||
status,
|
||||
reason
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
line_id = #{lineId} and deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getShopRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
point_id,
|
||||
line_id,
|
||||
development_manager,
|
||||
status,
|
||||
reason
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
shop_id = #{shopId} and deleted = 0
|
||||
</select>
|
||||
<select id="getShopRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
point_id,
|
||||
line_id,
|
||||
development_manager,
|
||||
status,
|
||||
reason
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
shop_id = #{shopId} and deleted = 0
|
||||
</select>
|
||||
|
||||
<insert id="batchInsert">
|
||||
<foreach collection="recommendList" item="item" index="index" separator=";">
|
||||
insert into xfsg_point_recommend (shop_id, point_id, development_manager, status)
|
||||
values (#{item.shopId}, #{item.pointId}, #{item.developmentManager}, #{item.status})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert">
|
||||
<foreach collection="recommendList" item="item" index="index" separator=";">
|
||||
insert into xfsg_point_recommend (shop_id, point_id, development_manager, status)
|
||||
values (#{item.shopId}, #{item.pointId}, #{item.developmentManager}, #{item.status})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="turnLineUpdateRecommendStatus">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
deleted = if(status = 1, 1, deleted),
|
||||
development_manager = if(status in (2,4), #{developmentManager}, development_manager)
|
||||
where
|
||||
shop_id = #{shopId}
|
||||
</update>
|
||||
<update id="turnLineUpdateRecommendStatus">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
deleted = if(status = 1, 1, deleted),
|
||||
development_manager = if(status in (2,4), #{developmentManager}, development_manager)
|
||||
where
|
||||
shop_id = #{shopId}
|
||||
</update>
|
||||
|
||||
<select id="getLineRecommendPointPage" resultType="com.cool.store.dto.point.MiniPointPageDTO">
|
||||
select
|
||||
p.id as pointId,
|
||||
pr.line_id as lineId,
|
||||
p.point_name as pointName,
|
||||
p.point_code as pointCode,
|
||||
p.region_id as regionId,
|
||||
p.longitude as longitude,
|
||||
p.latitude as latitude,
|
||||
p.address as address,
|
||||
p.point_score as pointScore,
|
||||
p.point_area as pointArea,
|
||||
p.point_status as pointStatus,
|
||||
p.select_status as selectStatus,
|
||||
p.create_time as createTime,
|
||||
p.opportunity_point_code as opportunityPointCode,
|
||||
p.opportunity_point_name as opportunityPointName,
|
||||
c.picture_obj as pictureObj,
|
||||
pr.status as recommendStatus
|
||||
from
|
||||
xfsg_point_recommend pr
|
||||
<select id="getLineRecommendPointPage" resultType="com.cool.store.dto.point.MiniPointPageDTO">
|
||||
select
|
||||
p.id as pointId,
|
||||
pr.line_id as lineId,
|
||||
p.point_name as pointName,
|
||||
p.point_code as pointCode,
|
||||
p.region_id as regionId,
|
||||
p.longitude as longitude,
|
||||
p.latitude as latitude,
|
||||
p.address as address,
|
||||
p.point_score as pointScore,
|
||||
p.point_area as pointArea,
|
||||
p.point_status as pointStatus,
|
||||
p.select_status as selectStatus,
|
||||
p.create_time as createTime,
|
||||
p.opportunity_point_code as opportunityPointCode,
|
||||
p.opportunity_point_name as opportunityPointName,
|
||||
c.picture_obj as pictureObj,
|
||||
pr.status as recommendStatus,
|
||||
e.store_name as shopName
|
||||
from
|
||||
xfsg_point_recommend pr
|
||||
inner join xfsg_point_info p on p.id = pr.point_id
|
||||
left join xfsg_point_detail_info c on p.id = c.point_id
|
||||
where
|
||||
p.deleted = 0 and pr.shop_id = #{request.shopId} and pr.deleted = 0
|
||||
<if test="request.status != null and request.status == 1">
|
||||
and pr.status = 1 and p.select_status = 0
|
||||
</if>
|
||||
<if test="request.status != null and request.status == 2">
|
||||
and pr.status = 2 and p.select_status = 1 and p.shop_id = #{request.shopId}
|
||||
</if>
|
||||
<if test="request.status != null and request.status == 3">
|
||||
and pr.status in (5, 6)
|
||||
</if>
|
||||
<if test="request.areaCode!=null and request.areaCode !=''">
|
||||
and (p.province_code = #{request.areaCode} or p.city_code = #{request.areaCode} or p.district_code = #{request.areaCode})
|
||||
</if>
|
||||
left JOIN xfsg_shop_info d ON c.shop_id = d.id
|
||||
left JOIN store_${enterpriseId} e ON d.shop_code = e.store_num
|
||||
where
|
||||
p.deleted = 0 and pr.shop_id = #{request.shopId} and pr.deleted = 0
|
||||
<if test="request.status != null and request.status == 1">
|
||||
and pr.status = 1 and p.select_status = 0
|
||||
</if>
|
||||
<if test="request.status != null and request.status == 2">
|
||||
and pr.status = 2 and p.select_status = 1 and p.shop_id = #{request.shopId}
|
||||
</if>
|
||||
<if test="request.status != null and request.status == 3">
|
||||
and pr.status in (5, 6)
|
||||
</if>
|
||||
<if test="request.areaCode!=null and request.areaCode !=''">
|
||||
and (p.province_code = #{request.areaCode} or p.city_code = #{request.areaCode} or p.district_code =
|
||||
#{request.areaCode})
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</select>
|
||||
|
||||
<update id="updateStatusByPointIdAndLineId">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
status = if(shop_id = #{shopId}, 2, 3)
|
||||
where point_id = #{pointId} and deleted = 0 and status = 1
|
||||
</update>
|
||||
<update id="updateStatusByPointIdAndLineId">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
status = if(shop_id = #{shopId}, 2, 3)
|
||||
where point_id = #{pointId} and deleted = 0 and status = 1
|
||||
</update>
|
||||
|
||||
<update id="rejectPoint">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
status = 5,
|
||||
reason = #{reason}
|
||||
where point_id = #{pointId} and shop_id = #{shopId} and deleted = 0 and status = 1
|
||||
</update>
|
||||
|
||||
<select id="getRecommendPointListByPointId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
point_id = #{pointId} and deleted = 0
|
||||
</select>
|
||||
<update id="rejectPoint">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
status = 5,
|
||||
reason = #{reason}
|
||||
where point_id = #{pointId} and shop_id = #{shopId} and deleted = 0 and status = 1
|
||||
</update>
|
||||
|
||||
<select id="getAllRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_point_recommend
|
||||
<where>
|
||||
and (shop_id = 0 or shop_id is null)
|
||||
<if test="lineId!=null">
|
||||
and line_id = #{lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getRecommendPointListByPointId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
point_id = #{pointId} and deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="getAllRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_point_recommend
|
||||
<where>
|
||||
and (shop_id = 0 or shop_id is null)
|
||||
<if test="lineId!=null">
|
||||
and line_id = #{lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="batchUpdateShopId">
|
||||
update xfsg_point_recommend
|
||||
set
|
||||
shop_id = case id
|
||||
<foreach collection="recommendList" item="item" index="index" >
|
||||
when #{item.id} then #{item.shopId}
|
||||
</foreach>
|
||||
end
|
||||
where
|
||||
id in
|
||||
<foreach collection="recommendList" item="entity" open="(" separator="," close=")">
|
||||
#{entity.id}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="batchUpdateShopId">
|
||||
update xfsg_point_recommend
|
||||
set
|
||||
shop_id = case id
|
||||
<foreach collection="recommendList" item="item" index="index">
|
||||
when #{item.id} then #{item.shopId}
|
||||
</foreach>
|
||||
end
|
||||
where
|
||||
id in
|
||||
<foreach collection="recommendList" item="entity" open="(" separator="," close=")">
|
||||
#{entity.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.cool.store.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/04/02/18:20
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class MiniShopDTO {
|
||||
|
||||
@ApiModelProperty("门店名称")
|
||||
private String shopName;
|
||||
@ApiModelProperty("地址")
|
||||
private String address;
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.cool.store.dto.point;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class MiniPointPageDTO {
|
||||
|
||||
@@ -38,4 +40,13 @@ public class MiniPointPageDTO {
|
||||
|
||||
@ApiModelProperty("1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效")
|
||||
private Integer recommendStatus;
|
||||
|
||||
@ApiModelProperty("机会点编号")
|
||||
private String opportunityPointCode;
|
||||
|
||||
@ApiModelProperty("机会点名称")
|
||||
private String opportunityPointName;
|
||||
|
||||
@ApiModelProperty("成功开店店名称")
|
||||
private String openShopName;
|
||||
}
|
||||
@@ -227,6 +227,24 @@ public class AddPointDetailRequest {
|
||||
@ApiModelProperty("人流测算 1.>400人/时以上, 2.300~400人/时, 3.200~300人/时, 4.100~200人/时")
|
||||
private Integer flowRateCalculate;
|
||||
|
||||
@ApiModelProperty("机会点编号")
|
||||
private String opportunityPointCode;
|
||||
|
||||
@ApiModelProperty("机会点名称")
|
||||
private String opportunityPointName;
|
||||
|
||||
@ApiModelProperty("省编码")
|
||||
private String provinceCode;
|
||||
|
||||
@ApiModelProperty("市编码")
|
||||
private String cityCode;
|
||||
|
||||
@ApiModelProperty("区/县编码")
|
||||
private String districtCode;
|
||||
|
||||
@ApiModelProperty("铺位经纬度geohash")
|
||||
@NotBlank(message = "铺位经纬度geohash不能为空")
|
||||
private String location;
|
||||
|
||||
public static PointDetailInfoDO convertDO(AddPointDetailRequest request) {
|
||||
PointDetailInfoDO result = new PointDetailInfoDO();
|
||||
@@ -280,6 +298,11 @@ public class AddPointDetailRequest {
|
||||
|
||||
public static PointInfoDO convertPointDO(AddPointDetailRequest request) {
|
||||
PointInfoDO result = new PointInfoDO();
|
||||
result.setOpportunityPointName(request.getOpportunityPointName());
|
||||
result.setOpportunityPointCode(request.getOpportunityPointCode());
|
||||
result.setProvinceCode(request.getProvinceCode());
|
||||
result.setCityCode(request.getCityCode());
|
||||
result.setDistrictCode(request.getDistrictCode());
|
||||
result.setPointName(request.getPointName());
|
||||
result.setRegionId(request.getRegionId());
|
||||
result.setPointArea(request.getPointArea());
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
@@ -22,6 +23,10 @@ public class AddSignFranchiseRequest {
|
||||
private String shopName;
|
||||
|
||||
private String detailAddress;
|
||||
|
||||
@ApiModelProperty("店铺编码")
|
||||
@NotBlank(message = "shopCode不能为空")
|
||||
private String shopCode;
|
||||
/**
|
||||
* SignTypeEnum
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.cool.store.entity.MemberQuestionDO;
|
||||
import com.cool.store.entity.QualificationsInfoDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@@ -90,6 +91,8 @@ public class JoinIntentionRequest {
|
||||
private String businessLicense;
|
||||
@ApiModelProperty("统一社会信用代码")
|
||||
private String unifiedSocialCreditCode;
|
||||
@ApiModelProperty("督导")
|
||||
private String supervisor;
|
||||
|
||||
public LineInfoDO toLineInfoDO() {
|
||||
LineInfoDO lineInfoDO = new LineInfoDO();
|
||||
@@ -100,6 +103,9 @@ public class JoinIntentionRequest {
|
||||
lineInfoDO.setSex(String.valueOf(this.sex));
|
||||
lineInfoDO.setWantShopAreaId(Long.valueOf(this.areaCode));
|
||||
lineInfoDO.setId(this.lineId);
|
||||
if (StringUtils.isNotBlank(this.supervisor)) {
|
||||
lineInfoDO.setInvestmentManager(this.supervisor);
|
||||
}
|
||||
return lineInfoDO;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,9 @@ public class MiniAddPointRequest {
|
||||
@ApiModelProperty("区/县编码")
|
||||
private String districtCode;
|
||||
|
||||
@ApiModelProperty("铺位经纬度geohash")
|
||||
private String location;
|
||||
|
||||
public static PointDetailInfoDO convertDO(MiniAddPointRequest request) {
|
||||
PointDetailInfoDO result = new PointDetailInfoDO();
|
||||
result.setBusinessStatus(request.getBusinessStatus());
|
||||
|
||||
@@ -72,6 +72,11 @@ public class UpdatePointDetailRequest extends AddPointDetailRequest {
|
||||
|
||||
public static PointInfoDO convertPointDO(UpdatePointDetailRequest request) {
|
||||
PointInfoDO result = new PointInfoDO();
|
||||
result.setOpportunityPointName(request.getOpportunityPointName());
|
||||
result.setOpportunityPointCode(request.getOpportunityPointCode());
|
||||
result.setProvinceCode(request.getProvinceCode());
|
||||
result.setCityCode(request.getCityCode());
|
||||
result.setDistrictCode(request.getDistrictCode());
|
||||
result.setId(request.getPointId());
|
||||
result.setPointName(request.getPointName());
|
||||
result.setRegionId(request.getRegionId());
|
||||
|
||||
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -13,8 +14,8 @@ import javax.validation.constraints.NotBlank;
|
||||
@Data
|
||||
public class BerthOperationRequest {
|
||||
@ApiModelProperty(" 操作类型: 1(新增), 2(更新), 3(删除)")
|
||||
@NotBlank(message = "操作类型不能为空")
|
||||
private String opType;
|
||||
@NotNull(message = "操作类型不能为空")
|
||||
private Integer opType;
|
||||
|
||||
@ApiModelProperty("机会点编号")
|
||||
@NotBlank(message = "机会点编号不能为空")
|
||||
@@ -33,7 +34,7 @@ public class BerthOperationRequest {
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("铺位ID")
|
||||
@NotBlank(message = "铺位ID不能为空")
|
||||
@NotNull(message = "铺位ID不能为空")
|
||||
private Integer berthId;
|
||||
|
||||
@ApiModelProperty("铺位名称")
|
||||
|
||||
@@ -66,6 +66,9 @@ public class MiniPointPageVO {
|
||||
@ApiModelProperty("纬度")
|
||||
private String latitude;
|
||||
|
||||
@ApiModelProperty("成功开店店名称")
|
||||
private String openShopName;
|
||||
|
||||
public static List<MiniPointPageVO> convertVO(List<MiniPointPageDTO> pointList, Map<Long, String> regionNameMap) {
|
||||
if(CollectionUtils.isEmpty(pointList)){
|
||||
return Lists.newArrayList();
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.MiniShopDTO;
|
||||
import com.cool.store.vo.point.MiniPointPageVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/04/02/18:17
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public interface OpportunityPointService {
|
||||
|
||||
List<MiniPointPageVO> getPointByOpportunityPointCode(String code);
|
||||
|
||||
List<MiniShopDTO> getShopByOpportunityPointCode(String code);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.vo.LinePointBaseInfoVO;
|
||||
import com.cool.store.vo.point.*;
|
||||
@@ -23,7 +24,7 @@ public interface PointService {
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, String userId);
|
||||
Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, LoginUserInfo user);
|
||||
|
||||
|
||||
/**
|
||||
@@ -38,7 +39,7 @@ public interface PointService {
|
||||
* @param shopPointDetailRequest
|
||||
* @return
|
||||
*/
|
||||
Long updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest);
|
||||
Long updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest,LoginUserInfo user);
|
||||
|
||||
/**
|
||||
* 生成铺位评估报告
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.PointInfoDAO;
|
||||
import com.cool.store.dto.MiniShopDTO;
|
||||
import com.cool.store.entity.PointInfoDO;
|
||||
import com.cool.store.service.OpportunityPointService;
|
||||
import com.cool.store.vo.point.MiniPointPageVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/04/02/18:17
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Service
|
||||
public class OpportunityPointServiceImpl implements OpportunityPointService {
|
||||
|
||||
@Autowired
|
||||
private PointInfoDAO pointInfoDAO;
|
||||
@Value("${mybatis.configuration.variables.enterpriseId}")
|
||||
private String enterpriseId;
|
||||
@Override
|
||||
public List<MiniPointPageVO> getPointByOpportunityPointCode(String code) {
|
||||
return pointInfoDAO.getPointByOpportunityPointCode(code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MiniShopDTO> getShopByOpportunityPointCode(String code) {
|
||||
return pointInfoDAO.getShopByOpportunityPointCode(enterpriseId,code);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.point.AuditNodeDTO;
|
||||
import com.cool.store.dto.point.MiniPointPageDTO;
|
||||
@@ -12,6 +13,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.request.oppty.BerthOperationRequest;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
@@ -52,6 +54,8 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class PointServiceImpl implements PointService {
|
||||
|
||||
@Resource
|
||||
private ThirdOpportunityService thirdOpportunityService;
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
@@ -98,7 +102,8 @@ public class PointServiceImpl implements PointService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, String userId) {
|
||||
public Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, LoginUserInfo user) {
|
||||
String userId = user.getUserId();
|
||||
PointInfoDO pointInfo = AddPointDetailRequest.convertPointDO(shopPointDetailRequest);
|
||||
pointInfo.setPointCode(generateCode());
|
||||
pointInfo.setDevelopmentManager(userId);
|
||||
@@ -107,6 +112,18 @@ public class PointServiceImpl implements PointService {
|
||||
PointDetailInfoDO shopPoint = AddPointDetailRequest.convertDO(shopPointDetailRequest);
|
||||
shopPoint.setPointId(pointId);
|
||||
pointDetailInfoDAO.addPointDetailInfo(shopPoint);
|
||||
//推送铺位至三方平台
|
||||
BerthOperationRequest request1 = new BerthOperationRequest();
|
||||
request1.setOpType(OpTypeEnum.INSERT.getCode());
|
||||
request1.setCode(shopPointDetailRequest.getOpportunityPointCode());
|
||||
request1.setUserId(userId);
|
||||
request1.setMobile(user.getMobile());
|
||||
request1.setUserName(user.getName());
|
||||
request1.setBerthId(Math.toIntExact(pointId));
|
||||
request1.setName(pointInfo.getPointName());
|
||||
request1.setAddress(pointInfo.getAddress());
|
||||
request1.setLocation(shopPointDetailRequest.getLocation());
|
||||
thirdOpportunityService.berthOperation(request1);
|
||||
return pointId;
|
||||
}
|
||||
|
||||
@@ -140,7 +157,7 @@ public class PointServiceImpl implements PointService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest) {
|
||||
public Long updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest, LoginUserInfo user) {
|
||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(shopPointDetailRequest.getPointId());
|
||||
if (Objects.isNull(pointInfo)) {
|
||||
log.error("铺位基本信息不存在");
|
||||
@@ -151,6 +168,25 @@ public class PointServiceImpl implements PointService {
|
||||
shopPointInfo.setPointScore(shopPoint.getTotalPointScore());
|
||||
pointInfoDAO.perfectPointInfo(shopPointInfo);
|
||||
pointDetailInfoDAO.updatePartFieldPointDetail(shopPoint);
|
||||
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(pointInfo.getLineId());
|
||||
//推送铺位至三方平台
|
||||
BerthOperationRequest request1 = new BerthOperationRequest();
|
||||
request1.setCode(shopPointDetailRequest.getOpportunityPointCode());
|
||||
if (pointInfo.getPointSource().equals(PointSourceEnum.POINT_SOURCE_1.getCode())) {
|
||||
request1.setUserId(user.getUserId());
|
||||
request1.setMobile(user.getMobile());
|
||||
request1.setUserName(user.getName());
|
||||
}else{
|
||||
request1.setUserId(lineInfoDO.getPartnerId());
|
||||
request1.setMobile(lineInfoDO.getMobile());
|
||||
request1.setUserName(lineInfoDO.getUsername());
|
||||
}
|
||||
request1.setOpType(OpTypeEnum.UPDATE.getCode());
|
||||
request1.setBerthId(Math.toIntExact(shopPointInfo.getId()));
|
||||
request1.setName(shopPointInfo.getPointName());
|
||||
request1.setAddress(shopPointInfo.getAddress());
|
||||
request1.setLocation(shopPointDetailRequest.getLocation());
|
||||
thirdOpportunityService.berthOperation(request1);
|
||||
return shopPointDetailRequest.getPointId();
|
||||
}
|
||||
|
||||
@@ -731,6 +767,7 @@ public class PointServiceImpl implements PointService {
|
||||
|
||||
@Override
|
||||
public PageInfo<MiniPointPageVO> getLineRecommendPointPage(MiniPointPageRequest request) {
|
||||
//todo
|
||||
if (Objects.equals(request.getType(), PointListType.POINT_LIST_TYPE_1.getCode())) {
|
||||
Page<MiniPointPageDTO> pointPage = pointRecommendDAO.getLineRecommendPointPage(request);
|
||||
List<MiniPointPageVO> resultList = new ArrayList<>();
|
||||
@@ -742,7 +779,7 @@ public class PointServiceImpl implements PointService {
|
||||
List<PointDetailInfoDO> pointDetailList = pointDetailInfoDAO.getByPointIdList(pointList);
|
||||
Map<Long, PointDetailInfoDO> map = pointDetailList.stream().collect(Collectors.toMap(PointDetailInfoDO::getPointId, Function.identity()));
|
||||
resultList.forEach(x -> {
|
||||
PointDetailInfoDO pointDetailInfoDO = map.getOrDefault(x.getPointId(),new PointDetailInfoDO());
|
||||
PointDetailInfoDO pointDetailInfoDO = map.getOrDefault(x.getPointId(), new PointDetailInfoDO());
|
||||
x.setMonthRent(pointDetailInfoDO.getMonthRent());
|
||||
x.setLandlordMobile(pointDetailInfoDO.getLandlordMobile());
|
||||
});
|
||||
@@ -751,9 +788,9 @@ public class PointServiceImpl implements PointService {
|
||||
resultPage.setList(resultList);
|
||||
return resultPage;
|
||||
}
|
||||
if (request.getType().equals(PointListType.POINT_LIST_TYPE_2.getCode())){
|
||||
if (request.getType().equals(PointListType.POINT_LIST_TYPE_2.getCode())) {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<MiniPointPageVO> miniPointPage = pointInfoDAO.getMiniPointPage(request);
|
||||
List<MiniPointPageVO> miniPointPage = pointInfoDAO.getMiniPointPage(enterpriseId,request);
|
||||
return new PageInfo<>(miniPointPage);
|
||||
}
|
||||
return new PageInfo<>();
|
||||
@@ -885,6 +922,18 @@ public class PointServiceImpl implements PointService {
|
||||
updatePoint.setId(pointId);
|
||||
updatePoint.setShopId(shopInfo.getId());
|
||||
pointInfoDAO.updatePointInfo(updatePoint);
|
||||
//推送铺位至三方平台
|
||||
BerthOperationRequest request1 = new BerthOperationRequest();
|
||||
request1.setOpType(OpTypeEnum.INSERT.getCode());
|
||||
request1.setCode(request.getOpportunityPointCode());
|
||||
request1.setUserId(lineInfo.getPartnerId());
|
||||
request1.setMobile(lineInfo.getMobile());
|
||||
request1.setUserName(lineInfo.getUsername());
|
||||
request1.setBerthId(Math.toIntExact(pointId));
|
||||
request1.setName(pointInfo.getPointName());
|
||||
request1.setAddress(pointInfo.getAddress());
|
||||
request1.setLocation(request.getLocation());
|
||||
thirdOpportunityService.berthOperation(request1);
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("partnerUsername", lineInfo.getUsername());
|
||||
map.put("partnerMobile", lineInfo.getMobile());
|
||||
|
||||
@@ -205,6 +205,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
shopInfoDO.setRegionId(request.getRegionId());
|
||||
shopInfoDO.setShopName(request.getShopName());
|
||||
shopInfoDO.setDetailAddress(request.getDetailAddress());
|
||||
shopInfoDO.setShopCode(request.getShopCode());
|
||||
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
|
||||
|
||||
return new ResponseResult(200000, "提交成功");
|
||||
|
||||
@@ -39,7 +39,7 @@ public class PointController {
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<Long> addPointDetailInfo(@RequestBody @Validated AddPointDetailRequest shopPointDetailRequest) {
|
||||
log.info("新增铺位:{}", JSONObject.toJSONString(shopPointDetailRequest));
|
||||
return ResponseResult.success(pointService.addPointDetailInfo(shopPointDetailRequest, CurrentUserHolder.getUserId()));
|
||||
return ResponseResult.success(pointService.addPointDetailInfo(shopPointDetailRequest, CurrentUserHolder.getUser()));
|
||||
}
|
||||
|
||||
@ApiOperation("铺位详情")
|
||||
@@ -52,7 +52,7 @@ public class PointController {
|
||||
@ApiOperation("完善铺位")
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Long> updatePointDetailInfo(@RequestBody @Validated UpdatePointDetailRequest shopPointDetailRequest) {
|
||||
return ResponseResult.success(pointService.updatePointDetailInfo(shopPointDetailRequest));
|
||||
return ResponseResult.success(pointService.updatePointDetailInfo(shopPointDetailRequest,CurrentUserHolder.getUser()));
|
||||
}
|
||||
|
||||
@ApiOperation("生成评估报告")
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.dto.MiniShopDTO;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.OpportunityPointService;
|
||||
import com.cool.store.vo.point.MiniPointPageVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/04/02/18:44
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@RestController
|
||||
@Api("机会点详情")
|
||||
@RequestMapping("/mini/opportunityPoint")
|
||||
public class MiniOpportunityPointController {
|
||||
@Resource
|
||||
private OpportunityPointService opportunityPointService;
|
||||
@GetMapping("/getPoints")
|
||||
public ResponseResult<List<MiniPointPageVO> >getPointByOpportunityPointCode(String code) {
|
||||
return ResponseResult.success(opportunityPointService.getPointByOpportunityPointCode(code));
|
||||
}
|
||||
@GetMapping("/getShops")
|
||||
public ResponseResult<List<MiniShopDTO> >getShopByOpportunityPointCode(String code) {
|
||||
return ResponseResult.success(opportunityPointService.getShopByOpportunityPointCode(code));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user