PC+mini铺位改造
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
package com.cool.store.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: WangShuo
|
||||||
|
* @Date: 2025/03/31/10:58
|
||||||
|
* @Version 1.0
|
||||||
|
* @注释:
|
||||||
|
*/
|
||||||
|
public enum PointListType {
|
||||||
|
POINT_LIST_TYPE_1(1, "推荐铺位"),
|
||||||
|
POINT_LIST_TYPE_2(2, "我创建的"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
PointListType(Integer code, String desc) {
|
||||||
|
this.code = code;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,8 +3,10 @@ package com.cool.store.dao;
|
|||||||
import com.cool.store.entity.PointDetailInfoDO;
|
import com.cool.store.entity.PointDetailInfoDO;
|
||||||
import com.cool.store.mapper.PointDetailInfoMapper;
|
import com.cool.store.mapper.PointDetailInfoMapper;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
import tk.mybatis.mapper.entity.Example;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,5 +60,11 @@ public class PointDetailInfoDAO {
|
|||||||
return pointDetailInfoMapper.getShopPointDetailInfoByPointId(pointId);
|
return pointDetailInfoMapper.getShopPointDetailInfoByPointId(pointId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<PointDetailInfoDO> getByPointIdList(List<Long> pointIdList) {
|
||||||
|
Example example = new Example(PointDetailInfoDO.class);
|
||||||
|
example.createCriteria().andIn("point_id", pointIdList);
|
||||||
|
return pointDetailInfoMapper.selectByExample(example);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ import com.cool.store.dto.point.LineCountDTO;
|
|||||||
import com.cool.store.entity.PointInfoDO;
|
import com.cool.store.entity.PointInfoDO;
|
||||||
import com.cool.store.mapper.PointInfoMapper;
|
import com.cool.store.mapper.PointInfoMapper;
|
||||||
import com.cool.store.request.AllPointPageRequest;
|
import com.cool.store.request.AllPointPageRequest;
|
||||||
|
import com.cool.store.request.MiniPointPageRequest;
|
||||||
import com.cool.store.request.PointPageRequest;
|
import com.cool.store.request.PointPageRequest;
|
||||||
import com.cool.store.request.RecommendPointPageRequest;
|
import com.cool.store.request.RecommendPointPageRequest;
|
||||||
import com.cool.store.utils.StringUtil;
|
import com.cool.store.utils.StringUtil;
|
||||||
|
import com.cool.store.vo.point.MiniPointPageVO;
|
||||||
import com.cool.store.vo.point.PointHomePageDataVO;
|
import com.cool.store.vo.point.PointHomePageDataVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
@@ -117,4 +119,13 @@ public class PointInfoDAO {
|
|||||||
}
|
}
|
||||||
return pointInfoMapper.recyclePoint(pointId);
|
return pointInfoMapper.recyclePoint(pointId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<MiniPointPageVO> getMiniPointPage(Long lineId ) {
|
||||||
|
List<MiniPointPageVO> pointInfoDOPage = pointInfoMapper.MiniPointPageVO(lineId);
|
||||||
|
if(CollectionUtils.isEmpty(pointInfoDOPage)){
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return pointInfoDOPage ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.cool.store.entity.PointInfoDO;
|
|||||||
import com.cool.store.request.AllPointPageRequest;
|
import com.cool.store.request.AllPointPageRequest;
|
||||||
import com.cool.store.request.PointPageRequest;
|
import com.cool.store.request.PointPageRequest;
|
||||||
import com.cool.store.request.RecommendPointPageRequest;
|
import com.cool.store.request.RecommendPointPageRequest;
|
||||||
|
import com.cool.store.vo.point.MiniPointPageVO;
|
||||||
import com.cool.store.vo.point.PointHomePageDataVO;
|
import com.cool.store.vo.point.PointHomePageDataVO;
|
||||||
import com.cool.store.vo.point.PointPageVO;
|
import com.cool.store.vo.point.PointPageVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
@@ -88,4 +89,11 @@ public interface PointInfoMapper extends Mapper<PointInfoDO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer perfectPointInfo(@Param("request") PointInfoDO request);
|
Integer perfectPointInfo(@Param("request") PointInfoDO request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: wangshuo
|
||||||
|
* @Date: 2025/3/31
|
||||||
|
* @description:获取铺位部分数据
|
||||||
|
*/
|
||||||
|
List<MiniPointPageVO> MiniPointPageVO(@Param("lineId") Long lineId);
|
||||||
}
|
}
|
||||||
@@ -1,226 +1,260 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.cool.store.mapper.PointInfoMapper">
|
<mapper namespace="com.cool.store.mapper.PointInfoMapper">
|
||||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointInfoDO">
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointInfoDO">
|
||||||
<id column="id" jdbcType="BIGINT" property="id" />
|
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||||
<result column="point_code" jdbcType="VARCHAR" property="pointCode" />
|
<result column="point_code" jdbcType="VARCHAR" property="pointCode"/>
|
||||||
<result column="point_name" jdbcType="VARCHAR" property="pointName" />
|
<result column="point_name" jdbcType="VARCHAR" property="pointName"/>
|
||||||
<result column="region_id" jdbcType="BIGINT" property="regionId" />
|
<result column="region_id" jdbcType="BIGINT" property="regionId"/>
|
||||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
|
||||||
<result column="line_id" jdbcType="BIGINT" property="lineId" />
|
<result column="line_id" jdbcType="BIGINT" property="lineId"/>
|
||||||
<result column="point_area" jdbcType="VARCHAR" property="pointArea" />
|
<result column="point_area" jdbcType="VARCHAR" property="pointArea"/>
|
||||||
<result column="longitude" jdbcType="VARCHAR" property="longitude" />
|
<result column="longitude" jdbcType="VARCHAR" property="longitude"/>
|
||||||
<result column="latitude" jdbcType="VARCHAR" property="latitude" />
|
<result column="latitude" jdbcType="VARCHAR" property="latitude"/>
|
||||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
<result column="address" jdbcType="VARCHAR" property="address"/>
|
||||||
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager" />
|
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager"/>
|
||||||
<result column="operate_user_id" jdbcType="VARCHAR" property="operateUserId" />
|
<result column="operate_user_id" jdbcType="VARCHAR" property="operateUserId"/>
|
||||||
<result column="development_time" jdbcType="TIMESTAMP" property="developmentTime" />
|
<result column="development_time" jdbcType="TIMESTAMP" property="developmentTime"/>
|
||||||
<result column="point_status" jdbcType="TINYINT" property="pointStatus" />
|
<result column="point_status" jdbcType="TINYINT" property="pointStatus"/>
|
||||||
<result column="point_score" jdbcType="INTEGER" property="pointScore" />
|
<result column="point_score" jdbcType="INTEGER" property="pointScore"/>
|
||||||
<result column="select_status" jdbcType="TINYINT" property="selectStatus" />
|
<result column="select_status" jdbcType="TINYINT" property="selectStatus"/>
|
||||||
<result column="submit_audit_count" jdbcType="TINYINT" property="submitAuditCount" />
|
<result column="submit_audit_count" jdbcType="TINYINT" property="submitAuditCount"/>
|
||||||
<result column="point_source" jdbcType="TINYINT" property="pointSource" />
|
<result column="point_source" jdbcType="TINYINT" property="pointSource"/>
|
||||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||||
<result column="province" jdbcType="VARCHAR" property="province" />
|
<result column="province" jdbcType="VARCHAR" property="province"/>
|
||||||
<result column="city" jdbcType="VARCHAR" property="city" />
|
<result column="city" jdbcType="VARCHAR" property="city"/>
|
||||||
<result column="district" jdbcType="VARCHAR" property="district" />
|
<result column="district" jdbcType="VARCHAR" property="district"/>
|
||||||
<result column="township" jdbcType="VARCHAR" property="township" />
|
<result column="township" jdbcType="VARCHAR" property="township"/>
|
||||||
<result column="storage_status" jdbcType="TINYINT" property="storageStatus" />
|
<result column="storage_status" jdbcType="TINYINT" property="storageStatus"/>
|
||||||
<result column="opportunity_point_code" jdbcType="VARCHAR" property="opportunityPointCode" />
|
<result column="opportunity_point_code" jdbcType="VARCHAR" property="opportunityPointCode"/>
|
||||||
<result column="opportunity_point_name" jdbcType="VARCHAR" property="opportunityPointName" />
|
<result column="opportunity_point_name" jdbcType="VARCHAR" property="opportunityPointName"/>
|
||||||
</resultMap>
|
<result column="open_shop_name" jdbcType="VARCHAR" property="openShopName"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
<sql id="allColumn">
|
<sql id="allColumn">
|
||||||
id, point_code, point_name, region_id, shop_id, line_id, point_area, longitude, latitude, address, development_manager, operate_user_id,
|
id, point_code, point_name, region_id, shop_id, line_id, point_area, longitude, latitude, address,
|
||||||
development_time, point_status, point_score, select_status, submit_audit_count, point_source, deleted, create_time, update_time,
|
development_manager, operate_user_id,
|
||||||
province, city, district, township
|
development_time, point_status, point_score, select_status, submit_audit_count, point_source, deleted,
|
||||||
</sql>
|
create_time, update_time,
|
||||||
|
province, city, district, township, opportunity_point_code, opportunity_point_name,open_shop_name
|
||||||
|
</sql>
|
||||||
|
|
||||||
<select id="getMyPointData" resultType="com.cool.store.vo.point.PointHomePageDataVO">
|
<select id="getMyPointData" resultType="com.cool.store.vo.point.PointHomePageDataVO">
|
||||||
select
|
select
|
||||||
sum(if(point_status != 7, 1, 0)) as myPoint,
|
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 in (4, 5, 6), 1, 0)) as poolPoint,
|
||||||
sum(if(point_status = 1, 1, 0)) as collectPoint,
|
sum(if(point_status = 1, 1, 0)) as collectPoint,
|
||||||
sum(if(point_status = 2, 1, 0)) as evaluatePoint,
|
sum(if(point_status = 2, 1, 0)) as evaluatePoint,
|
||||||
sum(if(point_status in (3, 4), 1, 0)) as waitAuditPoint,
|
sum(if(point_status in (3, 4), 1, 0)) as waitAuditPoint,
|
||||||
sum(if(point_status = 7, 1, 0)) as signPoint
|
sum(if(point_status = 7, 1, 0)) as signPoint
|
||||||
from xfsg_point_info
|
from xfsg_point_info
|
||||||
where deleted = 0 and development_manager = #{userId}
|
where deleted = 0 and development_manager = #{userId}
|
||||||
</select>
|
</select>
|
||||||
<select id="getMyPointPage" resultMap="BaseResultMap">
|
<select id="getMyPointPage" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
id,
|
id,
|
||||||
point_name,
|
point_name,
|
||||||
point_code,
|
point_code,
|
||||||
address,
|
address,
|
||||||
region_id,
|
region_id,
|
||||||
point_status,
|
point_status,
|
||||||
point_score,
|
point_score,
|
||||||
point_area,
|
point_area,
|
||||||
development_manager,
|
development_manager,
|
||||||
operate_user_id,
|
operate_user_id,
|
||||||
development_time,
|
development_time,
|
||||||
select_status,
|
select_status,
|
||||||
create_time,
|
create_time,
|
||||||
update_time
|
update_time,
|
||||||
from xfsg_point_info
|
open_shop_name,
|
||||||
where deleted = 0 and development_manager = #{request.developmentManager}
|
opportunity_point_code,
|
||||||
<if test="request.keyword != null and request.keyword != ''">
|
opportunity_point_name
|
||||||
and (point_code like concat('%', #{request.keyword}, '%') or point_name like concat('%', #{request.keyword}, '%'))
|
from xfsg_point_info
|
||||||
</if>
|
where deleted = 0 and development_manager = #{request.developmentManager}
|
||||||
<if test="request.developmentStartTime != null and request.developmentStartTime != ''">
|
<if test="request.keyword != null and request.keyword != ''">
|
||||||
and development_time >= #{request.developmentStartTime}
|
and (point_code like concat('%', #{request.keyword}, '%') or point_name like concat('%', #{request.keyword},
|
||||||
</if>
|
'%'))
|
||||||
<if test="request.developmentEndTime != null and request.developmentEndTime != ''">
|
</if>
|
||||||
<![CDATA[and development_time <= #{request.developmentEndTime}]]>
|
<if test="request.developmentStartTime != null and request.developmentStartTime != ''">
|
||||||
</if>
|
and development_time >= #{request.developmentStartTime}
|
||||||
<if test="request.pointStatusList != null and request.pointStatusList.size() > 0">
|
</if>
|
||||||
and point_status in
|
<if test="request.developmentEndTime != null and request.developmentEndTime != ''">
|
||||||
<foreach collection="request.pointStatusList" item="pointStatus" open="(" close=")" separator=",">
|
<![CDATA[and development_time <= #{request.developmentEndTime}]]>
|
||||||
#{pointStatus}
|
</if>
|
||||||
</foreach>
|
<if test="request.pointStatusList != null and request.pointStatusList.size() > 0">
|
||||||
</if>
|
and point_status in
|
||||||
<if test="request.storageStatus != null">
|
<foreach collection="request.pointStatusList" item="pointStatus" open="(" close=")" separator=",">
|
||||||
and storage_status = #{request.storageStatus}
|
#{pointStatus}
|
||||||
</if>
|
</foreach>
|
||||||
<if test="request.operateUserId != null and request.operateUserId != ''">
|
</if>
|
||||||
and operate_user_id = #{request.operateUserId}
|
<if test="request.storageStatus != null">
|
||||||
</if>
|
and storage_status = #{request.storageStatus}
|
||||||
<if test="request.createStartTime != null and request.createStartTime != ''">
|
</if>
|
||||||
and create_time >= #{request.createStartTime}
|
<if test="request.operateUserId != null and request.operateUserId != ''">
|
||||||
</if>
|
and operate_user_id = #{request.operateUserId}
|
||||||
<if test="request.createEndTime != null and request.createEndTime != ''">
|
</if>
|
||||||
<![CDATA[and create_time <= #{request.createEndTime}]]>
|
<if test="request.createStartTime != null and request.createStartTime != ''">
|
||||||
</if>
|
and create_time >= #{request.createStartTime}
|
||||||
<if test="request.regionIds != null and request.regionIds.size() > 0">
|
</if>
|
||||||
and region_id in
|
<if test="request.createEndTime != null and request.createEndTime != ''">
|
||||||
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
|
<![CDATA[and create_time <= #{request.createEndTime}]]>
|
||||||
#{regionId}
|
</if>
|
||||||
</foreach>
|
<if test="request.regionIds != null and request.regionIds.size() > 0">
|
||||||
</if>
|
and region_id in
|
||||||
order by id desc
|
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
|
||||||
</select>
|
#{regionId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
order by id desc
|
||||||
|
</select>
|
||||||
<select id="getSelectedShopNum" resultType="com.cool.store.dto.point.LineCountDTO">
|
<select id="getSelectedShopNum" resultType="com.cool.store.dto.point.LineCountDTO">
|
||||||
select
|
select
|
||||||
line_id as lineId,
|
line_id as lineId,
|
||||||
count(1) as selectedShopNum
|
count(1) as selectedShopNum
|
||||||
from xfsg_point_info
|
from xfsg_point_info
|
||||||
where deleted = 0 and select_status = 1 and point_status !=7 and line_id in
|
where deleted = 0 and select_status = 1 and point_status !=7 and line_id in
|
||||||
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
|
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
|
||||||
#{lineId}
|
#{lineId}
|
||||||
</foreach>
|
</foreach>
|
||||||
group by line_id
|
group by line_id
|
||||||
</select>
|
</select>
|
||||||
<select id="getPointListByIds" resultMap="BaseResultMap">
|
<select id="getPointListByIds" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
<include refid="allColumn"/>
|
<include refid="allColumn"/>
|
||||||
from xfsg_point_info
|
from xfsg_point_info
|
||||||
where deleted = 0 and id in
|
where deleted = 0 and id in
|
||||||
<foreach collection="pointIds" item="pointId" index="index" open="(" separator="," close=")">
|
<foreach collection="pointIds" item="pointId" index="index" open="(" separator="," close=")">
|
||||||
#{pointId}
|
#{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} and select_status = 0
|
|
||||||
<if test="request.pointStatusList != null and request.pointStatusList.size() > 0">
|
|
||||||
and point_status in
|
|
||||||
<foreach collection="request.pointStatusList" item="pointStatus" separator="," open="(" close=")">
|
|
||||||
#{pointStatus}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<update id="updateSelectedDevelopmentManager">
|
|
||||||
update
|
|
||||||
xfsg_point_info
|
|
||||||
set
|
|
||||||
development_manager = #{developmentManager}
|
|
||||||
where
|
|
||||||
shop_id = #{shopId} 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>
|
</foreach>
|
||||||
</if>
|
</select>
|
||||||
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
|
<select id="getRecommendPointList" resultType="com.cool.store.entity.PointInfoDO">
|
||||||
and region_id in
|
select
|
||||||
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
|
<include refid="allColumn"/>
|
||||||
#{regionId}
|
from xfsg_point_info
|
||||||
</foreach>
|
where deleted = 0 and point_status in (4,5) and development_manager = #{request.developmentManager} and
|
||||||
</if>
|
select_status = 0
|
||||||
order by id desc
|
<if test="request.pointStatusList != null and request.pointStatusList.size() > 0">
|
||||||
</select>
|
and point_status in
|
||||||
|
<foreach collection="request.pointStatusList" item="pointStatus" separator="," open="(" close=")">
|
||||||
|
#{pointStatus}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateSelectedDevelopmentManager">
|
||||||
|
update
|
||||||
|
xfsg_point_info
|
||||||
|
set
|
||||||
|
development_manager = #{developmentManager}
|
||||||
|
where
|
||||||
|
shop_id = #{shopId} 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,
|
||||||
|
open_shop_name,
|
||||||
|
opportunity_point_code,
|
||||||
|
opportunity_point_name
|
||||||
|
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>
|
||||||
|
<if test="request.storageStatus != null ">
|
||||||
|
and storage_status = #{request.storageStatus}
|
||||||
|
</if>
|
||||||
|
order by id desc
|
||||||
|
</select>
|
||||||
<select id="getDataByShopIdAndLineId" resultType="com.cool.store.entity.PointInfoDO">
|
<select id="getDataByShopIdAndLineId" resultType="com.cool.store.entity.PointInfoDO">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="allColumn"/>
|
<include refid="allColumn"/>
|
||||||
FROM xfsg_point_info
|
FROM xfsg_point_info
|
||||||
WHERE shop_id = #{shopId}
|
WHERE shop_id = #{shopId}
|
||||||
AND line_id = #{lineId}
|
AND line_id = #{lineId}
|
||||||
AND deleted = 0
|
AND deleted = 0
|
||||||
|
</select>
|
||||||
|
<select id="MiniPointPageVO" 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,
|
||||||
|
a.picture_obj as pictureObj,
|
||||||
|
a.point_area as pointArea,
|
||||||
|
b.landlord_mobile as landlordMobile,
|
||||||
|
b.month_rent as monthRent,
|
||||||
|
from xfsg_point_info a
|
||||||
|
left join xfsg_point_recommend b on a.id = b.point_id
|
||||||
|
where a.line_id = #{lineId} and a.point_source = 2
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="recyclePoint">
|
<update id="recyclePoint">
|
||||||
update xfsg_point_info set line_id = null, shop_id = null, select_status = 0, update_time = now(), point_status = if(point_status = 6, 5, point_status) where id = #{pointId}
|
update xfsg_point_info set line_id = null, shop_id = null, select_status = 0, update_time = now(), point_status
|
||||||
</update>
|
= if(point_status = 6, 5, point_status) where id = #{pointId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<update id="perfectPointInfo">
|
<update id="perfectPointInfo">
|
||||||
update
|
update
|
||||||
xfsg_point_info
|
xfsg_point_info
|
||||||
set
|
set
|
||||||
point_name = #{request.pointName},
|
point_name = #{request.pointName},
|
||||||
region_id = #{request.regionId},
|
region_id = #{request.regionId},
|
||||||
point_area = #{request.pointArea},
|
point_area = #{request.pointArea},
|
||||||
latitude = #{request.latitude},
|
latitude = #{request.latitude},
|
||||||
longitude = #{request.longitude},
|
longitude = #{request.longitude},
|
||||||
address = #{request.address},
|
address = #{request.address},
|
||||||
province = #{request.province},
|
province = #{request.province},
|
||||||
city = #{request.city},
|
city = #{request.city},
|
||||||
district = #{request.district},
|
district = #{request.district},
|
||||||
township = #{request.township},
|
township = #{request.township},
|
||||||
point_score = #{request.pointScore}
|
point_score = #{request.pointScore}
|
||||||
where id = #{request.id}
|
where id = #{request.id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -116,11 +116,17 @@
|
|||||||
p.point_name as pointName,
|
p.point_name as pointName,
|
||||||
p.point_code as pointCode,
|
p.point_code as pointCode,
|
||||||
p.region_id as regionId,
|
p.region_id as regionId,
|
||||||
|
p.longitude as longitude,
|
||||||
|
p.latitude as latitude,
|
||||||
p.address as address,
|
p.address as address,
|
||||||
p.point_score as pointScore,
|
p.point_score as pointScore,
|
||||||
p.point_area as pointArea,
|
p.point_area as pointArea,
|
||||||
p.point_status as pointStatus,
|
p.point_status as pointStatus,
|
||||||
p.select_status as selectStatus,
|
p.select_status as selectStatus,
|
||||||
|
p.create_time as createTime,
|
||||||
|
p.opportunity_point_code as opportunityPointCode,
|
||||||
|
p.opportunity_point_name as opportunityPointName,
|
||||||
|
p.picture_obj as pictureObj,
|
||||||
pr.status as recommendStatus
|
pr.status as recommendStatus
|
||||||
from
|
from
|
||||||
xfsg_point_recommend pr
|
xfsg_point_recommend pr
|
||||||
|
|||||||
@@ -160,4 +160,7 @@ public class PointInfoDO {
|
|||||||
|
|
||||||
@Column(name = "opportunity_point_name")
|
@Column(name = "opportunity_point_name")
|
||||||
private String opportunityPointName;
|
private String opportunityPointName;
|
||||||
|
|
||||||
|
@Column(name = "open_shop_name")
|
||||||
|
private String openShopName;
|
||||||
}
|
}
|
||||||
@@ -43,4 +43,6 @@ public class AllPointPageRequest extends PageBasicInfo {
|
|||||||
@ApiModelProperty(value = "管辖区域",hidden = true)
|
@ApiModelProperty(value = "管辖区域",hidden = true)
|
||||||
private List<String> authRegionIds;
|
private List<String> authRegionIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否入库1已入库 2暂未入库")
|
||||||
|
private Integer storageStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
import javax.validation.constraints.Max;
|
import javax.validation.constraints.Max;
|
||||||
import javax.validation.constraints.Min;
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
@@ -24,4 +25,11 @@ public class MiniPointPageRequest extends PageBasicInfo {
|
|||||||
@ApiModelProperty(value = "门店线索ID")
|
@ApiModelProperty(value = "门店线索ID")
|
||||||
private Long shopId;
|
private Long shopId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "1-推荐铺位,2-我创建的")
|
||||||
|
@NotNull
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
private Long lineId;
|
||||||
|
|
||||||
|
private String partnerId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import lombok.Data;
|
|||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -41,6 +42,30 @@ public class MiniPointPageVO {
|
|||||||
@ApiModelProperty("1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效")
|
@ApiModelProperty("1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效")
|
||||||
private Integer recommendStatus;
|
private Integer recommendStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("租金")
|
||||||
|
private String monthRent;
|
||||||
|
|
||||||
|
@ApiModelProperty("房东电话")
|
||||||
|
private String landlordMobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("录入时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("机会点编号")
|
||||||
|
private String opportunityPointCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("机会点名称")
|
||||||
|
private String opportunityPointName;
|
||||||
|
|
||||||
|
@ApiModelProperty("图片/视频附件")
|
||||||
|
private String pictureObj;
|
||||||
|
|
||||||
|
@ApiModelProperty("经度")
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
@ApiModelProperty("纬度")
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
public static List<MiniPointPageVO> convertVO(List<MiniPointPageDTO> pointList, Map<Long, String> regionNameMap) {
|
public static List<MiniPointPageVO> convertVO(List<MiniPointPageDTO> pointList, Map<Long, String> regionNameMap) {
|
||||||
if(CollectionUtils.isEmpty(pointList)){
|
if(CollectionUtils.isEmpty(pointList)){
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
|
|||||||
@@ -260,6 +260,14 @@ public class PointDetailVO {
|
|||||||
@ApiModelProperty("是否可以上传租赁合同")
|
@ApiModelProperty("是否可以上传租赁合同")
|
||||||
private boolean canSubmitRentContract;
|
private boolean canSubmitRentContract;
|
||||||
|
|
||||||
|
@ApiModelProperty("成功开店")
|
||||||
|
private String openShopName;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属机会点编码")
|
||||||
|
private String opportunityPointCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属机会点名称")
|
||||||
|
private String opportunityPointName;
|
||||||
|
|
||||||
public static PointDetailVO convertVO(PointInfoDO pointInfo, PointDetailInfoDO pointDetailInfo) {
|
public static PointDetailVO convertVO(PointInfoDO pointInfo, PointDetailInfoDO pointDetailInfo) {
|
||||||
PointDetailVO result = new PointDetailVO();
|
PointDetailVO result = new PointDetailVO();
|
||||||
@@ -271,7 +279,7 @@ public class PointDetailVO {
|
|||||||
result.setLatitude(pointInfo.getLatitude());
|
result.setLatitude(pointInfo.getLatitude());
|
||||||
result.setAddress(pointInfo.getAddress());
|
result.setAddress(pointInfo.getAddress());
|
||||||
result.setPointStatus(pointInfo.getPointStatus());
|
result.setPointStatus(pointInfo.getPointStatus());
|
||||||
if(PointStatusEnum.POINT_STATUS_4.getCode().equals(pointInfo.getPointStatus())){
|
if (PointStatusEnum.POINT_STATUS_4.getCode().equals(pointInfo.getPointStatus())) {
|
||||||
result.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode());
|
result.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode());
|
||||||
}
|
}
|
||||||
result.setDevelopmentTime(pointInfo.getDevelopmentTime());
|
result.setDevelopmentTime(pointInfo.getDevelopmentTime());
|
||||||
@@ -344,6 +352,9 @@ public class PointDetailVO {
|
|||||||
result.setCity(pointInfo.getCity());
|
result.setCity(pointInfo.getCity());
|
||||||
result.setDistrict(pointInfo.getDistrict());
|
result.setDistrict(pointInfo.getDistrict());
|
||||||
result.setTownship(pointInfo.getTownship());
|
result.setTownship(pointInfo.getTownship());
|
||||||
|
result.setOpenShopName(pointInfo.getOpenShopName());
|
||||||
|
result.setOpportunityPointCode(pointInfo.getOpportunityPointCode());
|
||||||
|
result.setOpportunityPointName(pointInfo.getOpportunityPointName());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,13 @@ public class PointPageVO {
|
|||||||
@ApiModelProperty("更新时间")
|
@ApiModelProperty("更新时间")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("成功开店")
|
||||||
|
private String openShopName;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属机会点编码")
|
||||||
|
private String opportunityPointCode;
|
||||||
|
@ApiModelProperty("所属机会点名称")
|
||||||
|
private String opportunityPointName;
|
||||||
|
|
||||||
|
|
||||||
public static List<PointPageVO> convertVO(List<PointInfoDO> pointList, Map<String, String> usernameMap, Map<Long, String> regionNameMap) {
|
public static List<PointPageVO> convertVO(List<PointInfoDO> pointList, Map<String, String> usernameMap, Map<Long, String> regionNameMap) {
|
||||||
|
|||||||
@@ -19,5 +19,5 @@ public interface TallyBookService {
|
|||||||
|
|
||||||
List<TallyBookDTO> getTallyBookListByShopIdAndYear(Long shopId, Integer year);
|
List<TallyBookDTO> getTallyBookListByShopIdAndYear(Long shopId, Integer year);
|
||||||
|
|
||||||
public TallyBookDO initData(Date date, Long shopId, String partnerId);
|
Long initData(Date date, Long shopId, String partnerId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.cool.store.vo.point.*;
|
|||||||
import com.cool.store.vo.shop.RentInfoToDoVO;
|
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||||
import com.cool.store.vo.shop.ShopPointBaseInfoVO;
|
import com.cool.store.vo.shop.ShopPointBaseInfoVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -112,12 +113,12 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Override
|
@Override
|
||||||
public PointDetailVO getPointDetailInfo(Long pointId, Boolean isGetNodeNo) {
|
public PointDetailVO getPointDetailInfo(Long pointId, Boolean isGetNodeNo) {
|
||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
||||||
if(Objects.isNull(pointInfo)){
|
if (Objects.isNull(pointInfo)) {
|
||||||
log.error("铺位基本信息不存在");
|
log.error("铺位基本信息不存在");
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
|
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
|
||||||
if(Objects.isNull(pointDetailInfo)){
|
if (Objects.isNull(pointDetailInfo)) {
|
||||||
log.error("铺位详情信息不存在");
|
log.error("铺位详情信息不存在");
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
@@ -126,10 +127,10 @@ public class PointServiceImpl implements PointService {
|
|||||||
result.setDevelopmentManagerUserName(userName);
|
result.setDevelopmentManagerUserName(userName);
|
||||||
result.setDevelopmentManagerUserId(pointInfo.getDevelopmentManager());
|
result.setDevelopmentManagerUserId(pointInfo.getDevelopmentManager());
|
||||||
result.setRegionNodeName(regionService.getBelongWarRegionName(pointInfo.getRegionId()));
|
result.setRegionNodeName(regionService.getBelongWarRegionName(pointInfo.getRegionId()));
|
||||||
if(Objects.nonNull(isGetNodeNo) && isGetNodeNo){
|
if (Objects.nonNull(isGetNodeNo) && isGetNodeNo) {
|
||||||
result.setCurNodeNo(pointTodoInfoDAO.getCurNodeNoByPoint(pointId));
|
result.setCurNodeNo(pointTodoInfoDAO.getCurNodeNoByPoint(pointId));
|
||||||
}
|
}
|
||||||
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
if (SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) {
|
||||||
List<Long> canSubmitRentContractShopIds = shopStageInfoDAO.getCanSubmitRentContractShopIds(Arrays.asList(pointInfo.getShopId()));
|
List<Long> canSubmitRentContractShopIds = shopStageInfoDAO.getCanSubmitRentContractShopIds(Arrays.asList(pointInfo.getShopId()));
|
||||||
boolean canSubmitRentContract = CollectionUtils.isEmpty(canSubmitRentContractShopIds) ? Boolean.FALSE : Boolean.TRUE;
|
boolean canSubmitRentContract = CollectionUtils.isEmpty(canSubmitRentContractShopIds) ? Boolean.FALSE : Boolean.TRUE;
|
||||||
result.setCanSubmitRentContract(canSubmitRentContract);
|
result.setCanSubmitRentContract(canSubmitRentContract);
|
||||||
@@ -141,7 +142,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Long updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest) {
|
public Long updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest) {
|
||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(shopPointDetailRequest.getPointId());
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(shopPointDetailRequest.getPointId());
|
||||||
if(Objects.isNull(pointInfo)){
|
if (Objects.isNull(pointInfo)) {
|
||||||
log.error("铺位基本信息不存在");
|
log.error("铺位基本信息不存在");
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
@@ -157,10 +158,10 @@ public class PointServiceImpl implements PointService {
|
|||||||
public Integer generateEvaluationReport(Long pointId) {
|
public Integer generateEvaluationReport(Long pointId) {
|
||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
||||||
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
|
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
|
||||||
if(Objects.isNull(pointInfo) || Objects.isNull(pointDetailInfo)){
|
if (Objects.isNull(pointInfo) || Objects.isNull(pointDetailInfo)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
if(!pointDetailInfo.isCanSubmitEvaluable() || StringUtils.isBlank(pointInfo.getPointArea())){
|
if (!pointDetailInfo.isCanSubmitEvaluable() || StringUtils.isBlank(pointInfo.getPointArea())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_COMPLETE);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_COMPLETE);
|
||||||
}
|
}
|
||||||
Integer totalPointScore = pointDetailInfo.getTotalPointScore();
|
Integer totalPointScore = pointDetailInfo.getTotalPointScore();
|
||||||
@@ -176,18 +177,18 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer pointInvalid(Long pointId) {
|
public Integer pointInvalid(Long pointId) {
|
||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
||||||
if(Objects.isNull(pointInfo)){
|
if (Objects.isNull(pointInfo)) {
|
||||||
log.error("铺位基本信息不存在");
|
log.error("铺位基本信息不存在");
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
|
if (PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
|
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
|
||||||
}
|
}
|
||||||
PointInfoDO updatePoint = new PointInfoDO();
|
PointInfoDO updatePoint = new PointInfoDO();
|
||||||
updatePoint.setId(pointId);
|
updatePoint.setId(pointId);
|
||||||
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_7.getCode());
|
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_7.getCode());
|
||||||
pointInfoDAO.updatePointInfo(updatePoint);
|
pointInfoDAO.updatePointInfo(updatePoint);
|
||||||
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
if (SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) {
|
||||||
rollbackSelectPoint(pointInfo.getShopId(), pointInfo.getId());
|
rollbackSelectPoint(pointInfo.getShopId(), pointInfo.getId());
|
||||||
}
|
}
|
||||||
return pointRecommendDAO.updateRecommendStatus(pointId, PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_6, null);
|
return pointRecommendDAO.updateRecommendStatus(pointId, PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_6, null);
|
||||||
@@ -197,7 +198,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
* 回退选址状态
|
* 回退选址状态
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private void rollbackSelectPoint(Long shopId, Long pointId){
|
private void rollbackSelectPoint(Long shopId, Long pointId) {
|
||||||
//店铺回退待带选址
|
//店铺回退待带选址
|
||||||
shopInfoDAO.unbindPoint(shopId);
|
shopInfoDAO.unbindPoint(shopId);
|
||||||
//铺位回退
|
//铺位回退
|
||||||
@@ -206,7 +207,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_10);
|
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_10);
|
||||||
//租赁合同回到未开始
|
//租赁合同回到未开始
|
||||||
Integer result = shopStageInfoDAO.updateShopStageToNotStarted(shopId, ShopSubStageEnum.SHOP_STAGE_2);
|
Integer result = shopStageInfoDAO.updateShopStageToNotStarted(shopId, ShopSubStageEnum.SHOP_STAGE_2);
|
||||||
if(result > CommonConstants.ZERO){
|
if (result > CommonConstants.ZERO) {
|
||||||
//删除租赁合同
|
//删除租赁合同
|
||||||
shopRentInfoDAO.deleteRentContractByShopId(shopId);
|
shopRentInfoDAO.deleteRentContractByShopId(shopId);
|
||||||
}
|
}
|
||||||
@@ -216,14 +217,14 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer pointUnbind(Long pointId) {
|
public Integer pointUnbind(Long pointId) {
|
||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
||||||
if(Objects.isNull(pointInfo)){
|
if (Objects.isNull(pointInfo)) {
|
||||||
log.error("铺位基本信息不存在");
|
log.error("铺位基本信息不存在");
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
|
if (PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
|
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
|
||||||
}
|
}
|
||||||
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
if (SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) {
|
||||||
rollbackSelectPoint(pointInfo.getShopId(), pointInfo.getId());
|
rollbackSelectPoint(pointInfo.getShopId(), pointInfo.getId());
|
||||||
}
|
}
|
||||||
//将已选择、已被他人选择的状态更新成待选泽
|
//将已选择、已被他人选择的状态更新成待选泽
|
||||||
@@ -233,7 +234,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Override
|
@Override
|
||||||
public Integer addMapEvaluationReport(AddMapEvaluationReportRequest request) {
|
public Integer addMapEvaluationReport(AddMapEvaluationReportRequest request) {
|
||||||
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(request.getPointId());
|
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(request.getPointId());
|
||||||
if(Objects.isNull(pointDetailInfo)){
|
if (Objects.isNull(pointDetailInfo)) {
|
||||||
log.error("铺位基本信息不存在");
|
log.error("铺位基本信息不存在");
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
@@ -249,22 +250,22 @@ public class PointServiceImpl implements PointService {
|
|||||||
|
|
||||||
Long pointId = request.getPointId();
|
Long pointId = request.getPointId();
|
||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
||||||
if(Objects.isNull(pointInfo)){
|
if (Objects.isNull(pointInfo)) {
|
||||||
log.error("铺位基本信息不存在");
|
log.error("铺位基本信息不存在");
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
|
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
|
||||||
if(Objects.isNull(pointDetailInfo)){
|
if (Objects.isNull(pointDetailInfo)) {
|
||||||
log.error("铺位详细信息不存在");
|
log.error("铺位详细信息不存在");
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
//处理子任务审核记录表
|
//处理子任务审核记录表
|
||||||
AuditSettingVO auditSetting = getAuditSetting();
|
AuditSettingVO auditSetting = getAuditSetting();
|
||||||
if(Objects.isNull(auditSetting)){
|
if (Objects.isNull(auditSetting)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_AUDIT_NOT_SETTING);
|
throw new ServiceException(ErrorCodeEnum.POINT_AUDIT_NOT_SETTING);
|
||||||
}
|
}
|
||||||
List<AuditNodeDTO> auditNode = dealAuditNode(auditSetting, pointInfo.getRegionId(), pointInfo.getDevelopmentManager());
|
List<AuditNodeDTO> auditNode = dealAuditNode(auditSetting, pointInfo.getRegionId(), pointInfo.getDevelopmentManager());
|
||||||
if(auditNode.size()==CommonConstants.ONE){
|
if (auditNode.size() == CommonConstants.ONE) {
|
||||||
throw new ServiceException(ErrorCodeEnum.CONFIRM_THE_APPROVER);
|
throw new ServiceException(ErrorCodeEnum.CONFIRM_THE_APPROVER);
|
||||||
}
|
}
|
||||||
int submitAuditCount = pointInfo.getSubmitAuditCount() + 1;
|
int submitAuditCount = pointInfo.getSubmitAuditCount() + 1;
|
||||||
@@ -297,7 +298,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
public AuditSettingVO getAuditSetting() {
|
public AuditSettingVO getAuditSetting() {
|
||||||
String cacheKey = MessageFormat.format(AUDIT_SETTING_KEY, enterpriseId);
|
String cacheKey = MessageFormat.format(AUDIT_SETTING_KEY, enterpriseId);
|
||||||
String auditSetting = redisUtilPool.getString(cacheKey);
|
String auditSetting = redisUtilPool.getString(cacheKey);
|
||||||
if(StringUtils.isBlank(auditSetting)){
|
if (StringUtils.isBlank(auditSetting)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return JSONObject.parseObject(auditSetting, AuditSettingVO.class);
|
return JSONObject.parseObject(auditSetting, AuditSettingVO.class);
|
||||||
@@ -337,25 +338,25 @@ public class PointServiceImpl implements PointService {
|
|||||||
* @param currentNo
|
* @param currentNo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Integer dealNextAuditRecord(PointInfoDO pointInfo, Map<Integer, PointAuditRecordDO> pointAuditRecordMap, Integer currentNo){
|
private Integer dealNextAuditRecord(PointInfoDO pointInfo, Map<Integer, PointAuditRecordDO> pointAuditRecordMap, Integer currentNo) {
|
||||||
Integer result = CommonConstants.ZERO;
|
Integer result = CommonConstants.ZERO;
|
||||||
PointAuditRecordDO nextAuditRecord = getNextAuditRecord(currentNo, pointAuditRecordMap);
|
PointAuditRecordDO nextAuditRecord = getNextAuditRecord(currentNo, pointAuditRecordMap);
|
||||||
if(Objects.nonNull(nextAuditRecord)){
|
if (Objects.nonNull(nextAuditRecord)) {
|
||||||
pointAuditRecordDAO.updatePointAuditRecord(PointAuditRecordDO.convert(nextAuditRecord.getId(), new Date()));
|
pointAuditRecordDAO.updatePointAuditRecord(PointAuditRecordDO.convert(nextAuditRecord.getId(), new Date()));
|
||||||
//审批通过的情况下 生成下一个节点的待办数据
|
//审批通过的情况下 生成下一个节点的待办数据
|
||||||
pointTodoInfoDAO.addPointTodoInfo(PointAuditRecordDO.convertTODO(nextAuditRecord));
|
pointTodoInfoDAO.addPointTodoInfo(PointAuditRecordDO.convertTODO(nextAuditRecord));
|
||||||
List<String> sendMessageUserIds = JSONObject.parseArray(nextAuditRecord.getHandlerUserIds(), String.class);
|
List<String> sendMessageUserIds = JSONObject.parseArray(nextAuditRecord.getHandlerUserIds(), String.class);
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
map.put("pointName",pointInfo.getPointName()) ;
|
map.put("pointName", pointInfo.getPointName());
|
||||||
map.put("pointAddress",pointInfo.getAddress()) ;
|
map.put("pointAddress", pointInfo.getAddress());
|
||||||
commonService.sendQWMessage(sendMessageUserIds, MessageEnum.MESSAGE_13, map);
|
commonService.sendQWMessage(sendMessageUserIds, MessageEnum.MESSAGE_13, map);
|
||||||
}else{
|
} else {
|
||||||
PointInfoDO updatePoint = new PointInfoDO();
|
PointInfoDO updatePoint = new PointInfoDO();
|
||||||
updatePoint.setId(pointInfo.getId());
|
updatePoint.setId(pointInfo.getId());
|
||||||
//没有下一节点 审批通过
|
//没有下一节点 审批通过
|
||||||
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_5.getCode());
|
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_5.getCode());
|
||||||
updatePoint.setStorageStatus(StorageStatusEnum.IN_STORAGE.getCode());
|
updatePoint.setStorageStatus(StorageStatusEnum.IN_STORAGE.getCode());
|
||||||
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
if (SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) {
|
||||||
initUploadRentContract(pointInfo);
|
initUploadRentContract(pointInfo);
|
||||||
}
|
}
|
||||||
Map<String, String> messageMap = new HashMap<>();
|
Map<String, String> messageMap = new HashMap<>();
|
||||||
@@ -374,7 +375,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
* @param reason
|
* @param reason
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Integer auditRejectDeal(PointInfoDO pointInfo, String reason){
|
private Integer auditRejectDeal(PointInfoDO pointInfo, String reason) {
|
||||||
Long pointId = pointInfo.getId();
|
Long pointId = pointInfo.getId();
|
||||||
PointInfoDO pointInfoUpdate = new PointInfoDO();
|
PointInfoDO pointInfoUpdate = new PointInfoDO();
|
||||||
pointInfoUpdate.setId(pointId);
|
pointInfoUpdate.setId(pointId);
|
||||||
@@ -394,17 +395,17 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer audit(String userId, PointAuditRequest request) {
|
public Integer audit(String userId, PointAuditRequest request) {
|
||||||
if(!request.check()){
|
if (!request.check()) {
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
}
|
}
|
||||||
Long pointId = request.getPointId();
|
Long pointId = request.getPointId();
|
||||||
PointTodoInfoDO pointTodo = pointTodoInfoDAO.getPointToDoByUserIdAndPointId(userId, pointId);
|
PointTodoInfoDO pointTodo = pointTodoInfoDAO.getPointToDoByUserIdAndPointId(userId, pointId);
|
||||||
if(Objects.isNull(pointTodo)){
|
if (Objects.isNull(pointTodo)) {
|
||||||
log.info("该用户没有待办数据");
|
log.info("该用户没有待办数据");
|
||||||
throw new ServiceException(ErrorCodeEnum.USER_NOT_TODO_AUDIT);
|
throw new ServiceException(ErrorCodeEnum.USER_NOT_TODO_AUDIT);
|
||||||
}
|
}
|
||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
||||||
if(Objects.isNull(pointInfo)){
|
if (Objects.isNull(pointInfo)) {
|
||||||
log.info("铺位不存在");
|
log.info("铺位不存在");
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
@@ -413,14 +414,14 @@ public class PointServiceImpl implements PointService {
|
|||||||
pointTodoInfoDAO.updatePointTodoInfo(pointId, pointTodo.getNodeNo(), pointInfo.getSubmitAuditCount(), userId);
|
pointTodoInfoDAO.updatePointTodoInfo(pointId, pointTodo.getNodeNo(), pointInfo.getSubmitAuditCount(), userId);
|
||||||
Map<Integer, PointAuditRecordDO> pointAuditRecordMap = pointAuditRecordDAO.getPointAuditRecordMap(pointId, pointInfo.getSubmitAuditCount());
|
Map<Integer, PointAuditRecordDO> pointAuditRecordMap = pointAuditRecordDAO.getPointAuditRecordMap(pointId, pointInfo.getSubmitAuditCount());
|
||||||
PointAuditRecordDO pointAuditRecord = pointAuditRecordMap.get(pointTodo.getNodeNo());
|
PointAuditRecordDO pointAuditRecord = pointAuditRecordMap.get(pointTodo.getNodeNo());
|
||||||
if(Objects.isNull(pointAuditRecord)){
|
if (Objects.isNull(pointAuditRecord)) {
|
||||||
log.info("铺位处理记录中的数据不对");
|
log.info("铺位处理记录中的数据不对");
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_AUDIT_NODE_ERROR);
|
throw new ServiceException(ErrorCodeEnum.POINT_AUDIT_NODE_ERROR);
|
||||||
}
|
}
|
||||||
NodeNoEnum nodeNoEnum = NodeNoEnum.getByCode(pointTodo.getNodeNo());
|
NodeNoEnum nodeNoEnum = NodeNoEnum.getByCode(pointTodo.getNodeNo());
|
||||||
PointAuditRecordDO auditRecord = PointAuditRecordDO.convert(pointAuditRecord.getId(), userId, auditStatus, request.getReason(), nodeNoEnum);
|
PointAuditRecordDO auditRecord = PointAuditRecordDO.convert(pointAuditRecord.getId(), userId, auditStatus, request.getReason(), nodeNoEnum);
|
||||||
pointAuditRecordDAO.updatePointAuditRecord(auditRecord);
|
pointAuditRecordDAO.updatePointAuditRecord(auditRecord);
|
||||||
if(AuditStatusEnum.REJECT.equals(auditStatus)){
|
if (AuditStatusEnum.REJECT.equals(auditStatus)) {
|
||||||
return auditRejectDeal(pointInfo, request.getReason());
|
return auditRejectDeal(pointInfo, request.getReason());
|
||||||
}
|
}
|
||||||
//处理下一节点任务及更新point状态
|
//处理下一节点任务及更新point状态
|
||||||
@@ -430,13 +431,13 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Override
|
@Override
|
||||||
public Integer turnDevelopmentManager(TurnDevelopmentManagerRequest request) {
|
public Integer turnDevelopmentManager(TurnDevelopmentManagerRequest request) {
|
||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(request.getPointId());
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(request.getPointId());
|
||||||
if(Objects.isNull(pointInfo)){
|
if (Objects.isNull(pointInfo)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus()) || PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
|
if (SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus()) || PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||||
}
|
}
|
||||||
if(PointStatusEnum.POINT_STATUS_7.getCode().equals(pointInfo.getPointStatus())){
|
if (PointStatusEnum.POINT_STATUS_7.getCode().equals(pointInfo.getPointStatus())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||||
}
|
}
|
||||||
pointInfo.setDevelopmentManager(request.getDevelopmentManager());
|
pointInfo.setDevelopmentManager(request.getDevelopmentManager());
|
||||||
@@ -446,8 +447,8 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Override
|
@Override
|
||||||
public PageInfo<LinePointBaseInfoVO> getLinePage(PointLinePageRequest request) {
|
public PageInfo<LinePointBaseInfoVO> getLinePage(PointLinePageRequest request) {
|
||||||
Page<LineInfoDO> lineList = lineInfoDAO.getLinePageByDevelopmentManager(request);
|
Page<LineInfoDO> lineList = lineInfoDAO.getLinePageByDevelopmentManager(request);
|
||||||
List<String> userPortraitList = lineList.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(LineInfoDO::getUserPortrait).collect(Collectors.toList());
|
List<String> userPortraitList = lineList.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait())).map(LineInfoDO::getUserPortrait).collect(Collectors.toList());
|
||||||
List<String> investmentManagerUserIds = lineList.stream().filter(x -> StringUtils.isNotEmpty(x.getInvestmentManager() )).map(LineInfoDO::getInvestmentManager).collect(Collectors.toList());
|
List<String> investmentManagerUserIds = lineList.stream().filter(x -> StringUtils.isNotEmpty(x.getInvestmentManager())).map(LineInfoDO::getInvestmentManager).collect(Collectors.toList());
|
||||||
List<Long> lineIds = lineList.stream().map(LineInfoDO::getId).collect(Collectors.toList());
|
List<Long> lineIds = lineList.stream().map(LineInfoDO::getId).collect(Collectors.toList());
|
||||||
List<Long> wantShopAreaIds = lineList.stream().map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
List<Long> wantShopAreaIds = lineList.stream().map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
||||||
Map<Long, Integer> recommendShopNumMap = pointRecommendDAO.getPushShopNumMap(lineIds);
|
Map<Long, Integer> recommendShopNumMap = pointRecommendDAO.getPushShopNumMap(lineIds);
|
||||||
@@ -464,8 +465,8 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Override
|
@Override
|
||||||
public PageInfo<ShopPointBaseInfoVO> getShopPage(PointLinePageRequest request) {
|
public PageInfo<ShopPointBaseInfoVO> getShopPage(PointLinePageRequest request) {
|
||||||
List<ShopPointDTO> listByDevelopmentManager = shopInfoDAO.getShopPointListByDevelopmentManager(request);
|
List<ShopPointDTO> listByDevelopmentManager = shopInfoDAO.getShopPointListByDevelopmentManager(request);
|
||||||
List<String> userPortraitList = listByDevelopmentManager.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(ShopPointDTO::getUserPortrait).collect(Collectors.toList());
|
List<String> userPortraitList = listByDevelopmentManager.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait())).map(ShopPointDTO::getUserPortrait).collect(Collectors.toList());
|
||||||
List<String> investmentManagerUserIds = listByDevelopmentManager.stream().filter(x -> StringUtils.isNotEmpty(x.getInvestmentManager() )).map(ShopPointDTO::getInvestmentManager).collect(Collectors.toList());
|
List<String> investmentManagerUserIds = listByDevelopmentManager.stream().filter(x -> StringUtils.isNotEmpty(x.getInvestmentManager())).map(ShopPointDTO::getInvestmentManager).collect(Collectors.toList());
|
||||||
List<Long> shopIds = listByDevelopmentManager.stream().map(ShopPointDTO::getShopId).collect(Collectors.toList());
|
List<Long> shopIds = listByDevelopmentManager.stream().map(ShopPointDTO::getShopId).collect(Collectors.toList());
|
||||||
List<Long> wantShopAreaIds = listByDevelopmentManager.stream().map(ShopPointDTO::getWantShopAreaId).collect(Collectors.toList());
|
List<Long> wantShopAreaIds = listByDevelopmentManager.stream().map(ShopPointDTO::getWantShopAreaId).collect(Collectors.toList());
|
||||||
Map<Long, Integer> recommendShopNumMap = pointRecommendDAO.getShopPushPointNumMap(shopIds);
|
Map<Long, Integer> recommendShopNumMap = pointRecommendDAO.getShopPushPointNumMap(shopIds);
|
||||||
@@ -476,7 +477,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
List<Long> lineIds = listByDevelopmentManager.stream().map(ShopPointDTO::getLineId).collect(Collectors.toList());
|
List<Long> lineIds = listByDevelopmentManager.stream().map(ShopPointDTO::getLineId).collect(Collectors.toList());
|
||||||
Map<Long, String> partnerNameMap = lineInfoDAO.getUserNameMap(lineIds);
|
Map<Long, String> partnerNameMap = lineInfoDAO.getUserNameMap(lineIds);
|
||||||
|
|
||||||
List<ShopPointBaseInfoVO> resultList = ShopPointBaseInfoVO.convertList(partnerNameMap,listByDevelopmentManager, userNameMap, userPortraitMap, cityMap, recommendShopNumMap);
|
List<ShopPointBaseInfoVO> resultList = ShopPointBaseInfoVO.convertList(partnerNameMap, listByDevelopmentManager, userNameMap, userPortraitMap, cityMap, recommendShopNumMap);
|
||||||
PageInfo resultPage = new PageInfo(listByDevelopmentManager);
|
PageInfo resultPage = new PageInfo(listByDevelopmentManager);
|
||||||
resultPage.setList(resultList);
|
resultPage.setList(resultList);
|
||||||
return resultPage;
|
return resultPage;
|
||||||
@@ -488,7 +489,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public LinePointBaseInfoVO getLineInfo(Long lineId){
|
public LinePointBaseInfoVO getLineInfo(Long lineId) {
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||||
Map<Long, Integer> recommendShopNumMap = pointRecommendDAO.getPushShopNumMap(Arrays.asList(lineId));
|
Map<Long, Integer> recommendShopNumMap = pointRecommendDAO.getPushShopNumMap(Arrays.asList(lineId));
|
||||||
HyOpenAreaInfoDO cityArea = hyOpenAreaInfoDAO.selectById(lineInfo.getWantShopAreaId());
|
HyOpenAreaInfoDO cityArea = hyOpenAreaInfoDAO.selectById(lineInfo.getWantShopAreaId());
|
||||||
@@ -505,16 +506,16 @@ public class PointServiceImpl implements PointService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<PointPageVO> getMyPointPage(PointPageRequest request) {
|
public PageInfo<PointPageVO> getMyPointPage(PointPageRequest request) {
|
||||||
if(CollectionUtils.isNotEmpty(request.getRegionIds())){
|
if (CollectionUtils.isNotEmpty(request.getRegionIds())) {
|
||||||
if(request.getRegionIds().contains(CommonConstants.ROOT_DEPT_ID_STR)){
|
if (request.getRegionIds().contains(CommonConstants.ROOT_DEPT_ID_STR)) {
|
||||||
request.setRegionIds(null);
|
request.setRegionIds(null);
|
||||||
}else{
|
} else {
|
||||||
request.setRegionIds(regionService.getSubRegionIdsByRegionIds(request.getRegionIds()));
|
request.setRegionIds(regionService.getSubRegionIdsByRegionIds(request.getRegionIds()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<PointPageVO> resultList = new ArrayList();
|
List<PointPageVO> resultList = new ArrayList();
|
||||||
Page<PointInfoDO> pointPage = pointInfoDAO.getMyPointPage(request);
|
Page<PointInfoDO> pointPage = pointInfoDAO.getMyPointPage(request);
|
||||||
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
|
if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) {
|
||||||
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||||
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
|
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
|
||||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
|
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
|
||||||
@@ -527,23 +528,23 @@ public class PointServiceImpl implements PointService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<PointPageVO> getTeamPointPage(AllPointPageRequest request){
|
public PageInfo<PointPageVO> getTeamPointPage(AllPointPageRequest request) {
|
||||||
if(!sysRoleService.checkIsAdmin(request.getCurUserId())){
|
if (!sysRoleService.checkIsAdmin(request.getCurUserId())) {
|
||||||
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(request.getCurUserId()));
|
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(request.getCurUserId()));
|
||||||
}
|
}
|
||||||
if(CollectionUtils.isNotEmpty(request.getRegionIds())){
|
if (CollectionUtils.isNotEmpty(request.getRegionIds())) {
|
||||||
if(request.getRegionIds().contains(CommonConstants.ROOT_DEPT_ID_STR)){
|
if (request.getRegionIds().contains(CommonConstants.ROOT_DEPT_ID_STR)) {
|
||||||
request.setRegionIds(null);
|
request.setRegionIds(null);
|
||||||
}else{
|
} else {
|
||||||
request.setRegionIds(regionService.getSubRegionIdsByRegionIds(request.getRegionIds()));
|
request.setRegionIds(regionService.getSubRegionIdsByRegionIds(request.getRegionIds()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Objects.nonNull(request.getPointStatus()) && PointStatusEnum.POINT_STATUS_3.getCode().equals(request.getPointStatus())){
|
if (Objects.nonNull(request.getPointStatus()) && PointStatusEnum.POINT_STATUS_3.getCode().equals(request.getPointStatus())) {
|
||||||
request.setPointStatus(PointStatusEnum.POINT_STATUS_4.getCode());
|
request.setPointStatus(PointStatusEnum.POINT_STATUS_4.getCode());
|
||||||
}
|
}
|
||||||
List<PointPageVO> resultList = new ArrayList();
|
List<PointPageVO> resultList = new ArrayList();
|
||||||
Page<PointInfoDO> pointPage = pointInfoDAO.getTeamPointPage(request);
|
Page<PointInfoDO> pointPage = pointInfoDAO.getTeamPointPage(request);
|
||||||
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
|
if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) {
|
||||||
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||||
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
|
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
|
||||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
|
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
|
||||||
@@ -558,10 +559,10 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Override
|
@Override
|
||||||
public List<PointAuditRecordVO> getPointAllAuditRecord(Long pointId) {
|
public List<PointAuditRecordVO> getPointAllAuditRecord(Long pointId) {
|
||||||
List<PointAuditRecordDO> auditRecordList = pointAuditRecordDAO.getPointAllAuditRecord(pointId);
|
List<PointAuditRecordDO> auditRecordList = pointAuditRecordDAO.getPointAllAuditRecord(pointId);
|
||||||
if(CollectionUtils.isEmpty(auditRecordList)){
|
if (CollectionUtils.isEmpty(auditRecordList)) {
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
List<String> userIds = auditRecordList.stream().map(o->JSONObject.parseArray(o.getHandlerUserIds(), String.class)).flatMap(Collection::stream).distinct().collect(Collectors.toList());
|
List<String> userIds = auditRecordList.stream().map(o -> JSONObject.parseArray(o.getHandlerUserIds(), String.class)).flatMap(Collection::stream).distinct().collect(Collectors.toList());
|
||||||
Map<String, EnterpriseUserDO> userMap = enterpriseUserDAO.getUserInfoMap(userIds);
|
Map<String, EnterpriseUserDO> userMap = enterpriseUserDAO.getUserInfoMap(userIds);
|
||||||
return PointAuditRecordVO.convert(auditRecordList, userMap);
|
return PointAuditRecordVO.convert(auditRecordList, userMap);
|
||||||
}
|
}
|
||||||
@@ -598,7 +599,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
public PageInfo<PointPageVO> getRecommendPointList(RecommendPointPageRequest request) {
|
public PageInfo<PointPageVO> getRecommendPointList(RecommendPointPageRequest request) {
|
||||||
List<PointPageVO> resultList = new ArrayList();
|
List<PointPageVO> resultList = new ArrayList();
|
||||||
Page<PointInfoDO> pointPage = pointInfoDAO.getRecommendPointList(request);
|
Page<PointInfoDO> pointPage = pointInfoDAO.getRecommendPointList(request);
|
||||||
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
|
if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) {
|
||||||
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||||
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
|
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
|
||||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
|
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
|
||||||
@@ -615,26 +616,26 @@ public class PointServiceImpl implements PointService {
|
|||||||
List<Long> pointIds = request.getPointIds();
|
List<Long> pointIds = request.getPointIds();
|
||||||
List<PointInfoDO> pointList = pointInfoDAO.getPointListByIds(pointIds);
|
List<PointInfoDO> pointList = pointInfoDAO.getPointListByIds(pointIds);
|
||||||
List<PointInfoDO> selectList = pointList.stream().filter(o -> SelectStatusEnum.SELECT_STATUS_1.getCode().equals(o.getSelectStatus())).collect(Collectors.toList());
|
List<PointInfoDO> selectList = pointList.stream().filter(o -> SelectStatusEnum.SELECT_STATUS_1.getCode().equals(o.getSelectStatus())).collect(Collectors.toList());
|
||||||
if(CollectionUtils.isNotEmpty(selectList)){
|
if (CollectionUtils.isNotEmpty(selectList)) {
|
||||||
String pointNames = selectList.stream().map(PointInfoDO::getPointName).collect(Collectors.joining(","));
|
String pointNames = selectList.stream().map(PointInfoDO::getPointName).collect(Collectors.joining(","));
|
||||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, pointNames + ",已经被选");
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, pointNames + ",已经被选");
|
||||||
}
|
}
|
||||||
List<PointInfoDO> invalidList = pointList.stream().filter(o -> PointStatusEnum.POINT_STATUS_7.getCode().equals(o.getPointStatus())).collect(Collectors.toList());
|
List<PointInfoDO> invalidList = pointList.stream().filter(o -> PointStatusEnum.POINT_STATUS_7.getCode().equals(o.getPointStatus())).collect(Collectors.toList());
|
||||||
if(CollectionUtils.isNotEmpty(invalidList)){
|
if (CollectionUtils.isNotEmpty(invalidList)) {
|
||||||
String pointNames = invalidList.stream().map(PointInfoDO::getPointName).collect(Collectors.joining(","));
|
String pointNames = invalidList.stream().map(PointInfoDO::getPointName).collect(Collectors.joining(","));
|
||||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, pointNames + ",已失效");
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, pointNames + ",已失效");
|
||||||
}
|
}
|
||||||
List<PointRecommendDO> recommendPointList = pointRecommendDAO.getShopRecommendPointList(request.getShopId());
|
List<PointRecommendDO> recommendPointList = pointRecommendDAO.getShopRecommendPointList(request.getShopId());
|
||||||
if(CollectionUtils.isNotEmpty(recommendPointList)){
|
if (CollectionUtils.isNotEmpty(recommendPointList)) {
|
||||||
List<PointRecommendDO> recommendList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus()) ||
|
List<PointRecommendDO> recommendList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus()) ||
|
||||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(o.getStatus()) ||
|
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(o.getStatus()) ||
|
||||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_4.getCode().equals(o.getStatus()))
|
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_4.getCode().equals(o.getStatus()))
|
||||||
.filter(o->request.getPointIds().contains(o.getPointId())).collect(Collectors.toList());
|
.filter(o -> request.getPointIds().contains(o.getPointId())).collect(Collectors.toList());
|
||||||
if(CollectionUtils.isNotEmpty(recommendList)){
|
if (CollectionUtils.isNotEmpty(recommendList)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "铺位已推送,请勿重复推送");
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "铺位已推送,请勿重复推送");
|
||||||
}
|
}
|
||||||
List<PointRecommendDO> selectedList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(o.getStatus())).filter(o->request.getPointIds().contains(o.getPointId())).collect(Collectors.toList());
|
List<PointRecommendDO> selectedList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(o.getStatus())).filter(o -> request.getPointIds().contains(o.getPointId())).collect(Collectors.toList());
|
||||||
if(CollectionUtils.isNotEmpty(selectedList)){
|
if (CollectionUtils.isNotEmpty(selectedList)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "铺位已选,请勿重复推送");
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "铺位已选,请勿重复推送");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -646,31 +647,31 @@ public class PointServiceImpl implements PointService {
|
|||||||
public Integer pointRecommendLine(PointRecommendLineRequest request) {
|
public Integer pointRecommendLine(PointRecommendLineRequest request) {
|
||||||
Long pointId = request.getPointId();
|
Long pointId = request.getPointId();
|
||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
||||||
if(Objects.isNull(pointInfo)){
|
if (Objects.isNull(pointInfo)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
if(PointStatusEnum.POINT_STATUS_7.getCode().equals(pointInfo.getPointStatus())){
|
if (PointStatusEnum.POINT_STATUS_7.getCode().equals(pointInfo.getPointStatus())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_IS_INVALID);
|
throw new ServiceException(ErrorCodeEnum.POINT_IS_INVALID);
|
||||||
}
|
}
|
||||||
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
if (SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_SELECTED);
|
throw new ServiceException(ErrorCodeEnum.POINT_SELECTED);
|
||||||
}
|
}
|
||||||
List<PointRecommendDO> recommendPointList = pointRecommendDAO.getRecommendPointListByPointId(pointId);
|
List<PointRecommendDO> recommendPointList = pointRecommendDAO.getRecommendPointListByPointId(pointId);
|
||||||
if(CollectionUtils.isNotEmpty(recommendPointList)){
|
if (CollectionUtils.isNotEmpty(recommendPointList)) {
|
||||||
List<PointRecommendDO> recommendList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(o.getStatus()) ||
|
List<PointRecommendDO> recommendList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(o.getStatus()) ||
|
||||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(o.getStatus()) ||
|
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(o.getStatus()) ||
|
||||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_4.getCode().equals(o.getStatus()))
|
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_4.getCode().equals(o.getStatus()))
|
||||||
.filter(o->request.getShopIds().contains(o.getShopId())).collect(Collectors.toList());
|
.filter(o -> request.getShopIds().contains(o.getShopId())).collect(Collectors.toList());
|
||||||
if(CollectionUtils.isNotEmpty(recommendList)){
|
if (CollectionUtils.isNotEmpty(recommendList)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "推送失败,铺位已被选");
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "推送失败,铺位已被选");
|
||||||
}
|
}
|
||||||
List<Long> shopIds = recommendPointList.stream()
|
List<Long> shopIds = recommendPointList.stream()
|
||||||
.filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus()))
|
.filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus()))
|
||||||
.filter(o->request.getShopIds().contains(o.getShopId())).map(PointRecommendDO::getShopId).collect(Collectors.toList());
|
.filter(o -> request.getShopIds().contains(o.getShopId())).map(PointRecommendDO::getShopId).collect(Collectors.toList());
|
||||||
if(CollectionUtils.isNotEmpty(shopIds)){
|
if (CollectionUtils.isNotEmpty(shopIds)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "请勿重复推送");
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "请勿重复推送");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
List<PointRecommendDO> recommendList = request.convertList();
|
List<PointRecommendDO> recommendList = request.convertList();
|
||||||
return pointRecommendDAO.addRecommendPoint(recommendList);
|
return pointRecommendDAO.addRecommendPoint(recommendList);
|
||||||
}
|
}
|
||||||
@@ -696,10 +697,10 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Override
|
@Override
|
||||||
public Integer updateWantShopNum(UpdateWantShopNumRequest request) {
|
public Integer updateWantShopNum(UpdateWantShopNumRequest request) {
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||||
if(Objects.isNull(lineInfo)){
|
if (Objects.isNull(lineInfo)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||||
}
|
}
|
||||||
if(!WorkflowStageEnum.INTENT.getCode().equals(lineInfo.getWorkflowStage())){
|
if (!WorkflowStageEnum.INTENT.getCode().equals(lineInfo.getWorkflowStage())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_MODIFY_WANT_SHOP_NUM);
|
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_MODIFY_WANT_SHOP_NUM);
|
||||||
}
|
}
|
||||||
LineInfoDO updateLine = new LineInfoDO();
|
LineInfoDO updateLine = new LineInfoDO();
|
||||||
@@ -712,7 +713,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
public PageInfo<PointPageVO> getTodoList(PointTodoPageRequest request) {
|
public PageInfo<PointPageVO> getTodoList(PointTodoPageRequest request) {
|
||||||
Page<PointInfoDO> pointPage = pointTodoInfoDAO.getUserTodoList(request);
|
Page<PointInfoDO> pointPage = pointTodoInfoDAO.getUserTodoList(request);
|
||||||
List<PointPageVO> resultList = new ArrayList<>();
|
List<PointPageVO> resultList = new ArrayList<>();
|
||||||
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
|
if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) {
|
||||||
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||||
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
|
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
|
||||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
|
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
|
||||||
@@ -726,16 +727,32 @@ public class PointServiceImpl implements PointService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<MiniPointPageVO> getLineRecommendPointPage(MiniPointPageRequest request) {
|
public PageInfo<MiniPointPageVO> getLineRecommendPointPage(MiniPointPageRequest request) {
|
||||||
Page<MiniPointPageDTO> pointPage = pointRecommendDAO.getLineRecommendPointPage(request);
|
if (Objects.equals(request.getType(), PointListType.POINT_LIST_TYPE_1.getCode())) {
|
||||||
List<MiniPointPageVO> resultList = new ArrayList<>();
|
Page<MiniPointPageDTO> pointPage = pointRecommendDAO.getLineRecommendPointPage(request);
|
||||||
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
|
List<MiniPointPageVO> resultList = new ArrayList<>();
|
||||||
List<Long> regionIds = pointPage.getResult().stream().map(MiniPointPageDTO::getRegionId).distinct().collect(Collectors.toList());
|
if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) {
|
||||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
List<Long> regionIds = pointPage.getResult().stream().map(MiniPointPageDTO::getRegionId).distinct().collect(Collectors.toList());
|
||||||
resultList = MiniPointPageVO.convertVO(pointPage, regionNameMap);
|
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||||
|
resultList = MiniPointPageVO.convertVO(pointPage, regionNameMap);
|
||||||
|
List<Long> pointList = pointPage.getResult().stream().map(MiniPointPageDTO::getPointId).distinct().collect(Collectors.toList());
|
||||||
|
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());
|
||||||
|
x.setMonthRent(pointDetailInfoDO.getMonthRent());
|
||||||
|
x.setLandlordMobile(pointDetailInfoDO.getLandlordMobile());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
PageInfo resultPage = new PageInfo(pointPage);
|
||||||
|
resultPage.setList(resultList);
|
||||||
|
return resultPage;
|
||||||
}
|
}
|
||||||
PageInfo resultPage = new PageInfo(pointPage);
|
if (request.getType().equals(PointListType.POINT_LIST_TYPE_2.getCode())){
|
||||||
resultPage.setList(resultList);
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
return resultPage;
|
List<MiniPointPageVO> miniPointPage = pointInfoDAO.getMiniPointPage(request.getLineId());
|
||||||
|
return new PageInfo<>(miniPointPage);
|
||||||
|
}
|
||||||
|
return new PageInfo<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -743,27 +760,27 @@ public class PointServiceImpl implements PointService {
|
|||||||
public Integer lineSelectPoint(SelectPointRequest request) {
|
public Integer lineSelectPoint(SelectPointRequest request) {
|
||||||
Long pointId = request.getPointId(), shopId = request.getShopId(), lineId = request.getLineId();
|
Long pointId = request.getPointId(), shopId = request.getShopId(), lineId = request.getLineId();
|
||||||
String lockKey = MessageFormat.format(POINT_SELECT_KEY, enterpriseId, pointId);
|
String lockKey = MessageFormat.format(POINT_SELECT_KEY, enterpriseId, pointId);
|
||||||
if(!redisUtilPool.setNxExpire(lockKey, JSONObject.toJSONString(request), 30*1000)){
|
if (!redisUtilPool.setNxExpire(lockKey, JSONObject.toJSONString(request), 30 * 1000)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_IS_LOCK);
|
throw new ServiceException(ErrorCodeEnum.POINT_IS_LOCK);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||||
if(Objects.isNull(shopInfo)){
|
if (Objects.isNull(shopInfo)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||||
}
|
}
|
||||||
if(!ShopStageEnum.SHOP_STAGE_1.getShopStage().equals(shopInfo.getShopStage())){
|
if (!ShopStageEnum.SHOP_STAGE_1.getShopStage().equals(shopInfo.getShopStage())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
||||||
}
|
}
|
||||||
if(Objects.nonNull(shopInfo.getPointId())){
|
if (Objects.nonNull(shopInfo.getPointId())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.SHOP_IS_SELECTED);
|
throw new ServiceException(ErrorCodeEnum.SHOP_IS_SELECTED);
|
||||||
}
|
}
|
||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
||||||
if(Objects.isNull(pointInfo)){
|
if (Objects.isNull(pointInfo)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
if (SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())) {
|
||||||
if(lineId.equals(pointInfo.getLineId())){
|
if (lineId.equals(pointInfo.getLineId())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_ALREADY_SELECT);
|
throw new ServiceException(ErrorCodeEnum.POINT_ALREADY_SELECT);
|
||||||
}
|
}
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_IS_SELECTED);
|
throw new ServiceException(ErrorCodeEnum.POINT_IS_SELECTED);
|
||||||
}
|
}
|
||||||
@@ -787,7 +804,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
pointDetailInfoDAO.updatePointDetailInfo(updateDetail);
|
pointDetailInfoDAO.updatePointDetailInfo(updateDetail);
|
||||||
List<ShopSubStageStatusEnum> updateStatusList = new ArrayList<>();
|
List<ShopSubStageStatusEnum> updateStatusList = new ArrayList<>();
|
||||||
//如果铺位是已审核 则进入上传租赁合同状态
|
//如果铺位是已审核 则进入上传租赁合同状态
|
||||||
if(PointStatusEnum.POINT_STATUS_5.getCode().equals(pointInfo.getPointStatus())){
|
if (PointStatusEnum.POINT_STATUS_5.getCode().equals(pointInfo.getPointStatus())) {
|
||||||
selectStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_12;
|
selectStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_12;
|
||||||
updateStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20);
|
updateStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20);
|
||||||
Map<String, String> templateParam = new HashMap<>();
|
Map<String, String> templateParam = new HashMap<>();
|
||||||
@@ -795,11 +812,11 @@ public class PointServiceImpl implements PointService {
|
|||||||
}
|
}
|
||||||
updateStatusList.add(selectStatus);
|
updateStatusList.add(selectStatus);
|
||||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, updateStatusList);
|
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, updateStatusList);
|
||||||
if (selectStatus.equals( ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_11)){
|
if (selectStatus.equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_11)) {
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
map.put("pointName",pointInfo.getPointName()) ;
|
map.put("pointName", pointInfo.getPointName());
|
||||||
map.put("pointAddress",pointInfo.getAddress());
|
map.put("pointAddress", pointInfo.getAddress());
|
||||||
commonService.sendQWMessage(Collections.singletonList(shopInfo.getInvestmentManager()),
|
commonService.sendQWMessage(Collections.singletonList(shopInfo.getInvestmentManager()),
|
||||||
MessageEnum.MESSAGE_13,
|
MessageEnum.MESSAGE_13,
|
||||||
map);
|
map);
|
||||||
@@ -811,9 +828,10 @@ public class PointServiceImpl implements PointService {
|
|||||||
redisUtilPool.delKey(lockKey);
|
redisUtilPool.delKey(lockKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer lineRejectPoint(RejectPointRequest request){
|
public Integer lineRejectPoint(RejectPointRequest request) {
|
||||||
return pointRecommendDAO.rejectPoint(request.getShopId(), request.getPointId(), request.getReason());
|
return pointRecommendDAO.rejectPoint(request.getShopId(), request.getPointId(), request.getReason());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -823,14 +841,14 @@ public class PointServiceImpl implements PointService {
|
|||||||
public Long miniAddPointDetailInfo(MiniAddPointRequest request) {
|
public Long miniAddPointDetailInfo(MiniAddPointRequest request) {
|
||||||
Long lineId = request.getCurLineId();
|
Long lineId = request.getCurLineId();
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||||
if(Objects.isNull(lineInfo)){
|
if (Objects.isNull(lineInfo)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||||
}
|
}
|
||||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||||
if(Objects.isNull(shopInfo)){
|
if (Objects.isNull(shopInfo)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||||
}
|
}
|
||||||
if(Objects.nonNull(shopInfo.getPointId())){
|
if (Objects.nonNull(shopInfo.getPointId())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.SHOP_IS_SELECTED);
|
throw new ServiceException(ErrorCodeEnum.SHOP_IS_SELECTED);
|
||||||
}
|
}
|
||||||
PointDetailInfoDO pointDetailInfo = MiniAddPointRequest.convertDO(request);
|
PointDetailInfoDO pointDetailInfo = MiniAddPointRequest.convertDO(request);
|
||||||
@@ -843,6 +861,8 @@ public class PointServiceImpl implements PointService {
|
|||||||
pointInfo.setDevelopmentTime(new Date());
|
pointInfo.setDevelopmentTime(new Date());
|
||||||
pointInfo.setPointSource(PointSourceEnum.POINT_SOURCE_2.getCode());
|
pointInfo.setPointSource(PointSourceEnum.POINT_SOURCE_2.getCode());
|
||||||
pointInfo.setPointCode(generateCode());
|
pointInfo.setPointCode(generateCode());
|
||||||
|
pointInfo.setOpportunityPointName(request.getOpportunityPointName());
|
||||||
|
pointInfo.setOpportunityPointCode(request.getOpportunityPointCode());
|
||||||
Long pointId = pointInfoDAO.addPointInfo(pointInfo);
|
Long pointId = pointInfoDAO.addPointInfo(pointInfo);
|
||||||
pointDetailInfo.setPointId(pointId);
|
pointDetailInfo.setPointId(pointId);
|
||||||
pointDetailInfoDAO.addPointDetailInfo(pointDetailInfo);
|
pointDetailInfoDAO.addPointDetailInfo(pointDetailInfo);
|
||||||
@@ -864,9 +884,9 @@ public class PointServiceImpl implements PointService {
|
|||||||
updatePoint.setShopId(shopInfo.getId());
|
updatePoint.setShopId(shopInfo.getId());
|
||||||
pointInfoDAO.updatePointInfo(updatePoint);
|
pointInfoDAO.updatePointInfo(updatePoint);
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
map.put("partnerUsername",lineInfo.getUsername());
|
map.put("partnerUsername", lineInfo.getUsername());
|
||||||
map.put("partnerMobile",lineInfo.getMobile());
|
map.put("partnerMobile", lineInfo.getMobile());
|
||||||
map.put("pointName",pointInfo.getPointName()) ;
|
map.put("pointName", pointInfo.getPointName());
|
||||||
commonService.sendQWMessage(Collections.singletonList(shopInfo.getInvestmentManager()),
|
commonService.sendQWMessage(Collections.singletonList(shopInfo.getInvestmentManager()),
|
||||||
MessageEnum.MESSAGE_51,
|
MessageEnum.MESSAGE_51,
|
||||||
map);
|
map);
|
||||||
@@ -874,25 +894,25 @@ public class PointServiceImpl implements PointService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer uploadRentContract(AddRentContractRequest request){
|
public Integer uploadRentContract(AddRentContractRequest request) {
|
||||||
if(!request.check()){
|
if (!request.check()) {
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
}
|
}
|
||||||
Long pointId = request.getPointId(), shopId = request.getShopId();
|
Long pointId = request.getPointId(), shopId = request.getShopId();
|
||||||
if(Objects.isNull(pointId) && Objects.nonNull(shopId)){
|
if (Objects.isNull(pointId) && Objects.nonNull(shopId)) {
|
||||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||||
pointId = shopInfo.getPointId();
|
pointId = shopInfo.getPointId();
|
||||||
}
|
}
|
||||||
if(Objects.nonNull(pointId) && Objects.isNull(shopId)){
|
if (Objects.nonNull(pointId) && Objects.isNull(shopId)) {
|
||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
||||||
shopId = pointInfo.getShopId();
|
shopId = pointInfo.getShopId();
|
||||||
}
|
}
|
||||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_2);
|
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_2);
|
||||||
if(Objects.isNull(shopSubStageInfo)){
|
if (Objects.isNull(shopSubStageInfo)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_ERROR);
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_ERROR);
|
||||||
}
|
}
|
||||||
List<Integer> operateStatusList = Lists.newArrayList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20.getShopSubStageStatus(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22.getShopSubStageStatus());
|
List<Integer> operateStatusList = Lists.newArrayList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20.getShopSubStageStatus(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22.getShopSubStageStatus());
|
||||||
if(!operateStatusList.contains(shopSubStageInfo.getShopSubStageStatus())){
|
if (!operateStatusList.contains(shopSubStageInfo.getShopSubStageStatus())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
||||||
}
|
}
|
||||||
//是否存在租赁合同
|
//是否存在租赁合同
|
||||||
@@ -900,16 +920,16 @@ public class PointServiceImpl implements PointService {
|
|||||||
ShopRentInfoDO shopRentInfo = AddRentContractRequest.convertDO(request);
|
ShopRentInfoDO shopRentInfo = AddRentContractRequest.convertDO(request);
|
||||||
shopRentInfo.setShopId(shopId);
|
shopRentInfo.setShopId(shopId);
|
||||||
shopRentInfo.setPointId(pointId);
|
shopRentInfo.setPointId(pointId);
|
||||||
if(Objects.isNull(rentContract)){
|
if (Objects.isNull(rentContract)) {
|
||||||
shopRentInfoDAO.addShopRentInfo(shopRentInfo);
|
shopRentInfoDAO.addShopRentInfo(shopRentInfo);
|
||||||
}else{
|
} else {
|
||||||
shopRentInfo.setId(rentContract.getId());
|
shopRentInfo.setId(rentContract.getId());
|
||||||
shopRentInfoDAO.updateRentContract(shopRentInfo);
|
shopRentInfoDAO.updateRentContract(shopRentInfo);
|
||||||
}
|
}
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopSubStageInfo.getLineId());
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopSubStageInfo.getLineId());
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
map.put("partnerUsername",lineInfo.getUsername());
|
map.put("partnerUsername", lineInfo.getUsername());
|
||||||
map.put("partnerMobile",lineInfo.getMobile());
|
map.put("partnerMobile", lineInfo.getMobile());
|
||||||
commonService.sendQWMessage(Collections.singletonList(lineInfo.getInvestmentManager()),
|
commonService.sendQWMessage(Collections.singletonList(lineInfo.getInvestmentManager()),
|
||||||
MessageEnum.MESSAGE_15,
|
MessageEnum.MESSAGE_15,
|
||||||
map);
|
map);
|
||||||
@@ -919,7 +939,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
@Override
|
@Override
|
||||||
public ShopRentInfoVO getRentContractDetail(Long shopId) {
|
public ShopRentInfoVO getRentContractDetail(Long shopId) {
|
||||||
ShopRentInfoDO rentContract = shopRentInfoDAO.getRentContractByShopId(shopId);
|
ShopRentInfoDO rentContract = shopRentInfoDAO.getRentContractByShopId(shopId);
|
||||||
if(Objects.isNull(rentContract)){
|
if (Objects.isNull(rentContract)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
ShopRentInfoVO result = ShopRentInfoVO.build(rentContract);
|
ShopRentInfoVO result = ShopRentInfoVO.build(rentContract);
|
||||||
@@ -927,7 +947,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
result.setStatus(shopSubStageInfo.getShopSubStageStatus());
|
result.setStatus(shopSubStageInfo.getShopSubStageStatus());
|
||||||
boolean isAudit = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus()) ||
|
boolean isAudit = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus()) ||
|
||||||
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus());
|
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus());
|
||||||
if(Objects.nonNull(shopSubStageInfo.getAuditId()) && isAudit){
|
if (Objects.nonNull(shopSubStageInfo.getAuditId()) && isAudit) {
|
||||||
//当前是审核过的状态才获取原因
|
//当前是审核过的状态才获取原因
|
||||||
ShopAuditInfoDO auditInfo = shopAuditInfoDAO.getAuditInfo(shopSubStageInfo.getAuditId());
|
ShopAuditInfoDO auditInfo = shopAuditInfoDAO.getAuditInfo(shopSubStageInfo.getAuditId());
|
||||||
result.setAuditInfo(AuditInfoVO.convertVO(auditInfo));
|
result.setAuditInfo(AuditInfoVO.convertVO(auditInfo));
|
||||||
@@ -944,14 +964,14 @@ public class PointServiceImpl implements PointService {
|
|||||||
public Integer auditRentContract(AuditRentContractRequest request) {
|
public Integer auditRentContract(AuditRentContractRequest request) {
|
||||||
Long shopId = request.getShopId();
|
Long shopId = request.getShopId();
|
||||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||||
if(Objects.isNull(shopInfo)){
|
if (Objects.isNull(shopInfo)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||||
}
|
}
|
||||||
if(!ShopStageEnum.SHOP_STAGE_1.getShopStage().equals(shopInfo.getShopStage())){
|
if (!ShopStageEnum.SHOP_STAGE_1.getShopStage().equals(shopInfo.getShopStage())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
||||||
}
|
}
|
||||||
ShopStageInfoDO shopStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_2);
|
ShopStageInfoDO shopStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_2);
|
||||||
if (!shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus())){
|
if (!shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||||
}
|
}
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||||
@@ -962,10 +982,10 @@ public class PointServiceImpl implements PointService {
|
|||||||
Long auditId = shopAuditInfoDAO.addAuditInfo(AuditRentContractRequest.convert(request, AuditTypeEnum.UPLOAD_RENT_CONTRACT));
|
Long auditId = shopAuditInfoDAO.addAuditInfo(AuditRentContractRequest.convert(request, AuditTypeEnum.UPLOAD_RENT_CONTRACT));
|
||||||
|
|
||||||
ShopSubStageStatusEnum subStageStatus = AuditResultTypeEnum.PASS.getCode().equals(request.getResultType()) ? ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23 : ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22;
|
ShopSubStageStatusEnum subStageStatus = AuditResultTypeEnum.PASS.getCode().equals(request.getResultType()) ? ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23 : ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22;
|
||||||
if(AuditResultTypeEnum.REJECT.getCode().equals(request.getResultType())){
|
if (AuditResultTypeEnum.REJECT.getCode().equals(request.getResultType())) {
|
||||||
//commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.RENT_CONTRACT_AUDIT_FAIL, null);
|
//commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.RENT_CONTRACT_AUDIT_FAIL, null);
|
||||||
}
|
}
|
||||||
if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23.equals(subStageStatus)){
|
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23.equals(subStageStatus)) {
|
||||||
//审核通过铺位变为已签约
|
//审核通过铺位变为已签约
|
||||||
PointInfoDO updatePoint = new PointInfoDO();
|
PointInfoDO updatePoint = new PointInfoDO();
|
||||||
updatePoint.setId(shopInfo.getPointId());
|
updatePoint.setId(shopInfo.getPointId());
|
||||||
@@ -976,17 +996,17 @@ public class PointServiceImpl implements PointService {
|
|||||||
updateShop.setShopStage(ShopStageEnum.SHOP_STAGE_2.getShopStage());
|
updateShop.setShopStage(ShopStageEnum.SHOP_STAGE_2.getShopStage());
|
||||||
List<UserRoleEnum> roleList = Arrays.asList(UserRoleEnum.THEATER_MANAGER, UserRoleEnum.OPERATIONS_MANAGER, UserRoleEnum.REGION_MANAGER);
|
List<UserRoleEnum> roleList = Arrays.asList(UserRoleEnum.THEATER_MANAGER, UserRoleEnum.OPERATIONS_MANAGER, UserRoleEnum.REGION_MANAGER);
|
||||||
String shopManagerUserId = sysRoleService.getUserIdByRegionIdWithRolePriority(shopInfo.getRegionId(), roleList);
|
String shopManagerUserId = sysRoleService.getUserIdByRegionIdWithRolePriority(shopInfo.getRegionId(), roleList);
|
||||||
if(StringUtils.isBlank(shopManagerUserId)){
|
if (StringUtils.isBlank(shopManagerUserId)) {
|
||||||
shopManagerUserId = userAuthMappingService.getShopManagerUserId();
|
shopManagerUserId = userAuthMappingService.getShopManagerUserId();
|
||||||
}
|
}
|
||||||
updateShop.setShopManagerUserId(shopManagerUserId);
|
updateShop.setShopManagerUserId(shopManagerUserId);
|
||||||
shopInfoDAO.updateShopInfo(updateShop);
|
shopInfoDAO.updateShopInfo(updateShop);
|
||||||
//发送工作通知
|
//发送工作通知
|
||||||
Map<String, String> requestMap = new HashMap<>();
|
Map<String, String> requestMap = new HashMap<>();
|
||||||
requestMap.put("partnerName",lineInfo.getUsername());
|
requestMap.put("partnerName", lineInfo.getUsername());
|
||||||
requestMap.put("partnerMobile",lineInfo.getMobile());
|
requestMap.put("partnerMobile", lineInfo.getMobile());
|
||||||
requestMap.put("lineId",String.valueOf(lineInfo.getId()));
|
requestMap.put("lineId", String.valueOf(lineInfo.getId()));
|
||||||
requestMap.put("shopId",String.valueOf(shopId));
|
requestMap.put("shopId", String.valueOf(shopId));
|
||||||
// if (Objects.nonNull(shopInfo.getShopName())) {
|
// if (Objects.nonNull(shopInfo.getShopName())) {
|
||||||
// requestMap.put("storeName",shopInfo.getShopName());
|
// requestMap.put("storeName",shopInfo.getShopName());
|
||||||
// commonService.sendMessage(Arrays.asList(lineInfo.getInvestmentManager()),MessageEnum.MESSAGE_16,requestMap);
|
// commonService.sendMessage(Arrays.asList(lineInfo.getInvestmentManager()),MessageEnum.MESSAGE_16,requestMap);
|
||||||
@@ -1000,18 +1020,18 @@ public class PointServiceImpl implements PointService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer updateRentContract(UpdateRentContractRequest request){
|
public Integer updateRentContract(UpdateRentContractRequest request) {
|
||||||
if(!request.check()){
|
if (!request.check()) {
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
}
|
}
|
||||||
ShopRentInfoDO shopRentInfo = UpdateRentContractRequest.convertDO(request);
|
ShopRentInfoDO shopRentInfo = UpdateRentContractRequest.convertDO(request);
|
||||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_2);
|
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_2);
|
||||||
if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){
|
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())) {
|
||||||
shopStageInfoDAO.updateShopStageAndAuditInfo(shopRentInfo.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21, null);
|
shopStageInfoDAO.updateShopStageAndAuditInfo(shopRentInfo.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21, null);
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopSubStageInfo.getLineId());
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopSubStageInfo.getLineId());
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
map.put("partnerUsername",lineInfo.getUsername());
|
map.put("partnerUsername", lineInfo.getUsername());
|
||||||
map.put("partnerMobile",lineInfo.getMobile());
|
map.put("partnerMobile", lineInfo.getMobile());
|
||||||
commonService.sendQWMessage(Collections.singletonList(lineInfo.getInvestmentManager()),
|
commonService.sendQWMessage(Collections.singletonList(lineInfo.getInvestmentManager()),
|
||||||
MessageEnum.MESSAGE_15,
|
MessageEnum.MESSAGE_15,
|
||||||
map);
|
map);
|
||||||
@@ -1027,7 +1047,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
request.setPageSize(pageSize);
|
request.setPageSize(pageSize);
|
||||||
Page<PointInfoDO> pointPage = pointTodoInfoDAO.getUserTodoList(request);
|
Page<PointInfoDO> pointPage = pointTodoInfoDAO.getUserTodoList(request);
|
||||||
List<PointToDoVO> resultList = new ArrayList<>();
|
List<PointToDoVO> resultList = new ArrayList<>();
|
||||||
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
|
if (Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())) {
|
||||||
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||||
List<Long> pointIds = pointPage.stream().map(PointInfoDO::getId).collect(Collectors.toList());
|
List<Long> pointIds = pointPage.stream().map(PointInfoDO::getId).collect(Collectors.toList());
|
||||||
//获取提交时间
|
//获取提交时间
|
||||||
@@ -1044,17 +1064,17 @@ public class PointServiceImpl implements PointService {
|
|||||||
public PageInfo<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNumber, Integer pageSize) {
|
public PageInfo<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNumber, Integer pageSize) {
|
||||||
Page<RentInfoToDoVO> todoPage = shopStageInfoDAO.getRentContractToDoPage(userId, pageNumber, pageSize);
|
Page<RentInfoToDoVO> todoPage = shopStageInfoDAO.getRentContractToDoPage(userId, pageNumber, pageSize);
|
||||||
List<RentInfoToDoVO> resultList = null;
|
List<RentInfoToDoVO> resultList = null;
|
||||||
if(Objects.nonNull(todoPage) && CollectionUtils.isNotEmpty(todoPage.getResult())){
|
if (Objects.nonNull(todoPage) && CollectionUtils.isNotEmpty(todoPage.getResult())) {
|
||||||
List<Long> shopIds = todoPage.getResult().stream().map(RentInfoToDoVO::getShopId).collect(Collectors.toList());
|
List<Long> shopIds = todoPage.getResult().stream().map(RentInfoToDoVO::getShopId).collect(Collectors.toList());
|
||||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopListByIds(shopIds);
|
List<ShopInfoDO> shopList = shopInfoDAO.getShopListByIds(shopIds);
|
||||||
Map<Long, ShopInfoDO> shopPointMap = shopList.stream().collect(Collectors.toMap(k->k.getId(), Function.identity()));
|
Map<Long, ShopInfoDO> shopPointMap = shopList.stream().collect(Collectors.toMap(k -> k.getId(), Function.identity()));
|
||||||
List<Long> regionIds = shopList.stream().map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
List<Long> regionIds = shopList.stream().map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||||
List<Long> pointIds = shopList.stream().map(ShopInfoDO::getPointId).collect(Collectors.toList());
|
List<Long> pointIds = shopList.stream().map(ShopInfoDO::getPointId).collect(Collectors.toList());
|
||||||
List<PointInfoDO> pointList = pointInfoDAO.getPointListByIds(pointIds);
|
List<PointInfoDO> pointList = pointInfoDAO.getPointListByIds(pointIds);
|
||||||
Map<Long, PointInfoDO> pointMap = ListUtils.emptyIfNull(pointList).stream().collect(Collectors.toMap(k->k.getId(), Function.identity()));
|
Map<Long, PointInfoDO> pointMap = ListUtils.emptyIfNull(pointList).stream().collect(Collectors.toMap(k -> k.getId(), Function.identity()));
|
||||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||||
List<ShopRentInfoDO> rentContractList = shopRentInfoDAO.getRentContractByShopIds(shopIds);
|
List<ShopRentInfoDO> rentContractList = shopRentInfoDAO.getRentContractByShopIds(shopIds);
|
||||||
Map<Long, Date> rentContractSubmitTimeMap = ListUtils.emptyIfNull(rentContractList).stream().collect(Collectors.toMap(k->k.getShopId(), v->v.getCreateTime()));
|
Map<Long, Date> rentContractSubmitTimeMap = ListUtils.emptyIfNull(rentContractList).stream().collect(Collectors.toMap(k -> k.getShopId(), v -> v.getCreateTime()));
|
||||||
resultList = RentInfoToDoVO.convert(todoPage, shopPointMap, pointMap, regionNameMap, rentContractSubmitTimeMap);
|
resultList = RentInfoToDoVO.convert(todoPage, shopPointMap, pointMap, regionNameMap, rentContractSubmitTimeMap);
|
||||||
}
|
}
|
||||||
PageInfo resultPage = new PageInfo(todoPage);
|
PageInfo resultPage = new PageInfo(todoPage);
|
||||||
@@ -1067,55 +1087,55 @@ public class PointServiceImpl implements PointService {
|
|||||||
public Boolean linePointToShopPoint(Long lineId) {
|
public Boolean linePointToShopPoint(Long lineId) {
|
||||||
//查询所有的推荐 如果传入的lineId 则查询该线索的所有推荐
|
//查询所有的推荐 如果传入的lineId 则查询该线索的所有推荐
|
||||||
List<PointRecommendDO> allRecommendPointList = pointRecommendDAO.getAllRecommendPointList(lineId);
|
List<PointRecommendDO> allRecommendPointList = pointRecommendDAO.getAllRecommendPointList(lineId);
|
||||||
if (CollectionUtils.isEmpty(allRecommendPointList)){
|
if (CollectionUtils.isEmpty(allRecommendPointList)) {
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
List<PointRecommendDO> recommendList = new ArrayList<>();
|
List<PointRecommendDO> recommendList = new ArrayList<>();
|
||||||
List<PointRecommendDO> updateList = new ArrayList<>();
|
List<PointRecommendDO> updateList = new ArrayList<>();
|
||||||
allRecommendPointList.forEach(recommend -> {
|
allRecommendPointList.forEach(recommend -> {
|
||||||
//如果是待选择
|
//如果是待选择
|
||||||
if(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(recommend.getStatus())||
|
if (PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(recommend.getStatus()) ||
|
||||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_5.getCode().equals(recommend.getStatus())||
|
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_5.getCode().equals(recommend.getStatus()) ||
|
||||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_6.getCode().equals(recommend.getStatus())){
|
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_6.getCode().equals(recommend.getStatus())) {
|
||||||
//将单条加盟商数据 分配到各个门店商
|
//将单条加盟商数据 分配到各个门店商
|
||||||
Long tempLineId = recommend.getLineId();
|
Long tempLineId = recommend.getLineId();
|
||||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(tempLineId);
|
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(tempLineId);
|
||||||
for (ShopInfoDO shopInfoDO : shopList) {
|
for (ShopInfoDO shopInfoDO : shopList) {
|
||||||
PointRecommendDO tempPointRecommendDO = new PointRecommendDO();
|
PointRecommendDO tempPointRecommendDO = new PointRecommendDO();
|
||||||
BeanUtil.copyProperties(recommend,tempPointRecommendDO);
|
BeanUtil.copyProperties(recommend, tempPointRecommendDO);
|
||||||
tempPointRecommendDO.setShopId(shopInfoDO.getId());
|
tempPointRecommendDO.setShopId(shopInfoDO.getId());
|
||||||
recommendList.add(tempPointRecommendDO);
|
recommendList.add(tempPointRecommendDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//已选 已被他人选择
|
//已选 已被他人选择
|
||||||
if(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(recommend.getStatus())){
|
if (PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(recommend.getStatus())) {
|
||||||
//查询该加盟商选择的这个店
|
//查询该加盟商选择的这个店
|
||||||
ShopInfoDO shopInfoByPointId = shopInfoDAO.getShopInfoByPointId(recommend.getLineId(), recommend.getPointId());
|
ShopInfoDO shopInfoByPointId = shopInfoDAO.getShopInfoByPointId(recommend.getLineId(), recommend.getPointId());
|
||||||
recommend.setShopId(shopInfoByPointId.getId());
|
recommend.setShopId(shopInfoByPointId.getId());
|
||||||
updateList.add(recommend);
|
updateList.add(recommend);
|
||||||
}
|
}
|
||||||
if(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(recommend.getStatus())){
|
if (PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(recommend.getStatus())) {
|
||||||
List<PointRecommendDO> recommendPointListByPointId = pointRecommendDAO.getRecommendPointListByPointId(recommend.getPointId());
|
List<PointRecommendDO> recommendPointListByPointId = pointRecommendDAO.getRecommendPointListByPointId(recommend.getPointId());
|
||||||
for (PointRecommendDO pointRecommendDO: recommendPointListByPointId) {
|
for (PointRecommendDO pointRecommendDO : recommendPointListByPointId) {
|
||||||
//表示当前门店已选址
|
//表示当前门店已选址
|
||||||
if (pointRecommendDO.getLineId().equals(recommend.getLineId())){
|
if (pointRecommendDO.getLineId().equals(recommend.getLineId())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(pointRecommendDO.getLineId());
|
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(pointRecommendDO.getLineId());
|
||||||
for (ShopInfoDO shopInfoDO : shopList) {
|
for (ShopInfoDO shopInfoDO : shopList) {
|
||||||
PointRecommendDO tempPointRecommendDO = new PointRecommendDO();
|
PointRecommendDO tempPointRecommendDO = new PointRecommendDO();
|
||||||
BeanUtil.copyProperties(recommend,tempPointRecommendDO);
|
BeanUtil.copyProperties(recommend, tempPointRecommendDO);
|
||||||
tempPointRecommendDO.setShopId(shopInfoDO.getId());
|
tempPointRecommendDO.setShopId(shopInfoDO.getId());
|
||||||
recommendList.add(tempPointRecommendDO);
|
recommendList.add(tempPointRecommendDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (CollectionUtils.isNotEmpty(updateList)){
|
if (CollectionUtils.isNotEmpty(updateList)) {
|
||||||
pointRecommendDAO.batchUpdateShopId(updateList);
|
pointRecommendDAO.batchUpdateShopId(updateList);
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(recommendList)){
|
if (CollectionUtils.isNotEmpty(recommendList)) {
|
||||||
log.info("linePointToShopPoint recommendList:{}", JSONObject.toJSONString(recommendList));
|
log.info("linePointToShopPoint recommendList:{}", JSONObject.toJSONString(recommendList));
|
||||||
pointRecommendDAO.addRecommendPoint(recommendList);
|
pointRecommendDAO.addRecommendPoint(recommendList);
|
||||||
}
|
}
|
||||||
@@ -1127,7 +1147,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
List<String> roleIds = new ArrayList<>();
|
List<String> roleIds = new ArrayList<>();
|
||||||
//审核人
|
//审核人
|
||||||
Pair<List<String>, List<String>> firstApproval = getUserIdsAndPositionIds(auditSetting.getFirstApproval());
|
Pair<List<String>, List<String>> firstApproval = getUserIdsAndPositionIds(auditSetting.getFirstApproval());
|
||||||
if(CollectionUtils.isNotEmpty(firstApproval.getValue())){
|
if (CollectionUtils.isNotEmpty(firstApproval.getValue())) {
|
||||||
roleIds.addAll(firstApproval.getValue());
|
roleIds.addAll(firstApproval.getValue());
|
||||||
}
|
}
|
||||||
List<AuditNodeDTO> resultList = new ArrayList<>();
|
List<AuditNodeDTO> resultList = new ArrayList<>();
|
||||||
@@ -1135,7 +1155,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
List<String> firstApprovalUserIds = getUserIdsByPositionIds(firstApproval, userIdsMap);
|
List<String> firstApprovalUserIds = getUserIdsByPositionIds(firstApproval, userIdsMap);
|
||||||
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_0.getCode(), PointAuditRecordDO.SUBMIT_TASK, Boolean.FALSE, Arrays.asList(developmentManager)));
|
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_0.getCode(), PointAuditRecordDO.SUBMIT_TASK, Boolean.FALSE, Arrays.asList(developmentManager)));
|
||||||
//todo 缺少兜底人
|
//todo 缺少兜底人
|
||||||
if(CollectionUtils.isNotEmpty(firstApprovalUserIds)){
|
if (CollectionUtils.isNotEmpty(firstApprovalUserIds)) {
|
||||||
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_1.getCode(), PointAuditRecordDO.RECEIVE_TASK, Boolean.TRUE, firstApprovalUserIds));
|
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_1.getCode(), PointAuditRecordDO.RECEIVE_TASK, Boolean.TRUE, firstApprovalUserIds));
|
||||||
}
|
}
|
||||||
return resultList;
|
return resultList;
|
||||||
@@ -1146,7 +1166,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
* @param requests
|
* @param requests
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Pair<List<String>, List<String>> getUserIdsAndPositionIds(List<UserAndPositionRequest> requests){
|
private Pair<List<String>, List<String>> getUserIdsAndPositionIds(List<UserAndPositionRequest> requests) {
|
||||||
List<String> positionIds = ListUtils.emptyIfNull(requests).stream().filter(o -> "position".equals(o.getType())).map(UserAndPositionRequest::getValue).collect(Collectors.toList());
|
List<String> positionIds = ListUtils.emptyIfNull(requests).stream().filter(o -> "position".equals(o.getType())).map(UserAndPositionRequest::getValue).collect(Collectors.toList());
|
||||||
List<String> userIds = ListUtils.emptyIfNull(requests).stream().filter(o -> "person".equals(o.getType())).map(UserAndPositionRequest::getValue).collect(Collectors.toList());
|
List<String> userIds = ListUtils.emptyIfNull(requests).stream().filter(o -> "person".equals(o.getType())).map(UserAndPositionRequest::getValue).collect(Collectors.toList());
|
||||||
return Pair.of(userIds, positionIds);
|
return Pair.of(userIds, positionIds);
|
||||||
@@ -1160,13 +1180,13 @@ public class PointServiceImpl implements PointService {
|
|||||||
*/
|
*/
|
||||||
private List<String> getUserIdsByPositionIds(Pair<List<String>, List<String>> userIdsAndPositionIds, Map<String, List<String>> userIdsMap) {
|
private List<String> getUserIdsByPositionIds(Pair<List<String>, List<String>> userIdsAndPositionIds, Map<String, List<String>> userIdsMap) {
|
||||||
Set<String> userIds = new HashSet<>();
|
Set<String> userIds = new HashSet<>();
|
||||||
if(CollectionUtils.isNotEmpty(userIdsAndPositionIds.getKey())){
|
if (CollectionUtils.isNotEmpty(userIdsAndPositionIds.getKey())) {
|
||||||
userIds.addAll(userIdsAndPositionIds.getKey());
|
userIds.addAll(userIdsAndPositionIds.getKey());
|
||||||
}
|
}
|
||||||
if(CollectionUtils.isNotEmpty(userIdsAndPositionIds.getValue())){
|
if (CollectionUtils.isNotEmpty(userIdsAndPositionIds.getValue())) {
|
||||||
userIdsAndPositionIds.getValue().forEach(positionId -> {
|
userIdsAndPositionIds.getValue().forEach(positionId -> {
|
||||||
List<String> userIdList = userIdsMap.get(positionId);
|
List<String> userIdList = userIdsMap.get(positionId);
|
||||||
if(CollectionUtils.isNotEmpty(userIdList)){
|
if (CollectionUtils.isNotEmpty(userIdList)) {
|
||||||
userIds.addAll(userIdList);
|
userIds.addAll(userIdList);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1174,14 +1194,14 @@ public class PointServiceImpl implements PointService {
|
|||||||
return new ArrayList<>(userIds);
|
return new ArrayList<>(userIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PointAuditRecordDO getNextAuditRecord(Integer currentNodeNo, Map<Integer, PointAuditRecordDO> auditRecordMap){
|
private PointAuditRecordDO getNextAuditRecord(Integer currentNodeNo, Map<Integer, PointAuditRecordDO> auditRecordMap) {
|
||||||
List<NodeNoEnum> nextNodeNoList = NodeNoEnum.getNextNodeNoList(currentNodeNo);
|
List<NodeNoEnum> nextNodeNoList = NodeNoEnum.getNextNodeNoList(currentNodeNo);
|
||||||
if(CollectionUtils.isEmpty(nextNodeNoList)){
|
if (CollectionUtils.isEmpty(nextNodeNoList)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
for (NodeNoEnum nodeNoEnum : nextNodeNoList) {
|
for (NodeNoEnum nodeNoEnum : nextNodeNoList) {
|
||||||
PointAuditRecordDO pointAuditRecord = auditRecordMap.get(nodeNoEnum.getCode());
|
PointAuditRecordDO pointAuditRecord = auditRecordMap.get(nodeNoEnum.getCode());
|
||||||
if(Objects.nonNull(pointAuditRecord)){
|
if (Objects.nonNull(pointAuditRecord)) {
|
||||||
return pointAuditRecord;
|
return pointAuditRecord;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ public class TallyBookServiceImpl implements TallyBookService {
|
|||||||
@Override
|
@Override
|
||||||
public Long insertOrUpdateSelective(TallyBookRequest request, String partnerId) {
|
public Long insertOrUpdateSelective(TallyBookRequest request, String partnerId) {
|
||||||
TallyBookDO tallyBookDO = request.toTallyBookDO();
|
TallyBookDO tallyBookDO = request.toTallyBookDO();
|
||||||
|
tallyBookDO.setStatus(TallyBookStatusEnum.IS_SUBMIT.getCode());
|
||||||
if (request.getId()==null){
|
if (request.getId()==null){
|
||||||
tallyBookDO.setCreateUser(partnerId);
|
tallyBookDO.setCreateUser(partnerId);
|
||||||
tallyBookDO.setPartnerId(partnerId);
|
tallyBookDO.setPartnerId(partnerId);
|
||||||
tallyBookDO.setStatus(TallyBookStatusEnum.IS_SUBMIT.getCode());
|
|
||||||
return tallyBookDAO.insertSelective(tallyBookDO);
|
return tallyBookDAO.insertSelective(tallyBookDO);
|
||||||
}else{
|
}else{
|
||||||
tallyBookDO.setUpdateUser(partnerId);
|
tallyBookDO.setUpdateUser(partnerId);
|
||||||
@@ -59,34 +59,27 @@ public class TallyBookServiceImpl implements TallyBookService {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public TallyBookDO initData(Date date,Long shopId, String partnerId){
|
public Long initData(Date date,Long shopId, String partnerId){
|
||||||
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||||
// 获取年份
|
// 获取年份
|
||||||
int year = localDate.getYear();
|
int year = localDate.getYear();
|
||||||
// 获取月份
|
// 获取月份
|
||||||
int month = localDate.getMonthValue();
|
int month = localDate.getMonthValue();
|
||||||
List<TallyBookDO> list = tallyBookDAO.getTallyBookListByShopIdAndYear(shopId,year);
|
List<TallyBookDO> list = tallyBookDAO.getTallyBookListByShopIdAndYear(shopId,year);
|
||||||
|
TallyBookDO tallyBookDO = new TallyBookDO();
|
||||||
|
tallyBookDO.setShopId(shopId);
|
||||||
|
tallyBookDO.setPartnerId(partnerId);
|
||||||
|
tallyBookDO.setYear(year);
|
||||||
|
tallyBookDO.setMonth(month);
|
||||||
|
tallyBookDO.setCreateTime(new Date());
|
||||||
|
tallyBookDO.setStatus(TallyBookStatusEnum.NOT_SUBMIT.getCode());
|
||||||
if(CollectionUtils.isEmpty(list)){
|
if(CollectionUtils.isEmpty(list)){
|
||||||
TallyBookDO tallyBookDO = new TallyBookDO();
|
return tallyBookDAO.insertSelective(tallyBookDO);
|
||||||
tallyBookDO.setShopId(shopId);
|
|
||||||
tallyBookDO.setPartnerId(partnerId);
|
|
||||||
tallyBookDO.setYear(year);
|
|
||||||
tallyBookDO.setMonth(month);
|
|
||||||
tallyBookDO.setCreateTime(new Date());
|
|
||||||
tallyBookDO.setStatus(TallyBookStatusEnum.NOT_SUBMIT.getCode());
|
|
||||||
return tallyBookDO;
|
|
||||||
}
|
}
|
||||||
List<Integer> monthList = list.stream().map(TallyBookDO::getMonth).collect(Collectors.toList());
|
List<Integer> monthList = list.stream().map(TallyBookDO::getMonth).collect(Collectors.toList());
|
||||||
if (!monthList.contains(month)){
|
if (!monthList.contains(month)){
|
||||||
TallyBookDO tallyBookDO = new TallyBookDO();
|
return tallyBookDAO.insertSelective(tallyBookDO);
|
||||||
tallyBookDO.setShopId(shopId);
|
|
||||||
tallyBookDO.setPartnerId(partnerId);
|
|
||||||
tallyBookDO.setYear(year);
|
|
||||||
tallyBookDO.setMonth(month);
|
|
||||||
tallyBookDO.setCreateTime(new Date());
|
|
||||||
tallyBookDO.setStatus(TallyBookStatusEnum.NOT_SUBMIT.getCode());
|
|
||||||
return tallyBookDO;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.cool.store.request.*;
|
|||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.PointService;
|
import com.cool.store.service.PointService;
|
||||||
import com.cool.store.service.ShopService;
|
import com.cool.store.service.ShopService;
|
||||||
|
import com.cool.store.vo.PartnerUserInfoVO;
|
||||||
import com.cool.store.vo.point.MiniPointPageVO;
|
import com.cool.store.vo.point.MiniPointPageVO;
|
||||||
import com.cool.store.vo.point.PointDetailVO;
|
import com.cool.store.vo.point.PointDetailVO;
|
||||||
import com.cool.store.vo.point.ShopRentInfoVO;
|
import com.cool.store.vo.point.ShopRentInfoVO;
|
||||||
@@ -59,6 +60,9 @@ public class MiniShopController {
|
|||||||
@ApiOperation("获取推荐给我的铺位")
|
@ApiOperation("获取推荐给我的铺位")
|
||||||
@PostMapping("/getLineRecommendPointPage")
|
@PostMapping("/getLineRecommendPointPage")
|
||||||
public ResponseResult<PageInfo<MiniPointPageVO>> getLineRecommendPointPage(@RequestBody MiniPointPageRequest request) {
|
public ResponseResult<PageInfo<MiniPointPageVO>> getLineRecommendPointPage(@RequestBody MiniPointPageRequest request) {
|
||||||
|
PartnerUserInfoVO user = PartnerUserHolder.getUser();
|
||||||
|
request.setPartnerId(user.getPartnerId());
|
||||||
|
request.setLineId(user.getLineId());
|
||||||
return ResponseResult.success(pointService.getLineRecommendPointPage(request));
|
return ResponseResult.success(pointService.getLineRecommendPointPage(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.cool.store.controller.webc;
|
||||||
|
|
||||||
|
import com.cool.store.context.PartnerUserHolder;
|
||||||
|
import com.cool.store.dto.TallyBookDTO;
|
||||||
|
import com.cool.store.request.TallyBookRequest;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.TallyBookService;
|
||||||
|
import com.cool.store.vo.PartnerUserInfoVO;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: WangShuo
|
||||||
|
* @Date: 2025/03/31/14:23
|
||||||
|
* @Version 1.0
|
||||||
|
* @注释:
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Api("mini记账本")
|
||||||
|
@RequestMapping("/mini/tallyBook")
|
||||||
|
public class TallyBookController {
|
||||||
|
@Resource
|
||||||
|
private TallyBookService tallyBookService;
|
||||||
|
|
||||||
|
@PostMapping("/insertOrUpdate")
|
||||||
|
public ResponseResult insertOrUpdateSelective(@RequestBody @Validated TallyBookRequest request) {
|
||||||
|
PartnerUserInfoVO user = PartnerUserHolder.getUser();
|
||||||
|
return ResponseResult.success(tallyBookService.insertOrUpdateSelective(request, user.getPartnerId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getTallyBookListByShopIdAndYear")
|
||||||
|
public ResponseResult<List<TallyBookDTO>> getTallyBookListByShopIdAndYear(@RequestParam("shopId") Long shopId, @RequestParam("year") Integer year) {
|
||||||
|
PartnerUserInfoVO user = PartnerUserHolder.getUser();
|
||||||
|
return ResponseResult.success(tallyBookService.getTallyBookListByShopIdAndYear(shopId,year));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user