记得上下班打卡 | git大法好,push需谨慎

Commit a2986147 authored by 胡佳晨's avatar 胡佳晨

修改 添加接口 的 sku时间重合判断

parent 3c7089e8
...@@ -132,11 +132,15 @@ public class GoblinListServiceImpl implements IGoblinListService { ...@@ -132,11 +132,15 @@ public class GoblinListServiceImpl implements IGoblinListService {
for (GoblinListCollectVo collectItem : collectVos) { for (GoblinListCollectVo collectItem : collectVos) {
if (collectItem.getTimeEnd() != null) { if (collectItem.getTimeEnd() != null) {
if ((st.isAfter(collectItem.getTimeStart().minusSeconds(1)) && st.isBefore(collectItem.getTimeEnd().minusSeconds(1))) || if ((st.isAfter(collectItem.getTimeStart().minusSeconds(1)) && st.isBefore(collectItem.getTimeEnd().minusSeconds(1))) ||
(et.isAfter(collectItem.getTimeStart().minusSeconds(1)) && et.isBefore(collectItem.getTimeEnd().minusSeconds(1)))) { (et.isAfter(collectItem.getTimeStart().minusSeconds(1)) && et.isBefore(collectItem.getTimeEnd().minusSeconds(1))) ||
(st.isBefore(collectItem.getTimeStart().minusSeconds(1)) && et.isAfter(collectItem.getTimeEnd().minusSeconds(1)))
) {
return ResponseDto.failure("sku时间不能重合"); return ResponseDto.failure("sku时间不能重合");
} }
} else { } else {
if(st.isBefore(collectItem.getTimeStart().minusSeconds(1)) && et.isAfter(collectItem.getTimeStart().minusSeconds(1))){
return ResponseDto.failure("sku时间不能重合");
}
} }
} }
} else {//未结束时间 } else {//未结束时间
...@@ -149,7 +153,7 @@ public class GoblinListServiceImpl implements IGoblinListService { ...@@ -149,7 +153,7 @@ public class GoblinListServiceImpl implements IGoblinListService {
if (st.isAfter(collectItem.getTimeStart().minusSeconds(1)) && st.isBefore(collectItem.getTimeEnd().minusSeconds(1))) { if (st.isAfter(collectItem.getTimeStart().minusSeconds(1)) && st.isBefore(collectItem.getTimeEnd().minusSeconds(1))) {
return ResponseDto.failure("sku时间不能重合"); return ResponseDto.failure("sku时间不能重合");
} }
}else{ } else {
} }
} }
......
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