Initial commit

This commit is contained in:
南宁网宿科技
2023-06-03 23:56:49 +08:00
commit 912944faea
821 changed files with 74279 additions and 0 deletions
@@ -0,0 +1,25 @@
package com.gxwebsoft.shop.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@Configuration
@PropertySource("classpath:express.properties")
@ConfigurationProperties(prefix = "express")
@Data
public class ExpressConfig {
// 开发者ID
private Long devId;
// 开发者密钥
private String devKey;
// 店铺ID
private String shopId;
// 加密签名
private String sign;
// 顺丰IP地址
private String serverHost;
}
@@ -0,0 +1,38 @@
package com.gxwebsoft.shop.config;
import cn.hutool.crypto.PemUtil;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import java.security.PrivateKey;
@Configuration
@PropertySource("classpath:wxpay.properties")
@ConfigurationProperties(prefix = "wxpay")
@Data
public class WxPayConfig {
// 商户号
private String mchId;
// 证书序列号
private String mchSerialNo;
// 商户私钥文件
private String privateKeyPath;
// APIv3秘钥
private String apiV3Key;
// APPID
private String appId;
// 微信服务器地址
private String domain;
// 接受结果通知地址
private String notifyDomain;
}
@@ -0,0 +1,14 @@
package com.gxwebsoft.shop.constants;
public class OrderConstants {
// 订单来源 10普通订单 20砍价订单 30秒杀订单
public static final Integer ORDER_SOURCE = 10; // 普通订单
public static final Integer ORDER_SOURCE_BARGAIN = 20; // 砍价订单
public static final Integer ORDER_SOURCE_SHARP= 30; // 秒杀订单
// 订单商品
public static final Integer ORDER_GOODS_DELIVERY_STATUS10 = 10; // 未发货
public static final Integer ORDER_GOODS_DELIVERY_STATUS20 = 20; // 已发货
public static final Integer ORDER_GOODS_DELIVERY_STATUS30 = 30; // 部分发货
}
@@ -0,0 +1,148 @@
package com.gxwebsoft.shop.controller;
import cn.hutool.core.bean.BeanUtil;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.*;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.entity.Cart;
import com.gxwebsoft.shop.param.CartParam;
import com.gxwebsoft.shop.service.CartService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* 购物车记录表控制器
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
@Api(tags = "购物车记录表管理")
@RestController
@RequestMapping("/api/shop/cart")
public class CartController extends BaseController {
@Resource
private CartService cartService;
@Resource
private StringRedisTemplate stringRedisTemplate;
@PreAuthorize("hasAuthority('shop:cart:list')")
@OperationLog
@ApiOperation("分页查询购物车记录表")
@GetMapping("/page")
public ApiResult<PageResult<Cart>> page(CartParam param) {
PageParam<Cart, CartParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(cartService.page(page, page.getWrapper()));
// 使用关联查询
//return success(cartService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:cart:list')")
@OperationLog
@ApiOperation("查询全部购物车记录表")
@GetMapping()
public ApiResult<List<Cart>> list(CartParam param) {
// PageParam<Cart, CartParam> page = new PageParam<>(param);
// page.setDefaultOrder("create_time desc");
// return success(cartService.list(page.getOrderWrapper()));
// 使用关联查询
return success(cartService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:cart:list')")
@OperationLog
@ApiOperation("根据id查询购物车记录表")
@GetMapping("/{id}")
public ApiResult<Cart> get(@PathVariable("id") Integer id) {
return success(cartService.getById(id));
// 使用关联查询
//return success(cartService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:cart:save')")
@OperationLog
@ApiOperation("添加购物车记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Cart cart) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
// 存入redis
Map<String,Object> userMap = BeanUtil.beanToMap(loginUser);
String userMapKey = "oa:cart:".concat(loginUser.getUserId().toString());
stringRedisTemplate.opsForHash().putAll(userMapKey,userMap);
stringRedisTemplate.expire(userMapKey,30, TimeUnit.MINUTES);
if (loginUser != null) {
cart.setUserId(loginUser.getUserId());
}
if (cartService.save(cart)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:cart:update')")
@OperationLog
@ApiOperation("修改购物车记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Cart cart) {
if (cartService.updateById(cart)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:cart:remove')")
@OperationLog
@ApiOperation("删除购物车记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (cartService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:cart:save')")
@OperationLog
@ApiOperation("批量添加购物车记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Cart> list) {
if (cartService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:cart:update')")
@OperationLog
@ApiOperation("批量修改购物车记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Cart> batchParam) {
if (batchParam.update(cartService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:cart:remove')")
@OperationLog
@ApiOperation("批量删除购物车记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (cartService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,141 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.CategoryService;
import com.gxwebsoft.shop.entity.Category;
import com.gxwebsoft.shop.param.CategoryParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 商品分类表控制器
*
* @author 科技小王子
* @since 2022-11-22 17:45:37
*/
@Api(tags = "商品分类表管理")
@RestController
@RequestMapping("/api/shop/category")
public class CategoryController extends BaseController {
@Resource
private CategoryService categoryService;
@PreAuthorize("hasAuthority('shop:category:list')")
@OperationLog
@ApiOperation("分页查询商品分类表")
@GetMapping("/page")
public ApiResult<PageResult<Category>> page(CategoryParam param) {
PageParam<Category, CategoryParam> page = new PageParam<>(param);
// page.setDefaultOrder("create_time desc");
page.setDefaultOrder("sort_number");
return success(categoryService.page(page, page.getWrapper()));
// 使用关联查询
//return success(categoryService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:category:list')")
@OperationLog
@ApiOperation("查询全部商品分类表")
@GetMapping()
public ApiResult<List<Category>> list(CategoryParam param) {
PageParam<Category, CategoryParam> page = new PageParam<>(param);
// page.setDefaultOrder("create_time desc");
page.setDefaultOrder("sort_number");
return success(categoryService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(categoryService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:category:list')")
@OperationLog
@ApiOperation("根据id查询商品分类表")
@GetMapping("/{id}")
public ApiResult<Category> get(@PathVariable("id") Integer id) {
return success(categoryService.getById(id));
// 使用关联查询
//return success(categoryService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:category:save')")
@OperationLog
@ApiOperation("添加商品分类表")
@PostMapping()
public ApiResult<?> save(@RequestBody Category category) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
category.setUserId(loginUser.getUserId());
}
if (categoryService.save(category)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:category:update')")
@OperationLog
@ApiOperation("修改商品分类表")
@PutMapping()
public ApiResult<?> update(@RequestBody Category category) {
if (categoryService.updateById(category)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:category:remove')")
@OperationLog
@ApiOperation("删除商品分类表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (categoryService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:category:save')")
@OperationLog
@ApiOperation("批量添加商品分类表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Category> list) {
if (categoryService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:category:update')")
@OperationLog
@ApiOperation("批量修改商品分类表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Category> batchParam) {
if (batchParam.update(categoryService, "category_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:category:remove')")
@OperationLog
@ApiOperation("批量删除商品分类表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (categoryService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,139 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.CommentService;
import com.gxwebsoft.shop.entity.Comment;
import com.gxwebsoft.shop.param.CommentParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 商品评价记录表控制器
*
* @author 科技小王子
* @since 2022-11-23 21:18:56
*/
@Api(tags = "商品评价记录表管理")
@RestController
@RequestMapping("/api/shop/comment")
public class CommentController extends BaseController {
@Resource
private CommentService commentService;
@PreAuthorize("hasAuthority('shop:comment:list')")
@OperationLog
@ApiOperation("分页查询商品评价记录表")
@GetMapping("/page")
public ApiResult<PageResult<Comment>> page(CommentParam param) {
PageParam<Comment, CommentParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(commentService.page(page, page.getWrapper()));
// 使用关联查询
//return success(commentService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:comment:list')")
@OperationLog
@ApiOperation("查询全部商品评价记录表")
@GetMapping()
public ApiResult<List<Comment>> list(CommentParam param) {
PageParam<Comment, CommentParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(commentService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(commentService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:comment:list')")
@OperationLog
@ApiOperation("根据id查询商品评价记录表")
@GetMapping("/{id}")
public ApiResult<Comment> get(@PathVariable("id") Integer id) {
return success(commentService.getById(id));
// 使用关联查询
//return success(commentService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:comment:save')")
@OperationLog
@ApiOperation("添加商品评价记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Comment comment) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
comment.setUserId(loginUser.getUserId());
}
if (commentService.save(comment)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:comment:update')")
@OperationLog
@ApiOperation("修改商品评价记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Comment comment) {
if (commentService.updateById(comment)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:comment:remove')")
@OperationLog
@ApiOperation("删除商品评价记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (commentService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:comment:save')")
@OperationLog
@ApiOperation("批量添加商品评价记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Comment> list) {
if (commentService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:comment:update')")
@OperationLog
@ApiOperation("批量修改商品评价记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Comment> batchParam) {
if (batchParam.update(commentService, "comment_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:comment:remove')")
@OperationLog
@ApiOperation("批量删除商品评价记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (commentService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,139 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.CouponService;
import com.gxwebsoft.shop.entity.Coupon;
import com.gxwebsoft.shop.param.CouponParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 优惠券记录表控制器
*
* @author 科技小王子
* @since 2022-11-28 18:26:05
*/
@Api(tags = "优惠券记录表管理")
@RestController
@RequestMapping("/api/shop/coupon")
public class CouponController extends BaseController {
@Resource
private CouponService couponService;
@PreAuthorize("hasAuthority('shop:coupon:list')")
@OperationLog
@ApiOperation("分页查询优惠券记录表")
@GetMapping("/page")
public ApiResult<PageResult<Coupon>> page(CouponParam param) {
PageParam<Coupon, CouponParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(couponService.page(page, page.getWrapper()));
// 使用关联查询
//return success(couponService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:coupon:list')")
@OperationLog
@ApiOperation("查询全部优惠券记录表")
@GetMapping()
public ApiResult<List<Coupon>> list(CouponParam param) {
PageParam<Coupon, CouponParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(couponService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(couponService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:coupon:list')")
@OperationLog
@ApiOperation("根据id查询优惠券记录表")
@GetMapping("/{id}")
public ApiResult<Coupon> get(@PathVariable("id") Integer id) {
return success(couponService.getById(id));
// 使用关联查询
//return success(couponService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:coupon:save')")
@OperationLog
@ApiOperation("添加优惠券记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Coupon coupon) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
coupon.setUserId(loginUser.getUserId());
}
if (couponService.save(coupon)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:coupon:update')")
@OperationLog
@ApiOperation("修改优惠券记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Coupon coupon) {
if (couponService.updateById(coupon)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:coupon:remove')")
@OperationLog
@ApiOperation("删除优惠券记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (couponService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:coupon:save')")
@OperationLog
@ApiOperation("批量添加优惠券记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Coupon> list) {
if (couponService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:coupon:update')")
@OperationLog
@ApiOperation("批量修改优惠券记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Coupon> batchParam) {
if (batchParam.update(couponService, "coupon_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:coupon:remove')")
@OperationLog
@ApiOperation("批量删除优惠券记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (couponService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,139 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.ExpressService;
import com.gxwebsoft.shop.entity.Express;
import com.gxwebsoft.shop.param.ExpressParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 物流公司记录表控制器
*
* @author 科技小王子
* @since 2022-11-22 00:21:07
*/
@Api(tags = "物流公司记录表管理")
@RestController
@RequestMapping("/api/shop/express")
public class ExpressController extends BaseController {
@Resource
private ExpressService expressService;
@PreAuthorize("hasAuthority('shop:express:list')")
@OperationLog
@ApiOperation("分页查询物流公司记录表")
@GetMapping("/page")
public ApiResult<PageResult<Express>> page(ExpressParam param) {
PageParam<Express, ExpressParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(expressService.page(page, page.getWrapper()));
// 使用关联查询
//return success(expressService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:express:list')")
@OperationLog
@ApiOperation("查询全部物流公司记录表")
@GetMapping()
public ApiResult<List<Express>> list(ExpressParam param) {
PageParam<Express, ExpressParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(expressService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(expressService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:express:list')")
@OperationLog
@ApiOperation("根据id查询物流公司记录表")
@GetMapping("/{id}")
public ApiResult<Express> get(@PathVariable("id") Integer id) {
return success(expressService.getById(id));
// 使用关联查询
//return success(expressService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:express:save')")
@OperationLog
@ApiOperation("添加物流公司记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Express express) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
express.setUserId(loginUser.getUserId());
}
if (expressService.save(express)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:express:update')")
@OperationLog
@ApiOperation("修改物流公司记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Express express) {
if (expressService.updateById(express)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:express:remove')")
@OperationLog
@ApiOperation("删除物流公司记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (expressService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:express:save')")
@OperationLog
@ApiOperation("批量添加物流公司记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Express> list) {
if (expressService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:express:update')")
@OperationLog
@ApiOperation("批量修改物流公司记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Express> batchParam) {
if (batchParam.update(expressService, "express_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:express:remove')")
@OperationLog
@ApiOperation("批量删除物流公司记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (expressService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,138 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.entity.Goods;
import com.gxwebsoft.shop.param.GoodsParam;
import com.gxwebsoft.shop.service.GoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 商品记录表控制器
*
* @author 科技小王子
* @since 2022-11-23 12:47:16
*/
@Api(tags = "商品记录表管理")
@RestController
@RequestMapping("/api/shop/goods")
public class GoodsController extends BaseController {
@Resource
private GoodsService goodsService;
@PreAuthorize("hasAuthority('shop:goods:list')")
@OperationLog
@ApiOperation("分页查询商品记录表")
@GetMapping("/page")
public ApiResult<PageResult<Goods>> page(GoodsParam param) {
// PageParam<Goods, GoodsParam> page = new PageParam<>(param);
// page.setDefaultOrder("create_time desc");
// return success(goodsService.page(page, page.getWrapper()));
// 使用关联查询
return success(goodsService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:goods:list')")
@OperationLog
@ApiOperation("查询全部商品记录表")
@GetMapping()
public ApiResult<List<Goods>> list(GoodsParam param) {
// PageParam<Goods, GoodsParam> page = new PageParam<>(param);
// page.setDefaultOrder("create_time desc");
// return success(goodsService.list(page.getOrderWrapper()));
// 使用关联查询
return success(goodsService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:goods:list')")
@OperationLog
@ApiOperation("根据id查询商品记录表")
@GetMapping("/{id}")
public ApiResult<Goods> get(@PathVariable("id") Integer id) {
return success(goodsService.getById(id));
// 使用关联查询
//return success(goodsService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:goods:save')")
@OperationLog
@ApiOperation("添加商品记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Goods goods) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
goods.setUserId(loginUser.getUserId());
}
if (goodsService.save(goods)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:goods:update')")
@OperationLog
@ApiOperation("修改商品记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Goods goods) {
if (goodsService.updateById(goods)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:goods:remove')")
@OperationLog
@ApiOperation("删除商品记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (goodsService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:goods:save')")
@OperationLog
@ApiOperation("批量添加商品记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Goods> list) {
if (goodsService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:goods:update')")
@OperationLog
@ApiOperation("批量修改商品记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Goods> batchParam) {
if (batchParam.update(goodsService, "goods_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:goods:remove')")
@OperationLog
@ApiOperation("批量删除商品记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (goodsService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,139 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.GoodsServiceService;
import com.gxwebsoft.shop.entity.GoodsService;
import com.gxwebsoft.shop.param.GoodsServiceParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 商品服务与承诺记录表控制器
*
* @author 科技小王子
* @since 2022-11-23 21:57:50
*/
@Api(tags = "商品服务与承诺记录表管理")
@RestController
@RequestMapping("/api/shop/goods-service")
public class GoodsServiceController extends BaseController {
@Resource
private GoodsServiceService goodsServiceService;
@PreAuthorize("hasAuthority('shop:goodsService:list')")
@OperationLog
@ApiOperation("分页查询商品服务与承诺记录表")
@GetMapping("/page")
public ApiResult<PageResult<GoodsService>> page(GoodsServiceParam param) {
PageParam<GoodsService, GoodsServiceParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time asc");
return success(goodsServiceService.page(page, page.getWrapper()));
// 使用关联查询
//return success(goodsServiceService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:goodsService:list')")
@OperationLog
@ApiOperation("查询全部商品服务与承诺记录表")
@GetMapping()
public ApiResult<List<GoodsService>> list(GoodsServiceParam param) {
PageParam<GoodsService, GoodsServiceParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(goodsServiceService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(goodsServiceService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:goodsService:list')")
@OperationLog
@ApiOperation("根据id查询商品服务与承诺记录表")
@GetMapping("/{id}")
public ApiResult<GoodsService> get(@PathVariable("id") Integer id) {
return success(goodsServiceService.getById(id));
// 使用关联查询
//return success(goodsServiceService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:goodsService:save')")
@OperationLog
@ApiOperation("添加商品服务与承诺记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody GoodsService goodsService) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
goodsService.setUserId(loginUser.getUserId());
}
if (goodsServiceService.save(goodsService)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:goodsService:update')")
@OperationLog
@ApiOperation("修改商品服务与承诺记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody GoodsService goodsService) {
if (goodsServiceService.updateById(goodsService)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:goodsService:remove')")
@OperationLog
@ApiOperation("删除商品服务与承诺记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (goodsServiceService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:goodsService:save')")
@OperationLog
@ApiOperation("批量添加商品服务与承诺记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<GoodsService> list) {
if (goodsServiceService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:goodsService:update')")
@OperationLog
@ApiOperation("批量修改商品服务与承诺记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsService> batchParam) {
if (batchParam.update(goodsServiceService, "service_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:goodsService:remove')")
@OperationLog
@ApiOperation("批量删除商品服务与承诺记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (goodsServiceService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,139 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.MemberService;
import com.gxwebsoft.shop.entity.Member;
import com.gxwebsoft.shop.param.MemberParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 商城会员控制器
*
* @author 科技小王子
* @since 2022-11-25 14:02:24
*/
@Api(tags = "商城会员管理")
@RestController
@RequestMapping("/api/shop/member")
public class MemberController extends BaseController {
@Resource
private MemberService memberService;
@PreAuthorize("hasAuthority('shop:member:list')")
@OperationLog
@ApiOperation("分页查询商城会员")
@GetMapping("/page")
public ApiResult<PageResult<Member>> page(MemberParam param) {
PageParam<Member, MemberParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
// return success(memberService.page(page, page.getWrapper()));
// 使用关联查询
return success(memberService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:member:list')")
@OperationLog
@ApiOperation("查询全部商城会员")
@GetMapping()
public ApiResult<List<Member>> list(MemberParam param) {
PageParam<Member, MemberParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
// return success(memberService.list(page.getOrderWrapper()));
// 使用关联查询
return success(memberService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:member:list')")
@OperationLog
@ApiOperation("根据id查询商城会员")
@GetMapping("/{id}")
public ApiResult<Member> get(@PathVariable("id") Integer id) {
return success(memberService.getById(id));
// 使用关联查询
//return success(memberService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:member:save')")
@OperationLog
@ApiOperation("添加商城会员")
@PostMapping()
public ApiResult<?> save(@RequestBody Member member) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
member.setUserId(loginUser.getUserId());
}
if (memberService.save(member)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:member:update')")
@OperationLog
@ApiOperation("修改商城会员")
@PutMapping()
public ApiResult<?> update(@RequestBody Member member) {
if (memberService.updateById(member)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:member:remove')")
@OperationLog
@ApiOperation("删除商城会员")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (memberService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:member:save')")
@OperationLog
@ApiOperation("批量添加商城会员")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Member> list) {
if (memberService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:member:update')")
@OperationLog
@ApiOperation("批量修改商城会员")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Member> batchParam) {
if (batchParam.update(memberService, "member_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:member:remove')")
@OperationLog
@ApiOperation("批量删除商城会员")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (memberService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,147 @@
package com.gxwebsoft.shop.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.shop.service.MerchantClerkService;
import com.gxwebsoft.shop.entity.MerchantClerk;
import com.gxwebsoft.shop.param.MerchantClerkParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 商家门店店员表控制器
*
* @author 科技小王子
* @since 2022-11-30 16:32:25
*/
@Api(tags = "商家门店店员表管理")
@RestController
@RequestMapping("/api/shop/merchant-clerk")
public class MerchantClerkController extends BaseController {
@Resource
private MerchantClerkService merchantClerkService;
@Resource
private UserService userService;
@PreAuthorize("hasAuthority('shop:merchantClerk:list')")
@OperationLog
@ApiOperation("分页查询商家门店店员表")
@GetMapping("/page")
public ApiResult<PageResult<MerchantClerk>> page(MerchantClerkParam param) {
PageParam<MerchantClerk, MerchantClerkParam> page = new PageParam<>(param);
// page.setDefaultOrder("create_time desc");
// return success(merchantClerkService.page(page, page.getWrapper()));
// 使用关联查询
return success(merchantClerkService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:merchantClerk:list')")
@OperationLog
@ApiOperation("查询全部商家门店店员表")
@GetMapping()
public ApiResult<List<MerchantClerk>> list(MerchantClerkParam param) {
PageParam<MerchantClerk, MerchantClerkParam> page = new PageParam<>(param);
// page.setDefaultOrder("create_time desc");
// return success(merchantClerkService.list(page.getOrderWrapper()));
// 使用关联查询
return success(merchantClerkService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:merchantClerk:list')")
@OperationLog
@ApiOperation("根据id查询商家门店店员表")
@GetMapping("/{id}")
public ApiResult<MerchantClerk> get(@PathVariable("id") Integer id) {
return success(merchantClerkService.getById(id));
// 使用关联查询
//return success(merchantClerkService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:merchantClerk:save')")
@OperationLog
@ApiOperation("添加商家门店店员表")
@PostMapping()
public ApiResult<?> save(@RequestBody MerchantClerk merchantClerk) {
// 判断用户ID是否存在
User user = userService.getById(merchantClerk.getUserId());
if(user != null){
// 防止重复
if (merchantClerkService.count(new LambdaQueryWrapper<MerchantClerk>()
.eq(MerchantClerk::getUserId, merchantClerk.getUserId())) > 0) {
return fail("该用户已被绑定");
}
if (merchantClerkService.save(merchantClerk)) {
return success("添加成功");
}
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:merchantClerk:update')")
@OperationLog
@ApiOperation("修改商家门店店员表")
@PutMapping()
public ApiResult<?> update(@RequestBody MerchantClerk merchantClerk) {
if (merchantClerkService.updateById(merchantClerk)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:merchantClerk:remove')")
@OperationLog
@ApiOperation("删除商家门店店员表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (merchantClerkService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:merchantClerk:save')")
@OperationLog
@ApiOperation("批量添加商家门店店员表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<MerchantClerk> list) {
if (merchantClerkService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:merchantClerk:update')")
@OperationLog
@ApiOperation("批量修改商家门店店员表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<MerchantClerk> batchParam) {
if (batchParam.update(merchantClerkService, "clerk_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:merchantClerk:remove')")
@OperationLog
@ApiOperation("批量删除商家门店店员表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (merchantClerkService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,171 @@
package com.gxwebsoft.shop.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.utils.CacheClient;
import com.gxwebsoft.common.core.web.*;
import com.gxwebsoft.shop.entity.Merchant;
import com.gxwebsoft.shop.param.MerchantParam;
import com.gxwebsoft.shop.service.MerchantService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import static com.gxwebsoft.common.core.constants.RedisConstants.MERCHANT_GEO_KEY;
import static com.gxwebsoft.common.core.constants.RedisConstants.MERCHANT_KEY;
/**
* 商户管理控制器
*
* @author 科技小王子
* @since 2022-11-30 15:10:54
*/
@Api(tags = "商户管理管理")
@RestController
@RequestMapping("/api/shop/merchant")
public class MerchantController extends BaseController {
@Resource
private MerchantService merchantService;
@Resource
private CacheClient cacheClient;
@PreAuthorize("hasAuthority('shop:merchant:list')")
@ApiOperation("分页查询商户管理")
@GetMapping("/page")
public ApiResult<PageResult<Merchant>> page(MerchantParam param) {
// 搜索条件
if (getMerchantCode() != null) {
param.setMerchantCode(getMerchantCode());
}
// 使用关联查询
return success(merchantService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:merchant:list')")
@ApiOperation("查询全部商户管理")
@GetMapping()
public ApiResult<List<Merchant>> list(MerchantParam param) {
PageParam<Merchant, MerchantParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
// 使用关联查询
return success(merchantService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:merchant:list')")
@ApiOperation("根据id查询商户管理")
@GetMapping("/{id}")
public ApiResult<Merchant> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(merchantService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:merchant:save')")
@ApiOperation("添加商户管理")
@PostMapping()
public ApiResult<?> save(@RequestBody Merchant merchant) {
if (merchantService.count(new LambdaQueryWrapper<Merchant>()
.eq(Merchant::getMerchantCode, merchant.getMerchantCode())) > 0) {
return fail("商户编号已存在");
}
if (merchantService.save(merchant)) {
// 添加缓存
String lngAndLat = merchant.getLngAndLat();
String[] split = lngAndLat.split(",");
Double x = Double.parseDouble(split[0]);
Double y = Double.parseDouble(split[1]);
String id = merchant.getMerchantId().toString();
cacheClient.geoAdd(MERCHANT_GEO_KEY,x,y,id);
cacheClient.set(MERCHANT_KEY.concat(":").concat(merchant.getMerchantId().toString()),merchant);
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:merchant:update')")
@ApiOperation("修改商户管理")
@PutMapping()
public ApiResult<?> update(@RequestBody Merchant merchant) {
// 超级管理员不能设为店主
if(getLoginUser().getUserId().equals(merchant.getMerchantOwner())){
return fail("超级管理员不能绑定为负责人!");
}
if (merchantService.updateById(merchant)) {
// 添加缓存
String lngAndLat = merchant.getLngAndLat();
String[] split = lngAndLat.split(",");
Double x = Double.parseDouble(split[0]);
Double y = Double.parseDouble(split[1]);
String id = merchant.getMerchantId().toString();
cacheClient.geoAdd(MERCHANT_GEO_KEY,x,y,id);
cacheClient.geoAdd(MERCHANT_GEO_KEY,x,y,id);
cacheClient.set(MERCHANT_KEY.concat(":").concat(merchant.getMerchantId().toString()),merchant);
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:merchant:remove')")
@ApiOperation("删除商户管理")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (merchantService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:merchant:save')")
@ApiOperation("批量添加商户管理")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Merchant> list) {
if (merchantService.saveBatch(list)) {
list.forEach(d -> {
// 添加缓存
String lngAndLat = d.getLngAndLat();
String[] split = lngAndLat.split(",");
Double x = Double.parseDouble(split[0]);
Double y = Double.parseDouble(split[1]);
String id = d.getMerchantId().toString();
cacheClient.geoAdd(MERCHANT_GEO_KEY,x,y,id);
cacheClient.geoAdd(MERCHANT_GEO_KEY,x,y,id);
cacheClient.set(MERCHANT_KEY.concat(":").concat(d.getMerchantId().toString()),d);
});
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:merchant:update')")
@ApiOperation("批量修改商户管理")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Merchant> batchParam) {
if (batchParam.update(merchantService, "merchant_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:merchant:remove')")
@ApiOperation("批量删除商户管理")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (merchantService.removeByIds(ids)) {
// 删除缓存
ids.forEach(id -> {
cacheClient.geoRemove(MERCHANT_GEO_KEY,id);
});
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:merchant:list')")
@ApiOperation("根据定位查询附近的商户列表")
@PostMapping("/getListByGeo")
public ApiResult<List<Merchant>> getListByGeo(@RequestBody MerchantParam param) {
return success(merchantService.listByGeo(param));
}
}
@@ -0,0 +1,143 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.MerchantWithdrawService;
import com.gxwebsoft.shop.entity.MerchantWithdraw;
import com.gxwebsoft.shop.param.MerchantWithdrawParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 商户提现记录控制器
*
* @author 科技小王子
* @since 2022-12-02 00:41:09
*/
@Api(tags = "商户提现记录管理")
@RestController
@RequestMapping("/api/shop/merchant-withdraw")
public class MerchantWithdrawController extends BaseController {
@Resource
private MerchantWithdrawService merchantWithdrawService;
@PreAuthorize("hasAuthority('shop:merchantWithdraw:list')")
@OperationLog
@ApiOperation("分页查询商户提现记录")
@GetMapping("/page")
public ApiResult<PageResult<MerchantWithdraw>> page(MerchantWithdrawParam param) {
PageParam<MerchantWithdraw, MerchantWithdrawParam> page = new PageParam<>(param);
// 搜索条件
if (getMerchantCode() != null) {
param.setMerchantCode(getMerchantCode());
}
// page.setDefaultOrder("create_time desc");
// return success(merchantWithdrawService.page(page, page.getWrapper()));
// 使用关联查询
return success(merchantWithdrawService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:merchantWithdraw:list')")
@OperationLog
@ApiOperation("查询全部商户提现记录")
@GetMapping()
public ApiResult<List<MerchantWithdraw>> list(MerchantWithdrawParam param) {
PageParam<MerchantWithdraw, MerchantWithdrawParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(merchantWithdrawService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(merchantWithdrawService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:merchantWithdraw:list')")
@OperationLog
@ApiOperation("根据id查询商户提现记录")
@GetMapping("/{id}")
public ApiResult<MerchantWithdraw> get(@PathVariable("id") Integer id) {
return success(merchantWithdrawService.getById(id));
// 使用关联查询
//return success(merchantWithdrawService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:merchantWithdraw:save')")
@OperationLog
@ApiOperation("添加商户提现记录")
@PostMapping()
public ApiResult<?> save(@RequestBody MerchantWithdraw merchantWithdraw) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
merchantWithdraw.setUserId(loginUser.getUserId());
}
if (merchantWithdrawService.save(merchantWithdraw)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:merchantWithdraw:update')")
@OperationLog
@ApiOperation("修改商户提现记录")
@PutMapping()
public ApiResult<?> update(@RequestBody MerchantWithdraw merchantWithdraw) {
if (merchantWithdrawService.updateById(merchantWithdraw)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:merchantWithdraw:remove')")
@OperationLog
@ApiOperation("删除商户提现记录")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (merchantWithdrawService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:merchantWithdraw:save')")
@OperationLog
@ApiOperation("批量添加商户提现记录")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<MerchantWithdraw> list) {
if (merchantWithdrawService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:merchantWithdraw:update')")
@OperationLog
@ApiOperation("批量修改商户提现记录")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<MerchantWithdraw> batchParam) {
if (batchParam.update(merchantWithdrawService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:merchantWithdraw:remove')")
@OperationLog
@ApiOperation("批量删除商户提现记录")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (merchantWithdrawService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,140 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.OrderAddressService;
import com.gxwebsoft.shop.entity.OrderAddress;
import com.gxwebsoft.shop.param.OrderAddressParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 订单收货地址记录表控制器
*
* @author 科技小王子
* @since 2022-12-02 21:21:10
*/
@Api(tags = "订单收货地址记录表管理")
@RestController
@RequestMapping("/api/shop/order-address")
public class OrderAddressController extends BaseController {
@Resource
private OrderAddressService orderAddressService;
@PreAuthorize("hasAuthority('shop:orderAddress:list')")
@OperationLog
@ApiOperation("分页查询订单收货地址记录表")
@GetMapping("/page")
public ApiResult<PageResult<OrderAddress>> page(OrderAddressParam param) {
PageParam<OrderAddress, OrderAddressParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(orderAddressService.page(page, page.getWrapper()));
// 使用关联查询
//return success(orderAddressService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:orderAddress:list')")
@OperationLog
@ApiOperation("查询全部订单收货地址记录表")
@GetMapping()
public ApiResult<List<OrderAddress>> list(OrderAddressParam param) {
PageParam<OrderAddress, OrderAddressParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(orderAddressService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(orderAddressService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:orderAddress:list')")
@OperationLog
@ApiOperation("根据id查询订单收货地址记录表")
@GetMapping("/{id}")
public ApiResult<OrderAddress> get(@PathVariable("id") Integer id) {
return success(orderAddressService.getById(id));
// 使用关联查询
//return success(orderAddressService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:orderAddress:save')")
@OperationLog
@ApiOperation("添加订单收货地址记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody OrderAddress orderAddress) {
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
orderAddress.setUserId(loginUser.getUserId());
orderAddress.setMerchantCode(getMerchantCode());
}
if (orderAddressService.save(orderAddress)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:orderAddress:update')")
@OperationLog
@ApiOperation("修改订单收货地址记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody OrderAddress orderAddress) {
if (orderAddressService.updateById(orderAddress)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:orderAddress:remove')")
@OperationLog
@ApiOperation("删除订单收货地址记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (orderAddressService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:orderAddress:save')")
@OperationLog
@ApiOperation("批量添加订单收货地址记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<OrderAddress> list) {
if (orderAddressService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:orderAddress:update')")
@OperationLog
@ApiOperation("批量修改订单收货地址记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<OrderAddress> batchParam) {
if (batchParam.update(orderAddressService, "order_address_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:orderAddress:remove')")
@OperationLog
@ApiOperation("批量删除订单收货地址记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (orderAddressService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,320 @@
package com.gxwebsoft.shop.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.extra.qrcode.QrCodeUtil;
import cn.hutool.extra.qrcode.QrConfig;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.apps.entity.BcAgent;
import com.gxwebsoft.apps.entity.EquipmentGoods;
import com.gxwebsoft.apps.entity.EquipmentOrderGoods;
import com.gxwebsoft.apps.param.BcAgentParam;
import com.gxwebsoft.apps.service.BcAgentService;
import com.gxwebsoft.apps.service.EquipmentGoodsService;
import com.gxwebsoft.apps.service.EquipmentOrderGoodsService;
import com.gxwebsoft.apps.service.EquipmentService;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.*;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.shop.entity.Order;
import com.gxwebsoft.shop.entity.UserReferee;
import com.gxwebsoft.shop.param.OrderGoodsParam;
import com.gxwebsoft.shop.param.OrderParam;
import com.gxwebsoft.shop.service.OrderGoodsService;
import com.gxwebsoft.shop.service.OrderService;
import com.gxwebsoft.shop.service.UserRefereeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import static com.gxwebsoft.common.core.constants.OrderConstants.*;
/**
* 订单记录表控制器
*
* @author WebSoft
* @since 2022-11-16 11:25:58
*/
@Api(tags = "订单记录表管理")
@RestController
@RequestMapping("/api/shop/order")
public class OrderController extends BaseController {
@Resource
private OrderService orderService;
@Resource
private EquipmentGoodsService equipmentGoodsService;
@Resource
private EquipmentService equipmentService;
@Resource
private OrderGoodsService orderGoodsService;
@Resource
private EquipmentOrderGoodsService equipmentOrderGoodsService;
@Resource
private UserRefereeService userRefereeService;
@Resource
private UserService userService;
@Resource
private BcAgentService bcAgentService;
@PreAuthorize("hasAuthority('shop:order:list')")
@OperationLog
@ApiOperation("分页查询订单记录表")
@GetMapping("/page")
public ApiResult<PageResult<Order>> page(OrderParam param) {
// 搜索条件
if (getMerchantCode() != null) {
param.setMerchantCode(getMerchantCode());
}
// 云芯威项目查询关联设备
if(getTenantId().equals(6)){
// 查询订单的关联商品
List<Order> list = orderService.listRel(param);
// 查询订单的设备
for (Order order : list) {
final OrderGoodsParam orderGoodsParam = new OrderGoodsParam();
orderGoodsParam.setOrderId(order.getOrderId());
order.setGoodsList(orderGoodsService.listRel(orderGoodsParam));
order.setEquipmentGoods(equipmentOrderGoodsService.getOne(new LambdaQueryWrapper<EquipmentOrderGoods>().eq(EquipmentOrderGoods::getOrderId,order.getOrderId())));
order.setEquipment(equipmentService.getById(order.getEquipmentId()));
}
PageParam<Order, OrderParam> page = new PageParam<>(param);
return success(new PageResult<>(list, page.getTotal()));
}
// 贵港自然资源报餐
if(getTenantId().equals(10048) && getAppId() != null){
final BcAgentParam bcAgentParam = new BcAgentParam();
bcAgentParam.setParentId(getLoginUserId());
bcAgentParam.setLimit(100L);
final PageResult<BcAgent> result = bcAgentService.pageRel(bcAgentParam);
final Set<Integer> collect = result.getList().stream().map(BcAgent::getUserId).collect(Collectors.toSet());
collect.add(getLoginUserId());
param.setUserId(null);
param.setUserIds(collect);
return success(orderService.pageRel(param));
}
// 使用关联查询
return success(orderService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:order:list')")
@OperationLog
@ApiOperation("查询全部订单记录表")
@GetMapping()
public ApiResult<List<Order>> list(OrderParam param) {
// 使用关联查询
return success(orderService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:order:list')")
@OperationLog
@ApiOperation("按订单集查询")
@PostMapping("/listByIds")
public ApiResult<List<Order>> listByIds(@RequestBody List<Integer> orderIds) {
System.out.println("按订单集查询 = " + orderIds);
Integer userId = getLoginUserId();
// 代报餐情况(未完成)
final Order order = orderService.getById(orderIds.get(0));
if (!order.getUserId().equals(getLoginUserId())) {
userId = order.getUserId();
final List<Order> list1 = orderService.list(new LambdaQueryWrapper<Order>().in(Order::getOrderId,orderIds).eq(Order::getUserId, userId).eq(Order::getPayStatus,PAY_STATUS_NO_PAY));
final Set<Integer> collect = list1.stream().map(Order::getOrderId).collect(Collectors.toSet());
return success(orderService.listByIds(collect));
}
final List<Order> list1 = orderService.list(new LambdaQueryWrapper<Order>().eq(Order::getUserId, getLoginUserId()).eq(Order::getPayStatus,PAY_STATUS_NO_PAY));
final List<Integer> collect = list1.stream().map(Order::getOrderId).collect(Collectors.toList());
// 使用关联查询
return success(orderService.listByIds(collect));
}
@PreAuthorize("hasAuthority('shop:order:list')")
@OperationLog
@ApiOperation("根据id查询订单记录表")
@GetMapping("/{id}")
public ApiResult<Order> get(@PathVariable("id") Integer id) {
// 使用关联查询
Order order = orderService.getByIdRel(id);
// 云芯威关联设备查询
if (!order.getGoodsId().equals(0) || !order.getEquipmentId().equals(0)) {
order.setEquipmentGoods(equipmentOrderGoodsService.getOne(new LambdaQueryWrapper<EquipmentOrderGoods>().eq(EquipmentOrderGoods::getOrderId,order.getOrderId())));
order.setEquipment(equipmentService.getById(order.getEquipmentId()));
}
return success(order);
}
@PreAuthorize("hasAuthority('shop:order:save')")
@OperationLog
@ApiOperation("添加订单记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Order order) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
order.setUserId(loginUser.getUserId());
}
if (orderService.save(order)) {
// 云芯威BMS
if (order.getTenantId().equals(6)) {
final EquipmentGoods eg = equipmentGoodsService.getById(order.getOrderSourceId());
eg.setOrderId(order.getOrderId());
// 添加订单商品
final EquipmentOrderGoods oeg = new EquipmentOrderGoods();
oeg.setOrderId(order.getOrderId());
oeg.setGoodsName(eg.getGoodsName());
oeg.setEquipmentCategory(eg.getEquipmentCategory());
oeg.setImage(eg.getImage());
oeg.setCategoryId(eg.getCategoryId());
oeg.setBatteryModel(eg.getBatteryModel());
oeg.setSellingPoint(eg.getSellingPoint());
oeg.setStockTotal(eg.getStockTotal());
oeg.setContent(eg.getContent());
oeg.setBatteryPrice(eg.getBatteryPrice());
oeg.setBatteryRent(eg.getBatteryRent());
oeg.setBatteryInsurance(eg.getBatteryInsurance());
oeg.setBatteryDeposit(eg.getBatteryDeposit());
oeg.setDownPayment(eg.getDownPayment());
oeg.setPeriods(eg.getPeriods());
oeg.setRepayment(eg.getRepayment());
oeg.setServiceCharges(eg.getServiceCharges());
oeg.setPeriodsType(eg.getPeriodsType());
oeg.setUserId(eg.getUserId());
oeg.setComments(eg.getComments());
oeg.setStatus(eg.getStatus());
oeg.setMerchantCode(eg.getMerchantCode());
oeg.setTenantId(eg.getTenantId());
equipmentOrderGoodsService.saveOrUpdate(oeg);
// 添加推荐人关系
if (order.getDealerId() != null) {
final User dealer = userService.getById(order.getDealerId());
if(dealer == null){
return fail("推荐人的用户ID不存在");
}
final UserReferee referee = new UserReferee();
referee.setDealerId(order.getDealerId());
referee.setUserId(getLoginUserId());
userRefereeService.save(referee);
}
}
// 是否存入星期值
if(order.getDeliveryTime() != null){
order.setWeek(DateUtil.dayOfWeek(order.getDeliveryTime()) - 1);
}
return success("添加成功",order);
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:order:update')")
@OperationLog
@ApiOperation("修改订单记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Order order) {
if (orderService.updateById(order)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:order:remove')")
@OperationLog
@ApiOperation("删除订单记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (orderService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:order:save')")
@OperationLog
@ApiOperation("批量添加订单记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Order> list) {
if (orderService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:order:update')")
@OperationLog
@ApiOperation("批量修改订单记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Order> batchParam) {
if (batchParam.update(orderService, "order_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:order:remove')")
@OperationLog
@ApiOperation("批量删除订单记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (orderService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("支付成功")
@PostMapping("/setPayStatus")
public ApiResult<?> setPayStatus(@RequestBody Order order){
if (orderService.updateById(order)) {
return success("设置成功");
}
return fail("设置失败");
}
@PreAuthorize("hasAuthority('shop:order:list')")
@OperationLog
@ApiOperation("生成核销付款码(二维码)")
@GetMapping("/generateQrCode")
public ApiResult<?> generateQrCode(OrderParam param) throws IOException {
// 查询当天的报餐信息
param.setUserId(getLoginUserId());
param.setDeliveryTime(DateUtil.beginOfDay(DateUtil.date()).toString());
param.setOrderStatus(ORDER_STATUS_DOING);
param.setPayStatus(PAY_STATUS_SUCCESS);
param.setDeleted(0);
final List<Order> list = orderService.listRel(param);
if(list.size() == 0){
return fail("今日无报餐记录");
}
final Order order = list.get(0);
// LOGO URL地址
String logoUrl = "https://file.wsdns.cn/20230430/6fa31aca3b0d47af98a149cf2dd26a4f.jpeg";
// 二维码生成图片保存路径
String filePath = "/www/wwwroot/file.ws/file/qrcode/" + getLoginUserId() + "/payQrCode.jpg";
// 二维码访问路径
String qrcodeUrl = "https://file.gxwebsoft.com/qrcode/" + getLoginUserId() + "/payQrCode.jpg" + "?v=" + DateUtil.current();
// 二维码内容
final String orderNo = order.getOrderNo().toString();
// 将URL转为BufferedImage
BufferedImage bufferedImage = ImageIO.read(new URL(logoUrl));
// 生成二维码
QrConfig config = new QrConfig(300, 300);
// 设置边距,既二维码和背景之间的边距
config.setMargin(1);
// 附带小logo
config.setImg(bufferedImage);
QrCodeUtil.generate(orderNo, config, FileUtil.file(filePath));
return success("请求成功",qrcodeUrl);
}
}
@@ -0,0 +1,133 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.OrderGoodsService;
import com.gxwebsoft.shop.entity.OrderGoods;
import com.gxwebsoft.shop.param.OrderGoodsParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 订单商品记录表控制器
*
* @author 科技小王子
* @since 2022-12-09 17:15:31
*/
@Api(tags = "订单商品记录表管理")
@RestController
@RequestMapping("/api/shop/order-goods")
public class OrderGoodsController extends BaseController {
@Resource
private OrderGoodsService orderGoodsService;
@PreAuthorize("hasAuthority('shop:orderGoods:list')")
@OperationLog
@ApiOperation("分页查询订单商品记录表")
@GetMapping("/page")
public ApiResult<PageResult<OrderGoods>> page(OrderGoodsParam param) {
// 使用关联查询
return success(orderGoodsService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:orderGoods:list')")
@OperationLog
@ApiOperation("查询全部订单商品记录表")
@GetMapping()
public ApiResult<List<OrderGoods>> list(OrderGoodsParam param) {
// 使用关联查询
return success(orderGoodsService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:orderGoods:list')")
@OperationLog
@ApiOperation("根据id查询订单商品记录表")
@GetMapping("/{id}")
public ApiResult<OrderGoods> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(orderGoodsService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:orderGoods:save')")
@OperationLog
@ApiOperation("添加订单商品记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody OrderGoods orderGoods) {
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
orderGoods.setUserId(loginUser.getUserId());
orderGoods.setMerchantCode(getMerchantCode());
}
if (orderGoodsService.save(orderGoods)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:orderGoods:update')")
@OperationLog
@ApiOperation("修改订单商品记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody OrderGoods orderGoods) {
if (orderGoodsService.updateById(orderGoods)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:orderGoods:remove')")
@OperationLog
@ApiOperation("删除订单商品记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (orderGoodsService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:orderGoods:save')")
@OperationLog
@ApiOperation("批量添加订单商品记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<OrderGoods> list) {
if (orderGoodsService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:orderGoods:update')")
@OperationLog
@ApiOperation("批量修改订单商品记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<OrderGoods> batchParam) {
if (batchParam.update(orderGoodsService, "order_goods_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:orderGoods:remove')")
@OperationLog
@ApiOperation("批量删除订单商品记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (orderGoodsService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,139 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.OrderRefundAddressService;
import com.gxwebsoft.shop.entity.OrderRefundAddress;
import com.gxwebsoft.shop.param.OrderRefundAddressParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 售后单退货地址记录表控制器
*
* @author 科技小王子
* @since 2023-05-18 13:09:51
*/
@Api(tags = "售后单退货地址记录表管理")
@RestController
@RequestMapping("/api/shop/order-refund-address")
public class OrderRefundAddressController extends BaseController {
@Resource
private OrderRefundAddressService orderRefundAddressService;
@PreAuthorize("hasAuthority('shop:orderRefundAddress:list')")
@OperationLog
@ApiOperation("分页查询售后单退货地址记录表")
@GetMapping("/page")
public ApiResult<PageResult<OrderRefundAddress>> page(OrderRefundAddressParam param) {
PageParam<OrderRefundAddress, OrderRefundAddressParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(orderRefundAddressService.page(page, page.getWrapper()));
// 使用关联查询
//return success(orderRefundAddressService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:orderRefundAddress:list')")
@OperationLog
@ApiOperation("查询全部售后单退货地址记录表")
@GetMapping()
public ApiResult<List<OrderRefundAddress>> list(OrderRefundAddressParam param) {
PageParam<OrderRefundAddress, OrderRefundAddressParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(orderRefundAddressService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(orderRefundAddressService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:orderRefundAddress:list')")
@OperationLog
@ApiOperation("根据id查询售后单退货地址记录表")
@GetMapping("/{id}")
public ApiResult<OrderRefundAddress> get(@PathVariable("id") Integer id) {
return success(orderRefundAddressService.getById(id));
// 使用关联查询
//return success(orderRefundAddressService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:orderRefundAddress:save')")
@OperationLog
@ApiOperation("添加售后单退货地址记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody OrderRefundAddress orderRefundAddress) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
orderRefundAddress.setUserId(loginUser.getUserId());
}
if (orderRefundAddressService.save(orderRefundAddress)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:orderRefundAddress:update')")
@OperationLog
@ApiOperation("修改售后单退货地址记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody OrderRefundAddress orderRefundAddress) {
if (orderRefundAddressService.updateById(orderRefundAddress)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:orderRefundAddress:remove')")
@OperationLog
@ApiOperation("删除售后单退货地址记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (orderRefundAddressService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:orderRefundAddress:save')")
@OperationLog
@ApiOperation("批量添加售后单退货地址记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<OrderRefundAddress> list) {
if (orderRefundAddressService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:orderRefundAddress:update')")
@OperationLog
@ApiOperation("批量修改售后单退货地址记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<OrderRefundAddress> batchParam) {
if (batchParam.update(orderRefundAddressService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:orderRefundAddress:remove')")
@OperationLog
@ApiOperation("批量删除售后单退货地址记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (orderRefundAddressService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,151 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.apps.entity.Equipment;
import com.gxwebsoft.apps.service.EquipmentService;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.entity.Order;
import com.gxwebsoft.shop.service.OrderRefundService;
import com.gxwebsoft.shop.entity.OrderRefund;
import com.gxwebsoft.shop.param.OrderRefundParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.shop.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import static com.gxwebsoft.common.core.constants.OrderConstants.RECEIPT_STATUS_RETURN;
/**
* 售后单记录表控制器
*
* @author 科技小王子
* @since 2023-05-18 13:09:51
*/
@Api(tags = "售后单记录表管理")
@RestController
@RequestMapping("/api/shop/order-refund")
public class OrderRefundController extends BaseController {
@Resource
private OrderRefundService orderRefundService;
@Resource
private OrderService orderService;
@Resource
private EquipmentService equipmentService;
@PreAuthorize("hasAuthority('shop:orderRefund:list')")
@OperationLog
@ApiOperation("分页查询售后单记录表")
@GetMapping("/page")
public ApiResult<PageResult<OrderRefund>> page(OrderRefundParam param) {
// 使用关联查询
return success(orderRefundService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:orderRefund:list')")
@OperationLog
@ApiOperation("查询全部售后单记录表")
@GetMapping()
public ApiResult<List<OrderRefund>> list(OrderRefundParam param) {
// 使用关联查询
return success(orderRefundService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:orderRefund:list')")
@OperationLog
@ApiOperation("根据id查询售后单记录表")
@GetMapping("/{id}")
public ApiResult<OrderRefund> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(orderRefundService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:orderRefund:save')")
@OperationLog
@ApiOperation("添加售后单记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody OrderRefund orderRefund) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
orderRefund.setUserId(loginUser.getUserId());
}
if (orderRefundService.save(orderRefund)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:orderRefund:update')")
@OperationLog
@ApiOperation("修改售后单记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody OrderRefund orderRefund) {
if (orderRefundService.updateById(orderRefund)) {
if(orderRefund.getTenantId().equals(6)){
final Integer orderId = orderRefund.getOrderId();
final Order order = orderService.getById(orderId);
System.out.println("order = " + order);
order.setReceiptStatus(RECEIPT_STATUS_RETURN);
final Equipment equipment = equipmentService.getById(order.getEquipmentId());
equipment.setUserId(0);
equipmentService.updateById(equipment);
}
return success("操作成功");
}
return fail("退租失败");
}
@PreAuthorize("hasAuthority('shop:orderRefund:remove')")
@OperationLog
@ApiOperation("删除售后单记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (orderRefundService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:orderRefund:save')")
@OperationLog
@ApiOperation("批量添加售后单记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<OrderRefund> list) {
if (orderRefundService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:orderRefund:update')")
@OperationLog
@ApiOperation("批量修改售后单记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<OrderRefund> batchParam) {
if (batchParam.update(orderRefundService, "order_refund_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:orderRefund:remove')")
@OperationLog
@ApiOperation("批量删除售后单记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (orderRefundService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,140 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.OrderRenewService;
import com.gxwebsoft.shop.entity.OrderRenew;
import com.gxwebsoft.shop.param.OrderRenewParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 续费订单记录表控制器
*
* @author 科技小王子
* @since 2023-04-13 10:34:35
*/
@Api(tags = "续费订单记录表管理")
@RestController
@RequestMapping("/api/shop/order-renew")
public class OrderRenewController extends BaseController {
@Resource
private OrderRenewService orderRenewService;
@PreAuthorize("hasAuthority('shop:orderRenew:list')")
@OperationLog
@ApiOperation("分页查询续费订单记录表")
@GetMapping("/page")
public ApiResult<PageResult<OrderRenew>> page(OrderRenewParam param) {
PageParam<OrderRenew, OrderRenewParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(orderRenewService.page(page, page.getWrapper()));
// 使用关联查询
//return success(orderRenewService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:orderRenew:list')")
@OperationLog
@ApiOperation("查询全部续费订单记录表")
@GetMapping()
public ApiResult<List<OrderRenew>> list(OrderRenewParam param) {
PageParam<OrderRenew, OrderRenewParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(orderRenewService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(orderRenewService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:orderRenew:list')")
@OperationLog
@ApiOperation("根据id查询续费订单记录表")
@GetMapping("/{id}")
public ApiResult<OrderRenew> get(@PathVariable("id") Integer id) {
return success(orderRenewService.getById(id));
// 使用关联查询
//return success(orderRenewService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:orderRenew:save')")
@OperationLog
@ApiOperation("添加续费订单记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody OrderRenew orderRenew) {
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
orderRenew.setUserId(loginUser.getUserId());
orderRenew.setMerchantCode(getMerchantCode());
}
if (orderRenewService.save(orderRenew)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:orderRenew:update')")
@OperationLog
@ApiOperation("修改续费订单记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody OrderRenew orderRenew) {
if (orderRenewService.updateById(orderRenew)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:orderRenew:remove')")
@OperationLog
@ApiOperation("删除续费订单记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (orderRenewService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:orderRenew:save')")
@OperationLog
@ApiOperation("批量添加续费订单记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<OrderRenew> list) {
if (orderRenewService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:orderRenew:update')")
@OperationLog
@ApiOperation("批量修改续费订单记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<OrderRenew> batchParam) {
if (batchParam.update(orderRenewService, "order_renew_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:orderRenew:remove')")
@OperationLog
@ApiOperation("批量删除续费订单记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (orderRenewService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,539 @@
package com.gxwebsoft.shop.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayConstants;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.internal.util.AlipayEncrypt;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayTradeCreateRequest;
import com.alipay.api.request.AlipayTradeQueryRequest;
import com.alipay.api.response.AlipayTradeCreateResponse;
import com.alipay.api.response.AlipayTradeQueryResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.apps.entity.BcTemporary;
import com.gxwebsoft.apps.param.BcTemporaryParam;
import com.gxwebsoft.apps.service.BcTemporaryService;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.core.exception.BusinessException;
import com.gxwebsoft.common.core.utils.AlipayConfigUtil;
import com.gxwebsoft.common.core.web.*;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.OperationRecordService;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.shop.entity.Order;
import com.gxwebsoft.shop.entity.Payment;
import com.gxwebsoft.shop.entity.UserBalanceLog;
import com.gxwebsoft.shop.param.PaymentParam;
import com.gxwebsoft.shop.service.OrderService;
import com.gxwebsoft.shop.service.PaymentService;
import com.gxwebsoft.shop.service.UserBalanceLogService;
import com.gxwebsoft.shop.service.UserOauthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.core.env.Environment;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
import static com.gxwebsoft.common.core.constants.BalanceConstants.BALANCE_USE;
import static com.gxwebsoft.common.core.constants.OrderConstants.*;
/**
* 商城支付方式记录表控制器
*
* @author 科技小王子
* @since 2022-12-15 19:11:07
*/
@Api(tags = "商城支付方式记录表管理")
@RestController
@RequestMapping("/api/shop/payment")
public class PaymentController extends BaseController {
@Resource
private PaymentService paymentService;
@Resource
private OrderService orderService;
@Resource
private Environment config;
@Resource
private ConfigProperties pathConfig;
@Resource
private OperationRecordService operationRecordService;
@Resource
private UserOauthService userOauthService;
@Resource
private AlipayConfigUtil alipayConfig;
@Resource
private UserService userService;
@Resource
private UserBalanceLogService userBalanceLogService;
@Resource
private BcTemporaryService bcTemporaryService;
@PreAuthorize("hasAuthority('shop:payment:list')")
@ApiOperation("分页查询商城支付方式记录表")
@GetMapping("/page")
public ApiResult<PageResult<Payment>> page(PaymentParam param) {
PageParam<Payment, PaymentParam> page = new PageParam<>(param);
return success(paymentService.page(page, page.getWrapper()));
// 使用关联查询
//return success(paymentService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:payment:list')")
@ApiOperation("查询全部商城支付方式记录表")
@GetMapping()
public ApiResult<List<Payment>> list(PaymentParam param) {
PageParam<Payment, PaymentParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(paymentService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(paymentService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:payment:list')")
@ApiOperation("根据id查询商城支付方式记录表")
@GetMapping("/{id}")
public ApiResult<Payment> get(@PathVariable("id") Integer id) {
return success(paymentService.getById(id));
// 使用关联查询
//return success(paymentService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:payment:save')")
@ApiOperation("添加商城支付方式记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Payment payment) {
if (paymentService.count(new LambdaQueryWrapper<Payment>()
.eq(Payment::getMethod, payment.getMethod())) > 0) {
return fail("该支付方式已存在");
}
if (paymentService.save(payment)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:payment:update')")
@OperationLog
@ApiOperation("修改商城支付方式记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Payment payment) {
if (paymentService.updateById(payment)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:payment:remove')")
@OperationLog
@ApiOperation("删除商城支付方式记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (paymentService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:payment:save')")
@OperationLog
@ApiOperation("批量添加商城支付方式记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Payment> list) {
if (paymentService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:payment:update')")
@OperationLog
@ApiOperation("批量修改商城支付方式记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Payment> batchParam) {
if (batchParam.update(paymentService, "payment_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:payment:remove')")
@OperationLog
@ApiOperation("批量删除商城支付方式记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (paymentService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("支付宝手机号码")
@PostMapping("/getPhoneNumber")
public ApiResult<?> getPhoneNumber(@RequestBody Map<String, String> params) {
final String encryptedData = params.get("encryptedData");
final String tenantId = params.get("tenantId");
// 支付宝配置信息
JSONObject config = alipayConfig.payment(Integer.valueOf(tenantId));
//1. 获取验签和解密所需要的参数
JSONObject jsonObject =JSONObject.parseObject(encryptedData);
String content = jsonObject.getString("response");
String sign = jsonObject.getString("sign");
String signType = "RSA2";
String charset = "UTF-8";
String encryptType = "AES";
String alipayCertPublicKey = pathConfig.getUploadPath() + "file" + config.getString("alipayCertPublicKey");
boolean isDataEncrypted = !content.startsWith("{");
boolean signVerified = false;
//2. 验签
String signContent = content;
String signVeriKey = ""; // 支付宝公钥
String decryptKey = config.getString("decryptKey"); // 加解密密钥
// System.out.println("decryptKey = " + decryptKey);
// System.out.println(content);
// System.out.println(sign);
// System.out.println(alipayCertPublicKey);
// System.out.println(charset);
// System.out.println(signType);
// System.out.println(isDataEncrypted);
if (isDataEncrypted) {
signContent = "\"" + signContent + "\"";
} try {
//验签方法
signVerified = AlipaySignature.rsaCertCheck(signContent, sign, alipayCertPublicKey, charset, signType);
} catch (AlipayApiException e) {
// 验签异常, 日志
} if (!signVerified) {
//验签不通过(异常或者报文被篡改),终止流程(不需要做解密)
return fail("验签失败");
}
//3. 解密
String plainData = null;
if (isDataEncrypted) {
try {
plainData = AlipayEncrypt.decryptContent(content, encryptType, decryptKey, charset);
} catch (AlipayApiException e) {
//解密异常, 记录日志
return fail("解密异常");
}} else {
plainData = content;
}
return success("获取成功",plainData);
}
@ApiModelProperty("支付宝小程序支付")
@GetMapping("/mp-alipay/{id}")
public ApiResult<?> mpAlipay(@PathVariable("id") Integer id) throws AlipayApiException {
// 验证签名
isCheckSign();
// 订单数据
Order order = orderService.getByIdRel(id);
// 实例化客户端
DefaultAlipayClient alipayClient = alipayConfig.alipayClient(order.getTenantId());
try {
AlipayTradeCreateRequest request = new AlipayTradeCreateRequest();
// 配置公共请求参数
request.setNotifyUrl(pathConfig.getServerUrl() + "/shop/payment/mp-alipay/notify");
// request.setNotifyUrl("https://454k72r798.goho.co/api/shop/payment/mp-alipay/notify");
request.setReturnUrl(null);
// 配置业务参数
JSONObject bizContent = new JSONObject();
System.out.println("bizContent = " + order);
bizContent.put("out_trade_no", order.getOrderNo());
bizContent.put("total_amount", order.getPayPrice());
bizContent.put("subject", order.getMerchantName());
// 拿不到手机号码??
bizContent.put("buyer_id", userOauthService.getOauthIdByUserId(order.getUserId(), "MP-ALIPAY"));
request.setBizContent(bizContent.toString());
//SDK 已经封装掉了公共参数,这里只需要传入业务参数。
AlipayTradeCreateResponse response = alipayClient.certificateExecute(request);
String trade_no = response.getTradeNo();// 获取返回的tradeNO。
return success("支付成功", trade_no);
} catch (AlipayApiException e) {
e.printStackTrace();
throw new RuntimeException();
}
}
@ApiModelProperty("异步通知")
@OperationLog
@PostMapping("/mp-alipay/notify")
public String alipayNotify(@RequestParam Map<String, String> params) throws AlipayApiException {
System.out.println("异步处理>>>>");
System.out.println("params = " + params);
String outTradeNo = params.get("out_trade_no");
Order order = orderService.getByOutTradeNo(outTradeNo);
if(order == null){
throw new BusinessException("订单不存在");
}
final JSONObject config = alipayConfig.payment(order.getTenantId());
// 生成环境证书路径
String alipayCertPublicKey = pathConfig.getUploadPath() + "file" + config.getString("alipayCertPublicKey");
// TODO 验签成功后,按照支付结果异步通知中的描述,对支付结果中的业务内容进行二次校验,校验成功后在response中返回success并继续商户自身业务处理,校验失败返回failure
boolean flag = AlipaySignature.rsaCertCheckV1(params, alipayCertPublicKey, AlipayConstants.CHARSET_UTF8, AlipayConstants.SIGN_TYPE_RSA2);
System.out.println("flag>>>>>>>>>>>>>>>>>>>>>>>");
System.out.println(flag);
// 处理订单业务
if (flag) {
final String tradeStatus = params.get("trade_status");
final String receipt_amount = params.get("receipt_amount");
final String payPrice = order.getPayPrice().toString();
final String trade_no = params.get("trade_no");
final String subject = params.get("subject");
// 1. 验证appId是否一致
final String app_id = params.get("app_id");
if(!config.getString("alipayAppId").equals(app_id)){
System.out.println("支付宝appId不一致 = " + app_id);
throw new BusinessException("支付宝appId不一致");
}
// 2. 订单金额
if(!payPrice.equals(receipt_amount)){
System.out.println("订单金额是不一致 = " + receipt_amount);
throw new BusinessException("订单金额是不一致");
}
// 3. 判断交易状态
if(!"TRADE_SUCCESS".equals(tradeStatus)){
System.out.println("支付失败 = " + tradeStatus);
throw new BusinessException("支付失败");
}
// 4. 修改支付状态
order.setPayStatus(PAY_STATUS_SUCCESS);
order.setPayMethod(PAY_METHOD_ALIPAY);
order.setReceiptAmount(new BigDecimal(receipt_amount));
order.setPayTime(DateUtil.date());
order.setTradeId(trade_no);
order.setSubject(subject);
System.out.println("order2 = " + order);
final boolean b = orderService.updateByIdRel(order);
System.out.println("bsss = " + b);
return "success";
}
// TODO 验签失败则记录异常日志,并在response中返回failure.
return "failure";
}
@OperationLog
@ApiModelProperty("余额支付")
@GetMapping("/balance/{id}")
@Transactional(rollbackFor = {Exception.class})
public ApiResult<?> balance(@PathVariable("id") Integer id) throws AlipayApiException {
// 1. 验证签名
isCheckSign();
// 订单数据
Order order = orderService.getByIdRel(id);
// 当前登录用户id
User user = new User();
// 代付款情况
if(!order.getUserId().equals(getLoginUserId())){
user = userService.getById(order.getUserId());
}else{
user = getLoginUser();
}
final Integer userId = user.getUserId();
final BigDecimal balance = user.getBalance();
final BigDecimal payPrice = order.getPayPrice();
if(balance.compareTo(payPrice) < 0){
return fail("余额不足 = " + balance.compareTo(payPrice));
}
// 2. 扣除余额操作
BigDecimal subtract = balance.subtract(payPrice);
user.setBalance(subtract);
userService.updateById(user);
// 3. 记录余额明细
UserBalanceLog userBalanceLog = new UserBalanceLog();
userBalanceLog.setUserId(userId);
userBalanceLog.setScene(BALANCE_USE);
userBalanceLog.setMoney(payPrice);
userBalanceLog.setBalance(subtract);
userBalanceLog.setComments(order.getOrderNo().toString());
userBalanceLog.setMerchantCode(order.getMerchantCode());
userBalanceLogService.save(userBalanceLog);
// 4. 修改支付状态
order.setPayStatus(PAY_STATUS_SUCCESS);
order.setPayMethod(PAY_METHOD_BALANCE);
order.setReceiptAmount(payPrice);
order.setPayTime(DateUtil.date());
order.setSubject(order.getMerchantName());
orderService.updateByIdRel(order);
// 5. 续租订单
if(order.getRentOrderId() > 0){
// 主订单
Order parentOrder = orderService.getById(order.getRentOrderId());
// 更新过期时间延长一个月
Date expirationTime = parentOrder.getExpirationTime();
DateTime nextMonthTime = DateUtil.offsetMonth(expirationTime, 1);
parentOrder.setExpirationTime(nextMonthTime);
orderService.updateById(parentOrder);
// 保存续费订单状态
order.setDeliveryStatus(DELIVERY_STATUS_YES);
order.setReceiptStatus(RECEIPT_STATUS_YES);
order.setOrderStatus(ORDER_STATUS_COMPLETED);
order.setStartTime(expirationTime);
order.setExpirationTime(nextMonthTime);
orderService.updateById(order);
}
// 6. 是否是临时报餐
final BcTemporaryParam bcTemporaryParam = new BcTemporaryParam();
bcTemporaryParam.setUserId(getLoginUserId());
bcTemporaryParam.setApplyStatus(1);
final List<BcTemporary> bcTemporaries = bcTemporaryService.listRel(bcTemporaryParam);
bcTemporaries.forEach(b -> {
b.setStatus(1);
bcTemporaryService.updateById(b);
});
return success("支付成功",user);
}
@OperationLog
@ApiModelProperty("余额支付批量")
@PostMapping("/balanceBatch")
@Transactional(rollbackFor = {Exception.class})
public ApiResult<?> balanceBatch(@RequestBody List<Integer> orderIds) throws AlipayApiException {
// 1. 验证签名
isCheckSign();
// 订单数据
final List<Order> list = orderService.listByIds(orderIds);
final StringBuilder sb = new StringBuilder();
list.forEach(d -> {
// 当前登录用户id
User user = new User();
// 代付款情况
if(!d.getUserId().equals(getLoginUserId())){
user = userService.getById(d.getUserId());
}else{
user = getLoginUser();
}
final Integer userId = user.getUserId();
final BigDecimal balance = user.getBalance();
final BigDecimal payPrice = d.getPayPrice();
if(balance.compareTo(payPrice) < 0){
sb.append("下单失败:").append(user.getNickname()).append("余额不足");
throw new BusinessException("余额不足");
}
// 2. 扣除余额操作
BigDecimal subtract = balance.subtract(payPrice);
user.setBalance(subtract);
userService.updateById(user);
// 3. 记录余额明细
UserBalanceLog userBalanceLog = new UserBalanceLog();
userBalanceLog.setUserId(userId);
userBalanceLog.setScene(BALANCE_USE);
userBalanceLog.setMoney(payPrice);
userBalanceLog.setBalance(subtract);
userBalanceLog.setComments(d.getOrderNo().toString());
userBalanceLog.setMerchantCode(d.getMerchantCode());
userBalanceLogService.save(userBalanceLog);
// 4. 修改支付状态
d.setPayStatus(PAY_STATUS_SUCCESS);
d.setPayMethod(PAY_METHOD_BALANCE);
d.setReceiptAmount(payPrice);
d.setPayTime(DateUtil.date());
d.setSubject(d.getMerchantName());
orderService.updateByIdRel(d);
// 5. 续租订单
if(d.getRentOrderId() > 0){
// 主订单
Order parentOrder = orderService.getById(d.getRentOrderId());
// 更新过期时间延长一个月
Date expirationTime = parentOrder.getExpirationTime();
DateTime nextMonthTime = DateUtil.offsetMonth(expirationTime, 1);
parentOrder.setExpirationTime(nextMonthTime);
orderService.updateById(parentOrder);
// 保存续费订单状态
d.setDeliveryStatus(DELIVERY_STATUS_YES);
d.setReceiptStatus(RECEIPT_STATUS_YES);
d.setOrderStatus(ORDER_STATUS_COMPLETED);
d.setStartTime(expirationTime);
d.setExpirationTime(nextMonthTime);
orderService.updateById(d);
}
// 6. 是否是临时报餐
final BcTemporaryParam bcTemporaryParam = new BcTemporaryParam();
bcTemporaryParam.setUserId(getLoginUserId());
bcTemporaryParam.setApplyStatus(1);
final List<BcTemporary> bcTemporaries = bcTemporaryService.listRel(bcTemporaryParam);
bcTemporaries.forEach(b -> {
b.setStatus(1);
bcTemporaryService.updateById(b);
});
});
return success("支付成功",sb);
}
@ApiModelProperty("统一收单交易查询")
@GetMapping("/mp-alipay/query/{id}")
public ApiResult<?> query(@PathVariable("id") Integer id) throws AlipayApiException {
// 验证签名
isCheckSign();
// 订单数据
Order order = orderService.getByIdRel(id);
// 实例化客户端
DefaultAlipayClient alipayClient = alipayConfig.alipayClient(order.getTenantId());
AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
JSONObject bizContent = new JSONObject();
bizContent.put("out_trade_no", order.getOrderNo());
request.setBizContent(bizContent.toString());
AlipayTradeQueryResponse response = alipayClient.certificateExecute(request);
if(response.isSuccess()){
System.out.println("调用成功");
orderService.paySuccess(response);
} else {
System.out.println("调用失败");
}
return success("调用成功",response);
}
@ApiModelProperty("测试")
@GetMapping("/mp-alipay/test")
public String test() {
System.out.println("开始>>>>>");
Order order = orderService.getByOutTradeNo("2023213225911618");
System.out.println("order = " + order);
order.setPayPrice(new BigDecimal("0.11"));
order.setTotalPrice(new BigDecimal("0.11"));
order.setPayStatus(PAY_STATUS_SUCCESS);
final boolean b = orderService.updateByIdRel(order);
System.out.println("b = " + b);
// params.put("gmt_create", "2022-12-16 21:32:33");
// params.put("charset", "UTF-8");
// params.put("seller_email", "zhu115289@163.com");
// params.put("subject", "测试商品");
// params.put("buyer_id", "2088202959044205");
// params.put("invoice_amount", "0.01");
// params.put("notify_id", "2022121601222213308044201435873270");
// params.put("fund_bill_list", "");
// params.put("notify_type", "trade_status_sync");
// params.put("trade_status", "TRADE_SUCCESS");
// params.put("receipt_amount", "0.01");
// params.put("buyer_pay_amount", "0.01");
// params.put("app_id", "2021003156628508");
// params.put("seller_id", "2088431805524422");
// params.put("gmt_payment", "2022-12-16 21:33:07");
// params.put("notify_time", "2022-12-16 21:33:09");
// params.put("version", "1.0");
// params.put("out_trade_no", "20221116205303366");
// params.put("total_amount", "0.01");
// params.put("trade_no", "2022121622001444201411215463");
// params.put("auth_app_id", "2021003156628508");
// params.put("buyer_logon_id", "ip1***@163.com");
// params.put("point_amount", "0.00");
// // 处理订单业务
// orderService.paySuccess(params);
return "success";
}
}
@@ -0,0 +1,134 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.PaymentTemplateService;
import com.gxwebsoft.shop.entity.PaymentTemplate;
import com.gxwebsoft.shop.param.PaymentTemplateParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 商城支付模板记录表控制器
*
* @author 科技小王子
* @since 2022-12-09 13:59:38
*/
@Api(tags = "商城支付模板记录表管理")
@RestController
@RequestMapping("/api/shop/payment-template")
public class PaymentTemplateController extends BaseController {
@Resource
private PaymentTemplateService paymentTemplateService;
@PreAuthorize("hasAuthority('shop:paymentTemplate:list')")
@OperationLog
@ApiOperation("分页查询商城支付模板记录表")
@GetMapping("/page")
public ApiResult<PageResult<PaymentTemplate>> page(PaymentTemplateParam param) {
PageParam<PaymentTemplate, PaymentTemplateParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(paymentTemplateService.page(page, page.getWrapper()));
// 使用关联查询
//return success(paymentTemplateService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:paymentTemplate:list')")
@OperationLog
@ApiOperation("查询全部商城支付模板记录表")
@GetMapping()
public ApiResult<List<PaymentTemplate>> list(PaymentTemplateParam param) {
PageParam<PaymentTemplate, PaymentTemplateParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(paymentTemplateService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(paymentTemplateService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:paymentTemplate:list')")
@OperationLog
@ApiOperation("根据id查询商城支付模板记录表")
@GetMapping("/{id}")
public ApiResult<PaymentTemplate> get(@PathVariable("id") Integer id) {
return success(paymentTemplateService.getById(id));
// 使用关联查询
//return success(paymentTemplateService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:paymentTemplate:save')")
@OperationLog
@ApiOperation("添加商城支付模板记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody PaymentTemplate paymentTemplate) {
if (paymentTemplateService.save(paymentTemplate)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:paymentTemplate:update')")
@OperationLog
@ApiOperation("修改商城支付模板记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody PaymentTemplate paymentTemplate) {
if (paymentTemplateService.updateById(paymentTemplate)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:paymentTemplate:remove')")
@OperationLog
@ApiOperation("删除商城支付模板记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (paymentTemplateService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:paymentTemplate:save')")
@OperationLog
@ApiOperation("批量添加商城支付模板记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<PaymentTemplate> list) {
if (paymentTemplateService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:paymentTemplate:update')")
@OperationLog
@ApiOperation("批量修改商城支付模板记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<PaymentTemplate> batchParam) {
if (batchParam.update(paymentTemplateService, "template_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:paymentTemplate:remove')")
@OperationLog
@ApiOperation("批量删除商城支付模板记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (paymentTemplateService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,140 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.PaymentTradeService;
import com.gxwebsoft.shop.entity.PaymentTrade;
import com.gxwebsoft.shop.param.PaymentTradeParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 第三方支付交易记录表控制器
*
* @author 科技小王子
* @since 2022-12-09 13:59:38
*/
@Api(tags = "第三方支付交易记录表管理")
@RestController
@RequestMapping("/api/shop/payment-trade")
public class PaymentTradeController extends BaseController {
@Resource
private PaymentTradeService paymentTradeService;
@PreAuthorize("hasAuthority('shop:paymentTrade:list')")
@OperationLog
@ApiOperation("分页查询第三方支付交易记录表")
@GetMapping("/page")
public ApiResult<PageResult<PaymentTrade>> page(PaymentTradeParam param) {
PageParam<PaymentTrade, PaymentTradeParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(paymentTradeService.page(page, page.getWrapper()));
// 使用关联查询
//return success(paymentTradeService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:paymentTrade:list')")
@OperationLog
@ApiOperation("查询全部第三方支付交易记录表")
@GetMapping()
public ApiResult<List<PaymentTrade>> list(PaymentTradeParam param) {
PageParam<PaymentTrade, PaymentTradeParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(paymentTradeService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(paymentTradeService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:paymentTrade:list')")
@OperationLog
@ApiOperation("根据id查询第三方支付交易记录表")
@GetMapping("/{id}")
public ApiResult<PaymentTrade> get(@PathVariable("id") Integer id) {
return success(paymentTradeService.getById(id));
// 使用关联查询
//return success(paymentTradeService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:paymentTrade:save')")
@OperationLog
@ApiOperation("添加第三方支付交易记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody PaymentTrade paymentTrade) {
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
paymentTrade.setUserId(loginUser.getUserId());
paymentTrade.setMerchantCode(getMerchantCode());
}
if (paymentTradeService.save(paymentTrade)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:paymentTrade:update')")
@OperationLog
@ApiOperation("修改第三方支付交易记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody PaymentTrade paymentTrade) {
if (paymentTradeService.updateById(paymentTrade)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:paymentTrade:remove')")
@OperationLog
@ApiOperation("删除第三方支付交易记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (paymentTradeService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:paymentTrade:save')")
@OperationLog
@ApiOperation("批量添加第三方支付交易记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<PaymentTrade> list) {
if (paymentTradeService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:paymentTrade:update')")
@OperationLog
@ApiOperation("批量修改第三方支付交易记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<PaymentTrade> batchParam) {
if (batchParam.update(paymentTradeService, "trade_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:paymentTrade:remove')")
@OperationLog
@ApiOperation("批量删除第三方支付交易记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (paymentTradeService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,200 @@
package com.gxwebsoft.shop.controller;
import cn.hutool.core.util.IdUtil;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.shop.entity.RechargeOrder;
import com.gxwebsoft.shop.entity.UserBalanceLog;
import com.gxwebsoft.shop.param.RechargeOrderParam;
import com.gxwebsoft.shop.service.RechargeOrderService;
import com.gxwebsoft.shop.service.UserBalanceLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import static com.gxwebsoft.common.core.constants.BalanceConstants.BALANCE_ADMIN;
/**
* 会员充值订单表控制器
*
* @author 科技小王子
* @since 2023-04-20 20:36:24
*/
@Api(tags = "会员充值订单表管理")
@RestController
@RequestMapping("/api/shop/recharge-order")
public class RechargeOrderController extends BaseController {
@Resource
private RechargeOrderService rechargeOrderService;
@Resource
private UserService userService;
@Resource
private UserBalanceLogService userBalanceLogService;
@PreAuthorize("hasAuthority('shop:rechargeOrder:save')")
@OperationLog
@ApiOperation("会员充值")
@PostMapping("/recharge")
@Transactional(rollbackFor = {Exception.class})
public ApiResult<?> recharge(@RequestBody RechargeOrder rechargeOrder) {
// 充值
User user = userService.getById(rechargeOrder.getUserId());
BigDecimal balance = user.getBalance().add(rechargeOrder.getPayPrice());
user.setBalance(balance);
userService.updateById(user);
// 保存充值记录
rechargeOrder.setOrderNo(IdUtil.getSnowflakeNextId());
rechargeOrder.setBalance(balance);
if (rechargeOrderService.save(rechargeOrder)) {
// 记录余额明细
UserBalanceLog userBalanceLog = new UserBalanceLog();
userBalanceLog.setUserId(rechargeOrder.getUserId());
userBalanceLog.setScene(BALANCE_ADMIN);
userBalanceLog.setMoney(rechargeOrder.getPayPrice());
userBalanceLog.setBalance(balance);
userBalanceLog.setComments("操作人:" + getLoginUser().getNickname());
userBalanceLog.setRemark(rechargeOrder.getComments());
userBalanceLog.setMerchantCode(rechargeOrder.getMerchantCode());
userBalanceLogService.save(userBalanceLog);
return success("充值成功", user);
}
return fail("充值失败");
}
@PreAuthorize("hasAuthority('shop:rechargeOrder:list')")
@OperationLog
@ApiOperation("分页查询会员充值订单表")
@GetMapping("/page")
public ApiResult<PageResult<RechargeOrder>> page(RechargeOrderParam param) {
// 使用关联查询
return success(rechargeOrderService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:rechargeOrder:list')")
@OperationLog
@ApiOperation("查询全部会员充值订单表")
@GetMapping()
public ApiResult<List<RechargeOrder>> list(RechargeOrderParam param) {
// 使用关联查询
return success(rechargeOrderService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:rechargeOrder:list')")
@OperationLog
@ApiOperation("根据id查询会员充值订单表")
@GetMapping("/{id}")
public ApiResult<RechargeOrder> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(rechargeOrderService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:rechargeOrder:save')")
@OperationLog
@ApiOperation("添加会员充值订单表")
@PostMapping()
public ApiResult<?> save(@RequestBody RechargeOrder rechargeOrder) {
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
rechargeOrder.setUserId(loginUser.getUserId());
rechargeOrder.setMerchantCode(getMerchantCode());
}
if (rechargeOrderService.save(rechargeOrder)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:rechargeOrder:update')")
@OperationLog
@ApiOperation("修改会员充值订单表")
@PutMapping()
public ApiResult<?> update(@RequestBody RechargeOrder rechargeOrder) {
if (rechargeOrderService.updateById(rechargeOrder)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:rechargeOrder:remove')")
@OperationLog
@ApiOperation("删除会员充值订单表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (rechargeOrderService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:rechargeOrder:save')")
@OperationLog
@ApiOperation("批量充值")
@PostMapping("/batchRecharge")
@Transactional(rollbackFor = {Exception.class})
public ApiResult<?> batchRecharge(@RequestBody List<RechargeOrder> list) {
if (rechargeOrderService.saveBatch(list)) {
String nickname = getLoginUser().getNickname();
ArrayList<User> users = new ArrayList<>(list.size());
ArrayList<UserBalanceLog> logs = new ArrayList<>(list.size());
list.forEach(d -> {
User user = userService.getByIdRel(d.getUserId());
BigDecimal balance = user.getBalance().add(d.getPayPrice());
user.setBalance(balance);
users.add(user);
UserBalanceLog userBalanceLog = new UserBalanceLog();
userBalanceLog.setUserId(d.getUserId());
userBalanceLog.setScene(BALANCE_ADMIN);
userBalanceLog.setMoney(d.getPayPrice());
userBalanceLog.setBalance(balance);
userBalanceLog.setComments("操作人:" + nickname);
userBalanceLog.setRemark(d.getComments());
userBalanceLog.setMerchantCode(d.getMerchantCode());
logs.add(userBalanceLog);
});
// 批量充值
userService.updateBatchById(users);
// 记录余额明细
userBalanceLogService.saveBatch(logs);
return success("充值成功");
}
return fail("充值失败");
}
@PreAuthorize("hasAuthority('shop:rechargeOrder:update')")
@OperationLog
@ApiOperation("批量修改会员充值订单表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<RechargeOrder> batchParam) {
if (batchParam.update(rechargeOrderService, "order_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:rechargeOrder:remove')")
@OperationLog
@ApiOperation("批量删除会员充值订单表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (rechargeOrderService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,140 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.RechargeOrderPlanService;
import com.gxwebsoft.shop.entity.RechargeOrderPlan;
import com.gxwebsoft.shop.param.RechargeOrderPlanParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 会员充值订单套餐快照表控制器
*
* @author 科技小王子
* @since 2023-04-20 20:36:24
*/
@Api(tags = "会员充值订单套餐快照表管理")
@RestController
@RequestMapping("/api/shop/recharge-order-plan")
public class RechargeOrderPlanController extends BaseController {
@Resource
private RechargeOrderPlanService rechargeOrderPlanService;
@PreAuthorize("hasAuthority('shop:rechargeOrderPlan:list')")
@OperationLog
@ApiOperation("分页查询会员充值订单套餐快照表")
@GetMapping("/page")
public ApiResult<PageResult<RechargeOrderPlan>> page(RechargeOrderPlanParam param) {
PageParam<RechargeOrderPlan, RechargeOrderPlanParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(rechargeOrderPlanService.page(page, page.getWrapper()));
// 使用关联查询
//return success(rechargeOrderPlanService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:rechargeOrderPlan:list')")
@OperationLog
@ApiOperation("查询全部会员充值订单套餐快照表")
@GetMapping()
public ApiResult<List<RechargeOrderPlan>> list(RechargeOrderPlanParam param) {
PageParam<RechargeOrderPlan, RechargeOrderPlanParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(rechargeOrderPlanService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(rechargeOrderPlanService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:rechargeOrderPlan:list')")
@OperationLog
@ApiOperation("根据id查询会员充值订单套餐快照表")
@GetMapping("/{id}")
public ApiResult<RechargeOrderPlan> get(@PathVariable("id") Integer id) {
return success(rechargeOrderPlanService.getById(id));
// 使用关联查询
//return success(rechargeOrderPlanService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:rechargeOrderPlan:save')")
@OperationLog
@ApiOperation("添加会员充值订单套餐快照表")
@PostMapping()
public ApiResult<?> save(@RequestBody RechargeOrderPlan rechargeOrderPlan) {
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
rechargeOrderPlan.setUserId(loginUser.getUserId());
rechargeOrderPlan.setMerchantCode(getMerchantCode());
}
if (rechargeOrderPlanService.save(rechargeOrderPlan)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:rechargeOrderPlan:update')")
@OperationLog
@ApiOperation("修改会员充值订单套餐快照表")
@PutMapping()
public ApiResult<?> update(@RequestBody RechargeOrderPlan rechargeOrderPlan) {
if (rechargeOrderPlanService.updateById(rechargeOrderPlan)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:rechargeOrderPlan:remove')")
@OperationLog
@ApiOperation("删除会员充值订单套餐快照表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (rechargeOrderPlanService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:rechargeOrderPlan:save')")
@OperationLog
@ApiOperation("批量添加会员充值订单套餐快照表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<RechargeOrderPlan> list) {
if (rechargeOrderPlanService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:rechargeOrderPlan:update')")
@OperationLog
@ApiOperation("批量修改会员充值订单套餐快照表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<RechargeOrderPlan> batchParam) {
if (batchParam.update(rechargeOrderPlanService, "order_plan_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:rechargeOrderPlan:remove')")
@OperationLog
@ApiOperation("批量删除会员充值订单套餐快照表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (rechargeOrderPlanService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,140 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.RechargePlanService;
import com.gxwebsoft.shop.entity.RechargePlan;
import com.gxwebsoft.shop.param.RechargePlanParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 会员充值套餐表控制器
*
* @author 科技小王子
* @since 2023-04-20 20:36:24
*/
@Api(tags = "会员充值套餐表管理")
@RestController
@RequestMapping("/api/shop/recharge-plan")
public class RechargePlanController extends BaseController {
@Resource
private RechargePlanService rechargePlanService;
@PreAuthorize("hasAuthority('shop:rechargePlan:list')")
@OperationLog
@ApiOperation("分页查询会员充值套餐表")
@GetMapping("/page")
public ApiResult<PageResult<RechargePlan>> page(RechargePlanParam param) {
PageParam<RechargePlan, RechargePlanParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(rechargePlanService.page(page, page.getWrapper()));
// 使用关联查询
//return success(rechargePlanService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:rechargePlan:list')")
@OperationLog
@ApiOperation("查询全部会员充值套餐表")
@GetMapping()
public ApiResult<List<RechargePlan>> list(RechargePlanParam param) {
PageParam<RechargePlan, RechargePlanParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(rechargePlanService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(rechargePlanService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:rechargePlan:list')")
@OperationLog
@ApiOperation("根据id查询会员充值套餐表")
@GetMapping("/{id}")
public ApiResult<RechargePlan> get(@PathVariable("id") Integer id) {
return success(rechargePlanService.getById(id));
// 使用关联查询
//return success(rechargePlanService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:rechargePlan:save')")
@OperationLog
@ApiOperation("添加会员充值套餐表")
@PostMapping()
public ApiResult<?> save(@RequestBody RechargePlan rechargePlan) {
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
rechargePlan.setUserId(loginUser.getUserId());
rechargePlan.setMerchantCode(getMerchantCode());
}
if (rechargePlanService.save(rechargePlan)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:rechargePlan:update')")
@OperationLog
@ApiOperation("修改会员充值套餐表")
@PutMapping()
public ApiResult<?> update(@RequestBody RechargePlan rechargePlan) {
if (rechargePlanService.updateById(rechargePlan)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:rechargePlan:remove')")
@OperationLog
@ApiOperation("删除会员充值套餐表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (rechargePlanService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:rechargePlan:save')")
@OperationLog
@ApiOperation("批量添加会员充值套餐表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<RechargePlan> list) {
if (rechargePlanService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:rechargePlan:update')")
@OperationLog
@ApiOperation("批量修改会员充值套餐表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<RechargePlan> batchParam) {
if (batchParam.update(rechargePlanService, "plan_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:rechargePlan:remove')")
@OperationLog
@ApiOperation("批量删除会员充值套餐表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (rechargePlanService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,63 @@
package com.gxwebsoft.shop.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayConstants;
import com.alipay.api.CertAlipayRequest;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.internal.util.AlipayEncrypt;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayTradeCreateRequest;
import com.alipay.api.response.AlipayTradeCreateResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.core.web.*;
import com.gxwebsoft.common.system.service.OperationRecordService;
import com.gxwebsoft.shop.entity.Order;
import com.gxwebsoft.shop.entity.Payment;
import com.gxwebsoft.shop.param.PaymentParam;
import com.gxwebsoft.shop.service.OrderService;
import com.gxwebsoft.shop.service.PaymentService;
import com.gxwebsoft.shop.service.UserOauthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 定时任务
*
* @author 科技小王子
* @since 2022-12-15 19:11:07
*/
@Api(tags = "定时任务")
@RestController
@RequestMapping("/api/shop/payment")
public class SchedulingController extends BaseController {
@Resource
private OrderService orderService;
// /**
// * 删除失效订单
// */
// @Scheduled(cron="0 0 */1 * * ?")
// public void reportCurrentTime() {
// System.out.println("定时任务开始 = " + new Date());
// boolean remove = orderService.remove(new LambdaQueryWrapper<Order>()
// .lt(Order::getExpirationTime, new Date())
// .eq(Order::getPayStatus, 10)
// .eq(Order::getOrderStatus, 10));
// System.out.println("remove = " + remove);
// }
}
@@ -0,0 +1,21 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.shop.config.ExpressConfig;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
public class SfExpressController extends BaseController {
@Resource
ExpressConfig expressConfig;
public ApiResult<?> createOrder(){
String sign = "";
String serverHost = expressConfig.getServerHost().concat("/open/api/external/createorder?sign=").concat(sign);
return success("成功",serverHost);
}
}
@@ -0,0 +1,24 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.constants.RedisConstants;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Api(tags = "测试控制器")
@RequestMapping("/api/shop/test")
public class TestController extends BaseController {
@GetMapping()
@OperationLog
@ApiOperation("测试方法")
public ApiResult<?> test(){
return null;
}
}
@@ -0,0 +1,139 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.UserAddressService;
import com.gxwebsoft.shop.entity.UserAddress;
import com.gxwebsoft.shop.param.UserAddressParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 用户收货地址表控制器
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
@Api(tags = "用户收货地址表管理")
@RestController
@RequestMapping("/api/shop/user-address")
public class UserAddressController extends BaseController {
@Resource
private UserAddressService userAddressService;
@PreAuthorize("hasAuthority('shop:userAddress:list')")
@OperationLog
@ApiOperation("分页查询用户收货地址表")
@GetMapping("/page")
public ApiResult<PageResult<UserAddress>> page(UserAddressParam param) {
PageParam<UserAddress, UserAddressParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(userAddressService.page(page, page.getWrapper()));
// 使用关联查询
//return success(userAddressService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:userAddress:list')")
@OperationLog
@ApiOperation("查询全部用户收货地址表")
@GetMapping()
public ApiResult<List<UserAddress>> list(UserAddressParam param) {
PageParam<UserAddress, UserAddressParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(userAddressService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(userAddressService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:userAddress:list')")
@OperationLog
@ApiOperation("根据id查询用户收货地址表")
@GetMapping("/{id}")
public ApiResult<UserAddress> get(@PathVariable("id") Integer id) {
return success(userAddressService.getById(id));
// 使用关联查询
//return success(userAddressService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:userAddress:save')")
@OperationLog
@ApiOperation("添加用户收货地址表")
@PostMapping()
public ApiResult<?> save(@RequestBody UserAddress userAddress) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
userAddress.setUserId(loginUser.getUserId());
}
if (userAddressService.save(userAddress)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userAddress:update')")
@OperationLog
@ApiOperation("修改用户收货地址表")
@PutMapping()
public ApiResult<?> update(@RequestBody UserAddress userAddress) {
if (userAddressService.updateById(userAddress)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userAddress:remove')")
@OperationLog
@ApiOperation("删除用户收货地址表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (userAddressService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:userAddress:save')")
@OperationLog
@ApiOperation("批量添加用户收货地址表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<UserAddress> list) {
if (userAddressService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userAddress:update')")
@OperationLog
@ApiOperation("批量修改用户收货地址表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserAddress> batchParam) {
if (batchParam.update(userAddressService, "address_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userAddress:remove')")
@OperationLog
@ApiOperation("批量删除用户收货地址表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (userAddressService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,137 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.UserBalanceLogService;
import com.gxwebsoft.shop.entity.UserBalanceLog;
import com.gxwebsoft.shop.param.UserBalanceLogParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 用户余额变动明细表控制器
*
* @author 科技小王子
* @since 2023-04-21 15:59:09
*/
@Api(tags = "用户余额变动明细表管理")
@RestController
@RequestMapping("/api/shop/user-balance-log")
public class UserBalanceLogController extends BaseController {
@Resource
private UserBalanceLogService userBalanceLogService;
@PreAuthorize("hasAuthority('shop:userBalanceLog:list')")
@OperationLog
@ApiOperation("分页查询用户余额变动明细表")
@GetMapping("/page")
public ApiResult<PageResult<UserBalanceLog>> page(UserBalanceLogParam param) {
// 使用关联查询
return success(userBalanceLogService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:userBalanceLog:list')")
@OperationLog
@ApiOperation("查询全部用户余额变动明细表")
@GetMapping()
public ApiResult<List<UserBalanceLog>> list(UserBalanceLogParam param) {
PageParam<UserBalanceLog, UserBalanceLogParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(userBalanceLogService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(userBalanceLogService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:userBalanceLog:list')")
@OperationLog
@ApiOperation("根据id查询用户余额变动明细表")
@GetMapping("/{id}")
public ApiResult<UserBalanceLog> get(@PathVariable("id") Integer id) {
return success(userBalanceLogService.getById(id));
// 使用关联查询
//return success(userBalanceLogService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:userBalanceLog:save')")
@OperationLog
@ApiOperation("添加用户余额变动明细表")
@PostMapping()
public ApiResult<?> save(@RequestBody UserBalanceLog userBalanceLog) {
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
userBalanceLog.setUserId(loginUser.getUserId());
userBalanceLog.setMerchantCode(getMerchantCode());
}
if (userBalanceLogService.save(userBalanceLog)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userBalanceLog:update')")
@OperationLog
@ApiOperation("修改用户余额变动明细表")
@PutMapping()
public ApiResult<?> update(@RequestBody UserBalanceLog userBalanceLog) {
if (userBalanceLogService.updateById(userBalanceLog)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userBalanceLog:remove')")
@OperationLog
@ApiOperation("删除用户余额变动明细表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (userBalanceLogService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:userBalanceLog:save')")
@OperationLog
@ApiOperation("批量添加用户余额变动明细表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<UserBalanceLog> list) {
if (userBalanceLogService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userBalanceLog:update')")
@OperationLog
@ApiOperation("批量修改用户余额变动明细表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserBalanceLog> batchParam) {
if (batchParam.update(userBalanceLogService, "log_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userBalanceLog:remove')")
@OperationLog
@ApiOperation("批量删除用户余额变动明细表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (userBalanceLogService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,139 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.UserCouponService;
import com.gxwebsoft.shop.entity.UserCoupon;
import com.gxwebsoft.shop.param.UserCouponParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 用户优惠券记录表控制器
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
@Api(tags = "用户优惠券记录表管理")
@RestController
@RequestMapping("/api/shop/user-coupon")
public class UserCouponController extends BaseController {
@Resource
private UserCouponService userCouponService;
@PreAuthorize("hasAuthority('shop:userCoupon:list')")
@OperationLog
@ApiOperation("分页查询用户优惠券记录表")
@GetMapping("/page")
public ApiResult<PageResult<UserCoupon>> page(UserCouponParam param) {
PageParam<UserCoupon, UserCouponParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(userCouponService.page(page, page.getWrapper()));
// 使用关联查询
//return success(userCouponService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:userCoupon:list')")
@OperationLog
@ApiOperation("查询全部用户优惠券记录表")
@GetMapping()
public ApiResult<List<UserCoupon>> list(UserCouponParam param) {
PageParam<UserCoupon, UserCouponParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(userCouponService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(userCouponService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:userCoupon:list')")
@OperationLog
@ApiOperation("根据id查询用户优惠券记录表")
@GetMapping("/{id}")
public ApiResult<UserCoupon> get(@PathVariable("id") Integer id) {
return success(userCouponService.getById(id));
// 使用关联查询
//return success(userCouponService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:userCoupon:save')")
@OperationLog
@ApiOperation("添加用户优惠券记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody UserCoupon userCoupon) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
userCoupon.setUserId(loginUser.getUserId());
}
if (userCouponService.save(userCoupon)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userCoupon:update')")
@OperationLog
@ApiOperation("修改用户优惠券记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody UserCoupon userCoupon) {
if (userCouponService.updateById(userCoupon)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userCoupon:remove')")
@OperationLog
@ApiOperation("删除用户优惠券记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (userCouponService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:userCoupon:save')")
@OperationLog
@ApiOperation("批量添加用户优惠券记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<UserCoupon> list) {
if (userCouponService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userCoupon:update')")
@OperationLog
@ApiOperation("批量修改用户优惠券记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserCoupon> batchParam) {
if (batchParam.update(userCouponService, "user_coupon_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userCoupon:remove')")
@OperationLog
@ApiOperation("批量删除用户优惠券记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (userCouponService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,139 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.UserFollowService;
import com.gxwebsoft.shop.entity.UserFollow;
import com.gxwebsoft.shop.param.UserFollowParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 关注记录表控制器
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
@Api(tags = "关注记录表管理")
@RestController
@RequestMapping("/api/shop/user-follow")
public class UserFollowController extends BaseController {
@Resource
private UserFollowService userFollowService;
@PreAuthorize("hasAuthority('shop:userFollow:list')")
@OperationLog
@ApiOperation("分页查询关注记录表")
@GetMapping("/page")
public ApiResult<PageResult<UserFollow>> page(UserFollowParam param) {
PageParam<UserFollow, UserFollowParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(userFollowService.page(page, page.getWrapper()));
// 使用关联查询
//return success(userFollowService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:userFollow:list')")
@OperationLog
@ApiOperation("查询全部关注记录表")
@GetMapping()
public ApiResult<List<UserFollow>> list(UserFollowParam param) {
PageParam<UserFollow, UserFollowParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(userFollowService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(userFollowService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:userFollow:list')")
@OperationLog
@ApiOperation("根据id查询关注记录表")
@GetMapping("/{id}")
public ApiResult<UserFollow> get(@PathVariable("id") Integer id) {
return success(userFollowService.getById(id));
// 使用关联查询
//return success(userFollowService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:userFollow:save')")
@OperationLog
@ApiOperation("添加关注记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody UserFollow userFollow) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
userFollow.setUserId(loginUser.getUserId());
}
if (userFollowService.save(userFollow)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userFollow:update')")
@OperationLog
@ApiOperation("修改关注记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody UserFollow userFollow) {
if (userFollowService.updateById(userFollow)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userFollow:remove')")
@OperationLog
@ApiOperation("删除关注记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (userFollowService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:userFollow:save')")
@OperationLog
@ApiOperation("批量添加关注记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<UserFollow> list) {
if (userFollowService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userFollow:update')")
@OperationLog
@ApiOperation("批量修改关注记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserFollow> batchParam) {
if (batchParam.update(userFollowService, "log_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userFollow:remove')")
@OperationLog
@ApiOperation("批量删除关注记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (userFollowService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,127 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.UserOauthService;
import com.gxwebsoft.shop.entity.UserOauth;
import com.gxwebsoft.shop.param.UserOauthParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 第三方用户信息表控制器
*
* @author 科技小王子
* @since 2022-12-15 08:33:13
*/
@Api(tags = "第三方用户信息表管理")
@RestController
@RequestMapping("/api/shop/user-oauth")
public class UserOauthController extends BaseController {
@Resource
private UserOauthService userOauthService;
@PreAuthorize("hasAuthority('shop:userOauth:list')")
@OperationLog
@ApiOperation("分页查询第三方用户信息表")
@GetMapping("/page")
public ApiResult<PageResult<UserOauth>> page(UserOauthParam param) {
// 使用关联查询
return success(userOauthService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:userOauth:list')")
@OperationLog
@ApiOperation("查询全部第三方用户信息表")
@GetMapping()
public ApiResult<List<UserOauth>> list(UserOauthParam param) {
// 使用关联查询
return success(userOauthService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:userOauth:list')")
@OperationLog
@ApiOperation("根据id查询第三方用户信息表")
@GetMapping("/{id}")
public ApiResult<UserOauth> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(userOauthService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:userOauth:save')")
@OperationLog
@ApiOperation("添加第三方用户信息表")
@PostMapping()
public ApiResult<?> save(@RequestBody UserOauth userOauth) {
if (userOauthService.save(userOauth)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userOauth:update')")
@OperationLog
@ApiOperation("修改第三方用户信息表")
@PutMapping()
public ApiResult<?> update(@RequestBody UserOauth userOauth) {
if (userOauthService.updateById(userOauth)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userOauth:remove')")
@OperationLog
@ApiOperation("删除第三方用户信息表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (userOauthService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:userOauth:save')")
@OperationLog
@ApiOperation("批量添加第三方用户信息表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<UserOauth> list) {
if (userOauthService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userOauth:update')")
@OperationLog
@ApiOperation("批量修改第三方用户信息表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserOauth> batchParam) {
if (batchParam.update(userOauthService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userOauth:remove')")
@OperationLog
@ApiOperation("批量删除第三方用户信息表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (userOauthService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,139 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.UserPointsLogService;
import com.gxwebsoft.shop.entity.UserPointsLog;
import com.gxwebsoft.shop.param.UserPointsLogParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 用户积分变动明细表控制器
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
@Api(tags = "用户积分变动明细表管理")
@RestController
@RequestMapping("/api/shop/user-points-log")
public class UserPointsLogController extends BaseController {
@Resource
private UserPointsLogService userPointsLogService;
@PreAuthorize("hasAuthority('shop:userPointsLog:list')")
@OperationLog
@ApiOperation("分页查询用户积分变动明细表")
@GetMapping("/page")
public ApiResult<PageResult<UserPointsLog>> page(UserPointsLogParam param) {
PageParam<UserPointsLog, UserPointsLogParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(userPointsLogService.page(page, page.getWrapper()));
// 使用关联查询
//return success(userPointsLogService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:userPointsLog:list')")
@OperationLog
@ApiOperation("查询全部用户积分变动明细表")
@GetMapping()
public ApiResult<List<UserPointsLog>> list(UserPointsLogParam param) {
PageParam<UserPointsLog, UserPointsLogParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(userPointsLogService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(userPointsLogService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:userPointsLog:list')")
@OperationLog
@ApiOperation("根据id查询用户积分变动明细表")
@GetMapping("/{id}")
public ApiResult<UserPointsLog> get(@PathVariable("id") Integer id) {
return success(userPointsLogService.getById(id));
// 使用关联查询
//return success(userPointsLogService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:userPointsLog:save')")
@OperationLog
@ApiOperation("添加用户积分变动明细表")
@PostMapping()
public ApiResult<?> save(@RequestBody UserPointsLog userPointsLog) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
userPointsLog.setUserId(loginUser.getUserId());
}
if (userPointsLogService.save(userPointsLog)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userPointsLog:update')")
@OperationLog
@ApiOperation("修改用户积分变动明细表")
@PutMapping()
public ApiResult<?> update(@RequestBody UserPointsLog userPointsLog) {
if (userPointsLogService.updateById(userPointsLog)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userPointsLog:remove')")
@OperationLog
@ApiOperation("删除用户积分变动明细表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (userPointsLogService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:userPointsLog:save')")
@OperationLog
@ApiOperation("批量添加用户积分变动明细表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<UserPointsLog> list) {
if (userPointsLogService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userPointsLog:update')")
@OperationLog
@ApiOperation("批量修改用户积分变动明细表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserPointsLog> batchParam) {
if (batchParam.update(userPointsLogService, "log_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userPointsLog:remove')")
@OperationLog
@ApiOperation("批量删除用户积分变动明细表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (userPointsLogService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,151 @@
package com.gxwebsoft.shop.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.service.UserRefereeService;
import com.gxwebsoft.shop.entity.UserReferee;
import com.gxwebsoft.shop.param.UserRefereeParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 用户推荐关系表控制器
*
* @author 科技小王子
* @since 2023-04-28 14:07:29
*/
@Api(tags = "用户推荐关系表管理")
@RestController
@RequestMapping("/api/shop/user-referee")
public class UserRefereeController extends BaseController {
@Resource
private UserRefereeService userRefereeService;
@PreAuthorize("hasAuthority('shop:userReferee:list')")
@OperationLog
@ApiOperation("分页查询用户推荐关系表")
@GetMapping("/page")
public ApiResult<PageResult<UserReferee>> page(UserRefereeParam param) {
PageParam<UserReferee, UserRefereeParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(userRefereeService.page(page, page.getWrapper()));
// 使用关联查询
//return success(userRefereeService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:userReferee:list')")
@OperationLog
@ApiOperation("查询全部用户推荐关系表")
@GetMapping()
public ApiResult<List<UserReferee>> list(UserRefereeParam param) {
// 贵港自然资源局定制
if(getTenantId().equals(10048)){
final List<UserReferee> userRefereeList = userRefereeService.listRel(param);
final User user = getLoginUser();
final UserReferee userReferee = new UserReferee();
userReferee.setNickname(user.getNickname());
userRefereeList.add(userReferee);
return success(userRefereeList);
}
// 使用关联查询
return success(userRefereeService.listRel(param));
}
@PreAuthorize("hasAuthority('shop:userReferee:list')")
@OperationLog
@ApiOperation("根据id查询用户推荐关系表")
@GetMapping("/{id}")
public ApiResult<UserReferee> get(@PathVariable("id") Integer id) {
return success(userRefereeService.getById(id));
// 使用关联查询
//return success(userRefereeService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:userReferee:save')")
@OperationLog
@ApiOperation("添加用户推荐关系表")
@PostMapping()
public ApiResult<?> save(@RequestBody UserReferee userReferee) {
// if(userReferee.getDealerId().equals(userReferee.getUserId())){
// return fail("不能邀请自己");
// }
final int count = userRefereeService.count(new LambdaQueryWrapper<UserReferee>()
.eq(UserReferee::getUserId, userReferee.getUserId())
.eq(UserReferee::getDealerId,userReferee.getDealerId())
);
if(count > 0){
return fail("关系已存在");
}
if (userRefereeService.save(userReferee)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userReferee:update')")
@OperationLog
@ApiOperation("修改用户推荐关系表")
@PutMapping()
public ApiResult<?> update(@RequestBody UserReferee userReferee) {
if (userRefereeService.updateById(userReferee)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userReferee:remove')")
@OperationLog
@ApiOperation("删除用户推荐关系表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (userRefereeService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:userReferee:save')")
@OperationLog
@ApiOperation("批量添加用户推荐关系表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<UserReferee> list) {
if (userRefereeService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:userReferee:update')")
@OperationLog
@ApiOperation("批量修改用户推荐关系表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserReferee> batchParam) {
if (batchParam.update(userRefereeService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:userReferee:remove')")
@OperationLog
@ApiOperation("批量删除用户推荐关系表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (userRefereeService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -0,0 +1,223 @@
package com.gxwebsoft.shop.controller;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.core.security.JwtSubject;
import com.gxwebsoft.common.core.security.JwtUtil;
import com.gxwebsoft.common.core.utils.CommonUtil;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.LoginRecord;
import com.gxwebsoft.common.system.entity.Role;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.entity.UserRole;
import com.gxwebsoft.common.system.param.UserParam;
import com.gxwebsoft.common.system.result.LoginResult;
import com.gxwebsoft.common.system.service.*;
import com.gxwebsoft.shop.entity.UserOauth;
import com.gxwebsoft.shop.service.UserOauthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import static com.gxwebsoft.common.core.constants.RedisConstants.ACCESS_TOKEN_KEY;
@RestController
@RequestMapping("/api/shop/wx-login")
@Api(tags = "微信小程序登录API")
public class WxLoginController extends BaseController {
@Resource
private SettingService settingService;
@Resource
private UserService userService;
@Resource
private ConfigProperties configProperties;
@Resource
private UserRoleService userRoleService;
@Resource
private UserOauthService userOauthService;
@Resource
private LoginRecordService loginRecordService;
@Resource
private RoleService roleService;
@Autowired
private StringRedisTemplate redisTemplate;
@ApiOperation("获取微信openId")
@Transactional(rollbackFor = {Exception.class})
@PostMapping("/getOpenId")
public ApiResult<LoginResult> getOpenId(@RequestBody UserParam userParam, HttpServletRequest request) {
// 1.获取openid
JSONObject result = getOpenIdByCode(userParam);
String openid = result.getString("openid");
String unionid = result.getString("unionid");
if (openid == null) {
return fail("获取openid失败", null);
}
// 2.通过openid查询用户是否已存在
User user = userOauthService.getByOauthId(openid);
// 3.存在则签发token并返回登录成功,不存在则注册新用户
if (user == null) {
user = addUser(userParam);
// 添加第三方用户信息
UserOauth uo = new UserOauth();
uo.setUserId(user.getUserId());
uo.setTenantId(user.getTenantId());
uo.setOauthType("MP-WEIXIN");
uo.setOauthId(openid);
uo.setUnionid(unionid);
userOauthService.save(uo);
}
// 4.签发token
loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_LOGIN, null, user.getTenantId(), request);
String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()),
configProperties.getTokenExpireTime(), configProperties.getTokenKey());
return success("登录成功", new LoginResult(access_token, user));
}
@ApiOperation("微信授权手机号码并登录")
@Transactional(rollbackFor = {Exception.class})
@PostMapping("/loginByMpWxPhone")
public ApiResult<LoginResult> loginByMpWxPhone(@RequestBody UserParam userParam, HttpServletRequest request) {
// 获取手机号码
String phone = getPhoneByCode(userParam);
// 查询是否存在
User user = userService.getByPhone(phone);
// 不存在则注册
if (user == null) {
userParam.setPhone(phone);
user = addUser(userParam);
}
// 签发token
String access_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), user.getTenantId()),
configProperties.getTokenExpireTime(), configProperties.getTokenKey());
loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_REGISTER, null, user.getTenantId(), request);
return success("登录成功", new LoginResult(access_token, user));
}
@ApiOperation("微信授权手机号码并更新")
@Transactional(rollbackFor = {Exception.class})
@PostMapping("/updatePhoneByMpWx")
public ApiResult<?> updatePhoneByMpWx(@RequestBody UserParam userParam) {
// 获取微信授权手机号
String phone = getPhoneByCode(userParam);
// 查询当前用户
User user = userService.getById(userParam.getUserId());
if (user != null && phone != null) {
user.setPhone(phone);
userService.updateUser(user);
return success("更新成功",phone);
}
return fail("更新失败");
}
/**
* 新用户注册
*/
private User addUser(UserParam userParam) {
User addUser = new User();
// 注册用户
addUser.setStatus(0);
addUser.setUsername(createUsername("wx_"));
addUser.setNickname("微信用户");
addUser.setPassword(userService.encodePassword(CommonUtil.randomUUID16()));
addUser.setTenantId(getTenantId());
Role role = roleService.getOne(new QueryWrapper<Role>().eq("role_code", "user"), false);
addUser.setRoleId(role.getRoleId());
if (userService.saveUser(addUser)) {
// 添加用户角色
final UserRole userRole = new UserRole();
userRole.setUserId(addUser.getUserId());
userRole.setTenantId(addUser.getTenantId());
userRole.setRoleId(addUser.getRoleId());
userRoleService.save(userRole);
}
return addUser;
}
// 获取openid
private JSONObject getOpenIdByCode(UserParam userParam) {
// 获取微信小程序配置信息
JSONObject setting = settingService.getBySettingKey("mp-weixin");
// 获取openId
String apiUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=" + setting.getString("appId") + "&secret=" + setting.getString("appSecret") + "&js_code=" + userParam.getCode() + "&grant_type=authorization_code";
// 执行get请求
String result = HttpUtil.get(apiUrl);
System.out.println("result = " + result);
// 解析access_token
return JSON.parseObject(result);
}
/**
* 获取微信手机号码
*
* @param userParam 需要传微信凭证code
*/
private String getPhoneByCode(UserParam userParam) {
// 获取手机号码
String apiUrl = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" + getAccessToken();
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("code", userParam.getCode());
// 执行post请求
String post = HttpUtil.post(apiUrl, JSON.toJSONString(paramMap));
JSONObject json = JSON.parseObject(post);
if (json.get("errcode").equals(0)) {
JSONObject phoneInfo = JSON.parseObject(json.getString("phone_info"));
// 微信用户的手机号码
return phoneInfo.getString("phoneNumber");
}
return null;
}
/**
* 生成随机账号
*
* @return username
*/
private String createUsername(String type) {
return type.concat(RandomUtil.randomString(12));
}
/**
* 获取接口调用凭据AccessToken
* https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-access-token/getAccessToken.html
*/
private String getAccessToken() {
// 获取微信小程序配置信息
JSONObject setting = settingService.getBySettingKey("mp-weixin");
// 从缓存获取access_token
String value = redisTemplate.opsForValue().get(ACCESS_TOKEN_KEY.concat(getTenantId().toString()));
if (value != null) {
// 解析access_token
JSONObject response = JSON.parseObject(value);
return response.getString("access_token");
}
// 微信获取凭证接口
String apiUrl = "https://api.weixin.qq.com/cgi-bin/token";
// 组装url参数
String url = apiUrl.concat("?grant_type=client_credential").concat("&appid=").concat(setting.getString("appId")).concat("&secret=").concat(setting.getString("appSecret"));
// 执行get请求
String result = HttpUtil.get(url);
// 解析access_token
JSONObject response = JSON.parseObject(result);
if (response.getString("access_token") != null) {
// 存入缓存
redisTemplate.opsForValue().set(ACCESS_TOKEN_KEY.concat(getTenantId().toString()), result);
return response.getString("access_token");
}
return null;
}
}
@@ -0,0 +1,25 @@
package com.gxwebsoft.shop.controller;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.shop.service.OrderService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping("/api/shop/wx-pay")
@Api(tags = "微信支付API")
public class WxPayController extends BaseController
{
@Resource
private OrderService orderService;
public ApiResult<?> nativePay(@PathVariable String orderId){
return success("支付成功");
}
}
@@ -0,0 +1,76 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 购物车记录表
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Cart对象", description = "购物车记录表")
@TableName("shop_cart")
public class Cart implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "商品ID")
private Integer goodsId;
@ApiModelProperty(value = "商品sku唯一标识")
private String goodsSkuId;
@ApiModelProperty(value = "商品数量")
private Integer goodsNum;
@ApiModelProperty(value = "商品价格")
private BigDecimal goodsPrice;
@ApiModelProperty(value = "商品封面图")
private String image;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,70 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 商品分类表
*
* @author 科技小王子
* @since 2022-11-22 17:45:37
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Category对象", description = "商品分类表")
@TableName("shop_category")
public class Category implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "商品分类ID")
@TableId(value = "category_id", type = IdType.AUTO)
private Integer categoryId;
@ApiModelProperty(value = "分类名称")
private String title;
@ApiModelProperty(value = "上级分类ID")
private Integer parentId;
@ApiModelProperty(value = "分类索引图")
private String image;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "所属商户")
private String merchantCode;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,76 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 商品评价记录表
*
* @author 科技小王子
* @since 2022-11-23 21:18:56
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Comment对象", description = "商品评价记录表")
@TableName("shop_comment")
public class Comment implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "评价ID")
@TableId(value = "comment_id", type = IdType.AUTO)
private Integer commentId;
@ApiModelProperty(value = "评分 (10好评 20中评 30差评)")
private Integer score;
@ApiModelProperty(value = "评价内容")
private String content;
@ApiModelProperty(value = "是否为图片评价")
private Integer isPicture;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "订单ID")
private Integer orderId;
@ApiModelProperty(value = "商品ID")
private Integer goodsId;
@ApiModelProperty(value = "订单商品ID")
private Integer orderGoodsId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,104 @@
package com.gxwebsoft.shop.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 优惠券记录表
*
* @author 科技小王子
* @since 2022-11-28 18:26:05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Coupon对象", description = "优惠券记录表")
@TableName("shop_coupon")
public class Coupon implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "优惠券ID")
@TableId(value = "coupon_id", type = IdType.AUTO)
private Integer couponId;
@ApiModelProperty(value = "优惠券名称")
private String name;
@ApiModelProperty(value = "优惠券类型(10满减券 20折扣券)")
private Integer couponType;
@ApiModelProperty(value = "满减券-减免金额")
private BigDecimal reducePrice;
@ApiModelProperty(value = "折扣券-折扣率(0-100)")
private Integer discount;
@ApiModelProperty(value = "最低消费金额")
private BigDecimal minPrice;
@ApiModelProperty(value = "到期类型(10领取后生效 20固定时间)")
private Integer expireType;
@ApiModelProperty(value = "领取后生效-有效天数")
private Integer expireDay;
@ApiModelProperty(value = "固定时间-开始时间")
private Integer startTime;
@ApiModelProperty(value = "固定时间-结束时间")
private Integer endTime;
@ApiModelProperty(value = "适用范围(10全部商品 20指定商品 30排除商品)")
private Integer applyRange;
@ApiModelProperty(value = "适用范围配置(json格式)")
private String applyRangeConfig;
@ApiModelProperty(value = "发放总数量(-1为不限制)")
private Integer totalNum;
@ApiModelProperty(value = "已领取数量")
private Integer receiveNum;
@ApiModelProperty(value = "优惠券描述")
private String describe;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,70 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 物流公司记录表
*
* @author 科技小王子
* @since 2022-11-22 00:21:07
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Express对象", description = "物流公司记录表")
@TableName("shop_express")
public class Express implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "物流公司ID")
@TableId(value = "express_id", type = IdType.AUTO)
private Integer expressId;
@ApiModelProperty(value = "物流公司名称")
private String expressName;
@ApiModelProperty(value = "物流公司编码 (快递100)")
private String kuaidi100Code;
@ApiModelProperty(value = "物流公司编码 (快递鸟)")
private String kdniaoCode;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,195 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 商品记录表
*
* @author 科技小王子
* @since 2022-11-23 12:47:16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Goods对象", description = "商品记录表")
@TableName("shop_goods")
public class Goods implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "商品ID")
@TableId(value = "goods_id", type = IdType.AUTO)
private Integer goodsId;
@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "商品编码")
private String goodsCode;
@ApiModelProperty(value = "商品规格(10单规格 20多规格)")
private Integer goodsType;
@ApiModelProperty(value = "商品分类ID")
private Integer categoryId;
@ApiModelProperty(value = "分类名称")
@TableField(exist = false)
private String categoryName;
@ApiModelProperty(value = "商品封面图")
private String image;
@ApiModelProperty(value = "上传的文件")
private String files;
@ApiModelProperty(value = "主图视频路径")
private String videoUrl;
@ApiModelProperty(value = "商品卖点")
private String sellingPoint;
@ApiModelProperty(value = "商品规格(10单规格 20多规格)")
private Integer specType;
@ApiModelProperty(value = "商品价格(最低)")
private BigDecimal goodsPriceMin;
@ApiModelProperty(value = "商品价格(最高)")
private BigDecimal goodsPriceMax;
@ApiModelProperty(value = "划线价格(最低)")
private BigDecimal linePriceMin;
@ApiModelProperty(value = "划线价格(最高)")
private BigDecimal linePriceMax;
@ApiModelProperty(value = "库存总量(包含所有sku)")
private Integer stockTotal;
@ApiModelProperty(value = "库存计算方式(10下单减库存 20付款减库存)")
private Integer deductStockType;
@ApiModelProperty(value = "商品详情")
private String content;
@ApiModelProperty(value = "初始销量")
private Integer salesInitial;
@ApiModelProperty(value = "实际销量")
private Integer salesActual;
@ApiModelProperty(value = "配送方式")
private Integer deliveryType;
@ApiModelProperty(value = "配送模板ID")
private Integer deliveryId;
@ApiModelProperty(value = "是否开启积分赠送(1开启 0关闭)")
private Integer isPointsGift;
@ApiModelProperty(value = "是否允许使用积分抵扣(1允许 0不允许)")
private Integer isPointsDiscount;
@ApiModelProperty(value = "积分抵扣设置(0默认抵扣 1单独设置抵扣)")
private Integer isAlonePointsDiscount;
@ApiModelProperty(value = "单独设置积分抵扣的配置")
private String pointsDiscountConfig;
@ApiModelProperty(value = "是否开启会员折扣(1开启 0关闭)")
private Integer isEnableGrade;
@ApiModelProperty(value = "会员折扣设置(0默认等级折扣 1单独设置折扣)")
private Integer isAloneGrade;
@ApiModelProperty(value = "单独设置折扣的配置")
private String aloneGradeEquity;
@ApiModelProperty(value = "是否推荐")
private Integer isHot;
@ApiModelProperty(value = "规格单位")
private String unit;
@ApiModelProperty(value = "餐段")
private String period;
@ApiModelProperty(value = "档口")
private Integer gear;
@ApiModelProperty(value = "商品重量")
private Double goodsWeight;
@ApiModelProperty(value = "商品优惠属性: 0无 1限时特惠 2特惠专区")
private Integer attribute;
@ApiModelProperty(value = "是否开启单独分销(0关闭 1开启)")
private Integer isIndDealer;
@ApiModelProperty(value = "是否开启限购")
private Integer purchaseLimit;
@ApiModelProperty(value = "分销佣金类型(10百分比 20固定金额)")
private Integer dealerMoneyType;
@ApiModelProperty(value = "分销佣金(一级)")
private BigDecimal firstMoney;
@ApiModelProperty(value = "分销佣金(二级)")
private BigDecimal secondMoney;
@ApiModelProperty(value = "分销佣金(三级)")
private BigDecimal thirdMoney;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0上架, 1下架")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编号")
private String merchantCode;
@ApiModelProperty(value = "商户名称")
@TableField(exist = false)
private String merchantName;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "购物车购买数量")
@TableField(exist = false)
private Integer totalNum;
@ApiModelProperty(value = "已预定份数")
@TableField(exist = false)
private Integer deliveryTimes;
@ApiModelProperty(value = "未领取份数")
@TableField(exist = false)
private Integer noDeliveryTimes;
}
@@ -0,0 +1,71 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 商品服务与承诺记录表
*
* @author 科技小王子
* @since 2022-11-23 21:57:50
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "GoodsService对象", description = "商品服务与承诺记录表")
@TableName("shop_goods_service")
public class GoodsService implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "商品服务ID")
@TableId(value = "service_id", type = IdType.AUTO)
private Integer serviceId;
@ApiModelProperty(value = "服务名称")
private String name;
@ApiModelProperty(value = "概述")
private String summary;
@ApiModelProperty(value = "是否默认(新增商品时)")
private Integer isDefault;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,50 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 商城会员
*
* @author 科技小王子
* @since 2022-11-25 14:02:24
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Member对象", description = "商城会员")
@TableName("shop_member")
public class Member implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "member_id", type = IdType.AUTO)
private Integer memberId;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty("登录账号")
@TableField(exist = false)
private String username;
@ApiModelProperty("用户昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty("用户信息")
@TableField(exist = false)
private User user;
}
@@ -0,0 +1,176 @@
package com.gxwebsoft.shop.entity;
import java.math.BigDecimal;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import static java.lang.Character.isDigit;
/**
* 商户管理
*
* @author 科技小王子
* @since 2022-11-30 15:10:54
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Merchant对象", description = "商户管理")
@TableName("shop_merchant")
public class Merchant implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "商户ID")
@TableId(value = "merchant_id", type = IdType.AUTO)
private Integer merchantId;
@ApiModelProperty(value = "商户名称")
private String merchantName;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "商户类型")
private String merchantType;
@ApiModelProperty(value = "当前可提现金额")
private BigDecimal money;
@ApiModelProperty(value = "已冻结金额")
private BigDecimal freezeMoney;
@ApiModelProperty(value = "累积提现金额")
private BigDecimal totalMoney;
@ApiModelProperty(value = "商户logo")
private String logo;
@ApiModelProperty(value = "商户背景图片")
private String background;
@ApiModelProperty(value = "营业时间")
private String merchantHours;
@ApiModelProperty(value = "所在省份")
private String province;
@ApiModelProperty(value = "所在城市")
private String city;
@ApiModelProperty(value = "所在辖区")
private String region;
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "商户详情")
private String content;
@ApiModelProperty(value = "商户坐标经纬度")
private String lngAndLat;
@ApiModelProperty(value = "geohash")
private String geohash;
@ApiModelProperty(value = "商户简介")
private String summary;
@ApiModelProperty(value = "打款方式 (10微信 20支付宝 30银行卡)")
private Integer payType;
@ApiModelProperty(value = "支付宝姓名")
private String alipayName;
@ApiModelProperty(value = "支付宝账号")
private String alipayAccount;
@ApiModelProperty(value = "开户行名称")
private String bankName;
@ApiModelProperty(value = "银行开户名")
private String bankAccount;
@ApiModelProperty(value = "银行卡号")
private String bankCard;
@ApiModelProperty(value = "是否可编辑 0 商户可编辑 1 管理员可编辑")
private Integer isEdit;
@ApiModelProperty(value = "是否支持自提核销(0否 1支持)")
private Integer isCheck;
@ApiModelProperty(value = "店主")
private Integer merchantOwner;
@ApiModelProperty(value = "门店联系电话")
private String merchantPhone;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "客户ID")
private Integer customerId;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty("登录账号")
@TableField(exist = false)
private String username;
@ApiModelProperty("用户昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "联系电话")
@TableField(exist = false)
private String phone;
@ApiModelProperty(value = "距离")
@TableField(exist = false)
private Double distance;
@ApiModelProperty(value = "店铺ID")
@TableField(exist = false)
private Long shopId;
@ApiModelProperty(value = "哗啦啦店铺信息")
@TableField(exist = false)
private Object shopInfo;
public Long getShopId(){
if(NumberUtil.isLong(this.merchantCode)){
return Long.parseLong(merchantCode);
}
return null;
}
}
@@ -0,0 +1,57 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 商家门店店员表
*
* @author 科技小王子
* @since 2022-11-30 16:32:25
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "MerchantClerk对象", description = "商家门店店员表")
@TableName("shop_merchant_clerk")
public class MerchantClerk implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "商户人员ID")
@TableId(value = "clerk_id", type = IdType.AUTO)
private Integer clerkId;
@ApiModelProperty(value = "关联商户编号")
private String merchantCode;
@ApiModelProperty(value = "关联商户名称")
@TableField(exist = false)
private String merchantName;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "是否为商户主")
private Integer isOwner;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty("用户信息")
@TableField(exist = false)
private User user;
}
@@ -0,0 +1,101 @@
package com.gxwebsoft.shop.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 商户提现记录
*
* @author 科技小王子
* @since 2022-12-02 00:41:09
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "MerchantWithdraw对象", description = "商户提现记录")
@TableName("shop_merchant_withdraw")
public class MerchantWithdraw implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "提现单号")
private String withdrawCode;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "提现金额")
private BigDecimal money;
@ApiModelProperty(value = "打款方式 (10微信 20支付宝 30银行卡)")
private Integer payType;
@ApiModelProperty(value = "支付宝姓名")
private String alipayName;
@ApiModelProperty(value = "支付宝账号")
private String alipayAccount;
@ApiModelProperty(value = "开户行名称")
private String bankName;
@ApiModelProperty(value = "银行开户名")
private String bankAccount;
@ApiModelProperty(value = "银行卡号")
private String bankCard;
@ApiModelProperty(value = "申请状态 (10待审核 20审核通过 30驳回 40已打款)")
private Integer applyStatus;
@ApiModelProperty(value = "审核时间")
private Integer auditTime;
@ApiModelProperty(value = "驳回原因")
private String rejectReason;
@ApiModelProperty(value = "来源客户端(APP、H5、小程序等)")
private String platform;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "关联商户编号")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "商户名称")
@TableField(exist = false)
private String merchantName;
}
@@ -0,0 +1,261 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.gxwebsoft.apps.entity.Equipment;
import com.gxwebsoft.apps.entity.EquipmentOrderGoods;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 订单记录表
*
* @author WebSoft
* @since 2022-11-16 11:25:58
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Order对象", description = "订单记录表")
@TableName("shop_order")
public class Order implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "订单ID")
@TableId(value = "order_id", type = IdType.AUTO)
private Integer orderId;
@ApiModelProperty(value = "订单标题")
private String subject;
@ApiModelProperty(value = "订单号")
private Long orderNo;
@ApiModelProperty(value = "商品总金额(不含优惠折扣)")
private BigDecimal totalPrice;
@ApiModelProperty(value = "订单金额(含优惠折扣)")
private BigDecimal orderPrice;
@ApiModelProperty(value = "优惠券ID")
private Integer couponId;
@ApiModelProperty(value = "优惠券抵扣金额")
private BigDecimal couponMoney;
@ApiModelProperty(value = "积分抵扣金额")
private BigDecimal pointsMoney;
@ApiModelProperty(value = "积分抵扣数量")
private Integer pointsNum;
@ApiModelProperty(value = "实际付款金额(包含运费)")
private BigDecimal payPrice;
@ApiModelProperty(value = "第三方支付实收金额")
private BigDecimal receiptAmount;
@ApiModelProperty(value = "后台修改的订单金额(差价)")
private BigDecimal updatePrice;
@ApiModelProperty(value = "买家留言")
private String buyerRemark;
@ApiModelProperty(value = "支付方式(废弃)")
private Integer payType;
@ApiModelProperty(value = "支付方式(余额/微信/支付宝)")
private String payMethod;
@ApiModelProperty(value = "付款状态(10未付款 20已付款)")
private Integer payStatus;
@ApiModelProperty(value = "付款时间")
private Date payTime;
@ApiModelProperty(value = "服务开始时间")
private Date startTime;
@ApiModelProperty(value = "服务到期时间")
private Date expirationTime;
@ApiModelProperty(value = "购买月份数量")
private Integer month;
@ApiModelProperty(value = "0星期日 1星期一 2星期二 3星期三 4星期四 5星期五 6星期六")
private Integer week;
@ApiModelProperty(value = "第三方交易记录ID")
private String tradeId;
@ApiModelProperty(value = "配送方式(10快递配送 20门店自提)")
private Integer deliveryType;
@ApiModelProperty(value = "自提门店ID")
private Integer extractShopId;
@ApiModelProperty(value = "核销店员ID")
private Integer extractClerkId;
@ApiModelProperty(value = "运费金额")
private BigDecimal expressPrice;
@ApiModelProperty(value = "物流公司ID (废弃)")
private Integer expressId;
@ApiModelProperty(value = "物流单号 (废弃)")
private String expressNo;
@ApiModelProperty(value = "发货状态(10未发货 20已发货 30部分发货)")
private Integer deliveryStatus;
@ApiModelProperty(value = "发货时间")
private Date deliveryTime;
@ApiModelProperty(value = "收货状态(10未收货 20已收货)")
private Integer receiptStatus;
@ApiModelProperty(value = "收货时间")
private Date receiptTime;
@ApiModelProperty(value = "订单状态(10进行中 20取消 21待取消 30已完成)")
private Integer orderStatus;
@ApiModelProperty(value = "赠送的积分数量")
private Integer pointsBonus;
@ApiModelProperty(value = "商家备注")
private String merchantRemark;
@ApiModelProperty(value = "订单是否已结算(0未结算 1已结算)")
private Integer isSettled;
@ApiModelProperty(value = "最后结算时间")
private Date settledTime;
@ApiModelProperty(value = "续租订单的关联单号")
private Integer rentOrderId;
@ApiModelProperty(value = "微信支付交易号(废弃)")
private String transactionId;
@ApiModelProperty(value = "是否已评价(0否 1是)")
private Integer isComment;
@ApiModelProperty(value = "订单来源(10普通订单 20砍价订单 30秒杀订单)")
private Integer orderSource;
@ApiModelProperty(value = "来源记录ID")
private Integer orderSourceId;
@ApiModelProperty(value = "来源记录的参数 (json格式)")
private String orderSourceData;
@ApiModelProperty(value = "电池租金")
private BigDecimal batteryRent;
@ApiModelProperty(value = "电池押金")
private BigDecimal batteryDeposit;
@ApiModelProperty(value = "保险")
private BigDecimal batteryInsurance;
@ApiModelProperty(value = "来源客户端 (APP、H5、小程序等)")
private String platform;
@ApiModelProperty(value = "是否续费订单")
private Integer isRenew;
@ApiModelProperty(value = "是否临时报餐")
private Integer isTemporary;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "商品ID")
private Integer goodsId;
@ApiModelProperty(value = "设备ID")
private Integer equipmentId;
@ApiModelProperty(value = "商户编号")
private String merchantCode;
@ApiModelProperty(value = "商户名称")
@TableField(exist = false)
private String merchantName;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty("账号")
@TableField(exist = false)
private String username;
@ApiModelProperty("用户别名")
@TableField(exist = false)
private String alias;
@ApiModelProperty("用户昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "联系电话")
@TableField(exist = false)
private String phone;
@ApiModelProperty(value = "头像")
@TableField(exist = false)
private String avatar;
@ApiModelProperty(value = "所属部门")
@TableField(exist = false)
private Integer organizationId;
@ApiModelProperty(value = "部门名称")
@TableField(exist = false)
private String organizationName;
@ApiModelProperty("商品列表")
@TableField(exist = false)
private List<OrderGoods> goodsList;
@ApiModelProperty("管理电池商品")
@TableField(exist = false)
private EquipmentOrderGoods equipmentGoods;
@ApiModelProperty("设备")
@TableField(exist = false)
private Equipment equipment;
@ApiModelProperty("推荐人ID")
@TableField(exist = false)
private Integer dealerId;
}
@@ -0,0 +1,81 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* 订单收货地址记录表
*
* @author 科技小王子
* @since 2022-12-02 21:21:10
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "OrderAddress对象", description = "订单收货地址记录表")
@TableName("shop_order_address")
public class OrderAddress implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "地址ID")
@TableId(value = "order_address_id", type = IdType.AUTO)
private Integer orderAddressId;
@ApiModelProperty(value = "收货人姓名")
private String name;
@ApiModelProperty(value = "联系电话")
private String phone;
@ApiModelProperty(value = "省份ID")
private Integer provinceId;
@ApiModelProperty(value = "城市ID")
private Integer cityId;
@ApiModelProperty(value = "区/县ID")
private Integer regionId;
@ApiModelProperty(value = "详细地址")
private String detail;
@ApiModelProperty(value = "订单ID")
private Integer orderId;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "关联商户编号")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,193 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 订单商品记录表
*
* @author 科技小王子
* @since 2022-12-09 17:15:31
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "OrderGoods对象", description = "订单商品记录表")
@TableName("shop_order_goods")
public class OrderGoods implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "订单商品ID")
@TableId(value = "order_goods_id", type = IdType.AUTO)
private Integer orderGoodsId;
@ApiModelProperty(value = "商品ID")
private Integer goodsId;
@ApiModelProperty(value = "商品名称")
private String goodsName;
@ApiModelProperty(value = "商品分类ID")
private Integer categoryId;
@ApiModelProperty(value = "分类名称")
@TableField(exist = false)
private String categoryName;
@ApiModelProperty(value = "商品封面图")
private String imageUrl;
@ApiModelProperty(value = "商品封面图ID")
private Integer imageId;
@ApiModelProperty(value = "库存计算方式(10下单减库存 20付款减库存)")
private Integer deductStockType;
@ApiModelProperty(value = "规格类型(10单规格 20多规格)")
private Integer specType;
@ApiModelProperty(value = "商品sku唯一标识")
private String goodsSkuId;
@ApiModelProperty(value = "SKU的规格属性(json格式)")
private String goodsProps;
@ApiModelProperty(value = "商品详情")
private String content;
@ApiModelProperty(value = "商品编码")
private String goodsNo;
@ApiModelProperty(value = "商品价格(单价)")
private BigDecimal goodsPrice;
@ApiModelProperty(value = "商品划线价")
private BigDecimal linePrice;
@ApiModelProperty(value = "商品重量(Kg)")
private Double goodsWeight;
@ApiModelProperty(value = "是否存在会员等级折扣")
private Integer isUserGrade;
@ApiModelProperty(value = "会员折扣比例(0-10)")
private Integer gradeRatio;
@ApiModelProperty(value = "会员折扣的商品单价")
private BigDecimal gradeGoodsPrice;
@ApiModelProperty(value = "会员折扣的总额差")
private BigDecimal gradeTotalMoney;
@ApiModelProperty(value = "优惠券折扣金额")
private BigDecimal couponMoney;
@ApiModelProperty(value = "积分金额")
private BigDecimal pointsMoney;
@ApiModelProperty(value = "积分抵扣数量")
private Integer pointsNum;
@ApiModelProperty(value = "赠送的积分数量")
private Integer pointsBonus;
@ApiModelProperty(value = "付款状态(10未付款 20已付款)")
@TableField(exist = false)
private Integer payStatus;
@ApiModelProperty(value = "购买数量")
private Integer totalNum;
@ApiModelProperty(value = "商品总价(数量×单价)")
private BigDecimal totalPrice;
@ApiModelProperty(value = "实际付款价(折扣和优惠后)")
private BigDecimal totalPayPrice;
@ApiModelProperty(value = "发货状态(10未发货 20已发货 30部分发货)")
private Integer deliveryStatus;
@ApiModelProperty(value = "发货时间")
@TableField(exist = false)
private Date deliveryTime;
@ApiModelProperty(value = "已发货数量")
private Integer deliveryNum;
@ApiModelProperty(value = "所属档口")
private Integer gear;
@ApiModelProperty(value = "是否开启单独分销(0关闭 1开启)")
private Integer isIndDealer;
@ApiModelProperty(value = "分销佣金类型(10百分比 20固定金额)")
private Integer dealerMoneyType;
@ApiModelProperty(value = "分销佣金(一级)")
private BigDecimal firstMoney;
@ApiModelProperty(value = "分销佣金(二级)")
private BigDecimal secondMoney;
@ApiModelProperty(value = "分销佣金(三级)")
private BigDecimal thirdMoney;
@ApiModelProperty(value = "是否已评价(0否 1是)")
private Integer isComment;
@ApiModelProperty(value = "订单ID")
private Integer orderId;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "来源记录ID")
private Integer goodsSourceId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "用户昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "订单状态")
@TableField(exist = false)
private Integer orderStatus;
@ApiModelProperty("是否允许取消")
@TableField(exist = false)
private Boolean isCancel;
@ApiModelProperty("导出数据")
@TableField(exist = false)
private Object exportData;
}
@@ -0,0 +1,117 @@
package com.gxwebsoft.shop.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 售后单记录表
*
* @author 科技小王子
* @since 2023-05-18 13:09:51
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "OrderRefund对象", description = "售后单记录表")
@TableName("shop_order_refund")
public class OrderRefund implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "售后单ID")
@TableId(value = "order_refund_id", type = IdType.AUTO)
private Integer orderRefundId;
@ApiModelProperty(value = "订单ID")
private Integer orderId;
@ApiModelProperty(value = "订单商品ID")
private Integer orderGoodsId;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "售后类型(10退货退款 20换货)")
private Integer type;
@ApiModelProperty(value = "用户申请原因(说明)")
private String applyDesc;
@ApiModelProperty(value = "商家审核状态(0待审核 10已同意 20已拒绝)")
private Integer auditStatus;
@ApiModelProperty(value = "商家拒绝原因(说明)")
private String refuseDesc;
@ApiModelProperty(value = "实际退款金额")
private BigDecimal refundMoney;
@ApiModelProperty(value = "用户是否发货(0未发货 1已发货)")
private Integer isUserSend;
@ApiModelProperty(value = "用户发货时间")
private Integer sendTime;
@ApiModelProperty(value = "用户发货物流公司ID")
private String expressId;
@ApiModelProperty(value = "用户发货物流单号")
private String expressNo;
@ApiModelProperty(value = "商家收货状态(0未收货 1已收货)")
private Integer isReceipt;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "头像")
@TableField(exist = false)
private String avatar;
@ApiModelProperty(value = "设备编号")
@TableField(exist = false)
private String equipmentCode;
@ApiModelProperty(value = "商户名称")
@TableField(exist = false)
private String merchantName;
}
@@ -0,0 +1,82 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 售后单退货地址记录表
*
* @author 科技小王子
* @since 2023-05-18 13:09:51
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "OrderRefundAddress对象", description = "售后单退货地址记录表")
@TableName("shop_order_refund_address")
public class OrderRefundAddress implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "售后单ID")
private Integer orderRefundId;
@ApiModelProperty(value = "收货人姓名")
private String name;
@ApiModelProperty(value = "联系电话")
private String phone;
@ApiModelProperty(value = "所在省份ID")
private Integer provinceId;
@ApiModelProperty(value = "所在城市ID")
private Integer cityId;
@ApiModelProperty(value = "所在区/县ID")
private Integer regionId;
@ApiModelProperty(value = "详细地址")
private String detail;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,77 @@
package com.gxwebsoft.shop.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 续费订单记录表
*
* @author 科技小王子
* @since 2023-04-13 10:34:35
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "OrderRenew对象", description = "续费订单记录表")
@TableName("shop_order_renew")
public class OrderRenew implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "续费单ID")
@TableId(value = "order_renew_id", type = IdType.AUTO)
private Integer orderRenewId;
@ApiModelProperty(value = "订单ID")
private Integer orderId;
@ApiModelProperty(value = "订单商品ID")
private Integer orderGoodsId;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "类型(10续费订单)")
private Integer type;
@ApiModelProperty(value = "实际续费金额")
private BigDecimal renewMoney;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,72 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.tika.config.Field;
/**
* 商城支付方式记录表
*
* @author 科技小王子
* @since 2022-12-15 19:11:07
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Payment对象", description = "商城支付方式记录表")
@TableName("shop_payment")
public class Payment implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "支付方式ID")
@TableId(value = "payment_id", type = IdType.AUTO)
private Integer paymentId;
@ApiModelProperty(value = "支付方式(微信、支付宝、余额)")
private String method;
@ApiModelProperty(value = "编码")
private String paymentCode;
@ApiModelProperty(value = "支付配置(json格式)")
private String config;
@ApiModelProperty(value = "是否为默认支付方式")
private Integer isDefault;
@ApiModelProperty(value = "是否启用")
private Integer isEnable;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,76 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 商城支付模板记录表
*
* @author 科技小王子
* @since 2022-12-09 13:59:38
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "PaymentTemplate对象", description = "商城支付模板记录表")
@TableName("shop_payment_template")
public class PaymentTemplate implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "支付模板ID")
@TableId(value = "template_id", type = IdType.AUTO)
private Integer templateId;
@ApiModelProperty(value = "支付模板名称")
private String name;
@ApiModelProperty(value = "支付方式(微信、支付宝、余额)")
private String method;
@ApiModelProperty(value = "支付配置(json格式)")
private String config;
@ApiModelProperty(value = "管理员备注")
private String remarks;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,91 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 第三方支付交易记录表
*
* @author 科技小王子
* @since 2022-12-09 13:59:38
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "PaymentTrade对象", description = "第三方支付交易记录表")
@TableName("shop_payment_trade")
public class PaymentTrade implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "交易记录ID")
@TableId(value = "trade_id", type = IdType.AUTO)
private Integer tradeId;
@ApiModelProperty(value = "交易订单号(全局唯一)")
private String outTradeNo;
@ApiModelProperty(value = "发起客户端(H5、小程序、APP)")
private String client;
@ApiModelProperty(value = "支付方式(微信、支付宝)")
private String payMethod;
@ApiModelProperty(value = "订单类型(10商城订单 100余额充值订单)")
private Integer orderType;
@ApiModelProperty(value = "订单ID(商城订单、充值订单)")
private Integer orderId;
@ApiModelProperty(value = "商城订单号(商城订单、充值订单)")
private String orderNo;
@ApiModelProperty(value = "第三方交易流水号")
private String tradeNo;
@ApiModelProperty(value = "预支付交易会话ID(微信支付)")
private String prepayId;
@ApiModelProperty(value = "交易状态")
private Integer tradeState;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,112 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 会员充值订单表
*
* @author 科技小王子
* @since 2023-04-20 20:36:24
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "RechargeOrder对象", description = "会员充值订单表")
@TableName("shop_recharge_order")
public class RechargeOrder implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "订单ID")
@TableId(value = "order_id", type = IdType.AUTO)
private Integer orderId;
@ApiModelProperty(value = "订单号")
private Long orderNo;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "部门ID")
private Integer organizationId;
@ApiModelProperty(value = "部门名称")
@TableField(exist = false)
private String organizationName;
@ApiModelProperty(value = "充值方式(10自定义金额 20套餐充值)")
private Integer rechargeType;
@ApiModelProperty(value = "充值套餐ID")
private Integer planId;
@ApiModelProperty(value = "用户支付金额")
private BigDecimal payPrice;
@ApiModelProperty(value = "赠送金额")
private BigDecimal giftMoney;
@ApiModelProperty(value = "实际到账金额")
private BigDecimal actualMoney;
@ApiModelProperty(value = "用户余额")
private BigDecimal balance;
@ApiModelProperty(value = "支付方式(微信/支付宝)")
private String payMethod;
@ApiModelProperty(value = "支付状态(10待支付 20已支付)")
private Integer payStatus;
@ApiModelProperty(value = "付款时间")
private Integer payTime;
@ApiModelProperty(value = "第三方交易记录ID")
private Integer tradeId;
@ApiModelProperty(value = "来源客户端 (APP、H5、小程序等)")
private String platform;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "用户头像")
@TableField(exist = false)
private String avatar;
}
@@ -0,0 +1,80 @@
package com.gxwebsoft.shop.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 会员充值订单套餐快照表
*
* @author 科技小王子
* @since 2023-04-20 20:36:24
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "RechargeOrderPlan对象", description = "会员充值订单套餐快照表")
@TableName("shop_recharge_order_plan")
public class RechargeOrderPlan implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "order_plan_id", type = IdType.AUTO)
private Integer orderPlanId;
@ApiModelProperty(value = "订单ID")
private Integer orderId;
@ApiModelProperty(value = "主键ID")
private Integer planId;
@ApiModelProperty(value = "方案名称")
private String planName;
@ApiModelProperty(value = "充值金额")
private BigDecimal money;
@ApiModelProperty(value = "赠送金额")
private BigDecimal giftMoney;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,74 @@
package com.gxwebsoft.shop.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 会员充值套餐表
*
* @author 科技小王子
* @since 2023-04-20 20:36:24
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "RechargePlan对象", description = "会员充值套餐表")
@TableName("shop_recharge_plan")
public class RechargePlan implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "plan_id", type = IdType.AUTO)
private Integer planId;
@ApiModelProperty(value = "套餐名称")
private String planName;
@ApiModelProperty(value = "充值金额")
private BigDecimal money;
@ApiModelProperty(value = "赠送金额")
private BigDecimal giftMoney;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "所属门店ID")
private Integer shopId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,76 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户收货地址表
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "UserAddress对象", description = "用户收货地址表")
@TableName("shop_user_address")
public class UserAddress implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "address_id", type = IdType.AUTO)
private Integer addressId;
@ApiModelProperty(value = "收货人姓名")
private String name;
@ApiModelProperty(value = "联系电话")
private String phone;
@ApiModelProperty(value = "省份ID")
private Integer provinceId;
@ApiModelProperty(value = "城市ID")
private Integer cityId;
@ApiModelProperty(value = "区/县ID")
private Integer regionId;
@ApiModelProperty(value = "详细地址")
private String detail;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,81 @@
package com.gxwebsoft.shop.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户余额变动明细表
*
* @author 科技小王子
* @since 2023-04-21 15:59:09
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "UserBalanceLog对象", description = "用户余额变动明细表")
@TableName("shop_user_balance_log")
public class UserBalanceLog implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "log_id", type = IdType.AUTO)
private Integer logId;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "余额变动场景(10用户充值 20用户消费 30管理员操作 40订单退款)")
private Integer scene;
@ApiModelProperty(value = "变动金额")
private BigDecimal money;
@ApiModelProperty(value = "变动后余额")
private BigDecimal balance;
@ApiModelProperty(value = "管理员备注")
private String remark;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "用户头像")
@TableField(exist = false)
private String avatar;
}
@@ -0,0 +1,101 @@
package com.gxwebsoft.shop.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户优惠券记录表
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "UserCoupon对象", description = "用户优惠券记录表")
@TableName("shop_user_coupon")
public class UserCoupon implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "user_coupon_id", type = IdType.AUTO)
private Integer userCouponId;
@ApiModelProperty(value = "优惠券ID")
private Integer couponId;
@ApiModelProperty(value = "优惠券名称")
private String name;
@ApiModelProperty(value = "优惠券类型(10满减券 20折扣券)")
private Integer couponType;
@ApiModelProperty(value = "满减券-减免金额")
private BigDecimal reducePrice;
@ApiModelProperty(value = "折扣券-折扣率(0-100)")
private Integer discount;
@ApiModelProperty(value = "最低消费金额")
private BigDecimal minPrice;
@ApiModelProperty(value = "到期类型(10领取后生效 20固定时间)")
private Integer expireType;
@ApiModelProperty(value = "领取后生效-有效天数")
private Integer expireDay;
@ApiModelProperty(value = "有效期开始时间")
private Integer startTime;
@ApiModelProperty(value = "有效期结束时间")
private Integer endTime;
@ApiModelProperty(value = "适用范围(10全部商品 20指定商品)")
private Integer applyRange;
@ApiModelProperty(value = "适用范围配置(json格式)")
private String applyRangeConfig;
@ApiModelProperty(value = "是否过期(0未过期 1已过期)")
private Integer isExpire;
@ApiModelProperty(value = "是否已使用(0未使用 1已使用)")
private Integer isUse;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,64 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 关注记录表
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "UserFollow对象", description = "关注记录表")
@TableName("shop_user_follow")
public class UserFollow implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "log_id", type = IdType.AUTO)
private Integer logId;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "商铺ID")
private Integer shopId;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,70 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 第三方用户信息表
*
* @author 科技小王子
* @since 2022-12-15 08:33:13
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "UserOauth对象", description = "第三方用户信息表")
@TableName("shop_user_oauth")
public class UserOauth implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "第三方登陆类型(MP-WEIXIN)")
private String oauthType;
@ApiModelProperty(value = "第三方用户唯一标识 (uid openid)")
private String oauthId;
@ApiModelProperty(value = "微信unionID")
private String unionid;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "商户编码")
private String merchantCode;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,67 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户积分变动明细表
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "UserPointsLog对象", description = "用户积分变动明细表")
@TableName("shop_user_points_log")
public class UserPointsLog implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "log_id", type = IdType.AUTO)
private Integer logId;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "变动数量")
private Integer value;
@ApiModelProperty(value = "描述/说明")
private String describe;
@ApiModelProperty(value = "管理员备注")
private String remark;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,82 @@
package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户推荐关系表
*
* @author 科技小王子
* @since 2023-04-28 14:07:29
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "UserReferee对象", description = "用户推荐关系表")
@TableName("shop_user_referee")
public class UserReferee implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "推荐人ID")
private Integer dealerId;
@ApiModelProperty(value = "用户id(被推荐人)")
private Integer userId;
@ApiModelProperty(value = "推荐关系层级(1,2,3)")
private Integer level;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "推荐人")
@TableField(exist = false)
private User dealer;
@ApiModelProperty(value = "被推荐人")
@TableField(exist = false)
private User user;
@ApiModelProperty(value = "被推荐人的报餐信息")
@TableField(exist = false)
private List<Order> order;
@ApiModelProperty(value = "被推荐人的报餐菜品")
@TableField(exist = false)
private List<OrderGoods> orderGoods;
@ApiModelProperty(value = "被推荐人昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "推荐人昵称")
@TableField(exist = false)
private String dealerName;
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Cart;
import com.gxwebsoft.shop.param.CartParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 购物车记录表Mapper
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
public interface CartMapper extends BaseMapper<Cart> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Cart>
*/
List<Cart> selectPageRel(@Param("page") IPage<Cart> page,
@Param("param") CartParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Cart> selectListRel(@Param("param") CartParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Category;
import com.gxwebsoft.shop.param.CategoryParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商品分类表Mapper
*
* @author 科技小王子
* @since 2022-11-22 17:45:37
*/
public interface CategoryMapper extends BaseMapper<Category> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Category>
*/
List<Category> selectPageRel(@Param("page") IPage<Category> page,
@Param("param") CategoryParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Category> selectListRel(@Param("param") CategoryParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Comment;
import com.gxwebsoft.shop.param.CommentParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商品评价记录表Mapper
*
* @author 科技小王子
* @since 2022-11-23 21:18:56
*/
public interface CommentMapper extends BaseMapper<Comment> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Comment>
*/
List<Comment> selectPageRel(@Param("page") IPage<Comment> page,
@Param("param") CommentParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Comment> selectListRel(@Param("param") CommentParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Coupon;
import com.gxwebsoft.shop.param.CouponParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 优惠券记录表Mapper
*
* @author 科技小王子
* @since 2022-11-28 18:26:05
*/
public interface CouponMapper extends BaseMapper<Coupon> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Coupon>
*/
List<Coupon> selectPageRel(@Param("page") IPage<Coupon> page,
@Param("param") CouponParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Coupon> selectListRel(@Param("param") CouponParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Express;
import com.gxwebsoft.shop.param.ExpressParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 物流公司记录表Mapper
*
* @author 科技小王子
* @since 2022-11-22 00:21:07
*/
public interface ExpressMapper extends BaseMapper<Express> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Express>
*/
List<Express> selectPageRel(@Param("page") IPage<Express> page,
@Param("param") ExpressParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Express> selectListRel(@Param("param") ExpressParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Goods;
import com.gxwebsoft.shop.param.GoodsParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商品记录表Mapper
*
* @author 科技小王子
* @since 2022-11-23 12:47:16
*/
public interface GoodsMapper extends BaseMapper<Goods> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Goods>
*/
List<Goods> selectPageRel(@Param("page") IPage<Goods> page,
@Param("param") GoodsParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Goods> selectListRel(@Param("param") GoodsParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.GoodsService;
import com.gxwebsoft.shop.param.GoodsServiceParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商品服务与承诺记录表Mapper
*
* @author 科技小王子
* @since 2022-11-23 21:57:50
*/
public interface GoodsServiceMapper extends BaseMapper<GoodsService> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<GoodsService>
*/
List<GoodsService> selectPageRel(@Param("page") IPage<GoodsService> page,
@Param("param") GoodsServiceParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<GoodsService> selectListRel(@Param("param") GoodsServiceParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Member;
import com.gxwebsoft.shop.param.MemberParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商城会员Mapper
*
* @author 科技小王子
* @since 2022-11-25 14:02:24
*/
public interface MemberMapper extends BaseMapper<Member> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Member>
*/
List<Member> selectPageRel(@Param("page") IPage<Member> page,
@Param("param") MemberParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Member> selectListRel(@Param("param") MemberParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.MerchantClerk;
import com.gxwebsoft.shop.param.MerchantClerkParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商家门店店员表Mapper
*
* @author 科技小王子
* @since 2022-11-30 16:32:25
*/
public interface MerchantClerkMapper extends BaseMapper<MerchantClerk> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<MerchantClerk>
*/
List<MerchantClerk> selectPageRel(@Param("page") IPage<MerchantClerk> page,
@Param("param") MerchantClerkParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<MerchantClerk> selectListRel(@Param("param") MerchantClerkParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Merchant;
import com.gxwebsoft.shop.param.MerchantParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商户管理Mapper
*
* @author 科技小王子
* @since 2022-11-30 15:10:54
*/
public interface MerchantMapper extends BaseMapper<Merchant> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Merchant>
*/
List<Merchant> selectPageRel(@Param("page") IPage<Merchant> page,
@Param("param") MerchantParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Merchant> selectListRel(@Param("param") MerchantParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.MerchantWithdraw;
import com.gxwebsoft.shop.param.MerchantWithdrawParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商户提现记录Mapper
*
* @author 科技小王子
* @since 2022-12-02 00:41:09
*/
public interface MerchantWithdrawMapper extends BaseMapper<MerchantWithdraw> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<MerchantWithdraw>
*/
List<MerchantWithdraw> selectPageRel(@Param("page") IPage<MerchantWithdraw> page,
@Param("param") MerchantWithdrawParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<MerchantWithdraw> selectListRel(@Param("param") MerchantWithdrawParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.OrderAddress;
import com.gxwebsoft.shop.param.OrderAddressParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 订单收货地址记录表Mapper
*
* @author 科技小王子
* @since 2022-12-02 21:21:10
*/
public interface OrderAddressMapper extends BaseMapper<OrderAddress> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<OrderAddress>
*/
List<OrderAddress> selectPageRel(@Param("page") IPage<OrderAddress> page,
@Param("param") OrderAddressParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<OrderAddress> selectListRel(@Param("param") OrderAddressParam param);
}
@@ -0,0 +1,48 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.OrderGoods;
import com.gxwebsoft.shop.param.OrderGoodsParam;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* 订单商品记录表Mapper
*
* @author 科技小王子
* @since 2022-12-09 17:15:31
*/
public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<OrderGoods>
*/
List<OrderGoods> selectPageRel(@Param("page") IPage<OrderGoods> page,
@Param("param") OrderGoodsParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<OrderGoods> selectListRel(@Param("param") OrderGoodsParam param);
List<OrderGoods> selectByOrderIds(List<Integer> orderIds);
@InterceptorIgnore(tenantLine = "true")
@Select("SELECT * FROM shop_order_goods WHERE order_id = #{param.orderId}")
List<OrderGoods> selectByOrderId(Integer orderId);
@InterceptorIgnore(tenantLine = "true")
int selectCountBySettled(@Param("param") OrderGoodsParam param);
}
@@ -0,0 +1,59 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Order;
import com.gxwebsoft.shop.param.OrderParam;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* 订单记录表Mapper
*
* @author WebSoft
* @since 2022-11-16 11:25:58
*/
public interface OrderMapper extends BaseMapper<Order> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Order>
*/
List<Order> selectPageRel(@Param("page") IPage<Order> page,
@Param("param") OrderParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Order> selectListRel(@Param("param") OrderParam param);
@InterceptorIgnore(tenantLine = "true")
List<Order> getOne(@Param("param") OrderParam param);
@InterceptorIgnore(tenantLine = "true")
boolean updatePayStatus(@Param("param") OrderParam param);
@InterceptorIgnore(tenantLine = "true")
@Select("UPDATE shop_order SET pay_status = #{param.payStatus} where order_no = #{param.orderNo}")
List<Order> getAll(@Param("param") OrderParam param);
// @InterceptorIgnore(tenantLine = "true")
boolean updateByIdRel(@Param("param") Order order);
@InterceptorIgnore(tenantLine = "true")
List<Order> selectPageSettled(@Param("page") IPage<Order> page,
@Param("param") OrderParam param);
@InterceptorIgnore(tenantLine = "true")
void updateByIdSettled(@Param("param") Order order);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.OrderRefundAddress;
import com.gxwebsoft.shop.param.OrderRefundAddressParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 售后单退货地址记录表Mapper
*
* @author 科技小王子
* @since 2023-05-18 13:09:51
*/
public interface OrderRefundAddressMapper extends BaseMapper<OrderRefundAddress> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<OrderRefundAddress>
*/
List<OrderRefundAddress> selectPageRel(@Param("page") IPage<OrderRefundAddress> page,
@Param("param") OrderRefundAddressParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<OrderRefundAddress> selectListRel(@Param("param") OrderRefundAddressParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.OrderRefund;
import com.gxwebsoft.shop.param.OrderRefundParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 售后单记录表Mapper
*
* @author 科技小王子
* @since 2023-05-18 13:09:51
*/
public interface OrderRefundMapper extends BaseMapper<OrderRefund> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<OrderRefund>
*/
List<OrderRefund> selectPageRel(@Param("page") IPage<OrderRefund> page,
@Param("param") OrderRefundParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<OrderRefund> selectListRel(@Param("param") OrderRefundParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.OrderRenew;
import com.gxwebsoft.shop.param.OrderRenewParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 续费订单记录表Mapper
*
* @author 科技小王子
* @since 2023-04-13 10:34:35
*/
public interface OrderRenewMapper extends BaseMapper<OrderRenew> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<OrderRenew>
*/
List<OrderRenew> selectPageRel(@Param("page") IPage<OrderRenew> page,
@Param("param") OrderRenewParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<OrderRenew> selectListRel(@Param("param") OrderRenewParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Payment;
import com.gxwebsoft.shop.param.PaymentParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商城支付方式记录表Mapper
*
* @author 科技小王子
* @since 2022-12-15 19:11:07
*/
public interface PaymentMapper extends BaseMapper<Payment> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Payment>
*/
List<Payment> selectPageRel(@Param("page") IPage<Payment> page,
@Param("param") PaymentParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Payment> selectListRel(@Param("param") PaymentParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.PaymentTemplate;
import com.gxwebsoft.shop.param.PaymentTemplateParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商城支付模板记录表Mapper
*
* @author 科技小王子
* @since 2022-12-09 13:59:38
*/
public interface PaymentTemplateMapper extends BaseMapper<PaymentTemplate> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<PaymentTemplate>
*/
List<PaymentTemplate> selectPageRel(@Param("page") IPage<PaymentTemplate> page,
@Param("param") PaymentTemplateParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<PaymentTemplate> selectListRel(@Param("param") PaymentTemplateParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.PaymentTrade;
import com.gxwebsoft.shop.param.PaymentTradeParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 第三方支付交易记录表Mapper
*
* @author 科技小王子
* @since 2022-12-09 13:59:38
*/
public interface PaymentTradeMapper extends BaseMapper<PaymentTrade> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<PaymentTrade>
*/
List<PaymentTrade> selectPageRel(@Param("page") IPage<PaymentTrade> page,
@Param("param") PaymentTradeParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<PaymentTrade> selectListRel(@Param("param") PaymentTradeParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.RechargeOrder;
import com.gxwebsoft.shop.param.RechargeOrderParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 会员充值订单表Mapper
*
* @author 科技小王子
* @since 2023-04-20 20:36:24
*/
public interface RechargeOrderMapper extends BaseMapper<RechargeOrder> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<RechargeOrder>
*/
List<RechargeOrder> selectPageRel(@Param("page") IPage<RechargeOrder> page,
@Param("param") RechargeOrderParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<RechargeOrder> selectListRel(@Param("param") RechargeOrderParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.RechargeOrderPlan;
import com.gxwebsoft.shop.param.RechargeOrderPlanParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 会员充值订单套餐快照表Mapper
*
* @author 科技小王子
* @since 2023-04-20 20:36:24
*/
public interface RechargeOrderPlanMapper extends BaseMapper<RechargeOrderPlan> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<RechargeOrderPlan>
*/
List<RechargeOrderPlan> selectPageRel(@Param("page") IPage<RechargeOrderPlan> page,
@Param("param") RechargeOrderPlanParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<RechargeOrderPlan> selectListRel(@Param("param") RechargeOrderPlanParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.RechargePlan;
import com.gxwebsoft.shop.param.RechargePlanParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 会员充值套餐表Mapper
*
* @author 科技小王子
* @since 2023-04-20 20:36:24
*/
public interface RechargePlanMapper extends BaseMapper<RechargePlan> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<RechargePlan>
*/
List<RechargePlan> selectPageRel(@Param("page") IPage<RechargePlan> page,
@Param("param") RechargePlanParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<RechargePlan> selectListRel(@Param("param") RechargePlanParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.UserAddress;
import com.gxwebsoft.shop.param.UserAddressParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户收货地址表Mapper
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
public interface UserAddressMapper extends BaseMapper<UserAddress> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<UserAddress>
*/
List<UserAddress> selectPageRel(@Param("page") IPage<UserAddress> page,
@Param("param") UserAddressParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<UserAddress> selectListRel(@Param("param") UserAddressParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.UserBalanceLog;
import com.gxwebsoft.shop.param.UserBalanceLogParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户余额变动明细表Mapper
*
* @author 科技小王子
* @since 2023-04-21 15:59:09
*/
public interface UserBalanceLogMapper extends BaseMapper<UserBalanceLog> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<UserBalanceLog>
*/
List<UserBalanceLog> selectPageRel(@Param("page") IPage<UserBalanceLog> page,
@Param("param") UserBalanceLogParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<UserBalanceLog> selectListRel(@Param("param") UserBalanceLogParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.UserCoupon;
import com.gxwebsoft.shop.param.UserCouponParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户优惠券记录表Mapper
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
public interface UserCouponMapper extends BaseMapper<UserCoupon> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<UserCoupon>
*/
List<UserCoupon> selectPageRel(@Param("page") IPage<UserCoupon> page,
@Param("param") UserCouponParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<UserCoupon> selectListRel(@Param("param") UserCouponParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.UserFollow;
import com.gxwebsoft.shop.param.UserFollowParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 关注记录表Mapper
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
public interface UserFollowMapper extends BaseMapper<UserFollow> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<UserFollow>
*/
List<UserFollow> selectPageRel(@Param("page") IPage<UserFollow> page,
@Param("param") UserFollowParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<UserFollow> selectListRel(@Param("param") UserFollowParam param);
}
@@ -0,0 +1,47 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Order;
import com.gxwebsoft.shop.entity.UserOauth;
import com.gxwebsoft.shop.param.OrderParam;
import com.gxwebsoft.shop.param.UserOauthParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 第三方用户信息表Mapper
*
* @author 科技小王子
* @since 2022-12-15 08:33:13
*/
public interface UserOauthMapper extends BaseMapper<UserOauth> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<UserOauth>
*/
List<UserOauth> selectPageRel(@Param("page") IPage<UserOauth> page,
@Param("param") UserOauthParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<UserOauth> selectListRel(@Param("param") UserOauthParam param);
@InterceptorIgnore(tenantLine = "true")
List<UserOauth> getOne(@Param("param") UserOauthParam param);
@InterceptorIgnore(tenantLine = "true")
List<UserOauth> getByOauthId(@Param("param") UserOauthParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.UserPointsLog;
import com.gxwebsoft.shop.param.UserPointsLogParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户积分变动明细表Mapper
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
public interface UserPointsLogMapper extends BaseMapper<UserPointsLog> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<UserPointsLog>
*/
List<UserPointsLog> selectPageRel(@Param("page") IPage<UserPointsLog> page,
@Param("param") UserPointsLogParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<UserPointsLog> selectListRel(@Param("param") UserPointsLogParam param);
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.shop.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.UserReferee;
import com.gxwebsoft.shop.param.UserRefereeParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户推荐关系表Mapper
*
* @author 科技小王子
* @since 2023-04-28 14:07:29
*/
public interface UserRefereeMapper extends BaseMapper<UserReferee> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<UserReferee>
*/
List<UserReferee> selectPageRel(@Param("page") IPage<UserReferee> page,
@Param("param") UserRefereeParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<UserReferee> selectListRel(@Param("param") UserRefereeParam param);
}
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.shop.mapper.CartMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM shop_cart a
<where>
<if test="param.id != null">
AND a.id = #{param.id}
</if>
<if test="param.goodsId != null">
AND a.goods_id = #{param.goodsId}
</if>
<if test="param.goodsSkuId != null">
AND a.goods_sku_id LIKE CONCAT('%', #{param.goodsSkuId}, '%')
</if>
<if test="param.goodsNum != null">
AND a.goods_num = #{param.goodsNum}
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.Cart">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.Cart">
<include refid="selectSql"></include>
</select>
</mapper>
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.shop.mapper.CategoryMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM shop_category a
<where>
<if test="param.categoryId != null">
AND a.category_id = #{param.categoryId}
</if>
<if test="param.title != null">
AND a.name LIKE CONCAT('%', #{param.name}, '%')
</if>
<if test="param.parentId != null">
AND a.parent_id = #{param.parentId}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.merchantCode != null">
AND a.shop_code = #{param.merchantCode}
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.Category">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.Category">
<include refid="selectSql"></include>
</select>
</mapper>

Some files were not shown because too many files have changed in this diff Show More