|
@@ -10,6 +10,7 @@ import com.zhongzheng.common.utils.ServletUtils;
|
|
import com.zhongzheng.modules.alisms.service.IAliSmsService;
|
|
import com.zhongzheng.modules.alisms.service.IAliSmsService;
|
|
import com.zhongzheng.modules.bank.domain.QuestionBusiness;
|
|
import com.zhongzheng.modules.bank.domain.QuestionBusiness;
|
|
import com.zhongzheng.modules.base.service.IProfileTpService;
|
|
import com.zhongzheng.modules.base.service.IProfileTpService;
|
|
|
|
+import com.zhongzheng.modules.base.service.IShoppingCartService;
|
|
import com.zhongzheng.modules.base.vo.ProfileTpVo;
|
|
import com.zhongzheng.modules.base.vo.ProfileTpVo;
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
@@ -92,6 +93,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
@Autowired
|
|
@Autowired
|
|
private IUserService iUserService;
|
|
private IUserService iUserService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IShoppingCartService iShoppingCartService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
|
|
private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
|
|
|
|
|
|
@@ -313,6 +317,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
}
|
|
}
|
|
arrangeGrade(goods.getGoodsName(),goods.getGoodsId(),orderGoods.getOrderGoodsId(),gradeId,add.getUserId());
|
|
arrangeGrade(goods.getGoodsName(),goods.getGoodsId(),orderGoods.getOrderGoodsId(),gradeId,add.getUserId());
|
|
}
|
|
}
|
|
|
|
+ iShoppingCartService.deleteByGoodsId(g.getGoodsId(),bo.getUserId());
|
|
}
|
|
}
|
|
|
|
|
|
add.setOrderSn(out_trade_no);
|
|
add.setOrderSn(out_trade_no);
|
|
@@ -330,6 +335,35 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
return payResult;
|
|
return payResult;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String, String> resumeSmallOrder(OrderAddBo bo) {
|
|
|
|
+ if(bo.getOrderSn()==null){
|
|
|
|
+ throw new CustomException("订单数据错误");
|
|
|
|
+ }
|
|
|
|
+ Order order = this.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, bo.getOrderSn()));
|
|
|
|
+ String body = "";
|
|
|
|
+ if(order!=null&&order.getOrderStatus()==0){
|
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("order_sn",bo.getOrderSn());
|
|
|
|
+ List<OrderGoods> goodsList = iOrderGoodsService.listByMap(map);
|
|
|
|
+ for (OrderGoods g : goodsList) {
|
|
|
|
+ Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId,g.getGoodsId()));
|
|
|
|
+ if(goods.getGoodsStatus()!=1){
|
|
|
|
+ throw new CustomException("商品尚未上架");
|
|
|
|
+ }
|
|
|
|
+ body = "中正祥粤云-"+goods.getGoodsName();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ throw new CustomException("无法继续支付");
|
|
|
|
+ }
|
|
|
|
+ UserVo userVo = iUserService.queryById(bo.getUserId());
|
|
|
|
+ String price = "1";
|
|
|
|
+ Map<String, String> payResult = iWxPayService.payment(bo.getOrderSn(),userVo.getOpenId(),body,price);
|
|
|
|
+ payResult.put("orderSn",bo.getOrderSn());
|
|
|
|
+ return payResult;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Boolean updateByEditBo(OrderEditBo bo) {
|
|
public Boolean updateByEditBo(OrderEditBo bo) {
|
|
@@ -389,7 +423,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
throw new CustomException("该学员已在此商品有效期内的班级,无法加入新的有效期班级,请查看该学员此商品下的班级");
|
|
throw new CustomException("该学员已在此商品有效期内的班级,无法加入新的有效期班级,请查看该学员此商品下的班级");
|
|
}
|
|
}
|
|
//指定班级
|
|
//指定班级
|
|
- if(gradeId!=null){
|
|
|
|
|
|
+ if(gradeId>0){
|
|
ClassGradeVo classGradeVo = iClassGradeService.queryById(gradeId);
|
|
ClassGradeVo classGradeVo = iClassGradeService.queryById(gradeId);
|
|
if(classGradeVo==null){
|
|
if(classGradeVo==null){
|
|
throw new CustomException("班级不存在");
|
|
throw new CustomException("班级不存在");
|
|
@@ -453,7 +487,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
classGradeUser.setUserId(userId);
|
|
classGradeUser.setUserId(userId);
|
|
classGradeUser.setGradeId(gradeId);
|
|
classGradeUser.setGradeId(gradeId);
|
|
classGradeUser.setStatus(1);
|
|
classGradeUser.setStatus(1);
|
|
- classGradeUser.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
|
+ // classGradeUser.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
+ classGradeUser.setCreateBy("sys"); //系统分班
|
|
classGradeUser.setFromType(1);
|
|
classGradeUser.setFromType(1);
|
|
classGradeUser.setOrderGoodsId(orderGoodsId);
|
|
classGradeUser.setOrderGoodsId(orderGoodsId);
|
|
classGradeUser.setCreateTime(DateUtils.getNowTime());
|
|
classGradeUser.setCreateTime(DateUtils.getNowTime());
|