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

View File

@@ -0,0 +1,24 @@
package com.cool.store.dto.point;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: LineCountDTO
* @Description:
* @date 2024-04-08 15:52
*/
@Data
public class LineCountDTO {
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("推荐门店数量")
private Integer recommendShopNum;
@ApiModelProperty("选择门店数量")
private Integer selectedShopNum;
}

View File

@@ -1,9 +1,12 @@
package com.cool.store.request;
import com.cool.store.enums.AuditStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.util.Date;
import java.util.Objects;
/**
* @author zhangchenbiao
@@ -23,5 +26,18 @@ public class PointAuditRequest {
@ApiModelProperty("原因")
private String reason;
public boolean check(){
if(Objects.isNull(this.pointId)){
return false;
}
if(Objects.isNull(this.auditStatus)){
return false;
}
if(AuditStatusEnum.REJECT.equals(this.auditStatus) && StringUtils.isBlank(this.reason)){
return false;
}
return true;
}
}

View File

@@ -0,0 +1,21 @@
package com.cool.store.request;
import com.cool.store.common.PageBasicInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: PointLinePageRequest
* @Description:
* @date 2024-04-09 10:29
*/
@Data
public class PointLinePageRequest extends PageBasicInfo {
@ApiModelProperty(value = "搜索关键字 线索姓名手机号")
private String keyword;
@ApiModelProperty(value = "拓展经理", hidden = true)
private String developmentManager;
}

View File

@@ -0,0 +1,43 @@
package com.cool.store.request;
import com.cool.store.common.PageBasicInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author zhangchenbiao
* @FileName: PointPageRequest
* @Description:
* @date 2024-04-08 10:28
*/
@Data
public class PointPageRequest extends PageBasicInfo {
@ApiModelProperty("铺位名称或编号")
private String keyword;
@ApiModelProperty("营运人员")
private String operateUserId;
@ApiModelProperty("开始拓展时间 yyyy-MM-dd HH:mm:ss")
private String developmentStartTime;
@ApiModelProperty("结束拓展时间 yyyy-MM-dd HH:mm:ss")
private String developmentEndTime;
@ApiModelProperty(value = "拓展专员", hidden = true)
private String developmentManager;
@NotNull
@Min(1)@Max(2)
@ApiModelProperty("必传参数:1已入库 2暂未入库")
private Integer storageStatus;
@ApiModelProperty("1.采集中、2.已评估、3.待审核、5.已审核、6.已签约、7.已失效")
private Integer pointStatus;
}

View File

@@ -0,0 +1,22 @@
package com.cool.store.request;
import com.cool.store.common.PageBasicInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: RecommendPointPageRequest
* @Description:
* @date 2024-04-08 16:43
*/
@Data
public class RecommendPointPageRequest extends PageBasicInfo {
@ApiModelProperty("1.采集中、2.已评估、3.待审核、5.已审核、6.已签约、7.已失效")
private Integer pointStatus;
@ApiModelProperty(value = "拓展专员", hidden = true)
private String developmentManager;
}

View File

@@ -0,0 +1,46 @@
package com.cool.store.request;
import com.cool.store.entity.PointRecommendDO;
import com.cool.store.enums.point.PointRecommendStatus;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author zhangchenbiao
* @FileName: RecommendPointRequest
* @Description:
* @date 2024-04-08 16:50
*/
@Data
public class RecommendPointRequest {
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("铺位ids")
private List<Long> pointIds;
@ApiModelProperty(value = "拓展经理", hidden = true)
private String developmentManager;
public List<PointRecommendDO> convertList(){
if(Objects.isNull(this.lineId) || CollectionUtils.isEmpty(pointIds)){
return Lists.newArrayList();
}
return this.pointIds.stream().map(pointId -> {
PointRecommendDO pointRecommendDO = new PointRecommendDO();
pointRecommendDO.setLineId(this.lineId);
pointRecommendDO.setDevelopmentManager(this.developmentManager);
pointRecommendDO.setPointId(pointId);
pointRecommendDO.setStatus(PointRecommendStatus.POINT_RECOMMEND_STATUS_1.getCode());
return pointRecommendDO;
}).collect(Collectors.toList());
}
}

View File

