This commit is contained in:
zhangchenbiao
2024-04-02 09:58:32 +08:00
parent c3e5b0e53e
commit e5ed16438e
24 changed files with 680 additions and 139 deletions

View File

@@ -45,7 +45,6 @@ public enum ErrorCodeEnum {
WX_SERVICE_ERROR(1021021, "调用微信服务异常", null), WX_SERVICE_ERROR(1021021, "调用微信服务异常", null),
SESSION_KEY_ERROR(1021022, "sessionKey过期", null), SESSION_KEY_ERROR(1021022, "sessionKey过期", null),
GET_WECHAT_USER_INFO_FAIL(1021023,"获取小程序用户信息失败", null), GET_WECHAT_USER_INFO_FAIL(1021023,"获取小程序用户信息失败", null),
FEISHU_SERVICE_ERROR(1021024,"飞书服务调用异常", null),
USER_GROUP_NAME_EXIST(1021076, "用户分组名称已存在", null), USER_GROUP_NAME_EXIST(1021076, "用户分组名称已存在", null),
USER_GROUP_NOT_EXIST(1021077, "用户分组不存在", null), USER_GROUP_NOT_EXIST(1021077, "用户分组不存在", null),
GET_INFO_ERROR(1021078, "获取信息异常", null), GET_INFO_ERROR(1021078, "获取信息异常", null),
@@ -80,6 +79,10 @@ public enum ErrorCodeEnum {
TIME_OCCUPIED(500018, "预约时间被占用", null), TIME_OCCUPIED(500018, "预约时间被占用", null),
LINE_PAY_IS_NOT_EXIST(500019, "意向金信息不存在!", 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), INTERVIEW_ENTER_FAIL(1021101, "进入面审间失败", null),
DINGDING_USER_NOT_EXIST(1021102, "用户钉钉信息不存在,无法发起资质审核!", null), DINGDING_USER_NOT_EXIST(1021102, "用户钉钉信息不存在,无法发起资质审核!", null),
@@ -119,23 +122,11 @@ public enum ErrorCodeEnum {
OPEN_AREA_NULL(600006,"归属地区不能为空",null), OPEN_AREA_NULL(600006,"归属地区不能为空",null),
NOT_IN_PUBLIC_SEA(600007,"当前线索不在公海 不支持分配招商经理",null), NOT_IN_PUBLIC_SEA(600007,"当前线索不在公海 不支持分配招商经理",null),
OUTBOUND_NUMBER_EXIST(110001, "该呼出号码已被绑定,请更改后重试", null),
LABEL_GROUP_IN_USE(120001, "该标签组下存在标签不可删除请确保该标签组下标签数量为0后再进行删除", null), LABEL_GROUP_IN_USE(120001, "该标签组下存在标签不可删除请确保该标签组下标签数量为0后再进行删除", null),
LABEL_GROUP_EXIST(120002, "该标签组已存在,请重新输入", null), LABEL_GROUP_EXIST(120002, "该标签组已存在,请重新输入", null),
LABEL_EXIST(120003, "该标签已存在,请重新输入", 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), OPEN_AREA_IS_NOT_EXISTS(107006, "意向区域城市不存在", null),
REGION_NOT_EXIST(108001, "区域不存在",null), REGION_NOT_EXIST(108001, "区域不存在",null),

View File

@@ -53,4 +53,47 @@ public enum FlowRateCalculateEnum {
return null; 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;
}
} }

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -5,6 +5,7 @@ import com.cool.store.mapper.ShopPointDetailInfoMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Objects;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
@@ -34,8 +35,10 @@ public class ShopPointDetailInfoDAO {
* @return * @return
*/ */
public Integer updateShopPointDetailInfo(ShopPointDetailInfoDO shopPointDetailInfo) { public Integer updateShopPointDetailInfo(ShopPointDetailInfoDO shopPointDetailInfo) {
Long pointDetailId = getPointDetailIdByPointId(shopPointDetailInfo.getPointId()); if(Objects.isNull(shopPointDetailInfo.getId()) && Objects.nonNull(shopPointDetailInfo.getPointId())){
shopPointDetailInfo.setId(pointDetailId); Long pointDetailId = getPointDetailIdByPointId(shopPointDetailInfo.getPointId());
shopPointDetailInfo.setId(pointDetailId);
}
return shopPointDetailInfoMapper.updateByPrimaryKeySelective(shopPointDetailInfo); return shopPointDetailInfoMapper.updateByPrimaryKeySelective(shopPointDetailInfo);
} }
@@ -43,5 +46,9 @@ public class ShopPointDetailInfoDAO {
return shopPointDetailInfoMapper.getPointDetailIdByPointId(pointId); return shopPointDetailInfoMapper.getPointDetailIdByPointId(pointId);
} }
public ShopPointDetailInfoDO getShopPointDetailInfoByPointId(Long pointId) {
return shopPointDetailInfoMapper.getShopPointDetailInfoByPointId(pointId);
}
} }

