This commit is contained in:
zhangchenbiao
2024-04-15 09:50:21 +08:00
parent f2c84f888f
commit 74e37a73c6
25 changed files with 572 additions and 63 deletions

View File

@@ -0,0 +1,41 @@
package com.cool.store.dto.point;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class MiniPointPageDTO {
@ApiModelProperty("店铺id")
private Long pointId;
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("铺位名称")
private String pointName;
@ApiModelProperty("铺位编号")
private String pointCode;
@ApiModelProperty("所属站区")
private Long regionId;
@ApiModelProperty("地址")
private String address;
@ApiModelProperty("铺位得分")
private Integer pointScore;
@ApiModelProperty("铺位面积")
private String pointArea;
@ApiModelProperty("铺位状态 1.采集中、2.已评估、3.待审核、5.已审核、6.已签约、7.已失效")
private Integer pointStatus;
@ApiModelProperty("选择状态0.未选择, 1.已被选择")
private Integer selectStatus;
@ApiModelProperty("1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效")
private Integer recommendStatus;
}

View File

@@ -45,11 +45,29 @@ public class ShopStageInfoDO {
@Column(name = "is_terminated")
private Boolean isTerminated;
/**
* 计划完成时间
*/
@Column(name = "plan_complete_time")
private String planCompleteTime;
/**
* 实际完成时间
*/
@Column(name = "actual_complete_time")
private String actualCompleteTime;
/**
* 备注
*/
private String remark;
/**
* 审核id
*/
@Column(name = "audit_id")
private Long auditId;
/**
* 删除标识
*/

View File

@@ -1,7 +1,7 @@
package com.cool.store.request;
import com.cool.store.entity.PointRecommendDO;
import com.cool.store.enums.point.PointRecommendStatus;
import com.cool.store.enums.point.PointRecommendStatusEnum;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -38,7 +38,7 @@ public class LineRecommendPointRequest {
pointRecommendDO.setLineId(this.lineId);
pointRecommendDO.setDevelopmentManager(this.developmentManager);
pointRecommendDO.setPointId(pointId);
pointRecommendDO.setStatus(PointRecommendStatus.POINT_RECOMMEND_STATUS_1.getCode());
pointRecommendDO.setStatus(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode());
return pointRecommendDO;
}).collect(Collectors.toList());
}

View File

@@ -0,0 +1,27 @@
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;
/**
* @author zhangchenbiao
* @FileName: MiniPointPageRequest
* @Description:
* @date 2024-04-12 14:33
*/
@Data
public class MiniPointPageRequest extends PageBasicInfo {
@Min(value = 1, message = "status不能小于1")
@Max(value = 3, message = "status不能大于3")
@ApiModelProperty("1.待选择 2.已选择 3.拒绝/失效")
private Integer status;
@ApiModelProperty(value = "线索id",hidden = true)
private Long lineId;
}

View File

@@ -1,7 +1,7 @@
package com.cool.store.request;
import com.cool.store.entity.PointRecommendDO;
import com.cool.store.enums.point.PointRecommendStatus;
import com.cool.store.enums.point.PointRecommendStatusEnum;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -38,7 +38,7 @@ public class PointRecommendLineRequest {
pointRecommendDO.setLineId(lineId);
pointRecommendDO.setDevelopmentManager(this.developmentManager);
pointRecommendDO.setPointId(pointId);
pointRecommendDO.setStatus(PointRecommendStatus.POINT_RECOMMEND_STATUS_1.getCode());
pointRecommendDO.setStatus(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode());
return pointRecommendDO;
}).collect(Collectors.toList());
}

View File

@@ -0,0 +1,29 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @author zhangchenbiao
* @FileName: SelectPointRequest
* @Description:
* @date 2024-04-12 15:08
*/
@Data
public class SelectPointRequest {
@NotNull
@ApiModelProperty("店铺id")
private Long shopId;
@NotNull
@ApiModelProperty("铺位id")
private Long pointId;
@ApiModelProperty(value = "当前线索id", hidden = true)
private Long lineId;
}

View File

