This commit is contained in:
shuo.wang
2025-05-26 20:50:53 +08:00
parent 3ae63c892a
commit 3a17363c7c
2 changed files with 21 additions and 13 deletions

View File

@@ -18,6 +18,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
@@ -169,4 +170,8 @@ public class ShopAccountDAO {
}
return shopAccountMapper.updateStatusDataHandle(shopIds);
}
public List<Long> getShopId(){
List<ShopAccountDO> shopAccountDOS = shopAccountMapper.selectAll();
return new ArrayList<>(shopAccountDOS.stream().map(ShopAccountDO::getShopId).collect(Collectors.toSet())) ;
}
}

View File

@@ -918,31 +918,34 @@ public class DataHandlerServerImpl implements DataHandlerServer {
List<LineInfoDO> lineInfoDOS = lineInfoDAO.getByLineIds(new ArrayList<>(lineIds));
Map<Long, LineInfoDO> lineMap = lineInfoDOS.stream().collect(Collectors.toMap(LineInfoDO::getId, line -> line));
List<ShopStageInfoDO> initList = new ArrayList<>();
List<ShopAccountDO> initAccountList = new ArrayList<>();
List<ShopAccountDO> initAccountList = new ArrayList<>();
ShopSubStageEnum shopSubStageEnum = ShopSubStageEnum.SHOP_STAGE_25;
for (ShopStageInfoDO shopStageInfoDO : subStages){
List<Long> shopIds = shopAccountDAO.getShopId();
for (ShopStageInfoDO shopStageInfoDO : subStages) {
LineInfoDO lineInfoDO = lineMap.get(shopStageInfoDO.getLineId());
if (Objects.isNull(lineInfoDO)){
log.info("线索不存在:{}", shopStageInfoDO.getShopId());
if (Objects.isNull(lineInfoDO)) {
log.info("线索不存在:{}", shopStageInfoDO.getShopId());
continue;
}
if (shopStageInfoDO.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus())){
if (shopStageInfoDO.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus())) {
ShopStageInfoDO shopStageInfo = getShopStageInfoDO(shopSubStageEnum, shopStageInfoDO, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00);
initList.add(shopStageInfo);
}
if ( !shopStageInfoDO.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus())){
if (!shopStageInfoDO.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus())) {
ShopStageInfoDO shopStageInfo = getShopStageInfoDO(shopSubStageEnum, shopStageInfoDO, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_250);
initList.add(shopStageInfo);
}
ShopAccountDO shopAccountDO = new ShopAccountDO();
shopAccountDO.setShopId(shopStageInfoDO.getShopId());
shopAccountDO.setSystemName(ShopAccountEnum.JINGDONG.getSystemName());
shopAccountDO.setBoundPhone(lineInfoDO.getMobile());
shopAccountDO.setStatus(ShopAccountEnum.JINGDONG.getInitStatus().getCode());
initAccountList.add(shopAccountDO);
if (shopIds.contains(shopStageInfoDO.getShopId())) {
ShopAccountDO shopAccountDO = new ShopAccountDO();
shopAccountDO.setShopId(shopStageInfoDO.getShopId());
shopAccountDO.setSystemName(ShopAccountEnum.JINGDONG.getSystemName());
shopAccountDO.setBoundPhone(lineInfoDO.getMobile());
shopAccountDO.setStatus(ShopAccountEnum.JINGDONG.getInitStatus().getCode());
initAccountList.add(shopAccountDO);
}
}
shopAccountDAO.batchInsert(initAccountList);
return shopStageInfoDAO.batchInsert(initList) ;
return shopStageInfoDAO.batchInsert(initList);
}