|
@@ -33,12 +33,21 @@ public class BuyService {
|
|
|
Buy buy2 = buyMapper.selectById(buy1.getBuyId());
|
|
|
if (roleType.getRoleType() != 1) {
|
|
|
if (jmTuangou.getTgMaxNum().intValue() >= jmTuangou.getCurrentNum().intValue() - buy2.getBuyCount().intValue() + buy.getBuyCount().intValue()) {
|
|
|
+ //个人限额(指挥部的限额 和 管理员的限额)
|
|
|
+ if (roleType.getTgItemNum().intValue() != 0 && roleType.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
|
|
|
+ return 4;
|
|
|
+ }
|
|
|
buy.setBuyId(buy1.getBuyId());
|
|
|
return buyMapper.updateById(buy);
|
|
|
} else {
|
|
|
return 3;//不允许更改团购数量
|
|
|
}
|
|
|
} else {
|
|
|
+ //指挥部的更改
|
|
|
+ //个人限额(指挥部的限额 和 管理员的限额)
|
|
|
+ if (roleType.getTgItemNum().intValue() != 0 && roleType.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
|
|
|
+ return 4;
|
|
|
+ }
|
|
|
buy.setBuyId(buy1.getBuyId());
|
|
|
return buyMapper.updateById(buy);
|
|
|
}
|
|
@@ -51,6 +60,10 @@ public class BuyService {
|
|
|
return 3;
|
|
|
}
|
|
|
}
|
|
|
+ //个人限额(指挥部的限额 和 管理员的限额)
|
|
|
+ if (roleType.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
|
|
|
+ return 4;
|
|
|
+ }
|
|
|
|
|
|
buy.setBuyId(IdWorker.getId());
|
|
|
buy.setUserCreate(buy.getUserId());
|
|
@@ -105,7 +118,7 @@ public class BuyService {
|
|
|
if (jmTuangous != null && jmTuangous.size() > 0) {
|
|
|
for (JmTuangou list : jmTuangous) {
|
|
|
//判断是指挥部还是管理员
|
|
|
- if (list.getRoleType()==1) {
|
|
|
+ if (list.getRoleType() == 1) {
|
|
|
if (list.getTgEndTime().getTime() < new DateTime().getMillis()) {
|
|
|
jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
|
|
|
}
|