新增:产品管理模块

This commit is contained in:
2024-09-27 21:09:28 +08:00
parent 8626647393
commit 8ddb0e2b41
35 changed files with 1869 additions and 6 deletions

View File

@@ -20,7 +20,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 文章控制器 * 文章控制器
@@ -162,4 +164,32 @@ public class CmsArticleController extends BaseController {
return success(article); return success(article);
} }
@ApiOperation("统计信息")
@GetMapping("/data")
public ApiResult<Map<String, Integer>> data(CmsArticleParam param) {
Map<String, Integer> data = new HashMap<>();
final LambdaQueryWrapper<CmsArticle> wrapper = new LambdaQueryWrapper<>();
if(param.getMerchantId() != null){
wrapper.eq(CmsArticle::getMerchantId,param.getMerchantId());
}
Integer totalNum = cmsArticleService.count(
wrapper.eq(CmsArticle::getDeleted,0).eq(CmsArticle::getStatus,0)
);
data.put("totalNum", totalNum);
Integer totalNum2 = cmsArticleService.count(
wrapper.eq(CmsArticle::getStatus,1)
);
data.put("totalNum2", totalNum2);
Integer totalNum3 = cmsArticleService.count(
wrapper.gt(CmsArticle::getStatus,1)
);
data.put("totalNum3", totalNum3);
return success(data);
}
} }

View File

