|
@@ -793,17 +793,23 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
}
|
|
}
|
|
|
//校验是否有重复商品
|
|
//校验是否有重复商品
|
|
|
String businessName = iGoodsService.getGoodsBusinessName(g.getGoodsId());
|
|
String businessName = iGoodsService.getGoodsBusinessName(g.getGoodsId());
|
|
|
- if (StringUtils.isNotBlank(goods.getSevenYear()) && businessName.contains("继续教育") && businessName.contains("施工现场专业人员")){
|
|
|
|
|
- Long count = iOrderGoodsService.countOrderGoodsByYear(goods.getSevenYear(),g.getGoodsId(),bo.getUserId());
|
|
|
|
|
- if (count > 0){
|
|
|
|
|
- throw new CustomException(goods.getGoodsName() + ",请勿重复购买相同年份的商品");
|
|
|
|
|
- }
|
|
|
|
|
- }else if (businessName.contains("考前培训") && businessName.contains("施工现场专业人员")){
|
|
|
|
|
- Long count = baseMapper.getOrderGoodsByBo(g.getGoodsId(),bo.getUserId());
|
|
|
|
|
- if (count > 0){
|
|
|
|
|
- throw new CustomException("请勿重复购买相同的课程");
|
|
|
|
|
|
|
+ SysTenant tenant = iSysTenantService.getById(tenantId);
|
|
|
|
|
+
|
|
|
|
|
+ if (ObjectUtils.isNotNull(tenant.getSlabSign()) && tenant.getSlabSign() != 2){
|
|
|
|
|
+ //学校可以重复
|
|
|
|
|
+ if (StringUtils.isNotBlank(goods.getSevenYear()) && businessName.contains("继续教育") && businessName.contains("施工现场专业人员")){
|
|
|
|
|
+ Long count = iOrderGoodsService.countOrderGoodsByYear(goods.getSevenYear(),g.getGoodsId(),bo.getUserId());
|
|
|
|
|
+ if (count > 0){
|
|
|
|
|
+ throw new CustomException(goods.getGoodsName() + ",请勿重复购买相同年份的商品");
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if (businessName.contains("考前培训") && businessName.contains("施工现场专业人员")){
|
|
|
|
|
+ Long count = baseMapper.getOrderGoodsByBo(g.getGoodsId(),bo.getUserId());
|
|
|
|
|
+ if (count > 0){
|
|
|
|
|
+ throw new CustomException("请勿重复购买相同的课程");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// if (goods.getGoodsStatus() != 1) {
|
|
// if (goods.getGoodsStatus() != 1) {
|
|
|
// throw new CustomException(goods.getGoodsName()+"商品已下架,请重新选择商品下单", 510);
|
|
// throw new CustomException(goods.getGoodsName()+"商品已下架,请重新选择商品下单", 510);
|
|
|
// }
|
|
// }
|
|
@@ -2659,9 +2665,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
String businessName = iGoodsService.getBusinessName(goodsId);
|
|
String businessName = iGoodsService.getBusinessName(goodsId);
|
|
|
String tenantId = ServletUtils.getRequest().getHeader("TenantId");
|
|
String tenantId = ServletUtils.getRequest().getHeader("TenantId");
|
|
|
SysTenant tenant = iSysTenantService.getById(tenantId);
|
|
SysTenant tenant = iSysTenantService.getById(tenantId);
|
|
|
- if (StringUtils.isNotBlank(businessName) && businessName.contains("二级造价师")
|
|
|
|
|
- && ObjectUtils.isNotNull(tenant.getSlabSign()) && tenant.getSlabSign() == 2){
|
|
|
|
|
- //学校二造可以重复
|
|
|
|
|
|
|
+// if (StringUtils.isNotBlank(businessName) && businessName.contains("二级造价师")
|
|
|
|
|
+// && ObjectUtils.isNotNull(tenant.getSlabSign()) && tenant.getSlabSign() == 2){
|
|
|
|
|
+// //学校二造可以重复
|
|
|
|
|
+// return null;
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+ if (ObjectUtils.isNotNull(tenant.getSlabSign()) && tenant.getSlabSign() == 2){
|
|
|
|
|
+ //学校可以重复
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
OrderGoodsQueryBo orderGoodsQueryBo = new OrderGoodsQueryBo();
|
|
OrderGoodsQueryBo orderGoodsQueryBo = new OrderGoodsQueryBo();
|