选址
This commit is contained in:
@@ -45,7 +45,6 @@ public enum ErrorCodeEnum {
|
||||
WX_SERVICE_ERROR(1021021, "调用微信服务异常", null),
|
||||
SESSION_KEY_ERROR(1021022, "sessionKey过期", null),
|
||||
GET_WECHAT_USER_INFO_FAIL(1021023,"获取小程序用户信息失败", null),
|
||||
FEISHU_SERVICE_ERROR(1021024,"飞书服务调用异常", null),
|
||||
USER_GROUP_NAME_EXIST(1021076, "用户分组名称已存在", null),
|
||||
USER_GROUP_NOT_EXIST(1021077, "用户分组不存在", null),
|
||||
GET_INFO_ERROR(1021078, "获取信息异常", null),
|
||||
@@ -80,6 +79,10 @@ public enum ErrorCodeEnum {
|
||||
TIME_OCCUPIED(500018, "预约时间被占用", null),
|
||||
LINE_PAY_IS_NOT_EXIST(500019, "意向金信息不存在!", null),
|
||||
|
||||
POINT_NOT_COMPLETE(600000, "铺位信息未填写完全,请完善后生成评估报告", null),
|
||||
POINT_NOT_EXIST(600001, "铺位信息不存在", null),
|
||||
POINT_SIGNED(600002, "操作失败,铺位已签约", null),
|
||||
NOT_ALLOW_OPERATE(600003, "当前状态不允许该操作", null),
|
||||
|
||||
INTERVIEW_ENTER_FAIL(1021101, "进入面审间失败", null),
|
||||
DINGDING_USER_NOT_EXIST(1021102, "用户钉钉信息不存在,无法发起资质审核!", null),
|
||||
@@ -119,23 +122,11 @@ public enum ErrorCodeEnum {
|
||||
OPEN_AREA_NULL(600006,"归属地区不能为空",null),
|
||||
NOT_IN_PUBLIC_SEA(600007,"当前线索不在公海 不支持分配招商经理",null),
|
||||
|
||||
OUTBOUND_NUMBER_EXIST(110001, "该呼出号码已被绑定,请更改后重试", null),
|
||||
|
||||
LABEL_GROUP_IN_USE(120001, "该标签组下存在标签,不可删除;请确保该标签组下标签数量为0后再进行删除", null),
|
||||
LABEL_GROUP_EXIST(120002, "该标签组已存在,请重新输入", null),
|
||||
LABEL_EXIST(120003, "该标签已存在,请重新输入", null),
|
||||
|
||||
|
||||
|
||||
//会销相关异常 106*** 106开头
|
||||
EXHIBITION_GROUP_NOT_NULL(106001, "会销组中必须添加至少一个会销", null),
|
||||
EXHIBITION_GROUP_NOT_EXIST(106002, "会销组不存在或被删除", null),
|
||||
EXHIBITION_NOT_EXIST(106003, "会销不存在或被删除", null),
|
||||
EXHIBITION_NOT_SIGNED(106004, "线索未进行会销签到", null),
|
||||
EXHIBITION_NOT_SUBMIT_INTENTION(106005, "线索未提交意向申请", null),
|
||||
EXHIBITION_LINE_INTERVIEWED(106006, "线索已预约面审", null),
|
||||
|
||||
|
||||
OPEN_AREA_IS_NOT_EXISTS(107006, "意向区域城市不存在", null),
|
||||
|
||||
REGION_NOT_EXIST(108001, "区域不存在",null),
|
||||
|
||||
@@ -53,4 +53,47 @@ public enum FlowRateCalculateEnum {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人流测算
|
||||
* @param nineFlowRate
|
||||
* @param tenFlowRate
|
||||
* @param eighteenFlowRate
|
||||
* @param nineteenFlowRate
|
||||
* @return
|
||||
*/
|
||||
public static FlowRateCalculateEnum getByFlowRate(Integer nineFlowRate, Integer tenFlowRate, Integer eighteenFlowRate, Integer nineteenFlowRate){
|
||||
System.out.println("@@@@@@@@@@");
|
||||
Integer flowRate = 0, count = 0;
|
||||
if(Objects.nonNull(nineFlowRate)){
|
||||
flowRate += nineFlowRate;
|
||||
count++;
|
||||
}
|
||||
if(Objects.nonNull(tenFlowRate)){
|
||||
flowRate += tenFlowRate;
|
||||
count++;
|
||||
}
|
||||
if(Objects.nonNull(eighteenFlowRate)){
|
||||
flowRate += eighteenFlowRate;
|
||||
count++;
|
||||
}
|
||||
if(Objects.nonNull(nineteenFlowRate)){
|
||||
flowRate += nineteenFlowRate;
|
||||
count++;
|
||||
}
|
||||
if(count == 0){
|
||||
count = 1;
|
||||
}
|
||||
flowRate = flowRate / count;
|
||||
if(flowRate > 400){
|
||||
return FLOW_RATE_CALCULATE_1;
|
||||
}
|
||||
if(flowRate > 300 && flowRate <= 400){
|
||||
return FLOW_RATE_CALCULATE_2;
|
||||
}
|
||||
if(flowRate > 200 && flowRate <= 300){
|
||||
return FLOW_RATE_CALCULATE_3;
|
||||
}
|
||||
return FLOW_RATE_CALCULATE_4;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.cool.store.enums.point;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: PointRecommendStatus
|
||||
* @Description:
|
||||
* @date 2024-04-01 14:38
|
||||
*/
|
||||
public enum PointRecommendStatus {
|
||||
|
||||
//状态 1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效
|
||||
POINT_RECOMMEND_STATUS_1(1, "待选择"),
|
||||
POINT_RECOMMEND_STATUS_2(2, "已选择"),
|
||||
POINT_RECOMMEND_STATUS_3(3, "已被他人选择"),
|
||||
POINT_RECOMMEND_STATUS_4(4, "已签约"),
|
||||
POINT_RECOMMEND_STATUS_5(5, "已拒绝"),
|
||||
POINT_RECOMMEND_STATUS_6(6, "已失效"),
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String desc;
|
||||
|
||||
PointRecommendStatus(Integer code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static PointRecommendStatus getByCode(Integer code) {
|
||||
for (PointRecommendStatus pointRecommendStatus : PointRecommendStatus.values()) {
|
||||
if (pointRecommendStatus.getCode().equals(code)) {
|
||||
return pointRecommendStatus;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.cool.store.enums.point;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: PointStatusEnum
|
||||
* @Description:
|
||||
* @date 2024-04-01 10:37
|
||||
*/
|
||||
public enum PointStatusEnum {
|
||||
|
||||
//1.采集中、2.已评估、3.待审核、4.待审核可推荐、5.已审核、6.已签约、7.已失效
|
||||
POINT_STATUS_1(1, "采集中"),
|
||||
POINT_STATUS_2(2, "已评估"),
|
||||
POINT_STATUS_3(3, "待审核"),
|
||||
POINT_STATUS_4(4, "待审核可推荐"),
|
||||
POINT_STATUS_5(5, "已审核"),
|
||||
POINT_STATUS_6(6, "已签约"),
|
||||
POINT_STATUS_7(7, "已失效")
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String desc;
|
||||
|
||||
PointStatusEnum(Integer code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.cool.store.enums.point;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: SelectStatusEnum
|
||||
* @Description:
|
||||
* @date 2024-04-01 10:37
|
||||
*/
|
||||
public enum SelectStatusEnum {
|
||||
|
||||
//选择状态0.未选择, 1.已被选择
|
||||
SELECT_STATUS_0(0, "未选择"),
|
||||
SELECT_STATUS_1(1, "已被选择"),
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String desc;
|
||||
|
||||
SelectStatusEnum(Integer code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.cool.store.mapper.ShopPointDetailInfoMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -34,8 +35,10 @@ public class ShopPointDetailInfoDAO {
|
||||
* @return
|
||||
*/
|
||||
public Integer updateShopPointDetailInfo(ShopPointDetailInfoDO shopPointDetailInfo) {
|
||||
Long pointDetailId = getPointDetailIdByPointId(shopPointDetailInfo.getPointId());
|
||||
shopPointDetailInfo.setId(pointDetailId);
|
||||
if(Objects.isNull(shopPointDetailInfo.getId()) && Objects.nonNull(shopPointDetailInfo.getPointId())){
|
||||
Long pointDetailId = getPointDetailIdByPointId(shopPointDetailInfo.getPointId());
|
||||
shopPointDetailInfo.setId(pointDetailId);
|
||||
}
|
||||
return shopPointDetailInfoMapper.updateByPrimaryKeySelective(shopPointDetailInfo);
|
||||
}
|
||||
|
||||
@@ -43,5 +46,9 @@ public class ShopPointDetailInfoDAO {
|
||||
return shopPointDetailInfoMapper.getPointDetailIdByPointId(pointId);
|
||||
}
|
||||
|
||||
public ShopPointDetailInfoDO getShopPointDetailInfoByPointId(Long pointId) {
|
||||
return shopPointDetailInfoMapper.getShopPointDetailInfoByPointId(pointId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.cool.store.mapper.ShopPointInfoMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -18,6 +19,14 @@ public class ShopPointInfoDAO {
|
||||
@Resource
|
||||
private ShopPointInfoMapper shopPointInfoMapper;
|
||||
|
||||
public ShopPointInfoDO getShopPointInfoById(Long id) {
|
||||
ShopPointInfoDO shopPointInfo = shopPointInfoMapper.selectByPrimaryKey(id);
|
||||
if(Objects.isNull(shopPointInfo) || shopPointInfo.getDeleted()){
|
||||
return null;
|
||||
}
|
||||
return shopPointInfo;
|
||||
}
|
||||
|
||||
public Long addShopPointInfo(ShopPointInfoDO shopPointInfo) {
|
||||
shopPointInfoMapper.insertSelective(shopPointInfo);
|
||||
return shopPointInfo.getId();
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.enums.point.PointRecommendStatus;
|
||||
import com.cool.store.mapper.ShopPointRecommendMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: ShopPointRecommendDAO
|
||||
* @Description:点位推荐
|
||||
* @date 2024-04-01 14:36
|
||||
*/
|
||||
@Repository
|
||||
public class ShopPointRecommendDAO {
|
||||
|
||||
@Resource
|
||||
private ShopPointRecommendMapper shopPointRecommendMapper;
|
||||
|
||||
public Integer updateRecommendStatus(Long pointId, PointRecommendStatus status) {
|
||||
if(Objects.isNull(status)){
|
||||
return 0;
|
||||
}
|
||||
return shopPointRecommendMapper.updateShopPointRecommendStatus(pointId, status.getCode());
|
||||
}
|
||||
|
||||
public Integer updateRecommendStatusByStatusAndPointId(Long pointId, PointRecommendStatus status, List<PointRecommendStatus> statusList) {
|
||||
if(Objects.isNull(status) || CollectionUtils.isEmpty(statusList)){
|
||||
return 0;
|
||||
}
|
||||
List<Integer> statusCodeList = statusList.stream().map(PointRecommendStatus::getCode).collect(Collectors.toList());
|
||||
return shopPointRecommendMapper.updateRecommendStatusByStatusAndPointId(pointId, status.getCode(), statusCodeList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,4 +12,11 @@ public interface ShopPointDetailInfoMapper extends Mapper<ShopPointDetailInfoDO>
|
||||
* @return
|
||||
*/
|
||||
Long getPointDetailIdByPointId(@Param("pointId") Long pointId);
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param pointId
|
||||
* @return
|
||||
*/
|
||||
ShopPointDetailInfoDO getShopPointDetailInfoByPointId(@Param("pointId") Long pointId);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.ShopPointRecommendDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ShopPointRecommendMapper extends Mapper<ShopPointRecommendDO> {
|
||||
|
||||
/**
|
||||
* 更新铺位推荐状态
|
||||
* @param pointId
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
Integer updateShopPointRecommendStatus(@Param("pointId") Long pointId, @Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* 跟进点位 和 推荐状态 更新推荐状态
|
||||
* @param pointId
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
Integer updateRecommendStatusByStatusAndPointId(@Param("pointId") Long pointId, @Param("status") Integer status, @Param("statusList") List<Integer> statusList);
|
||||
}
|
||||
@@ -5,16 +5,15 @@
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="point_id" jdbcType="BIGINT" property="pointId" />
|
||||
<result column="bussiness_status" jdbcType="TINYINT" property="bussinessStatus" />
|
||||
<result column="nine_flow_rate" jdbcType="TINYINT" property="nineFlowRate" />
|
||||
<result column="ten_flow_rate" jdbcType="TINYINT" property="tenFlowRate" />
|
||||
<result column="eighteen_flow_rate" jdbcType="TINYINT" property="eighteenFlowRate" />
|
||||
<result column="nineteen_flow_rate" jdbcType="TINYINT" property="nineteenFlowRate" />
|
||||
<result column="nine_flow_rate" jdbcType="INTEGER" property="nineFlowRate" />
|
||||
<result column="ten_flow_rate" jdbcType="INTEGER" property="tenFlowRate" />
|
||||
<result column="eighteen_flow_rate" jdbcType="INTEGER" property="eighteenFlowRate" />
|
||||
<result column="nineteen_flow_rate" jdbcType="INTEGER" property="nineteenFlowRate" />
|
||||
<result column="point_direction" jdbcType="TINYINT" property="pointDirection" />
|
||||
<result column="site_conditions" jdbcType="TINYINT" property="siteConditions" />
|
||||
<result column="store_width" jdbcType="VARCHAR" property="storeWidth" />
|
||||
<result column="landlord_username" jdbcType="VARCHAR" property="landlordUsername" />
|
||||
<result column="landlord_mobile" jdbcType="VARCHAR" property="landlordMobile" />
|
||||
<result column="store_rent" jdbcType="VARCHAR" property="storeRent" />
|
||||
<result column="payment_method" jdbcType="TINYINT" property="paymentMethod" />
|
||||
<result column="property_status" jdbcType="TINYINT" property="propertyStatus" />
|
||||
<result column="transfer_fee" jdbcType="VARCHAR" property="transferFee" />
|
||||
@@ -74,4 +73,8 @@
|
||||
<select id="getPointDetailIdByPointId" resultType="java.lang.Long">
|
||||
select id from xfsg_shop_point_detail_info where point_id = #{pointId}
|
||||
</select>
|
||||
|
||||
<select id="getShopPointDetailInfoByPointId" resultMap="BaseResultMap">
|
||||
select * from xfsg_shop_point_detail_info where point_id = #{pointId} and deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -9,7 +9,6 @@
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId" />
|
||||
<result column="point_area" jdbcType="VARCHAR" property="pointArea" />
|
||||
<result column="shop_area_type" jdbcType="VARCHAR" property="shopAreaType" />
|
||||
<result column="longitude" jdbcType="VARCHAR" property="longitude" />
|
||||
<result column="latitude" jdbcType="VARCHAR" property="latitude" />
|
||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
||||
@@ -18,6 +17,7 @@
|
||||
<result column="development_time" jdbcType="TIMESTAMP" property="developmentTime" />
|
||||
<result column="point_status" jdbcType="TINYINT" property="pointStatus" />
|
||||
<result column="point_score" jdbcType="INTEGER" property="pointScore" />
|
||||
<result column="select_status" jdbcType="TINYINT" property="selectStatus" />
|
||||
<result column="submit_audit_count" jdbcType="TINYINT" property="submitAuditCount" />
|
||||
<result column="is_line_upload" jdbcType="BIT" property="isLineUpload" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.ShopPointRecommendMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopPointRecommendDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId" />
|
||||
<result column="point_id" jdbcType="BIGINT" property="pointId" />
|
||||
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager" />
|
||||
<result column="status" jdbcType="TINYINT" property="status" />
|
||||
<result column="reason" jdbcType="VARCHAR" property="reason" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<update id="updateShopPointRecommendStatus">
|
||||
update xfsg_shop_point_recommend set status = #{status} where point_id = #{pointId}
|
||||
</update>
|
||||
|
||||
<update id="updateRecommendStatusByStatusAndPointId">
|
||||
update xfsg_shop_point_recommend set status = #{status} where point_id = #{pointId} and status in
|
||||
<foreach collection="statusList" item="status" index="index" open="(" separator="," close=")">
|
||||
#{status}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -3,6 +3,6 @@ jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcoll
|
||||
jdbc.user= coolstore
|
||||
jdbc.password = CSCErYcXniNYm7bT
|
||||
|
||||
table.name = xfsg_shop_point_info
|
||||
table.object.class = ShopPointInfoDO
|
||||
table.mapper = ShopPointInfoMapper
|
||||
table.name = xfsg_shop_point_recommend
|
||||
table.object.class = ShopPointRecommendDO
|
||||
table.mapper = ShopPointRecommendMapper
|
||||
@@ -52,7 +52,7 @@ public class ShopPointDetailInfoDO {
|
||||
private Integer nineteenFlowRate;
|
||||
|
||||
/**
|
||||
* 店铺方位 0主要路线, 1次要路线
|
||||
* 店铺方位 1.主要动线 2.次要动线
|
||||
*/
|
||||
@Column(name = "point_direction")
|
||||
private Integer pointDirection;
|
||||
@@ -81,12 +81,6 @@ public class ShopPointDetailInfoDO {
|
||||
@Column(name = "landlord_mobile")
|
||||
private String landlordMobile;
|
||||
|
||||
/**
|
||||
* 门店月租金
|
||||
*/
|
||||
@Column(name = "store_rent")
|
||||
private String storeRent;
|
||||
|
||||
/**
|
||||
* 支付方式 参考PaymentMethodEnum
|
||||
*/
|
||||
@@ -527,6 +521,10 @@ public class ShopPointDetailInfoDO {
|
||||
return getMarketSizeScore() + getShopAreaScore() + getConvenientScore() + getEnvironmentScore();
|
||||
}
|
||||
|
||||
public Integer getFlowRateCalculate() {
|
||||
return FlowRateCalculateEnum.getByFlowRate(this.nineFlowRate, this.tenFlowRate, this.eighteenFlowRate, this.nineteenFlowRate).getCode();
|
||||
}
|
||||
|
||||
public boolean isCanSubmitEvaluable(){
|
||||
if(Objects.isNull(this.bussinessStatus)){
|
||||
return false;
|
||||
@@ -553,9 +551,6 @@ public class ShopPointDetailInfoDO {
|
||||
if(Objects.isNull(this.landlordUsername) || StringUtils.isBlank(this.landlordUsername.trim()) || Objects.isNull(this.landlordMobile) || StringUtils.isBlank(this.landlordMobile.trim())){
|
||||
return false;
|
||||
}
|
||||
if(Objects.isNull(this.storeRent)){
|
||||
return false;
|
||||
}
|
||||
if(Objects.isNull(this.paymentMethod) || Objects.isNull(this.propertyStatus)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -48,12 +48,6 @@ public class ShopPointInfoDO {
|
||||
@Column(name = "point_area")
|
||||
private String pointArea;
|
||||
|
||||
/**
|
||||
* 商圈类型
|
||||
*/
|
||||
@Column(name = "shop_area_type")
|
||||
private String shopAreaType;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@@ -99,6 +93,12 @@ public class ShopPointInfoDO {
|
||||
@Column(name = "point_score")
|
||||
private Integer pointScore;
|
||||
|
||||
/**
|
||||
* 选择状态0.未选择, 1.已被选择
|
||||
*/
|
||||
@Column(name = "select_status")
|
||||
private Integer selectStatus;
|
||||
|
||||
/**
|
||||
* 审批次数
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import javax.persistence.*;
|
||||
|
||||
@Data
|
||||
@Table(name = "xfsg_shop_point_recommend")
|
||||
public class ShopPointRecommendDO {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 线索id
|
||||
*/
|
||||
@Column(name = "line_id")
|
||||
private Long lineId;
|
||||
|
||||
/**
|
||||
* 点位id
|
||||
*/
|
||||
@Column(name = "point_id")
|
||||
private Long pointId;
|
||||
|
||||
/**
|
||||
* 拓展专员
|
||||
*/
|
||||
@Column(name = "development_manager")
|
||||
private String developmentManager;
|
||||
|
||||
/**
|
||||
* 状态 1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 原因
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: AddMapEvaluationReportRequest
|
||||
* @Description:
|
||||
* @date 2024-04-01 17:49
|
||||
*/
|
||||
@Data
|
||||
public class AddMapEvaluationReportRequest {
|
||||
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long pointId;
|
||||
|
||||
@ApiModelProperty("高德地图评估报告")
|
||||
private String mapEvaluationReport;
|
||||
}
|
||||
@@ -63,9 +63,6 @@ public class AddShopPointDetailRequest {
|
||||
@ApiModelProperty("房东电话")
|
||||
private String landlordMobile;
|
||||
|
||||
@ApiModelProperty("门店月租金")
|
||||
private String storeRent;
|
||||
|
||||
@Min(1)
|
||||
@Max(4)
|
||||
@ApiModelProperty("支付方式 1.月付 2.季付 3.半年付 4.年付")
|
||||
@@ -89,11 +86,6 @@ public class AddShopPointDetailRequest {
|
||||
@ApiModelProperty("消费能力 1.高端 2.中高端 3.中端 4.低端")
|
||||
private Integer consumerAbility;
|
||||
|
||||
@Min(1)
|
||||
@Max(4)
|
||||
@ApiModelProperty("人流测算 1.>400人/时以上, 2.300~400人/时, 3.200~300人/时, 4.100~200人/时")
|
||||
private Integer flowRateCalculate;
|
||||
|
||||
@Min(1)
|
||||
@Max(2)
|
||||
@ApiModelProperty("聚客点农贸市场 1.是 2.否")
|
||||
@@ -226,9 +218,6 @@ public class AddShopPointDetailRequest {
|
||||
@ApiModelProperty("租赁合同")
|
||||
private String rentContract;
|
||||
|
||||
@ApiModelProperty("高德地图评估报告")
|
||||
private String mapEvaluationReport;
|
||||
|
||||
@ApiModelProperty("图片对象")
|
||||
private String pictureObj;
|
||||
|
||||
@@ -237,6 +226,7 @@ public class AddShopPointDetailRequest {
|
||||
ShopPointDetailInfoDO result = new ShopPointDetailInfoDO();
|
||||
result.setBussinessStatus(request.getBussinessStatus());
|
||||
result.setNineFlowRate(request.getNineFlowRate());
|
||||
result.setTenFlowRate(request.getTenFlowRate());
|
||||
result.setEighteenFlowRate(request.getEighteenFlowRate());
|
||||
result.setNineteenFlowRate(request.getNineteenFlowRate());
|
||||
result.setPointDirection(request.getPointDirection());
|
||||
@@ -244,13 +234,11 @@ public class AddShopPointDetailRequest {
|
||||
result.setStoreWidth(request.getStoreWidth());
|
||||
result.setLandlordUsername(request.getLandlordUsername());
|
||||
result.setLandlordMobile(request.getLandlordMobile());
|
||||
result.setStoreRent(request.getStoreRent());
|
||||
result.setPaymentMethod(request.getPaymentMethod());
|
||||
result.setPropertyStatus(request.getPropertyStatus());
|
||||
result.setTransferFee(request.getTransferFee());
|
||||
result.setCoverCommunity(request.getCoverCommunity());
|
||||
result.setConsumerAbility(request.getConsumerAbility());
|
||||
result.setFlowRateCalculate(request.getFlowRateCalculate());
|
||||
result.setGatherGuestFarmerMarket(request.getGatherGuestFarmerMarket());
|
||||
result.setGatherGuestHospital(request.getGatherGuestHospital());
|
||||
result.setGatherGuestSchool(request.getGatherGuestSchool());
|
||||
@@ -285,7 +273,6 @@ public class AddShopPointDetailRequest {
|
||||
result.setNetProfit(request.getNetProfit());
|
||||
result.setMonthRateReturn(request.getMonthRateReturn());
|
||||
result.setRentContract(request.getRentContract());
|
||||
result.setMapEvaluationReport(request.getMapEvaluationReport());
|
||||
result.setPictureObj(request.getPictureObj());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -5,11 +5,13 @@ import com.cool.store.entity.ShopPointInfoDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class UpdateShopPointDetailRequest extends AddShopPointDetailRequest{
|
||||
|
||||
@NotNull
|
||||
@ApiModelProperty("点位id")
|
||||
private Long pointId;
|
||||
|
||||
@@ -28,13 +30,11 @@ public class UpdateShopPointDetailRequest extends AddShopPointDetailRequest{
|
||||
result.setStoreWidth(request.getStoreWidth());
|
||||
result.setLandlordUsername(request.getLandlordUsername());
|
||||
result.setLandlordMobile(request.getLandlordMobile());
|
||||
result.setStoreRent(request.getStoreRent());
|
||||
result.setPaymentMethod(request.getPaymentMethod());
|
||||
result.setPropertyStatus(request.getPropertyStatus());
|
||||
result.setTransferFee(request.getTransferFee());
|
||||
result.setCoverCommunity(request.getCoverCommunity());
|
||||
result.setConsumerAbility(request.getConsumerAbility());
|
||||
result.setFlowRateCalculate(request.getFlowRateCalculate());
|
||||
result.setGatherGuestFarmerMarket(request.getGatherGuestFarmerMarket());
|
||||
result.setGatherGuestHospital(request.getGatherGuestHospital());
|
||||
result.setGatherGuestSchool(request.getGatherGuestSchool());
|
||||
@@ -69,7 +69,6 @@ public class UpdateShopPointDetailRequest extends AddShopPointDetailRequest{
|
||||
result.setNetProfit(request.getNetProfit());
|
||||
result.setMonthRateReturn(request.getMonthRateReturn());
|
||||
result.setRentContract(request.getRentContract());
|
||||
result.setMapEvaluationReport(request.getMapEvaluationReport());
|
||||
result.setPictureObj(request.getPictureObj());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.vo.point;
|
||||
|
||||
import com.cool.store.entity.ShopPointDetailInfoDO;
|
||||
import com.cool.store.entity.ShopPointInfoDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -9,9 +10,15 @@ import java.util.Date;
|
||||
@Data
|
||||
public class ShopPointDetailVO {
|
||||
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long pointId;
|
||||
|
||||
@ApiModelProperty("铺位名称")
|
||||
private String pointName;
|
||||
|
||||
@ApiModelProperty("铺位编号")
|
||||
private String pointCode;
|
||||
|
||||
@ApiModelProperty("所属大区")
|
||||
private Long regionId;
|
||||
|
||||
@@ -24,7 +31,13 @@ public class ShopPointDetailVO {
|
||||
@ApiModelProperty("详细地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty("经营状况")
|
||||
@ApiModelProperty("铺位状态 1.采集中、2.已评估、3.待审核、4.待审核可推荐、5.已审核、6.已签约、7.已失效")
|
||||
private Integer pointStatus;
|
||||
|
||||
@ApiModelProperty("铺位得分")
|
||||
private Integer pointScore;
|
||||
|
||||
@ApiModelProperty("经营状况 1营业中 2空铺")
|
||||
private Integer bussinessStatus;
|
||||
|
||||
@ApiModelProperty("09:00-10:00人流量")
|
||||
@@ -39,7 +52,7 @@ public class ShopPointDetailVO {
|
||||
@ApiModelProperty("19:00-20:00人流量")
|
||||
private Integer nineteenFlowRate;
|
||||
|
||||
@ApiModelProperty("店铺方位 0主要路线, 1次要路线")
|
||||
@ApiModelProperty("店铺方位 1.主要动线 2.次要动线")
|
||||
private Integer pointDirection;
|
||||
|
||||
@ApiModelProperty("立地条件0单门面, 1双门面, 2多门面, 3转角")
|
||||
@@ -57,9 +70,6 @@ public class ShopPointDetailVO {
|
||||
@ApiModelProperty("房东电话")
|
||||
private String landlordMobile;
|
||||
|
||||
@ApiModelProperty("门店月租金")
|
||||
private String storeRent;
|
||||
|
||||
@ApiModelProperty("支付方式 1.月付 2.季付 3.半年付 4.年付")
|
||||
private Integer paymentMethod;
|
||||
|
||||
@@ -217,71 +227,78 @@ public class ShopPointDetailVO {
|
||||
private String pictureObj;
|
||||
|
||||
|
||||
public static ShopPointDetailInfoDO convertDO(ShopPointDetailVO request) {
|
||||
ShopPointDetailInfoDO result = new ShopPointDetailInfoDO();
|
||||
result.setBussinessStatus(request.getBussinessStatus());
|
||||
result.setNineFlowRate(request.getNineFlowRate());
|
||||
result.setTenFlowRate(request.getTenFlowRate());
|
||||
result.setEighteenFlowRate(request.getEighteenFlowRate());
|
||||
result.setNineteenFlowRate(request.getNineteenFlowRate());
|
||||
result.setPointDirection(request.getPointDirection());
|
||||
result.setSiteConditions(request.getSiteConditions());
|
||||
result.setStoreWidth(request.getStoreWidth());
|
||||
result.setLandlordUsername(request.getLandlordUsername());
|
||||
result.setLandlordMobile(request.getLandlordMobile());
|
||||
result.setStoreRent(request.getStoreRent());
|
||||
result.setPaymentMethod(request.getPaymentMethod());
|
||||
result.setPropertyStatus(request.getPropertyStatus());
|
||||
result.setTransferFee(request.getTransferFee());
|
||||
result.setCoverCommunity(request.getCoverCommunity());
|
||||
result.setConsumerAbility(request.getConsumerAbility());
|
||||
result.setFlowRateCalculate(request.getFlowRateCalculate());
|
||||
result.setGatherGuestFarmerMarket(request.getGatherGuestFarmerMarket());
|
||||
result.setGatherGuestHospital(request.getGatherGuestHospital());
|
||||
result.setGatherGuestSchool(request.getGatherGuestSchool());
|
||||
result.setStoreFlowTrend(request.getStoreFlowTrend());
|
||||
result.setNearRepast(request.getNearRepast());
|
||||
result.setNearNeighbor(request.getNearNeighbor());
|
||||
result.setNearCompete(request.getNearCompete());
|
||||
result.setNearBusinessCondition(request.getNearBusinessCondition());
|
||||
result.setIntendPosition(request.getIntendPosition());
|
||||
result.setGreenBelt(request.getGreenBelt());
|
||||
result.setStoreOutlook(request.getStoreOutlook());
|
||||
result.setGuestConvenience(request.getGuestConvenience());
|
||||
result.setWantShopSize(request.getWantShopSize());
|
||||
result.setCompeteType(request.getCompeteType());
|
||||
result.setCompeteBusinessCapacity(request.getCompeteBusinessCapacity());
|
||||
result.setInvestAmount(request.getInvestAmount());
|
||||
result.setDayTrader(request.getDayTrader());
|
||||
result.setProfitRate(request.getProfitRate());
|
||||
result.setMonthProfitRate(request.getMonthProfitRate());
|
||||
result.setDeliveryRate(request.getDeliveryRate());
|
||||
result.setDeliveryFee(request.getDeliveryFee());
|
||||
result.setBrandUseRate(request.getBrandUseRate());
|
||||
result.setBrandUseFee(request.getBrandUseFee());
|
||||
result.setStaffFee(request.getStaffFee());
|
||||
result.setShopManagerNum(request.getShopManagerNum());
|
||||
result.setShopManagerFee(request.getShopManagerFee());
|
||||
result.setClerkNum(request.getClerkNum());
|
||||
result.setClerkFee(request.getClerkFee());
|
||||
result.setBonus(request.getBonus());
|
||||
result.setMonthRent(request.getMonthRent());
|
||||
result.setOtherFee(request.getOtherFee());
|
||||
result.setNetProfit(request.getNetProfit());
|
||||
result.setMonthRateReturn(request.getMonthRateReturn());
|
||||
result.setDevelopmentManagerSign(request.getDevelopmentManagerSign());
|
||||
result.setDevelopmentManagerSignTime(request.getDevelopmentManagerSignTime());
|
||||
result.setOperationUserSign(request.getOperationUserSign());
|
||||
result.setOperationUserSignTime(request.getOperationUserSignTime());
|
||||
result.setLineSign(request.getLineSign());
|
||||
result.setLineSignTime(request.getLineSignTime());
|
||||
result.setMarketSizeScore(request.getMarketSizeScore());
|
||||
result.setShopAreaScore(request.getShopAreaScore());
|
||||
result.setConvenientScore(request.getConvenientScore());
|
||||
result.setEnvironmentScore(request.getEnvironmentScore());
|
||||
result.setRentContract(request.getRentContract());
|
||||
result.setMapEvaluationReport(request.getMapEvaluationReport());
|
||||
result.setPictureObj(request.getPictureObj());
|
||||
public static ShopPointDetailVO convertVO(ShopPointInfoDO pointInfo, ShopPointDetailInfoDO pointDetailInfo) {
|
||||
ShopPointDetailVO result = new ShopPointDetailVO();
|
||||
result.setPointId(pointInfo.getId());
|
||||
result.setPointName(pointInfo.getPointName());
|
||||
result.setPointCode(pointInfo.getPointCode());
|
||||
result.setLongitude(pointInfo.getLongitude());
|
||||
result.setLatitude(pointInfo.getLatitude());
|
||||
result.setAddress(pointInfo.getAddress());
|
||||
result.setPointStatus(pointInfo.getPointStatus());
|
||||
result.setPointScore(pointInfo.getPointScore());
|
||||
result.setBussinessStatus(pointDetailInfo.getBussinessStatus());
|
||||
result.setNineFlowRate(pointDetailInfo.getNineFlowRate());
|
||||
result.setTenFlowRate(pointDetailInfo.getTenFlowRate());
|
||||
result.setEighteenFlowRate(pointDetailInfo.getEighteenFlowRate());
|
||||
result.setNineteenFlowRate(pointDetailInfo.getNineteenFlowRate());
|
||||
result.setPointDirection(pointDetailInfo.getPointDirection());
|
||||
result.setSiteConditions(pointDetailInfo.getSiteConditions());
|
||||
result.setStoreWidth(pointDetailInfo.getStoreWidth());
|
||||
result.setLandlordUsername(pointDetailInfo.getLandlordUsername());
|
||||
result.setLandlordMobile(pointDetailInfo.getLandlordMobile());
|
||||
result.setPaymentMethod(pointDetailInfo.getPaymentMethod());
|
||||
result.setPropertyStatus(pointDetailInfo.getPropertyStatus());
|
||||
result.setTransferFee(pointDetailInfo.getTransferFee());
|
||||
result.setCoverCommunity(pointDetailInfo.getCoverCommunity());
|
||||
result.setConsumerAbility(pointDetailInfo.getConsumerAbility());
|
||||
result.setFlowRateCalculate(pointDetailInfo.getFlowRateCalculate());
|
||||
result.setGatherGuestFarmerMarket(pointDetailInfo.getGatherGuestFarmerMarket());
|
||||
result.setGatherGuestHospital(pointDetailInfo.getGatherGuestHospital());
|
||||
result.setGatherGuestSchool(pointDetailInfo.getGatherGuestSchool());
|
||||
result.setStoreFlowTrend(pointDetailInfo.getStoreFlowTrend());
|
||||
result.setNearRepast(pointDetailInfo.getNearRepast());
|
||||
result.setNearNeighbor(pointDetailInfo.getNearNeighbor());
|
||||
result.setNearCompete(pointDetailInfo.getNearCompete());
|
||||
result.setNearBusinessCondition(pointDetailInfo.getNearBusinessCondition());
|
||||
result.setIntendPosition(pointDetailInfo.getIntendPosition());
|
||||
result.setGreenBelt(pointDetailInfo.getGreenBelt());
|
||||
result.setStoreOutlook(pointDetailInfo.getStoreOutlook());
|
||||
result.setGuestConvenience(pointDetailInfo.getGuestConvenience());
|
||||
result.setWantShopSize(pointDetailInfo.getWantShopSize());
|
||||
result.setCompeteType(pointDetailInfo.getCompeteType());
|
||||
result.setCompeteBusinessCapacity(pointDetailInfo.getCompeteBusinessCapacity());
|
||||
result.setInvestAmount(pointDetailInfo.getInvestAmount());
|
||||
result.setDayTrader(pointDetailInfo.getDayTrader());
|
||||
result.setProfitRate(pointDetailInfo.getProfitRate());
|
||||
result.setMonthProfitRate(pointDetailInfo.getMonthProfitRate());
|
||||
result.setDeliveryRate(pointDetailInfo.getDeliveryRate());
|
||||
result.setDeliveryFee(pointDetailInfo.getDeliveryFee());
|
||||
result.setBrandUseRate(pointDetailInfo.getBrandUseRate());
|
||||
result.setBrandUseFee(pointDetailInfo.getBrandUseFee());
|
||||
result.setStaffFee(pointDetailInfo.getStaffFee());
|
||||
result.setShopManagerNum(pointDetailInfo.getShopManagerNum());
|
||||
result.setShopManagerFee(pointDetailInfo.getShopManagerFee());
|
||||
result.setClerkNum(pointDetailInfo.getClerkNum());
|
||||
result.setClerkFee(pointDetailInfo.getClerkFee());
|
||||
result.setBonus(pointDetailInfo.getBonus());
|
||||
result.setMonthRent(pointDetailInfo.getMonthRent());
|
||||
result.setOtherFee(pointDetailInfo.getOtherFee());
|
||||
result.setNetProfit(pointDetailInfo.getNetProfit());
|
||||
result.setMonthRateReturn(pointDetailInfo.getMonthRateReturn());
|
||||
result.setDevelopmentManagerSign(pointDetailInfo.getDevelopmentManagerSign());
|
||||
result.setDevelopmentManagerSignTime(pointDetailInfo.getDevelopmentManagerSignTime());
|
||||
result.setOperationUserSign(pointDetailInfo.getOperationUserSign());
|
||||
result.setOperationUserSignTime(pointDetailInfo.getOperationUserSignTime());
|
||||
result.setLineSign(pointDetailInfo.getLineSign());
|
||||
result.setLineSignTime(pointDetailInfo.getLineSignTime());
|
||||
result.setMarketSizeScore(pointDetailInfo.getMarketSizeScore());
|
||||
result.setShopAreaScore(pointDetailInfo.getShopAreaScore());
|
||||
result.setConvenientScore(pointDetailInfo.getConvenientScore());
|
||||
result.setEnvironmentScore(pointDetailInfo.getEnvironmentScore());
|
||||
result.setRentContract(pointDetailInfo.getRentContract());
|
||||
result.setMapEvaluationReport(pointDetailInfo.getMapEvaluationReport());
|
||||
result.setPictureObj(pointDetailInfo.getPictureObj());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.AddMapEvaluationReportRequest;
|
||||
import com.cool.store.request.AddShopPointDetailRequest;
|
||||
import com.cool.store.request.UpdateShopPointDetailRequest;
|
||||
import com.cool.store.vo.point.ShopPointDetailVO;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -19,10 +21,53 @@ public interface ShopPointService {
|
||||
*/
|
||||
Long addShopPointDetailInfo(AddShopPointDetailRequest shopPointDetailRequest, String userId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取铺位详情
|
||||
* @param pointId
|
||||
* @return
|
||||
*/
|
||||
ShopPointDetailVO getShopPointDetailInfo(Long pointId);
|
||||
|
||||
/**
|
||||
* 更新铺位
|
||||
* @param shopPointDetailRequest
|
||||
* @return
|
||||
*/
|
||||
Integer updateShopPointDetailInfo(UpdateShopPointDetailRequest shopPointDetailRequest);
|
||||
|
||||
/**
|
||||
* 生成铺位评估报告
|
||||
* @param pointId
|
||||
* @return
|
||||
*/
|
||||
Integer generateEvaluationReport(Long pointId);
|
||||
|
||||
/**
|
||||
* 铺位失效
|
||||
* @param pointId
|
||||
* @return
|
||||
*/
|
||||
Integer pointInvalid(Long pointId);
|
||||
|
||||
/**
|
||||
* 解绑铺位
|
||||
* @param pointId
|
||||
* @return
|
||||
*/
|
||||
Integer pointUnbind(Long pointId);
|
||||
|
||||
/**
|
||||
* 配置评估报告
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
Integer addMapEvaluationReport(AddMapEvaluationReportRequest request);
|
||||
|
||||
/**
|
||||
* 提交审批
|
||||
* @param pointId
|
||||
* @return
|
||||
*/
|
||||
Integer submitAudit(Long pointId);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.dao.ShopInfoDAO;
|
||||
import com.cool.store.dao.ShopPointDetailInfoDAO;
|
||||
import com.cool.store.dao.ShopPointInfoDAO;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.entity.ShopPointDetailInfoDO;
|
||||
import com.cool.store.entity.ShopPointInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.point.PointRecommendStatus;
|
||||
import com.cool.store.enums.point.PointStatusEnum;
|
||||
import com.cool.store.enums.point.SelectStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.AddMapEvaluationReportRequest;
|
||||
import com.cool.store.request.AddShopPointDetailRequest;
|
||||
import com.cool.store.request.UpdateShopPointDetailRequest;
|
||||
import com.cool.store.service.ShopPointService;
|
||||
import com.cool.store.vo.point.ShopPointDetailVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -21,6 +29,7 @@ import java.time.format.DateTimeFormatter;
|
||||
* @Description:
|
||||
* @date 2024-03-29 15:25
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ShopPointServiceImpl implements ShopPointService {
|
||||
|
||||
@@ -32,29 +41,130 @@ public class ShopPointServiceImpl implements ShopPointService {
|
||||
private ShopPointDetailInfoDAO shopPointDetailInfoDAO;
|
||||
@Resource
|
||||
private LineInfoDAO lineInfoDAO;
|
||||
@Resource
|
||||
private ShopPointRecommendDAO shopPointRecommendDAO;
|
||||
|
||||
@Override
|
||||
public Long addShopPointDetailInfo(AddShopPointDetailRequest shopPointDetailRequest, String userId) {
|
||||
ShopPointInfoDO shopPointInfo = AddShopPointDetailRequest.convertPointDO(shopPointDetailRequest);
|
||||
shopPointInfo.setPointCode(generateCode());
|
||||
shopPointInfo.setDevelopmentManager(userId);
|
||||
shopPointInfo.setDevelopmentTime(new Date());
|
||||
Long pointId = shopPointInfoDAO.addShopPointInfo(shopPointInfo);
|
||||
ShopPointDetailInfoDO shopPoint = AddShopPointDetailRequest.convertDO(shopPointDetailRequest);
|
||||
shopPoint.setPointId(pointId);
|
||||
return shopPointDetailInfoDAO.addShopPointDetailInfo(shopPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopPointDetailVO getShopPointDetailInfo(Long pointId) {
|
||||
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
|
||||
if(Objects.isNull(pointInfo)){
|
||||
log.error("铺位基本信息不存在");
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||
}
|
||||
ShopPointDetailInfoDO pointDetailInfo = shopPointDetailInfoDAO.getShopPointDetailInfoByPointId(pointId);
|
||||
if(Objects.isNull(pointDetailInfo)){
|
||||
log.error("铺位详情信息不存在");
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||
}
|
||||
return ShopPointDetailVO.convertVO(pointInfo, pointDetailInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateShopPointDetailInfo(UpdateShopPointDetailRequest shopPointDetailRequest) {
|
||||
ShopPointInfoDO shopPointInfo = UpdateShopPointDetailRequest.convertPointDO(shopPointDetailRequest);
|
||||
ShopPointDetailInfoDO shopPoint = UpdateShopPointDetailRequest.convertDO(shopPointDetailRequest);
|
||||
Long pointDetailId = shopPointDetailInfoDAO.getPointDetailIdByPointId(shopPointDetailRequest.getPointId());
|
||||
shopPoint.setId(pointDetailId);
|
||||
shopPointInfo.setPointScore(shopPoint.getTotalPointScore());
|
||||
shopPointInfoDAO.updatePointInfo(shopPointInfo);
|
||||
return shopPointDetailInfoDAO.updateShopPointDetailInfo(shopPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer generateEvaluationReport(Long pointId) {
|
||||
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
|
||||
ShopPointDetailInfoDO pointDetailInfo = shopPointDetailInfoDAO.getShopPointDetailInfoByPointId(pointId);
|
||||
if(Objects.isNull(pointInfo) || Objects.isNull(pointDetailInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||
}
|
||||
if(!pointDetailInfo.isCanSubmitEvaluable()){
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_COMPLETE);
|
||||
}
|
||||
Integer totalPointScore = pointDetailInfo.getTotalPointScore();
|
||||
ShopPointInfoDO updatePointInfo = new ShopPointInfoDO();
|
||||
updatePointInfo.setId(pointId);
|
||||
updatePointInfo.setPointScore(totalPointScore);
|
||||
updatePointInfo.setPointStatus(PointStatusEnum.POINT_STATUS_2.getCode());
|
||||
shopPointInfoDAO.updatePointInfo(updatePointInfo);
|
||||
return totalPointScore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer pointInvalid(Long pointId) {
|
||||
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
|
||||
if(Objects.isNull(pointInfo)){
|
||||
log.error("铺位基本信息不存在");
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||
}
|
||||
if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
|
||||
}
|
||||
ShopPointInfoDO updatePoint = new ShopPointInfoDO();
|
||||
updatePoint.setId(pointId);
|
||||
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_7.getCode());
|
||||
shopPointInfoDAO.updatePointInfo(updatePoint);
|
||||
return shopPointRecommendDAO.updateRecommendStatus(pointId, PointRecommendStatus.POINT_RECOMMEND_STATUS_6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer pointUnbind(Long pointId) {
|
||||
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
|
||||
if(Objects.isNull(pointInfo)){
|
||||
log.error("铺位基本信息不存在");
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||
}
|
||||
if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
|
||||
}
|
||||
ShopPointInfoDO updatePoint = new ShopPointInfoDO();
|
||||
updatePoint.setId(pointId);
|
||||
updatePoint.setSelectStatus(SelectStatusEnum.SELECT_STATUS_0.getCode());
|
||||
shopPointInfoDAO.updatePointInfo(updatePoint);
|
||||
//将已选择、已被他人选择的状态更新成待选泽
|
||||
return shopPointRecommendDAO.updateRecommendStatusByStatusAndPointId(pointId, PointRecommendStatus.POINT_RECOMMEND_STATUS_1, Arrays.asList(PointRecommendStatus.POINT_RECOMMEND_STATUS_2, PointRecommendStatus.POINT_RECOMMEND_STATUS_3));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer addMapEvaluationReport(AddMapEvaluationReportRequest request) {
|
||||
ShopPointDetailInfoDO pointDetailInfo = shopPointDetailInfoDAO.getShopPointDetailInfoByPointId(request.getPointId());
|
||||
if(Objects.isNull(pointDetailInfo)){
|
||||
log.error("铺位基本信息不存在");
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||
}
|
||||
ShopPointDetailInfoDO updatePoint = new ShopPointDetailInfoDO();
|
||||
updatePoint.setId(pointDetailInfo.getId());
|
||||
updatePoint.setMapEvaluationReport(request.getMapEvaluationReport());
|
||||
return shopPointDetailInfoDAO.updateShopPointDetailInfo(updatePoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer submitAudit(Long pointId) {
|
||||
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
|
||||
if(Objects.isNull(pointInfo)){
|
||||
log.error("铺位基本信息不存在");
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||
}
|
||||
if(!PointStatusEnum.POINT_STATUS_2.getCode().equals(pointInfo.getPointStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopPointInfoDO updatePoint = new ShopPointInfoDO();
|
||||
updatePoint.setId(pointId);
|
||||
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode());
|
||||
updatePoint.setSubmitAuditCount(pointInfo.getSubmitAuditCount() + 1);
|
||||
//处理子任务审核记录表
|
||||
return shopPointInfoDAO.updatePointInfo(updatePoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成code
|
||||
* @return
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.request.AddMapEvaluationReportRequest;
|
||||
import com.cool.store.request.AddShopPointDetailRequest;
|
||||
import com.cool.store.request.UpdateShopPointDetailRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.ShopPointService;
|
||||
import com.cool.store.vo.point.ShopPointDetailVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@@ -27,14 +28,54 @@ public class ShopPointController {
|
||||
@Resource
|
||||
private ShopPointService shopPointService;
|
||||
|
||||
@ApiOperation("新增铺位")
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<Long> addShopPointDetailInfo(@RequestBody AddShopPointDetailRequest shopPointDetailRequest) {
|
||||
public ResponseResult<Long> addShopPointDetailInfo(@RequestBody @Validated AddShopPointDetailRequest shopPointDetailRequest) {
|
||||
return ResponseResult.success(shopPointService.addShopPointDetailInfo(shopPointDetailRequest, CurrentUserHolder.getUserId()));
|
||||
}
|
||||
|
||||
@ApiOperation("铺位详情")
|
||||
@GetMapping("/detail")
|
||||
public ResponseResult<ShopPointDetailVO> getShopPointDetailInfo(@RequestParam("pointId")Long pointId) {
|
||||
return ResponseResult.success(shopPointService.getShopPointDetailInfo(pointId));
|
||||
}
|
||||
|
||||
@ApiOperation("完善铺位")
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Integer> updateShopPointDetailInfo(@RequestBody UpdateShopPointDetailRequest shopPointDetailRequest) {
|
||||
public ResponseResult<Integer> updateShopPointDetailInfo(@RequestBody @Validated UpdateShopPointDetailRequest shopPointDetailRequest) {
|
||||
return ResponseResult.success(shopPointService.updateShopPointDetailInfo(shopPointDetailRequest));
|
||||
}
|
||||
|
||||
@ApiOperation("生成评估报告")
|
||||
@GetMapping("/generateEvaluationReport")
|
||||
public ResponseResult<Integer> generateEvaluationReport(@RequestParam("pointId")Long pointId) {
|
||||
return ResponseResult.success(shopPointService.generateEvaluationReport(pointId));
|
||||
}
|
||||
|
||||
@ApiOperation("铺位失效")
|
||||
@GetMapping("/invalid")
|
||||
public ResponseResult<Integer> pointInvalid(@RequestParam("pointId")Long pointId) {
|
||||
return ResponseResult.success(shopPointService.pointInvalid(pointId));
|
||||
}
|
||||
|
||||
@ApiOperation("铺位解绑")
|
||||
@GetMapping("/unbind")
|
||||
public ResponseResult<Integer> pointUnbind(@RequestParam("pointId")Long pointId) {
|
||||
return ResponseResult.success(shopPointService.pointUnbind(pointId));
|
||||
}
|
||||
|
||||
@ApiOperation("配置评估报告")
|
||||
@PostMapping("/addMapEvaluationReport")
|
||||
public ResponseResult<Integer> addMapEvaluationReport(@RequestBody AddMapEvaluationReportRequest request) {
|
||||
return ResponseResult.success(shopPointService.addMapEvaluationReport(request));
|
||||
}
|
||||
|
||||
@ApiOperation("提交审批")
|
||||
@GetMapping("/submitAudit")
|
||||
public ResponseResult<Integer> submitAudit(@RequestParam("pointId")Long pointId) {
|
||||
return ResponseResult.success(shopPointService.submitAudit(pointId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user