@@ -0,0 +1,150 @@
package com.gxwebsoft.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.cms.param.CmsProductSpecParam;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.cms.service.CmsProductService;
import com.gxwebsoft.cms.entity.CmsProduct;
import com.gxwebsoft.cms.param.CmsProductParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.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.HashMap;
import java.util.List;
import java.util.Map;
/**
* 产品控制器
*
* @author 科技小王子
* @since 2024-09-27 16:03:44
*/
@Api(tags = "产品管理")
@RestController
@RequestMapping("/api/cms/cms-product")
public class CmsProductController extends BaseController {
@Resource
private CmsProductService cmsProductService;
@ApiOperation("分页查询产品")
@GetMapping("/page")
public ApiResult<PageResult<CmsProduct>> page(CmsProductParam param) {
// 使用关联查询
return success(cmsProductService.pageRel(param));
}
@ApiOperation("查询全部产品")
@GetMapping()
public ApiResult<List<CmsProduct>> list(CmsProductParam param) {
// 使用关联查询
return success(cmsProductService.listRel(param));
}
@ApiOperation("根据id查询产品")
@GetMapping("/{id}")
public ApiResult<CmsProduct> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(cmsProductService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('cms:cmsProduct:save')")
@OperationLog
@ApiOperation("添加产品")
@PostMapping()
public ApiResult<?> save(@RequestBody CmsProduct cmsProduct) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
cmsProduct.setUserId(loginUser.getUserId());
}
if (cmsProductService.save(cmsProduct)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('cms:cmsProduct:update')")
@OperationLog
@ApiOperation("修改产品")
@PutMapping()
public ApiResult<?> update(@RequestBody CmsProduct cmsProduct) {
if (cmsProductService.updateById(cmsProduct)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('cms:cmsProduct:remove')")
@OperationLog
@ApiOperation("删除产品")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (cmsProductService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('cms:cmsProduct:save')")
@OperationLog
@ApiOperation("批量添加产品")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<CmsProduct> list) {
if (cmsProductService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('cms:cmsProduct:update')")
@OperationLog
@ApiOperation("批量修改产品")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsProduct> batchParam) {
if (batchParam.update(cmsProductService, "product_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('cms:cmsProduct:remove')")
@OperationLog
@ApiOperation("批量删除产品")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (cmsProductService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("统计信息")
@GetMapping("/data")
public ApiResult<Map<String, Integer>> data(CmsProductSpecParam param) {
Map<String, Integer> data = new HashMap<>();
final LambdaQueryWrapper<CmsProduct> wrapper = new LambdaQueryWrapper<>();
if(param.getMerchantId() != null){
wrapper.eq(CmsProduct::getMerchantId,param.getMerchantId());
}
Integer totalNum = cmsProductService.count(
wrapper.eq(CmsProduct::getDeleted,0).eq(CmsProduct::getStatus,0)
);
data.put("totalNum", totalNum);
Integer totalNum2 = cmsProductService.count(
wrapper.eq(CmsProduct::getStatus,1)
);
data.put("totalNum2", totalNum2);
Integer totalNum3 = cmsProductService.count(
wrapper.gt(CmsProduct::getStatus,1)
);
data.put("totalNum3", totalNum3);
return success(data);
}
}

View File

@@ -0,0 +1,116 @@
package com.gxwebsoft.cms.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.cms.service.CmsProductSpecService;
import com.gxwebsoft.cms.entity.CmsProductSpec;
import com.gxwebsoft.cms.param.CmsProductSpecParam;
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-09-27 16:03:44
*/
@Api(tags = "规格管理")
@RestController
@RequestMapping("/api/cms/cms-product-spec")
public class CmsProductSpecController extends BaseController {
@Resource
private CmsProductSpecService cmsProductSpecService;
@ApiOperation("分页查询规格")
@GetMapping("/page")
public ApiResult<PageResult<CmsProductSpec>> page(CmsProductSpecParam param) {
// 使用关联查询
return success(cmsProductSpecService.pageRel(param));
}
@ApiOperation("查询全部规格")
@GetMapping()
public ApiResult<List<CmsProductSpec>> list(CmsProductSpecParam param) {
// 使用关联查询
return success(cmsProductSpecService.listRel(param));
}
@PreAuthorize("hasAuthority('cms:cmsProductSpec:list')")
@OperationLog
@ApiOperation("根据id查询规格")
@GetMapping("/{id}")
public ApiResult<CmsProductSpec> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(cmsProductSpecService.getByIdRel(id));
}
@ApiOperation("添加规格")
@PostMapping()
public ApiResult<?> save(@RequestBody CmsProductSpec cmsProductSpec) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
cmsProductSpec.setUserId(loginUser.getUserId());
}
if (cmsProductSpecService.save(cmsProductSpec)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改规格")
@PutMapping()
public ApiResult<?> update(@RequestBody CmsProductSpec cmsProductSpec) {
if (cmsProductSpecService.updateById(cmsProductSpec)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除规格")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (cmsProductSpecService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加规格")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<CmsProductSpec> list) {
if (cmsProductSpecService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改规格")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsProductSpec> batchParam) {
if (batchParam.update(cmsProductSpecService, "spec_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除规格")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (cmsProductSpecService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -0,0 +1,111 @@
package com.gxwebsoft.cms.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.cms.service.CmsProductSpecValueService;
import com.gxwebsoft.cms.entity.CmsProductSpecValue;
import com.gxwebsoft.cms.param.CmsProductSpecValueParam;
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-09-27 16:03:44
*/
@Api(tags = "规格值管理")
@RestController
@RequestMapping("/api/cms/cms-product-spec-value")
public class CmsProductSpecValueController extends BaseController {
@Resource
private CmsProductSpecValueService cmsProductSpecValueService;
@ApiOperation("分页查询规格值")
@GetMapping("/page")
public ApiResult<PageResult<CmsProductSpecValue>> page(CmsProductSpecValueParam param) {
// 使用关联查询
return success(cmsProductSpecValueService.pageRel(param));
}
@ApiOperation("查询全部规格值")
@GetMapping()
public ApiResult<List<CmsProductSpecValue>> list(CmsProductSpecValueParam param) {
// 使用关联查询
return success(cmsProductSpecValueService.listRel(param));
}
@PreAuthorize("hasAuthority('cms:cmsProductSpecValue:list')")
@OperationLog
@ApiOperation("根据id查询规格值")
@GetMapping("/{id}")
public ApiResult<CmsProductSpecValue> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(cmsProductSpecValueService.getByIdRel(id));
}
@ApiOperation("添加规格值")
@PostMapping()
public ApiResult<?> save(@RequestBody CmsProductSpecValue cmsProductSpecValue) {
if (cmsProductSpecValueService.save(cmsProductSpecValue)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改规格值")
@PutMapping()
public ApiResult<?> update(@RequestBody CmsProductSpecValue cmsProductSpecValue) {
if (cmsProductSpecValueService.updateById(cmsProductSpecValue)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除规格值")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (cmsProductSpecValueService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加规格值")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<CmsProductSpecValue> list) {
if (cmsProductSpecValueService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改规格值")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsProductSpecValue> batchParam) {
if (batchParam.update(cmsProductSpecValueService, "spec_value_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除规格值")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (cmsProductSpecValueService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -0,0 +1,111 @@
package com.gxwebsoft.cms.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.cms.service.CmsProductUrlService;
import com.gxwebsoft.cms.entity.CmsProductUrl;
import com.gxwebsoft.cms.param.CmsProductUrlParam;
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-09-27 16:03:44
*/
@Api(tags = "域名管理")
@RestController
@RequestMapping("/api/cms/cms-product-url")
public class CmsProductUrlController extends BaseController {
@Resource
private CmsProductUrlService cmsProductUrlService;
@ApiOperation("分页查询域名")
@GetMapping("/page")
public ApiResult<PageResult<CmsProductUrl>> page(CmsProductUrlParam param) {
// 使用关联查询
return success(cmsProductUrlService.pageRel(param));
}
@ApiOperation("查询全部域名")
@GetMapping()
public ApiResult<List<CmsProductUrl>> list(CmsProductUrlParam param) {
// 使用关联查询
return success(cmsProductUrlService.listRel(param));
}
@PreAuthorize("hasAuthority('cms:cmsProductUrl:list')")
@OperationLog
@ApiOperation("根据id查询域名")
@GetMapping("/{id}")
public ApiResult<CmsProductUrl> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(cmsProductUrlService.getByIdRel(id));
}
@ApiOperation("添加域名")
@PostMapping()
public ApiResult<?> save(@RequestBody CmsProductUrl cmsProductUrl) {
if (cmsProductUrlService.save(cmsProductUrl)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改域名")
@PutMapping()
public ApiResult<?> update(@RequestBody CmsProductUrl cmsProductUrl) {
if (cmsProductUrlService.updateById(cmsProductUrl)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除域名")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (cmsProductUrlService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加域名")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<CmsProductUrl> list) {
if (cmsProductUrlService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改域名")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsProductUrl> batchParam) {
if (batchParam.update(cmsProductUrlService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除域名")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (cmsProductUrlService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -113,6 +113,9 @@ public class CmsArticle implements Serializable {
@ApiModelProperty(value = "用户ID") @ApiModelProperty(value = "用户ID")
private Integer userId; private Integer userId;
@ApiModelProperty(value = "商户ID")
private Integer merchantId;
@ApiModelProperty(value = "昵称") @ApiModelProperty(value = "昵称")
@TableField(exist = false) @TableField(exist = false)
private String nickname; private String nickname;

View File

@@ -0,0 +1,115 @@
package com.gxwebsoft.cms.entity;
import java.math.BigDecimal;
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-09-27 16:03:44
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "CmsProduct对象", description = "产品")
public class CmsProduct implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "自增ID")
@TableId(value = "product_id", type = IdType.AUTO)
private Integer productId;
@ApiModelProperty(value = "类型 0软件产品 1实物商品 2虚拟商品")
private Integer type;
@ApiModelProperty(value = "产品编码")
private String code;
@ApiModelProperty(value = "产品标题")
private String title;
@ApiModelProperty(value = "封面图")
private String image;
@ApiModelProperty(value = "产品详情")
private String content;
@ApiModelProperty(value = "父级分类ID")
private Integer parentId;
@ApiModelProperty(value = "产品分类ID")
private Integer categoryId;
@ApiModelProperty(value = "产品规格 0单规格 1多规格")
private Integer specs;
@ApiModelProperty(value = "货架")
private String position;
@ApiModelProperty(value = "单位名称 (个)")
private String unitName;
@ApiModelProperty(value = "进货价格")
private BigDecimal price;
@ApiModelProperty(value = "销售价格")
private BigDecimal salePrice;
@ApiModelProperty(value = "库存计算方式(10下单减库存 20付款减库存)")
private Integer deductStockType;
@ApiModelProperty(value = "轮播图")
private String files;
@ApiModelProperty(value = "销量")
private Integer sales;
@ApiModelProperty(value = "库存")
private Integer stock;
@ApiModelProperty(value = "消费赚取积分")
private BigDecimal gainIntegral;
@ApiModelProperty(value = "推荐")
private Integer recommend;
@ApiModelProperty(value = "商户ID")
private Long merchantId;
@ApiModelProperty(value = "状态0未上架1上架")
private Boolean isShow;
@ApiModelProperty(value = "状态, 0上架 1待上架 2待审核 3审核不通过")
private Integer status;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "排序号")
private Integer sortNumber;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,55 @@
package com.gxwebsoft.cms.entity;
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-09-27 16:03:44
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "CmsProductSpec对象", description = "规格")
public class CmsProductSpec implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "规格ID")
@TableId(value = "spec_id", type = IdType.AUTO)
private Integer specId;
@ApiModelProperty(value = "规格名称")
private String specName;
@ApiModelProperty(value = "规格值")
private String specValue;
@ApiModelProperty(value = "创建用户")
private Integer userId;
@ApiModelProperty(value = "更新者")
private Integer updater;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1待修,2异常已修3异常未修")
private Integer status;
@ApiModelProperty(value = "排序号")
private Integer sortNumber;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,46 @@
package com.gxwebsoft.cms.entity;
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-09-27 16:03:44
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "CmsProductSpecValue对象", description = "规格值")
public class CmsProductSpecValue implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "规格值ID")
@TableId(value = "spec_value_id", type = IdType.AUTO)
private Integer specValueId;
@ApiModelProperty(value = "规格组ID")
private Integer specId;
@ApiModelProperty(value = "规格值")
private String specValue;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "排序号")
private Integer sortNumber;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,61 @@
package com.gxwebsoft.cms.entity;
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-09-27 16:03:44
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "CmsProductUrl对象", description = "域名")
public class CmsProductUrl 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 productId;
@ApiModelProperty(value = "域名类型")
private String type;
@ApiModelProperty(value = "域名")
private String domain;
@ApiModelProperty(value = "账号")
private String account;
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "商户ID")
private Integer merchantId;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "状态, 0正常, 1待确认")
private Integer status;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
}

View File

@@ -0,0 +1,37 @@
package com.gxwebsoft.cms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.cms.entity.CmsProduct;
import com.gxwebsoft.cms.param.CmsProductParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 产品Mapper
*
* @author 科技小王子
* @since 2024-09-27 16:03:44
*/
public interface CmsProductMapper extends BaseMapper<CmsProduct> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<CmsProduct>
*/
List<CmsProduct> selectPageRel(@Param("page") IPage<CmsProduct> page,
@Param("param") CmsProductParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<CmsProduct> selectListRel(@Param("param") CmsProductParam param);
}

View File

@@ -0,0 +1,37 @@
package com.gxwebsoft.cms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.cms.entity.CmsProductSpec;
import com.gxwebsoft.cms.param.CmsProductSpecParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 规格Mapper
*
* @author 科技小王子
* @since 2024-09-27 16:03:44
*/
public interface CmsProductSpecMapper extends BaseMapper<CmsProductSpec> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<CmsProductSpec>
*/
List<CmsProductSpec> selectPageRel(@Param("page") IPage<CmsProductSpec> page,
@Param("param") CmsProductSpecParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<CmsProductSpec> selectListRel(@Param("param") CmsProductSpecParam param);
}

View File

@@ -0,0 +1,37 @@
package com.gxwebsoft.cms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.cms.entity.CmsProductSpecValue;
import com.gxwebsoft.cms.param.CmsProductSpecValueParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 规格值Mapper
*
* @author 科技小王子
* @since 2024-09-27 16:03:44
*/
public interface CmsProductSpecValueMapper extends BaseMapper<CmsProductSpecValue> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<CmsProductSpecValue>
*/
List<CmsProductSpecValue> selectPageRel(@Param("page") IPage<CmsProductSpecValue> page,
@Param("param") CmsProductSpecValueParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<CmsProductSpecValue> selectListRel(@Param("param") CmsProductSpecValueParam param);
}

View File

@@ -0,0 +1,37 @@
package com.gxwebsoft.cms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.cms.entity.CmsProductUrl;
import com.gxwebsoft.cms.param.CmsProductUrlParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 域名Mapper
*
* @author 科技小王子
* @since 2024-09-27 16:03:44
*/
public interface CmsProductUrlMapper extends BaseMapper<CmsProductUrl> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<CmsProductUrl>
*/
List<CmsProductUrl> selectPageRel(@Param("page") IPage<CmsProductUrl> page,
@Param("param") CmsProductUrlParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<CmsProductUrl> selectListRel(@Param("param") CmsProductUrlParam param);
}

View File

@@ -6,9 +6,9 @@
<sql id="selectSql"> <sql id="selectSql">
SELECT a.*,b.title as categoryName,b.parent_Id as parentId,c.title as parentName,d.nickname,d.avatar SELECT a.*,b.title as categoryName,b.parent_Id as parentId,c.title as parentName,d.nickname,d.avatar
FROM cms_article a FROM cms_article a
LEFT JOIN cms_article_category b ON a.category_id = b.category_id LEFT JOIN cms_navigation b ON a.category_id = b.navigation_id
LEFT JOIN cms_article_category c ON c.category_id = b.parent_id LEFT JOIN cms_navigation c ON b.parent_id = c.navigation_id
LEFT JOIN sys_user d ON d.user_id = a.user_id LEFT JOIN sys_user d ON a.user_id = d.user_id
<where> <where>
<if test="param.articleId != null"> <if test="param.articleId != null">
AND a.article_id = #{param.articleId} AND a.article_id = #{param.articleId}

View File

@@ -109,6 +109,11 @@
<if test="param.createTimeEnd != null"> <if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd} AND a.create_time &lt;= #{param.createTimeEnd}
</if> </if>
<if test="param.keywords != null">
AND (a.path LIKE CONCAT('%', #{param.keywords}, '%')
OR a.title LIKE CONCAT('%', #{param.keywords}, '%')
)
</if>
</where> </where>
</sql> </sql>

View File

@@ -0,0 +1,110 @@
<?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.cms.mapper.CmsProductMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM cms_product a
<where>
<if test="param.productId != null">
AND a.product_id = #{param.productId}
</if>
<if test="param.type != null">
AND a.type = #{param.type}
</if>
<if test="param.code != null">
AND a.code LIKE CONCAT('%', #{param.code}, '%')
</if>
<if test="param.title != null">
AND a.title LIKE CONCAT('%', #{param.title}, '%')
</if>
<if test="param.image != null">
AND a.image LIKE CONCAT('%', #{param.image}, '%')
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if>
<if test="param.parentId != null">
AND a.parent_id = #{param.parentId}
</if>
<if test="param.categoryId != null">
AND a.category_id = #{param.categoryId}
</if>
<if test="param.specs != null">
AND a.specs = #{param.specs}
</if>
<if test="param.position != null">
AND a.position LIKE CONCAT('%', #{param.position}, '%')
</if>
<if test="param.unitName != null">
AND a.unit_name LIKE CONCAT('%', #{param.unitName}, '%')
</if>
<if test="param.price != null">
AND a.price = #{param.price}
</if>
<if test="param.salePrice != null">
AND a.sale_price = #{param.salePrice}
</if>
<if test="param.deductStockType != null">
AND a.deduct_stock_type = #{param.deductStockType}
</if>
<if test="param.files != null">
AND a.files LIKE CONCAT('%', #{param.files}, '%')
</if>
<if test="param.sales != null">
AND a.sales = #{param.sales}
</if>
<if test="param.stock != null">
AND a.stock = #{param.stock}
</if>
<if test="param.gainIntegral != null">
AND a.gain_integral = #{param.gainIntegral}
</if>
<if test="param.recommend != null">
AND a.recommend = #{param.recommend}
</if>
<if test="param.merchantId != null">
AND a.merchant_id = #{param.merchantId}
</if>
<if test="param.isShow != null">
AND a.is_show = #{param.isShow}
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsProduct">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsProduct">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -0,0 +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.cms.mapper.CmsProductSpecMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM cms_product_spec a
<where>
<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.specValue != null">
AND a.spec_value LIKE CONCAT('%', #{param.specValue}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.updater != null">
AND a.updater = #{param.updater}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsProductSpec">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsProductSpec">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -0,0 +1,44 @@
<?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.cms.mapper.CmsProductSpecValueMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM cms_product_spec_value a
<where>
<if test="param.specValueId != null">
AND a.spec_value_id = #{param.specValueId}
</if>
<if test="param.specId != null">
AND a.spec_id = #{param.specId}
</if>
<if test="param.specValue != null">
AND a.spec_value LIKE CONCAT('%', #{param.specValue}, '%')
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsProductSpecValue">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsProductSpecValue">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.cms.mapper.CmsProductUrlMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM cms_product_url a
<where>
<if test="param.id != null">
AND a.id = #{param.id}
</if>
<if test="param.productId != null">
AND a.product_id = #{param.productId}
</if>
<if test="param.type != null">
AND a.type LIKE CONCAT('%', #{param.type}, '%')
</if>
<if test="param.domain != null">
AND a.domain LIKE CONCAT('%', #{param.domain}, '%')
</if>
<if test="param.account != null">
AND a.account LIKE CONCAT('%', #{param.account}, '%')
</if>
<if test="param.password != null">
AND a.password LIKE CONCAT('%', #{param.password}, '%')
</if>
<if test="param.merchantId != null">
AND a.merchant_id = #{param.merchantId}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</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.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.CmsProductUrl">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.CmsProductUrl">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -0,0 +1,123 @@
package com.gxwebsoft.cms.param;
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;
import java.math.BigDecimal;
/**
* 产品查询参数
*
* @author 科技小王子
* @since 2024-09-27 16:03:44
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "CmsProductParam对象", description = "产品查询参数")
public class CmsProductParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "自增ID")
@QueryField(type = QueryType.EQ)
private Integer productId;
@ApiModelProperty(value = "类型 0软件产品 1实物商品 2虚拟商品")
@QueryField(type = QueryType.EQ)
private Integer type;
@ApiModelProperty(value = "产品编码")
private String code;
@ApiModelProperty(value = "产品标题")
private String title;
@ApiModelProperty(value = "封面图")
private String image;
@ApiModelProperty(value = "产品详情")
private String content;
@ApiModelProperty(value = "父级分类ID")
@QueryField(type = QueryType.EQ)
private Integer parentId;
@ApiModelProperty(value = "产品分类ID")
@QueryField(type = QueryType.EQ)
private Integer categoryId;
@ApiModelProperty(value = "产品规格 0单规格 1多规格")
@QueryField(type = QueryType.EQ)
private Integer specs;
@ApiModelProperty(value = "货架")
private String position;
@ApiModelProperty(value = "单位名称 (个)")
private String unitName;
@ApiModelProperty(value = "进货价格")
@QueryField(type = QueryType.EQ)
private BigDecimal price;
@ApiModelProperty(value = "销售价格")
@QueryField(type = QueryType.EQ)
private BigDecimal salePrice;
@ApiModelProperty(value = "库存计算方式(10下单减库存 20付款减库存)")
@QueryField(type = QueryType.EQ)
private Integer deductStockType;
@ApiModelProperty(value = "轮播图")
private String files;
@ApiModelProperty(value = "销量")
@QueryField(type = QueryType.EQ)
private Integer sales;
@ApiModelProperty(value = "库存")
@QueryField(type = QueryType.EQ)
private Integer stock;
@ApiModelProperty(value = "消费赚取积分")
@QueryField(type = QueryType.EQ)
private BigDecimal gainIntegral;
@ApiModelProperty(value = "推荐")
@QueryField(type = QueryType.EQ)
private Integer recommend;
@ApiModelProperty(value = "商户ID")
@QueryField(type = QueryType.EQ)
private Long merchantId;
@ApiModelProperty(value = "状态0未上架1上架")
@QueryField(type = QueryType.EQ)
private Boolean isShow;
@ApiModelProperty(value = "状态, 0上架 1待上架 2待审核 3审核不通过")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "排序号")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
}

View File

@@ -0,0 +1,54 @@
package com.gxwebsoft.cms.param;
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-09-27 16:03:44
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "CmsProductSpecParam对象", description = "规格查询参数")
public class CmsProductSpecParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "规格ID")
@QueryField(type = QueryType.EQ)
private Integer specId;
@ApiModelProperty(value = "规格名称")
private String specName;
@ApiModelProperty(value = "规格值")
private String specValue;
@ApiModelProperty(value = "创建用户")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "更新者")
@QueryField(type = QueryType.EQ)
private Integer updater;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1待修,2异常已修3异常未修")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "排序号")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
}

View File

@@ -0,0 +1,43 @@
package com.gxwebsoft.cms.param;
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-09-27 16:03:44
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "CmsProductSpecValueParam对象", description = "规格值查询参数")
public class CmsProductSpecValueParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "规格值ID")
@QueryField(type = QueryType.EQ)
private Integer specValueId;
@ApiModelProperty(value = "规格组ID")
@QueryField(type = QueryType.EQ)
private Integer specId;
@ApiModelProperty(value = "规格值")
private String specValue;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "排序号")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
}

View File

@@ -0,0 +1,60 @@
package com.gxwebsoft.cms.param;
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-09-27 16:03:44
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "CmsProductUrlParam对象", description = "域名查询参数")
public class CmsProductUrlParam 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 productId;
@ApiModelProperty(value = "域名类型")
private String type;
@ApiModelProperty(value = "域名")
private String domain;
@ApiModelProperty(value = "账号")
private String account;
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "商户ID")
@QueryField(type = QueryType.EQ)
private Long merchantId;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "排序(数字越小越靠前)")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
@ApiModelProperty(value = "状态, 0正常, 1待确认")
@QueryField(type = QueryType.EQ)
private Integer status;
}

View File

@@ -0,0 +1,42 @@
package com.gxwebsoft.cms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.cms.entity.CmsProduct;
import com.gxwebsoft.cms.param.CmsProductParam;
import java.util.List;
/**
* 产品Service
*
* @author 科技小王子
* @since 2024-09-27 16:03:44
*/
public interface CmsProductService extends IService<CmsProduct> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<CmsProduct>
*/
PageResult<CmsProduct> pageRel(CmsProductParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<CmsProduct>
*/
List<CmsProduct> listRel(CmsProductParam param);
/**
* 根据id查询
*
* @param productId 自增ID
* @return CmsProduct
*/
CmsProduct getByIdRel(Integer productId);
}

View File

@@ -0,0 +1,42 @@
package com.gxwebsoft.cms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.cms.entity.CmsProductSpec;
import com.gxwebsoft.cms.param.CmsProductSpecParam;
import java.util.List;
/**
* 规格Service
*
* @author 科技小王子
* @since 2024-09-27 16:03:44
*/
public interface CmsProductSpecService extends IService<CmsProductSpec> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<CmsProductSpec>
*/
PageResult<CmsProductSpec> pageRel(CmsProductSpecParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<CmsProductSpec>
*/
List<CmsProductSpec> listRel(CmsProductSpecParam param);
/**
* 根据id查询
*
* @param specId 规格ID
* @return CmsProductSpec
*/
CmsProductSpec getByIdRel(Integer specId);
}

View File

@@ -0,0 +1,42 @@
package com.gxwebsoft.cms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.cms.entity.CmsProductSpecValue;
import com.gxwebsoft.cms.param.CmsProductSpecValueParam;
import java.util.List;
/**
* 规格值Service
*
* @author 科技小王子
* @since 2024-09-27 16:03:44
*/
public interface CmsProductSpecValueService extends IService<CmsProductSpecValue> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<CmsProductSpecValue>
*/
PageResult<CmsProductSpecValue> pageRel(CmsProductSpecValueParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<CmsProductSpecValue>
*/
List<CmsProductSpecValue> listRel(CmsProductSpecValueParam param);
/**
* 根据id查询
*
* @param specValueId 规格值ID
* @return CmsProductSpecValue
*/
CmsProductSpecValue getByIdRel(Integer specValueId);
}

View File

@@ -0,0 +1,42 @@
package com.gxwebsoft.cms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.cms.entity.CmsProductUrl;
import com.gxwebsoft.cms.param.CmsProductUrlParam;
import java.util.List;
/**
* 域名Service
*
* @author 科技小王子
* @since 2024-09-27 16:03:44
*/
public interface CmsProductUrlService extends IService<CmsProductUrl> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<CmsProductUrl>
*/
PageResult<CmsProductUrl> pageRel(CmsProductUrlParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<CmsProductUrl>
*/
List<CmsProductUrl> listRel(CmsProductUrlParam param);
/**
* 根据id查询
*
* @param id 自增ID
* @return CmsProductUrl
*/
CmsProductUrl getByIdRel(Integer id);
}

View File

@@ -3,6 +3,7 @@ package com.gxwebsoft.cms.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.cms.entity.CmsDesign; import com.gxwebsoft.cms.entity.CmsDesign;
import com.gxwebsoft.cms.mapper.CmsNavigationMapper; import com.gxwebsoft.cms.mapper.CmsNavigationMapper;
@@ -17,6 +18,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@@ -34,7 +36,7 @@ public class CmsNavigationServiceImpl extends ServiceImpl<CmsNavigationMapper, C
@Override @Override
public PageResult<CmsNavigation> pageRel(CmsNavigationParam param) { public PageResult<CmsNavigation> pageRel(CmsNavigationParam param) {
PageParam<CmsNavigation, CmsNavigationParam> page = new PageParam<>(param); PageParam<CmsNavigation, CmsNavigationParam> page = new PageParam<>(param);
page.setDefaultOrder("sort_number asc,navigation_id asc"); page.setDefaultOrder("sort_number asc, position asc, navigation_id asc");
List<CmsNavigation> list = baseMapper.selectPageRel(page, param); List<CmsNavigation> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal()); return new PageResult<>(list, page.getTotal());
} }
@@ -44,7 +46,7 @@ public class CmsNavigationServiceImpl extends ServiceImpl<CmsNavigationMapper, C
List<CmsNavigation> list = baseMapper.selectListRel(param); List<CmsNavigation> list = baseMapper.selectListRel(param);
// 排序 // 排序
PageParam<CmsNavigation, CmsNavigationParam> page = new PageParam<>(); PageParam<CmsNavigation, CmsNavigationParam> page = new PageParam<>();
page.setDefaultOrder("sort_number asc,navigation_id asc"); page.setDefaultOrder("sort_number asc, position asc,navigation_id asc");
return page.sortRecords(list); return page.sortRecords(list);
} }

View File

@@ -0,0 +1,47 @@
package com.gxwebsoft.cms.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.cms.mapper.CmsProductMapper;
import com.gxwebsoft.cms.service.CmsProductService;
import com.gxwebsoft.cms.entity.CmsProduct;
import com.gxwebsoft.cms.param.CmsProductParam;
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-09-27 16:03:44
*/
@Service
public class CmsProductServiceImpl extends ServiceImpl<CmsProductMapper, CmsProduct> implements CmsProductService {
@Override
public PageResult<CmsProduct> pageRel(CmsProductParam param) {
PageParam<CmsProduct, CmsProductParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<CmsProduct> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<CmsProduct> listRel(CmsProductParam param) {
List<CmsProduct> list = baseMapper.selectListRel(param);
// 排序
PageParam<CmsProduct, CmsProductParam> page = new PageParam<>();
page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public CmsProduct getByIdRel(Integer productId) {
CmsProductParam param = new CmsProductParam();
param.setProductId(productId);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -0,0 +1,47 @@
package com.gxwebsoft.cms.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.cms.mapper.CmsProductSpecMapper;
import com.gxwebsoft.cms.service.CmsProductSpecService;
import com.gxwebsoft.cms.entity.CmsProductSpec;
import com.gxwebsoft.cms.param.CmsProductSpecParam;
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-09-27 16:03:44
*/
@Service
public class CmsProductSpecServiceImpl extends ServiceImpl<CmsProductSpecMapper, CmsProductSpec> implements CmsProductSpecService {
@Override
public PageResult<CmsProductSpec> pageRel(CmsProductSpecParam param) {
PageParam<CmsProductSpec, CmsProductSpecParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<CmsProductSpec> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<CmsProductSpec> listRel(CmsProductSpecParam param) {
List<CmsProductSpec> list = baseMapper.selectListRel(param);
// 排序
PageParam<CmsProductSpec, CmsProductSpecParam> page = new PageParam<>();
page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public CmsProductSpec getByIdRel(Integer specId) {
CmsProductSpecParam param = new CmsProductSpecParam();
param.setSpecId(specId);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -0,0 +1,47 @@
package com.gxwebsoft.cms.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.cms.mapper.CmsProductSpecValueMapper;
import com.gxwebsoft.cms.service.CmsProductSpecValueService;
import com.gxwebsoft.cms.entity.CmsProductSpecValue;
import com.gxwebsoft.cms.param.CmsProductSpecValueParam;
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-09-27 16:03:44
*/
@Service
public class CmsProductSpecValueServiceImpl extends ServiceImpl<CmsProductSpecValueMapper, CmsProductSpecValue> implements CmsProductSpecValueService {
@Override
public PageResult<CmsProductSpecValue> pageRel(CmsProductSpecValueParam param) {
PageParam<CmsProductSpecValue, CmsProductSpecValueParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<CmsProductSpecValue> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<CmsProductSpecValue> listRel(CmsProductSpecValueParam param) {
List<CmsProductSpecValue> list = baseMapper.selectListRel(param);
// 排序
PageParam<CmsProductSpecValue, CmsProductSpecValueParam> page = new PageParam<>();
page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public CmsProductSpecValue getByIdRel(Integer specValueId) {
CmsProductSpecValueParam param = new CmsProductSpecValueParam();
param.setSpecValueId(specValueId);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -0,0 +1,47 @@
package com.gxwebsoft.cms.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.cms.mapper.CmsProductUrlMapper;
import com.gxwebsoft.cms.service.CmsProductUrlService;
import com.gxwebsoft.cms.entity.CmsProductUrl;
import com.gxwebsoft.cms.param.CmsProductUrlParam;
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-09-27 16:03:44
*/
@Service
public class CmsProductUrlServiceImpl extends ServiceImpl<CmsProductUrlMapper, CmsProductUrl> implements CmsProductUrlService {
@Override
public PageResult<CmsProductUrl> pageRel(CmsProductUrlParam param) {
PageParam<CmsProductUrl, CmsProductUrlParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<CmsProductUrl> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<CmsProductUrl> listRel(CmsProductUrlParam param) {
List<CmsProductUrl> list = baseMapper.selectListRel(param);
// 排序
PageParam<CmsProductUrl, CmsProductUrlParam> page = new PageParam<>();
page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public CmsProductUrl getByIdRel(Integer id) {
CmsProductUrlParam param = new CmsProductUrlParam();
param.setId(id);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -95,7 +95,11 @@ public class MybatisPlusConfig {
"oa_app_renew", "oa_app_renew",
"oa_app_url", "oa_app_url",
"oa_app_user", "oa_app_user",
"shop_goods" "shop_goods",
"cms_product",
"cms_product_url",
"cms_product_spec",
"cms_product_spec_value"
).contains(tableName); ).contains(tableName);
} }
}; };

View File

@@ -72,6 +72,10 @@ public class CmsGenerator {
// "cms_navigation", // "cms_navigation",
// "cms_website", // "cms_website",
// "cms_website_field", // "cms_website_field",
"cms_product",
"cms_product_spec",
"cms_product_spec_value",
"cms_product_url"
}; };
// 需要去除的表前缀 // 需要去除的表前缀
private static final String[] TABLE_PREFIX = new String[]{ private static final String[] TABLE_PREFIX = new String[]{