Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -2,6 +2,7 @@ package com.cool.store.dao;
|
|||||||
|
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||||
|
import com.cool.store.dto.point.LineCountDTO;
|
||||||
import com.cool.store.entity.ShopInfoDO;
|
import com.cool.store.entity.ShopInfoDO;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
@@ -9,6 +10,7 @@ import com.cool.store.mapper.ShopInfoMapper;
|
|||||||
import com.cool.store.vo.shop.StageShopCountVO;
|
import com.cool.store.vo.shop.StageShopCountVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@@ -16,7 +18,9 @@ import org.springframework.stereotype.Repository;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
@@ -139,4 +143,12 @@ public class ShopInfoDAO {
|
|||||||
PageHelper.startPage(pageNum, pageSize);
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
return shopInfoMapper.getOpenPlanShopListByShopName(shopName,bigName,fightName);
|
return shopInfoMapper.getOpenPlanShopListByShopName(shopName,bigName,fightName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<Long, Integer> getSelectedShopNumMap(List<Long> lineIds) {
|
||||||
|
if(CollectionUtils.isEmpty(lineIds)){
|
||||||
|
return Maps.newHashMap();
|
||||||
|
}
|
||||||
|
List<LineCountDTO> selectedShopNum = shopInfoMapper.getSelectedShopNum(lineIds);
|
||||||
|
return selectedShopNum.stream().collect(Collectors.toMap(k->k.getLineId(), v->v.getSelectedShopNum()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.cool.store.mapper;
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||||
|
import com.cool.store.dto.point.LineCountDTO;
|
||||||
import com.cool.store.entity.ShopInfoDO;
|
import com.cool.store.entity.ShopInfoDO;
|
||||||
import com.cool.store.vo.shop.StageShopCountVO;
|
import com.cool.store.vo.shop.StageShopCountVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
@@ -69,4 +70,6 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
|||||||
*/
|
*/
|
||||||
Page<OpenPlanShopInfoDTO> getOpenPlanShopListByShopName(@Param("shopName") String shopName,
|
Page<OpenPlanShopInfoDTO> getOpenPlanShopListByShopName(@Param("shopName") String shopName,
|
||||||
@Param("bigName") String bigName, @Param("fightName") String fightName);
|
@Param("bigName") String bigName, @Param("fightName") String fightName);
|
||||||
|
|
||||||
|
List<LineCountDTO> getSelectedShopNum(@Param("lineIds") List<Long> lineIds);
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
line_id as lineId,
|
line_id as lineId,
|
||||||
count(1) as selectedShopNum
|
count(1) as selectedShopNum
|
||||||
from xfsg_point_info
|
from xfsg_point_info
|
||||||
where deleted = 0 and select_status = 1 and line_id in
|
where deleted = 0 and select_status = 1 and point_status !=7 and line_id in
|
||||||
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
|
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
|
||||||
#{lineId}
|
#{lineId}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|||||||
@@ -93,5 +93,17 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getSelectedShopNum" resultType="com.cool.store.dto.point.LineCountDTO">
|
||||||
|
select
|
||||||
|
line_id as lineId,
|
||||||
|
count(1) as selectedShopNum
|
||||||
|
from xfsg_shop_info
|
||||||
|
where deleted = 0 and point_id > 0 and line_id in
|
||||||
|
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
|
||||||
|
#{lineId}
|
||||||
|
</foreach>
|
||||||
|
group by line_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -52,6 +52,9 @@ public class PointAuditRecordVO {
|
|||||||
@ApiModelProperty("是否超时")
|
@ApiModelProperty("是否超时")
|
||||||
private Boolean isTimeout;
|
private Boolean isTimeout;
|
||||||
|
|
||||||
|
@ApiModelProperty("节点")
|
||||||
|
private Integer nodeNo;
|
||||||
|
|
||||||
public static List<PointAuditRecordVO> convert(List<PointAuditRecordDO> auditRecordList, Map<String, EnterpriseUserDO> userMap) {
|
public static List<PointAuditRecordVO> convert(List<PointAuditRecordDO> auditRecordList, Map<String, EnterpriseUserDO> userMap) {
|
||||||
List<PointAuditRecordVO> resultList = new ArrayList<>();
|
List<PointAuditRecordVO> resultList = new ArrayList<>();
|
||||||
for (PointAuditRecordDO pointAuditRecord : auditRecordList) {
|
for (PointAuditRecordDO pointAuditRecord : auditRecordList) {
|
||||||
@@ -63,6 +66,7 @@ public class PointAuditRecordVO {
|
|||||||
pointAuditRecordVO.setSignAddress(pointAuditRecord.getSignAddress());
|
pointAuditRecordVO.setSignAddress(pointAuditRecord.getSignAddress());
|
||||||
pointAuditRecordVO.setPictureUrl(pointAuditRecord.getPictureUrl());
|
pointAuditRecordVO.setPictureUrl(pointAuditRecord.getPictureUrl());
|
||||||
pointAuditRecordVO.setIsTimeout(Boolean.FALSE);
|
pointAuditRecordVO.setIsTimeout(Boolean.FALSE);
|
||||||
|
pointAuditRecordVO.setNodeNo(pointAuditRecord.getNodeNo());
|
||||||
if(Objects.nonNull(pointAuditRecord.getReceiveTaskTime())){
|
if(Objects.nonNull(pointAuditRecord.getReceiveTaskTime())){
|
||||||
Date time = Objects.isNull(pointAuditRecord.getFinishTaskTime()) ? new Date() : pointAuditRecord.getFinishTaskTime();
|
Date time = Objects.isNull(pointAuditRecord.getFinishTaskTime()) ? new Date() : pointAuditRecord.getFinishTaskTime();
|
||||||
LocalDateTime localDateTime = LocalDateTime.ofInstant(pointAuditRecord.getReceiveTaskTime().toInstant(), ZoneId.systemDefault());
|
LocalDateTime localDateTime = LocalDateTime.ofInstant(pointAuditRecord.getReceiveTaskTime().toInstant(), ZoneId.systemDefault());
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_7.getCode());
|
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_7.getCode());
|
||||||
pointInfoDAO.updatePointInfo(updatePoint);
|
pointInfoDAO.updatePointInfo(updatePoint);
|
||||||
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
||||||
rollbackSelectPoint(pointInfo.getShopId());
|
rollbackSelectPoint(pointInfo.getShopId(), pointInfo.getId());
|
||||||
}
|
}
|
||||||
return pointRecommendDAO.updateRecommendStatus(pointId, PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_6, null);
|
return pointRecommendDAO.updateRecommendStatus(pointId, PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_6, null);
|
||||||
}
|
}
|
||||||
@@ -177,8 +177,11 @@ public class PointServiceImpl implements PointService {
|
|||||||
* 回退选址状态
|
* 回退选址状态
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private void rollbackSelectPoint(Long shopId){
|
private void rollbackSelectPoint(Long shopId, Long pointId){
|
||||||
|
//店铺回退待带选址
|
||||||
shopInfoDAO.unbindPoint(shopId);
|
shopInfoDAO.unbindPoint(shopId);
|
||||||
|
//铺位回退
|
||||||
|
pointInfoDAO.recyclePoint(pointId);
|
||||||
//回到待选址状态
|
//回到待选址状态
|
||||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_10);
|
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_10);
|
||||||
//租赁合同回到未开始
|
//租赁合同回到未开始
|
||||||
@@ -200,9 +203,8 @@ public class PointServiceImpl implements PointService {
|
|||||||
if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
|
if(PointStatusEnum.POINT_STATUS_6.getCode().equals(pointInfo.getPointStatus())){
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
|
throw new ServiceException(ErrorCodeEnum.POINT_SIGNED);
|
||||||
}
|
}
|
||||||
pointInfoDAO.recyclePoint(pointId);
|
|
||||||
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
||||||
rollbackSelectPoint(pointInfo.getShopId());
|
rollbackSelectPoint(pointInfo.getShopId(), pointInfo.getId());
|
||||||
}
|
}
|
||||||
//将已选择、已被他人选择的状态更新成待选泽
|
//将已选择、已被他人选择的状态更新成待选泽
|
||||||
return pointRecommendDAO.updateRecommendStatusByStatusAndPointId(pointId, PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1, Arrays.asList(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2, PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3));
|
return pointRecommendDAO.updateRecommendStatusByStatusAndPointId(pointId, PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1, Arrays.asList(PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2, PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3));
|
||||||
@@ -435,7 +437,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
List<Long> wantShopAreaIds = lineList.stream().map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
List<Long> wantShopAreaIds = lineList.stream().map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
||||||
Map<Long, Integer> recommendShopNumMap = pointRecommendDAO.getPushShopNumMap(lineIds);
|
Map<Long, Integer> recommendShopNumMap = pointRecommendDAO.getPushShopNumMap(lineIds);
|
||||||
Map<Long, HyOpenAreaInfoDO> cityMap = hyOpenAreaInfoDAO.getCityMap(wantShopAreaIds);
|
Map<Long, HyOpenAreaInfoDO> cityMap = hyOpenAreaInfoDAO.getCityMap(wantShopAreaIds);
|
||||||
Map<Long, Integer> selectedShopNumMap = pointInfoDAO.getSelectedShopNumMap(lineIds);
|
Map<Long, Integer> selectedShopNumMap = shopInfoDAO.getSelectedShopNumMap(lineIds);
|
||||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(investmentManagerUserIds);
|
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(investmentManagerUserIds);
|
||||||
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
|
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
|
||||||
List<LinePointBaseInfoVO> resultList = LinePointBaseInfoVO.convertList(lineList, userNameMap, userPortraitMap, cityMap, recommendShopNumMap, selectedShopNumMap);
|
List<LinePointBaseInfoVO> resultList = LinePointBaseInfoVO.convertList(lineList, userNameMap, userPortraitMap, cityMap, recommendShopNumMap, selectedShopNumMap);
|
||||||
@@ -703,6 +705,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
pointInfoDAO.updatePointInfo(updatePoint);
|
pointInfoDAO.updatePointInfo(updatePoint);
|
||||||
ShopInfoDO updateShop = new ShopInfoDO();
|
ShopInfoDO updateShop = new ShopInfoDO();
|
||||||
updateShop.setId(shopId);
|
updateShop.setId(shopId);
|
||||||
|
updateShop.setShopName(pointInfo.getPointName());
|
||||||
updateShop.setPointId(pointId);
|
updateShop.setPointId(pointId);
|
||||||
shopInfoDAO.updateShopInfo(updateShop);
|
shopInfoDAO.updateShopInfo(updateShop);
|
||||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_11);
|
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_11);
|
||||||
|
|||||||
Reference in New Issue
Block a user