|
@@ -74,7 +74,7 @@ public class BuyService {
|
|
|
}
|
|
|
|
|
|
public Buy status(Buy buy) {
|
|
|
- return buyMapper.status(buy.getJmId(),buy.getUserId());
|
|
|
+ return buyMapper.status(buy.getJmId(), buy.getUserId());
|
|
|
}
|
|
|
|
|
|
//截止日期状态的更改
|
|
@@ -87,9 +87,18 @@ public class BuyService {
|
|
|
if (list.getTgEndTime().getTime() < new DateTime().getMillis()) {
|
|
|
|
|
|
// 团购数量 最小起订量
|
|
|
- List<Buy> buys = buyMapper.selectCountNum(list.getJmId());
|
|
|
- if (buys != null && buys.size() > 0) {
|
|
|
- for (Buy v : buys) { //最小起订量
|
|
|
+ Buy buy = buyMapper.selectCountNum(list.getJmId());
|
|
|
+ if (buy != null) { //最小起订量
|
|
|
+ if (list.getTgMinNum().intValue() > buy.getCount().intValue()) {
|
|
|
+ jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
|
|
|
+ } else {
|
|
|
+ jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
|
|
|
+ }
|
|
|
+ /* if (buys != null && buys.size() > 0) {
|
|
|
+ for (Buy v : buys) {
|
|
|
if (v.getCount().intValue() < list.getTgMinNum().intValue()) {
|
|
|
jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
|
|
|
} else {
|
|
@@ -98,7 +107,7 @@ public class BuyService {
|
|
|
}
|
|
|
} else {
|
|
|
jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
}
|
|
|
}
|