Commit 3c2a2bf7 by 吕明尚

门店增加状态:筹备中/维护中 门店列表可显示,不能点击进入,不显示有人预定,当前维护中更改为下线

parent d9286e68
......@@ -4,6 +4,8 @@ public enum StoreStatusEnum {
// 0:停业 1:正常营业
STOP("0", "停业"),
NORMAL("1", "正常营业"),
//维修中
REPAIR("2", "维修中"),
;
private String index;
......
......@@ -198,7 +198,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
@Override
public int updateSStore(SStore sStore) {
sStore.setUpdateTime(DateUtils.getNowDate());
if (sStore.getStatus().equals(YesNoEnum.no.getIndex().toString())) {
if (sStore.getStatus().equals(StoreStatusEnum.STOP.getIndex())) {
//判断门店下是否有已支付.待使用,使用中订单
LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SOrder::getStoreId, sStore.getId());
......@@ -278,10 +278,15 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
request.setStatus(YesNoEnum.yes.getIndex().toString());
}
listVoCheck(request);
SStore store = new SStore();
store.setStatus(request.getStatus());
store.setName(request.getName());
List<SStore> storeList = baseMapper.selectSStoreList(store);
// SStore store = new SStore();
// store.setStatus(request.getStatus());
// store.setName(request.getName());
LambdaQueryWrapper<SStore> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.ne(SStore::getStatus, StoreStatusEnum.STOP.getIndex());
if (StringUtils.isNotEmpty(request.getName())) {
queryWrapper.eq(SStore::getName, request.getName());
}
List<SStore> storeList = baseMapper.selectList(queryWrapper);
List<SStoreVo> voList = new ArrayList<>();
if (StringUtils.isNotBlank(request.getNowLongitude())) {
voList = convertDosToVosSortByDst(storeList, request);
......@@ -333,12 +338,19 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
}
vo.setOrderType(order.getOrderType());
} else {
if (o.getStatus().equals(StoreStatusEnum.REPAIR.getIndex())) {
vo.setOrderTimeType(0);
vo.setOrderTime(0L);
} else {
vo.setOrderTimeType(2);
vo.setOrderTime(3L);
}
}
voList.add(vo);
});
return voList.stream().sorted(Comparator.comparing(storeVo -> Double.parseDouble(storeVo.getDistance()))).collect(Collectors.toList());
//排序条件 getStatus()从小到大并且getDistance()从小到大
voList.sort(Comparator.comparing(SStoreVo::getStatus).thenComparing(SStoreVo::getDistance));
// voList.stream().sorted(Comparator.comparing(storeVo -> Double.parseDouble(storeVo.getDistance()))).collect(Collectors.toList());
}
return voList;
}
......@@ -562,8 +574,9 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
List<SOrder> orderList = list.stream().filter(order ->
order.getRoomId().compareTo(room.getId()) == 0
&& order.getStatus().equals(OrderStatusEnum.UNUSED.getCode())
//预约开始时间是今天的
&& DateUtil.isSameDay(order.getPreStartDate(), DateUtil.date())
//预约开始时间是当前时间至之后的12小时内
&& order.getPreStartDate().compareTo(new Date()) >= 0
&& order.getPreStartDate().compareTo(DateUtils.addHours(new Date(), 12)) <= 0
).collect(Collectors.toList());
//按照预约开始时间排序
orderList.sort(Comparator.comparing(SOrder::getPreStartDate));
......
......@@ -166,7 +166,7 @@
and DATE_FORMAT(pre_start_date, '%Y-%m-%d') &gt;= DATE_FORMAT(#{preStartDate}, '%Y-%m-%d')
</if>
<if test="preEndDate != null">
and DATE_FORMAT(pre_end_date, '%Y-%m-%d') &lt;= DATE_FORMAT(#{preEndDate}, '%Y-%m-%d')
and DATE_FORMAT(pre_start_date, '%Y-%m-%d') &lt;= DATE_FORMAT(#{preEndDate}, '%Y-%m-%d')
</if>
<if test="startDate != null">
and DATE_FORMAT(create_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment