diff --git a/src/main/java/com/gxwebsoft/cms/controller/CmsArticleController.java b/src/main/java/com/gxwebsoft/cms/controller/CmsArticleController.java index e3eaf45..1894098 100644 --- a/src/main/java/com/gxwebsoft/cms/controller/CmsArticleController.java +++ b/src/main/java/com/gxwebsoft/cms/controller/CmsArticleController.java @@ -20,7 +20,9 @@ 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; /** * 文章控制器 @@ -162,4 +164,32 @@ public class CmsArticleController extends BaseController { return success(article); } + @ApiOperation("统计信息") + @GetMapping("/data") + public ApiResult> data(CmsArticleParam param) { + Map data = new HashMap<>(); + final LambdaQueryWrapper 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); + } + } diff --git a/src/main/java/com/gxwebsoft/cms/controller/CmsProductController.java b/src/main/java/com/gxwebsoft/cms/controller/CmsProductController.java new file mode 100644 index 0000000..b0b7499 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/controller/CmsProductController.java @@ -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> page(CmsProductParam param) { + // 使用关联查询 + return success(cmsProductService.pageRel(param)); + } + + @ApiOperation("查询全部产品") + @GetMapping() + public ApiResult> list(CmsProductParam param) { + // 使用关联查询 + return success(cmsProductService.listRel(param)); + } + + @ApiOperation("根据id查询产品") + @GetMapping("/{id}") + public ApiResult 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 list) { + if (cmsProductService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + @PreAuthorize("hasAuthority('cms:cmsProduct:update')") + @OperationLog + @ApiOperation("批量修改产品") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam 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 ids) { + if (cmsProductService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("统计信息") + @GetMapping("/data") + public ApiResult> data(CmsProductSpecParam param) { + Map data = new HashMap<>(); + final LambdaQueryWrapper 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); + } +} diff --git a/src/main/java/com/gxwebsoft/cms/controller/CmsProductSpecController.java b/src/main/java/com/gxwebsoft/cms/controller/CmsProductSpecController.java new file mode 100644 index 0000000..6cb8ab7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/controller/CmsProductSpecController.java @@ -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> page(CmsProductSpecParam param) { + // 使用关联查询 + return success(cmsProductSpecService.pageRel(param)); + } + + @ApiOperation("查询全部规格") + @GetMapping() + public ApiResult> list(CmsProductSpecParam param) { + // 使用关联查询 + return success(cmsProductSpecService.listRel(param)); + } + + @PreAuthorize("hasAuthority('cms:cmsProductSpec:list')") + @OperationLog + @ApiOperation("根据id查询规格") + @GetMapping("/{id}") + public ApiResult 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 list) { + if (cmsProductSpecService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改规格") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(cmsProductSpecService, "spec_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除规格") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (cmsProductSpecService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/controller/CmsProductSpecValueController.java b/src/main/java/com/gxwebsoft/cms/controller/CmsProductSpecValueController.java new file mode 100644 index 0000000..a9e81d2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/controller/CmsProductSpecValueController.java @@ -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> page(CmsProductSpecValueParam param) { + // 使用关联查询 + return success(cmsProductSpecValueService.pageRel(param)); + } + + @ApiOperation("查询全部规格值") + @GetMapping() + public ApiResult> list(CmsProductSpecValueParam param) { + // 使用关联查询 + return success(cmsProductSpecValueService.listRel(param)); + } + + @PreAuthorize("hasAuthority('cms:cmsProductSpecValue:list')") + @OperationLog + @ApiOperation("根据id查询规格值") + @GetMapping("/{id}") + public ApiResult 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 list) { + if (cmsProductSpecValueService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改规格值") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(cmsProductSpecValueService, "spec_value_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除规格值") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (cmsProductSpecValueService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/controller/CmsProductUrlController.java b/src/main/java/com/gxwebsoft/cms/controller/CmsProductUrlController.java new file mode 100644 index 0000000..e061891 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/controller/CmsProductUrlController.java @@ -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> page(CmsProductUrlParam param) { + // 使用关联查询 + return success(cmsProductUrlService.pageRel(param)); + } + + @ApiOperation("查询全部域名") + @GetMapping() + public ApiResult> list(CmsProductUrlParam param) { + // 使用关联查询 + return success(cmsProductUrlService.listRel(param)); + } + + @PreAuthorize("hasAuthority('cms:cmsProductUrl:list')") + @OperationLog + @ApiOperation("根据id查询域名") + @GetMapping("/{id}") + public ApiResult 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 list) { + if (cmsProductUrlService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改域名") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(cmsProductUrlService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除域名") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (cmsProductUrlService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/entity/CmsArticle.java b/src/main/java/com/gxwebsoft/cms/entity/CmsArticle.java index 51d0e4d..2d660f9 100644 --- a/src/main/java/com/gxwebsoft/cms/entity/CmsArticle.java +++ b/src/main/java/com/gxwebsoft/cms/entity/CmsArticle.java @@ -113,6 +113,9 @@ public class CmsArticle implements Serializable { @ApiModelProperty(value = "用户ID") private Integer userId; + @ApiModelProperty(value = "商户ID") + private Integer merchantId; + @ApiModelProperty(value = "昵称") @TableField(exist = false) private String nickname; diff --git a/src/main/java/com/gxwebsoft/cms/entity/CmsProduct.java b/src/main/java/com/gxwebsoft/cms/entity/CmsProduct.java new file mode 100644 index 0000000..a175739 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/entity/CmsProduct.java @@ -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; + +} diff --git a/src/main/java/com/gxwebsoft/cms/entity/CmsProductSpec.java b/src/main/java/com/gxwebsoft/cms/entity/CmsProductSpec.java new file mode 100644 index 0000000..260aa4a --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/entity/CmsProductSpec.java @@ -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; + +} diff --git a/src/main/java/com/gxwebsoft/cms/entity/CmsProductSpecValue.java b/src/main/java/com/gxwebsoft/cms/entity/CmsProductSpecValue.java new file mode 100644 index 0000000..970846d --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/entity/CmsProductSpecValue.java @@ -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; + +} diff --git a/src/main/java/com/gxwebsoft/cms/entity/CmsProductUrl.java b/src/main/java/com/gxwebsoft/cms/entity/CmsProductUrl.java new file mode 100644 index 0000000..b8b8738 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/entity/CmsProductUrl.java @@ -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; + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/CmsProductMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/CmsProductMapper.java new file mode 100644 index 0000000..5abc070 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/CmsProductMapper.java @@ -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 { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CmsProductParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CmsProductParam param); + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/CmsProductSpecMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/CmsProductSpecMapper.java new file mode 100644 index 0000000..ce73ad8 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/CmsProductSpecMapper.java @@ -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 { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CmsProductSpecParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CmsProductSpecParam param); + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/CmsProductSpecValueMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/CmsProductSpecValueMapper.java new file mode 100644 index 0000000..9885e18 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/CmsProductSpecValueMapper.java @@ -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 { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CmsProductSpecValueParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CmsProductSpecValueParam param); + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/CmsProductUrlMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/CmsProductUrlMapper.java new file mode 100644 index 0000000..5bd2486 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/CmsProductUrlMapper.java @@ -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 { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") CmsProductUrlParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") CmsProductUrlParam param); + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsArticleMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsArticleMapper.xml index 3a7cd94..01262fd 100644 --- a/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsArticleMapper.xml +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsArticleMapper.xml @@ -6,9 +6,9 @@ SELECT a.*,b.title as categoryName,b.parent_Id as parentId,c.title as parentName,d.nickname,d.avatar FROM cms_article a - LEFT JOIN cms_article_category b ON a.category_id = b.category_id - LEFT JOIN cms_article_category c ON c.category_id = b.parent_id - LEFT JOIN sys_user d ON d.user_id = a.user_id + LEFT JOIN cms_navigation b ON a.category_id = b.navigation_id + LEFT JOIN cms_navigation c ON b.parent_id = c.navigation_id + LEFT JOIN sys_user d ON a.user_id = d.user_id AND a.article_id = #{param.articleId} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsNavigationMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsNavigationMapper.xml index c7a993a..0a14e5e 100644 --- a/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsNavigationMapper.xml +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsNavigationMapper.xml @@ -109,6 +109,11 @@ AND a.create_time <= #{param.createTimeEnd} + + AND (a.path LIKE CONCAT('%', #{param.keywords}, '%') + OR a.title LIKE CONCAT('%', #{param.keywords}, '%') + ) + diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductMapper.xml new file mode 100644 index 0000000..dc2a719 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductMapper.xml @@ -0,0 +1,110 @@ + + + + + + + SELECT a.* + FROM cms_product a + + + AND a.product_id = #{param.productId} + + + AND a.type = #{param.type} + + + AND a.code LIKE CONCAT('%', #{param.code}, '%') + + + AND a.title LIKE CONCAT('%', #{param.title}, '%') + + + AND a.image LIKE CONCAT('%', #{param.image}, '%') + + + AND a.content LIKE CONCAT('%', #{param.content}, '%') + + + AND a.parent_id = #{param.parentId} + + + AND a.category_id = #{param.categoryId} + + + AND a.specs = #{param.specs} + + + AND a.position LIKE CONCAT('%', #{param.position}, '%') + + + AND a.unit_name LIKE CONCAT('%', #{param.unitName}, '%') + + + AND a.price = #{param.price} + + + AND a.sale_price = #{param.salePrice} + + + AND a.deduct_stock_type = #{param.deductStockType} + + + AND a.files LIKE CONCAT('%', #{param.files}, '%') + + + AND a.sales = #{param.sales} + + + AND a.stock = #{param.stock} + + + AND a.gain_integral = #{param.gainIntegral} + + + AND a.recommend = #{param.recommend} + + + AND a.merchant_id = #{param.merchantId} + + + AND a.is_show = #{param.isShow} + + + AND a.status = #{param.status} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductSpecMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductSpecMapper.xml new file mode 100644 index 0000000..08ee497 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductSpecMapper.xml @@ -0,0 +1,53 @@ + + + + + + + SELECT a.* + FROM cms_product_spec a + + + AND a.spec_id = #{param.specId} + + + AND a.spec_name LIKE CONCAT('%', #{param.specName}, '%') + + + AND a.spec_value LIKE CONCAT('%', #{param.specValue}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.updater = #{param.updater} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductSpecValueMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductSpecValueMapper.xml new file mode 100644 index 0000000..acc1723 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductSpecValueMapper.xml @@ -0,0 +1,44 @@ + + + + + + + SELECT a.* + FROM cms_product_spec_value a + + + AND a.spec_value_id = #{param.specValueId} + + + AND a.spec_id = #{param.specId} + + + AND a.spec_value LIKE CONCAT('%', #{param.specValue}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductUrlMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductUrlMapper.xml new file mode 100644 index 0000000..fb42be5 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsProductUrlMapper.xml @@ -0,0 +1,59 @@ + + + + + + + SELECT a.* + FROM cms_product_url a + + + AND a.id = #{param.id} + + + AND a.product_id = #{param.productId} + + + AND a.type LIKE CONCAT('%', #{param.type}, '%') + + + AND a.domain LIKE CONCAT('%', #{param.domain}, '%') + + + AND a.account LIKE CONCAT('%', #{param.account}, '%') + + + AND a.password LIKE CONCAT('%', #{param.password}, '%') + + + AND a.merchant_id = #{param.merchantId} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.status = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/cms/param/CmsProductParam.java b/src/main/java/com/gxwebsoft/cms/param/CmsProductParam.java new file mode 100644 index 0000000..28add14 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/param/CmsProductParam.java @@ -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; + +} diff --git a/src/main/java/com/gxwebsoft/cms/param/CmsProductSpecParam.java b/src/main/java/com/gxwebsoft/cms/param/CmsProductSpecParam.java new file mode 100644 index 0000000..0ffb5d6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/param/CmsProductSpecParam.java @@ -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; + +} diff --git a/src/main/java/com/gxwebsoft/cms/param/CmsProductSpecValueParam.java b/src/main/java/com/gxwebsoft/cms/param/CmsProductSpecValueParam.java new file mode 100644 index 0000000..88f10e9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/param/CmsProductSpecValueParam.java @@ -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; + +} diff --git a/src/main/java/com/gxwebsoft/cms/param/CmsProductUrlParam.java b/src/main/java/com/gxwebsoft/cms/param/CmsProductUrlParam.java new file mode 100644 index 0000000..e808fe4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/param/CmsProductUrlParam.java @@ -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; + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/CmsProductService.java b/src/main/java/com/gxwebsoft/cms/service/CmsProductService.java new file mode 100644 index 0000000..00ef8bd --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/CmsProductService.java @@ -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 { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CmsProductParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CmsProductParam param); + + /** + * 根据id查询 + * + * @param productId 自增ID + * @return CmsProduct + */ + CmsProduct getByIdRel(Integer productId); + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/CmsProductSpecService.java b/src/main/java/com/gxwebsoft/cms/service/CmsProductSpecService.java new file mode 100644 index 0000000..d2beb35 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/CmsProductSpecService.java @@ -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 { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CmsProductSpecParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CmsProductSpecParam param); + + /** + * 根据id查询 + * + * @param specId 规格ID + * @return CmsProductSpec + */ + CmsProductSpec getByIdRel(Integer specId); + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/CmsProductSpecValueService.java b/src/main/java/com/gxwebsoft/cms/service/CmsProductSpecValueService.java new file mode 100644 index 0000000..29a94c0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/CmsProductSpecValueService.java @@ -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 { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CmsProductSpecValueParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CmsProductSpecValueParam param); + + /** + * 根据id查询 + * + * @param specValueId 规格值ID + * @return CmsProductSpecValue + */ + CmsProductSpecValue getByIdRel(Integer specValueId); + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/CmsProductUrlService.java b/src/main/java/com/gxwebsoft/cms/service/CmsProductUrlService.java new file mode 100644 index 0000000..6501378 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/CmsProductUrlService.java @@ -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 { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(CmsProductUrlParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(CmsProductUrlParam param); + + /** + * 根据id查询 + * + * @param id 自增ID + * @return CmsProductUrl + */ + CmsProductUrl getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/CmsNavigationServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/CmsNavigationServiceImpl.java index 73671ac..64a07ae 100644 --- a/src/main/java/com/gxwebsoft/cms/service/impl/CmsNavigationServiceImpl.java +++ b/src/main/java/com/gxwebsoft/cms/service/impl/CmsNavigationServiceImpl.java @@ -3,6 +3,7 @@ package com.gxwebsoft.cms.service.impl; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; 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.gxwebsoft.cms.entity.CmsDesign; import com.gxwebsoft.cms.mapper.CmsNavigationMapper; @@ -17,6 +18,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.List; /** @@ -34,7 +36,7 @@ public class CmsNavigationServiceImpl extends ServiceImpl pageRel(CmsNavigationParam param) { PageParam page = new PageParam<>(param); - page.setDefaultOrder("sort_number asc,navigation_id asc"); + page.setDefaultOrder("sort_number asc, position asc, navigation_id asc"); List list = baseMapper.selectPageRel(page, param); return new PageResult<>(list, page.getTotal()); } @@ -44,7 +46,7 @@ public class CmsNavigationServiceImpl extends ServiceImpl list = baseMapper.selectListRel(param); // 排序 PageParam 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); } diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductServiceImpl.java new file mode 100644 index 0000000..2233554 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductServiceImpl.java @@ -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 implements CmsProductService { + + @Override + public PageResult pageRel(CmsProductParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CmsProductParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam 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)); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductSpecServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductSpecServiceImpl.java new file mode 100644 index 0000000..6532eba --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductSpecServiceImpl.java @@ -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 implements CmsProductSpecService { + + @Override + public PageResult pageRel(CmsProductSpecParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CmsProductSpecParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam 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)); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductSpecValueServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductSpecValueServiceImpl.java new file mode 100644 index 0000000..c004b49 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductSpecValueServiceImpl.java @@ -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 implements CmsProductSpecValueService { + + @Override + public PageResult pageRel(CmsProductSpecValueParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CmsProductSpecValueParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam 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)); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductUrlServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductUrlServiceImpl.java new file mode 100644 index 0000000..a92eed8 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/impl/CmsProductUrlServiceImpl.java @@ -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 implements CmsProductUrlService { + + @Override + public PageResult pageRel(CmsProductUrlParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(CmsProductUrlParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam 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)); + } + +} diff --git a/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java b/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java index e2b81e5..19edc94 100644 --- a/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java +++ b/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java @@ -95,7 +95,11 @@ public class MybatisPlusConfig { "oa_app_renew", "oa_app_url", "oa_app_user", - "shop_goods" + "shop_goods", + "cms_product", + "cms_product_url", + "cms_product_spec", + "cms_product_spec_value" ).contains(tableName); } }; diff --git a/src/test/java/com/gxwebsoft/generator/CmsGenerator.java b/src/test/java/com/gxwebsoft/generator/CmsGenerator.java index 00e19ec..86c5899 100644 --- a/src/test/java/com/gxwebsoft/generator/CmsGenerator.java +++ b/src/test/java/com/gxwebsoft/generator/CmsGenerator.java @@ -72,6 +72,10 @@ public class CmsGenerator { // "cms_navigation", // "cms_website", // "cms_website_field", + "cms_product", + "cms_product_spec", + "cms_product_spec_value", + "cms_product_url" }; // 需要去除的表前缀 private static final String[] TABLE_PREFIX = new String[]{