fix 门店状态已完成

This commit is contained in:
shuo.wang
2025-02-13 20:00:31 +08:00
parent 7377435498
commit ac01c4009f

View File

@@ -95,8 +95,8 @@ public class PreparationServiceImpl implements PreparationService {
Map<Long, ShopStageInfoDO> shopStageInfoDOMap = shopContractActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
List<ShopStageInfoDO> openActivityActualCompletionTime = shopStageInfoDAO.getOpenActivityActualCompletionTime(shopIds);
Map<Long, ShopStageInfoDO> openActivityStageMap;
if (openActivityActualCompletionTime !=null){
openActivityStageMap = openActivityActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
if (openActivityActualCompletionTime != null) {
openActivityStageMap = openActivityActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
} else {
openActivityStageMap = new HashMap<>();
}
@@ -119,7 +119,7 @@ public class PreparationServiceImpl implements PreparationService {
preparationScheduleVO.setPlanOpenTime(x.getPlanOpenTime());
preparationScheduleVO.setStoreNum(x.getStoreNum());
preparationScheduleVO.setShopCreateTime(x.getCreateTime());
if ( openActivityStageMap.containsKey(x.getId())) {
if (openActivityStageMap.containsKey(x.getId())) {
preparationScheduleVO.setOpeningActivityEndTime(DateUtils.strToDate(openActivityStageMap.get(x.getId()).getActualCompleteTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
}
preparationScheduleVO.setShopManagerUserName(userInfoMap.getOrDefault(x.getShopManagerUserId(), new EnterpriseUserDO()).getName());
@@ -195,7 +195,7 @@ public class PreparationServiceImpl implements PreparationService {
@Override
public PreparationProcessVO getPreparationProcess(Long shopId) {
PreparationProcessVO preparationProcess = shopStageInfoDAO.getPreparationProcess(shopId);
if (preparationProcess == null){
if (preparationProcess == null) {
return null;
}
preparationProcess.setTotalCount(10);
@@ -218,7 +218,7 @@ public class PreparationServiceImpl implements PreparationService {
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90);
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_140);
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_150);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId,list);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
}
}
}
@@ -230,13 +230,13 @@ public class PreparationServiceImpl implements PreparationService {
Map<Integer, ShopStageInfoDO> shopStageInfoDOMap = shopStageInfo.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopSubStage, data -> data));
Boolean flag3 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_153.getShopSubStageStatus().
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
if (flag3){
if (flag3) {
List<ShopSubStageStatusEnum> list = new ArrayList<>();
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_160);
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_170);
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_230);
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_240);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId,list);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
}
}
}
@@ -254,7 +254,7 @@ public class PreparationServiceImpl implements PreparationService {
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage()).getShopSubStageStatus());
//都完成了 初始化后续流程数据
if (flag1&&flag2&&flag3) {
if (flag1 && flag2 && flag3) {
//初始化后续流程数据s
List<ShopSubStageStatusEnum> list = new ArrayList<>();
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_180);
@@ -262,12 +262,12 @@ public class PreparationServiceImpl implements PreparationService {
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_200);
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_210);
list.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_220);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId,list);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, list);
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
Map<String, String> templateParam = new HashMap<>();
templateParam.put("shopName", shopInfo.getShopName());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.PLATFORM_BUILD_STORE,templateParam);
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.PLATFORM_BUILD_STORE, templateParam);
}
}
}
@@ -285,26 +285,27 @@ public class PreparationServiceImpl implements PreparationService {
@Override
public void updateShopStatus(Long shopId) {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
if (shopInfo.getShopStatus().equals(ShopStatusEnum.ING.getCode())){
if (shopInfo.getShopStatus().equals(ShopStatusEnum.ING.getCode())) {
ScheduleDTO scheduleAll = shopStageInfoDAO.getScheduleAll(shopId);
ShopInfoDO shopInfoDO = new ShopInfoDO();
if (scheduleAll.getTotalColumn().equals(scheduleAll.getCompletionColumn())){
shopInfoDO.setShopStatus(ShopStatusEnum.DONE.getCode());
}
if (scheduleAll.getTotalColumn().equals(scheduleAll.getCompletionColumn())) {
shopInfoDO.setShopStatus(ShopStatusEnum.DONE.getCode());
}
shopInfoDO.setUpdateTime(new Date());
shopInfoDO.setId(shopId);
shopInfoDAO.updateShopInfo(shopInfoDO);
}
}
@Override
public Map<Long,Integer> getShopStatus(List<Long> shopIds) {
public Map<Long, Integer> getShopStatus(List<Long> shopIds) {
List<ScheduleDTO> scheduleList = shopStageInfoDAO.getScheduleList(shopIds);
Map<Long,Integer> map = new HashMap<>();
scheduleList.forEach(x->{
if (x.getTotalColumn().equals(x.getCompletionColumn())){
map.put(x.getShopId(),ShopStatusEnum.DONE.getCode());
}else {
map.put(x.getShopId(),ShopStatusEnum.ING.getCode());
Map<Long, Integer> map = new HashMap<>();
scheduleList.forEach(x -> {
if (x.getTotalColumn().equals(x.getCompletionColumn())) {
map.put(x.getShopId(), ShopStatusEnum.DONE.getCode());
} else {
map.put(x.getShopId(), ShopStatusEnum.ING.getCode());
}
});
return map;