@@ -3,6 +3,8 @@ package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @author zhangchenbiao
* @FileName: TurnDevelopmentManagerRequest
@@ -12,9 +14,11 @@ import lombok.Data;
@Data
public class TurnDevelopmentManagerRequest {
@NotNull
@ApiModelProperty("铺位id")
private Long pointId;
@NotNull
@ApiModelProperty("拓展经理")
private String developmentManager;

View File

@@ -0,0 +1,21 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: TurnLineRequest
* @Description:
* @date 2024-04-08 17:09
*/
@Data
public class TurnLineRequest {
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("新的选址人员")
private String developmentManager;
}

View File

@@ -0,0 +1,27 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author zhangchenbiao
* @FileName: UpdateWantShopNumRequest
* @Description:意向开店数量
* @date 2024-04-09 11:16
*/
@Data
public class UpdateWantShopNumRequest {
@NotNull
@ApiModelProperty("线索id")
private Long lineId;
@NotNull
@Min(1)
@ApiModelProperty("意向开店数量")
private Integer wantShopNum;
}

View File

@@ -99,6 +99,9 @@ public class LineInfoVO {
@ApiModelProperty("流程子阶段状态")
private Integer workflowSubStageStatus;
@ApiModelProperty("意向开店数量")
private Integer wantShopNum;
/**
* 待选址铺位
*/

View File

@@ -0,0 +1,92 @@
package com.cool.store.vo;
import com.cool.store.entity.HyOpenAreaInfoDO;
import com.cool.store.entity.LineInfoDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: LineUsernameAndMobileVO
* @Description:
* @date 2024-04-07 14:39
*/
@Data
public class LinePointBaseInfoVO {
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("手机号")
private String mobile;
@ApiModelProperty("区域名称")
private String areaName;
@ApiModelProperty("区域路径")
private String areaPath;
@ApiModelProperty("用户标签")
private List<String> userPortraitList;
@ApiModelProperty("招商经理")
private String investmentManagerUsername;
@ApiModelProperty("已推门店")
private Integer recommendShopNum;
@ApiModelProperty("已选门店")
private Integer selectedShopNum;
@ApiModelProperty("意向开店数量")
private Integer wantShopNum;
public LinePointBaseInfoVO(Long lineId, String username, String mobile) {
this.lineId = lineId;
this.username = username;
this.mobile = mobile;
}
public static List<LinePointBaseInfoVO> convertList(List<LineInfoDO> lineList, Map<String, String> userNameMap, Map<Long, String> userPortraitMap, Map<Long, HyOpenAreaInfoDO> cityMap, Map<Long, Integer> recommendShopNumMap, Map<Long, Integer> selectedShopNumMap){
List<LinePointBaseInfoVO> resultList = new ArrayList<>();
for (LineInfoDO lineInfo : lineList) {
LinePointBaseInfoVO linePointBaseInfo = new LinePointBaseInfoVO(lineInfo.getId(), lineInfo.getUsername(), lineInfo.getMobile());
linePointBaseInfo.setWantShopNum(lineInfo.getWantShopNum());
String username = userNameMap.get(lineInfo.getInvestmentManager());
linePointBaseInfo.setInvestmentManagerUsername(username);
HyOpenAreaInfoDO areaInfo = cityMap.get(lineInfo.getWantShopAreaId());
if(Objects.nonNull(areaInfo)){
linePointBaseInfo.setAreaName(areaInfo.getAreaName());
linePointBaseInfo.setAreaPath(areaInfo.getAreaPath().replace("/", "").trim());
}
linePointBaseInfo.setRecommendShopNum(recommendShopNumMap.get(lineInfo.getId()));
linePointBaseInfo.setSelectedShopNum(selectedShopNumMap.get(lineInfo.getId()));
if(StringUtils.isNotBlank(lineInfo.getUserPortrait())){
List<String> userPortraitList = new ArrayList<>();
String[] parts = lineInfo.getUserPortrait().split(",");
for (String part : parts) {
String trimmedPart = part.trim();
if (StringUtils.isNotBlank(trimmedPart)) {
String s = userPortraitMap.get(Long.valueOf(part));
if(StringUtils.isNotBlank(s)){
userPortraitList.add(s);
}
}
}
linePointBaseInfo.setUserPortraitList(userPortraitList);
}
resultList.add(linePointBaseInfo);
}
return resultList;
}
}

View File

@@ -1,24 +0,0 @@
package com.cool.store.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: LineUsernameAndMobileVO
* @Description:
* @date 2024-04-07 14:39
*/
@Data
public class LineUsernameAndMobileVO {
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("手机号")
private String mobile;
}

View File

@@ -0,0 +1,83 @@
package com.cool.store.vo.point;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.entity.PointAuditRecordDO;
import com.cool.store.utils.StringUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
/**
* @author zhangchenbiao
* @FileName: AuditRecordVO
* @Description:
* @date 2024-04-08 11:36
*/
@Data
public class PointAuditRecordVO {
@ApiModelProperty("实际处理人")
private UserBaseInfoVO handlerUser;
@ApiModelProperty("处理人列表")
private List<UserBaseInfoVO> handlerUserList;
@ApiModelProperty("处理时间")
private Date handlerTime;
@ApiModelProperty("原因")
private String reason;
@ApiModelProperty("0待处理,1通过,2拒绝")
private String auditStatus;
@ApiModelProperty("signTime")
private Date signTime;
@ApiModelProperty("签到地址")
private String signAddress;
@ApiModelProperty("图片")
private String pictureUrl;
@ApiModelProperty("是否超时")
private Boolean isTimeout;
public static List<PointAuditRecordVO> convert(List<PointAuditRecordDO> auditRecordList, Map<String, EnterpriseUserDO> userMap) {
List<PointAuditRecordVO> resultList = new ArrayList<>();
for (PointAuditRecordDO pointAuditRecord : auditRecordList) {
PointAuditRecordVO pointAuditRecordVO = new PointAuditRecordVO();
pointAuditRecordVO.setHandlerTime(pointAuditRecord.getFinishTaskTime());
pointAuditRecordVO.setReason(pointAuditRecord.getReason());
pointAuditRecordVO.setAuditStatus(pointAuditRecord.getAuditStatus().toString());
pointAuditRecordVO.setSignTime(pointAuditRecord.getSignTime());
pointAuditRecordVO.setSignAddress(pointAuditRecord.getSignAddress());
pointAuditRecordVO.setPictureUrl(pointAuditRecord.getPictureUrl());
pointAuditRecordVO.setIsTimeout(Boolean.FALSE);
if(Objects.nonNull(pointAuditRecord.getReceiveTaskTime())){
Date time = Objects.isNull(pointAuditRecord.getFinishTaskTime()) ? new Date() : pointAuditRecord.getFinishTaskTime();
LocalDateTime localDateTime = LocalDateTime.ofInstant(pointAuditRecord.getReceiveTaskTime().toInstant(), ZoneId.systemDefault());
LocalDateTime localDateTime1 = LocalDateTime.ofInstant(time.toInstant(), ZoneId.systemDefault());
Duration duration = Duration.between(localDateTime, localDateTime1);
long hours = duration.toHours();
pointAuditRecordVO.setIsTimeout(hours >= 48);
}
pointAuditRecordVO.setHandlerUser(UserBaseInfoVO.convert(pointAuditRecord.getHandlerUserId(), userMap));
List<String> handlerUserIds = JSONObject.parseArray(pointAuditRecord.getHandlerUserIds(), String.class);
pointAuditRecordVO.setHandlerUserList(UserBaseInfoVO.convert(handlerUserIds, userMap));
resultList.add(pointAuditRecordVO);
}
return resultList;
}
}

View File

@@ -0,0 +1,32 @@
package com.cool.store.vo.point;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: PointHomePageDataVO
* @Description:铺位首页数据
* @date 2024-04-07 16:57
*/
@Data
public class PointHomePageDataVO {
@ApiModelProperty("我的铺位")
private Integer myPoint;
@ApiModelProperty("铺位池")
private Integer poolPoint;
@ApiModelProperty("采集中")
private Integer collectPoint;
@ApiModelProperty("已评估")
private Integer evaluatePoint;
@ApiModelProperty("待审核铺位")
private Integer waitAuditPoint;
@ApiModelProperty("已签约")
private Integer signPoint;
}

View File

@@ -0,0 +1,76 @@
package com.cool.store.vo.point;
import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.entity.PointInfoDO;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Data
public class PointPageVO {
@ApiModelProperty("店铺id")
private Long pointId;
@ApiModelProperty("铺位名称")
private String pointName;
@ApiModelProperty("铺位编号")
private String pointCode;
@ApiModelProperty("所属大区")
private Long regionId;
@ApiModelProperty("所属站区")
private String regionNodeName;
@ApiModelProperty("铺位状态 1.采集中、2.已评估、3.待审核、4.待审核可推荐、5.已审核、6.已签约、7.已失效")
private Integer pointStatus;
@ApiModelProperty("铺位得分")
private Integer pointScore;
@ApiModelProperty("铺位面积")
private String pointArea;
@ApiModelProperty("拓展专员")
private String developmentManagerUsername;
@ApiModelProperty("拓展时间")
private Date developmentTime;
@ApiModelProperty("选择状态0.未选择, 1.已被选择")
private Integer selectStatus;
public static List<PointPageVO> convertVO(List<PointInfoDO> pointList, Map<String, String> usernameMap, Map<Long, String> regionNameMap) {
if(CollectionUtils.isEmpty(pointList)){
return Lists.newArrayList();
}
List<PointPageVO> resultList = new ArrayList<>();
for (PointInfoDO pointInfo : pointList) {
PointPageVO pointPageVO = new PointPageVO();
pointPageVO.setPointId(pointInfo.getId());
pointPageVO.setPointName(pointInfo.getPointName());
pointPageVO.setPointCode(pointInfo.getPointCode());
pointPageVO.setRegionId(pointInfo.getRegionId());
pointPageVO.setRegionNodeName(regionNameMap.get(pointInfo.getRegionId()));
pointPageVO.setPointStatus(pointInfo.getPointStatus());
pointPageVO.setPointScore(pointInfo.getPointScore());
pointPageVO.setPointArea(pointInfo.getPointArea());
pointPageVO.setDevelopmentManagerUsername(usernameMap.get(pointInfo.getDevelopmentManager()));
pointPageVO.setDevelopmentTime(pointInfo.getDevelopmentTime());
pointPageVO.setSelectStatus(pointInfo.getSelectStatus());
resultList.add(pointPageVO);
}
return resultList;
}
}

View File

@@ -0,0 +1,84 @@
package com.cool.store.vo.point;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.entity.PointRecommendDO;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author zhangchenbiao
* @FileName: PointRecommendPageVO
* @Description:
* @date 2024-04-08 16:11
*/
@Data
public class PointRecommendPageVO {
@ApiModelProperty("店铺id")
private Long pointId;
@ApiModelProperty("铺位名称")
private String pointName;
@ApiModelProperty("铺位编号")
private String pointCode;
@ApiModelProperty("所属大区")
private Long regionId;
@ApiModelProperty("所属站区")
private String regionNodeName;
@ApiModelProperty("铺位状态 1.采集中、2.已评估、3.待审核、4.待审核可推荐、5.已审核、6.已签约、7.已失效")
private Integer pointStatus;
@ApiModelProperty("铺位得分")
private Integer pointScore;
@ApiModelProperty("铺位面积")
private String pointArea;
@ApiModelProperty("拓展专员")
private String developmentManagerUsername;
@ApiModelProperty("拓展时间")
private Date developmentTime;
@ApiModelProperty("选择状态1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效")
private Integer recommendStatus;
public static List<PointRecommendPageVO> convertVO(List<PointRecommendDO> recommendList, List<PointInfoDO> pointList, Map<String, String> usernameMap, Map<Long, String> regionNameMap) {
if(CollectionUtils.isEmpty(recommendList) || CollectionUtils.isEmpty(pointList)){
return Lists.newArrayList();
}
List<PointRecommendPageVO> resultList = new ArrayList<>();
Map<Long, PointInfoDO> pointMap = pointList.stream().collect(Collectors.toMap(k -> k.getId(), Function.identity()));
for (PointRecommendDO pointRecommend : recommendList) {
PointRecommendPageVO recommend = new PointRecommendPageVO();
recommend.setRecommendStatus(pointRecommend.getStatus());
PointInfoDO pointInfo = pointMap.get(pointRecommend.getPointId());
if(Objects.nonNull(pointInfo)){
recommend.setPointId(pointInfo.getId());
recommend.setPointName(pointInfo.getPointName());
recommend.setPointCode(pointInfo.getPointCode());
recommend.setRegionId(pointInfo.getRegionId());
recommend.setRegionNodeName(regionNameMap.get(pointInfo.getRegionId()));
recommend.setPointStatus(pointInfo.getPointStatus());
recommend.setPointScore(pointInfo.getPointScore());
recommend.setPointArea(pointInfo.getPointArea());
recommend.setDevelopmentManagerUsername(usernameMap.get(pointInfo.getDevelopmentManager()));
recommend.setDevelopmentTime(pointInfo.getDevelopmentTime());
}
resultList.add(recommend);
}
return resultList;
}
}

View File

@@ -0,0 +1,65 @@
package com.cool.store.vo.point;
import cn.hutool.core.map.MapUtil;
import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
import com.cool.store.entity.EnterpriseUserDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: UserBaseInfoVO
* @Description:
* @date 2024-04-08 13:42
*/
@Data
public class UserBaseInfoVO {
@ApiModelProperty("用户id")
private String userId;
@ApiModelProperty("姓名")
private String username;
@ApiModelProperty("头像")
private String avatar;
public UserBaseInfoVO(String userId, String username, String avatar) {
this.userId = userId;
this.username = username;
this.avatar = avatar;
}
public static UserBaseInfoVO convert(String userId, Map<String, EnterpriseUserDO> userMap) {
if(StringUtils.isBlank(userId) || MapUtil.isEmpty(userMap)){
return null;
}
EnterpriseUserDO user = userMap.get(userId);
if(Objects.isNull(user)){
return null;
}
return new UserBaseInfoVO(user.getUserId(), user.getName(), user.getAvatar());
}
public static List<UserBaseInfoVO> convert(List<String> userIdList, Map<String, EnterpriseUserDO> userMap) {
if(CollectionUtils.isEmpty(userIdList) || MapUtil.isEmpty(userMap)){
return null;
}
List<UserBaseInfoVO> resultList = new ArrayList<>();
for (String userId : userIdList) {
EnterpriseUserDO user = userMap.get(userId);
if(Objects.isNull(user)){
continue;
}
resultList.add(new UserBaseInfoVO(user.getUserId(), user.getName(), user.getAvatar()));
}
return resultList;
}
}