This commit is contained in:
zhangchenbiao
2024-04-02 11:43:52 +08:00
parent aca8aebd54
commit b239dac239
20 changed files with 156 additions and 157 deletions

View File

@@ -1,9 +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;
import com.cool.store.request.AddPointDetailRequest;
import com.cool.store.request.UpdatePointDetailRequest;
import com.cool.store.vo.point.PointDetailVO;
/**
* @author zhangchenbiao
@@ -19,7 +19,7 @@ public interface ShopPointService {
* @param userId
* @return
*/
Long addShopPointDetailInfo(AddShopPointDetailRequest shopPointDetailRequest, String userId);
Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, String userId);
/**
@@ -27,14 +27,14 @@ public interface ShopPointService {
* @param pointId
* @return
*/
ShopPointDetailVO getShopPointDetailInfo(Long pointId);
PointDetailVO getPointDetailInfo(Long pointId);
/**
* 更新铺位
* @param shopPointDetailRequest
* @return
*/
Integer updateShopPointDetailInfo(UpdateShopPointDetailRequest shopPointDetailRequest);
Integer updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest);
/**
* 生成铺位评估报告

View File

@@ -1,18 +1,18 @@
package com.cool.store.service.impl;
import com.cool.store.dao.*;
import com.cool.store.entity.ShopPointDetailInfoDO;
import com.cool.store.entity.ShopPointInfoDO;
import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.entity.PointInfoDO;
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.request.AddPointDetailRequest;
import com.cool.store.request.UpdatePointDetailRequest;
import com.cool.store.service.ShopPointService;
import com.cool.store.vo.point.ShopPointDetailVO;
import com.cool.store.vo.point.PointDetailVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -36,54 +36,54 @@ public class ShopPointServiceImpl implements ShopPointService {
@Resource
private ShopInfoDAO shopInfoDAO;
@Resource
private ShopPointInfoDAO shopPointInfoDAO;
private PointInfoDAO pointInfoDAO;
@Resource
private ShopPointDetailInfoDAO shopPointDetailInfoDAO;
private PointDetailInfoDAO pointDetailInfoDAO;
@Resource
private LineInfoDAO lineInfoDAO;
@Resource
private ShopPointRecommendDAO shopPointRecommendDAO;
private PointRecommendDAO pointRecommendDAO;
@Override
public Long addShopPointDetailInfo(AddShopPointDetailRequest shopPointDetailRequest, String userId) {
ShopPointInfoDO shopPointInfo = AddShopPointDetailRequest.convertPointDO(shopPointDetailRequest);
public Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, String userId) {
PointInfoDO shopPointInfo = AddPointDetailRequest.convertPointDO(shopPointDetailRequest);
shopPointInfo.setPointCode(generateCode());
shopPointInfo.setDevelopmentManager(userId);
shopPointInfo.setDevelopmentTime(new Date());
Long pointId = shopPointInfoDAO.addShopPointInfo(shopPointInfo);
ShopPointDetailInfoDO shopPoint = AddShopPointDetailRequest.convertDO(shopPointDetailRequest);
Long pointId = pointInfoDAO.addPointInfo(shopPointInfo);
PointDetailInfoDO shopPoint = AddPointDetailRequest.convertDO(shopPointDetailRequest);
shopPoint.setPointId(pointId);
return shopPointDetailInfoDAO.addShopPointDetailInfo(shopPoint);
return pointDetailInfoDAO.addPointDetailInfo(shopPoint);
}
@Override
public ShopPointDetailVO getShopPointDetailInfo(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
public PointDetailVO getPointDetailInfo(Long pointId) {
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
ShopPointDetailInfoDO pointDetailInfo = shopPointDetailInfoDAO.getShopPointDetailInfoByPointId(pointId);
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
if(Objects.isNull(pointDetailInfo)){
log.error("铺位详情信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
return ShopPointDetailVO.convertVO(pointInfo, pointDetailInfo);
return PointDetailVO.convertVO(pointInfo, pointDetailInfo);
}
@Override
public Integer updateShopPointDetailInfo(UpdateShopPointDetailRequest shopPointDetailRequest) {
ShopPointInfoDO shopPointInfo = UpdateShopPointDetailRequest.convertPointDO(shopPointDetailRequest);
ShopPointDetailInfoDO shopPoint = UpdateShopPointDetailRequest.convertDO(shopPointDetailRequest);
public Integer updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest) {
PointInfoDO shopPointInfo = UpdatePointDetailRequest.convertPointDO(shopPointDetailRequest);
PointDetailInfoDO shopPoint = UpdatePointDetailRequest.convertDO(shopPointDetailRequest);
shopPointInfo.setPointScore(shopPoint.getTotalPointScore());
shopPointInfoDAO.updatePointInfo(shopPointInfo);
return shopPointDetailInfoDAO.updateShopPointDetailInfo(shopPoint);
pointInfoDAO.updatePointInfo(shopPointInfo);
return pointDetailInfoDAO.updatePointDetailInfo(shopPoint);
}
@Override
public Integer generateEvaluationReport(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
ShopPointDetailInfoDO pointDetailInfo = shopPointDetailInfoDAO.getShopPointDetailInfoByPointId(pointId);
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
if(Objects.isNull(pointInfo) || Objects.isNull(pointDetailInfo)){
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
@@ -91,17 +91,17 @@ public class ShopPointServiceImpl implements ShopPointService {
throw new ServiceException(ErrorCodeEnum.POINT_NOT_COMPLETE);
}
Integer totalPointScore = pointDetailInfo.getTotalPointScore();
ShopPointInfoDO updatePointInfo = new ShopPointInfoDO();
PointInfoDO updatePointInfo = new PointInfoDO();
updatePointInfo.setId(pointId);
updatePointInfo.setPointScore(totalPointScore);
updatePointInfo.setPointStatus(PointStatusEnum.POINT_STATUS_2.getCode());
shopPointInfoDAO.updatePointInfo(updatePointInfo);
pointInfoDAO.updatePointInfo(updatePointInfo);
return totalPointScore;
}
@Override
public Integer pointInvalid(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
@@ -109,16 +109,16 @@ public class ShopPointServiceImpl implements ShopPointService {
if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
}
ShopPointInfoDO updatePoint = new ShopPointInfoDO();
PointInfoDO updatePoint = new PointInfoDO();
updatePoint.setId(pointId);
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_7.getCode());
shopPointInfoDAO.updatePointInfo(updatePoint);
return shopPointRecommendDAO.updateRecommendStatus(pointId, PointRecommendStatus.POINT_RECOMMEND_STATUS_6);
pointInfoDAO.updatePointInfo(updatePoint);
return pointRecommendDAO.updateRecommendStatus(pointId, PointRecommendStatus.POINT_RECOMMEND_STATUS_6);
}
@Override
public Integer pointUnbind(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
@@ -126,30 +126,30 @@ public class ShopPointServiceImpl implements ShopPointService {
if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
}
ShopPointInfoDO updatePoint = new ShopPointInfoDO();
PointInfoDO updatePoint = new PointInfoDO();
updatePoint.setId(pointId);
updatePoint.setSelectStatus(SelectStatusEnum.SELECT_STATUS_0.getCode());
shopPointInfoDAO.updatePointInfo(updatePoint);
pointInfoDAO.updatePointInfo(updatePoint);
//将已选择、已被他人选择的状态更新成待选泽
return shopPointRecommendDAO.updateRecommendStatusByStatusAndPointId(pointId, PointRecommendStatus.POINT_RECOMMEND_STATUS_1, Arrays.asList(PointRecommendStatus.POINT_RECOMMEND_STATUS_2, PointRecommendStatus.POINT_RECOMMEND_STATUS_3));
return pointRecommendDAO.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());
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(request.getPointId());
if(Objects.isNull(pointDetailInfo)){
log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
ShopPointDetailInfoDO updatePoint = new ShopPointDetailInfoDO();
PointDetailInfoDO updatePoint = new PointDetailInfoDO();
updatePoint.setId(pointDetailInfo.getId());
updatePoint.setMapEvaluationReport(request.getMapEvaluationReport());
return shopPointDetailInfoDAO.updateShopPointDetailInfo(updatePoint);
return pointDetailInfoDAO.updatePointDetailInfo(updatePoint);
}
@Override
public Integer submitAudit(Long pointId) {
ShopPointInfoDO pointInfo = shopPointInfoDAO.getShopPointInfoById(pointId);
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
@@ -157,12 +157,12 @@ public class ShopPointServiceImpl implements ShopPointService {
if(!PointStatusEnum.POINT_STATUS_2.getCode().equals(pointInfo.getPointStatus())){
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
}
ShopPointInfoDO updatePoint = new ShopPointInfoDO();
PointInfoDO updatePoint = new PointInfoDO();
updatePoint.setId(pointId);
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode());
updatePoint.setSubmitAuditCount(pointInfo.getSubmitAuditCount() + 1);
//处理子任务审核记录表
return shopPointInfoDAO.updatePointInfo(updatePoint);
return pointInfoDAO.updatePointInfo(updatePoint);
}
/**