@@ -6,6 +6,7 @@ import lombok.Data;
import javax.persistence.*;
import java.util.Date;
import java.util.Objects;
@Data
public class LineAuditInfoVO {
@@ -28,10 +29,13 @@ public class LineAuditInfoVO {
@ApiModelProperty("明文件或凭证")
private String certifyFile;
@ApiModelProperty("审批事件")
@ApiModelProperty("审批时间")
private Date createTime;
public static LineAuditInfoVO convertVO(LineAuditInfoDO auditInfo) {
if(Objects.isNull(auditInfo)){
return null;
}
LineAuditInfoVO result = new LineAuditInfoVO();
result.setAuditId(auditInfo.getId());
result.setResultType(auditInfo.getResultType());

View File

@@ -0,0 +1,77 @@
package com.cool.store.vo.point;
import com.cool.store.dto.point.MiniPointPageDTO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.enums.point.PointRecommendStatusEnum;
import com.cool.store.enums.point.PointStatusEnum;
import com.cool.store.enums.point.SelectStatusEnum;
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.List;
import java.util.Map;
@Data
public class MiniPointPageVO {
@ApiModelProperty("店铺id")
private Long pointId;
@ApiModelProperty("铺位名称")
private String pointName;
@ApiModelProperty("铺位编号")
private String pointCode;
@ApiModelProperty("所属站区")
private String regionNodeName;
@ApiModelProperty("地址")
private String address;
@ApiModelProperty("铺位得分")
private Integer pointScore;
@ApiModelProperty("铺位面积")
private String pointArea;
@ApiModelProperty("1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效")
private Integer recommendStatus;
public static List<MiniPointPageVO> convertVO(List<MiniPointPageDTO> pointList, Map<Long, String> regionNameMap, Long curLineId) {
if(CollectionUtils.isEmpty(pointList)){
return Lists.newArrayList();
}
List<MiniPointPageVO> resultList = new ArrayList<>();
for (MiniPointPageDTO pointInfo : pointList) {
MiniPointPageVO pointPageVO = new MiniPointPageVO();
pointPageVO.setPointId(pointInfo.getPointId());
pointPageVO.setPointName(pointInfo.getPointName());
pointPageVO.setPointCode(pointInfo.getPointCode());
pointPageVO.setRegionNodeName(regionNameMap.get(pointInfo.getRegionId()));
pointPageVO.setAddress(pointInfo.getAddress());
pointPageVO.setPointScore(pointInfo.getPointScore());
pointPageVO.setPointArea(pointInfo.getPointArea());
pointPageVO.setRecommendStatus(getRecommendStatus(curLineId, pointInfo.getLineId(), pointInfo.getPointStatus(), pointInfo.getSelectStatus(), pointInfo.getRecommendStatus()));
resultList.add(pointPageVO);
}
return resultList;
}
public static Integer getRecommendStatus(Long curLineId, Long lineId, Integer pointStatus, Integer selectStatus, Integer recommendStatus) {
if(PointStatusEnum.POINT_STATUS_7.getCode().equals(pointStatus)){
return PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_6.getCode();
}
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(selectStatus)){
//已选择 判断线索id是否是自己
if(curLineId.equals(lineId)){
return PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode();
}
return PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode();
}
return recommendStatus;
}
}

View File

@@ -22,7 +22,6 @@ public class MiniShopPageVO {
@ApiModelProperty("店铺名称")
private String shopName;
public MiniShopPageVO(Long shopId, String shopName) {
this.shopId = shopId;
this.shopName = shopName;

View File

@@ -1,13 +1,19 @@
package com.cool.store.vo.shop;
import com.cool.store.entity.LineAuditInfoDO;
import com.cool.store.entity.ShopStageInfoDO;
import com.cool.store.vo.LineAuditInfoVO;
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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author zhangchenbiao
@@ -30,20 +36,37 @@ public class ShopStageInfoVO {
@ApiModelProperty("当前阶段是否结束 0未结束 1已结束")
private Boolean isTerminated;
@ApiModelProperty("预估完成时间")
private String planCompleteTime;
@ApiModelProperty("实际完成时间")
private String actualCompleteTime;
@ApiModelProperty("阶段审核信息")
private LineAuditInfoVO auditInfo;
public ShopStageInfoVO(Integer shopStage, Integer shopSubStage, Integer shopSubStageStatus, Boolean isTerminated) {
this.shopStage = shopStage;
this.shopSubStage = shopSubStage;
this.shopSubStageStatus = shopSubStageStatus;
this.isTerminated = isTerminated;
}
public static List<ShopStageInfoVO> convertList(List<ShopStageInfoDO> stageList){
public static List<ShopStageInfoVO> convertList(List<ShopStageInfoDO> stageList, List<LineAuditInfoDO> auditList){
if(CollectionUtils.isEmpty(stageList)){
return Lists.newArrayList();
}
Map<Long, LineAuditInfoDO> auditMap = auditList.stream().collect(Collectors.toMap(LineAuditInfoDO::getId, Function.identity()));
List<ShopStageInfoVO> resultList = new ArrayList<>();
for (ShopStageInfoDO stageInfo : stageList) {
resultList.add(new ShopStageInfoVO(stageInfo.getShopStage(), stageInfo.getShopSubStage(), stageInfo.getShopSubStageStatus(), stageInfo.getIsTerminated()));
ShopStageInfoVO shopStageInfo = new ShopStageInfoVO(stageInfo.getShopStage(), stageInfo.getShopSubStage(), stageInfo.getShopSubStageStatus(), stageInfo.getIsTerminated());
LineAuditInfoDO auditInfo = auditMap.get(stageInfo.getAuditId());
LineAuditInfoVO auditInfoVO = LineAuditInfoVO.convertVO(auditInfo);
shopStageInfo.setAuditInfo(auditInfoVO);
shopStageInfo.setPlanCompleteTime(stageInfo.getPlanCompleteTime());
shopStageInfo.setActualCompleteTime(stageInfo.getActualCompleteTime());
resultList.add(shopStageInfo);
}
return resultList;
}