拆分think模块包
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.BrandService;
|
||||
import com.gxwebsoft.shop.entity.Brand;
|
||||
import com.gxwebsoft.shop.param.BrandParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
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 2024-04-04 11:38:21
|
||||
*/
|
||||
@Api(tags = "品牌管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/brand")
|
||||
public class BrandController extends BaseController {
|
||||
@Resource
|
||||
private BrandService brandService;
|
||||
|
||||
@ApiOperation("分页查询品牌")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Brand>> page(BrandParam param) {
|
||||
// 使用关联查询
|
||||
return success(brandService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:brand:list')")
|
||||
@ApiOperation("查询全部品牌")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Brand>> list(BrandParam param) {
|
||||
// 使用关联查询
|
||||
return success(brandService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询品牌")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Brand> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(brandService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:brand:save')")
|
||||
@ApiOperation("添加品牌")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Brand brand) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// brand.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (brandService.save(brand)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:brand:update')")
|
||||
@ApiOperation("修改品牌")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Brand brand) {
|
||||
if (brandService.updateById(brand)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:brand:remove')")
|
||||
@ApiOperation("删除品牌")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (brandService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:brand:save')")
|
||||
@ApiOperation("批量添加品牌")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Brand> list) {
|
||||
if (brandService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:brand:update')")
|
||||
@ApiOperation("批量修改品牌")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Brand> batchParam) {
|
||||
if (batchParam.update(brandService, "brand_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:brand:remove')")
|
||||
@ApiOperation("批量删除品牌")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (brandService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
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.shop.entity.Cart;
|
||||
import com.gxwebsoft.shop.entity.Merchant;
|
||||
import com.gxwebsoft.shop.param.CartParam;
|
||||
import com.gxwebsoft.shop.service.CartService;
|
||||
import com.gxwebsoft.shop.service.MerchantService;
|
||||
import com.gxwebsoft.shop.vo.CartVo;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 购物车控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-29 21:02:39
|
||||
*/
|
||||
@Api(tags = "购物车管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/cart")
|
||||
public class CartController extends BaseController {
|
||||
@Resource
|
||||
private CartService cartService;
|
||||
@Resource
|
||||
private MerchantService merchantService;
|
||||
|
||||
@ApiOperation("分页查询购物车")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Cart>> page(CartParam param) {
|
||||
// 使用关联查询
|
||||
return success(cartService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部购物车")
|
||||
@GetMapping()
|
||||
public ApiResult<CartVo> list(CartParam param) {
|
||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
return success("请先登录",null);
|
||||
}
|
||||
// 附加用户ID
|
||||
param.setUserId(getLoginUserId());
|
||||
return success(cartService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:cart:list')")
|
||||
@ApiOperation("根据id查询购物车")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Cart> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cartService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加购物车")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Cart cart) {
|
||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
return success("请先登录",null);
|
||||
}
|
||||
// 修正用户ID
|
||||
cart.setUserId(getLoginUserId());
|
||||
// 修正购买数量
|
||||
if (ObjectUtil.isEmpty(cart.getCartNum())) {
|
||||
cart.setCartNum(1);
|
||||
}
|
||||
// 超出最大限制
|
||||
if (cartService.count(new LambdaUpdateWrapper<Cart>().eq(Cart::getUserId,getLoginUserId())) > 50) {
|
||||
return fail("购物车宝贝数量已满,建议您先去结算或清理~");
|
||||
}
|
||||
// 重复商品叠加数量
|
||||
final Cart one = cartService.getOne(new LambdaQueryWrapper<Cart>()
|
||||
.eq(Cart::getUserId, getLoginUserId())
|
||||
.eq(Cart::getGoodsId,cart.getGoodsId())
|
||||
.eq(Cart::getSpec,cart.getSpec())
|
||||
.last("limit 1"));
|
||||
if(ObjectUtil.isNotEmpty(one)){
|
||||
one.setCartNum(cart.getCartNum()+1);
|
||||
cartService.updateById(one);
|
||||
return success("更新成功",one.getId());
|
||||
}
|
||||
if (cartService.save(cart)) {
|
||||
return success("添加成功",cart.getId());
|
||||
}
|
||||
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改购物车")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Cart cart) {
|
||||
if (cartService.updateById(cart)) {
|
||||
final CartParam param = new CartParam();
|
||||
param.setType(cart.getType());
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:cart:remove')")
|
||||
@ApiOperation("删除购物车")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cartService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:cart:save')")
|
||||
@ApiOperation("批量添加购物车")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Cart> list) {
|
||||
if (cartService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:cart:update')")
|
||||
@ApiOperation("批量修改购物车")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Cart> batchParam) {
|
||||
if (batchParam.update(cartService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:cart:remove')")
|
||||
@ApiOperation("批量删除购物车")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cartService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("全选操作")
|
||||
@PutMapping("/onSelectAll/{yes}")
|
||||
public ApiResult<?> onSelectAll(@PathVariable("yes") Boolean yes) {
|
||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
return success("请先登录",null);
|
||||
}
|
||||
final List<Cart> carts = cartService.list(new LambdaUpdateWrapper<Cart>()
|
||||
.eq(Cart::getSelected,!yes)
|
||||
.eq(Cart::getUserId, getLoginUserId()));
|
||||
carts.forEach(d -> {
|
||||
d.setSelected(yes);
|
||||
});
|
||||
return success("修改成功", cartService.updateBatchById(carts));
|
||||
}
|
||||
|
||||
@ApiOperation("增加数量")
|
||||
@PutMapping("/addCartNum")
|
||||
public ApiResult<?> addCartNum(@RequestBody Cart cart) {
|
||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
return success("请先登录",null);
|
||||
}
|
||||
cart.setCartNum(cart.getCartNum()+1);
|
||||
cartService.updateById(cart);
|
||||
return success("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("减少数量")
|
||||
@PutMapping("/subCartNum")
|
||||
public ApiResult<?> subCartNum(@RequestBody Cart cart) {
|
||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
return success("请先登录",null);
|
||||
}
|
||||
cart.setCartNum(cart.getCartNum()-1);
|
||||
cartService.updateById(cart);
|
||||
return success("操作成功");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.entity.Cart;
|
||||
import com.gxwebsoft.shop.service.CashierService;
|
||||
import com.gxwebsoft.shop.entity.Cashier;
|
||||
import com.gxwebsoft.shop.param.CashierParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.shop.vo.CashierVo;
|
||||
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 2024-08-04 11:51:43
|
||||
*/
|
||||
@Api(tags = "收银管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/cashier")
|
||||
public class CashierController extends BaseController {
|
||||
@Resource
|
||||
private CashierService cashierService;
|
||||
|
||||
@ApiOperation("分页查询收银")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Cashier>> page(CashierParam param) {
|
||||
// 使用关联查询
|
||||
return success(cashierService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部收银")
|
||||
@GetMapping()
|
||||
public ApiResult<CashierVo> list(CashierParam param) {
|
||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
return success("请先登录",null);
|
||||
}
|
||||
// 附加收银员ID
|
||||
param.setCashierId(getLoginUserId());
|
||||
// 收银员ID
|
||||
// final Set<String> collect = getLoginUser().getRoles().stream().map(Role::getRoleCode).collect(Collectors.toSet());
|
||||
// if (!collect.contains("merchantClerk")) {
|
||||
// return fail("这个账户没有收银权限",null);
|
||||
// }
|
||||
return success(cashierService.listRel(param));
|
||||
}
|
||||
|
||||
// @ApiOperation("按groupId分组查询全部收银")
|
||||
// @GetMapping("/listByGroupId")
|
||||
// public ApiResult<List<CashierVo>> listByGroupId(CashierParam param) {
|
||||
// if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
// return success("请先登录",null);
|
||||
// }
|
||||
// // 附加收银员ID
|
||||
// param.setCashierId(getLoginUserId());
|
||||
// // 收银员ID
|
||||
// return success(cashierService.listRelByGroupId(param));
|
||||
// }
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:cashier:list')")
|
||||
@ApiOperation("根据id查询收银")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Cashier> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cashierService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加收银")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Cashier cashier) {
|
||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
return success("请先登录",null);
|
||||
}
|
||||
cashier.setCashierId(getLoginUserId());
|
||||
// 修正购买数量
|
||||
if (ObjectUtil.isEmpty(cashier.getCartNum())) {
|
||||
cashier.setCartNum(1);
|
||||
}
|
||||
// 超出最大限制
|
||||
if (cashierService.count(new LambdaUpdateWrapper<Cashier>().eq(Cashier::getCashierId,getLoginUserId())) > 50) {
|
||||
return fail("购物车宝贝数量已满,建议您先去结算或清理~");
|
||||
}
|
||||
// 重复商品叠加数量
|
||||
final Cashier one = cashierService.getOne(new LambdaQueryWrapper<Cashier>()
|
||||
.eq(Cashier::getCashierId,getLoginUserId())
|
||||
.eq(Cashier::getGoodsId,cashier.getGoodsId())
|
||||
.eq(Cashier::getSpec,cashier.getSpec())
|
||||
.eq(Cashier::getGroupId,0)
|
||||
.last("limit 1"));
|
||||
|
||||
if(ObjectUtil.isNotEmpty(one)){
|
||||
return fail("请勿重复添加");
|
||||
}
|
||||
if (cashierService.save(cashier)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改收银")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Cashier cashier) {
|
||||
if (cashierService.updateById(cashier)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除收银")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cashierService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加收银")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Cashier> list) {
|
||||
if (cashierService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改收银")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Cashier> batchParam) {
|
||||
if (batchParam.update(cashierService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除收银")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cashierService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("增加数量")
|
||||
@PutMapping("/addCartNum")
|
||||
public ApiResult<?> addCartNum(@RequestBody Cashier cashier) {
|
||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
return success("请先登录",null);
|
||||
}
|
||||
cashier.setCartNum(cashier.getCartNum()+1);
|
||||
cashierService.updateById(cashier);
|
||||
return success("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("减少数量")
|
||||
@PutMapping("/subCartNum")
|
||||
public ApiResult<?> subCartNum(@RequestBody Cashier cashier) {
|
||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
return success("请先登录",null);
|
||||
}
|
||||
cashier.setCartNum(cashier.getCartNum()-1);
|
||||
cashierService.updateById(cashier);
|
||||
return success("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("清空")
|
||||
@PutMapping("/cearCartNum")
|
||||
public ApiResult<?> removeCartNum(@RequestBody Cashier cashier) {
|
||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
return success("请先登录",null);
|
||||
}
|
||||
cashier.setCartNum(cashier.getCartNum()-1);
|
||||
cashierService.updateById(cashier);
|
||||
return success("操作成功");
|
||||
}
|
||||
|
||||
@ApiOperation("挂单")
|
||||
@PutMapping("/packCashier")
|
||||
public ApiResult<?> packCashier() {
|
||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||
return success("请先登录",null);
|
||||
}
|
||||
final long timeMillis = System.currentTimeMillis();
|
||||
final boolean update = cashierService.update(new LambdaUpdateWrapper<Cashier>().eq(Cashier::getGroupId, 0).eq(Cashier::getCashierId, getLoginUserId()).set(Cashier::getGroupId, timeMillis/1000));
|
||||
|
||||
return success("操作成功",update);
|
||||
}
|
||||
|
||||
@ApiOperation("取单")
|
||||
@PutMapping("/getByGroup/{id}")
|
||||
public ApiResult<?> getByGroup(@PathVariable("id") Integer id) {
|
||||
if (cashierService.update(new LambdaUpdateWrapper<Cashier>().eq(Cashier::getGroupId,id).set(Cashier::getGroupId,0))) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除整单")
|
||||
@DeleteMapping("/removeByGroup/{id}")
|
||||
public ApiResult<?> removeByGroup(@PathVariable("id") Integer id) {
|
||||
if (cashierService.remove(new LambdaQueryWrapper<Cashier>().eq(Cashier::getGroupId,id))) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.ChatConversationService;
|
||||
import com.gxwebsoft.shop.entity.ChatConversation;
|
||||
import com.gxwebsoft.shop.param.ChatConversationParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
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 2024-04-27 16:08:04
|
||||
*/
|
||||
@Api(tags = "聊天消息表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/chat-conversation")
|
||||
public class ChatConversationController extends BaseController {
|
||||
@Resource
|
||||
private ChatConversationService chatConversationService;
|
||||
|
||||
@ApiOperation("分页查询聊天消息表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ChatConversation>> page(ChatConversationParam param) {
|
||||
// 使用关联查询
|
||||
return success(chatConversationService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部聊天消息表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ChatConversation>> list(ChatConversationParam param) {
|
||||
// 使用关联查询
|
||||
return success(chatConversationService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:chatConversation:list')")
|
||||
@ApiOperation("根据id查询聊天消息表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ChatConversation> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(chatConversationService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加聊天消息表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ChatConversation chatConversation) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// chatConversation.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (chatConversationService.save(chatConversation)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改聊天消息表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ChatConversation chatConversation) {
|
||||
if (chatConversationService.updateById(chatConversation)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除聊天消息表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (chatConversationService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加聊天消息表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ChatConversation> list) {
|
||||
if (chatConversationService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改聊天消息表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ChatConversation> batchParam) {
|
||||
if (batchParam.update(chatConversationService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除聊天消息表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (chatConversationService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.ChatMessageService;
|
||||
import com.gxwebsoft.shop.entity.ChatMessage;
|
||||
import com.gxwebsoft.shop.param.ChatMessageParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
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 2024-04-27 16:08:04
|
||||
*/
|
||||
@Api(tags = "聊天消息表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/chat-message")
|
||||
public class ChatMessageController extends BaseController {
|
||||
@Resource
|
||||
private ChatMessageService chatMessageService;
|
||||
|
||||
@ApiOperation("分页查询聊天消息表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ChatMessage>> page(ChatMessageParam param) {
|
||||
// 使用关联查询
|
||||
return success(chatMessageService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部聊天消息表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ChatMessage>> list(ChatMessageParam param) {
|
||||
// 使用关联查询
|
||||
return success(chatMessageService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:chatMessage:list')")
|
||||
@ApiOperation("根据id查询聊天消息表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ChatMessage> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(chatMessageService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加聊天消息表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ChatMessage chatMessage) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// chatMessage.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (chatMessageService.save(chatMessage)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改聊天消息表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ChatMessage chatMessage) {
|
||||
if (chatMessageService.updateById(chatMessage)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除聊天消息表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (chatMessageService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加聊天消息表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ChatMessage> list) {
|
||||
if (chatMessageService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改聊天消息表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ChatMessage> batchParam) {
|
||||
if (batchParam.update(chatMessageService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除聊天消息表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (chatMessageService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.CountService;
|
||||
import com.gxwebsoft.shop.entity.Count;
|
||||
import com.gxwebsoft.shop.param.CountParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
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 2024-07-31 22:25:10
|
||||
*/
|
||||
@Api(tags = "商城销售统计表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/count")
|
||||
public class CountController extends BaseController {
|
||||
@Resource
|
||||
private CountService countService;
|
||||
|
||||
@ApiOperation("分页查询商城销售统计表")
|
||||
@GetMapping("/data")
|
||||
public ApiResult<?> data(CountParam param) {
|
||||
final DateTime dateTime = DateUtil.offsetDay(DateUtil.date(), 1);
|
||||
System.out.println("dateTime = " + dateTime);
|
||||
|
||||
final DateTime dateTime2 = DateUtil.offsetDay(DateUtil.date(), -1);
|
||||
System.out.println("dateTime2 = " + dateTime2);
|
||||
final DateTime dateTime3 = DateUtil.offsetDay(DateUtil.date(), -2);
|
||||
System.out.println("dateTime3 = " + dateTime3);
|
||||
return success(countService.list(new LambdaQueryWrapper<Count>().ge(Count::getDateTime, dateTime3).last("limit 2")));
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询商城销售统计表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Count>> page(CountParam param) {
|
||||
// 使用关联查询
|
||||
return success(countService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商城销售统计表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Count>> list(CountParam param) {
|
||||
// 使用关联查询
|
||||
return success(countService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:count:list')")
|
||||
@ApiOperation("根据id查询商城销售统计表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Count> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(countService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商城销售统计表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Count count) {
|
||||
if (countService.save(count)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商城销售统计表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Count count) {
|
||||
if (countService.updateById(count)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商城销售统计表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (countService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商城销售统计表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Count> list) {
|
||||
if (countService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商城销售统计表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Count> batchParam) {
|
||||
if (batchParam.update(countService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商城销售统计表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (countService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.entity.DealerReferee;
|
||||
import com.gxwebsoft.shop.entity.DealerUser;
|
||||
import com.gxwebsoft.shop.service.DealerApplyService;
|
||||
import com.gxwebsoft.shop.entity.DealerApply;
|
||||
import com.gxwebsoft.shop.param.DealerApplyParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.shop.service.DealerRefereeService;
|
||||
import com.gxwebsoft.shop.service.DealerUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商申请记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
@Api(tags = "分销商申请记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/dealer-apply")
|
||||
public class DealerApplyController extends BaseController {
|
||||
@Resource
|
||||
private DealerApplyService dealerApplyService;
|
||||
@Resource
|
||||
private DealerUserService dealerUserService;
|
||||
@Resource
|
||||
private DealerRefereeService dealerRefereeService;
|
||||
|
||||
@ApiOperation("分页查询分销商申请记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DealerApply>> page(DealerApplyParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerApplyService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部分销商申请记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DealerApply>> list(DealerApplyParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerApplyService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询分销商申请记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DealerApply> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(dealerApplyService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@ApiOperation("添加分销商申请记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DealerApply dealerApply) {
|
||||
final Integer refereeId = dealerApply.getRefereeId();
|
||||
final DealerUser dealerUser = new DealerUser();
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
dealerApply.setUserId(loginUser.getUserId());
|
||||
dealerUser.setUserId(loginUser.getUserId());
|
||||
dealerUser.setMobile(loginUser.getPhone());
|
||||
dealerUser.setTenantId(loginUser.getTenantId());
|
||||
}
|
||||
final int count = dealerUserService.count(new LambdaQueryWrapper<DealerUser>().eq(DealerUser::getUserId, refereeId));
|
||||
System.out.println("count = " + count);
|
||||
if (dealerUserService.count(new LambdaQueryWrapper<DealerUser>().eq(DealerUser::getUserId,refereeId)) == 0) {
|
||||
return fail("邀请人ID不存在");
|
||||
}
|
||||
if (dealerApplyService.save(dealerApply)) {
|
||||
// 加入正式分销商
|
||||
dealerUser.setRealName(dealerApply.getRealName());
|
||||
dealerUser.setRefereeId(dealerApply.getRefereeId());
|
||||
dealerUserService.save(dealerUser);
|
||||
// 添加关系
|
||||
final DealerReferee referee = new DealerReferee();
|
||||
referee.setDealerId(refereeId);
|
||||
referee.setUserId(dealerUser.getUserId());
|
||||
referee.setLevel(1);
|
||||
referee.setTenantId(dealerApply.getTenantId());
|
||||
dealerRefereeService.save(referee);
|
||||
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改分销商申请记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DealerApply dealerApply) {
|
||||
if (dealerApplyService.updateById(dealerApply)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除分销商申请记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (dealerApplyService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加分销商申请记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DealerApply> list) {
|
||||
if (dealerApplyService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改分销商申请记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DealerApply> batchParam) {
|
||||
if (batchParam.update(dealerApplyService, "apply_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除分销商申请记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (dealerApplyService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.DealerCapitalService;
|
||||
import com.gxwebsoft.shop.entity.DealerCapital;
|
||||
import com.gxwebsoft.shop.param.DealerCapitalParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 2024-07-28 11:57:41
|
||||
*/
|
||||
@Api(tags = "分销商资金明细表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/dealer-capital")
|
||||
public class DealerCapitalController extends BaseController {
|
||||
@Resource
|
||||
private DealerCapitalService dealerCapitalService;
|
||||
|
||||
@ApiOperation("分页查询分销商资金明细表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DealerCapital>> page(DealerCapitalParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerCapitalService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部分销商资金明细表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DealerCapital>> list(DealerCapitalParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerCapitalService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:dealerCapital:list')")
|
||||
@ApiOperation("根据id查询分销商资金明细表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DealerCapital> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(dealerCapitalService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加分销商资金明细表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DealerCapital dealerCapital) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
dealerCapital.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (dealerCapitalService.save(dealerCapital)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改分销商资金明细表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DealerCapital dealerCapital) {
|
||||
if (dealerCapitalService.updateById(dealerCapital)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除分销商资金明细表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (dealerCapitalService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加分销商资金明细表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DealerCapital> list) {
|
||||
if (dealerCapitalService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改分销商资金明细表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DealerCapital> batchParam) {
|
||||
if (batchParam.update(dealerCapitalService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除分销商资金明细表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (dealerCapitalService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.DealerOrderService;
|
||||
import com.gxwebsoft.shop.entity.DealerOrder;
|
||||
import com.gxwebsoft.shop.param.DealerOrderParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 2024-07-28 11:57:41
|
||||
*/
|
||||
@Api(tags = "分销商订单记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/dealer-order")
|
||||
public class DealerOrderController extends BaseController {
|
||||
@Resource
|
||||
private DealerOrderService dealerOrderService;
|
||||
|
||||
@ApiOperation("分页查询分销商订单记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DealerOrder>> page(DealerOrderParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerOrderService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部分销商订单记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DealerOrder>> list(DealerOrderParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerOrderService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:dealerOrder:list')")
|
||||
@ApiOperation("根据id查询分销商订单记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DealerOrder> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(dealerOrderService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加分销商订单记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DealerOrder dealerOrder) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
dealerOrder.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (dealerOrderService.save(dealerOrder)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改分销商订单记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DealerOrder dealerOrder) {
|
||||
if (dealerOrderService.updateById(dealerOrder)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除分销商订单记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (dealerOrderService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加分销商订单记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DealerOrder> list) {
|
||||
if (dealerOrderService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改分销商订单记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DealerOrder> batchParam) {
|
||||
if (batchParam.update(dealerOrderService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除分销商订单记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (dealerOrderService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.DealerRefereeService;
|
||||
import com.gxwebsoft.shop.entity.DealerReferee;
|
||||
import com.gxwebsoft.shop.param.DealerRefereeParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 2024-07-28 11:57:41
|
||||
*/
|
||||
@Api(tags = "分销商推荐关系表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/dealer-referee")
|
||||
public class DealerRefereeController extends BaseController {
|
||||
@Resource
|
||||
private DealerRefereeService dealerRefereeService;
|
||||
|
||||
@ApiOperation("分页查询分销商推荐关系表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DealerReferee>> page(DealerRefereeParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerRefereeService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部分销商推荐关系表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DealerReferee>> list(DealerRefereeParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerRefereeService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:dealerReferee:list')")
|
||||
@ApiOperation("根据id查询分销商推荐关系表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DealerReferee> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(dealerRefereeService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加分销商推荐关系表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DealerReferee dealerReferee) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
dealerReferee.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (dealerRefereeService.save(dealerReferee)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改分销商推荐关系表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DealerReferee dealerReferee) {
|
||||
if (dealerRefereeService.updateById(dealerReferee)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除分销商推荐关系表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (dealerRefereeService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加分销商推荐关系表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DealerReferee> list) {
|
||||
if (dealerRefereeService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改分销商推荐关系表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DealerReferee> batchParam) {
|
||||
if (batchParam.update(dealerRefereeService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除分销商推荐关系表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (dealerRefereeService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.DealerSettingService;
|
||||
import com.gxwebsoft.shop.entity.DealerSetting;
|
||||
import com.gxwebsoft.shop.param.DealerSettingParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
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 2024-07-28 11:57:41
|
||||
*/
|
||||
@Api(tags = "分销商设置表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/dealer-setting")
|
||||
public class DealerSettingController extends BaseController {
|
||||
@Resource
|
||||
private DealerSettingService dealerSettingService;
|
||||
|
||||
@ApiOperation("分页查询分销商设置表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DealerSetting>> page(DealerSettingParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerSettingService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部分销商设置表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DealerSetting>> list(DealerSettingParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerSettingService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:dealerSetting:list')")
|
||||
@ApiOperation("根据id查询分销商设置表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DealerSetting> get(@PathVariable("id") String id) {
|
||||
// 使用关联查询
|
||||
return success(dealerSettingService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加分销商设置表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DealerSetting dealerSetting) {
|
||||
if (dealerSettingService.save(dealerSetting)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改分销商设置表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DealerSetting dealerSetting) {
|
||||
if (dealerSettingService.updateById(dealerSetting)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除分销商设置表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (dealerSettingService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加分销商设置表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DealerSetting> list) {
|
||||
if (dealerSettingService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改分销商设置表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DealerSetting> batchParam) {
|
||||
if (batchParam.update(dealerSettingService, "key")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除分销商设置表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (dealerSettingService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
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.DealerUser;
|
||||
import com.gxwebsoft.shop.param.DealerUserParam;
|
||||
import com.gxwebsoft.shop.service.DealerUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static com.gxwebsoft.common.core.constants.RedisConstants.ACCESS_TOKEN_KEY;
|
||||
|
||||
/**
|
||||
* 分销商用户记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 19:21:15
|
||||
*/
|
||||
@Api(tags = "分销商用户记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/dealer-user")
|
||||
public class DealerUserController extends BaseController {
|
||||
@Resource
|
||||
private DealerUserService dealerUserService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
private ConfigProperties config;
|
||||
|
||||
|
||||
@ApiOperation("生成专属二维码")
|
||||
@GetMapping("/getDealerUserQrcode")
|
||||
public ApiResult<?> getDealerUserQrcode() {
|
||||
final Integer loginUserId = getLoginUserId();
|
||||
if(loginUserId == null){
|
||||
return fail("请先登录");
|
||||
}
|
||||
|
||||
final DealerUser dealerUser = dealerUserService.getOne(new LambdaQueryWrapper<DealerUser>().eq(DealerUser::getUserId, loginUserId).last("limit 1"));
|
||||
|
||||
// 生成小程序码
|
||||
String apiUrl = "https://api.weixin.qq.com/wxa/getwxacode?access_token=" + getAccessToken();
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("path", "package/dealer/invite?id=" + loginUserId);
|
||||
map.put("env_version", "trial"); // 正式版为"release",体验版为"trial",开发版为"develop"
|
||||
|
||||
// 获取图片 Buffer
|
||||
byte[] qrCode = HttpRequest.post(apiUrl)
|
||||
.body(JSON.toJSONString(map))
|
||||
.execute().bodyBytes();
|
||||
|
||||
// 保存的文件名称
|
||||
final String fileName = loginUserId.toString().concat(".png");
|
||||
// 保存路径
|
||||
String filePath = getUploadDir().concat("user-code/") + fileName;
|
||||
File file = FileUtil.writeBytes(qrCode, filePath);
|
||||
|
||||
if (file != null) {
|
||||
final String qrcode = config.getFileServer().concat("/user-code/").concat(fileName);
|
||||
dealerUser.setQrcode(qrcode);
|
||||
dealerUserService.updateById(dealerUser);
|
||||
return success("操作成功",qrcode);
|
||||
}
|
||||
return success(dealerUser);
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询分销商用户记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DealerUser>> page(DealerUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerUserService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部分销商用户记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DealerUser>> list(DealerUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerUserService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询分销商用户记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DealerUser> get(@PathVariable("id") Integer id) {
|
||||
// 分销商信息
|
||||
final DealerUser dealerUser = dealerUserService.getOne(new LambdaQueryWrapper<DealerUser>()
|
||||
.eq(DealerUser::getUserId, id)
|
||||
.eq(DealerUser::getIsDelete, 0)
|
||||
.last("limit 1")
|
||||
);
|
||||
// 上级分销商
|
||||
final DealerUser dealerUser1 = dealerUserService.getOne(new LambdaQueryWrapper<DealerUser>()
|
||||
.eq(DealerUser::getUserId, dealerUser.getRefereeId())
|
||||
.eq(DealerUser::getIsDelete, 0));
|
||||
dealerUser.setDealerName(dealerUser1.getRealName());
|
||||
dealerUser.setDealerUser(dealerUser1);
|
||||
return success(dealerUser);
|
||||
}
|
||||
|
||||
@ApiOperation("添加分销商用户记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DealerUser dealerUser) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
dealerUser.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (dealerUserService.save(dealerUser)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改分销商用户记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DealerUser dealerUser) {
|
||||
if (dealerUserService.updateById(dealerUser)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除分销商用户记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (dealerUserService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加分销商用户记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DealerUser> list) {
|
||||
if (dealerUserService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改分销商用户记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DealerUser> batchParam) {
|
||||
if (batchParam.update(dealerUserService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除分销商用户记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (dealerUserService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
|
||||
private String getAccessToken() {
|
||||
String key = ACCESS_TOKEN_KEY.concat(":").concat(getTenantId().toString());
|
||||
// 从缓存获取access_token
|
||||
final String value = redisUtil.get(key);
|
||||
if (value != null) {
|
||||
// 解析access_token
|
||||
JSONObject response = JSON.parseObject(value);
|
||||
return response.getString("access_token");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private String getUploadDir() {
|
||||
return config.getUploadPath() + "file/";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.DealerWithdrawService;
|
||||
import com.gxwebsoft.shop.entity.DealerWithdraw;
|
||||
import com.gxwebsoft.shop.param.DealerWithdrawParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 2024-07-28 11:57:41
|
||||
*/
|
||||
@Api(tags = "分销商提现明细表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/dealer-withdraw")
|
||||
public class DealerWithdrawController extends BaseController {
|
||||
@Resource
|
||||
private DealerWithdrawService dealerWithdrawService;
|
||||
|
||||
@ApiOperation("分页查询分销商提现明细表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DealerWithdraw>> page(DealerWithdrawParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerWithdrawService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部分销商提现明细表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DealerWithdraw>> list(DealerWithdrawParam param) {
|
||||
// 使用关联查询
|
||||
return success(dealerWithdrawService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:dealerWithdraw:list')")
|
||||
@ApiOperation("根据id查询分销商提现明细表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DealerWithdraw> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(dealerWithdrawService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加分销商提现明细表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DealerWithdraw dealerWithdraw) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
dealerWithdraw.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (dealerWithdrawService.save(dealerWithdraw)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改分销商提现明细表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DealerWithdraw dealerWithdraw) {
|
||||
if (dealerWithdrawService.updateById(dealerWithdraw)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除分销商提现明细表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (dealerWithdrawService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加分销商提现明细表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DealerWithdraw> list) {
|
||||
if (dealerWithdrawService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改分销商提现明细表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DealerWithdraw> batchParam) {
|
||||
if (batchParam.update(dealerWithdrawService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除分销商提现明细表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (dealerWithdrawService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||
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.entity.GoodsCategory;
|
||||
import com.gxwebsoft.shop.entity.GoodsSpec;
|
||||
import com.gxwebsoft.shop.param.GoodsCategoryParam;
|
||||
import com.gxwebsoft.shop.service.GoodsCategoryService;
|
||||
import com.gxwebsoft.shop.service.GoodsService;
|
||||
import com.gxwebsoft.shop.service.GoodsSpecService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.gxwebsoft.common.core.utils.CommonUtil.toTreeData;
|
||||
|
||||
/**
|
||||
* 商品分类控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:34:16
|
||||
*/
|
||||
@Api(tags = "商品分类管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-category")
|
||||
public class GoodsCategoryController extends BaseController {
|
||||
@Resource
|
||||
private GoodsCategoryService goodsCategoryService;
|
||||
@Resource
|
||||
private GoodsSpecService goodsSpecService;
|
||||
@Resource
|
||||
private GoodsService goodsService;
|
||||
|
||||
@ApiOperation("查询商城菜单分类级商品数据(不联动)")
|
||||
@GetMapping("/listCategoryTree")
|
||||
public ApiResult<List<GoodsCategory>> listCategoryTree(GoodsCategoryParam param) {
|
||||
// 查询非店铺分类
|
||||
param.setMerchantId(0);
|
||||
final List<GoodsCategory> goodsCategoryList = goodsCategoryService.listRel(param);
|
||||
// 收集分类ID
|
||||
final Set<Integer> categoryIds = goodsCategoryList.stream().map(GoodsCategory::getCategoryId).collect(Collectors.toSet());
|
||||
if (categoryIds.isEmpty()) {
|
||||
return success(goodsCategoryList);
|
||||
}
|
||||
// List转为树形结构
|
||||
final List<GoodsCategory> list = toTreeData(goodsCategoryList, 0, GoodsCategory::getParentId, GoodsCategory::getCategoryId, GoodsCategory::setChildren);
|
||||
// 查询所有商品
|
||||
final List<Goods> goods = goodsService.list(new LambdaQueryWrapper<Goods>()
|
||||
.in(Goods::getCategoryId, categoryIds)
|
||||
.eq(Goods::getIsShow, 1)
|
||||
.eq(Goods::getDeleted, 0));
|
||||
|
||||
final Map<Integer, List<Goods>> collectGoods = goods.stream().collect(Collectors.groupingBy(Goods::getCategoryId));
|
||||
|
||||
final Set<Integer> goodsIds = goods.stream().map(Goods::getGoodsId).collect(Collectors.toSet());
|
||||
|
||||
final List<GoodsSpec> specs = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>().in(GoodsSpec::getGoodsId, goodsIds));
|
||||
|
||||
final Map<Integer, List<GoodsSpec>> collectGoodsSpec = specs.stream().collect(Collectors.groupingBy(GoodsSpec::getGoodsId));
|
||||
|
||||
list.forEach(d -> {
|
||||
d.setName(d.getTitle());
|
||||
final List<Goods> goodsList = collectGoods.get(d.getCategoryId());
|
||||
if (!CollectionUtils.isEmpty(goodsList)) {
|
||||
goodsList.forEach(v -> {
|
||||
final List<GoodsSpec> goodsSpecs = collectGoodsSpec.get(v.getGoodsId());
|
||||
if (!CollectionUtils.isEmpty(goodsSpecs)) {
|
||||
final GoodsSpec spec = goodsSpecs.get(0);
|
||||
v.setSpecValue(spec.getSpecValue());
|
||||
v.setGoodsSpecValue(JSONUtil.parseObject(spec.getSpecValue(), Object.class));
|
||||
}
|
||||
});
|
||||
d.setGoods(collectGoods.get(d.getCategoryId()));
|
||||
}
|
||||
});
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("查询商城菜单分类级商品数据(不联动)")
|
||||
@GetMapping("/listCategoryParentIdTree/{parentId}")
|
||||
public ApiResult<List<GoodsCategory>> listCategoryParentIdTree(@PathVariable("parentId") Integer parentId) {
|
||||
// 查询非店铺分类
|
||||
final List<GoodsCategory> list = goodsCategoryService.list(new LambdaQueryWrapper<GoodsCategory>()
|
||||
.eq(GoodsCategory::getParentId,parentId)
|
||||
.eq(GoodsCategory::getType,0)
|
||||
.eq(GoodsCategory::getMerchantId,0));
|
||||
|
||||
final Set<Integer> categoryIds = list.stream().map(GoodsCategory::getCategoryId).collect(Collectors.toSet());
|
||||
final List<Goods> goods = goodsService.list(new LambdaQueryWrapper<Goods>().in(Goods::getCategoryId, categoryIds));
|
||||
final Map<Integer, List<Goods>> collect = goods.stream().collect(Collectors.groupingBy(Goods::getCategoryId));
|
||||
|
||||
final Map<Integer, List<Goods>> collectGoods = goods.stream().collect(Collectors.groupingBy(Goods::getCategoryId));
|
||||
|
||||
final Set<Integer> goodsIds = goods.stream().map(Goods::getGoodsId).collect(Collectors.toSet());
|
||||
|
||||
final List<GoodsSpec> specs = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>().in(GoodsSpec::getGoodsId, goodsIds));
|
||||
|
||||
final Map<Integer, List<GoodsSpec>> collectGoodsSpec = specs.stream().collect(Collectors.groupingBy(GoodsSpec::getGoodsId));
|
||||
|
||||
list.forEach(d -> {
|
||||
d.setName(d.getTitle());
|
||||
final List<Goods> goodsList = collectGoods.get(d.getCategoryId());
|
||||
if (!CollectionUtils.isEmpty(goodsList)) {
|
||||
goodsList.forEach(v -> {
|
||||
final List<GoodsSpec> goodsSpecs = collectGoodsSpec.get(v.getGoodsId());
|
||||
if (!CollectionUtils.isEmpty(goodsSpecs)) {
|
||||
final GoodsSpec spec = goodsSpecs.get(0);
|
||||
v.setSpecValue(spec.getSpecValue());
|
||||
v.setGoodsSpecValue(JSONUtil.parseObject(spec.getSpecValue(), Object.class));
|
||||
}
|
||||
});
|
||||
d.setGoods(collectGoods.get(d.getCategoryId()));
|
||||
}
|
||||
});
|
||||
return success("请求成功",list);
|
||||
}
|
||||
|
||||
@ApiOperation("查询门店菜单分类及菜品数据(联动)")
|
||||
@GetMapping("/listShopCategoryTree")
|
||||
public ApiResult<List<GoodsCategory>> listShopCategoryTree(GoodsCategoryParam param) {
|
||||
final List<GoodsCategory> list = goodsCategoryService.listRel(param);
|
||||
final Set<Integer> categoryIds = list.stream().map(GoodsCategory::getCategoryId).collect(Collectors.toSet());
|
||||
if (categoryIds.isEmpty()) {
|
||||
return success(list);
|
||||
}
|
||||
|
||||
final List<Goods> goods = goodsService.list(new LambdaQueryWrapper<Goods>().in(Goods::getCategoryId, categoryIds).eq(Goods::getIsShow, 1).eq(Goods::getDeleted, 0));
|
||||
final Map<Integer, List<Goods>> collectGoods = goods.stream().collect(Collectors.groupingBy(Goods::getCategoryId));
|
||||
|
||||
final Set<Integer> goodsIds = goods.stream().map(Goods::getGoodsId).collect(Collectors.toSet());
|
||||
|
||||
final List<GoodsSpec> specs = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>().in(GoodsSpec::getGoodsId, goodsIds));
|
||||
|
||||
final Map<Integer, List<GoodsSpec>> collectGoodsSpec = specs.stream().collect(Collectors.groupingBy(GoodsSpec::getGoodsId));
|
||||
|
||||
list.forEach(d -> {
|
||||
d.setName(d.getTitle());
|
||||
final List<Goods> goodsList = collectGoods.get(d.getCategoryId());
|
||||
if (!CollectionUtils.isEmpty(goodsList)) {
|
||||
goodsList.forEach(v -> {
|
||||
final List<GoodsSpec> goodsSpecs = collectGoodsSpec.get(v.getGoodsId());
|
||||
if (!CollectionUtils.isEmpty(goodsSpecs)) {
|
||||
final GoodsSpec spec = goodsSpecs.get(0);
|
||||
v.setSpecValue(spec.getSpecValue());
|
||||
v.setGoodsSpecValue(JSONUtil.parseObject(spec.getSpecValue(), Object.class));
|
||||
}
|
||||
});
|
||||
d.setGoods(collectGoods.get(d.getCategoryId()));
|
||||
}
|
||||
});
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("分页查询商品分类")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsCategory>> page(GoodsCategoryParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsCategoryService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品分类")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsCategory>> list(GoodsCategoryParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsCategoryService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品分类")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsCategory> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsCategoryService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品分类")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsCategory goodsCategory) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
goodsCategory.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (goodsCategoryService.save(goodsCategory)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品分类")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsCategory goodsCategory) {
|
||||
if (goodsCategoryService.updateById(goodsCategory)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品分类")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsCategoryService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品分类")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsCategory> list) {
|
||||
if (goodsCategoryService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品分类")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsCategory> batchParam) {
|
||||
if (batchParam.update(goodsCategoryService, "category_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品分类")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsCategoryService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||
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.entity.GoodsSku;
|
||||
import com.gxwebsoft.shop.entity.GoodsSpec;
|
||||
import com.gxwebsoft.shop.param.GoodsParam;
|
||||
import com.gxwebsoft.shop.service.GoodsService;
|
||||
import com.gxwebsoft.shop.service.GoodsSkuService;
|
||||
import com.gxwebsoft.shop.service.GoodsSpecService;
|
||||
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.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 商品记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-25 19:22:01
|
||||
*/
|
||||
@Api(tags = "商品记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods")
|
||||
public class GoodsController extends BaseController {
|
||||
@Resource
|
||||
private GoodsService goodsService;
|
||||
@Resource
|
||||
private GoodsSpecService goodsSpecService;
|
||||
@Resource
|
||||
private GoodsSkuService goodsSkuService;
|
||||
|
||||
@ApiOperation("统计信息")
|
||||
@GetMapping("/data")
|
||||
public ApiResult<Map<String, Integer>> data(GoodsParam param) {
|
||||
Map<String, Integer> data = new HashMap<>();
|
||||
final LambdaQueryWrapper<Goods> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (param.getMerchantId() != null) {
|
||||
wrapper.eq(Goods::getMerchantId,param.getMerchantId());
|
||||
}
|
||||
|
||||
Integer totalNum = goodsService.count(
|
||||
wrapper.eq(Goods::getIsShow,1).gt(Goods::getStock,0)
|
||||
);
|
||||
data.put("totalNum", totalNum);
|
||||
|
||||
Integer totalNum2 = goodsService.count(
|
||||
wrapper.eq(Goods::getIsShow,0)
|
||||
);
|
||||
data.put("totalNum2", totalNum2);
|
||||
|
||||
Integer totalNum3 = goodsService.count(
|
||||
wrapper.eq(Goods::getStock,0)
|
||||
);
|
||||
data.put("totalNum3", totalNum3);
|
||||
|
||||
// 下架已售罄的商品
|
||||
goodsService.update(new LambdaUpdateWrapper<Goods>().eq(Goods::getStock,0).eq(Goods::getIsShow,1).set(Goods::getIsShow,0));
|
||||
|
||||
return success(data);
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询商品记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Goods>> page(GoodsParam param) {
|
||||
// 使用关联查询
|
||||
System.out.println("param = " + param);
|
||||
return success(goodsService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Goods>> list(GoodsParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Goods> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
final Goods goods = goodsService.getByIdRel(id);
|
||||
|
||||
// 提取specValue
|
||||
final GoodsSpec spec = goodsSpecService.getOne(new LambdaQueryWrapper<GoodsSpec>().eq(GoodsSpec::getGoodsId, id).last("limit 1"));
|
||||
if (spec != null) {
|
||||
final String specValue = spec.getSpecValue();
|
||||
final Object object = JSONUtil.parseObject(specValue, Object.class);
|
||||
goods.setGoodsSpecValue(object);
|
||||
}
|
||||
|
||||
return success(goods);
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:goods:save')")
|
||||
@ApiOperation("添加商品记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Goods goods) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
goods.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (goodsService.save(goods)) {
|
||||
// 保存商品规格及sku信息
|
||||
goodsService.saveBatchByAsync(goods);
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:goods:update')")
|
||||
@ApiOperation("修改商品记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Goods goods) {
|
||||
if (goodsService.updateById(goods)) {
|
||||
// 删除旧信息
|
||||
goodsSpecService.remove(new LambdaQueryWrapper<GoodsSpec>().eq(GoodsSpec::getGoodsId, goods.getGoodsId()));
|
||||
goodsSkuService.remove(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, goods.getGoodsId()));
|
||||
// 保存商品规格及sku信息
|
||||
goodsService.saveBatchByAsync(goods);
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:goods:remove')")
|
||||
@ApiOperation("删除商品记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:goods:save')")
|
||||
@ApiOperation("批量添加商品记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Goods> list) {
|
||||
if (goodsService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:goods:update')")
|
||||
@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')")
|
||||
@ApiOperation("批量删除商品记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
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.shop.entity.GoodsSku;
|
||||
import com.gxwebsoft.shop.entity.GoodsSkuVO;
|
||||
import com.gxwebsoft.shop.param.GoodsSkuParam;
|
||||
import com.gxwebsoft.shop.service.GoodsSkuService;
|
||||
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.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 商品sku列表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-26 10:49:02
|
||||
*/
|
||||
@Api(tags = "商品sku列表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-sku")
|
||||
public class GoodsSkuController extends BaseController {
|
||||
@Resource
|
||||
private GoodsSkuService goodsSkuService;
|
||||
|
||||
@ApiOperation("根据商品spec生成SKU列表")
|
||||
@PostMapping("/generateGoodsSku")
|
||||
public ApiResult<List<GoodsSku>> generateGoodsSku(@RequestBody List<GoodsSkuVO> voList) {
|
||||
List<List<String>> resultList = new ArrayList<>();
|
||||
voList.forEach(d -> {
|
||||
resultList.add(d.getDetail());
|
||||
});
|
||||
System.out.println("resultList = " + resultList);
|
||||
List<String> combine = generateSku(resultList,0,"",new ArrayList<>());
|
||||
|
||||
List<GoodsSku> goodsSkuList = new ArrayList<>();
|
||||
for (String sku : combine) {
|
||||
System.out.println(sku);
|
||||
GoodsSku goodsSku = new GoodsSku();
|
||||
goodsSku.setSku(sku);
|
||||
goodsSku.setUuid(UUID.randomUUID().toString());
|
||||
goodsSku.setImages(new ArrayList<>());
|
||||
goodsSkuList.add(goodsSku);
|
||||
}
|
||||
|
||||
return success(goodsSkuList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据属性值生成sku
|
||||
*
|
||||
* @param list 属性值列表
|
||||
* @param index 下标
|
||||
* @param str 初始化数据
|
||||
* @param newObjs 新obj
|
||||
*/
|
||||
public static List<String> generateSku(List<List<String>> list, int index, String str, List<String> newObjs) {
|
||||
if (index == list.size()) {
|
||||
newObjs.add(str);
|
||||
return newObjs;
|
||||
}
|
||||
for (String dataStr : list.get(index)) {
|
||||
if (StringUtils.isBlank(str)) {
|
||||
generateSku(list, index + 1, str + dataStr, newObjs);
|
||||
} else {
|
||||
generateSku(list, index + 1, str + "," + dataStr, newObjs);
|
||||
}
|
||||
}
|
||||
return newObjs;
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询商品sku列表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsSku>> page(GoodsSkuParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsSkuService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品sku列表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsSku>> list(GoodsSkuParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsSkuService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:goodsSku:list')")
|
||||
@ApiOperation("根据id查询商品sku列表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsSku> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsSkuService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品sku列表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsSku goodsSku) {
|
||||
if (goodsSkuService.save(goodsSku)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品sku列表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsSku goodsSku) {
|
||||
if (goodsSkuService.updateById(goodsSku)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品sku列表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsSkuService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品sku列表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsSku> list) {
|
||||
if (goodsSkuService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品sku列表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsSku> batchParam) {
|
||||
if (batchParam.update(goodsSkuService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品sku列表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsSkuService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.GoodsSpecService;
|
||||
import com.gxwebsoft.shop.entity.GoodsSpec;
|
||||
import com.gxwebsoft.shop.param.GoodsSpecParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品多规格控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
@Api(tags = "商品多规格管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-spec")
|
||||
public class GoodsSpecController extends BaseController {
|
||||
@Resource
|
||||
private GoodsSpecService goodsSpecService;
|
||||
|
||||
@ApiOperation("分页查询商品多规格")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsSpec>> page(GoodsSpecParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsSpecService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品多规格")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsSpec>> list(GoodsSpecParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsSpecService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品多规格")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsSpec> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsSpecService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品多规格")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsSpec goodsSpec) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// goodsSpec.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (goodsSpecService.save(goodsSpec)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品多规格")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsSpec goodsSpec) {
|
||||
if (goodsSpecService.updateById(goodsSpec)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品多规格")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsSpecService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品多规格")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsSpec> list) {
|
||||
if (goodsSpecService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品多规格")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsSpec> batchParam) {
|
||||
if (batchParam.update(goodsSpecService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品多规格")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsSpecService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||
import com.gxwebsoft.common.core.utils.RequestUtil;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.mapper.MerchantAccountMapper;
|
||||
import com.gxwebsoft.shop.service.MerchantAccountService;
|
||||
import com.gxwebsoft.shop.entity.MerchantAccount;
|
||||
import com.gxwebsoft.shop.param.MerchantAccountParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户账号控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-19 12:02:24
|
||||
*/
|
||||
@Api(tags = "商户账号管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/merchant-account")
|
||||
public class MerchantAccountController extends BaseController {
|
||||
@Resource
|
||||
private MerchantAccountService merchantAccountService;
|
||||
@Resource
|
||||
private MerchantAccountMapper merchantAccountMapper;
|
||||
|
||||
@ApiOperation("分页查询商户账号")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<MerchantAccount>> page(MerchantAccountParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantAccountService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商户账号")
|
||||
@GetMapping()
|
||||
public ApiResult<List<MerchantAccount>> list(MerchantAccountParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantAccountService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商户账号")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<MerchantAccount> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(merchantAccountService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商户账号")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody MerchantAccount merchantAccount, HttpServletRequest request) {
|
||||
if (merchantAccountService.count(new LambdaQueryWrapper<MerchantAccount>().eq(MerchantAccount::getPhone,merchantAccount.getPhone())) > 0) {
|
||||
return fail("手机号码已存在");
|
||||
}
|
||||
// 获取远程用户信息
|
||||
final RequestUtil requestUtil = new RequestUtil();
|
||||
String access_token = JwtUtil.getAccessToken(request);
|
||||
requestUtil.setAccessToken(access_token);
|
||||
requestUtil.setTenantId(getTenantId().toString());
|
||||
User userByPhone = requestUtil.getUserByPhone(merchantAccount.getPhone());
|
||||
// 新增注册
|
||||
if (userByPhone == null) {
|
||||
if (requestUtil.saveUserByPhone(merchantAccount)) {
|
||||
userByPhone = requestUtil.getUserByPhone(merchantAccount.getPhone());
|
||||
}
|
||||
}
|
||||
merchantAccount.setUserId(userByPhone.getUserId());
|
||||
if (merchantAccountService.save(merchantAccount)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商户账号")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody MerchantAccount merchantAccount) {
|
||||
if (merchantAccountService.updateById(merchantAccount)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商户账号")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (merchantAccountService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商户账号")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<MerchantAccount> list) {
|
||||
if (merchantAccountService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商户账号")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<MerchantAccount> batchParam) {
|
||||
if (batchParam.update(merchantAccountService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商户账号")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (merchantAccountService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("根据手机号码查询商户账号信息")
|
||||
@GetMapping("/getMerchantAccountByPhone")
|
||||
public ApiResult<MerchantAccount> getMerchantAccountByPhone(MerchantAccountParam param){
|
||||
param.setTenantId(getTenantId());
|
||||
final MerchantAccount merchantAccount = merchantAccountMapper.getMerchantAccountByPhone(param);
|
||||
if(merchantAccount == null){
|
||||
return fail("账号不存在",null);
|
||||
}
|
||||
return success(merchantAccount);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.MerchantApplyService;
|
||||
import com.gxwebsoft.shop.entity.MerchantApply;
|
||||
import com.gxwebsoft.shop.param.MerchantApplyParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户入驻申请控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 01:24:36
|
||||
*/
|
||||
@Api(tags = "商户入驻申请管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/merchant-apply")
|
||||
public class MerchantApplyController extends BaseController {
|
||||
@Resource
|
||||
private MerchantApplyService merchantApplyService;
|
||||
|
||||
@ApiOperation("分页查询商户入驻申请")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<MerchantApply>> page(MerchantApplyParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantApplyService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商户入驻申请")
|
||||
@GetMapping()
|
||||
public ApiResult<List<MerchantApply>> list(MerchantApplyParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantApplyService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商户入驻申请")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<MerchantApply> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(merchantApplyService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商户入驻申请")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody MerchantApply merchantApply) {
|
||||
if (merchantApplyService.save(merchantApply)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商户入驻申请")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody MerchantApply merchantApply) {
|
||||
if (merchantApplyService.updateById(merchantApply)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商户入驻申请")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (merchantApplyService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商户入驻申请")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<MerchantApply> list) {
|
||||
if (merchantApplyService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商户入驻申请")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<MerchantApply> batchParam) {
|
||||
if (batchParam.update(merchantApplyService, "apply_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商户入驻申请")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (merchantApplyService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||
import com.gxwebsoft.common.core.utils.RequestUtil;
|
||||
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.shop.entity.Merchant;
|
||||
import com.gxwebsoft.shop.entity.MerchantAccount;
|
||||
import com.gxwebsoft.shop.param.MerchantParam;
|
||||
import com.gxwebsoft.shop.service.MerchantAccountService;
|
||||
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 javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:03:54
|
||||
*/
|
||||
@Api(tags = "商户管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/merchant")
|
||||
public class MerchantController extends BaseController {
|
||||
@Resource
|
||||
private MerchantService merchantService;
|
||||
@Resource
|
||||
private MerchantAccountService merchantAccountService;
|
||||
|
||||
@ApiOperation("分页查询商户")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Merchant>> page(MerchantParam param) {
|
||||
// 使用关联查询
|
||||
System.out.println("param = " + param);
|
||||
return success(merchantService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商户")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Merchant>> list(MerchantParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantService.listRel(param));
|
||||
}
|
||||
|
||||
@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, HttpServletRequest request) {
|
||||
if (merchantService.count(new LambdaQueryWrapper<Merchant>().eq(Merchant::getPhone,merchant.getPhone())) > 0) {
|
||||
return fail("商户手机号码" + merchant.getPhone() + "已存在");
|
||||
}
|
||||
if (merchantService.save(merchant)) {
|
||||
// 设置商家后台入口
|
||||
merchant.setAdminUrl(merchant.getTenantId() + ".m.wsdns.cn");
|
||||
merchantService.updateById(merchant);
|
||||
// 获取用户信息
|
||||
final RequestUtil requestUtil = new RequestUtil();
|
||||
String access_token = JwtUtil.getAccessToken(request);
|
||||
requestUtil.setAccessToken(access_token);
|
||||
requestUtil.setTenantId(getTenantId().toString());
|
||||
final MerchantAccount merchantAccount = new MerchantAccount();
|
||||
merchantAccount.setMerchantId(merchant.getMerchantId());
|
||||
merchantAccount.setPhone(merchant.getPhone());
|
||||
merchantAccount.setPassword(merchant.getPhone().substring(merchant.getPhone().length() - 6));
|
||||
merchantAccount.setRealName(merchant.getRealName());
|
||||
merchantAccount.setRoleId(merchant.getRoleId());
|
||||
merchantAccount.setRoleName(merchant.getRoleName());
|
||||
requestUtil.saveUserByPhone(merchantAccount);
|
||||
merchantAccountService.save(merchantAccount);
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:update')")
|
||||
@ApiOperation("修改商户")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Merchant merchant) {
|
||||
if (merchantService.updateById(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)) {
|
||||
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)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.MerchantTypeService;
|
||||
import com.gxwebsoft.shop.entity.MerchantType;
|
||||
import com.gxwebsoft.shop.param.MerchantTypeParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户类型控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:08:51
|
||||
*/
|
||||
@Api(tags = "商户类型管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/merchant-type")
|
||||
public class MerchantTypeController extends BaseController {
|
||||
@Resource
|
||||
private MerchantTypeService merchantTypeService;
|
||||
|
||||
@ApiOperation("分页查询商户类型")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<MerchantType>> page(MerchantTypeParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantTypeService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商户类型")
|
||||
@GetMapping()
|
||||
public ApiResult<List<MerchantType>> list(MerchantTypeParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantTypeService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商户类型")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<MerchantType> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(merchantTypeService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商户类型")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody MerchantType merchantType) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// merchantType.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (merchantTypeService.save(merchantType)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商户类型")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody MerchantType merchantType) {
|
||||
if (merchantTypeService.updateById(merchantType)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商户类型")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (merchantTypeService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商户类型")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<MerchantType> list) {
|
||||
if (merchantTypeService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商户类型")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<MerchantType> batchParam) {
|
||||
if (batchParam.update(merchantTypeService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商户类型")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (merchantTypeService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.OrderService;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.param.OrderParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
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 2024-08-09 16:33:41
|
||||
*/
|
||||
@Api(tags = "管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/order")
|
||||
public class OrderController extends BaseController {
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
|
||||
@ApiOperation("分页查询")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Order>> page(OrderParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Order>> list(OrderParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:order:list')")
|
||||
@ApiOperation("根据id查询")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Order> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(orderService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Order order) {
|
||||
if (orderService.save(order)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Order order) {
|
||||
if (orderService.updateById(order)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (orderService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Order> list) {
|
||||
if (orderService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Order> batchParam) {
|
||||
if (batchParam.update(orderService, "order_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (orderService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
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.BatchParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 2024-05-26 15:42:03
|
||||
*/
|
||||
@Api(tags = "商品信息管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/order-goods")
|
||||
public class OrderGoodsController extends BaseController {
|
||||
@Resource
|
||||
private OrderGoodsService orderGoodsService;
|
||||
|
||||
@ApiOperation("分页查询商品信息")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<OrderGoods>> page(OrderGoodsParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderGoodsService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品信息")
|
||||
@GetMapping()
|
||||
public ApiResult<List<OrderGoods>> list(OrderGoodsParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderGoodsService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:orderGoods:list')")
|
||||
@ApiOperation("根据id查询商品信息")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<OrderGoods> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(orderGoodsService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品信息")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody OrderGoods orderGoods) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
orderGoods.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (orderGoodsService.save(orderGoods)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品信息")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody OrderGoods orderGoods) {
|
||||
if (orderGoodsService.updateById(orderGoods)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品信息")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (orderGoodsService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品信息")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<OrderGoods> list) {
|
||||
if (orderGoodsService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品信息")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<OrderGoods> batchParam) {
|
||||
if (batchParam.update(orderGoodsService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品信息")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (orderGoodsService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.OrderInfoService;
|
||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||
import com.gxwebsoft.shop.param.OrderInfoParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
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 2024-08-10 13:44:39
|
||||
*/
|
||||
@Api(tags = "管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/order-info")
|
||||
public class OrderInfoController extends BaseController {
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
|
||||
@ApiOperation("分页查询")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<OrderInfo>> page(OrderInfoParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部")
|
||||
@GetMapping()
|
||||
public ApiResult<List<OrderInfo>> list(OrderInfoParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:orderInfo:list')")
|
||||
@ApiOperation("根据id查询")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<OrderInfo> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody OrderInfo orderInfo) {
|
||||
if (orderInfoService.save(orderInfo)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody OrderInfo orderInfo) {
|
||||
if (orderInfoService.updateById(orderInfo)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (orderInfoService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<OrderInfo> list) {
|
||||
if (orderInfoService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<OrderInfo> batchParam) {
|
||||
if (batchParam.update(orderInfoService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (orderInfoService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.OrderInfoLogService;
|
||||
import com.gxwebsoft.shop.entity.OrderInfoLog;
|
||||
import com.gxwebsoft.shop.param.OrderInfoLogParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
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 2024-05-14 13:20:04
|
||||
*/
|
||||
@Api(tags = "订单核销管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/order-info-log")
|
||||
public class OrderInfoLogController extends BaseController {
|
||||
@Resource
|
||||
private OrderInfoLogService orderInfoLogService;
|
||||
|
||||
@ApiOperation("分页查询订单核销")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<OrderInfoLog>> page(OrderInfoLogParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoLogService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部订单核销")
|
||||
@GetMapping()
|
||||
public ApiResult<List<OrderInfoLog>> list(OrderInfoLogParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoLogService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:orderInfoLog:list')")
|
||||
@ApiOperation("根据id查询订单核销")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<OrderInfoLog> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoLogService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加订单核销")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody OrderInfoLog orderInfoLog) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// orderInfoLog.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (orderInfoLogService.save(orderInfoLog)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改订单核销")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody OrderInfoLog orderInfoLog) {
|
||||
if (orderInfoLogService.updateById(orderInfoLog)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除订单核销")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (orderInfoLogService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加订单核销")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<OrderInfoLog> list) {
|
||||
if (orderInfoLogService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改订单核销")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<OrderInfoLog> batchParam) {
|
||||
if (batchParam.update(orderInfoLogService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除订单核销")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (orderInfoLogService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.service.UserService;
|
||||
import com.gxwebsoft.shop.entity.UserBalanceLog;
|
||||
import com.gxwebsoft.shop.service.RechargeOrderService;
|
||||
import com.gxwebsoft.shop.entity.RechargeOrder;
|
||||
import com.gxwebsoft.shop.param.RechargeOrderParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 2024-07-26 23:18:48
|
||||
*/
|
||||
@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')")
|
||||
@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(Long.toString(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')")
|
||||
@ApiOperation("分页查询会员充值订单表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<RechargeOrder>> page(RechargeOrderParam param) {
|
||||
// 使用关联查询
|
||||
return success(rechargeOrderService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:rechargeOrder:list')")
|
||||
@ApiOperation("查询全部会员充值订单表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<RechargeOrder>> list(RechargeOrderParam param) {
|
||||
// 使用关联查询
|
||||
return success(rechargeOrderService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:rechargeOrder:list')")
|
||||
@ApiOperation("根据id查询会员充值订单表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<RechargeOrder> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(rechargeOrderService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加会员充值订单表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody RechargeOrder rechargeOrder) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
rechargeOrder.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (rechargeOrderService.save(rechargeOrder)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员充值订单表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody RechargeOrder rechargeOrder) {
|
||||
if (rechargeOrderService.updateById(rechargeOrder)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除会员充值订单表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (rechargeOrderService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:rechargeOrder:save')")
|
||||
@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')")
|
||||
@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')")
|
||||
@ApiOperation("批量删除会员充值订单表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (rechargeOrderService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.SpecService;
|
||||
import com.gxwebsoft.shop.entity.Spec;
|
||||
import com.gxwebsoft.shop.param.SpecParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 2024-07-25 03:00:41
|
||||
*/
|
||||
@Api(tags = "规格管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/spec")
|
||||
public class SpecController extends BaseController {
|
||||
@Resource
|
||||
private SpecService specService;
|
||||
|
||||
@ApiOperation("分页查询规格")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Spec>> page(SpecParam param) {
|
||||
// 使用关联查询
|
||||
return success(specService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部规格")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Spec>> list(SpecParam param) {
|
||||
// 使用关联查询
|
||||
return success(specService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:spec:list')")
|
||||
@ApiOperation("根据id查询规格")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Spec> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(specService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:spec:save')")
|
||||
@ApiOperation("添加规格")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Spec spec) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
spec.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (specService.save(spec)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:spec:update')")
|
||||
@ApiOperation("修改规格")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Spec spec) {
|
||||
if (specService.updateById(spec)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:spec:remove')")
|
||||
@ApiOperation("删除规格")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (specService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:spec:save')")
|
||||
@ApiOperation("批量添加规格")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Spec> list) {
|
||||
if (specService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:spec:update')")
|
||||
@ApiOperation("批量修改规格")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Spec> batchParam) {
|
||||
if (batchParam.update(specService, "spec_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
@PreAuthorize("hasAuthority('shop:spec:remove')")
|
||||
@ApiOperation("批量删除规格")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (specService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.shop.entity.SpecValue;
|
||||
import com.gxwebsoft.shop.param.SpecValueParam;
|
||||
import com.gxwebsoft.shop.service.SpecValueService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 规格值控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-01 09:49:15
|
||||
*/
|
||||
@Api(tags = "规格值管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/spec-value")
|
||||
public class SpecValueController extends BaseController {
|
||||
@Resource
|
||||
private SpecValueService specValueService;
|
||||
|
||||
@ApiOperation("分页查询规格值")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<SpecValue>> page(SpecValueParam param) {
|
||||
// 使用关联查询
|
||||
return success(specValueService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部规格值")
|
||||
@GetMapping()
|
||||
public ApiResult<List<SpecValue>> list(SpecValueParam param) {
|
||||
// 使用关联查询
|
||||
return success(specValueService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询规格值")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<SpecValue> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(specValueService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加规格值")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody SpecValue specValue) {
|
||||
if (specValueService.count(new LambdaQueryWrapper<SpecValue>().eq(SpecValue::getSpecId,specValue.getSpecId()).eq(SpecValue::getSpecValue,specValue.getSpecValue())) > 0) {
|
||||
return fail("规格值已存在");
|
||||
}
|
||||
if (specValueService.save(specValue)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改规格值")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody SpecValue specValue) {
|
||||
if (specValueService.updateById(specValue)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除规格值")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (specValueService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加规格值")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<SpecValue> list) {
|
||||
if (specValueService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改规格值")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<SpecValue> batchParam) {
|
||||
if (batchParam.update(specValueService, "spec_value_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除规格值")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (specValueService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
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.BatchParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 2024-05-26 10:58:37
|
||||
*/
|
||||
@Api(tags = "收货地址管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/user-address")
|
||||
public class UserAddressController extends BaseController {
|
||||
@Resource
|
||||
private UserAddressService userAddressService;
|
||||
|
||||
@ApiOperation("分页查询收货地址")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<UserAddress>> page(UserAddressParam param) {
|
||||
// 使用关联查询
|
||||
return success(userAddressService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部收货地址")
|
||||
@GetMapping()
|
||||
public ApiResult<List<UserAddress>> list(UserAddressParam param) {
|
||||
// 使用关联查询
|
||||
return success(userAddressService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:userAddress:list')")
|
||||
@ApiOperation("根据id查询收货地址")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<UserAddress> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(userAddressService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加收货地址")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody UserAddress userAddress) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
userAddress.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (userAddressService.save(userAddress)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改收货地址")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody UserAddress userAddress) {
|
||||
if (userAddress.getIsDefault() != null && userAddress.getIsDefault().equals(true)) {
|
||||
final boolean update = userAddressService.update(new LambdaUpdateWrapper<UserAddress>().eq(UserAddress::getUserId, getLoginUserId()).set(UserAddress::getIsDefault, 0));
|
||||
}
|
||||
if (userAddressService.updateById(userAddress)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除收货地址")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (userAddressService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加收货地址")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<UserAddress> list) {
|
||||
if (userAddressService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改收货地址")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserAddress> batchParam) {
|
||||
if (batchParam.update(userAddressService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除收货地址")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (userAddressService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
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.BatchParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
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 2024-05-29 15:57:44
|
||||
*/
|
||||
@Api(tags = "用户余额变动明细表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/user-balance-log")
|
||||
public class UserBalanceLogController extends BaseController {
|
||||
@Resource
|
||||
private UserBalanceLogService userBalanceLogService;
|
||||
|
||||
@ApiOperation("分页查询用户余额变动明细表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<UserBalanceLog>> page(UserBalanceLogParam param) {
|
||||
// 使用关联查询
|
||||
return success(userBalanceLogService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部用户余额变动明细表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<UserBalanceLog>> list(UserBalanceLogParam param) {
|
||||
// 使用关联查询
|
||||
return success(userBalanceLogService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:userBalanceLog:list')")
|
||||
@ApiOperation("根据id查询用户余额变动明细表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<UserBalanceLog> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(userBalanceLogService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加用户余额变动明细表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody UserBalanceLog userBalanceLog) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
userBalanceLog.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (userBalanceLogService.save(userBalanceLog)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改用户余额变动明细表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody UserBalanceLog userBalanceLog) {
|
||||
if (userBalanceLogService.updateById(userBalanceLog)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除用户余额变动明细表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (userBalanceLogService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加用户余额变动明细表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<UserBalanceLog> list) {
|
||||
if (userBalanceLogService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改用户余额变动明细表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserBalanceLog> batchParam) {
|
||||
if (batchParam.update(userBalanceLogService, "log_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除用户余额变动明细表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (userBalanceLogService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.UserCollectionService;
|
||||
import com.gxwebsoft.shop.entity.UserCollection;
|
||||
import com.gxwebsoft.shop.param.UserCollectionParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
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 2024-04-28 18:17:37
|
||||
*/
|
||||
@Api(tags = "我的收藏管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/user-collection")
|
||||
public class UserCollectionController extends BaseController {
|
||||
@Resource
|
||||
private UserCollectionService userCollectionService;
|
||||
|
||||
@ApiOperation("分页查询我的收藏")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<UserCollection>> page(UserCollectionParam param) {
|
||||
// 使用关联查询
|
||||
return success(userCollectionService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部我的收藏")
|
||||
@GetMapping()
|
||||
public ApiResult<List<UserCollection>> list(UserCollectionParam param) {
|
||||
// 使用关联查询
|
||||
return success(userCollectionService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:userCollection:list')")
|
||||
@ApiOperation("根据id查询我的收藏")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<UserCollection> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(userCollectionService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加我的收藏")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody UserCollection userCollection) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// userCollection.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (userCollectionService.save(userCollection)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改我的收藏")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody UserCollection userCollection) {
|
||||
if (userCollectionService.updateById(userCollection)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除我的收藏")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (userCollectionService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加我的收藏")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<UserCollection> list) {
|
||||
if (userCollectionService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改我的收藏")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserCollection> batchParam) {
|
||||
if (batchParam.update(userCollectionService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除我的收藏")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (userCollectionService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.UsersService;
|
||||
import com.gxwebsoft.shop.entity.Users;
|
||||
import com.gxwebsoft.shop.param.UsersParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
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 2024-08-09 15:20:25
|
||||
*/
|
||||
@Api(tags = "管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/users")
|
||||
public class UsersController extends BaseController {
|
||||
@Resource
|
||||
private UsersService usersService;
|
||||
|
||||
@ApiOperation("分页查询")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Users>> page(UsersParam param) {
|
||||
// 使用关联查询
|
||||
return success(usersService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Users>> list(UsersParam param) {
|
||||
// 使用关联查询
|
||||
return success(usersService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:users:list')")
|
||||
@ApiOperation("根据id查询")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Users> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(usersService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Users users) {
|
||||
if (usersService.save(users)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Users users) {
|
||||
if (usersService.updateById(users)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (usersService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Users> list) {
|
||||
if (usersService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Users> batchParam) {
|
||||
if (batchParam.update(usersService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (usersService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.WechatDepositService;
|
||||
import com.gxwebsoft.shop.entity.WechatDeposit;
|
||||
import com.gxwebsoft.shop.param.WechatDepositParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
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 2024-05-03 15:50:28
|
||||
*/
|
||||
@Api(tags = "押金管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/wechat-deposit")
|
||||
public class WechatDepositController extends BaseController {
|
||||
@Resource
|
||||
private WechatDepositService wechatDepositService;
|
||||
|
||||
@ApiOperation("分页查询押金")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<WechatDeposit>> page(WechatDepositParam param) {
|
||||
// 使用关联查询
|
||||
return success(wechatDepositService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部押金")
|
||||
@GetMapping()
|
||||
public ApiResult<List<WechatDeposit>> list(WechatDepositParam param) {
|
||||
// 使用关联查询
|
||||
return success(wechatDepositService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:wechatDeposit:list')")
|
||||
@ApiOperation("根据id查询押金")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<WechatDeposit> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(wechatDepositService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:wechatDeposit:list')")
|
||||
@ApiOperation("添加押金")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody WechatDeposit wechatDeposit) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// wechatDeposit.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (wechatDepositService.save(wechatDeposit)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:wechatDeposit:update')")
|
||||
@ApiOperation("修改押金")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody WechatDeposit wechatDeposit) {
|
||||
if (wechatDepositService.updateById(wechatDeposit)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:wechatDeposit:remove')")
|
||||
@ApiOperation("删除押金")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (wechatDepositService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:wechatDeposit:save')")
|
||||
@ApiOperation("批量添加押金")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<WechatDeposit> list) {
|
||||
if (wechatDepositService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:wechatDeposit:update')")
|
||||
@ApiOperation("批量修改押金")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<WechatDeposit> batchParam) {
|
||||
if (batchParam.update(wechatDepositService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:wechatDeposit:remove')")
|
||||
@ApiOperation("批量删除押金")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (wechatDepositService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.core.utils.WxNativeUtil;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.common.system.entity.Payment;
|
||||
import com.gxwebsoft.common.system.param.SettingParam;
|
||||
import com.gxwebsoft.shop.service.OrderService;
|
||||
import com.gxwebsoft.common.system.service.SettingService;
|
||||
import com.wechat.pay.java.core.Config;
|
||||
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
|
||||
import com.wechat.pay.java.service.payments.nativepay.NativePayService;
|
||||
import com.wechat.pay.java.service.payments.nativepay.model.Amount;
|
||||
import com.wechat.pay.java.service.payments.nativepay.model.PrepayRequest;
|
||||
import com.wechat.pay.java.service.payments.nativepay.model.PrepayResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Api(tags = "微信Native支付接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/wx-native-pay")
|
||||
public class WxNativePayController extends BaseController {
|
||||
@Value("${spring.profiles.active}")
|
||||
String active;
|
||||
public static String merchantId = "1246610101";
|
||||
public static String privateKeyPath = "/Users/gxwebsoft/JAVA/com.gxwebsoft.core/src/main/resources/cert/apiclient_key.pem";
|
||||
public static String merchantSerialNumber = "48749613B40AA8F1D768583FC352358E13EB5AF0";
|
||||
public static String apiV3Key = "zGufUcqa7ovgxRL0kF5OlPr482EZwtn9";
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
private Config wxPayConfig;
|
||||
@Resource
|
||||
private ConfigProperties config;
|
||||
@Resource
|
||||
private SettingService settingService;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
|
||||
|
||||
@ApiOperation("生成付款码")
|
||||
@PostMapping("/codeUrl")
|
||||
public ApiResult<?> getCodeUrl(@RequestBody Order order) {
|
||||
final User loginUser = getLoginUser();
|
||||
if(loginUser == null){
|
||||
return fail("请先登录");
|
||||
}
|
||||
String key = "Payment:wxPay:".concat(getTenantId().toString());
|
||||
final Payment payment = redisUtil.get(key, Payment.class);
|
||||
if (payment == null) {
|
||||
return fail("微信支付未配置");
|
||||
}
|
||||
// 获取微信小程序配置信息
|
||||
final String string = redisUtil.get("mp-weixin:".concat(getTenantId().toString()));
|
||||
if(string == null){
|
||||
return fail("微信小程序未配置");
|
||||
}
|
||||
final JSONObject jsonObject = JSONObject.parseObject(string);
|
||||
final String appId = jsonObject.getString("appId");
|
||||
|
||||
// 处理订单数据
|
||||
order.setTenantId(loginUser.getTenantId());
|
||||
order.setUid(loginUser.getUserId());
|
||||
// order.setRealName(loginUser.getRealName());
|
||||
order.setPhone(loginUser.getPhone());
|
||||
// order.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.MONTH, order.getTotalNum()));
|
||||
|
||||
// 使用自动更新平台证书的RSA配置
|
||||
// 一个商户号只能初始化一个配置,否则会因为重复的下载任务报错
|
||||
|
||||
// 构建service
|
||||
NativePayService service = new NativePayService.Builder().config(this.getWxPayConfig()).build();
|
||||
// request.setXxx(val)设置所需参数,具体参数可见Request定义
|
||||
PrepayRequest request = new PrepayRequest();
|
||||
// 计算金额
|
||||
order.setMoney(new BigDecimal("0.01")); // order.getPayPrice().toString()
|
||||
long orderNo = IdUtil.getSnowflakeNextId();
|
||||
order.setOrderNo(Long.toString(orderNo));
|
||||
BigDecimal decimal = order.getMoney();
|
||||
final BigDecimal multiply = decimal.multiply(new BigDecimal(100));
|
||||
// 将 BigDecimal 转换为 Integer
|
||||
Integer money = multiply.intValue();
|
||||
Amount amount = new Amount();
|
||||
amount.setTotal(money);
|
||||
request.setAmount(amount);
|
||||
request.setAppid(appId);
|
||||
request.setMchid(payment.getMchId());
|
||||
request.setDescription(order.getComments());
|
||||
request.setNotifyUrl("https://modules.gxwebsoft.com/api/shop/wx-native-pay/notify/" + getTenantId());
|
||||
request.setOutTradeNo(order.getOrderNo());
|
||||
// 调用下单方法,得到应答
|
||||
PrepayResponse response = service.prepay(request);
|
||||
// 使用微信扫描 code_url 对应的二维码,即可体验Native支付
|
||||
// System.out.println(response.getCodeUrl());
|
||||
// 生成指定url对应的二维码到文件,宽和高都是300像素
|
||||
// QrCodeUtil.generate(response.getCodeUrl(), 300, 300, FileUtil.file("/Users/gxwebsoft/Documents/uploads/wx-native-qrcode.jpg"));
|
||||
orderService.save(order);
|
||||
|
||||
return success("生成付款码", response.getCodeUrl());
|
||||
}
|
||||
|
||||
|
||||
private Config getWxPayConfig() {
|
||||
// 获取租户ID
|
||||
final Integer tenantId = getTenantId();
|
||||
Config build = WxNativeUtil.getConfig(tenantId);
|
||||
if (build != null) {
|
||||
return build;
|
||||
}
|
||||
String key = "Payment:wxPay:".concat(tenantId.toString());
|
||||
final Payment payment = redisUtil.get(key, Payment.class);
|
||||
System.out.println("payment = " + payment);
|
||||
String apiclientKey = config.getUploadPath().concat("/file").concat(payment.getApiclientKey());
|
||||
// 开发环境配置
|
||||
if(active.equals("dev")){
|
||||
apiclientKey = privateKeyPath;
|
||||
}
|
||||
Config config = new RSAAutoCertificateConfig.Builder()
|
||||
.merchantId(payment.getMchId())
|
||||
.privateKeyFromPath(apiclientKey)
|
||||
.merchantSerialNumber(payment.getMerchantSerialNumber())
|
||||
.apiV3Key(payment.getApiKey())
|
||||
.build();
|
||||
System.out.println("config = " + config);
|
||||
WxNativeUtil.addConfig(tenantId, config);
|
||||
return config;
|
||||
}
|
||||
|
||||
@ApiModelProperty("异步通知")
|
||||
@PostMapping("/notify/{tenantId}")
|
||||
public String wxNotify(@RequestHeader Map<String, String> header, @RequestBody String body, @PathVariable("tenantId") Integer tenantId) {
|
||||
System.out.println("异步通知*************** = ");
|
||||
System.out.println("request header = " + header);
|
||||
System.out.println("request body = " + body);
|
||||
System.out.println("tenantId = " + tenantId);
|
||||
|
||||
// 获取支付配置信息用于解密
|
||||
final SettingParam param = new SettingParam();
|
||||
param.setSettingKey("payment");
|
||||
param.setTenantId(tenantId);
|
||||
final String uploadPath = config.getUploadPath(); // 服务器本地路径
|
||||
|
||||
return "fail";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.booking.service.UserCardService;
|
||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||
import com.gxwebsoft.shop.entity.Payment;
|
||||
import com.gxwebsoft.shop.service.OrderInfoService;
|
||||
import com.gxwebsoft.shop.service.OrderService;
|
||||
import com.gxwebsoft.shop.service.UsersService;
|
||||
import com.wechat.pay.java.core.notification.NotificationConfig;
|
||||
import com.wechat.pay.java.core.notification.NotificationParser;
|
||||
import com.wechat.pay.java.core.notification.RSANotificationConfig;
|
||||
import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 会员特权购买记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-06-20 18:07:50
|
||||
*/
|
||||
@Api(tags = "微信支付结果通知")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/wx-pay")
|
||||
public class WxPayNotifyController extends BaseController {
|
||||
@Value("${spring.profiles.active}")
|
||||
String active;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
@Resource
|
||||
private UsersService usersService;
|
||||
@Resource
|
||||
private UserCardService userCardService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
private ConfigProperties conf;
|
||||
// 本地证书
|
||||
public static String wechatpayCertPath = "/Users/gxwebsoft/JAVA/com.gxwebsoft.core/src/main/resources/cert/wechatpay_4A3231584E93B6AE77820074D07EADEACCB7E223.pem"; // 平台证书
|
||||
|
||||
@ApiModelProperty("异步通知")
|
||||
@PostMapping("/notify/{tenantId}")
|
||||
public String wxNotify(@RequestHeader Map<String, String> header, @RequestBody String body, @PathVariable("tenantId") Integer tenantId) {
|
||||
System.out.println("异步通知*************** = ");
|
||||
System.out.println("request header = " + header);
|
||||
System.out.println("request body = " + body);
|
||||
System.out.println("tenantId = " + tenantId);
|
||||
|
||||
// 获取支付配置信息用于解密
|
||||
String key = "Payment:1:".concat(tenantId.toString());
|
||||
final Payment payment = redisUtil.get(key, Payment.class);
|
||||
String privateKey = payment.getApiKey();
|
||||
String apiclientCert = conf.getUploadPath().concat("/file").concat(payment.getApiclientCert());
|
||||
// 开发环境配置
|
||||
if(active.equals("dev")){
|
||||
apiclientCert = wechatpayCertPath;
|
||||
}
|
||||
|
||||
com.wechat.pay.java.core.notification.RequestParam requestParam = new com.wechat.pay.java.core.notification.RequestParam.Builder()
|
||||
.serialNumber(header.get("wechatpay-serial"))
|
||||
.nonce(header.get("wechatpay-nonce"))
|
||||
.signature(header.get("wechatpay-signature"))
|
||||
.timestamp(header.get("wechatpay-timestamp"))
|
||||
.body(body)
|
||||
.build();
|
||||
|
||||
System.out.println("payment = " + payment);
|
||||
System.out.println("requestParam = " + requestParam);
|
||||
|
||||
// 如果已经初始化了 RSAAutoCertificateConfig,可直接使用
|
||||
// 没有的话,则构造一个
|
||||
NotificationConfig config = new RSANotificationConfig.Builder()
|
||||
.apiV3Key(privateKey)
|
||||
.certificatesFromPath(apiclientCert)
|
||||
.build();
|
||||
|
||||
|
||||
// 初始化 NotificationParser
|
||||
NotificationParser parser = new NotificationParser(config);
|
||||
|
||||
// 以支付通知回调为例,验签、解密并转换成 Transaction
|
||||
try {
|
||||
Transaction transaction = parser.parse(requestParam, Transaction.class);
|
||||
final String outTradeNo = transaction.getOutTradeNo();
|
||||
final String transactionId = transaction.getTransactionId();
|
||||
final Integer total = transaction.getAmount().getTotal();
|
||||
final String tradeStateDesc = transaction.getTradeStateDesc();
|
||||
final Transaction.TradeStateEnum tradeState = transaction.getTradeState();
|
||||
final Transaction.TradeTypeEnum tradeType = transaction.getTradeType();
|
||||
System.out.println("transaction = " + transaction);
|
||||
System.out.println("tradeStateDesc = " + tradeStateDesc);
|
||||
System.out.println("tradeType = " + tradeType);
|
||||
System.out.println("tradeState = " + tradeState);
|
||||
System.out.println("outTradeNo = " + outTradeNo);
|
||||
System.out.println("amount = " + total);
|
||||
|
||||
// if (StrUtil.equals("支付成功", tradeStateDesc)) {
|
||||
// 1. 查询要处理的订单
|
||||
// Order order = orderService.getByOutTradeNo(outTradeNo);
|
||||
// 2. 已支付则跳过
|
||||
// if (order.getPayStatus().equals(1)) {
|
||||
// return "SUCCESS";
|
||||
// }
|
||||
// 2. 未支付则处理更新订单状态
|
||||
// if (order.getPayStatus().equals(0)) {
|
||||
// 5. TODO 处理订单状态
|
||||
// order.setPayTime(DateUtil.date());
|
||||
// order.setPayStatus(1);
|
||||
// order.setTransactionId(transactionId);
|
||||
// order.setPayPrice(new BigDecimal(NumberUtil.decimalFormat("0.00", total * 0.01)));
|
||||
// order.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.YEAR, 10));
|
||||
// System.out.println("实际付款金额 = " + order.getPayPrice());
|
||||
// orderService.updateByOutTradeNo(order);
|
||||
// 6. TODO 同步更新订单明细的支付状态
|
||||
// orderInfoService.update(new LambdaUpdateWrapper<OrderInfo>().eq(OrderInfo::getOrderId,order.getOrderId()).set(OrderInfo::getPayStatus,1));
|
||||
// orderInfoService.updateByOutTradeNo(order);
|
||||
// 7.同步会员卡状态
|
||||
// if(order.getType().equals(2)){
|
||||
// final UserCard userCard = userCardService.getById(order.getVid());
|
||||
// userCard.setStatus(1);
|
||||
// userCardService.updateById(userCard);
|
||||
// }
|
||||
// 8.发放积分
|
||||
// usersService.addIntegral(order);
|
||||
|
||||
// return "SUCCESS";
|
||||
// }
|
||||
// }
|
||||
} catch (Exception $e) {
|
||||
System.out.println($e.getMessage());
|
||||
}
|
||||
|
||||
return "fail";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.entity.Cart;
|
||||
import com.gxwebsoft.shop.service.*;
|
||||
import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 会员特权购买记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-06-20 18:07:50
|
||||
*/
|
||||
@Api(tags = "微信支付结果通知")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/wx-pay/notify/nbg")
|
||||
public class WxPayNotifyNbgController extends BaseController {
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
@Resource
|
||||
private OrderGoodsService orderGoodsService;
|
||||
@Resource
|
||||
private GoodsService goodsService;
|
||||
@Resource
|
||||
private UsersService usersService;
|
||||
@Resource
|
||||
private CartService cartService;
|
||||
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@ApiModelProperty("微信支付通知")
|
||||
@PostMapping()
|
||||
public String demo(@RequestBody Transaction transaction){
|
||||
|
||||
System.out.println("支付通知 >>>>> ");
|
||||
System.out.println("transaction = " + transaction);
|
||||
|
||||
// TODO 1.查询订单信息
|
||||
// final Order order = orderService.getByOutTradeNo(transaction.getOutTradeNo());
|
||||
// TODO 2.更新订单支付状态
|
||||
// order.setPayStatus(1);
|
||||
// order.setTransactionId(transaction.getTransactionId());
|
||||
// order.setPayPrice(new BigDecimal(NumberUtil.decimalFormat("0.00", transaction.getAmount().getTotal() * 0.01)));
|
||||
// order.setPayTime(DateUtil.date());
|
||||
// order.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.YEAR, 10));
|
||||
// orderService.updateById(order);
|
||||
// TODO 3.更新订单商品的支付状态
|
||||
// if (order.getType().equals(0)) {
|
||||
// final boolean update = orderGoodsService.update(new LambdaUpdateWrapper<OrderGoods>().eq(OrderGoods::getOrderId, order.getOrderId()).set(OrderGoods::getPayStatus, 1));
|
||||
// System.out.println("update1 = " + update);
|
||||
// // TODO 3.1 更新商品销量、库存数量
|
||||
// final List<OrderGoods> orderGoods = orderGoodsService.list(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderId, order.getOrderId()));
|
||||
// final Set<Integer> goodsIds = orderGoods.stream().map(OrderGoods::getGoodsId).collect(Collectors.toSet());
|
||||
// final Map<Integer, List<OrderGoods>> collectGoods = orderGoods.stream().collect(Collectors.groupingBy(OrderGoods::getGoodsId));
|
||||
// final List<Goods> goods = goodsService.list(new LambdaQueryWrapper<Goods>().in(Goods::getGoodsId, goodsIds));
|
||||
// for (Goods g : goods) {
|
||||
// final List<OrderGoods> goods1 = collectGoods.get(g.getGoodsId());
|
||||
// final OrderGoods goods2 = goods1.get(0);
|
||||
// g.setSales(g.getSales() + goods2.getTotalNum());
|
||||
// if (g.getStock().compareTo(0) >= 0) {
|
||||
// g.setStock(g.getStock() - goods2.getTotalNum());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// final boolean batchById = goodsService.updateBatchById(goods);
|
||||
// System.out.println("batchById = " + batchById);
|
||||
// }
|
||||
// if (order.getType().equals(1)) {
|
||||
// final boolean update = orderInfoService.update(new LambdaUpdateWrapper<OrderInfo>().eq(OrderInfo::getOrderId, order.getOrderId()).set(OrderInfo::getPayStatus, 1));
|
||||
// System.out.println("update2 = " + update);
|
||||
// // TODO 3.2 更新订单类型为预定的关联订单信息
|
||||
// }
|
||||
|
||||
// TODO 4. 清除购物车
|
||||
// final boolean remove = cartService.remove(new LambdaQueryWrapper<Cart>().eq(Cart::getUserId, order.getUid()).eq(Cart::getIsNew, true));
|
||||
// System.out.println("remove = " + remove);
|
||||
|
||||
|
||||
// TODO 5.累计会员积分
|
||||
|
||||
return "订单已支付";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
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 java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-04 11:38:21
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "Brand对象", description = "品牌")
|
||||
@TableName("shop_brand")
|
||||
public class Brand implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "brand_id", type = IdType.AUTO)
|
||||
private Integer brandId;
|
||||
|
||||
@ApiModelProperty(value = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
@ApiModelProperty(value = "图标")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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 2024-07-29 21:02:39
|
||||
*/
|
||||
@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 = "类型 0商城 1预定 ")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "唯一标识")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "商品规格")
|
||||
private String spec;
|
||||
|
||||
@ApiModelProperty(value = "商品价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "商品数量")
|
||||
private Integer cartNum;
|
||||
|
||||
@ApiModelProperty(value = "单品合计")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@ApiModelProperty(value = "0 = 未购买 1 = 已购买")
|
||||
private Boolean isPay;
|
||||
|
||||
@ApiModelProperty(value = "是否为立即购买")
|
||||
private Boolean isNew;
|
||||
|
||||
@ApiModelProperty(value = "是否选中")
|
||||
private Boolean selected;
|
||||
|
||||
@ApiModelProperty(value = "拼团id")
|
||||
private Integer combinationId;
|
||||
|
||||
@ApiModelProperty(value = "秒杀产品ID")
|
||||
private Integer seckillId;
|
||||
|
||||
@ApiModelProperty(value = "砍价id")
|
||||
private Integer bargainId;
|
||||
|
||||
@ApiModelProperty(value = "商户ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "添加时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "店铺名称")
|
||||
@TableField(exist = false)
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "店铺地址")
|
||||
@TableField(exist = false)
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
@TableField(exist = false)
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "商品图片")
|
||||
@TableField(exist = false)
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "是否全选")
|
||||
@TableField(exist = false)
|
||||
private Boolean selectAll;
|
||||
|
||||
@ApiModelProperty("子菜单")
|
||||
@TableField(exist = false)
|
||||
private List<Cart> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 收银
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-08-04 11:51:43
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "Cashier对象", description = "收银")
|
||||
@TableName("shop_cashier")
|
||||
public class Cashier implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "收银单ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "类型 0商城 1外卖")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "唯一标识")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "商品规格")
|
||||
private String spec;
|
||||
|
||||
@ApiModelProperty(value = "商品价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "商品数量")
|
||||
private Integer cartNum;
|
||||
|
||||
@ApiModelProperty(value = "单商品合计")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@ApiModelProperty(value = "0 = 未购买 1 = 已购买")
|
||||
private Boolean isPay;
|
||||
|
||||
@ApiModelProperty(value = "是否为立即购买")
|
||||
private Boolean isNew;
|
||||
|
||||
@ApiModelProperty(value = "是否选中")
|
||||
private Boolean selected;
|
||||
|
||||
@ApiModelProperty(value = "商户ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "收银员ID")
|
||||
private Integer cashierId;
|
||||
|
||||
@ApiModelProperty(value = "收银单分组ID")
|
||||
private Integer groupId;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
@TableField(exist = false)
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "商品图片")
|
||||
@TableField(exist = false)
|
||||
private String image;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 聊天消息表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-27 16:08:04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "ChatConversation对象", description = "聊天消息表")
|
||||
@TableName("shop_chat_conversation")
|
||||
public class ChatConversation 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 = "好友ID")
|
||||
private Integer friendId;
|
||||
|
||||
@ApiModelProperty(value = "消息类型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "消息内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "未读消息")
|
||||
private Integer unRead;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0未读, 1已读")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 聊天消息表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-27 16:08:04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "ChatMessage对象", description = "聊天消息表")
|
||||
@TableName("shop_chat_message")
|
||||
public class ChatMessage 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 formUserId;
|
||||
|
||||
@ApiModelProperty(value = "接收人ID")
|
||||
private Integer toUserId;
|
||||
|
||||
@ApiModelProperty(value = "消息类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "消息内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "屏蔽接收方")
|
||||
private Integer sideTo;
|
||||
|
||||
@ApiModelProperty(value = "屏蔽发送方")
|
||||
private Integer sideFrom;
|
||||
|
||||
@ApiModelProperty(value = "是否撤回")
|
||||
private Integer withdraw;
|
||||
|
||||
@ApiModelProperty(value = "文件信息")
|
||||
private String fileInfo;
|
||||
|
||||
@ApiModelProperty(value = "存在联系方式")
|
||||
private Integer hasContact;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0未读, 1已读")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.time.LocalDate;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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 2024-07-31 22:25:10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "Count对象", description = "商城销售统计表")
|
||||
@TableName("shop_count")
|
||||
public class Count implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "统计日期")
|
||||
private String dateTime;
|
||||
|
||||
@ApiModelProperty(value = "总销售额")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@ApiModelProperty(value = "今日销售额")
|
||||
private BigDecimal todayPrice;
|
||||
|
||||
@ApiModelProperty(value = "总会员数")
|
||||
private BigDecimal totalUsers;
|
||||
|
||||
@ApiModelProperty(value = "今日新增")
|
||||
private BigDecimal todayUsers;
|
||||
|
||||
@ApiModelProperty(value = "总订单笔数")
|
||||
private BigDecimal totalOrders;
|
||||
|
||||
@ApiModelProperty(value = "今日订单笔数")
|
||||
private BigDecimal todayOrders;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
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 java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 分销商申请记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "DealerApply对象", description = "分销商申请记录表")
|
||||
@TableName("shop_dealer_apply")
|
||||
public class DealerApply implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@TableId(value = "apply_id", type = IdType.AUTO)
|
||||
private Integer applyId;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "手机号")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "推荐人用户ID")
|
||||
private Integer refereeId;
|
||||
|
||||
@ApiModelProperty(value = "申请方式(10需后台审核 20无需审核)")
|
||||
private Integer applyType;
|
||||
|
||||
@ApiModelProperty(value = "申请时间")
|
||||
private Integer applyTime;
|
||||
|
||||
@ApiModelProperty(value = "审核状态 (10待审核 20审核通过 30驳回)")
|
||||
private Integer applyStatus;
|
||||
|
||||
@ApiModelProperty(value = "审核时间")
|
||||
private Integer auditTime;
|
||||
|
||||
@ApiModelProperty(value = "驳回原因")
|
||||
private String rejectReason;
|
||||
|
||||
@ApiModelProperty(value = "商城ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
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 java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 分销商资金明细表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "DealerCapital对象", description = "分销商资金明细表")
|
||||
@TableName("shop_dealer_capital")
|
||||
public class DealerCapital 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 = "订单ID")
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "资金流动类型 (10佣金收入 20提现支出 30转账支出 40转账收入)")
|
||||
private Integer flowType;
|
||||
|
||||
@ApiModelProperty(value = "金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String describe;
|
||||
|
||||
@ApiModelProperty(value = "对方用户ID")
|
||||
private Integer toUserId;
|
||||
|
||||
@ApiModelProperty(value = "商城ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
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 java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 分销商订单记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "DealerOrder对象", description = "分销商订单记录表")
|
||||
@TableName("shop_dealer_order")
|
||||
public class DealerOrder 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 = "订单ID")
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "订单总金额(不含运费)")
|
||||
private BigDecimal orderPrice;
|
||||
|
||||
@ApiModelProperty(value = "分销商用户id(一级)")
|
||||
private Integer firstUserId;
|
||||
|
||||
@ApiModelProperty(value = "分销商用户id(二级)")
|
||||
private Integer secondUserId;
|
||||
|
||||
@ApiModelProperty(value = "分销商用户id(三级)")
|
||||
private Integer thirdUserId;
|
||||
|
||||
@ApiModelProperty(value = "分销佣金(一级)")
|
||||
private BigDecimal firstMoney;
|
||||
|
||||
@ApiModelProperty(value = "分销佣金(二级)")
|
||||
private BigDecimal secondMoney;
|
||||
|
||||
@ApiModelProperty(value = "分销佣金(三级)")
|
||||
private BigDecimal thirdMoney;
|
||||
|
||||
@ApiModelProperty(value = "订单是否失效(0未失效 1已失效)")
|
||||
private Integer isInvalid;
|
||||
|
||||
@ApiModelProperty(value = "佣金结算(0未结算 1已结算)")
|
||||
private Integer isSettled;
|
||||
|
||||
@ApiModelProperty(value = "结算时间")
|
||||
private Integer settleTime;
|
||||
|
||||
@ApiModelProperty(value = "商城ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
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 java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 分销商推荐关系表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "DealerReferee对象", description = "分销商推荐关系表")
|
||||
@TableName("shop_dealer_referee")
|
||||
public class DealerReferee 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 = "商城ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 分销商设置表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "DealerSetting对象", description = "分销商设置表")
|
||||
@TableName("shop_dealer_setting")
|
||||
public class DealerSetting implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "设置项标示")
|
||||
@TableId(value = "key", type = IdType.AUTO)
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(value = "设置项描述")
|
||||
private String describe;
|
||||
|
||||
@ApiModelProperty(value = "设置内容(json格式)")
|
||||
private String values;
|
||||
|
||||
@ApiModelProperty(value = "商城ID")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Integer updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
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.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 分销商用户记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 19:21:15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "DealerUser对象", description = "分销商用户记录表")
|
||||
@TableName("shop_dealer_user")
|
||||
public class DealerUser 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 = "姓名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "手机号")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "支付密码")
|
||||
private String payPassword;
|
||||
|
||||
@ApiModelProperty(value = "当前可提现佣金")
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "已冻结佣金")
|
||||
private BigDecimal freezeMoney;
|
||||
|
||||
@ApiModelProperty(value = "累积提现佣金")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@ApiModelProperty(value = "推荐人用户ID")
|
||||
private Integer refereeId;
|
||||
|
||||
@ApiModelProperty(value = "成员数量(一级)")
|
||||
private Integer firstNum;
|
||||
|
||||
@ApiModelProperty(value = "成员数量(二级)")
|
||||
private Integer secondNum;
|
||||
|
||||
@ApiModelProperty(value = "成员数量(三级)")
|
||||
private Integer thirdNum;
|
||||
|
||||
@ApiModelProperty(value = "专属二维码")
|
||||
private String qrcode;
|
||||
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
private Integer isDelete;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "推荐人信息")
|
||||
@TableField(exist = false)
|
||||
private DealerUser dealerUser;
|
||||
|
||||
@ApiModelProperty(value = "推荐人姓名(脱敏)")
|
||||
@TableField(exist = false)
|
||||
private String dealerName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
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 java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 分销商提现明细表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "DealerWithdraw对象", description = "分销商提现明细表")
|
||||
@TableName("shop_dealer_withdraw")
|
||||
public class DealerWithdraw 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 = "提现金额")
|
||||
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 = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
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 2024-07-25 19:22:01
|
||||
*/
|
||||
@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 = "类型 1实物商品 2虚拟商品")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "商品编码")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "商品标题")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "商品封面图")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "商品详情")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "商品分类ID")
|
||||
private Integer categoryId;
|
||||
|
||||
@ApiModelProperty(value = "一级分类")
|
||||
private String categoryParent;
|
||||
|
||||
@ApiModelProperty(value = "二级分类")
|
||||
private String categoryChildren;
|
||||
|
||||
@ApiModelProperty(value = "商品规格 0单规格 1多规格")
|
||||
private Integer specs;
|
||||
|
||||
@ApiModelProperty(value = "货架")
|
||||
private String position;
|
||||
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "消费赚取积分")
|
||||
private BigDecimal gainIntegral;
|
||||
|
||||
@ApiModelProperty(value = "进货价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "销售价格")
|
||||
private BigDecimal salePrice;
|
||||
|
||||
@ApiModelProperty(value = "库存计算方式(10下单减库存 20付款减库存)")
|
||||
private Integer deductStockType;
|
||||
|
||||
@ApiModelProperty(value = "封面图")
|
||||
private String files;
|
||||
|
||||
@ApiModelProperty(value = "销量")
|
||||
private Integer sales;
|
||||
|
||||
@ApiModelProperty(value = "库存")
|
||||
private Integer stock;
|
||||
|
||||
@ApiModelProperty(value = "商品重量")
|
||||
private Integer goodsWeight;
|
||||
|
||||
@ApiModelProperty(value = "推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@ApiModelProperty(value = "商户ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "状态(0:未上架,1:上架)")
|
||||
private Integer isShow;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0上架 1待上架 2待审核 3审核不通过")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@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 GoodsSpec goodsSpec;
|
||||
|
||||
@ApiModelProperty(value = "规格值")
|
||||
@TableField(exist = false)
|
||||
private String specValue;
|
||||
|
||||
@ApiModelProperty(value = "商品规格值")
|
||||
@TableField(exist = false)
|
||||
private Object goodsSpecValue;
|
||||
|
||||
@ApiModelProperty(value = "商品sku列表")
|
||||
@TableField(exist = false)
|
||||
private List<GoodsSku> goodsSkus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
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 2024-03-30 19:34:16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsCategory对象", description = "商品分类")
|
||||
@TableName("shop_goods_category")
|
||||
public class GoodsCategory 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 categoryCode;
|
||||
|
||||
@ApiModelProperty(value = "分类名称")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "分类别名")
|
||||
@TableField(exist = false)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "类型 0商城分类 1外卖分类")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "分类图片")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "上级分类ID")
|
||||
private Integer parentId;
|
||||
|
||||
@ApiModelProperty(value = "路由/链接地址")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(value = "组件路径")
|
||||
private String component;
|
||||
|
||||
@ApiModelProperty(value = "绑定的页面")
|
||||
private Integer pageId;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "商品数量")
|
||||
private Integer count;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)")
|
||||
private Integer hide;
|
||||
|
||||
@ApiModelProperty(value = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@ApiModelProperty(value = "是否显示在首页")
|
||||
private Integer showIndex;
|
||||
|
||||
@ApiModelProperty(value = "商铺ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@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 List<Goods> goods;
|
||||
|
||||
@ApiModelProperty("子菜单")
|
||||
@TableField(exist = false)
|
||||
private List<GoodsCategory> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
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 java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品sku列表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-26 10:49:02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsSku对象", description = "商品sku列表")
|
||||
@TableName("shop_goods_sku")
|
||||
public class GoodsSku 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 = "商品属性索引值 (attr_value|attr_value[|....])")
|
||||
private String sku;
|
||||
|
||||
@ApiModelProperty(value = "商品图片")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "商品价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "市场价格")
|
||||
private BigDecimal salePrice;
|
||||
|
||||
@ApiModelProperty(value = "成本价")
|
||||
private BigDecimal cost;
|
||||
|
||||
@ApiModelProperty(value = "库存")
|
||||
private Integer stock;
|
||||
|
||||
@ApiModelProperty(value = "sku编码")
|
||||
private String skuNo;
|
||||
|
||||
@ApiModelProperty(value = "唯一值")
|
||||
private String uuid;
|
||||
|
||||
@ApiModelProperty(value = "商品条码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty(value = "重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
@ApiModelProperty(value = "体积")
|
||||
private BigDecimal volume;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1异常")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "商品图片对象")
|
||||
@TableField(exist = false)
|
||||
private List<Object> images;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class GoodsSkuVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("规格名称")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty("规格值")
|
||||
private List<String> detail;
|
||||
@Data
|
||||
public static class Payload {
|
||||
private String value;
|
||||
private List<String> detail;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
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.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品多规格
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsSpec对象", description = "商品多规格")
|
||||
@TableName("shop_goods_spec")
|
||||
public class GoodsSpec implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
private Integer specId;
|
||||
|
||||
@ApiModelProperty(value = "规格名称")
|
||||
private String specName;
|
||||
|
||||
@ApiModelProperty(value = "规格值")
|
||||
private String specValue;
|
||||
|
||||
@ApiModelProperty(value = "规格值")
|
||||
@TableField(exist = false)
|
||||
private List<SpecValue> valueList;
|
||||
|
||||
@ApiModelProperty(value = "活动类型 0=商品,1=秒杀,2=砍价,3=拼团")
|
||||
private Boolean type;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
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 2024-04-05 00:03: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 image;
|
||||
|
||||
@ApiModelProperty(value = "商户手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "商户姓名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "店铺类型")
|
||||
private String shopType;
|
||||
|
||||
@ApiModelProperty(value = "项目类型")
|
||||
private String itemType;
|
||||
|
||||
@ApiModelProperty(value = "商户分类")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "经纬度")
|
||||
private String lngAndLat;
|
||||
|
||||
@ApiModelProperty(value = "所在省份")
|
||||
private String province;
|
||||
|
||||
@ApiModelProperty(value = "所在城市")
|
||||
private String city;
|
||||
|
||||
@ApiModelProperty(value = "所在辖区")
|
||||
private String region;
|
||||
|
||||
@ApiModelProperty(value = "详细地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = "每小时价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "手续费")
|
||||
private BigDecimal commission;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(value = "资质图片")
|
||||
private String files;
|
||||
|
||||
@ApiModelProperty(value = "营业时间")
|
||||
private String businessTime;
|
||||
|
||||
@ApiModelProperty(value = "商户简介")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "是否自营")
|
||||
private Integer ownStore;
|
||||
|
||||
@ApiModelProperty(value = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@ApiModelProperty(value = "是否需要审核")
|
||||
private Boolean goodsReview;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "管理入口")
|
||||
private String adminUrl;
|
||||
|
||||
@ApiModelProperty(value = "所有人")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "默认商户管理员角色ID")
|
||||
@TableField(exist = false)
|
||||
private Integer roleId;
|
||||
|
||||
@ApiModelProperty(value = "角色名称")
|
||||
@TableField(exist = false)
|
||||
private String roleName;
|
||||
|
||||
@ApiModelProperty(value = "按店铺分类的购物车商品")
|
||||
@TableField(exist = false)
|
||||
private List<Cart> carts;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
|
||||
/**
|
||||
* 商户账号
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-19 12:02:24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "MerchantAccount对象", description = "商户账号")
|
||||
@TableName("shop_merchant_account")
|
||||
public class MerchantAccount implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商户手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "账号密码")
|
||||
@TableField(exist = false)
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "真实姓名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "商户ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
private Integer roleId;
|
||||
|
||||
@ApiModelProperty(value = "角色名称")
|
||||
private String roleName;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
@TableField(exist = false)
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "是否需要审核")
|
||||
@TableField(exist = false)
|
||||
private Boolean goodsReview;
|
||||
|
||||
@ApiModelProperty("手机号(脱敏)")
|
||||
@TableField(exist = false)
|
||||
private String mobile;
|
||||
|
||||
public String getMobile(){
|
||||
return DesensitizedUtil.mobilePhone(this.phone);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
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 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 2024-04-05 01:24:36
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "MerchantApply对象", description = "商户入驻申请")
|
||||
@TableName("shop_merchant_apply")
|
||||
public class MerchantApply implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "apply_id", type = IdType.AUTO)
|
||||
private Integer applyId;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "商户图标")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "商户手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "商户姓名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "店铺类型")
|
||||
private String shopType;
|
||||
|
||||
@ApiModelProperty(value = "商户分类")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "手续费")
|
||||
private BigDecimal commission;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(value = "资质图片")
|
||||
private String files;
|
||||
|
||||
@ApiModelProperty(value = "是否自营")
|
||||
private Integer ownStore;
|
||||
|
||||
@ApiModelProperty(value = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@ApiModelProperty(value = "是否需要审核")
|
||||
private Integer goodsReview;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
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 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 2024-04-05 00:08:51
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "MerchantType对象", description = "商户类型")
|
||||
@TableName("shop_merchant_type")
|
||||
public class MerchantType implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "店铺类型")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "店铺入驻条件")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-08-09 16:33:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "Order对象", description = "")
|
||||
@TableName("shop_order")
|
||||
public class Order implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "order_id", type = IdType.AUTO)
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "订单类型,0商城订单 1预定订单 2会员卡")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "下单渠道,0小程序预定 1俱乐部训练场 3活动订场")
|
||||
private Integer channel;
|
||||
|
||||
@ApiModelProperty(value = "微信支付订单号")
|
||||
private String transactionId;
|
||||
|
||||
@ApiModelProperty(value = "微信退款订单号")
|
||||
private String refundOrder;
|
||||
|
||||
@ApiModelProperty(value = "场馆id用于权限判断")
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "商户编号")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "使用的优惠券id")
|
||||
private Integer cid;
|
||||
|
||||
@ApiModelProperty(value = "使用的会员卡id")
|
||||
private Integer vid;
|
||||
|
||||
@ApiModelProperty(value = "关联管理员id")
|
||||
private Integer aid;
|
||||
|
||||
@ApiModelProperty(value = "核销管理员id")
|
||||
private Integer adminId;
|
||||
|
||||
@ApiModelProperty(value = "IC卡号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "真实姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "订单总额")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@ApiModelProperty(value = "减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格")
|
||||
private BigDecimal reducePrice;
|
||||
|
||||
@ApiModelProperty(value = "实际付款")
|
||||
private BigDecimal payPrice;
|
||||
|
||||
@ApiModelProperty(value = "用于统计")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "价钱,用于积分赠送")
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "退款金额")
|
||||
private BigDecimal refundMoney;
|
||||
|
||||
@ApiModelProperty(value = "教练价格")
|
||||
private BigDecimal coachPrice;
|
||||
|
||||
@ApiModelProperty(value = "教练id")
|
||||
private Integer coachId;
|
||||
|
||||
@ApiModelProperty(value = "1微信支付,2积分,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡")
|
||||
private Integer payType;
|
||||
|
||||
@ApiModelProperty(value = "1已付款,2未付款")
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty(value = "1已完成,2未使用,3已取消,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款")
|
||||
private Integer orderStatus;
|
||||
|
||||
@ApiModelProperty(value = "优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡")
|
||||
private Integer couponType;
|
||||
|
||||
@ApiModelProperty(value = "二维码地址,保存订单号,支付成功后才生成")
|
||||
private String qrcode;
|
||||
|
||||
@ApiModelProperty(value = "优惠说明")
|
||||
private String couponDesc;
|
||||
|
||||
@ApiModelProperty(value = "vip月卡年卡、ic月卡年卡回退次数")
|
||||
private Integer returnNum;
|
||||
|
||||
@ApiModelProperty(value = "vip充值回退金额")
|
||||
private BigDecimal returnMoney;
|
||||
|
||||
@ApiModelProperty(value = "预约详情开始时间数组")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty(value = "是否已开具发票:1已开发票,2未开发票,3不能开具发票")
|
||||
private Integer isInvoice;
|
||||
|
||||
@ApiModelProperty(value = "发票流水号")
|
||||
private String invoiceNo;
|
||||
|
||||
private Integer updateTime;
|
||||
|
||||
@ApiModelProperty(value = "付款时间")
|
||||
private Integer payTime;
|
||||
|
||||
@ApiModelProperty(value = "退款时间")
|
||||
private Integer refundTime;
|
||||
|
||||
@ApiModelProperty(value = "申请退款时间")
|
||||
private Integer refundApplyTime;
|
||||
|
||||
@ApiModelProperty(value = "过期时间")
|
||||
private LocalDateTime expirationTime;
|
||||
|
||||
@ApiModelProperty(value = "对账情况:1=已对账;2=未对账;3=已对账,金额对不上;4=未查询到该订单")
|
||||
private Integer checkBill;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "真实姓名")
|
||||
@TableField(exist = false)
|
||||
private String realName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
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.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品信息
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-26 15:42:03
|
||||
*/
|
||||
@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 = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "关联订单表id")
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "订单标识")
|
||||
private String orderCode;
|
||||
|
||||
@ApiModelProperty(value = "关联商户ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "商品封面图")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "关联商品id")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "购买数量")
|
||||
private Integer totalNum;
|
||||
|
||||
@ApiModelProperty(value = "0 未付款 1已付款,2无需付款或占用状态")
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty(value = "0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款")
|
||||
private Integer orderStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否免费:0收费、1免费")
|
||||
private Boolean isFree;
|
||||
|
||||
@ApiModelProperty(value = "系统版本 0当前版本 其他版本")
|
||||
private Integer version;
|
||||
|
||||
@ApiModelProperty(value = "预约时间段")
|
||||
private String timePeriod;
|
||||
|
||||
@ApiModelProperty(value = "预定日期")
|
||||
private Date dateTime;
|
||||
|
||||
@ApiModelProperty(value = "开场时间")
|
||||
private Date startTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
@ApiModelProperty(value = "毫秒时间戳")
|
||||
private Long timeFlag;
|
||||
|
||||
@ApiModelProperty(value = "过期时间")
|
||||
private Date expirationTime;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-08-10 13:44:39
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "OrderInfo对象", description = "")
|
||||
@TableName("shop_order_info")
|
||||
public class OrderInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "关联订单表id")
|
||||
private Integer oid;
|
||||
|
||||
@ApiModelProperty(value = "关联场馆id")
|
||||
private Integer sid;
|
||||
|
||||
@ApiModelProperty(value = "关联场地id")
|
||||
private Integer fid;
|
||||
|
||||
@ApiModelProperty(value = "场馆")
|
||||
private String siteName;
|
||||
|
||||
@ApiModelProperty(value = "场地")
|
||||
private String fieldName;
|
||||
|
||||
@ApiModelProperty(value = "预约时间段")
|
||||
private String dateTime;
|
||||
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "儿童价")
|
||||
private BigDecimal childrenPrice;
|
||||
|
||||
@ApiModelProperty(value = "成人人数")
|
||||
private Integer adultNum;
|
||||
|
||||
@ApiModelProperty(value = "儿童人数")
|
||||
private Integer childrenNum;
|
||||
|
||||
@ApiModelProperty(value = "1已付款,2未付款,3无需付款或占用状态")
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否免费:1免费、2收费")
|
||||
private Integer isFree;
|
||||
|
||||
@ApiModelProperty(value = "是否支持儿童票:1支持,2不支持")
|
||||
private Integer isChildren;
|
||||
|
||||
@ApiModelProperty(value = "预订类型:1全场,2半场")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "组合数据:日期+时间段+场馆id+场地id")
|
||||
private String mergeData;
|
||||
|
||||
@ApiModelProperty(value = "开场时间")
|
||||
private Integer startTime;
|
||||
|
||||
@ApiModelProperty(value = "下单时间")
|
||||
private Integer orderTime;
|
||||
|
||||
@ApiModelProperty(value = "毫秒时间戳")
|
||||
private Long timeFlag;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "组合数据:日期+时间段+场馆id+场地id")
|
||||
@TableField(exist = false)
|
||||
private String orderCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
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 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 2024-05-14 13:20:04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "OrderInfoLog对象", description = "订单核销")
|
||||
@TableName("shop_order_info_log")
|
||||
public class OrderInfoLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "关联订单表id")
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "关联商户ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "关联场地id")
|
||||
private Integer fieldId;
|
||||
|
||||
@ApiModelProperty(value = "核销数量")
|
||||
private Boolean useNum;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
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 2024-05-11 12:39:11
|
||||
*/
|
||||
@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 = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "支付方式")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "标识")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "支付图标")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "微信商户号类型 1普通商户2子商户")
|
||||
private Integer wechatType;
|
||||
|
||||
@ApiModelProperty(value = "应用ID")
|
||||
private String appId;
|
||||
|
||||
@ApiModelProperty(value = "商户号")
|
||||
private String mchId;
|
||||
|
||||
@ApiModelProperty(value = "设置APIv3密钥")
|
||||
private String apiKey;
|
||||
|
||||
@ApiModelProperty(value = "证书文件 (CERT)")
|
||||
private String apiclientCert;
|
||||
|
||||
@ApiModelProperty(value = "证书文件 (KEY)")
|
||||
private String apiclientKey;
|
||||
|
||||
@ApiModelProperty(value = "商户证书序列号")
|
||||
private String merchantSerialNumber;
|
||||
|
||||
@ApiModelProperty(value = "支付结果通知")
|
||||
private String notifyUrl;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "文章排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0未启用, 1启用")
|
||||
private Boolean 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 2024-07-26 23:18:48
|
||||
*/
|
||||
@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 String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "充值方式(10自定义金额 20套餐充值)")
|
||||
private Integer rechargeType;
|
||||
|
||||
@ApiModelProperty(value = "机构id")
|
||||
private Integer organizationId;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
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 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 2024-07-25 03:00:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "Spec对象", description = "规格")
|
||||
@TableName("shop_spec")
|
||||
public class Spec implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
@TableId(value = "spec_id", type = IdType.AUTO)
|
||||
private Integer specId;
|
||||
|
||||
@ApiModelProperty(value = "规格名称")
|
||||
private String specName;
|
||||
|
||||
@ApiModelProperty(value = "规格值")
|
||||
private String specValue;
|
||||
|
||||
@ApiModelProperty(value = "创建用户")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "更新者")
|
||||
private Integer updater;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待修,2异常已修,3异常未修")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
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 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 2024-04-01 09:49:15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "SpecValue对象", description = "规格值")
|
||||
@TableName("shop_spec_value")
|
||||
public class SpecValue implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "规格值ID")
|
||||
@TableId(value = "spec_value_id", type = IdType.AUTO)
|
||||
private Integer specValueId;
|
||||
|
||||
@ApiModelProperty(value = "规格值")
|
||||
private String specValue;
|
||||
|
||||
@ApiModelProperty(value = "规格组ID")
|
||||
private Integer specId;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
}
|
||||
@@ -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 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 2024-05-26 10:58:37
|
||||
*/
|
||||
@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 = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "所在国家")
|
||||
private String country;
|
||||
|
||||
@ApiModelProperty(value = "所在省份")
|
||||
private String province;
|
||||
|
||||
@ApiModelProperty(value = "所在城市")
|
||||
private String city;
|
||||
|
||||
@ApiModelProperty(value = "所在辖区")
|
||||
private String region;
|
||||
|
||||
@ApiModelProperty(value = "收货地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = "1先生 2女士")
|
||||
private Integer gender;
|
||||
|
||||
@ApiModelProperty(value = "家、公司、学校")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "默认收货地址")
|
||||
private Boolean isDefault;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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 2024-05-29 15:57:44
|
||||
*/
|
||||
@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 = "操作人ID")
|
||||
private Integer adminId;
|
||||
|
||||
@ApiModelProperty(value = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "商户ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@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,42 @@
|
||||
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 java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 我的收藏
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-28 18:17:37
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "UserCollection对象", description = "我的收藏")
|
||||
@TableName("shop_user_collection")
|
||||
public class UserCollection 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 tid;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
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.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-08-09 15:20:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "Users对象", description = "")
|
||||
@TableName("shop_users")
|
||||
public class Users implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户唯一小程序id")
|
||||
private String openId;
|
||||
|
||||
@ApiModelProperty(value = "小程序用户秘钥")
|
||||
private String sessionKey;
|
||||
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "头像地址")
|
||||
private String avatarUrl;
|
||||
|
||||
@ApiModelProperty(value = "1男,2女")
|
||||
private Integer gender;
|
||||
|
||||
@ApiModelProperty(value = "国家")
|
||||
private String country;
|
||||
|
||||
@ApiModelProperty(value = "省份")
|
||||
private String province;
|
||||
|
||||
@ApiModelProperty(value = "城市")
|
||||
private String city;
|
||||
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "积分")
|
||||
private BigDecimal integral;
|
||||
|
||||
@ApiModelProperty(value = "余额")
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Long createTime;
|
||||
|
||||
private String idcard;
|
||||
|
||||
private String truename;
|
||||
|
||||
@ApiModelProperty(value = "是否管理员:1是;2否")
|
||||
private Integer isAdmin;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
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.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 押金
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 15:50:28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "WechatDeposit对象", description = "押金")
|
||||
@TableName("shop_wechat_deposit")
|
||||
public class WechatDeposit implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "订单id")
|
||||
private Integer oid;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "场地订单号")
|
||||
private String orderNum;
|
||||
|
||||
@ApiModelProperty(value = "付款订单号")
|
||||
private String wechatOrder;
|
||||
|
||||
@ApiModelProperty(value = "退款订单号 ")
|
||||
private String wechatReturn;
|
||||
|
||||
@ApiModelProperty(value = "场馆名称")
|
||||
private String siteName;
|
||||
|
||||
@ApiModelProperty(value = "微信昵称")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "物品名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "押金金额")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "押金状态,1已付款,2未付款,已退押金")
|
||||
private Integer status;
|
||||
|
||||
private Integer createTime;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
}
|
||||
@@ -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.Brand;
|
||||
import com.gxwebsoft.shop.param.BrandParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 品牌Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-04 11:38:21
|
||||
*/
|
||||
public interface BrandMapper extends BaseMapper<Brand> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<Brand>
|
||||
*/
|
||||
List<Brand> selectPageRel(@Param("page") IPage<Brand> page,
|
||||
@Param("param") BrandParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<Brand> selectListRel(@Param("param") BrandParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
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 2024-07-29 21:02:39
|
||||
*/
|
||||
public interface CartMapper extends MPJBaseMapper<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.Cashier;
|
||||
import com.gxwebsoft.shop.param.CashierParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收银Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-08-04 11:51:43
|
||||
*/
|
||||
public interface CashierMapper extends BaseMapper<Cashier> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<Cashier>
|
||||
*/
|
||||
List<Cashier> selectPageRel(@Param("page") IPage<Cashier> page,
|
||||
@Param("param") CashierParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<Cashier> selectListRel(@Param("param") CashierParam 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.ChatConversation;
|
||||
import com.gxwebsoft.shop.param.ChatConversationParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 聊天消息表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-27 16:08:04
|
||||
*/
|
||||
public interface ChatConversationMapper extends BaseMapper<ChatConversation> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ChatConversation>
|
||||
*/
|
||||
List<ChatConversation> selectPageRel(@Param("page") IPage<ChatConversation> page,
|
||||
@Param("param") ChatConversationParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ChatConversation> selectListRel(@Param("param") ChatConversationParam 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.ChatMessage;
|
||||
import com.gxwebsoft.shop.param.ChatMessageParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 聊天消息表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-27 16:08:04
|
||||
*/
|
||||
public interface ChatMessageMapper extends BaseMapper<ChatMessage> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ChatMessage>
|
||||
*/
|
||||
List<ChatMessage> selectPageRel(@Param("page") IPage<ChatMessage> page,
|
||||
@Param("param") ChatMessageParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ChatMessage> selectListRel(@Param("param") ChatMessageParam 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.Count;
|
||||
import com.gxwebsoft.shop.param.CountParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商城销售统计表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-31 22:25:10
|
||||
*/
|
||||
public interface CountMapper extends BaseMapper<Count> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<Count>
|
||||
*/
|
||||
List<Count> selectPageRel(@Param("page") IPage<Count> page,
|
||||
@Param("param") CountParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<Count> selectListRel(@Param("param") CountParam 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.DealerApply;
|
||||
import com.gxwebsoft.shop.param.DealerApplyParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商申请记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
public interface DealerApplyMapper extends BaseMapper<DealerApply> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DealerApply>
|
||||
*/
|
||||
List<DealerApply> selectPageRel(@Param("page") IPage<DealerApply> page,
|
||||
@Param("param") DealerApplyParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DealerApply> selectListRel(@Param("param") DealerApplyParam 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.DealerCapital;
|
||||
import com.gxwebsoft.shop.param.DealerCapitalParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商资金明细表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
public interface DealerCapitalMapper extends BaseMapper<DealerCapital> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DealerCapital>
|
||||
*/
|
||||
List<DealerCapital> selectPageRel(@Param("page") IPage<DealerCapital> page,
|
||||
@Param("param") DealerCapitalParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DealerCapital> selectListRel(@Param("param") DealerCapitalParam 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.DealerOrder;
|
||||
import com.gxwebsoft.shop.param.DealerOrderParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商订单记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
public interface DealerOrderMapper extends BaseMapper<DealerOrder> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DealerOrder>
|
||||
*/
|
||||
List<DealerOrder> selectPageRel(@Param("page") IPage<DealerOrder> page,
|
||||
@Param("param") DealerOrderParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DealerOrder> selectListRel(@Param("param") DealerOrderParam 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.DealerReferee;
|
||||
import com.gxwebsoft.shop.param.DealerRefereeParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商推荐关系表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
public interface DealerRefereeMapper extends BaseMapper<DealerReferee> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DealerReferee>
|
||||
*/
|
||||
List<DealerReferee> selectPageRel(@Param("page") IPage<DealerReferee> page,
|
||||
@Param("param") DealerRefereeParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DealerReferee> selectListRel(@Param("param") DealerRefereeParam 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.DealerSetting;
|
||||
import com.gxwebsoft.shop.param.DealerSettingParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商设置表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
public interface DealerSettingMapper extends BaseMapper<DealerSetting> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DealerSetting>
|
||||
*/
|
||||
List<DealerSetting> selectPageRel(@Param("page") IPage<DealerSetting> page,
|
||||
@Param("param") DealerSettingParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DealerSetting> selectListRel(@Param("param") DealerSettingParam 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.DealerUser;
|
||||
import com.gxwebsoft.shop.param.DealerUserParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商用户记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 19:21:15
|
||||
*/
|
||||
public interface DealerUserMapper extends BaseMapper<DealerUser> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DealerUser>
|
||||
*/
|
||||
List<DealerUser> selectPageRel(@Param("page") IPage<DealerUser> page,
|
||||
@Param("param") DealerUserParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DealerUser> selectListRel(@Param("param") DealerUserParam 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.DealerWithdraw;
|
||||
import com.gxwebsoft.shop.param.DealerWithdrawParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分销商提现明细表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-28 11:57:41
|
||||
*/
|
||||
public interface DealerWithdrawMapper extends BaseMapper<DealerWithdraw> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DealerWithdraw>
|
||||
*/
|
||||
List<DealerWithdraw> selectPageRel(@Param("page") IPage<DealerWithdraw> page,
|
||||
@Param("param") DealerWithdrawParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DealerWithdraw> selectListRel(@Param("param") DealerWithdrawParam 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.GoodsCategory;
|
||||
import com.gxwebsoft.shop.param.GoodsCategoryParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品分类Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:34:16
|
||||
*/
|
||||
public interface GoodsCategoryMapper extends BaseMapper<GoodsCategory> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsCategory>
|
||||
*/
|
||||
List<GoodsCategory> selectPageRel(@Param("page") IPage<GoodsCategory> page,
|
||||
@Param("param") GoodsCategoryParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsCategory> selectListRel(@Param("param") GoodsCategoryParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
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 2024-07-25 19:22:01
|
||||
*/
|
||||
public interface GoodsMapper extends MPJBaseMapper<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.GoodsSku;
|
||||
import com.gxwebsoft.shop.param.GoodsSkuParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品sku列表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-26 10:49:02
|
||||
*/
|
||||
public interface GoodsSkuMapper extends BaseMapper<GoodsSku> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsSku>
|
||||
*/
|
||||
List<GoodsSku> selectPageRel(@Param("page") IPage<GoodsSku> page,
|
||||
@Param("param") GoodsSkuParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsSku> selectListRel(@Param("param") GoodsSkuParam 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.GoodsSpec;
|
||||
import com.gxwebsoft.shop.param.GoodsSpecParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品sku列表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
public interface GoodsSpecMapper extends BaseMapper<GoodsSpec> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsSpec>
|
||||
*/
|
||||
List<GoodsSpec> selectPageRel(@Param("page") IPage<GoodsSpec> page,
|
||||
@Param("param") GoodsSpecParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsSpec> selectListRel(@Param("param") GoodsSpecParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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.MerchantAccount;
|
||||
import com.gxwebsoft.shop.param.MerchantAccountParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户账号Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-19 12:02:24
|
||||
*/
|
||||
public interface MerchantAccountMapper extends BaseMapper<MerchantAccount> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<MerchantAccount>
|
||||
*/
|
||||
List<MerchantAccount> selectPageRel(@Param("page") IPage<MerchantAccount> page,
|
||||
@Param("param") MerchantAccountParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<MerchantAccount> selectListRel(@Param("param") MerchantAccountParam param);
|
||||
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
MerchantAccount getMerchantAccountByPhone(@Param("param") MerchantAccountParam 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.MerchantApply;
|
||||
import com.gxwebsoft.shop.param.MerchantApplyParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户入驻申请Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 01:24:36
|
||||
*/
|
||||
public interface MerchantApplyMapper extends BaseMapper<MerchantApply> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<MerchantApply>
|
||||
*/
|
||||
List<MerchantApply> selectPageRel(@Param("page") IPage<MerchantApply> page,
|
||||
@Param("param") MerchantApplyParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<MerchantApply> selectListRel(@Param("param") MerchantApplyParam 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 2024-04-05 00:03: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.MerchantType;
|
||||
import com.gxwebsoft.shop.param.MerchantTypeParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户类型Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:08:51
|
||||
*/
|
||||
public interface MerchantTypeMapper extends BaseMapper<MerchantType> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<MerchantType>
|
||||
*/
|
||||
List<MerchantType> selectPageRel(@Param("page") IPage<MerchantType> page,
|
||||
@Param("param") MerchantTypeParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<MerchantType> selectListRel(@Param("param") MerchantTypeParam 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.OrderGoods;
|
||||
import com.gxwebsoft.shop.param.OrderGoodsParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品信息Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-26 15:42:03
|
||||
*/
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -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.OrderInfoLog;
|
||||
import com.gxwebsoft.shop.param.OrderInfoLogParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单核销Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-14 13:20:04
|
||||
*/
|
||||
public interface OrderInfoLogMapper extends BaseMapper<OrderInfoLog> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<OrderInfoLog>
|
||||
*/
|
||||
List<OrderInfoLog> selectPageRel(@Param("page") IPage<OrderInfoLog> page,
|
||||
@Param("param") OrderInfoLogParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<OrderInfoLog> selectListRel(@Param("param") OrderInfoLogParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||
import com.gxwebsoft.shop.param.OrderInfoParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-08-10 13:44:39
|
||||
*/
|
||||
public interface OrderInfoMapper extends MPJBaseMapper<OrderInfo> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<OrderInfo>
|
||||
*/
|
||||
List<OrderInfo> selectPageRel(@Param("page") IPage<OrderInfo> page,
|
||||
@Param("param") OrderInfoParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<OrderInfo> selectListRel(@Param("param") OrderInfoParam param);
|
||||
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
void updateByOutTradeNo(@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.Order;
|
||||
import com.gxwebsoft.shop.param.OrderParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-08-09 16:33:41
|
||||
*/
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -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 2024-07-26 23:18:48
|
||||
*/
|
||||
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.Spec;
|
||||
import com.gxwebsoft.shop.param.SpecParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 规格Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-25 03:00:41
|
||||
*/
|
||||
public interface SpecMapper extends BaseMapper<Spec> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<Spec>
|
||||
*/
|
||||
List<Spec> selectPageRel(@Param("page") IPage<Spec> page,
|
||||
@Param("param") SpecParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<Spec> selectListRel(@Param("param") SpecParam 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.SpecValue;
|
||||
import com.gxwebsoft.shop.param.SpecValueParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 规格值Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-01 09:49:15
|
||||
*/
|
||||
public interface SpecValueMapper extends BaseMapper<SpecValue> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<SpecValue>
|
||||
*/
|
||||
List<SpecValue> selectPageRel(@Param("page") IPage<SpecValue> page,
|
||||
@Param("param") SpecValueParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<SpecValue> selectListRel(@Param("param") SpecValueParam 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 2024-05-26 10:58:37
|
||||
*/
|
||||
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);
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user