View File

@@ -5,6 +5,7 @@ import com.cool.store.mapper.ShopPointInfoMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Objects;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
@@ -18,6 +19,14 @@ public class ShopPointInfoDAO {
@Resource @Resource
private ShopPointInfoMapper shopPointInfoMapper; 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) { public Long addShopPointInfo(ShopPointInfoDO shopPointInfo) {
shopPointInfoMapper.insertSelective(shopPointInfo); shopPointInfoMapper.insertSelective(shopPointInfo);
return shopPointInfo.getId(); return shopPointInfo.getId();

View File

@@ -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);
}
}

View File

@@ -12,4 +12,11 @@ public interface ShopPointDetailInfoMapper extends Mapper<ShopPointDetailInfoDO>
* @return * @return
*/ */
Long getPointDetailIdByPointId(@Param("pointId") Long pointId); Long getPointDetailIdByPointId(@Param("pointId") Long pointId);
/**
* 获取详情
* @param pointId
* @return
*/
ShopPointDetailInfoDO getShopPointDetailInfoByPointId(@Param("pointId") Long pointId);
} }

View File

@@ -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);
}

View File

@@ -5,16 +5,15 @@
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="point_id" jdbcType="BIGINT" property="pointId" /> <result column="point_id" jdbcType="BIGINT" property="pointId" />
<result column="bussiness_status" jdbcType="TINYINT" property="bussinessStatus" /> <result column="bussiness_status" jdbcType="TINYINT" property="bussinessStatus" />
<result column="nine_flow_rate" jdbcType="TINYINT" property="nineFlowRate" /> <result column="nine_flow_rate" jdbcType="INTEGER" property="nineFlowRate" />
<result column="ten_flow_rate" jdbcType="TINYINT" property="tenFlowRate" /> <result column="ten_flow_rate" jdbcType="INTEGER" property="tenFlowRate" />
<result column="eighteen_flow_rate" jdbcType="TINYINT" property="eighteenFlowRate" /> <result column="eighteen_flow_rate" jdbcType="INTEGER" property="eighteenFlowRate" />
<result column="nineteen_flow_rate" jdbcType="TINYINT" property="nineteenFlowRate" /> <result column="nineteen_flow_rate" jdbcType="INTEGER" property="nineteenFlowRate" />
<result column="point_direction" jdbcType="TINYINT" property="pointDirection" /> <result column="point_direction" jdbcType="TINYINT" property="pointDirection" />
<result column="site_conditions" jdbcType="TINYINT" property="siteConditions" /> <result column="site_conditions" jdbcType="TINYINT" property="siteConditions" />
<result column="store_width" jdbcType="VARCHAR" property="storeWidth" /> <result column="store_width" jdbcType="VARCHAR" property="storeWidth" />
<result column="landlord_username" jdbcType="VARCHAR" property="landlordUsername" /> <result column="landlord_username" jdbcType="VARCHAR" property="landlordUsername" />
<result column="landlord_mobile" jdbcType="VARCHAR" property="landlordMobile" /> <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="payment_method" jdbcType="TINYINT" property="paymentMethod" />
<result column="property_status" jdbcType="TINYINT" property="propertyStatus" /> <result column="property_status" jdbcType="TINYINT" property="propertyStatus" />
<result column="transfer_fee" jdbcType="VARCHAR" property="transferFee" /> <result column="transfer_fee" jdbcType="VARCHAR" property="transferFee" />
@@ -74,4 +73,8 @@
<select id="getPointDetailIdByPointId" resultType="java.lang.Long"> <select id="getPointDetailIdByPointId" resultType="java.lang.Long">
select id from xfsg_shop_point_detail_info where point_id = #{pointId} select id from xfsg_shop_point_detail_info where point_id = #{pointId}
</select> </select>
<select id="getShopPointDetailInfoByPointId" resultMap="BaseResultMap">
select * from xfsg_shop_point_detail_info where point_id = #{pointId} and deleted = 0
</select>
</mapper> </mapper>

View File

@@ -9,7 +9,6 @@
<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="shop_area_type" jdbcType="VARCHAR" property="shopAreaType" />
<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" />
@@ -18,6 +17,7 @@
<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="submit_audit_count" jdbcType="TINYINT" property="submitAuditCount" /> <result column="submit_audit_count" jdbcType="TINYINT" property="submitAuditCount" />
<result column="is_line_upload" jdbcType="BIT" property="isLineUpload" /> <result column="is_line_upload" jdbcType="BIT" property="isLineUpload" />
<result column="deleted" jdbcType="BIT" property="deleted" /> <result column="deleted" jdbcType="BIT" property="deleted" />

