Commit 7af7d21b by 郑云飞

订单新增修改

parent c122a8db
...@@ -81,7 +81,7 @@ public class SysLoginController { ...@@ -81,7 +81,7 @@ public class SysLoginController {
* @return 结果 * @return 结果
*/ */
@SaIgnore @SaIgnore
@PostMapping("/xcxLogin") @GetMapping("/xcxLogin")
public R<Map<String, Object>> xcxLogin(@NotBlank(message = "{xcx.code.not.blank}") String xcxCode) { public R<Map<String, Object>> xcxLogin(@NotBlank(message = "{xcx.code.not.blank}") String xcxCode) {
Map<String, Object> ajax = new HashMap<>(); Map<String, Object> ajax = new HashMap<>();
// 生成令牌 // 生成令牌
...@@ -97,7 +97,7 @@ public class SysLoginController { ...@@ -97,7 +97,7 @@ public class SysLoginController {
* @return 结果 * @return 结果
*/ */
@SaIgnore @SaIgnore
@PostMapping("/xcxPhoneLogin") @GetMapping("/xcxPhoneLogin")
public R<Map<String, Object>> xcxPhoneLogin(@NotBlank(message = "{xcx.code.not.blank}") String xcxCode) { public R<Map<String, Object>> xcxPhoneLogin(@NotBlank(message = "{xcx.code.not.blank}") String xcxCode) {
LoginUser loginUser = LoginHelper.getLoginUser(); LoginUser loginUser = LoginHelper.getLoginUser();
return loginService.xcxPhoneLogin(xcxCode, loginUser); return loginService.xcxPhoneLogin(xcxCode, loginUser);
......
...@@ -137,19 +137,6 @@ public class DbOrderController extends BaseController { ...@@ -137,19 +137,6 @@ public class DbOrderController extends BaseController {
LoginUser loginUser = new LoginUser(); LoginUser loginUser = new LoginUser();
return toAjax(iDbOrderService.deleteWithValidByIds(id, loginUser)); return toAjax(iDbOrderService.deleteWithValidByIds(id, loginUser));
} }
/**
* 生成支付订单
*
* @param bo 主键串
*/
@SaCheckPermission("xinrenli:order:createPay")
@Log(title = "订单", businessType = BusinessType.DELETE)
@PostMapping("/createPay")
public R<Void> createPay(@RequestBody DbOrderEditBo bo) {
LoginUser loginUser = new LoginUser();
return toAjax(iDbOrderService.createPay(bo, loginUser));
}
/** /**
* 下单 * 下单
......
...@@ -68,8 +68,6 @@ public interface IDbOrderService { ...@@ -68,8 +68,6 @@ public interface IDbOrderService {
*/ */
TableDataInfo<DbOrderVo> homeList(DbOrderBo bo, PageQuery pageQuery); TableDataInfo<DbOrderVo> homeList(DbOrderBo bo, PageQuery pageQuery);
Boolean createPay(DbOrderEditBo bo, LoginUser loginUser);
R orderPay(Long id, Long couponId, LoginUser loginUser); R orderPay(Long id, Long couponId, LoginUser loginUser);
} }
...@@ -268,11 +268,6 @@ public class DbOrderServiceImpl implements IDbOrderService { ...@@ -268,11 +268,6 @@ public class DbOrderServiceImpl implements IDbOrderService {
return TableDataInfo.build(result); return TableDataInfo.build(result);
} }
@Override
public Boolean createPay(DbOrderEditBo bo, LoginUser loginUser) {
return baseMapper.createPay(bo) > 0;
}
/** /**
* 下单 * 下单
* @param orderId 订单id * @param orderId 订单id
...@@ -287,6 +282,10 @@ public class DbOrderServiceImpl implements IDbOrderService { ...@@ -287,6 +282,10 @@ public class DbOrderServiceImpl implements IDbOrderService {
// 2.根据卡券id获取卡券信息 // 2.根据卡券id获取卡券信息
DbCoupon dbCoupon = couponMapper.selectById(couponId); DbCoupon dbCoupon = couponMapper.selectById(couponId);
// 3.计算应支付金额 // 3.计算应支付金额
if (dbCoupon.getMinUsed().compareTo(dbOrder.getActualAmount()) > 0){
throw new RuntimeException("未达到此优惠券的最低消费金额");
}
BigDecimal actualAmount = dbOrder.getActualAmount();
// 4.组装支付数据 // 4.组装支付数据
// 5.调用微信统一下单接口 // 5.调用微信统一下单接口
// 6.返回支付所需数据 // 6.返回支付所需数据
......
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