新增:余额支付接口
This commit is contained in:
@@ -36,23 +36,49 @@ public class RequestUtil {
|
||||
ACCESS_TOKEN = token;
|
||||
}
|
||||
|
||||
// 微信支付通知
|
||||
public void pushWxPayNotify(Transaction transaction){
|
||||
System.out.println("transaction = " + transaction);
|
||||
// 预付请求付款(余额支付)
|
||||
public Object balancePay(Order order){
|
||||
// 设置租户ID
|
||||
// setTenantId(payment.getTenantId().toString());
|
||||
// 推送支付通知地址
|
||||
// String path = payment.getNotifyUrl();
|
||||
setTenantId(order.getTenantId().toString());
|
||||
// 设置token
|
||||
setAccessToken(order.getAccessToken());
|
||||
// 余额支付接口
|
||||
String path = "/system/payment/balancePay";
|
||||
try {
|
||||
// 链式构建请求
|
||||
String result = HttpRequest.post("http://pxf4av.natappfree.cc/api/shop/wx-pay/nbg/paySuccess")
|
||||
.header("Tenantid", "10158")
|
||||
.body(JSONUtil.toJSONString(transaction))//表单内容
|
||||
final String body = HttpRequest.post(host.concat(path))
|
||||
.header("Tenantid", TENANT_ID)
|
||||
.header("Authorization", ACCESS_TOKEN)
|
||||
.body(JSONUtil.toJSONString(order))//表单内容
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
|
||||
return JSONUtil.parseObject(body, ApiResult.class).getData();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 微信支付通知
|
||||
public String pushWxPayNotify(Transaction transaction, Payment payment){
|
||||
// 设置租户ID
|
||||
setTenantId(payment.getTenantId().toString());
|
||||
// 推送支付通知地址
|
||||
String path = payment.getNotifyUrl();
|
||||
try {
|
||||
// 链式构建请求
|
||||
return HttpRequest.post(path)
|
||||
.header("Tenantid", TENANT_ID)
|
||||
.body(JSONUtil.toJSONString(transaction))//表单内容
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "支付失败";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,25 +36,25 @@ import java.util.stream.Collectors;
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/cart")
|
||||
public class CartController extends BaseController {
|
||||
@Resource
|
||||
private CartService cartService;
|
||||
@Resource
|
||||
private MerchantService merchantService;
|
||||
@Resource
|
||||
private CartService cartService;
|
||||
@Resource
|
||||
private MerchantService merchantService;
|
||||
|
||||
@ApiOperation("我的购物车")
|
||||
@GetMapping("/myCart")
|
||||
public ApiResult<?> myCart(CartParam param){
|
||||
HashMap<String, Object> map = computeCart(param);
|
||||
@ApiOperation("我的购物车")
|
||||
@GetMapping("/myCart")
|
||||
public ApiResult<?> myCart(CartParam param) {
|
||||
HashMap<String, Object> map = computeCart(param);
|
||||
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser == null) {
|
||||
return fail("请先登录",null);
|
||||
}
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser == null) {
|
||||
return fail("请先登录", null);
|
||||
}
|
||||
|
||||
// 查询购物车
|
||||
param.setUserId(loginUser.getUserId());
|
||||
final List<Cart> carts = cartService.listRelMpj(param);
|
||||
// 查询购物车
|
||||
param.setUserId(loginUser.getUserId());
|
||||
final List<Cart> carts = cartService.listRelMpj(param);
|
||||
|
||||
// final List<Cart> carts = cartService.list(new LambdaQueryWrapper<Cart>()
|
||||
// .eq(Cart::getUserId, loginUser.getUserId())
|
||||
@@ -63,163 +63,177 @@ public class CartController extends BaseController {
|
||||
// .eq(Cart::getDeleted, 0)
|
||||
// .last("limit 100"));
|
||||
|
||||
// 收集店铺ID
|
||||
final Set<Integer> merchantIds = carts.stream().map(Cart::getMerchantId).collect(Collectors.toSet());
|
||||
if (CollectionUtils.isEmpty(merchantIds)) {
|
||||
map.put("selectAll",false);
|
||||
return success(map);
|
||||
}
|
||||
|
||||
// 查询店铺列
|
||||
final List<Merchant> merchants = merchantService.list(new LambdaQueryWrapper<Merchant>()
|
||||
.select(Merchant::getMerchantId,Merchant::getMerchantName,Merchant::getImage,Merchant::getShopType, Merchant::getAddress)
|
||||
.in(Merchant::getMerchantId, merchantIds));
|
||||
|
||||
// 返回空列表
|
||||
if (CollectionUtils.isEmpty(merchants)) {
|
||||
return success(merchants);
|
||||
}
|
||||
|
||||
final Map<Integer, List<Cart>> collect = carts.stream().collect(Collectors.groupingBy(Cart::getMerchantId));
|
||||
|
||||
// 封装数据
|
||||
merchants.forEach(d -> {
|
||||
d.setCarts(collect.get(d.getMerchantId()));
|
||||
});
|
||||
|
||||
// 计算购物车金额
|
||||
map.put("merchants",merchants);
|
||||
|
||||
// 收集店铺ID
|
||||
final Set<Integer> merchantIds = carts.stream().map(Cart::getMerchantId).collect(Collectors.toSet());
|
||||
if (CollectionUtils.isEmpty(merchantIds)) {
|
||||
map.put("selectAll", false);
|
||||
return success(map);
|
||||
}
|
||||
|
||||
@ApiOperation("添加购物车")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Cart cart) {
|
||||
// 查询店铺列
|
||||
final List<Merchant> merchants = merchantService.list(new LambdaQueryWrapper<Merchant>()
|
||||
.select(Merchant::getMerchantId, Merchant::getMerchantName, Merchant::getImage, Merchant::getShopType, Merchant::getAddress)
|
||||
.in(Merchant::getMerchantId, merchantIds));
|
||||
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser == null) {
|
||||
return fail("请先登录");
|
||||
}
|
||||
|
||||
// 查询参数
|
||||
final CartParam param = new CartParam();
|
||||
param.setType(cart.getType());
|
||||
|
||||
// 购物车是否已存在
|
||||
final Cart item = cartService.getOne(new LambdaQueryWrapper<Cart>()
|
||||
.eq(Cart::getUserId, loginUser.getUserId())
|
||||
.eq(Cart::getGoodsId, cart.getGoodsId())
|
||||
.eq(Cart::getType,cart.getType())
|
||||
.last("limit 1"));
|
||||
|
||||
cart.setUserId(loginUser.getUserId());
|
||||
// 字段验证
|
||||
if(cart.getCartNum() == null){
|
||||
return fail("购买数量不能为空");
|
||||
}
|
||||
|
||||
System.out.println("cart = " + cart);
|
||||
|
||||
// 修改购物车
|
||||
if (item != null) {
|
||||
item.setCartNum(item.getCartNum() + cart.getCartNum());
|
||||
cartService.updateById(item);
|
||||
|
||||
return success("添加成功",computeCart(param));
|
||||
}
|
||||
|
||||
// 新添加商品
|
||||
if (cartService.save(cart)) {
|
||||
return success("添加成功",computeCart(param));
|
||||
}
|
||||
|
||||
return fail("添加失败");
|
||||
// 返回空列表
|
||||
if (CollectionUtils.isEmpty(merchants)) {
|
||||
return success(merchants);
|
||||
}
|
||||
|
||||
@ApiOperation("修改购物车")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Cart cart) {
|
||||
if (cartService.updateById(cart)) {
|
||||
final CartParam param = new CartParam();
|
||||
param.setType(cart.getType());
|
||||
return success("修改成功",computeCart(param));
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
final Map<Integer, List<Cart>> collect = carts.stream().collect(Collectors.groupingBy(Cart::getMerchantId));
|
||||
|
||||
@ApiOperation("计算购物车金额")
|
||||
@GetMapping("/count")
|
||||
public HashMap<String, Object> computeCart(CartParam param) {
|
||||
final LambdaQueryWrapper<Cart> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// 封装数据
|
||||
merchants.forEach(d -> {
|
||||
d.setCarts(collect.get(d.getMerchantId()));
|
||||
});
|
||||
|
||||
queryWrapper.select(Cart::getId,Cart::getPrice,Cart::getCartNum)
|
||||
.eq(Cart::getUserId, getLoginUserId())
|
||||
.eq(Cart::getType,param.getType())
|
||||
.eq(Cart::getSelected,1)
|
||||
.eq(Cart::getIsPay, 0);
|
||||
// 计算购物车金额
|
||||
map.put("merchants", merchants);
|
||||
|
||||
// 查询购物车数据
|
||||
final List<Cart> carts = cartService.list(queryWrapper);
|
||||
return success(map);
|
||||
}
|
||||
|
||||
// 计算单品合计价格
|
||||
carts.forEach(d -> {
|
||||
d.setTotalPrice(d.getPrice().multiply(BigDecimal.valueOf(d.getCartNum())));
|
||||
});
|
||||
@ApiOperation("添加购物车")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Cart cart) {
|
||||
|
||||
// 保存到数据库
|
||||
cartService.updateBatchById(carts);
|
||||
|
||||
// 计算购物车金额
|
||||
final Integer reduce = carts.stream().map(Cart::getCartNum).reduce(Integer::sum).orElse(0);
|
||||
final BigDecimal reduced = carts.stream().map(Cart::getTotalPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
// 是否全选
|
||||
Boolean selectAll = cartService.count(new LambdaQueryWrapper<Cart>()
|
||||
.eq(Cart::getUserId, getLoginUserId())
|
||||
.eq(Cart::getSelected, 0)
|
||||
.eq(Cart::getIsPay, 0)
|
||||
) == 0;
|
||||
|
||||
|
||||
// 返回给前端
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("totalCartNum",reduce);
|
||||
map.put("totalPrice",reduced);
|
||||
map.put("selectAll",selectAll);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@ApiOperation("全选操作")
|
||||
@PutMapping("/onSelectAll/{yes}")
|
||||
public ApiResult<?> onSelectAll(@PathVariable("yes") Boolean yes) {
|
||||
final CartParam param = new CartParam();
|
||||
param.setType(0);
|
||||
|
||||
// 是否全选
|
||||
if (yes.equals(true)) {
|
||||
// 全勾选
|
||||
cartService.update(new LambdaUpdateWrapper<Cart>()
|
||||
.eq(Cart::getUserId, getLoginUserId())
|
||||
.eq(Cart::getIsPay, 0)
|
||||
.eq(Cart::getSelected,0)
|
||||
.set(Cart::getSelected,1)
|
||||
);
|
||||
return success("修改成功",computeCart(param));
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser == null) {
|
||||
return fail("请先登录");
|
||||
}
|
||||
// 全不勾选
|
||||
// 附加用户ID
|
||||
cart.setUserId(loginUser.getUserId());
|
||||
|
||||
// 字段验证
|
||||
if (cart.getCartNum() == null) {
|
||||
return fail("购买数量不能为空");
|
||||
}
|
||||
|
||||
// 立即购买按钮
|
||||
if(cart.getIsNew() != null && cart.getIsNew()){
|
||||
cartService.save(cart);
|
||||
return success(cart);
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<Cart> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (cart.getIsNew() != null) {
|
||||
queryWrapper.eq(Cart::getIsNew,cart.getIsNew());
|
||||
}
|
||||
|
||||
// 购物车是否已存在
|
||||
queryWrapper.eq(Cart::getUserId, loginUser.getUserId())
|
||||
.eq(Cart::getGoodsId, cart.getGoodsId())
|
||||
.eq(Cart::getType, cart.getType())
|
||||
.last("limit 1");
|
||||
|
||||
Cart item = cartService.getOne(queryWrapper);
|
||||
|
||||
// 查询购物车的参数
|
||||
final CartParam param = new CartParam();
|
||||
param.setType(cart.getType());
|
||||
if (cart.getIsNew() != null) {
|
||||
param.setIsNew(cart.getIsNew());
|
||||
}
|
||||
|
||||
// 重复商品叠加数量
|
||||
if(item != null){
|
||||
System.out.println("item = " + item);
|
||||
item.setCartNum(item.getCartNum() + cart.getCartNum());
|
||||
if (cartService.updateById(item)) {
|
||||
return success("更新成功", computeCart(param));
|
||||
}
|
||||
}
|
||||
|
||||
// 新添加商品
|
||||
if (cartService.save(cart)) {
|
||||
return success("添加成功", computeCart(param));
|
||||
}
|
||||
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改购物车")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Cart cart) {
|
||||
if (cartService.updateById(cart)) {
|
||||
final CartParam param = new CartParam();
|
||||
param.setType(cart.getType());
|
||||
return success("修改成功", computeCart(param));
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("计算购物车金额")
|
||||
@GetMapping("/count")
|
||||
public HashMap<String, Object> computeCart(CartParam param) {
|
||||
final LambdaQueryWrapper<Cart> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
queryWrapper.select(Cart::getId, Cart::getPrice, Cart::getCartNum)
|
||||
.eq(Cart::getUserId, getLoginUserId())
|
||||
.eq(Cart::getType, param.getType())
|
||||
.eq(Cart::getSelected, 1)
|
||||
.eq(Cart::getIsPay, 0);
|
||||
|
||||
// 查询购物车数据
|
||||
final List<Cart> carts = cartService.list(queryWrapper);
|
||||
|
||||
// 计算单品合计价格
|
||||
carts.forEach(d -> {
|
||||
d.setTotalPrice(d.getPrice().multiply(BigDecimal.valueOf(d.getCartNum())));
|
||||
});
|
||||
|
||||
// 保存到数据库
|
||||
cartService.updateBatchById(carts);
|
||||
|
||||
// 计算购物车金额
|
||||
final Integer reduce = carts.stream().map(Cart::getCartNum).reduce(Integer::sum).orElse(0);
|
||||
final BigDecimal reduced = carts.stream().map(Cart::getTotalPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
// 是否全选
|
||||
Boolean selectAll = cartService.count(new LambdaQueryWrapper<Cart>()
|
||||
.eq(Cart::getUserId, getLoginUserId())
|
||||
.eq(Cart::getSelected, 0)
|
||||
.eq(Cart::getIsPay, 0)
|
||||
) == 0;
|
||||
|
||||
|
||||
// 返回给前端
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("totalCartNum", reduce);
|
||||
map.put("totalPrice", reduced);
|
||||
map.put("selectAll", selectAll);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@ApiOperation("全选操作")
|
||||
@PutMapping("/onSelectAll/{yes}")
|
||||
public ApiResult<?> onSelectAll(@PathVariable("yes") Boolean yes) {
|
||||
final CartParam param = new CartParam();
|
||||
param.setType(0);
|
||||
|
||||
// 是否全选
|
||||
if (yes.equals(true)) {
|
||||
// 全勾选
|
||||
cartService.update(new LambdaUpdateWrapper<Cart>()
|
||||
.eq(Cart::getUserId, getLoginUserId())
|
||||
.eq(Cart::getIsPay, 0)
|
||||
.eq(Cart::getSelected,1)
|
||||
.set(Cart::getSelected,0)
|
||||
.eq(Cart::getSelected, 0)
|
||||
.set(Cart::getSelected, 1)
|
||||
);
|
||||
return success("修改成功",computeCart(param));
|
||||
return success("修改成功", computeCart(param));
|
||||
}
|
||||
|
||||
|
||||
// 全不勾选
|
||||
cartService.update(new LambdaUpdateWrapper<Cart>()
|
||||
.eq(Cart::getUserId, getLoginUserId())
|
||||
.eq(Cart::getIsPay, 0)
|
||||
.eq(Cart::getSelected, 1)
|
||||
.set(Cart::getSelected, 0)
|
||||
);
|
||||
return success("修改成功", computeCart(param));
|
||||
}
|
||||
|
||||
|
||||
// @ApiOperation("按店铺ID更新选择状态")
|
||||
@@ -233,62 +247,62 @@ public class CartController extends BaseController {
|
||||
// }
|
||||
|
||||
|
||||
@ApiOperation("分页查询购物车")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Cart>> page(CartParam param) {
|
||||
// 使用关联查询
|
||||
return success(cartService.pageRel(param));
|
||||
}
|
||||
@ApiOperation("分页查询购物车")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Cart>> page(CartParam param) {
|
||||
// 使用关联查询
|
||||
return success(cartService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部购物车")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Cart>> list(CartParam param) {
|
||||
// 使用关联查询
|
||||
return success(cartService.listRel(param));
|
||||
}
|
||||
@ApiOperation("查询全部购物车")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Cart>> list(CartParam param) {
|
||||
// 使用关联查询
|
||||
return success(cartService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:cart:list')")
|
||||
@ApiOperation("根据id查询购物车")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Cart> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cartService.getByIdRel(id));
|
||||
}
|
||||
@PreAuthorize("hasAuthority('shop:cart:list')")
|
||||
@ApiOperation("根据id查询购物车")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Cart> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cartService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("删除购物车")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cartService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
@ApiOperation("删除购物车")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cartService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加购物车")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Cart> list) {
|
||||
if (cartService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
@ApiOperation("批量添加购物车")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Cart> list) {
|
||||
if (cartService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改购物车")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Cart> batchParam) {
|
||||
if (batchParam.update(cartService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
@ApiOperation("批量修改购物车")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Cart> batchParam) {
|
||||
if (batchParam.update(cartService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除购物车")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cartService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
@ApiOperation("批量删除购物车")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cartService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ public class OrderController extends BaseController {
|
||||
// TODO 余额支付
|
||||
if (order.getPayType().equals(0)) {
|
||||
order.setAccessToken(order.getAccessToken());
|
||||
return success("下单成功", orderService.payByBalance(order));
|
||||
return success("下单成功", requestUtil.balancePay(order));
|
||||
}
|
||||
|
||||
// TODO 微信统一下单接口
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Api(tags = "微信支付结果通知")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/wx-pay/nbg")
|
||||
@RequestMapping("/api/shop/wx-pay/notify/nbg")
|
||||
public class WxPayNotifyNbgController extends BaseController {
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@@ -52,7 +52,7 @@ public class WxPayNotifyNbgController extends BaseController {
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@ApiModelProperty("微信支付通知")
|
||||
@PostMapping("/notify")
|
||||
@PostMapping()
|
||||
public String demo(@RequestBody Transaction transaction){
|
||||
|
||||
System.out.println("支付通知 >>>>> ");
|
||||
|
||||
@@ -66,6 +66,9 @@ public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements Ca
|
||||
if(param.getType() != null){
|
||||
mpjLambdaWrapper.eq(Cart::getType,param.getType());
|
||||
}
|
||||
if(param.getIsNew() != null){
|
||||
mpjLambdaWrapper.eq(Cart::getIsNew,param.getIsNew());
|
||||
}
|
||||
|
||||
return baseMapper.selectJoinList(Cart.class, mpjLambdaWrapper);
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
.select(GoodsSpec::getSpecValue)
|
||||
.select(GoodsSpec::getSpecName)
|
||||
.leftJoin(GoodsSpec.class,GoodsSpec::getGoodsId,GoodsSpec::getGoodsId)
|
||||
.gt(Goods::getStock,0)
|
||||
.eq(Goods::getType,0);
|
||||
return baseMapper.selectJoinList(Goods.class, mpjLambdaWrapper);
|
||||
}
|
||||
@@ -135,6 +136,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
||||
.select(GoodsSpec::getSpecValue)
|
||||
.select(GoodsSpec::getSpecName)
|
||||
.leftJoin(GoodsSpec.class,GoodsSpec::getGoodsId,GoodsSpec::getGoodsId)
|
||||
.gt(Goods::getStock,0)
|
||||
.eq(Goods::getType,1);
|
||||
return baseMapper.selectJoinList(Goods.class, mpjLambdaWrapper);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ import com.gxwebsoft.shop.param.OrderParam;
|
||||
import com.gxwebsoft.shop.service.*;
|
||||
import com.wechat.pay.java.core.Config;
|
||||
import com.wechat.pay.java.core.RSAConfig;
|
||||
import com.gxwebsoft.common.system.entity.Payment;
|
||||
import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
|
||||
import com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension;
|
||||
import com.wechat.pay.java.service.payments.jsapi.model.Amount;
|
||||
import com.wechat.pay.java.service.payments.jsapi.model.Payer;
|
||||
|
||||
Reference in New Issue
Block a user