View File

@@ -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>

View File

@@ -3,6 +3,6 @@ jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcoll
jdbc.user= coolstore jdbc.user= coolstore
jdbc.password = CSCErYcXniNYm7bT jdbc.password = CSCErYcXniNYm7bT
table.name = xfsg_shop_point_info table.name = xfsg_shop_point_recommend
table.object.class = ShopPointInfoDO table.object.class = ShopPointRecommendDO
table.mapper = ShopPointInfoMapper table.mapper = ShopPointRecommendMapper

View File

@@ -52,7 +52,7 @@ public class ShopPointDetailInfoDO {
private Integer nineteenFlowRate; private Integer nineteenFlowRate;
/** /**
* 店铺方位 0主要路线, 1次要线 * 店铺方位 1.主要动线 2.次要线
*/ */
@Column(name = "point_direction") @Column(name = "point_direction")
private Integer pointDirection; private Integer pointDirection;
@@ -81,12 +81,6 @@ public class ShopPointDetailInfoDO {
@Column(name = "landlord_mobile") @Column(name = "landlord_mobile")
private String landlordMobile; private String landlordMobile;
/**
* 门店月租金
*/
@Column(name = "store_rent")
private String storeRent;
/** /**
* 支付方式 参考PaymentMethodEnum * 支付方式 参考PaymentMethodEnum
*/ */
@@ -527,6 +521,10 @@ public class ShopPointDetailInfoDO {
return getMarketSizeScore() + getShopAreaScore() + getConvenientScore() + getEnvironmentScore(); return getMarketSizeScore() + getShopAreaScore() + getConvenientScore() + getEnvironmentScore();
} }
public Integer getFlowRateCalculate() {
return FlowRateCalculateEnum.getByFlowRate(this.nineFlowRate, this.tenFlowRate, this.eighteenFlowRate, this.nineteenFlowRate).getCode();
}
public boolean isCanSubmitEvaluable(){ public boolean isCanSubmitEvaluable(){
if(Objects.isNull(this.bussinessStatus)){ if(Objects.isNull(this.bussinessStatus)){
return false; 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())){ if(Objects.isNull(this.landlordUsername) || StringUtils.isBlank(this.landlordUsername.trim()) || Objects.isNull(this.landlordMobile) || StringUtils.isBlank(this.landlordMobile.trim())){
return false; return false;
} }
if(Objects.isNull(this.storeRent)){
return false;
}
if(Objects.isNull(this.paymentMethod) || Objects.isNull(this.propertyStatus)){ if(Objects.isNull(this.paymentMethod) || Objects.isNull(this.propertyStatus)){
return false; return false;
} }

View File

@@ -48,12 +48,6 @@ public class ShopPointInfoDO {
@Column(name = "point_area") @Column(name = "point_area")
private String pointArea; private String pointArea;
/**
* 商圈类型
*/
@Column(name = "shop_area_type")
private String shopAreaType;
/** /**
* 经度 * 经度
*/ */
@@ -99,6 +93,12 @@ public class ShopPointInfoDO {
@Column(name = "point_score") @Column(name = "point_score")
private Integer pointScore; private Integer pointScore;
/**
* 选择状态0.未选择, 1.已被选择
*/
@Column(name = "select_status")
private Integer selectStatus;
/** /**
* 审批次数 * 审批次数
*/ */

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -63,9 +63,6 @@ public class AddShopPointDetailRequest {
@ApiModelProperty("房东电话") @ApiModelProperty("房东电话")
private String landlordMobile; private String landlordMobile;
@ApiModelProperty("门店月租金")
private String storeRent;
@Min(1) @Min(1)
@Max(4) @Max(4)
@ApiModelProperty("支付方式 1.月付 2.季付 3.半年付 4.年付") @ApiModelProperty("支付方式 1.月付 2.季付 3.半年付 4.年付")
@@ -89,11 +86,6 @@ public class AddShopPointDetailRequest {
@ApiModelProperty("消费能力 1.高端 2.中高端 3.中端 4.低端") @ApiModelProperty("消费能力 1.高端 2.中高端 3.中端 4.低端")
private Integer consumerAbility; private Integer consumerAbility;
@Min(1)
@Max(4)
@ApiModelProperty("人流测算 1.>400人/时以上, 2.300400人/时, 3.200300人/时, 4.100200人/时")
private Integer flowRateCalculate;
@Min(1) @Min(1)
@Max(2) @Max(2)
@ApiModelProperty("聚客点农贸市场 1.是 2.否") @ApiModelProperty("聚客点农贸市场 1.是 2.否")
@@ -226,9 +218,6 @@ public class AddShopPointDetailRequest {
@ApiModelProperty("租赁合同") @ApiModelProperty("租赁合同")
private String rentContract; private String rentContract;
@ApiModelProperty("高德地图评估报告")
private String mapEvaluationReport;
@ApiModelProperty("图片对象") @ApiModelProperty("图片对象")
private String pictureObj; private String pictureObj;
@@ -237,6 +226,7 @@ public class AddShopPointDetailRequest {
ShopPointDetailInfoDO result = new ShopPointDetailInfoDO(); ShopPointDetailInfoDO result = new ShopPointDetailInfoDO();
result.setBussinessStatus(request.getBussinessStatus()); result.setBussinessStatus(request.getBussinessStatus());
result.setNineFlowRate(request.getNineFlowRate()); result.setNineFlowRate(request.getNineFlowRate());
result.setTenFlowRate(request.getTenFlowRate());
result.setEighteenFlowRate(request.getEighteenFlowRate()); result.setEighteenFlowRate(request.getEighteenFlowRate());
result.setNineteenFlowRate(request.getNineteenFlowRate()); result.setNineteenFlowRate(request.getNineteenFlowRate());
result.setPointDirection(request.getPointDirection()); result.setPointDirection(request.getPointDirection());
@@ -244,13 +234,11 @@ public class AddShopPointDetailRequest {
result.setStoreWidth(request.getStoreWidth()); result.setStoreWidth(request.getStoreWidth());
result.setLandlordUsername(request.getLandlordUsername()); result.setLandlordUsername(request.getLandlordUsername());
result.setLandlordMobile(request.getLandlordMobile()); result.setLandlordMobile(request.getLandlordMobile());
result.setStoreRent(request.getStoreRent());
result.setPaymentMethod(request.getPaymentMethod()); result.setPaymentMethod(request.getPaymentMethod());
result.setPropertyStatus(request.getPropertyStatus()); result.setPropertyStatus(request.getPropertyStatus());
result.setTransferFee(request.getTransferFee()); result.setTransferFee(request.getTransferFee());
result.setCoverCommunity(request.getCoverCommunity()); result.setCoverCommunity(request.getCoverCommunity());
result.setConsumerAbility(request.getConsumerAbility()); result.setConsumerAbility(request.getConsumerAbility());
result.setFlowRateCalculate(request.getFlowRateCalculate());
result.setGatherGuestFarmerMarket(request.getGatherGuestFarmerMarket()); result.setGatherGuestFarmerMarket(request.getGatherGuestFarmerMarket());
result.setGatherGuestHospital(request.getGatherGuestHospital()); result.setGatherGuestHospital(request.getGatherGuestHospital());
result.setGatherGuestSchool(request.getGatherGuestSchool()); result.setGatherGuestSchool(request.getGatherGuestSchool());
@@ -285,7 +273,6 @@ public class AddShopPointDetailRequest {
result.setNetProfit(request.getNetProfit()); result.setNetProfit(request.getNetProfit());
result.setMonthRateReturn(request.getMonthRateReturn()); result.setMonthRateReturn(request.getMonthRateReturn());
result.setRentContract(request.getRentContract()); result.setRentContract(request.getRentContract());
result.setMapEvaluationReport(request.getMapEvaluationReport());
result.setPictureObj(request.getPictureObj()); result.setPictureObj(request.getPictureObj());
return result; return result;
} }

View File

@@ -5,11 +5,13 @@ import com.cool.store.entity.ShopPointInfoDO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
@Data @Data
public class UpdateShopPointDetailRequest extends AddShopPointDetailRequest{ public class UpdateShopPointDetailRequest extends AddShopPointDetailRequest{
@NotNull
@ApiModelProperty("点位id") @ApiModelProperty("点位id")
private Long pointId; private Long pointId;
@@ -28,13 +30,11 @@ public class UpdateShopPointDetailRequest extends AddShopPointDetailRequest{
result.setStoreWidth(request.getStoreWidth()); result.setStoreWidth(request.getStoreWidth());
result.setLandlordUsername(request.getLandlordUsername()); result.setLandlordUsername(request.getLandlordUsername());
result.setLandlordMobile(request.getLandlordMobile()); result.setLandlordMobile(request.getLandlordMobile());
result.setStoreRent(request.getStoreRent());
result.setPaymentMethod(request.getPaymentMethod()); result.setPaymentMethod(request.getPaymentMethod());
result.setPropertyStatus(request.getPropertyStatus()); result.setPropertyStatus(request.getPropertyStatus());
result.setTransferFee(request.getTransferFee()); result.setTransferFee(request.getTransferFee());
result.setCoverCommunity(request.getCoverCommunity()); result.setCoverCommunity(request.getCoverCommunity());
result.setConsumerAbility(request.getConsumerAbility()); result.setConsumerAbility(request.getConsumerAbility());
result.setFlowRateCalculate(request.getFlowRateCalculate());
result.setGatherGuestFarmerMarket(request.getGatherGuestFarmerMarket()); result.setGatherGuestFarmerMarket(request.getGatherGuestFarmerMarket());
result.setGatherGuestHospital(request.getGatherGuestHospital()); result.setGatherGuestHospital(request.getGatherGuestHospital());
result.setGatherGuestSchool(request.getGatherGuestSchool()); result.setGatherGuestSchool(request.getGatherGuestSchool());
@@ -69,7 +69,6 @@ public class UpdateShopPointDetailRequest extends AddShopPointDetailRequest{
result.setNetProfit(request.getNetProfit()); result.setNetProfit(request.getNetProfit());
result.setMonthRateReturn(request.getMonthRateReturn()); result.setMonthRateReturn(request.getMonthRateReturn());
result.setRentContract(request.getRentContract()); result.setRentContract(request.getRentContract());
result.setMapEvaluationReport(request.getMapEvaluationReport());
result.setPictureObj(request.getPictureObj()); result.setPictureObj(request.getPictureObj());
return result; return result;
} }

View File

@@ -1,6 +1,7 @@
package com.cool.store.vo.point; package com.cool.store.vo.point;
import com.cool.store.entity.ShopPointDetailInfoDO; import com.cool.store.entity.ShopPointDetailInfoDO;
import com.cool.store.entity.ShopPointInfoDO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@@ -9,9 +10,15 @@ import java.util.Date;
@Data @Data
public class ShopPointDetailVO { public class ShopPointDetailVO {
@ApiModelProperty("店铺id")
private Long pointId;
@ApiModelProperty("铺位名称") @ApiModelProperty("铺位名称")
private String pointName; private String pointName;
@ApiModelProperty("铺位编号")
private String pointCode;
@ApiModelProperty("所属大区") @ApiModelProperty("所属大区")
private Long regionId; private Long regionId;
@@ -24,7 +31,13 @@ public class ShopPointDetailVO {
@ApiModelProperty("详细地址") @ApiModelProperty("详细地址")
private String address; 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; private Integer bussinessStatus;
@ApiModelProperty("09:00-10:00人流量") @ApiModelProperty("09:00-10:00人流量")
@@ -39,7 +52,7 @@ public class ShopPointDetailVO {
@ApiModelProperty("19:00-20:00人流量") @ApiModelProperty("19:00-20:00人流量")
private Integer nineteenFlowRate; private Integer nineteenFlowRate;
@ApiModelProperty("店铺方位 0主要路线, 1次要线") @ApiModelProperty("店铺方位 1.主要动线 2.次要线")
private Integer pointDirection; private Integer pointDirection;
@ApiModelProperty("立地条件0单门面, 1双门面, 2多门面, 3转角") @ApiModelProperty("立地条件0单门面, 1双门面, 2多门面, 3转角")
@@ -57,9 +70,6 @@ public class ShopPointDetailVO {
@ApiModelProperty("房东电话") @ApiModelProperty("房东电话")
private String landlordMobile; private String landlordMobile;
@ApiModelProperty("门店月租金")
private String storeRent;
@ApiModelProperty("支付方式 1.月付 2.季付 3.半年付 4.年付") @ApiModelProperty("支付方式 1.月付 2.季付 3.半年付 4.年付")
private Integer paymentMethod; private Integer paymentMethod;
@@ -217,71 +227,78 @@ public class ShopPointDetailVO {
private String pictureObj; private String pictureObj;
public static ShopPointDetailInfoDO convertDO(ShopPointDetailVO request) { public static ShopPointDetailVO convertVO(ShopPointInfoDO pointInfo, ShopPointDetailInfoDO pointDetailInfo) {
ShopPointDetailInfoDO result = new ShopPointDetailInfoDO(); ShopPointDetailVO result = new ShopPointDetailVO();
result.setBussinessStatus(request.getBussinessStatus()); result.setPointId(pointInfo.getId());
result.setNineFlowRate(request.getNineFlowRate()); result.setPointName(pointInfo.getPointName());
result.setTenFlowRate(request.getTenFlowRate()); result.setPointCode(pointInfo.getPointCode());
result.setEighteenFlowRate(request.getEighteenFlowRate()); result.setLongitude(pointInfo.getLongitude());
result.setNineteenFlowRate(request.getNineteenFlowRate()); result.setLatitude(pointInfo.getLatitude());
result.setPointDirection(request.getPointDirection()); result.setAddress(pointInfo.getAddress());
result.setSiteConditions(request.getSiteConditions()); result.setPointStatus(pointInfo.getPointStatus());
result.setStoreWidth(request.getStoreWidth()); result.setPointScore(pointInfo.getPointScore());
result.setLandlordUsername(request.getLandlordUsername()); result.setBussinessStatus(pointDetailInfo.getBussinessStatus());
result.setLandlordMobile(request.getLandlordMobile()); result.setNineFlowRate(pointDetailInfo.getNineFlowRate());
result.setStoreRent(request.getStoreRent()); result.setTenFlowRate(pointDetailInfo.getTenFlowRate());
result.setPaymentMethod(request.getPaymentMethod()); result.setEighteenFlowRate(pointDetailInfo.getEighteenFlowRate());
result.setPropertyStatus(request.getPropertyStatus()); result.setNineteenFlowRate(pointDetailInfo.getNineteenFlowRate());
result.setTransferFee(request.getTransferFee()); result.setPointDirection(pointDetailInfo.getPointDirection());
result.setCoverCommunity(request.getCoverCommunity()); result.setSiteConditions(pointDetailInfo.getSiteConditions());
result.setConsumerAbility(request.getConsumerAbility()); result.setStoreWidth(pointDetailInfo.getStoreWidth());
result.setFlowRateCalculate(request.getFlowRateCalculate()); result.setLandlordUsername(pointDetailInfo.getLandlordUsername());
result.setGatherGuestFarmerMarket(request.getGatherGuestFarmerMarket()); result.setLandlordMobile(pointDetailInfo.getLandlordMobile());
result.setGatherGuestHospital(request.getGatherGuestHospital()); result.setPaymentMethod(pointDetailInfo.getPaymentMethod());
result.setGatherGuestSchool(request.getGatherGuestSchool()); result.setPropertyStatus(pointDetailInfo.getPropertyStatus());
result.setStoreFlowTrend(request.getStoreFlowTrend()); result.setTransferFee(pointDetailInfo.getTransferFee());
result.setNearRepast(request.getNearRepast()); result.setCoverCommunity(pointDetailInfo.getCoverCommunity());
result.setNearNeighbor(request.getNearNeighbor()); result.setConsumerAbility(pointDetailInfo.getConsumerAbility());
result.setNearCompete(request.getNearCompete()); result.setFlowRateCalculate(pointDetailInfo.getFlowRateCalculate());
result.setNearBusinessCondition(request.getNearBusinessCondition()); result.setGatherGuestFarmerMarket(pointDetailInfo.getGatherGuestFarmerMarket());
result.setIntendPosition(request.getIntendPosition()); result.setGatherGuestHospital(pointDetailInfo.getGatherGuestHospital());
result.setGreenBelt(request.getGreenBelt()); result.setGatherGuestSchool(pointDetailInfo.getGatherGuestSchool());
result.setStoreOutlook(request.getStoreOutlook()); result.setStoreFlowTrend(pointDetailInfo.getStoreFlowTrend());
result.setGuestConvenience(request.getGuestConvenience()); result.setNearRepast(pointDetailInfo.getNearRepast());
result.setWantShopSize(request.getWantShopSize()); result.setNearNeighbor(pointDetailInfo.getNearNeighbor());
result.setCompeteType(request.getCompeteType()); result.setNearCompete(pointDetailInfo.getNearCompete());
result.setCompeteBusinessCapacity(request.getCompeteBusinessCapacity()); result.setNearBusinessCondition(pointDetailInfo.getNearBusinessCondition());
result.setInvestAmount(request.getInvestAmount()); result.setIntendPosition(pointDetailInfo.getIntendPosition());
result.setDayTrader(request.getDayTrader()); result.setGreenBelt(pointDetailInfo.getGreenBelt());
result.setProfitRate(request.getProfitRate()); result.setStoreOutlook(pointDetailInfo.getStoreOutlook());
result.setMonthProfitRate(request.getMonthProfitRate()); result.setGuestConvenience(pointDetailInfo.getGuestConvenience());
result.setDeliveryRate(request.getDeliveryRate()); result.setWantShopSize(pointDetailInfo.getWantShopSize());
result.setDeliveryFee(request.getDeliveryFee()); result.setCompeteType(pointDetailInfo.getCompeteType());
result.setBrandUseRate(request.getBrandUseRate()); result.setCompeteBusinessCapacity(pointDetailInfo.getCompeteBusinessCapacity());
result.setBrandUseFee(request.getBrandUseFee()); result.setInvestAmount(pointDetailInfo.getInvestAmount());
result.setStaffFee(request.getStaffFee()); result.setDayTrader(pointDetailInfo.getDayTrader());
result.setShopManagerNum(request.getShopManagerNum()); result.setProfitRate(pointDetailInfo.getProfitRate());
result.setShopManagerFee(request.getShopManagerFee()); result.setMonthProfitRate(pointDetailInfo.getMonthProfitRate());
result.setClerkNum(request.getClerkNum()); result.setDeliveryRate(pointDetailInfo.getDeliveryRate());
result.setClerkFee(request.getClerkFee()); result.setDeliveryFee(pointDetailInfo.getDeliveryFee());
result.setBonus(request.getBonus()); result.setBrandUseRate(pointDetailInfo.getBrandUseRate());
result.setMonthRent(request.getMonthRent()); result.setBrandUseFee(pointDetailInfo.getBrandUseFee());
result.setOtherFee(request.getOtherFee()); result.setStaffFee(pointDetailInfo.getStaffFee());
result.setNetProfit(request.getNetProfit()); result.setShopManagerNum(pointDetailInfo.getShopManagerNum());
result.setMonthRateReturn(request.getMonthRateReturn()); result.setShopManagerFee(pointDetailInfo.getShopManagerFee());
result.setDevelopmentManagerSign(request.getDevelopmentManagerSign()); result.setClerkNum(pointDetailInfo.getClerkNum());
result.setDevelopmentManagerSignTime(request.getDevelopmentManagerSignTime()); result.setClerkFee(pointDetailInfo.getClerkFee());
result.setOperationUserSign(request.getOperationUserSign()); result.setBonus(pointDetailInfo.getBonus());
result.setOperationUserSignTime(request.getOperationUserSignTime()); result.setMonthRent(pointDetailInfo.getMonthRent());
result.setLineSign(request.getLineSign()); result.setOtherFee(pointDetailInfo.getOtherFee());
result.setLineSignTime(request.getLineSignTime()); result.setNetProfit(pointDetailInfo.getNetProfit());
result.setMarketSizeScore(request.getMarketSizeScore()); result.setMonthRateReturn(pointDetailInfo.getMonthRateReturn());
result.setShopAreaScore(request.getShopAreaScore()); result.setDevelopmentManagerSign(pointDetailInfo.getDevelopmentManagerSign());
result.setConvenientScore(request.getConvenientScore()); result.setDevelopmentManagerSignTime(pointDetailInfo.getDevelopmentManagerSignTime());
result.setEnvironmentScore(request.getEnvironmentScore()); result.setOperationUserSign(pointDetailInfo.getOperationUserSign());
result.setRentContract(request.getRentContract()); result.setOperationUserSignTime(pointDetailInfo.getOperationUserSignTime());
result.setMapEvaluationReport(request.getMapEvaluationReport()); result.setLineSign(pointDetailInfo.getLineSign());
result.setPictureObj(request.getPictureObj()); 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; return result;
} }

View File

@@ -1,7 +1,9 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.request.AddMapEvaluationReportRequest;
import com.cool.store.request.AddShopPointDetailRequest; import com.cool.store.request.AddShopPointDetailRequest;
import com.cool.store.request.UpdateShopPointDetailRequest; import com.cool.store.request.UpdateShopPointDetailRequest;
import com.cool.store.vo.point.ShopPointDetailVO;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
@@ -19,10 +21,53 @@ public interface ShopPointService {
*/ */
Long addShopPointDetailInfo(AddShopPointDetailRequest shopPointDetailRequest, String userId); Long addShopPointDetailInfo(AddShopPointDetailRequest shopPointDetailRequest, String userId);
/**
* 获取铺位详情
* @param pointId
* @return
*/
ShopPointDetailVO getShopPointDetailInfo(Long pointId);
/** /**
* 更新铺位 * 更新铺位
* @param shopPointDetailRequest * @param shopPointDetailRequest
* @return * @return
*/ */
Integer updateShopPointDetailInfo(UpdateShopPointDetailRequest shopPointDetailRequest); 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);
} }

View File

@@ -1,19 +1,27 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import com.cool.store.dao.LineInfoDAO; import com.cool.store.dao.*;
import com.cool.store.dao.ShopInfoDAO;
import com.cool.store.dao.ShopPointDetailInfoDAO;
import com.cool.store.dao.ShopPointInfoDAO;
import com.cool.store.entity.ShopPointDetailInfoDO; import com.cool.store.entity.ShopPointDetailInfoDO;
import com.cool.store.entity.ShopPointInfoDO; 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.AddShopPointDetailRequest;
import com.cool.store.request.UpdateShopPointDetailRequest; import com.cool.store.request.UpdateShopPointDetailRequest;
import com.cool.store.service.ShopPointService; import com.cool.store.service.ShopPointService;
import com.cool.store.vo.point.ShopPointDetailVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.Date;
import java.util.Objects;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
@@ -21,6 +29,7 @@ import java.time.format.DateTimeFormatter;
* @Description: * @Description:
* @date 2024-03-29 15:25 * @date 2024-03-29 15:25
*/ */
@Slf4j
@Service @Service
public class ShopPointServiceImpl implements ShopPointService { public class ShopPointServiceImpl implements ShopPointService {
@@ -32,29 +41,130 @@ public class ShopPointServiceImpl implements ShopPointService {
private ShopPointDetailInfoDAO shopPointDetailInfoDAO; private ShopPointDetailInfoDAO shopPointDetailInfoDAO;
@Resource @Resource
private LineInfoDAO lineInfoDAO; private LineInfoDAO lineInfoDAO;
@Resource
private ShopPointRecommendDAO shopPointRecommendDAO;
@Override @Override
public Long addShopPointDetailInfo(AddShopPointDetailRequest shopPointDetailRequest, String userId) { public Long addShopPointDetailInfo(AddShopPointDetailRequest shopPointDetailRequest, String userId) {
ShopPointInfoDO shopPointInfo = AddShopPointDetailRequest.convertPointDO(shopPointDetailRequest); ShopPointInfoDO shopPointInfo = AddShopPointDetailRequest.convertPointDO(shopPointDetailRequest);
shopPointInfo.setPointCode(generateCode()); shopPointInfo.setPointCode(generateCode());
shopPointInfo.setDevelopmentManager(userId); shopPointInfo.setDevelopmentManager(userId);
shopPointInfo.setDevelopmentTime(new Date());
Long pointId = shopPointInfoDAO.addShopPointInfo(shopPointInfo); Long pointId = shopPointInfoDAO.addShopPointInfo(shopPointInfo);
ShopPointDetailInfoDO shopPoint = AddShopPointDetailRequest.convertDO(shopPointDetailRequest); ShopPointDetailInfoDO shopPoint = AddShopPointDetailRequest.convertDO(shopPointDetailRequest);
shopPoint.setPointId(pointId); shopPoint.setPointId(pointId);
return shopPointDetailInfoDAO.addShopPointDetailInfo(shopPoint); 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 @Override
public Integer updateShopPointDetailInfo(UpdateShopPointDetailRequest shopPointDetailRequest) { public Integer updateShopPointDetailInfo(UpdateShopPointDetailRequest shopPointDetailRequest) {
ShopPointInfoDO shopPointInfo = UpdateShopPointDetailRequest.convertPointDO(shopPointDetailRequest); ShopPointInfoDO shopPointInfo = UpdateShopPointDetailRequest.convertPointDO(shopPointDetailRequest);
ShopPointDetailInfoDO shopPoint = UpdateShopPointDetailRequest.convertDO(shopPointDetailRequest); ShopPointDetailInfoDO shopPoint = UpdateShopPointDetailRequest.convertDO(shopPointDetailRequest);
Long pointDetailId = shopPointDetailInfoDAO.getPointDetailIdByPointId(shopPointDetailRequest.getPointId());
shopPoint.setId(pointDetailId);
shopPointInfo.setPointScore(shopPoint.getTotalPointScore()); shopPointInfo.setPointScore(shopPoint.getTotalPointScore());
shopPointInfoDAO.updatePointInfo(shopPointInfo); shopPointInfoDAO.updatePointInfo(shopPointInfo);
return shopPointDetailInfoDAO.updateShopPointDetailInfo(shopPoint); 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 * 生成code
* @return * @return

View File

@@ -1,15 +1,16 @@
package com.cool.store.controller.webb; package com.cool.store.controller.webb;
import com.cool.store.context.CurrentUserHolder; import com.cool.store.context.CurrentUserHolder;
import com.cool.store.request.AddMapEvaluationReportRequest;
import com.cool.store.request.AddShopPointDetailRequest; import com.cool.store.request.AddShopPointDetailRequest;
import com.cool.store.request.UpdateShopPointDetailRequest; import com.cool.store.request.UpdateShopPointDetailRequest;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.ShopPointService; import com.cool.store.service.ShopPointService;
import com.cool.store.vo.point.ShopPointDetailVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
@@ -27,14 +28,54 @@ public class ShopPointController {
@Resource @Resource
private ShopPointService shopPointService; private ShopPointService shopPointService;
@ApiOperation("新增铺位")
@PostMapping("/add") @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())); 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") @PostMapping("/update")
public ResponseResult<Integer> updateShopPointDetailInfo(@RequestBody UpdateShopPointDetailRequest shopPointDetailRequest) { public ResponseResult<Integer> updateShopPointDetailInfo(@RequestBody @Validated UpdateShopPointDetailRequest shopPointDetailRequest) {
return ResponseResult.success(shopPointService.updateShopPointDetailInfo(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));
}
} }