完成商品管理的多规格保存入库
This commit is contained in:
@@ -1,114 +0,0 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.GoodsAttrResultService;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttrResult;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrResultParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.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-03-30 19:09:56
|
||||
*/
|
||||
@Api(tags = "商品属性详情表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-attr-result")
|
||||
public class GoodsAttrResultController extends BaseController {
|
||||
@Resource
|
||||
private GoodsAttrResultService goodsAttrResultService;
|
||||
|
||||
@ApiOperation("分页查询商品属性详情表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsAttrResult>> page(GoodsAttrResultParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsAttrResultService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品属性详情表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsAttrResult>> list(GoodsAttrResultParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsAttrResultService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品属性详情表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsAttrResult> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsAttrResultService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品属性详情表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsAttrResult goodsAttrResult) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// goodsAttrResult.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (goodsAttrResultService.save(goodsAttrResult)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品属性详情表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsAttrResult goodsAttrResult) {
|
||||
if (goodsAttrResultService.updateById(goodsAttrResult)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品属性详情表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsAttrResultService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品属性详情表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsAttrResult> list) {
|
||||
if (goodsAttrResultService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品属性详情表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsAttrResult> batchParam) {
|
||||
if (batchParam.update(goodsAttrResultService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品属性详情表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsAttrResultService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.GoodsAttrValueService;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttrValue;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrValueParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.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-03-30 19:09:56
|
||||
*/
|
||||
@Api(tags = "商品属性值表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-attr-value")
|
||||
public class GoodsAttrValueController extends BaseController {
|
||||
@Resource
|
||||
private GoodsAttrValueService goodsAttrValueService;
|
||||
|
||||
@ApiOperation("分页查询商品属性值表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsAttrValue>> page(GoodsAttrValueParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsAttrValueService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品属性值表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsAttrValue>> list(GoodsAttrValueParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsAttrValueService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品属性值表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsAttrValue> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsAttrValueService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品属性值表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsAttrValue goodsAttrValue) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// goodsAttrValue.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (goodsAttrValueService.save(goodsAttrValue)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品属性值表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsAttrValue goodsAttrValue) {
|
||||
if (goodsAttrValueService.updateById(goodsAttrValue)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品属性值表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsAttrValueService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品属性值表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsAttrValue> list) {
|
||||
if (goodsAttrValueService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品属性值表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsAttrValue> batchParam) {
|
||||
if (batchParam.update(goodsAttrValueService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品属性值表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsAttrValueService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.GoodsCommentService;
|
||||
import com.gxwebsoft.shop.entity.GoodsComment;
|
||||
import com.gxwebsoft.shop.param.GoodsCommentParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.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-03-30 19:09:56
|
||||
*/
|
||||
@Api(tags = "评论表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-comment")
|
||||
public class GoodsCommentController extends BaseController {
|
||||
@Resource
|
||||
private GoodsCommentService goodsCommentService;
|
||||
|
||||
@ApiOperation("分页查询评论表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsComment>> page(GoodsCommentParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsCommentService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部评论表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsComment>> list(GoodsCommentParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsCommentService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询评论表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsComment> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsCommentService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加评论表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsComment goodsComment) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// goodsComment.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (goodsCommentService.save(goodsComment)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改评论表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsComment goodsComment) {
|
||||
if (goodsCommentService.updateById(goodsComment)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除评论表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsCommentService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加评论表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsComment> list) {
|
||||
if (goodsCommentService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改评论表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsComment> batchParam) {
|
||||
if (batchParam.update(goodsCommentService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除评论表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsCommentService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.entity.GoodsSku;
|
||||
import com.gxwebsoft.shop.entity.GoodsSpec;
|
||||
import com.gxwebsoft.shop.entity.SpecValue;
|
||||
import com.gxwebsoft.shop.service.GoodsService;
|
||||
import com.gxwebsoft.shop.entity.Goods;
|
||||
import com.gxwebsoft.shop.param.GoodsParam;
|
||||
@@ -10,13 +15,18 @@ import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.shop.service.GoodsSkuService;
|
||||
import com.gxwebsoft.shop.service.GoodsSpecService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.tomcat.util.buf.StringUtils;
|
||||
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.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 商品记录表控制器
|
||||
@@ -28,87 +38,117 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods")
|
||||
public class GoodsController extends BaseController {
|
||||
@Resource
|
||||
private GoodsService goodsService;
|
||||
@Resource
|
||||
private GoodsService goodsService;
|
||||
@Resource
|
||||
private GoodsSpecService goodsSpecService;
|
||||
@Resource
|
||||
private GoodsSkuService goodsSkuService;
|
||||
|
||||
@ApiOperation("分页查询商品记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Goods>> page(GoodsParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsService.pageRel(param));
|
||||
}
|
||||
@ApiOperation("分页查询商品记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Goods>> page(GoodsParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Goods>> list(GoodsParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsService.listRel(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) {
|
||||
// 使用关联查询
|
||||
return success(goodsService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Goods goods) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
goods.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (goodsService.save(goods)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@ApiOperation("根据id查询商品记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Goods> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Goods goods) {
|
||||
if (goodsService.updateById(goods)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
@ApiOperation("添加商品记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Goods goods) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
goods.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (goodsService.save(goods)) {
|
||||
|
||||
@ApiOperation("删除商品记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
// 保存商品规格
|
||||
final List<GoodsSpec> goodsSpecs = goods.getGoodsSpecs();
|
||||
goodsSpecs.forEach(d -> {
|
||||
d.setGoodsId(goods.getGoodsId());
|
||||
final List<String> collect = d.getValueList().stream().map(SpecValue::getSpecValue).collect(Collectors.toList());
|
||||
d.setSpecValues(StringUtils.join(collect, ','));
|
||||
});
|
||||
goodsSpecService.saveBatch(goodsSpecs);
|
||||
|
||||
@ApiOperation("批量添加商品记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Goods> list) {
|
||||
if (goodsService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
// 保存商品sku表
|
||||
final List<GoodsSku> goodsSkus = goods.getGoodsSkus();
|
||||
goodsSkus.forEach(d -> {
|
||||
d.setGoodsId(goods.getGoodsId());
|
||||
});
|
||||
goodsSkuService.saveBatch(goodsSkus);
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Goods> batchParam) {
|
||||
if (batchParam.update(goodsService, "goods_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
@ApiOperation("修改商品记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Goods goods) {
|
||||
if (goodsService.updateById(goods)) {
|
||||
// 更新spec规格表
|
||||
if (goodsSpecService.remove(new LambdaQueryWrapper<GoodsSpec>().eq(GoodsSpec::getGoodsId, goods.getGoodsId()))) {
|
||||
goodsSpecService.saveBatch(goods.getGoodsSpecs());
|
||||
}
|
||||
// 更新sku表
|
||||
if (goodsSkuService.remove(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, goods.getGoodsId()))) {
|
||||
goodsSkuService.saveBatch(goods.getGoodsSkus());
|
||||
}
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
@ApiOperation("删除商品记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Goods> list) {
|
||||
if (goodsService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Goods> batchParam) {
|
||||
if (batchParam.update(goodsService, "goods_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.GoodsCouponService;
|
||||
import com.gxwebsoft.shop.entity.GoodsCoupon;
|
||||
import com.gxwebsoft.shop.param.GoodsCouponParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.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-03-30 19:09:56
|
||||
*/
|
||||
@Api(tags = "商品优惠券表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-coupon")
|
||||
public class GoodsCouponController extends BaseController {
|
||||
@Resource
|
||||
private GoodsCouponService goodsCouponService;
|
||||
|
||||
@ApiOperation("分页查询商品优惠券表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsCoupon>> page(GoodsCouponParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsCouponService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品优惠券表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsCoupon>> list(GoodsCouponParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsCouponService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品优惠券表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsCoupon> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsCouponService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品优惠券表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsCoupon goodsCoupon) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// goodsCoupon.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (goodsCouponService.save(goodsCoupon)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品优惠券表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsCoupon goodsCoupon) {
|
||||
if (goodsCouponService.updateById(goodsCoupon)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品优惠券表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsCouponService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品优惠券表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsCoupon> list) {
|
||||
if (goodsCouponService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品优惠券表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsCoupon> batchParam) {
|
||||
if (batchParam.update(goodsCouponService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品优惠券表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsCouponService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.GoodsDescriptionService;
|
||||
import com.gxwebsoft.shop.entity.GoodsDescription;
|
||||
import com.gxwebsoft.shop.param.GoodsDescriptionParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.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-03-30 19:09:56
|
||||
*/
|
||||
@Api(tags = "商品描述表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-description")
|
||||
public class GoodsDescriptionController extends BaseController {
|
||||
@Resource
|
||||
private GoodsDescriptionService goodsDescriptionService;
|
||||
|
||||
@ApiOperation("分页查询商品描述表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsDescription>> page(GoodsDescriptionParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsDescriptionService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品描述表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsDescription>> list(GoodsDescriptionParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsDescriptionService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品描述表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsDescription> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsDescriptionService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品描述表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsDescription goodsDescription) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// goodsDescription.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (goodsDescriptionService.save(goodsDescription)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品描述表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsDescription goodsDescription) {
|
||||
if (goodsDescriptionService.updateById(goodsDescription)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品描述表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsDescriptionService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品描述表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsDescription> list) {
|
||||
if (goodsDescriptionService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品描述表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsDescription> batchParam) {
|
||||
if (batchParam.update(goodsDescriptionService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品描述表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsDescriptionService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.GoodsRelationService;
|
||||
import com.gxwebsoft.shop.entity.GoodsRelation;
|
||||
import com.gxwebsoft.shop.param.GoodsRelationParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.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-03-30 19:09:56
|
||||
*/
|
||||
@Api(tags = "商品点赞和收藏表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-relation")
|
||||
public class GoodsRelationController extends BaseController {
|
||||
@Resource
|
||||
private GoodsRelationService goodsRelationService;
|
||||
|
||||
@ApiOperation("分页查询商品点赞和收藏表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsRelation>> page(GoodsRelationParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsRelationService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品点赞和收藏表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsRelation>> list(GoodsRelationParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsRelationService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品点赞和收藏表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsRelation> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsRelationService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品点赞和收藏表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsRelation goodsRelation) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// goodsRelation.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (goodsRelationService.save(goodsRelation)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品点赞和收藏表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsRelation goodsRelation) {
|
||||
if (goodsRelationService.updateById(goodsRelation)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品点赞和收藏表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsRelationService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品点赞和收藏表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsRelation> list) {
|
||||
if (goodsRelationService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品点赞和收藏表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsRelation> batchParam) {
|
||||
if (batchParam.update(goodsRelationService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品点赞和收藏表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsRelationService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.GoodsRuleService;
|
||||
import com.gxwebsoft.shop.entity.GoodsRule;
|
||||
import com.gxwebsoft.shop.param.GoodsRuleParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.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-03-30 19:09:56
|
||||
*/
|
||||
@Api(tags = "商品规则值(规格)表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-rule")
|
||||
public class GoodsRuleController extends BaseController {
|
||||
@Resource
|
||||
private GoodsRuleService goodsRuleService;
|
||||
|
||||
@ApiOperation("分页查询商品规则值(规格)表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsRule>> page(GoodsRuleParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsRuleService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品规则值(规格)表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsRule>> list(GoodsRuleParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsRuleService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品规则值(规格)表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsRule> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsRuleService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品规则值(规格)表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsRule goodsRule) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// goodsRule.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (goodsRuleService.save(goodsRule)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品规则值(规格)表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsRule goodsRule) {
|
||||
if (goodsRuleService.updateById(goodsRule)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品规则值(规格)表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsRuleService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品规则值(规格)表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsRule> list) {
|
||||
if (goodsRuleService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品规则值(规格)表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsRule> batchParam) {
|
||||
if (batchParam.update(goodsRuleService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品规则值(规格)表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsRuleService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
+35
-35
@@ -1,9 +1,9 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.GoodsLogService;
|
||||
import com.gxwebsoft.shop.entity.GoodsLog;
|
||||
import com.gxwebsoft.shop.param.GoodsLogParam;
|
||||
import com.gxwebsoft.shop.service.GoodsSkuService;
|
||||
import com.gxwebsoft.shop.entity.GoodsSku;
|
||||
import com.gxwebsoft.shop.param.GoodsSkuParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
@@ -19,93 +19,93 @@ import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品日志表控制器
|
||||
* 商品sku列表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
@Api(tags = "商品日志表管理")
|
||||
@Api(tags = "商品sku列表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-log")
|
||||
public class GoodsLogController extends BaseController {
|
||||
@RequestMapping("/api/shop/goods-sku")
|
||||
public class GoodsSkuController extends BaseController {
|
||||
@Resource
|
||||
private GoodsLogService goodsLogService;
|
||||
private GoodsSkuService goodsSkuService;
|
||||
|
||||
@ApiOperation("分页查询商品日志表")
|
||||
@ApiOperation("分页查询商品sku列表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsLog>> page(GoodsLogParam param) {
|
||||
public ApiResult<PageResult<GoodsSku>> page(GoodsSkuParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsLogService.pageRel(param));
|
||||
return success(goodsSkuService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品日志表")
|
||||
@ApiOperation("查询全部商品sku列表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsLog>> list(GoodsLogParam param) {
|
||||
public ApiResult<List<GoodsSku>> list(GoodsSkuParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsLogService.listRel(param));
|
||||
return success(goodsSkuService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品日志表")
|
||||
@ApiOperation("根据id查询商品sku列表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsLog> get(@PathVariable("id") Integer id) {
|
||||
public ApiResult<GoodsSku> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsLogService.getByIdRel(id));
|
||||
return success(goodsSkuService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品日志表")
|
||||
@ApiOperation("添加商品sku列表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsLog goodsLog) {
|
||||
public ApiResult<?> save(@RequestBody GoodsSku goodsSku) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// goodsLog.setUserId(loginUser.getUserId());
|
||||
// goodsSku.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (goodsLogService.save(goodsLog)) {
|
||||
if (goodsSkuService.save(goodsSku)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品日志表")
|
||||
@ApiOperation("修改商品sku列表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsLog goodsLog) {
|
||||
if (goodsLogService.updateById(goodsLog)) {
|
||||
public ApiResult<?> update(@RequestBody GoodsSku goodsSku) {
|
||||
if (goodsSkuService.updateById(goodsSku)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品日志表")
|
||||
@ApiOperation("删除商品sku列表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsLogService.removeById(id)) {
|
||||
if (goodsSkuService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品日志表")
|
||||
@ApiOperation("批量添加商品sku列表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsLog> list) {
|
||||
if (goodsLogService.saveBatch(list)) {
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsSku> list) {
|
||||
if (goodsSkuService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品日志表")
|
||||
@ApiOperation("批量修改商品sku列表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsLog> batchParam) {
|
||||
if (batchParam.update(goodsLogService, "id")) {
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsSku> batchParam) {
|
||||
if (batchParam.update(goodsSkuService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品日志表")
|
||||
@ApiOperation("批量删除商品sku列表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsLogService.removeByIds(ids)) {
|
||||
if (goodsSkuService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
+35
-35
@@ -1,9 +1,9 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.GoodsAttrService;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttr;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrParam;
|
||||
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.PageParam;
|
||||
@@ -19,93 +19,93 @@ import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性表控制器
|
||||
* 商品多规格控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
@Api(tags = "商品属性表管理")
|
||||
@Api(tags = "商品多规格管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/goods-attr")
|
||||
public class GoodsAttrController extends BaseController {
|
||||
@RequestMapping("/api/shop/goods-spec")
|
||||
public class GoodsSpecController extends BaseController {
|
||||
@Resource
|
||||
private GoodsAttrService goodsAttrService;
|
||||
private GoodsSpecService goodsSpecService;
|
||||
|
||||
@ApiOperation("分页查询商品属性表")
|
||||
@ApiOperation("分页查询商品多规格")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<GoodsAttr>> page(GoodsAttrParam param) {
|
||||
public ApiResult<PageResult<GoodsSpec>> page(GoodsSpecParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsAttrService.pageRel(param));
|
||||
return success(goodsSpecService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商品属性表")
|
||||
@ApiOperation("查询全部商品多规格")
|
||||
@GetMapping()
|
||||
public ApiResult<List<GoodsAttr>> list(GoodsAttrParam param) {
|
||||
public ApiResult<List<GoodsSpec>> list(GoodsSpecParam param) {
|
||||
// 使用关联查询
|
||||
return success(goodsAttrService.listRel(param));
|
||||
return success(goodsSpecService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品属性表")
|
||||
@ApiOperation("根据id查询商品多规格")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<GoodsAttr> get(@PathVariable("id") Integer id) {
|
||||
public ApiResult<GoodsSpec> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(goodsAttrService.getByIdRel(id));
|
||||
return success(goodsSpecService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品属性表")
|
||||
@ApiOperation("添加商品多规格")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody GoodsAttr goodsAttr) {
|
||||
public ApiResult<?> save(@RequestBody GoodsSpec goodsSpec) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// goodsAttr.setUserId(loginUser.getUserId());
|
||||
// goodsSpec.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (goodsAttrService.save(goodsAttr)) {
|
||||
if (goodsSpecService.save(goodsSpec)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品属性表")
|
||||
@ApiOperation("修改商品多规格")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody GoodsAttr goodsAttr) {
|
||||
if (goodsAttrService.updateById(goodsAttr)) {
|
||||
public ApiResult<?> update(@RequestBody GoodsSpec goodsSpec) {
|
||||
if (goodsSpecService.updateById(goodsSpec)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品属性表")
|
||||
@ApiOperation("删除商品多规格")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (goodsAttrService.removeById(id)) {
|
||||
if (goodsSpecService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品属性表")
|
||||
@ApiOperation("批量添加商品多规格")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsAttr> list) {
|
||||
if (goodsAttrService.saveBatch(list)) {
|
||||
public ApiResult<?> saveBatch(@RequestBody List<GoodsSpec> list) {
|
||||
if (goodsSpecService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品属性表")
|
||||
@ApiOperation("批量修改商品多规格")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsAttr> batchParam) {
|
||||
if (batchParam.update(goodsAttrService, "id")) {
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsSpec> batchParam) {
|
||||
if (batchParam.update(goodsSpecService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商品属性表")
|
||||
@ApiOperation("批量删除商品多规格")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (goodsAttrService.removeByIds(ids)) {
|
||||
if (goodsSpecService.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.Spec;
|
||||
import com.gxwebsoft.shop.param.SpecParam;
|
||||
import com.gxwebsoft.shop.service.SpecService;
|
||||
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:29:43
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商品规格")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Spec> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(specService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商品规格")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Spec spec) {
|
||||
if (specService.count(new LambdaQueryWrapper<Spec>().eq(Spec::getSpecName,spec.getSpecName())) > 0) {
|
||||
return fail("规格名称已存在");
|
||||
}
|
||||
if (specService.save(spec)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品规格")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Spec spec) {
|
||||
if (specService.updateById(spec)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品规格")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (specService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商品规格")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Spec> list) {
|
||||
if (specService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商品规格")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Spec> batchParam) {
|
||||
if (batchParam.update(specService, "spec_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
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 com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -91,9 +93,17 @@ public class Goods implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "商品规格")
|
||||
@TableField(exist = false)
|
||||
private List<GoodsSpec> goodsSpecs;
|
||||
|
||||
@ApiModelProperty(value = "商品sku列表")
|
||||
@TableField(exist = false)
|
||||
private List<GoodsSku> goodsSkus;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
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-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsAttrResult对象", description = "商品属性详情表")
|
||||
@TableName("shop_goods_attr_result")
|
||||
public class GoodsAttrResult 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 = "商品属性参数")
|
||||
private String result;
|
||||
|
||||
@ApiModelProperty(value = "活动类型 0=商品,1=秒杀,2=砍价,3=拼团")
|
||||
private Boolean type;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品属性值表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsAttrValue对象", description = "商品属性值表")
|
||||
@TableName("shop_goods_attr_value")
|
||||
public class GoodsAttrValue 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 = "商品属性索引值 (attr_value|attr_value[|....])")
|
||||
private String suk;
|
||||
|
||||
@ApiModelProperty(value = "属性对应的库存")
|
||||
private Integer stock;
|
||||
|
||||
@ApiModelProperty(value = "销量")
|
||||
private Integer sales;
|
||||
|
||||
@ApiModelProperty(value = "属性金额")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "图片")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "唯一值")
|
||||
private String unique;
|
||||
|
||||
@ApiModelProperty(value = "成本价")
|
||||
private BigDecimal cost;
|
||||
|
||||
@ApiModelProperty(value = "商品条码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty(value = "原价")
|
||||
private BigDecimal otPrice;
|
||||
|
||||
@ApiModelProperty(value = "重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
@ApiModelProperty(value = "体积")
|
||||
private BigDecimal volume;
|
||||
|
||||
@ApiModelProperty(value = "一级返佣")
|
||||
private BigDecimal brokerage;
|
||||
|
||||
@ApiModelProperty(value = "二级返佣")
|
||||
private BigDecimal brokerageTwo;
|
||||
|
||||
@ApiModelProperty(value = "活动类型 0=商品,1=秒杀,2=砍价,3=拼团")
|
||||
private Boolean type;
|
||||
|
||||
@ApiModelProperty(value = "活动限购数量")
|
||||
private Integer quota;
|
||||
|
||||
@ApiModelProperty(value = "活动限购数量显示")
|
||||
private Integer quotaShow;
|
||||
|
||||
@ApiModelProperty(value = "attr_values 创建更新时的属性对应")
|
||||
private String attrValue;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -6,6 +6,8 @@ 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;
|
||||
@@ -84,9 +86,9 @@ public class GoodsCategory implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private LocalDateTime createTime;
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
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-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsComment对象", description = "评论表")
|
||||
@TableName("shop_goods_comment")
|
||||
public class GoodsComment 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 uid;
|
||||
|
||||
@ApiModelProperty(value = "订单ID")
|
||||
private Integer oid;
|
||||
|
||||
@ApiModelProperty(value = "商品唯一id")
|
||||
private String unique;
|
||||
|
||||
@ApiModelProperty(value = "商品id")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "某种商品类型(普通商品、秒杀商品)")
|
||||
private String replyType;
|
||||
|
||||
@ApiModelProperty(value = "商品分数")
|
||||
private Boolean goodsScore;
|
||||
|
||||
@ApiModelProperty(value = "服务分数")
|
||||
private Boolean serviceScore;
|
||||
|
||||
@ApiModelProperty(value = "评论内容")
|
||||
private String comment;
|
||||
|
||||
@ApiModelProperty(value = "评论图片")
|
||||
private String pics;
|
||||
|
||||
@ApiModelProperty(value = "管理员回复内容")
|
||||
private String merchantReplyContent;
|
||||
|
||||
@ApiModelProperty(value = "管理员回复时间")
|
||||
private Integer merchantReplyTime;
|
||||
|
||||
@ApiModelProperty(value = "0未删除1已删除")
|
||||
private Boolean isDel;
|
||||
|
||||
@ApiModelProperty(value = "0未回复1已回复")
|
||||
private Boolean isReply;
|
||||
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
private String avatar;
|
||||
|
||||
@ApiModelProperty(value = "商品规格属性值,多个,号隔开")
|
||||
private String sku;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
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-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsCoupon对象", description = "商品优惠券表")
|
||||
@TableName("shop_goods_coupon")
|
||||
public class GoodsCoupon implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商品id")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "优惠劵id")
|
||||
private Integer issueCouponId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
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-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsDescription对象", description = "商品描述表")
|
||||
@TableName("shop_goods_description")
|
||||
public class GoodsDescription implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "商品详情")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "商品类型")
|
||||
private Boolean type;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
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-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsLog对象", description = "商品日志表")
|
||||
@TableName("shop_goods_log")
|
||||
public class GoodsLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "统计ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "类型visit,cart,order,pay,collect,refund")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "是否浏览")
|
||||
private Boolean visitNum;
|
||||
|
||||
@ApiModelProperty(value = "加入购物车数量")
|
||||
private Integer cartNum;
|
||||
|
||||
@ApiModelProperty(value = "下单数量")
|
||||
private Integer orderNum;
|
||||
|
||||
@ApiModelProperty(value = "支付数量")
|
||||
private Integer payNum;
|
||||
|
||||
@ApiModelProperty(value = "支付金额")
|
||||
private BigDecimal payPrice;
|
||||
|
||||
@ApiModelProperty(value = "商品成本价")
|
||||
private BigDecimal costPrice;
|
||||
|
||||
@ApiModelProperty(value = "支付用户ID")
|
||||
private Integer payUid;
|
||||
|
||||
@ApiModelProperty(value = "退款数量")
|
||||
private Integer refundNum;
|
||||
|
||||
@ApiModelProperty(value = "退款金额")
|
||||
private BigDecimal refundPrice;
|
||||
|
||||
@ApiModelProperty(value = "收藏")
|
||||
private Boolean collectNum;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
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-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsRelation对象", description = "商品点赞和收藏表")
|
||||
@TableName("shop_goods_relation")
|
||||
public class GoodsRelation 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 goodsId;
|
||||
|
||||
@ApiModelProperty(value = "类型(收藏(collect)、点赞(like))")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "某种类型的商品(普通商品、秒杀商品)")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 商品sku列表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
@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 = "规格组ID")
|
||||
private Integer specId;
|
||||
|
||||
@ApiModelProperty(value = "规格值ID")
|
||||
private Integer specValueId;
|
||||
|
||||
@ApiModelProperty(value = "规格值0")
|
||||
private String specValue0;
|
||||
|
||||
@ApiModelProperty(value = "规格值1")
|
||||
private String specValue1;
|
||||
|
||||
@ApiModelProperty(value = "规格值2")
|
||||
private String specValue2;
|
||||
|
||||
@ApiModelProperty(value = "商品图片")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "商品价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "市场价格")
|
||||
private BigDecimal salePrice;
|
||||
|
||||
@ApiModelProperty(value = "库存")
|
||||
private Integer stock;
|
||||
|
||||
@ApiModelProperty(value = "sku编码")
|
||||
private String skuNo;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1异常")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
+22
-14
@@ -1,26 +1,28 @@
|
||||
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 com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
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-03-30 19:09:56
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsAttr对象", description = "商品属性表")
|
||||
@TableName("shop_goods_attr")
|
||||
public class GoodsAttr implements Serializable {
|
||||
@ApiModel(value = "GoodsSpec对象", description = "商品多规格")
|
||||
@TableName("shop_goods_spec")
|
||||
public class GoodsSpec implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@@ -30,19 +32,25 @@ public class GoodsAttr implements Serializable {
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "属性名")
|
||||
private String attrName;
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
private Integer specId;
|
||||
|
||||
@ApiModelProperty(value = "属性值")
|
||||
private String attrValues;
|
||||
@ApiModelProperty(value = "规格名称")
|
||||
private String specName;
|
||||
|
||||
@ApiModelProperty(value = "规则值ID")
|
||||
private Integer specValueId;
|
||||
|
||||
@ApiModelProperty(value = "规格值")
|
||||
private String specValues;
|
||||
|
||||
@ApiModelProperty(value = "规格值")
|
||||
@TableField(exist = false)
|
||||
private List<SpecValue> valueList;
|
||||
|
||||
@ApiModelProperty(value = "活动类型 0=商品,1=秒杀,2=砍价,3=拼团")
|
||||
private Boolean type;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品规格组记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-01 09:29:43
|
||||
*/
|
||||
@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 comments;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1禁用")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "规则值列表")
|
||||
@TableField(exist = false)
|
||||
private List<SpecValue> specValues;
|
||||
|
||||
}
|
||||
+18
-11
@@ -3,33 +3,40 @@ 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-03-30 19:09:56
|
||||
* @since 2024-04-01 09:49:15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "GoodsRule对象", description = "商品规则值(规格)表")
|
||||
@TableName("shop_goods_rule")
|
||||
public class GoodsRule implements Serializable {
|
||||
@ApiModel(value = "SpecValue对象", description = "规格值")
|
||||
@TableName("shop_spec_value")
|
||||
public class SpecValue implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "规格名称")
|
||||
private String ruleName;
|
||||
@ApiModelProperty(value = "规格值ID")
|
||||
@TableId(value = "spec_value_id", type = IdType.AUTO)
|
||||
private Integer specValueId;
|
||||
|
||||
@ApiModelProperty(value = "规格值")
|
||||
private String ruleValue;
|
||||
private String specValue;
|
||||
|
||||
@ApiModelProperty(value = "规格组ID")
|
||||
private Integer specId;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttrResult;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrResultParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性详情表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsAttrResultMapper extends BaseMapper<GoodsAttrResult> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsAttrResult>
|
||||
*/
|
||||
List<GoodsAttrResult> selectPageRel(@Param("page") IPage<GoodsAttrResult> page,
|
||||
@Param("param") GoodsAttrResultParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsAttrResult> selectListRel(@Param("param") GoodsAttrResultParam param);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttrValue;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrValueParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性值表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsAttrValueMapper extends BaseMapper<GoodsAttrValue> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsAttrValue>
|
||||
*/
|
||||
List<GoodsAttrValue> selectPageRel(@Param("page") IPage<GoodsAttrValue> page,
|
||||
@Param("param") GoodsAttrValueParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsAttrValue> selectListRel(@Param("param") GoodsAttrValueParam param);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.GoodsComment;
|
||||
import com.gxwebsoft.shop.param.GoodsCommentParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 评论表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsCommentMapper extends BaseMapper<GoodsComment> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsComment>
|
||||
*/
|
||||
List<GoodsComment> selectPageRel(@Param("page") IPage<GoodsComment> page,
|
||||
@Param("param") GoodsCommentParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsComment> selectListRel(@Param("param") GoodsCommentParam param);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.GoodsCoupon;
|
||||
import com.gxwebsoft.shop.param.GoodsCouponParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品优惠券表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsCouponMapper extends BaseMapper<GoodsCoupon> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsCoupon>
|
||||
*/
|
||||
List<GoodsCoupon> selectPageRel(@Param("page") IPage<GoodsCoupon> page,
|
||||
@Param("param") GoodsCouponParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsCoupon> selectListRel(@Param("param") GoodsCouponParam param);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.GoodsDescription;
|
||||
import com.gxwebsoft.shop.param.GoodsDescriptionParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品描述表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsDescriptionMapper extends BaseMapper<GoodsDescription> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsDescription>
|
||||
*/
|
||||
List<GoodsDescription> selectPageRel(@Param("page") IPage<GoodsDescription> page,
|
||||
@Param("param") GoodsDescriptionParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsDescription> selectListRel(@Param("param") GoodsDescriptionParam param);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.GoodsRelation;
|
||||
import com.gxwebsoft.shop.param.GoodsRelationParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品点赞和收藏表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsRelationMapper extends BaseMapper<GoodsRelation> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsRelation>
|
||||
*/
|
||||
List<GoodsRelation> selectPageRel(@Param("page") IPage<GoodsRelation> page,
|
||||
@Param("param") GoodsRelationParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsRelation> selectListRel(@Param("param") GoodsRelationParam param);
|
||||
|
||||
}
|
||||
+9
-9
@@ -2,29 +2,29 @@ package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.GoodsLog;
|
||||
import com.gxwebsoft.shop.param.GoodsLogParam;
|
||||
import com.gxwebsoft.shop.entity.GoodsSku;
|
||||
import com.gxwebsoft.shop.param.GoodsSkuParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品日志表Mapper
|
||||
* 商品sku列表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
public interface GoodsLogMapper extends BaseMapper<GoodsLog> {
|
||||
public interface GoodsSkuMapper extends BaseMapper<GoodsSku> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsLog>
|
||||
* @return List<GoodsSku>
|
||||
*/
|
||||
List<GoodsLog> selectPageRel(@Param("page") IPage<GoodsLog> page,
|
||||
@Param("param") GoodsLogParam param);
|
||||
List<GoodsSku> selectPageRel(@Param("page") IPage<GoodsSku> page,
|
||||
@Param("param") GoodsSkuParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
@@ -32,6 +32,6 @@ public interface GoodsLogMapper extends BaseMapper<GoodsLog> {
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsLog> selectListRel(@Param("param") GoodsLogParam param);
|
||||
List<GoodsSku> selectListRel(@Param("param") GoodsSkuParam param);
|
||||
|
||||
}
|
||||
+9
-9
@@ -2,29 +2,29 @@ package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.GoodsRule;
|
||||
import com.gxwebsoft.shop.param.GoodsRuleParam;
|
||||
import com.gxwebsoft.shop.entity.Spec;
|
||||
import com.gxwebsoft.shop.param.SpecParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品规则值(规格)表Mapper
|
||||
* 商品规格组记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
* @since 2024-04-01 09:29:43
|
||||
*/
|
||||
public interface GoodsRuleMapper extends BaseMapper<GoodsRule> {
|
||||
public interface SpecMapper extends BaseMapper<Spec> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsRule>
|
||||
* @return List<Spec>
|
||||
*/
|
||||
List<GoodsRule> selectPageRel(@Param("page") IPage<GoodsRule> page,
|
||||
@Param("param") GoodsRuleParam param);
|
||||
List<Spec> selectPageRel(@Param("page") IPage<Spec> page,
|
||||
@Param("param") SpecParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
@@ -32,6 +32,6 @@ public interface GoodsRuleMapper extends BaseMapper<GoodsRule> {
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsRule> selectListRel(@Param("param") GoodsRuleParam param);
|
||||
List<Spec> selectListRel(@Param("param") SpecParam param);
|
||||
|
||||
}
|
||||
+9
-9
@@ -2,29 +2,29 @@ package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttr;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrParam;
|
||||
import com.gxwebsoft.shop.entity.SpecValue;
|
||||
import com.gxwebsoft.shop.param.SpecValueParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性表Mapper
|
||||
* 规格值Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
* @since 2024-04-01 09:49:15
|
||||
*/
|
||||
public interface GoodsAttrMapper extends BaseMapper<GoodsAttr> {
|
||||
public interface SpecValueMapper extends BaseMapper<SpecValue> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsAttr>
|
||||
* @return List<SpecValue>
|
||||
*/
|
||||
List<GoodsAttr> selectPageRel(@Param("page") IPage<GoodsAttr> page,
|
||||
@Param("param") GoodsAttrParam param);
|
||||
List<SpecValue> selectPageRel(@Param("page") IPage<SpecValue> page,
|
||||
@Param("param") SpecValueParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
@@ -32,6 +32,6 @@ public interface GoodsAttrMapper extends BaseMapper<GoodsAttr> {
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<GoodsAttr> selectListRel(@Param("param") GoodsAttrParam param);
|
||||
List<SpecValue> selectListRel(@Param("param") SpecValueParam param);
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.GoodsAttrMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_goods_attr a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.goodsId != null">
|
||||
AND a.goods_id = #{param.goodsId}
|
||||
</if>
|
||||
<if test="param.attrName != null">
|
||||
AND a.attr_name LIKE CONCAT('%', #{param.attrName}, '%')
|
||||
</if>
|
||||
<if test="param.attrValues != null">
|
||||
AND a.attr_values LIKE CONCAT('%', #{param.attrValues}, '%')
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsAttr">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsAttr">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,96 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.GoodsAttrValueMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_goods_attr_value a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.goodsId != null">
|
||||
AND a.goods_id = #{param.goodsId}
|
||||
</if>
|
||||
<if test="param.suk != null">
|
||||
AND a.suk LIKE CONCAT('%', #{param.suk}, '%')
|
||||
</if>
|
||||
<if test="param.stock != null">
|
||||
AND a.stock = #{param.stock}
|
||||
</if>
|
||||
<if test="param.sales != null">
|
||||
AND a.sales = #{param.sales}
|
||||
</if>
|
||||
<if test="param.price != null">
|
||||
AND a.price = #{param.price}
|
||||
</if>
|
||||
<if test="param.image != null">
|
||||
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||
</if>
|
||||
<if test="param.unique != null">
|
||||
AND a.unique LIKE CONCAT('%', #{param.unique}, '%')
|
||||
</if>
|
||||
<if test="param.cost != null">
|
||||
AND a.cost = #{param.cost}
|
||||
</if>
|
||||
<if test="param.barCode != null">
|
||||
AND a.bar_code LIKE CONCAT('%', #{param.barCode}, '%')
|
||||
</if>
|
||||
<if test="param.otPrice != null">
|
||||
AND a.ot_price = #{param.otPrice}
|
||||
</if>
|
||||
<if test="param.weight != null">
|
||||
AND a.weight = #{param.weight}
|
||||
</if>
|
||||
<if test="param.volume != null">
|
||||
AND a.volume = #{param.volume}
|
||||
</if>
|
||||
<if test="param.brokerage != null">
|
||||
AND a.brokerage = #{param.brokerage}
|
||||
</if>
|
||||
<if test="param.brokerageTwo != null">
|
||||
AND a.brokerage_two = #{param.brokerageTwo}
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.quota != null">
|
||||
AND a.quota = #{param.quota}
|
||||
</if>
|
||||
<if test="param.quotaShow != null">
|
||||
AND a.quota_show = #{param.quotaShow}
|
||||
</if>
|
||||
<if test="param.attrValue != null">
|
||||
AND a.attr_value LIKE CONCAT('%', #{param.attrValue}, '%')
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsAttrValue">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsAttrValue">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,96 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.GoodsCommentMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_goods_comment a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.uid != null">
|
||||
AND a.uid = #{param.uid}
|
||||
</if>
|
||||
<if test="param.oid != null">
|
||||
AND a.oid = #{param.oid}
|
||||
</if>
|
||||
<if test="param.unique != null">
|
||||
AND a.unique LIKE CONCAT('%', #{param.unique}, '%')
|
||||
</if>
|
||||
<if test="param.goodsId != null">
|
||||
AND a.goods_id = #{param.goodsId}
|
||||
</if>
|
||||
<if test="param.replyType != null">
|
||||
AND a.reply_type LIKE CONCAT('%', #{param.replyType}, '%')
|
||||
</if>
|
||||
<if test="param.goodsScore != null">
|
||||
AND a.goods_score = #{param.goodsScore}
|
||||
</if>
|
||||
<if test="param.serviceScore != null">
|
||||
AND a.service_score = #{param.serviceScore}
|
||||
</if>
|
||||
<if test="param.comment != null">
|
||||
AND a.comment LIKE CONCAT('%', #{param.comment}, '%')
|
||||
</if>
|
||||
<if test="param.pics != null">
|
||||
AND a.pics LIKE CONCAT('%', #{param.pics}, '%')
|
||||
</if>
|
||||
<if test="param.merchantReplyContent != null">
|
||||
AND a.merchant_reply_content LIKE CONCAT('%', #{param.merchantReplyContent}, '%')
|
||||
</if>
|
||||
<if test="param.merchantReplyTime != null">
|
||||
AND a.merchant_reply_time = #{param.merchantReplyTime}
|
||||
</if>
|
||||
<if test="param.isDel != null">
|
||||
AND a.is_del = #{param.isDel}
|
||||
</if>
|
||||
<if test="param.isReply != null">
|
||||
AND a.is_reply = #{param.isReply}
|
||||
</if>
|
||||
<if test="param.nickname != null">
|
||||
AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%')
|
||||
</if>
|
||||
<if test="param.avatar != null">
|
||||
AND a.avatar LIKE CONCAT('%', #{param.avatar}, '%')
|
||||
</if>
|
||||
<if test="param.sku != null">
|
||||
AND a.sku LIKE CONCAT('%', #{param.sku}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsComment">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsComment">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.GoodsCouponMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_goods_coupon a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.goodsId != null">
|
||||
AND a.goods_id = #{param.goodsId}
|
||||
</if>
|
||||
<if test="param.issueCouponId != null">
|
||||
AND a.issue_coupon_id = #{param.issueCouponId}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsCoupon">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsCoupon">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.GoodsDescriptionMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_goods_description a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.goodsId != null">
|
||||
AND a.goods_id = #{param.goodsId}
|
||||
</if>
|
||||
<if test="param.description != null">
|
||||
AND a.description LIKE CONCAT('%', #{param.description}, '%')
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsDescription">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsDescription">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
+26
-32
@@ -1,59 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.GoodsLogMapper">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.GoodsSkuMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_goods_log a
|
||||
FROM shop_goods_sku a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type LIKE CONCAT('%', #{param.type}, '%')
|
||||
</if>
|
||||
<if test="param.goodsId != null">
|
||||
AND a.goods_id = #{param.goodsId}
|
||||
</if>
|
||||
<if test="param.visitNum != null">
|
||||
AND a.visit_num = #{param.visitNum}
|
||||
<if test="param.specId != null">
|
||||
AND a.spec_id = #{param.specId}
|
||||
</if>
|
||||
<if test="param.cartNum != null">
|
||||
AND a.cart_num = #{param.cartNum}
|
||||
<if test="param.specValueId != null">
|
||||
AND a.spec_value_id = #{param.specValueId}
|
||||
</if>
|
||||
<if test="param.orderNum != null">
|
||||
AND a.order_num = #{param.orderNum}
|
||||
<if test="param.specValue0 != null">
|
||||
AND a.spec_value_0 LIKE CONCAT('%', #{param.specValue0}, '%')
|
||||
</if>
|
||||
<if test="param.payNum != null">
|
||||
AND a.pay_num = #{param.payNum}
|
||||
<if test="param.specValue1 != null">
|
||||
AND a.spec_value_1 LIKE CONCAT('%', #{param.specValue1}, '%')
|
||||
</if>
|
||||
<if test="param.payPrice != null">
|
||||
AND a.pay_price = #{param.payPrice}
|
||||
<if test="param.specValue2 != null">
|
||||
AND a.spec_value_2 LIKE CONCAT('%', #{param.specValue2}, '%')
|
||||
</if>
|
||||
<if test="param.costPrice != null">
|
||||
AND a.cost_price = #{param.costPrice}
|
||||
<if test="param.image != null">
|
||||
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||
</if>
|
||||
<if test="param.payUid != null">
|
||||
AND a.pay_uid = #{param.payUid}
|
||||
<if test="param.price != null">
|
||||
AND a.price = #{param.price}
|
||||
</if>
|
||||
<if test="param.refundNum != null">
|
||||
AND a.refund_num = #{param.refundNum}
|
||||
<if test="param.salePrice != null">
|
||||
AND a.sale_price = #{param.salePrice}
|
||||
</if>
|
||||
<if test="param.refundPrice != null">
|
||||
AND a.refund_price = #{param.refundPrice}
|
||||
<if test="param.stock != null">
|
||||
AND a.stock = #{param.stock}
|
||||
</if>
|
||||
<if test="param.collectNum != null">
|
||||
AND a.collect_num = #{param.collectNum}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
<if test="param.skuNo != null">
|
||||
AND a.sku_no LIKE CONCAT('%', #{param.skuNo}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
@@ -69,12 +63,12 @@
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsLog">
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsSku">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsLog">
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsSku">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
+12
-6
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.GoodsAttrResultMapper">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.GoodsSpecMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_goods_attr_result a
|
||||
FROM shop_goods_spec a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
@@ -13,8 +13,14 @@
|
||||
<if test="param.goodsId != null">
|
||||
AND a.goods_id = #{param.goodsId}
|
||||
</if>
|
||||
<if test="param.result != null">
|
||||
AND a.result LIKE CONCAT('%', #{param.result}, '%')
|
||||
<if test="param.specId != null">
|
||||
AND a.spec_id = #{param.specId}
|
||||
</if>
|
||||
<if test="param.specName != null">
|
||||
AND a.spec_name LIKE CONCAT('%', #{param.specName}, '%')
|
||||
</if>
|
||||
<if test="param.valueList != null">
|
||||
AND a.value_list LIKE CONCAT('%', #{param.valueList}, '%')
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
@@ -27,12 +33,12 @@
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsAttrResult">
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsSpec">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsAttrResult">
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsSpec">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
+13
-14
@@ -1,35 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.GoodsRuleMapper">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.SpecMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_goods_rule a
|
||||
FROM shop_spec a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
<if test="param.specId != null">
|
||||
AND a.spec_id = #{param.specId}
|
||||
</if>
|
||||
<if test="param.ruleName != null">
|
||||
AND a.rule_name LIKE CONCAT('%', #{param.ruleName}, '%')
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.ruleValue != null">
|
||||
AND a.rule_value LIKE CONCAT('%', #{param.ruleValue}, '%')
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsRule">
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.Spec">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsRule">
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.Spec">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
+10
-16
@@ -1,26 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.GoodsRelationMapper">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.SpecValueMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_goods_relation a
|
||||
FROM shop_spec_value a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
<if test="param.specValueId != null">
|
||||
AND a.spec_value_id = #{param.specValueId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.goodsId != null">
|
||||
AND a.goods_id = #{param.goodsId}
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type LIKE CONCAT('%', #{param.type}, '%')
|
||||
</if>
|
||||
<if test="param.category != null">
|
||||
AND a.category LIKE CONCAT('%', #{param.category}, '%')
|
||||
<if test="param.specId != null">
|
||||
AND a.spec_id = #{param.specId}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
@@ -36,12 +30,12 @@
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsRelation">
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.SpecValue">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsRelation">
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.SpecValue">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品属性详情表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "GoodsAttrResultParam对象", description = "商品属性详情表查询参数")
|
||||
public class GoodsAttrResultParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "商品属性参数")
|
||||
private String result;
|
||||
|
||||
@ApiModelProperty(value = "活动类型 0=商品,1=秒杀,2=砍价,3=拼团")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean type;
|
||||
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品属性值表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "GoodsAttrValueParam对象", description = "商品属性值表查询参数")
|
||||
public class GoodsAttrValueParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "商品属性索引值 (attr_value|attr_value[|....])")
|
||||
private String suk;
|
||||
|
||||
@ApiModelProperty(value = "属性对应的库存")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer stock;
|
||||
|
||||
@ApiModelProperty(value = "销量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sales;
|
||||
|
||||
@ApiModelProperty(value = "属性金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "图片")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "唯一值")
|
||||
private String unique;
|
||||
|
||||
@ApiModelProperty(value = "成本价")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal cost;
|
||||
|
||||
@ApiModelProperty(value = "商品条码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty(value = "原价")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal otPrice;
|
||||
|
||||
@ApiModelProperty(value = "重量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal weight;
|
||||
|
||||
@ApiModelProperty(value = "体积")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal volume;
|
||||
|
||||
@ApiModelProperty(value = "一级返佣")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal brokerage;
|
||||
|
||||
@ApiModelProperty(value = "二级返佣")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal brokerageTwo;
|
||||
|
||||
@ApiModelProperty(value = "活动类型 0=商品,1=秒杀,2=砍价,3=拼团")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean type;
|
||||
|
||||
@ApiModelProperty(value = "活动限购数量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer quota;
|
||||
|
||||
@ApiModelProperty(value = "活动限购数量显示")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer quotaShow;
|
||||
|
||||
@ApiModelProperty(value = "attr_values 创建更新时的属性对应")
|
||||
private String attrValue;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 评论表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "GoodsCommentParam对象", description = "评论表查询参数")
|
||||
public class GoodsCommentParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "评论ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "订单ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer oid;
|
||||
|
||||
@ApiModelProperty(value = "商品唯一id")
|
||||
private String unique;
|
||||
|
||||
@ApiModelProperty(value = "商品id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "某种商品类型(普通商品、秒杀商品)")
|
||||
private String replyType;
|
||||
|
||||
@ApiModelProperty(value = "商品分数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean goodsScore;
|
||||
|
||||
@ApiModelProperty(value = "服务分数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean serviceScore;
|
||||
|
||||
@ApiModelProperty(value = "评论内容")
|
||||
private String comment;
|
||||
|
||||
@ApiModelProperty(value = "评论图片")
|
||||
private String pics;
|
||||
|
||||
@ApiModelProperty(value = "管理员回复内容")
|
||||
private String merchantReplyContent;
|
||||
|
||||
@ApiModelProperty(value = "管理员回复时间")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer merchantReplyTime;
|
||||
|
||||
@ApiModelProperty(value = "0未删除1已删除")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean isDel;
|
||||
|
||||
@ApiModelProperty(value = "0未回复1已回复")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean isReply;
|
||||
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
private String avatar;
|
||||
|
||||
@ApiModelProperty(value = "商品规格属性值,多个,号隔开")
|
||||
private String sku;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品优惠券表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "GoodsCouponParam对象", description = "商品优惠券表查询参数")
|
||||
public class GoodsCouponParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商品id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "优惠劵id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer issueCouponId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品日志表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "GoodsLogParam对象", description = "商品日志表查询参数")
|
||||
public class GoodsLogParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "统计ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "类型visit,cart,order,pay,collect,refund")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "是否浏览")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean visitNum;
|
||||
|
||||
@ApiModelProperty(value = "加入购物车数量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer cartNum;
|
||||
|
||||
@ApiModelProperty(value = "下单数量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer orderNum;
|
||||
|
||||
@ApiModelProperty(value = "支付数量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer payNum;
|
||||
|
||||
@ApiModelProperty(value = "支付金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal payPrice;
|
||||
|
||||
@ApiModelProperty(value = "商品成本价")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal costPrice;
|
||||
|
||||
@ApiModelProperty(value = "支付用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer payUid;
|
||||
|
||||
@ApiModelProperty(value = "退款数量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer refundNum;
|
||||
|
||||
@ApiModelProperty(value = "退款金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal refundPrice;
|
||||
|
||||
@ApiModelProperty(value = "收藏")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean collectNum;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品点赞和收藏表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "GoodsRelationParam对象", description = "商品点赞和收藏表查询参数")
|
||||
public class GoodsRelationParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "类型(收藏(collect)、点赞(like))")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "某种类型的商品(普通商品、秒杀商品)")
|
||||
private String category;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品sku列表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "GoodsSkuParam对象", description = "商品sku列表查询参数")
|
||||
public class GoodsSkuParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "规格组ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer specId;
|
||||
|
||||
@ApiModelProperty(value = "规格值ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer specValueId;
|
||||
|
||||
@ApiModelProperty(value = "规格值0")
|
||||
private String specValue0;
|
||||
|
||||
@ApiModelProperty(value = "规格值1")
|
||||
private String specValue1;
|
||||
|
||||
@ApiModelProperty(value = "规格值2")
|
||||
private String specValue2;
|
||||
|
||||
@ApiModelProperty(value = "商品图片")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "商品价格")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "市场价格")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal salePrice;
|
||||
|
||||
@ApiModelProperty(value = "库存")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer stock;
|
||||
|
||||
@ApiModelProperty(value = "sku编码")
|
||||
private String skuNo;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1异常")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
}
|
||||
+12
-12
@@ -11,16 +11,16 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品属性表查询参数
|
||||
* 商品多规格查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "GoodsAttrParam对象", description = "商品属性表查询参数")
|
||||
public class GoodsAttrParam extends BaseParam {
|
||||
@ApiModel(value = "GoodsSpecParam对象", description = "商品多规格查询参数")
|
||||
public class GoodsSpecParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@@ -31,18 +31,18 @@ public class GoodsAttrParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "属性名")
|
||||
private String attrName;
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer specId;
|
||||
|
||||
@ApiModelProperty(value = "属性值")
|
||||
private String attrValues;
|
||||
@ApiModelProperty(value = "规格名称")
|
||||
private String specName;
|
||||
|
||||
@ApiModelProperty(value = "规格值")
|
||||
private String valueList;
|
||||
|
||||
@ApiModelProperty(value = "活动类型 0=商品,1=秒杀,2=砍价,3=拼团")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean type;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
}
|
||||
+8
-15
@@ -11,30 +11,23 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品描述表查询参数
|
||||
* 商品规格组记录表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
* @since 2024-04-01 09:29:43
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "GoodsDescriptionParam对象", description = "商品描述表查询参数")
|
||||
public class GoodsDescriptionParam extends BaseParam {
|
||||
@ApiModel(value = "SpecParam对象", description = "商品规格组记录表查询参数")
|
||||
public class SpecParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "规格组ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
private Integer specId;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "商品详情")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "商品类型")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean type;
|
||||
@ApiModelProperty(value = "规格组名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
+11
-9
@@ -11,25 +11,27 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商品规则值(规格)表查询参数
|
||||
* 规格值查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
* @since 2024-04-01 09:49:15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "GoodsRuleParam对象", description = "商品规则值(规格)表查询参数")
|
||||
public class GoodsRuleParam extends BaseParam {
|
||||
@ApiModel(value = "SpecValueParam对象", description = "规格值查询参数")
|
||||
public class SpecValueParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "规格值ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "规格名称")
|
||||
private String ruleName;
|
||||
private Integer specValueId;
|
||||
|
||||
@ApiModelProperty(value = "规格值")
|
||||
private String ruleValue;
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "规格组ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer specId;
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttrResult;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrResultParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性详情表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsAttrResultService extends IService<GoodsAttrResult> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<GoodsAttrResult>
|
||||
*/
|
||||
PageResult<GoodsAttrResult> pageRel(GoodsAttrResultParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsAttrResult>
|
||||
*/
|
||||
List<GoodsAttrResult> listRel(GoodsAttrResultParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return GoodsAttrResult
|
||||
*/
|
||||
GoodsAttrResult getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttr;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsAttrService extends IService<GoodsAttr> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<GoodsAttr>
|
||||
*/
|
||||
PageResult<GoodsAttr> pageRel(GoodsAttrParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsAttr>
|
||||
*/
|
||||
List<GoodsAttr> listRel(GoodsAttrParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return GoodsAttr
|
||||
*/
|
||||
GoodsAttr getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttrValue;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrValueParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性值表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsAttrValueService extends IService<GoodsAttrValue> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<GoodsAttrValue>
|
||||
*/
|
||||
PageResult<GoodsAttrValue> pageRel(GoodsAttrValueParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsAttrValue>
|
||||
*/
|
||||
List<GoodsAttrValue> listRel(GoodsAttrValueParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return GoodsAttrValue
|
||||
*/
|
||||
GoodsAttrValue getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.GoodsComment;
|
||||
import com.gxwebsoft.shop.param.GoodsCommentParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 评论表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsCommentService extends IService<GoodsComment> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<GoodsComment>
|
||||
*/
|
||||
PageResult<GoodsComment> pageRel(GoodsCommentParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsComment>
|
||||
*/
|
||||
List<GoodsComment> listRel(GoodsCommentParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 评论ID
|
||||
* @return GoodsComment
|
||||
*/
|
||||
GoodsComment getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.GoodsCoupon;
|
||||
import com.gxwebsoft.shop.param.GoodsCouponParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品优惠券表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsCouponService extends IService<GoodsCoupon> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<GoodsCoupon>
|
||||
*/
|
||||
PageResult<GoodsCoupon> pageRel(GoodsCouponParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsCoupon>
|
||||
*/
|
||||
List<GoodsCoupon> listRel(GoodsCouponParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id
|
||||
* @return GoodsCoupon
|
||||
*/
|
||||
GoodsCoupon getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.GoodsDescription;
|
||||
import com.gxwebsoft.shop.param.GoodsDescriptionParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品描述表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsDescriptionService extends IService<GoodsDescription> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<GoodsDescription>
|
||||
*/
|
||||
PageResult<GoodsDescription> pageRel(GoodsDescriptionParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsDescription>
|
||||
*/
|
||||
List<GoodsDescription> listRel(GoodsDescriptionParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id
|
||||
* @return GoodsDescription
|
||||
*/
|
||||
GoodsDescription getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.GoodsLog;
|
||||
import com.gxwebsoft.shop.param.GoodsLogParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品日志表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsLogService extends IService<GoodsLog> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<GoodsLog>
|
||||
*/
|
||||
PageResult<GoodsLog> pageRel(GoodsLogParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsLog>
|
||||
*/
|
||||
List<GoodsLog> listRel(GoodsLogParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 统计ID
|
||||
* @return GoodsLog
|
||||
*/
|
||||
GoodsLog getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.GoodsRelation;
|
||||
import com.gxwebsoft.shop.param.GoodsRelationParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品点赞和收藏表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsRelationService extends IService<GoodsRelation> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<GoodsRelation>
|
||||
*/
|
||||
PageResult<GoodsRelation> pageRel(GoodsRelationParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsRelation>
|
||||
*/
|
||||
List<GoodsRelation> listRel(GoodsRelationParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id id
|
||||
* @return GoodsRelation
|
||||
*/
|
||||
GoodsRelation getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.GoodsRule;
|
||||
import com.gxwebsoft.shop.param.GoodsRuleParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品规则值(规格)表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
public interface GoodsRuleService extends IService<GoodsRule> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<GoodsRule>
|
||||
*/
|
||||
PageResult<GoodsRule> pageRel(GoodsRuleParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsRule>
|
||||
*/
|
||||
List<GoodsRule> listRel(GoodsRuleParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id
|
||||
* @return GoodsRule
|
||||
*/
|
||||
GoodsRule getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.GoodsSku;
|
||||
import com.gxwebsoft.shop.param.GoodsSkuParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品sku列表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
public interface GoodsSkuService extends IService<GoodsSku> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<GoodsSku>
|
||||
*/
|
||||
PageResult<GoodsSku> pageRel(GoodsSkuParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsSku>
|
||||
*/
|
||||
List<GoodsSku> listRel(GoodsSkuParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return GoodsSku
|
||||
*/
|
||||
GoodsSku getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.GoodsSpec;
|
||||
import com.gxwebsoft.shop.param.GoodsSpecParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品多规格Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
public interface GoodsSpecService extends IService<GoodsSpec> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<GoodsSpec>
|
||||
*/
|
||||
PageResult<GoodsSpec> pageRel(GoodsSpecParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<GoodsSpec>
|
||||
*/
|
||||
List<GoodsSpec> listRel(GoodsSpecParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return GoodsSpec
|
||||
*/
|
||||
GoodsSpec getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.Spec;
|
||||
import com.gxwebsoft.shop.param.SpecParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品规格组记录表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-01 09:29:43
|
||||
*/
|
||||
public interface SpecService extends IService<Spec> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<Spec>
|
||||
*/
|
||||
PageResult<Spec> pageRel(SpecParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<Spec>
|
||||
*/
|
||||
List<Spec> listRel(SpecParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param specId 规格组ID
|
||||
* @return Spec
|
||||
*/
|
||||
Spec getByIdRel(Integer specId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.SpecValue;
|
||||
import com.gxwebsoft.shop.param.SpecValueParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 规格值Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-01 09:49:15
|
||||
*/
|
||||
public interface SpecValueService extends IService<SpecValue> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<SpecValue>
|
||||
*/
|
||||
PageResult<SpecValue> pageRel(SpecValueParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<SpecValue>
|
||||
*/
|
||||
List<SpecValue> listRel(SpecValueParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param specValueId 规格值ID
|
||||
* @return SpecValue
|
||||
*/
|
||||
SpecValue getByIdRel(Integer specValueId);
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.GoodsAttrResultMapper;
|
||||
import com.gxwebsoft.shop.service.GoodsAttrResultService;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttrResult;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrResultParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性详情表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Service
|
||||
public class GoodsAttrResultServiceImpl extends ServiceImpl<GoodsAttrResultMapper, GoodsAttrResult> implements GoodsAttrResultService {
|
||||
|
||||
@Override
|
||||
public PageResult<GoodsAttrResult> pageRel(GoodsAttrResultParam param) {
|
||||
PageParam<GoodsAttrResult, GoodsAttrResultParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<GoodsAttrResult> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GoodsAttrResult> listRel(GoodsAttrResultParam param) {
|
||||
List<GoodsAttrResult> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<GoodsAttrResult, GoodsAttrResultParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsAttrResult getByIdRel(Integer id) {
|
||||
GoodsAttrResultParam param = new GoodsAttrResultParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.GoodsAttrMapper;
|
||||
import com.gxwebsoft.shop.service.GoodsAttrService;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttr;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Service
|
||||
public class GoodsAttrServiceImpl extends ServiceImpl<GoodsAttrMapper, GoodsAttr> implements GoodsAttrService {
|
||||
|
||||
@Override
|
||||
public PageResult<GoodsAttr> pageRel(GoodsAttrParam param) {
|
||||
PageParam<GoodsAttr, GoodsAttrParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<GoodsAttr> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GoodsAttr> listRel(GoodsAttrParam param) {
|
||||
List<GoodsAttr> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<GoodsAttr, GoodsAttrParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsAttr getByIdRel(Integer id) {
|
||||
GoodsAttrParam param = new GoodsAttrParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.GoodsAttrValueMapper;
|
||||
import com.gxwebsoft.shop.service.GoodsAttrValueService;
|
||||
import com.gxwebsoft.shop.entity.GoodsAttrValue;
|
||||
import com.gxwebsoft.shop.param.GoodsAttrValueParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性值表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Service
|
||||
public class GoodsAttrValueServiceImpl extends ServiceImpl<GoodsAttrValueMapper, GoodsAttrValue> implements GoodsAttrValueService {
|
||||
|
||||
@Override
|
||||
public PageResult<GoodsAttrValue> pageRel(GoodsAttrValueParam param) {
|
||||
PageParam<GoodsAttrValue, GoodsAttrValueParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<GoodsAttrValue> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GoodsAttrValue> listRel(GoodsAttrValueParam param) {
|
||||
List<GoodsAttrValue> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<GoodsAttrValue, GoodsAttrValueParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsAttrValue getByIdRel(Integer id) {
|
||||
GoodsAttrValueParam param = new GoodsAttrValueParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.GoodsCommentMapper;
|
||||
import com.gxwebsoft.shop.service.GoodsCommentService;
|
||||
import com.gxwebsoft.shop.entity.GoodsComment;
|
||||
import com.gxwebsoft.shop.param.GoodsCommentParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 评论表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Service
|
||||
public class GoodsCommentServiceImpl extends ServiceImpl<GoodsCommentMapper, GoodsComment> implements GoodsCommentService {
|
||||
|
||||
@Override
|
||||
public PageResult<GoodsComment> pageRel(GoodsCommentParam param) {
|
||||
PageParam<GoodsComment, GoodsCommentParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<GoodsComment> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GoodsComment> listRel(GoodsCommentParam param) {
|
||||
List<GoodsComment> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<GoodsComment, GoodsCommentParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsComment getByIdRel(Integer id) {
|
||||
GoodsCommentParam param = new GoodsCommentParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.GoodsCouponMapper;
|
||||
import com.gxwebsoft.shop.service.GoodsCouponService;
|
||||
import com.gxwebsoft.shop.entity.GoodsCoupon;
|
||||
import com.gxwebsoft.shop.param.GoodsCouponParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品优惠券表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Service
|
||||
public class GoodsCouponServiceImpl extends ServiceImpl<GoodsCouponMapper, GoodsCoupon> implements GoodsCouponService {
|
||||
|
||||
@Override
|
||||
public PageResult<GoodsCoupon> pageRel(GoodsCouponParam param) {
|
||||
PageParam<GoodsCoupon, GoodsCouponParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<GoodsCoupon> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GoodsCoupon> listRel(GoodsCouponParam param) {
|
||||
List<GoodsCoupon> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<GoodsCoupon, GoodsCouponParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsCoupon getByIdRel(Integer id) {
|
||||
GoodsCouponParam param = new GoodsCouponParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.GoodsDescriptionMapper;
|
||||
import com.gxwebsoft.shop.service.GoodsDescriptionService;
|
||||
import com.gxwebsoft.shop.entity.GoodsDescription;
|
||||
import com.gxwebsoft.shop.param.GoodsDescriptionParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品描述表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Service
|
||||
public class GoodsDescriptionServiceImpl extends ServiceImpl<GoodsDescriptionMapper, GoodsDescription> implements GoodsDescriptionService {
|
||||
|
||||
@Override
|
||||
public PageResult<GoodsDescription> pageRel(GoodsDescriptionParam param) {
|
||||
PageParam<GoodsDescription, GoodsDescriptionParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<GoodsDescription> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GoodsDescription> listRel(GoodsDescriptionParam param) {
|
||||
List<GoodsDescription> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<GoodsDescription, GoodsDescriptionParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsDescription getByIdRel(Integer id) {
|
||||
GoodsDescriptionParam param = new GoodsDescriptionParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.GoodsLogMapper;
|
||||
import com.gxwebsoft.shop.service.GoodsLogService;
|
||||
import com.gxwebsoft.shop.entity.GoodsLog;
|
||||
import com.gxwebsoft.shop.param.GoodsLogParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品日志表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Service
|
||||
public class GoodsLogServiceImpl extends ServiceImpl<GoodsLogMapper, GoodsLog> implements GoodsLogService {
|
||||
|
||||
@Override
|
||||
public PageResult<GoodsLog> pageRel(GoodsLogParam param) {
|
||||
PageParam<GoodsLog, GoodsLogParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<GoodsLog> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GoodsLog> listRel(GoodsLogParam param) {
|
||||
List<GoodsLog> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<GoodsLog, GoodsLogParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsLog getByIdRel(Integer id) {
|
||||
GoodsLogParam param = new GoodsLogParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.GoodsRelationMapper;
|
||||
import com.gxwebsoft.shop.service.GoodsRelationService;
|
||||
import com.gxwebsoft.shop.entity.GoodsRelation;
|
||||
import com.gxwebsoft.shop.param.GoodsRelationParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品点赞和收藏表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Service
|
||||
public class GoodsRelationServiceImpl extends ServiceImpl<GoodsRelationMapper, GoodsRelation> implements GoodsRelationService {
|
||||
|
||||
@Override
|
||||
public PageResult<GoodsRelation> pageRel(GoodsRelationParam param) {
|
||||
PageParam<GoodsRelation, GoodsRelationParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<GoodsRelation> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GoodsRelation> listRel(GoodsRelationParam param) {
|
||||
List<GoodsRelation> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<GoodsRelation, GoodsRelationParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsRelation getByIdRel(Integer id) {
|
||||
GoodsRelationParam param = new GoodsRelationParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.GoodsRuleMapper;
|
||||
import com.gxwebsoft.shop.service.GoodsRuleService;
|
||||
import com.gxwebsoft.shop.entity.GoodsRule;
|
||||
import com.gxwebsoft.shop.param.GoodsRuleParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品规则值(规格)表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-03-30 19:09:56
|
||||
*/
|
||||
@Service
|
||||
public class GoodsRuleServiceImpl extends ServiceImpl<GoodsRuleMapper, GoodsRule> implements GoodsRuleService {
|
||||
|
||||
@Override
|
||||
public PageResult<GoodsRule> pageRel(GoodsRuleParam param) {
|
||||
PageParam<GoodsRule, GoodsRuleParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<GoodsRule> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GoodsRule> listRel(GoodsRuleParam param) {
|
||||
List<GoodsRule> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<GoodsRule, GoodsRuleParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsRule getByIdRel(Integer id) {
|
||||
GoodsRuleParam param = new GoodsRuleParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.GoodsSkuMapper;
|
||||
import com.gxwebsoft.shop.service.GoodsSkuService;
|
||||
import com.gxwebsoft.shop.entity.GoodsSku;
|
||||
import com.gxwebsoft.shop.param.GoodsSkuParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品sku列表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
@Service
|
||||
public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> implements GoodsSkuService {
|
||||
|
||||
@Override
|
||||
public PageResult<GoodsSku> pageRel(GoodsSkuParam param) {
|
||||
PageParam<GoodsSku, GoodsSkuParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
List<GoodsSku> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GoodsSku> listRel(GoodsSkuParam param) {
|
||||
List<GoodsSku> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<GoodsSku, GoodsSkuParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsSku getByIdRel(Integer id) {
|
||||
GoodsSkuParam param = new GoodsSkuParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.GoodsSpecMapper;
|
||||
import com.gxwebsoft.shop.service.GoodsSpecService;
|
||||
import com.gxwebsoft.shop.entity.GoodsSpec;
|
||||
import com.gxwebsoft.shop.param.GoodsSpecParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品多规格Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-03 16:06:23
|
||||
*/
|
||||
@Service
|
||||
public class GoodsSpecServiceImpl extends ServiceImpl<GoodsSpecMapper, GoodsSpec> implements GoodsSpecService {
|
||||
|
||||
@Override
|
||||
public PageResult<GoodsSpec> pageRel(GoodsSpecParam param) {
|
||||
PageParam<GoodsSpec, GoodsSpecParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
List<GoodsSpec> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GoodsSpec> listRel(GoodsSpecParam param) {
|
||||
List<GoodsSpec> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<GoodsSpec, GoodsSpecParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsSpec getByIdRel(Integer id) {
|
||||
GoodsSpecParam param = new GoodsSpecParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.entity.SpecValue;
|
||||
import com.gxwebsoft.shop.mapper.SpecMapper;
|
||||
import com.gxwebsoft.shop.param.SpecValueParam;
|
||||
import com.gxwebsoft.shop.service.SpecService;
|
||||
import com.gxwebsoft.shop.entity.Spec;
|
||||
import com.gxwebsoft.shop.param.SpecParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.service.SpecValueService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品规格组记录表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-01 09:29:43
|
||||
*/
|
||||
@Service
|
||||
public class SpecServiceImpl extends ServiceImpl<SpecMapper, Spec> implements SpecService {
|
||||
@Resource
|
||||
private SpecValueService specValueService;
|
||||
|
||||
@Override
|
||||
public PageResult<Spec> pageRel(SpecParam param) {
|
||||
PageParam<Spec, SpecParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc");
|
||||
List<Spec> list = baseMapper.selectPageRel(page, param);
|
||||
list.forEach(item -> {
|
||||
item.setSpecValues(specValueService.list(new LambdaQueryWrapper<SpecValue>().eq(SpecValue::getSpecId,item.getSpecId())));
|
||||
});
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Spec> listRel(SpecParam param) {
|
||||
List<Spec> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<Spec, SpecParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc");
|
||||
list.forEach(item -> {
|
||||
item.setSpecValues(specValueService.list(new LambdaQueryWrapper<SpecValue>().eq(SpecValue::getSpecId,item.getSpecId())));
|
||||
});
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Spec getByIdRel(Integer specId) {
|
||||
SpecParam param = new SpecParam();
|
||||
param.setSpecId(specId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.SpecValueMapper;
|
||||
import com.gxwebsoft.shop.service.SpecValueService;
|
||||
import com.gxwebsoft.shop.entity.SpecValue;
|
||||
import com.gxwebsoft.shop.param.SpecValueParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 规格值Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-01 09:49:15
|
||||
*/
|
||||
@Service
|
||||
public class SpecValueServiceImpl extends ServiceImpl<SpecValueMapper, SpecValue> implements SpecValueService {
|
||||
|
||||
@Override
|
||||
public PageResult<SpecValue> pageRel(SpecValueParam param) {
|
||||
PageParam<SpecValue, SpecValueParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc");
|
||||
List<SpecValue> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SpecValue> listRel(SpecValueParam param) {
|
||||
List<SpecValue> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<SpecValue, SpecValueParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpecValue getByIdRel(Integer specValueId) {
|
||||
SpecValueParam param = new SpecValueParam();
|
||||
param.setSpecValueId(specValueId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -46,10 +46,12 @@ public class ShopGenerator {
|
||||
private static final String MODULE_NAME = "shop";
|
||||
// 需要生成的表
|
||||
private static final String[] TABLE_NAMES = new String[]{
|
||||
"shop_goods",
|
||||
// "shop_goods_attr",
|
||||
// "shop_goods_attr_result",
|
||||
// "shop_goods_attr_value",
|
||||
// "shop_spec",
|
||||
// "shop_spec_value"
|
||||
// "shop_goods",
|
||||
// "shop_goods_spec",
|
||||
"shop_goods_spec_rel",
|
||||
// "shop_goods_sku",
|
||||
// "shop_goods_category",
|
||||
// "shop_goods_coupon",
|
||||
// "shop_goods_description",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑广告' : '添加广告'"
|
||||
:title="isUpdate ? '编辑${table.comment!}' : '添加${table.comment!}'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
@@ -19,101 +19,22 @@
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="广告位类型" name="adType">
|
||||
<a-select
|
||||
ref="select"
|
||||
v-model:value="form.adType"
|
||||
style="width: 120px"
|
||||
>
|
||||
<a-select-option value="图片广告">图片广告</a-select-option>
|
||||
<a-select-option value="幻灯片">幻灯片</a-select-option>
|
||||
<a-select-option value="视频广告">视频广告</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<template v-if="form.adType == '幻灯片'">
|
||||
<a-form-item label="广告图片" name="images" extra="请上传广告图片,最多可上传9张图">
|
||||
<SelectFile
|
||||
:placeholder="`请选择图片`"
|
||||
:limit="9"
|
||||
:data="images"
|
||||
@done="chooseFile"
|
||||
@del="onDeleteItem"
|
||||
/>
|
||||
<!-- <ele-image-upload-->
|
||||
<!-- v-model:value="images"-->
|
||||
<!-- :limit="9"-->
|
||||
<!-- :drag="true"-->
|
||||
<!-- :accept="'image/png,image/jpeg'"-->
|
||||
<!-- :item-style="{ maxWidth: '160px', maxHeight: '160px' }"-->
|
||||
<!-- :upload-handler="uploadHandler"-->
|
||||
<!-- @upload="onUpload"-->
|
||||
<!-- />-->
|
||||
</a-form-item>
|
||||
</template>
|
||||
<template v-if="form.adType == '图片广告'">
|
||||
<a-form-item label="广告图片" name="images" extra="请上传广告图片">
|
||||
<SelectFile
|
||||
:placeholder="`请选择图片`"
|
||||
:limit="1"
|
||||
:data="images"
|
||||
@done="chooseFile"
|
||||
@del="onDeleteItem"
|
||||
/>
|
||||
<!-- <ele-image-upload-->
|
||||
<!-- v-model:value="images"-->
|
||||
<!-- :limit="1"-->
|
||||
<!-- :accept="'image/png,image/jpeg'"-->
|
||||
<!-- :drag="true"-->
|
||||
<!-- :item-style="{ maxWidth: '160px', maxHeight: '160px' }"-->
|
||||
<!-- :upload-handler="uploadHandler"-->
|
||||
<!-- @upload="onUpload"-->
|
||||
<!-- />-->
|
||||
</a-form-item>
|
||||
</template>
|
||||
<template v-if="form.adType == '视频广告'">
|
||||
<a-form-item label="上传视频" name="images" extra="请上传视频文件,仅支持mp4格式,大小200M以内">
|
||||
<SelectFile
|
||||
:placeholder="`请选择视频文件`"
|
||||
:limit="1"
|
||||
:data="images"
|
||||
@done="chooseFile"
|
||||
@del="onDeleteItem"
|
||||
/>
|
||||
<!-- <ele-image-upload-->
|
||||
<!-- v-model:value="images"-->
|
||||
<!-- :limit="1"-->
|
||||
<!-- :accept="'video/mp4'"-->
|
||||
<!-- :drag="true"-->
|
||||
<!-- :item-style="{ maxWidth: '160px', maxHeight: '160px' }"-->
|
||||
<!-- :upload-handler="uploadHandler"-->
|
||||
<!-- @upload="onUpload"-->
|
||||
<!-- />-->
|
||||
</a-form-item>
|
||||
</template>
|
||||
<a-form-item label="广告位名称" name="name">
|
||||
<a-form-item label="${table.comment!}名称" name="${table.entityPath}Name">
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="100"
|
||||
placeholder="请输入广告位名称"
|
||||
v-model:value="form.name"
|
||||
placeholder="请输入${table.comment!}"
|
||||
v-model:value="form.${table.entityPath}Name"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="广告位描述" name="comments">
|
||||
<a-form-item label="描述" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入广告位描述"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="路由/链接地址" name="path">
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="100"
|
||||
placeholder="请输入路由/链接地址"
|
||||
v-model:value="form.path"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序号" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
@@ -125,8 +46,8 @@
|
||||
</a-form-item>
|
||||
<a-form-item label="状态" name="status">
|
||||
<a-radio-group v-model:value="form.status">
|
||||
<a-radio :value="0">开启</a-radio>
|
||||
<a-radio :value="1">关闭</a-radio>
|
||||
<a-radio :value="0">显示</a-radio>
|
||||
<a-radio :value="1">隐藏</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@@ -136,15 +57,12 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import {assignObject, isChinese} from 'ele-admin-pro';
|
||||
import { addAd, updateAd } from '@/api/cms/ad';
|
||||
import { Ad } from '@/api/cms/ad/model';
|
||||
import { assignObject } from 'ele-admin-pro';
|
||||
import { add${entity}, update${entity} } from '@/api/${package.ModuleName}/${table.entityPath}';
|
||||
import { ${entity} } from '@/api/${package.ModuleName}/${table.entityPath}/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import {FormInstance, RuleObject} from 'ant-design-vue/es/form';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { uploadFile } from '@/api/system/file';
|
||||
import {FileRecord} from "@/api/system/file/model";
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
@@ -157,7 +75,7 @@
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: Ad | null;
|
||||
data?: ${entity} | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -167,23 +85,15 @@
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 已上传数据
|
||||
const images = ref<ItemType[]>([]);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<Ad>({
|
||||
adId: undefined,
|
||||
name: '',
|
||||
adType: '图片广告',
|
||||
images: '',
|
||||
width: '',
|
||||
height: '',
|
||||
path: '',
|
||||
type: '',
|
||||
const form = reactive<${entity}>({
|
||||
${table.entityPath}Id: undefined,
|
||||
${table.entityPath}Name: '',
|
||||
status: 0,
|
||||
comments: '',
|
||||
sortNumber: 100
|
||||
@@ -196,93 +106,18 @@
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
name: [
|
||||
${table.entityPath}Name: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写广告位名称',
|
||||
message: '请填写${table.comment!}名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
adType: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请选择广告类型',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
images: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请上传图片或视频',
|
||||
trigger: 'blur',
|
||||
validator: async (_rule: RuleObject, value: string) => {
|
||||
if (images.value.length == 0) {
|
||||
return Promise.reject('请上传图片或视频');
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 上传事件 */
|
||||
const uploadHandler = (file: File) => {
|
||||
const item: ItemType = {
|
||||
file,
|
||||
uid: (file as any).uid,
|
||||
name: file.name
|
||||
};
|
||||
if (file.type.startsWith('video')) {
|
||||
if (file.size / 1024 / 1024 > 200) {
|
||||
message.error('大小不能超过 200MB');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (file.type.startsWith('image')) {
|
||||
if (file.size / 1024 / 1024 > 5) {
|
||||
message.error('大小不能超过 5MB');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
onUpload(item);
|
||||
};
|
||||
|
||||
// 上传文件
|
||||
const onUpload = (item: any) => {
|
||||
const { file } = item;
|
||||
uploadFile(file)
|
||||
.then((data) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: file.type == 'video/mp4' ? 'https://oss.wsdns.cn/20240301/6e4e32cb808245d4be336b9486961145.png' : data.path,
|
||||
status: 'done'
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
const chooseFile = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.images = data.path;
|
||||
}
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index,1)
|
||||
form.images = '';
|
||||
}
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
@@ -293,10 +128,9 @@
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form,
|
||||
images: JSON.stringify(images.value)
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateAd : addAd;
|
||||
const saveOrUpdate = isUpdate.value ? update${entity} : add${entity};
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
@@ -318,20 +152,8 @@
|
||||
if (visible) {
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
images.value = [];
|
||||
if (props.data.images) {
|
||||
const arr = JSON.parse(props.data.images);
|
||||
arr.map((d) => {
|
||||
images.value.push({
|
||||
uid: d.uid,
|
||||
url: d.url,
|
||||
status: 'done'
|
||||
});
|
||||
});
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
images.value = [];
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
@@ -341,21 +163,3 @@
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
<style lang="less">
|
||||
.tab-pane {
|
||||
min-height: 300px;
|
||||
}
|
||||
.ml-10 {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.upload-text {
|
||||
margin-right: 70px;
|
||||
}
|
||||
.icon-bg {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
display: block;
|
||||
border-radius: 50px;
|
||||
background: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%221%22%20x1%3D%220%22%20x2%3D%221%22%20y1%3D%220%22%20y2%3D%220%22%20gradientTransform%3D%22matrix(6.123233995736766e-17%2C%201%2C%20-0.024693877551020406%2C%206.123233995736766e-17%2C%200.5%2C%200)%22%3E%3Cstop%20stop-color%3D%22%230a060d%22%20stop-opacity%3D%221%22%20offset%3D%220%22%3E%3C%2Fstop%3E%3Cstop%20stop-color%3D%22%23660061%22%20stop-opacity%3D%221%22%20offset%3D%220.95%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22url(%231)%22%3E%3C%2Frect%3E%3C%2Fsvg%3E');
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
row-key="${table.entityPath}Id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
@@ -99,22 +99,29 @@
|
||||
{
|
||||
title: 'ID',
|
||||
width: 90,
|
||||
dataIndex: 'id'
|
||||
dataIndex: '${table.entityPath}Id'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name'
|
||||
dataIndex: '${table.entityPath}name',
|
||||
key: '${table.entityPath}name'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
dataIndex: 'comments',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
key: 'status'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 120,
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
package com.gxwebsoft.generatorVue;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.generator.AutoGenerator;
|
||||
import com.baomidou.mybatisplus.generator.InjectionConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.*;
|
||||
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
|
||||
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
|
||||
import com.gxwebsoft.generator.engine.BeetlTemplateEnginePlus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 代码生成工具
|
||||
*
|
||||
* @author WebSoft
|
||||
* @since 2021-09-05 00:31:14
|
||||
*/
|
||||
public class ShopVueGenerator {
|
||||
// 输出位置
|
||||
// private static final String OUTPUT_LOCATION = System.getProperty("user.dir");
|
||||
private static final String OUTPUT_LOCATION = "/Users/gxwebsoft/VUE/com.gxwebsoft.core-web"; // 不想生成到项目中可以写磁盘路径
|
||||
// 输出目录
|
||||
private static final String OUTPUT_DIR = "/generator";
|
||||
// 作者名称
|
||||
private static final String AUTHOR = "科技小王子";
|
||||
// 是否在xml中添加二级缓存配置
|
||||
private static final boolean ENABLE_CACHE = false;
|
||||
// 数据库连接配置
|
||||
private static final String DB_URL = "jdbc:mysql://47.119.165.234:3308/modules?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8";
|
||||
private static final String DB_DRIVER = "com.mysql.cj.jdbc.Driver";
|
||||
private static final String DB_USERNAME = "modules";
|
||||
private static final String DB_PASSWORD = "FYJGx7s8yt7K8xDH";
|
||||
// 包名
|
||||
private static final String PACKAGE_NAME = "";
|
||||
// 模块名
|
||||
private static final String MODULE_NAME = "shop";
|
||||
// 需要生成的表
|
||||
private static final String[] TABLE_NAMES = new String[]{
|
||||
"shop_goods",
|
||||
// "shop_goods_attr",
|
||||
// "shop_goods_attr_result",
|
||||
// "shop_goods_attr_value",
|
||||
// "shop_goods_category",
|
||||
// "shop_goods_coupon",
|
||||
// "shop_goods_description",
|
||||
// "shop_goods_log",
|
||||
// "shop_goods_relation",
|
||||
// "shop_goods_comment",
|
||||
"shop_goods_rule"
|
||||
};
|
||||
// 需要去除的表前缀
|
||||
private static final String[] TABLE_PREFIX = new String[]{
|
||||
"shop_",
|
||||
"tb_"
|
||||
};
|
||||
// 不需要作为查询参数的字段
|
||||
private static final String[] PARAM_EXCLUDE_FIELDS = new String[]{
|
||||
"tenant_id",
|
||||
"create_time",
|
||||
"update_time"
|
||||
};
|
||||
// 查询参数使用String的类型
|
||||
private static final String[] PARAM_TO_STRING_TYPE = new String[]{
|
||||
"Date",
|
||||
"LocalDate",
|
||||
"LocalTime",
|
||||
"LocalDateTime"
|
||||
};
|
||||
// 查询参数使用EQ的类型
|
||||
private static final String[] PARAM_EQ_TYPE = new String[]{
|
||||
"Integer",
|
||||
"Boolean",
|
||||
"BigDecimal"
|
||||
};
|
||||
// 是否添加权限注解
|
||||
private static final boolean AUTH_ANNOTATION = true;
|
||||
// 是否添加日志注解
|
||||
private static final boolean LOG_ANNOTATION = true;
|
||||
// controller的mapping前缀
|
||||
private static final String CONTROLLER_MAPPING_PREFIX = "/api";
|
||||
// 模板所在位置
|
||||
private static final String TEMPLATES_DIR = "/src/test/java/com/gxwebsoft/generatorVue/templates";
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 代码生成器
|
||||
AutoGenerator mpg = new AutoGenerator();
|
||||
|
||||
// 全局配置
|
||||
GlobalConfig gc = new GlobalConfig();
|
||||
gc.setOutputDir(OUTPUT_LOCATION + OUTPUT_DIR);
|
||||
gc.setAuthor(AUTHOR);
|
||||
gc.setOpen(false);
|
||||
gc.setFileOverride(true);
|
||||
gc.setEnableCache(ENABLE_CACHE);
|
||||
gc.setSwagger2(true);
|
||||
gc.setIdType(IdType.AUTO);
|
||||
gc.setServiceName("%sService");
|
||||
mpg.setGlobalConfig(gc);
|
||||
|
||||
// 数据源配置
|
||||
DataSourceConfig dsc = new DataSourceConfig();
|
||||
dsc.setUrl(DB_URL);
|
||||
// dsc.setSchemaName("public");
|
||||
dsc.setDriverName(DB_DRIVER);
|
||||
dsc.setUsername(DB_USERNAME);
|
||||
dsc.setPassword(DB_PASSWORD);
|
||||
mpg.setDataSource(dsc);
|
||||
|
||||
// 包配置
|
||||
PackageConfig pc = new PackageConfig();
|
||||
pc.setModuleName(MODULE_NAME);
|
||||
pc.setParent(PACKAGE_NAME);
|
||||
mpg.setPackageInfo(pc);
|
||||
|
||||
// 策略配置
|
||||
StrategyConfig strategy = new StrategyConfig();
|
||||
strategy.setNaming(NamingStrategy.underline_to_camel);
|
||||
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
|
||||
strategy.setInclude(TABLE_NAMES);
|
||||
strategy.setTablePrefix(TABLE_PREFIX);
|
||||
strategy.setSuperControllerClass(PACKAGE_NAME + ".common.core.web.BaseController");
|
||||
strategy.setEntityLombokModel(true);
|
||||
strategy.setRestControllerStyle(true);
|
||||
strategy.setControllerMappingHyphenStyle(true);
|
||||
strategy.setLogicDeleteFieldName("deleted");
|
||||
mpg.setStrategy(strategy);
|
||||
|
||||
// 模板配置
|
||||
TemplateConfig templateConfig = new TemplateConfig();
|
||||
// templateConfig.setController(TEMPLATES_DIR + "/index.ts");
|
||||
// templateConfig.setEntity(TEMPLATES_DIR + "/model.ts");
|
||||
// templateConfig.setMapper(TEMPLATES_DIR + "/search.vue");
|
||||
// templateConfig.setXml(TEMPLATES_DIR + "/search.vue");
|
||||
// templateConfig.setService(TEMPLATES_DIR + "/index.vue");
|
||||
// templateConfig.setServiceImpl(TEMPLATES_DIR + "/components.edit.vue");
|
||||
mpg.setTemplate(templateConfig);
|
||||
mpg.setTemplateEngine(new BeetlTemplateEnginePlus());
|
||||
|
||||
// 自定义模板配置
|
||||
InjectionConfig cfg = new InjectionConfig() {
|
||||
@Override
|
||||
public void initMap() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("packageName", PACKAGE_NAME);
|
||||
map.put("paramExcludeFields", PARAM_EXCLUDE_FIELDS);
|
||||
map.put("paramToStringType", PARAM_TO_STRING_TYPE);
|
||||
map.put("paramEqType", PARAM_EQ_TYPE);
|
||||
map.put("authAnnotation", AUTH_ANNOTATION);
|
||||
map.put("logAnnotation", LOG_ANNOTATION);
|
||||
map.put("controllerMappingPrefix", CONTROLLER_MAPPING_PREFIX);
|
||||
this.setMap(map);
|
||||
}
|
||||
};
|
||||
String templatePath = TEMPLATES_DIR + "/index.ts.btl";
|
||||
List<FileOutConfig> focList = new ArrayList<>();
|
||||
focList.add(new FileOutConfig(templatePath) {
|
||||
@Override
|
||||
public String outputFile(TableInfo tableInfo) {
|
||||
return OUTPUT_LOCATION + OUTPUT_DIR + "/"
|
||||
+ PACKAGE_NAME.replace(".", "/")
|
||||
+ "/" + pc.getModuleName() + "/api/"
|
||||
+ tableInfo.getEntityPath() + '/' + "index.ts";
|
||||
}
|
||||
});
|
||||
templatePath = TEMPLATES_DIR + "/model.ts.btl";
|
||||
focList.add(new FileOutConfig(templatePath) {
|
||||
@Override
|
||||
public String outputFile(TableInfo tableInfo) {
|
||||
return OUTPUT_LOCATION + OUTPUT_DIR + "/"
|
||||
+ PACKAGE_NAME.replace(".", "/")
|
||||
+ "/" + pc.getModuleName() + "/api/"
|
||||
+ tableInfo.getEntityPath() + "/model/" + "index.ts";
|
||||
}
|
||||
});
|
||||
cfg.setFileOutConfigList(focList);
|
||||
mpg.setCfg(cfg);
|
||||
|
||||
mpg.execute();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.gxwebsoft.generatorVue.engine;
|
||||
|
||||
import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder;
|
||||
import com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine;
|
||||
import org.beetl.core.Configuration;
|
||||
import org.beetl.core.GroupTemplate;
|
||||
import org.beetl.core.Template;
|
||||
import org.beetl.core.resource.FileResourceLoader;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Beetl模板引擎实现文件输出
|
||||
*
|
||||
* @author WebSoft
|
||||
* @since 2021-09-05 00:30:28
|
||||
*/
|
||||
public class BeetlTemplateEnginePlus extends AbstractTemplateEngine {
|
||||
private GroupTemplate groupTemplate;
|
||||
|
||||
@Override
|
||||
public AbstractTemplateEngine init(ConfigBuilder configBuilder) {
|
||||
super.init(configBuilder);
|
||||
try {
|
||||
Configuration cfg = Configuration.defaultConfiguration();
|
||||
groupTemplate = new GroupTemplate(new FileResourceLoader(), cfg);
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writer(Map<String, Object> objectMap, String templatePath, String outputFile) throws Exception {
|
||||
Template template = groupTemplate.getTemplate(templatePath);
|
||||
try (FileOutputStream fileOutputStream = new FileOutputStream(outputFile)) {
|
||||
template.binding(objectMap);
|
||||
template.renderTo(fileOutputStream);
|
||||
}
|
||||
logger.debug("模板:" + templatePath + "; 文件:" + outputFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String templateFilePath(String filePath) {
|
||||
return filePath + ".btl";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,361 +0,0 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑广告' : '添加广告'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="广告位类型" name="adType">
|
||||
<a-select
|
||||
ref="select"
|
||||
v-model:value="form.adType"
|
||||
style="width: 120px"
|
||||
>
|
||||
<a-select-option value="图片广告">图片广告</a-select-option>
|
||||
<a-select-option value="幻灯片">幻灯片</a-select-option>
|
||||
<a-select-option value="视频广告">视频广告</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<template v-if="form.adType == '幻灯片'">
|
||||
<a-form-item label="广告图片" name="images" extra="请上传广告图片,最多可上传9张图">
|
||||
<SelectFile
|
||||
:placeholder="`请选择图片`"
|
||||
:limit="9"
|
||||
:data="images"
|
||||
@done="chooseFile"
|
||||
@del="onDeleteItem"
|
||||
/>
|
||||
<!-- <ele-image-upload-->
|
||||
<!-- v-model:value="images"-->
|
||||
<!-- :limit="9"-->
|
||||
<!-- :drag="true"-->
|
||||
<!-- :accept="'image/png,image/jpeg'"-->
|
||||
<!-- :item-style="{ maxWidth: '160px', maxHeight: '160px' }"-->
|
||||
<!-- :upload-handler="uploadHandler"-->
|
||||
<!-- @upload="onUpload"-->
|
||||
<!-- />-->
|
||||
</a-form-item>
|
||||
</template>
|
||||
<template v-if="form.adType == '图片广告'">
|
||||
<a-form-item label="广告图片" name="images" extra="请上传广告图片">
|
||||
<SelectFile
|
||||
:placeholder="`请选择图片`"
|
||||
:limit="1"
|
||||
:data="images"
|
||||
@done="chooseFile"
|
||||
@del="onDeleteItem"
|
||||
/>
|
||||
<!-- <ele-image-upload-->
|
||||
<!-- v-model:value="images"-->
|
||||
<!-- :limit="1"-->
|
||||
<!-- :accept="'image/png,image/jpeg'"-->
|
||||
<!-- :drag="true"-->
|
||||
<!-- :item-style="{ maxWidth: '160px', maxHeight: '160px' }"-->
|
||||
<!-- :upload-handler="uploadHandler"-->
|
||||
<!-- @upload="onUpload"-->
|
||||
<!-- />-->
|
||||
</a-form-item>
|
||||
</template>
|
||||
<template v-if="form.adType == '视频广告'">
|
||||
<a-form-item label="上传视频" name="images" extra="请上传视频文件,仅支持mp4格式,大小200M以内">
|
||||
<SelectFile
|
||||
:placeholder="`请选择视频文件`"
|
||||
:limit="1"
|
||||
:data="images"
|
||||
@done="chooseFile"
|
||||
@del="onDeleteItem"
|
||||
/>
|
||||
<!-- <ele-image-upload-->
|
||||
<!-- v-model:value="images"-->
|
||||
<!-- :limit="1"-->
|
||||
<!-- :accept="'video/mp4'"-->
|
||||
<!-- :drag="true"-->
|
||||
<!-- :item-style="{ maxWidth: '160px', maxHeight: '160px' }"-->
|
||||
<!-- :upload-handler="uploadHandler"-->
|
||||
<!-- @upload="onUpload"-->
|
||||
<!-- />-->
|
||||
</a-form-item>
|
||||
</template>
|
||||
<a-form-item label="广告位名称" name="name">
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="100"
|
||||
placeholder="请输入广告位名称"
|
||||
v-model:value="form.name"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="广告位描述" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入广告位描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="路由/链接地址" name="path">
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="100"
|
||||
placeholder="请输入路由/链接地址"
|
||||
v-model:value="form.path"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序号" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="状态" name="status">
|
||||
<a-radio-group v-model:value="form.status">
|
||||
<a-radio :value="0">开启</a-radio>
|
||||
<a-radio :value="1">关闭</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import {assignObject, isChinese} from 'ele-admin-pro';
|
||||
import { addAd, updateAd } from '@/api/cms/ad';
|
||||
import { Ad } from '@/api/cms/ad/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import {FormInstance, RuleObject} from 'ant-design-vue/es/form';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { uploadFile } from '@/api/system/file';
|
||||
import {FileRecord} from "@/api/system/file/model";
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: Ad | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 已上传数据
|
||||
const images = ref<ItemType[]>([]);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<Ad>({
|
||||
adId: undefined,
|
||||
name: '',
|
||||
adType: '图片广告',
|
||||
images: '',
|
||||
width: '',
|
||||
height: '',
|
||||
path: '',
|
||||
type: '',
|
||||
status: 0,
|
||||
comments: '',
|
||||
sortNumber: 100
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写广告位名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
adType: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请选择广告类型',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
images: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请上传图片或视频',
|
||||
trigger: 'blur',
|
||||
validator: async (_rule: RuleObject, value: string) => {
|
||||
if (images.value.length == 0) {
|
||||
return Promise.reject('请上传图片或视频');
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 上传事件 */
|
||||
const uploadHandler = (file: File) => {
|
||||
const item: ItemType = {
|
||||
file,
|
||||
uid: (file as any).uid,
|
||||
name: file.name
|
||||
};
|
||||
if (file.type.startsWith('video')) {
|
||||
if (file.size / 1024 / 1024 > 200) {
|
||||
message.error('大小不能超过 200MB');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (file.type.startsWith('image')) {
|
||||
if (file.size / 1024 / 1024 > 5) {
|
||||
message.error('大小不能超过 5MB');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
onUpload(item);
|
||||
};
|
||||
|
||||
// 上传文件
|
||||
const onUpload = (item: any) => {
|
||||
const { file } = item;
|
||||
uploadFile(file)
|
||||
.then((data) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: file.type == 'video/mp4' ? 'https://oss.wsdns.cn/20240301/6e4e32cb808245d4be336b9486961145.png' : data.path,
|
||||
status: 'done'
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
const chooseFile = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.images = data.path;
|
||||
}
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index,1)
|
||||
form.images = '';
|
||||
}
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form,
|
||||
images: JSON.stringify(images.value)
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateAd : addAd;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
images.value = [];
|
||||
if (props.data.images) {
|
||||
const arr = JSON.parse(props.data.images);
|
||||
arr.map((d) => {
|
||||
images.value.push({
|
||||
uid: d.uid,
|
||||
url: d.url,
|
||||
status: 'done'
|
||||
});
|
||||
});
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
images.value = [];
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
<style lang="less">
|
||||
.tab-pane {
|
||||
min-height: 300px;
|
||||
}
|
||||
.ml-10 {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.upload-text {
|
||||
margin-right: 70px;
|
||||
}
|
||||
.icon-bg {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
display: block;
|
||||
border-radius: 50px;
|
||||
background: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%221%22%20x1%3D%220%22%20x2%3D%221%22%20y1%3D%220%22%20y2%3D%220%22%20gradientTransform%3D%22matrix(6.123233995736766e-17%2C%201%2C%20-0.024693877551020406%2C%206.123233995736766e-17%2C%200.5%2C%200)%22%3E%3Cstop%20stop-color%3D%22%230a060d%22%20stop-opacity%3D%221%22%20offset%3D%220%22%3E%3C%2Fstop%3E%3Cstop%20stop-color%3D%22%23660061%22%20stop-opacity%3D%221%22%20offset%3D%220.95%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22url(%231)%22%3E%3C%2Frect%3E%3C%2Fsvg%3E');
|
||||
}
|
||||
</style>
|
||||
@@ -1,106 +0,0 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ${entity}, ${entity}Param } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询${table.comment!}
|
||||
*/
|
||||
export async function page${entity}(params: ${entity}Param) {
|
||||
const res = await request.get<ApiResult<PageResult<${entity}>>>(
|
||||
MODULES_API_URL + '/shop/${controllerMappingHyphen}/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询${table.comment!}列表
|
||||
*/
|
||||
export async function list${entity}(params?: ${entity}Param) {
|
||||
const res = await request.get<ApiResult<${entity}[]>>(
|
||||
MODULES_API_URL + '/shop/${controllerMappingHyphen}',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加${table.comment!}
|
||||
*/
|
||||
export async function add${entity}(data: ${entity}) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/${controllerMappingHyphen}',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改${table.comment!}
|
||||
*/
|
||||
export async function update${entity}(data: ${entity}) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/${controllerMappingHyphen}',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除${table.comment!}
|
||||
*/
|
||||
export async function remove${entity}(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/${controllerMappingHyphen}/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除${table.comment!}
|
||||
*/
|
||||
export async function removeBatch${entity}(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/${controllerMappingHyphen}/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询${table.comment!}
|
||||
*/
|
||||
export async function get${entity}(id: number) {
|
||||
const res = await request.get<ApiResult<${entity}>>(
|
||||
MODULES_API_URL + '/shop/${controllerMappingHyphen}/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -1,242 +0,0 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="adId"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'images'">
|
||||
<template v-for="(item,index) in JSON.parse(record.images)" :key="index">
|
||||
<a-image :src="item.url" :width="80"></a-image>
|
||||
</template>
|
||||
<span></span>
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">开启</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">关闭</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<AdEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import AdEdit from './components/ad-edit.vue';
|
||||
import { pageAd, removeAd, removeBatchAd } from '@/api/cms/ad';
|
||||
import type { Ad, AdParam } from '@/api/cms/ad/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<Ad[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<Ad | null>(null);
|
||||
// 是否显示资产详情
|
||||
const showInfo = ref(false);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageAd({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: 'ID',
|
||||
width: 90,
|
||||
dataIndex: 'adId'
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'adType',
|
||||
key: 'adType'
|
||||
},
|
||||
{
|
||||
title: '广告位名称',
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '广告图片',
|
||||
dataIndex: 'images',
|
||||
key: 'images'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: AdParam) => {
|
||||
console.log(where);
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: Ad) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 打开用户详情弹窗 */
|
||||
const openInfo = (row?: Ad) => {
|
||||
current.value = row ?? null;
|
||||
showInfo.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: Ad) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeAd(row.adId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量转移 */
|
||||
const batchMove = (userId) => {
|
||||
console.log(userId, '批量转移0000');
|
||||
console.log(selection.value);
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchAd(selection.value.map((d) => d.adId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: Ad) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'Ad'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
@@ -1,42 +0,0 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* ${table.comment!}
|
||||
*/
|
||||
export interface ${entity} {
|
||||
<% /** -----------BEGIN 字段循环遍历----------- **/ %>
|
||||
<% for(field in table.fields) { %>
|
||||
<%
|
||||
var keyPropertyName;
|
||||
if(field.keyFlag) {
|
||||
keyPropertyName = field.propertyName;
|
||||
}
|
||||
%>
|
||||
<% /* 主键 */ %>
|
||||
<% if(field.keyFlag) { %>
|
||||
<% /* 普通字段 */ %>
|
||||
<% } else if(isNotEmpty(field.fill)) { %>
|
||||
<% if(field.convert){ %>
|
||||
@TableField(value = "${field.annotationColumnName}", fill = FieldFill.${field.fill})
|
||||
<% }else{ %>
|
||||
@TableField(fill = FieldFill.${field.fill})
|
||||
<% } %>
|
||||
<% } else if(field.convert) { %>
|
||||
@TableField("${field.annotationColumnName}")
|
||||
<% } %>
|
||||
${field.propertyName}?: <% if(field.propertyType == 'Integer') { %>number<% }else{ %>string<% } %>;
|
||||
<% } %>
|
||||
<% /** -----------END 字段循环遍历----------- **/ %>
|
||||
}
|
||||
|
||||
/**
|
||||
* ${table.comment!}搜索条件
|
||||
*/
|
||||
export interface ${entity}Param extends PageParam {
|
||||
<% for(field in table.fields) { %>
|
||||
<% if(field.keyFlag) { %>
|
||||
${field.propertyName}?: number;
|
||||
<% } %>
|
||||
<% } %>
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
Reference in New Issue
Block a user