Commit 17be0e13 by 吕明尚

小程序退款增加判断是否有使用中的订单才断电,删除

parent 9cb8d974
......@@ -276,7 +276,7 @@ public class RedisTask {
}
//判断订单是否已经添加保洁记录
SCleanRecords cleanRecords = isCleanRecordsService.lastCleanByRoomId(sOrder.getRoomId());
if(cleanRecords.getStatus().compareTo(CleaningStatusEnum.UNCLEAN.getCode())!=0) {
if (ObjectUtils.isEmpty(cleanRecords) || cleanRecords.getStatus().compareTo(CleaningStatusEnum.UNCLEAN.getCode()) != 0) {
boolean b = isCleanRecordsService.addSCleanRecords(sOrder.getStoreId(), sOrder.getRoomId());
}
//删除redis中的值
......
......@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import share.common.constant.Constants;
import share.common.core.page.PageDomain;
import share.common.core.page.TableSupport;
......@@ -795,6 +796,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SOrder lastOrder = lastOrderOp.orElse(null);
if(Objects.nonNull(lastOrder)&&Objects.nonNull(lastOrder.getEndDate())&&lastOrder.getEndDate().compareTo(request.getPreStartDate())<0){
SCleanRecords sCleanRecords = cleanRecordsService.lastCleanByRoomId(lastOrder.getRoomId());
if (ObjectUtils.isEmpty(sCleanRecords)) {
return;
}
if(sCleanRecords.getStatus().compareTo(CleaningStatusEnum.CLEANED.getCode())==0
&&sCleanRecords.getEndDate().compareTo(lastOrder.getEndDate())>0
&&sCleanRecords.getEndDate().compareTo(request.getPreStartDate())<0){
......
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