铺位改造

This commit is contained in:
shuo.wang
2025-05-22 14:28:44 +08:00
parent f7bd14fdb5
commit 50ed46f702
2 changed files with 37 additions and 12 deletions

View File

@@ -104,8 +104,19 @@ public class PointServiceImpl implements PointService {
@Override
@Transactional(rollbackFor = Exception.class)
public Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, LoginUserInfo user) {
Long shopId = shopPointDetailRequest.getShopId();
Long lineId = shopPointDetailRequest.getLineId();
String userId = user.getUserId();
PointInfoDO pointInfo = AddPointDetailRequest.convertPointDO(shopPointDetailRequest);
if (shopId != null) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (Objects.isNull(shopInfo)){
throw new ServiceException(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
}
pointInfo.setSelectStatus(SelectStatusEnum.SELECT_STATUS_1.getCode());
pointInfo.setShopId(shopId);
pointInfo.setLineId(lineId);
}
pointInfo.setPointCode(generateCode());
pointInfo.setPointLocation(shopPointDetailRequest.getLocation());
pointInfo.setDevelopmentManager(userId);
@@ -114,13 +125,25 @@ public class PointServiceImpl implements PointService {
PointDetailInfoDO shopPoint = AddPointDetailRequest.convertDO(shopPointDetailRequest);
shopPoint.setPointId(pointId);
pointDetailInfoDAO.addPointDetailInfo(shopPoint);
if (shopId !=null){
PointRecommendDO pointRecommendDO = new PointRecommendDO();
pointRecommendDO.setLineId(lineId);
pointRecommendDO.setShopId(shopId);
pointRecommendDO.setDevelopmentManager(userId);
pointRecommendDO.setPointId(pointId);
pointRecommendDO.setStatus(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode());
//推荐列表新增
pointRecommendDAO.addRecommendPoint(Lists.newArrayList(pointRecommendDO));
//更新店铺所处阶段
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_11);
}
//推送铺位至三方平台
if (StringUtils.isNotBlank(shopPointDetailRequest.getOpportunityPointCode())) {
BerthOperationRequest request1 = new BerthOperationRequest();
request1.setOpType(OpTypeEnum.INSERT.getCode());
request1.setCode(shopPointDetailRequest.getOpportunityPointCode());
request1.setUserId(userId);
request1.setMobile(StringUtils.isNotBlank(user.getMobile())?user.getMobile():"");
request1.setMobile(StringUtils.isNotBlank(user.getMobile()) ? user.getMobile() : "");
if (StringUtils.isBlank(user.getName())) {
if (StringUtils.isNotBlank(user.getMobile()) && user.getMobile().length() >= 4) {
// 获取后4位
@@ -194,7 +217,7 @@ public class PointServiceImpl implements PointService {
request1.setUserName(user.getName());
} else {
request1.setUserId(lineInfoDO.getPartnerId());
request1.setMobile(StringUtils.isNotBlank(lineInfoDO.getMobile())?lineInfoDO.getMobile():"");
request1.setMobile(StringUtils.isNotBlank(lineInfoDO.getMobile()) ? lineInfoDO.getMobile() : "");
request1.setUserName(lineInfoDO.getUsername());
}
request1.setOpType(OpTypeEnum.UPDATE.getCode());
@@ -350,7 +373,7 @@ public class PointServiceImpl implements PointService {
if (StringUtils.isAnyBlank(pointInfo.getPointArea(), pointInfo.getLatitude(),
pointInfo.getLongitude(), pointInfo.getAddress(), pointInfo.getProvince(), pointInfo.getCity(),
pointInfo.getDistrict(), pointDetailInfoDO.getMonthRent()
)) {
)) {
return false;
}
return true;
@@ -841,16 +864,16 @@ public class PointServiceImpl implements PointService {
throw new ServiceException(ErrorCodeEnum.POINT_IS_SELECTED);
}
PointInfoDO updatePoint = new PointInfoDO();
if (StringUtils.isNotBlank(shopInfo.getProvince())){
if (StringUtils.isNotBlank(shopInfo.getProvince())) {
updatePoint.setProvince(shopInfo.getProvince());
}
if (StringUtils.isNotBlank(shopInfo.getCity())){
if (StringUtils.isNotBlank(shopInfo.getCity())) {
updatePoint.setCity(shopInfo.getCity());
}
if (StringUtils.isNotBlank(shopInfo.getDistrict())){
if (StringUtils.isNotBlank(shopInfo.getDistrict())) {
updatePoint.setDistrict(shopInfo.getDistrict());
}
if (StringUtils.isNotBlank(shopInfo.getDetailAddress())){
if (StringUtils.isNotBlank(shopInfo.getDetailAddress())) {
updatePoint.setAddress(shopInfo.getDetailAddress());
}
updatePoint.setId(pointId);
@@ -962,16 +985,16 @@ public class PointServiceImpl implements PointService {
//更新店铺所处阶段
shopStageInfoDAO.updateShopStageInfo(shopInfo.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_11);
PointInfoDO updatePoint = new PointInfoDO();
if (StringUtils.isNotBlank(shopInfo.getProvince())){
if (StringUtils.isNotBlank(shopInfo.getProvince())) {
updatePoint.setProvince(shopInfo.getProvince());
}
if (StringUtils.isNotBlank(shopInfo.getCity())){
if (StringUtils.isNotBlank(shopInfo.getCity())) {
updatePoint.setCity(shopInfo.getCity());
}
if (StringUtils.isNotBlank(shopInfo.getDistrict())){
if (StringUtils.isNotBlank(shopInfo.getDistrict())) {
updatePoint.setDistrict(shopInfo.getDistrict());
}
if (StringUtils.isNotBlank(shopInfo.getDetailAddress())){
if (StringUtils.isNotBlank(shopInfo.getDetailAddress())) {
updatePoint.setAddress(shopInfo.getDetailAddress());
}
updatePoint.setId(pointId);
@@ -996,7 +1019,7 @@ public class PointServiceImpl implements PointService {
request1.setOpType(OpTypeEnum.INSERT.getCode());
request1.setCode(request.getOpportunityPointCode());
request1.setUserId(lineInfo.getPartnerId());
request1.setMobile(StringUtils.isNotBlank(lineInfo.getMobile())?lineInfo.getMobile():"");
request1.setMobile(StringUtils.isNotBlank(lineInfo.getMobile()) ? lineInfo.getMobile() : "");
if (StringUtils.isBlank(lineInfo.getUsername())) {
if (StringUtils.isNotBlank(lineInfo.getMobile()) && lineInfo.getMobile().length() >= 4) {
// 获取后4位