Merge branch 'feature/resource' of https://gitea.qinmian.online/CY/mcwl-ai into preview
# Conflicts: # mcwl-pay/src/main/java/com/mcwl/pay/service/OrderTradeService.java # mcwl-pay/src/main/java/com/mcwl/pay/service/impl/OrderTradeServiceImpl.java # mcwl-system/src/main/resources/mapper/system/SysUserMapper.xmlfeature/comment
commit
50c89af2c2
|
@ -20,18 +20,8 @@ public class McWlApplication
|
||||||
{
|
{
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
|
||||||
SpringApplication.run(McWlApplication.class, args);
|
SpringApplication.run(McWlApplication.class, args);
|
||||||
System.out.println("(♥◠‿◠)ノ゙ 魔创未来启动成功 ლ(´ڡ`ლ)゙ \n" +
|
System.out.println("(♥◠‿◠)ノ゙ 魔创未来启动成功 ლ(´ڡ`ლ)゙ ");
|
||||||
" .-------. ____ __ \n" +
|
|
||||||
" | _ _ \\ \\ \\ / / \n" +
|
|
||||||
" | ( ' ) | \\ _. / ' \n" +
|
|
||||||
" |(_ o _) / _( )_ .' \n" +
|
|
||||||
" | (_,_).' __ ___(_ o _)' \n" +
|
|
||||||
" | |\\ \\ | || |(_,_)' \n" +
|
|
||||||
" | | \\ `' /| `-' / \n" +
|
|
||||||
" | | \\ / \\ / \n" +
|
|
||||||
" ''-' `'-' `-..-' ");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 序列化枚举值为前端返回值
|
// 序列化枚举值为前端返回值
|
||||||
|
|
|
@ -1,77 +0,0 @@
|
||||||
package com.mcwl.web.controller.comment;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mcwl.comment.domain.ProductCommentConditionEntity;
|
|
||||||
import com.mcwl.comment.domain.ProductCommentEntity;
|
|
||||||
import com.mcwl.comment.service.impl.CommentServiceImpl;
|
|
||||||
import com.mcwl.common.utils.ResponsePageEntity;
|
|
||||||
import com.mcwl.resource.domain.MallProduct;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author:ChenYan
|
|
||||||
* @Project:McWl
|
|
||||||
* @Package:com.mcwl.web.controller.comment
|
|
||||||
* @Filename:CommentController
|
|
||||||
* @Description TODO
|
|
||||||
* @Date:2025/1/4 18:56
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/comment")
|
|
||||||
public class CommentController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private CommentServiceImpl commentService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询商品评论信息
|
|
||||||
*
|
|
||||||
* @param id 系统ID
|
|
||||||
* @return 商品评论信息
|
|
||||||
*/
|
|
||||||
@GetMapping("/findById")
|
|
||||||
public MallProduct findById(Long id) {
|
|
||||||
return commentService.findById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加商品评论
|
|
||||||
*
|
|
||||||
* @param productCommentEntity 商品评论实体
|
|
||||||
* @return 影响行数
|
|
||||||
*/
|
|
||||||
@PostMapping("/insert")
|
|
||||||
public int insert(@RequestBody ProductCommentEntity productCommentEntity) {
|
|
||||||
return commentService.insert(productCommentEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改商品评论
|
|
||||||
*
|
|
||||||
* @param productCommentEntity 商品评论实体
|
|
||||||
* @return 影响行数
|
|
||||||
*/
|
|
||||||
@PostMapping("/update")
|
|
||||||
public int update(@RequestBody ProductCommentEntity productCommentEntity) {
|
|
||||||
return commentService.update(productCommentEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除商品评论
|
|
||||||
*
|
|
||||||
* @param ids 商品评论ID集合
|
|
||||||
* @return 影响行数
|
|
||||||
*/
|
|
||||||
@PostMapping("/deleteByIds")
|
|
||||||
public int deleteByIds(@RequestBody @NotNull List<Long> ids) {
|
|
||||||
return commentService.deleteByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -5,8 +5,7 @@ import com.mcwl.common.core.controller.BaseController;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.common.domain.IdsParam;
|
import com.mcwl.common.domain.IdsParam;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
import com.mcwl.resource.domain.MallProduct;
|
|
||||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||||
import com.mcwl.resource.service.MallProductService;
|
import com.mcwl.resource.service.MallProductService;
|
||||||
import com.mcwl.web.controller.common.OssUtil;
|
import com.mcwl.web.controller.common.OssUtil;
|
||||||
|
@ -38,6 +37,7 @@ public class MallProductController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*
|
*
|
||||||
* 图片
|
* 图片
|
||||||
|
@ -86,11 +86,11 @@ public class MallProductController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 查询商品列表
|
* 查询商品列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@PostMapping("/list")
|
||||||
public TableDataInfo list(MallProduct sysJob)
|
public TableDataInfo list(@RequestBody ModelProduct mallProduct)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
List<MallProduct> list = mallProductRuleInfoService.selectMallProductList(sysJob);
|
List<ModelProduct> list = mallProductRuleInfoService.selectMallProductList(mallProduct);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,35 +99,33 @@ public class MallProductController extends BaseController {
|
||||||
* 获取详细信息
|
* 获取详细信息
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long jobId)
|
public AjaxResult getInfo(@PathVariable("id") Long Id)
|
||||||
{
|
{
|
||||||
return success(mallProductRuleInfoService.selectMallProductById(jobId));
|
return success(mallProductRuleInfoService.getById(Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public AjaxResult add(@RequestBody MallProduct mallProduct)
|
public AjaxResult add(@RequestBody ModelProduct mallProduct)
|
||||||
{
|
{
|
||||||
mallProduct.setUserId(SecurityUtils.getUserId());
|
|
||||||
mallProduct.setCreateBy(getUsername());
|
|
||||||
return toAjax(mallProductRuleInfoService.insertMallProduct(mallProduct));
|
return toAjax(mallProductRuleInfoService.insertMallProduct(mallProduct));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
@PutMapping("/upda")
|
@PutMapping("/upda")
|
||||||
public AjaxResult edit(@RequestBody MallProduct mallProduct)
|
public AjaxResult edit(@RequestBody ModelProduct mallProduct)
|
||||||
{
|
{
|
||||||
mallProduct.setUpdateBy(getUsername());
|
mallProduct.setUpdateBy(getUsername());
|
||||||
return toAjax(mallProductRuleInfoService.updateMallProduct(mallProduct));
|
return toAjax(mallProductRuleInfoService.updateMallProduct(mallProduct));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
|
@ -145,7 +143,7 @@ public class MallProductController extends BaseController {
|
||||||
@PostMapping("/selectByUserId")
|
@PostMapping("/selectByUserId")
|
||||||
public AjaxResult selectByUserId(@RequestBody MallProductVo mallProductVo){
|
public AjaxResult selectByUserId(@RequestBody MallProductVo mallProductVo){
|
||||||
|
|
||||||
Page<MallProduct> mallProductList = mallProductRuleInfoService.selectByUserId(mallProductVo);
|
Page<ModelProduct> mallProductList = mallProductRuleInfoService.selectByUserId(mallProductVo);
|
||||||
return AjaxResult.success(mallProductList);
|
return AjaxResult.success(mallProductList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.mcwl.web.controller.resource;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.mcwl.common.annotation.RepeatSubmit;
|
import com.mcwl.common.annotation.RepeatSubmit;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.resource.domain.MallProduct;
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||||
import com.mcwl.resource.service.MallProductLikeService;
|
import com.mcwl.resource.service.MallProductLikeService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -31,7 +31,7 @@ public class MallProductLikeController {
|
||||||
@PostMapping("/selectByUserLike")
|
@PostMapping("/selectByUserLike")
|
||||||
public AjaxResult selectByUserLike(@RequestBody MallProductVo mallProductVo){
|
public AjaxResult selectByUserLike(@RequestBody MallProductVo mallProductVo){
|
||||||
|
|
||||||
Page<MallProduct> mallProductPage = mallProductLikeService.selectByUserLike(mallProductVo);
|
Page<ModelProduct> mallProductPage = mallProductLikeService.selectByUserLike(mallProductVo);
|
||||||
return AjaxResult.success(mallProductPage);
|
return AjaxResult.success(mallProductPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
package com.mcwl.comment.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.mcwl.common.core.domain.BaseEntity;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author:ChenYan
|
|
||||||
* @Project:McWl
|
|
||||||
* @Package:com.mcwl.comment.domain
|
|
||||||
* @Filename:Comment
|
|
||||||
* @Description 评论表
|
|
||||||
* @Date:2025/1/4 18:47
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Data
|
|
||||||
@TableName("mall_product_comment")
|
|
||||||
public class Comment extends BaseEntity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ID
|
|
||||||
*/
|
|
||||||
@TableId
|
|
||||||
private Long id;
|
|
||||||
/**
|
|
||||||
* 父评论ID
|
|
||||||
*/
|
|
||||||
private String parentId;
|
|
||||||
/**
|
|
||||||
* 商品ID
|
|
||||||
*/
|
|
||||||
private String productId;
|
|
||||||
/**
|
|
||||||
* 用户ID
|
|
||||||
*/
|
|
||||||
private String userId;
|
|
||||||
/**
|
|
||||||
* 评论内容
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
/**
|
|
||||||
* 评分
|
|
||||||
*/
|
|
||||||
private String rating;
|
|
||||||
/**
|
|
||||||
* 删除标志(0代表存在 2代表删除)
|
|
||||||
*/
|
|
||||||
private String delFlag;
|
|
||||||
}
|
|
|
@ -1,56 +0,0 @@
|
||||||
package com.mcwl.comment.domain;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品评论查询条件实体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class ProductCommentConditionEntity extends RequestConditionEntity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ID集合
|
|
||||||
*/
|
|
||||||
private List<Long> idList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ID
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
/**
|
|
||||||
* 父评论ID
|
|
||||||
*/
|
|
||||||
private Long parentId;
|
|
||||||
/**
|
|
||||||
* 商品ID
|
|
||||||
*/
|
|
||||||
private Long productId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品ID集合
|
|
||||||
*/
|
|
||||||
private List<Long> productIdList;
|
|
||||||
/**
|
|
||||||
* 用户ID
|
|
||||||
*/
|
|
||||||
private Long userId;
|
|
||||||
/**
|
|
||||||
* 评论内容
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
/**
|
|
||||||
* 评分
|
|
||||||
*/
|
|
||||||
private Integer rating;
|
|
||||||
/**
|
|
||||||
* 删除标志(0代表存在 2代表删除)
|
|
||||||
*/
|
|
||||||
private String delFlag;
|
|
||||||
// /**
|
|
||||||
// * 评论类型
|
|
||||||
// */
|
|
||||||
// private Integer type;
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
package com.mcwl.comment.domain;
|
|
||||||
|
|
||||||
import com.mcwl.common.core.domain.BaseEntity;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author:ChenYan
|
|
||||||
* @Project:McWl
|
|
||||||
* @Package:com.mcwl.comment.domain
|
|
||||||
* @Filename:ProductCommentEntity
|
|
||||||
* @Description 评论实体
|
|
||||||
* @Date:2025/1/6 13:21
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Data
|
|
||||||
public class ProductCommentEntity extends BaseEntity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父评论ID
|
|
||||||
*/
|
|
||||||
private Long parentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品ID
|
|
||||||
*/
|
|
||||||
private Long productId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户ID
|
|
||||||
*/
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 评论内容
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 评分
|
|
||||||
*/
|
|
||||||
private Integer rating;
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 评论类型
|
|
||||||
// */
|
|
||||||
// private Integer type;
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
package com.mcwl.comment.domain;
|
|
||||||
|
|
||||||
import com.mcwl.common.utils.RequestPageEntity;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求条件实体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class RequestConditionEntity extends RequestPageEntity {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建日期范围
|
|
||||||
*/
|
|
||||||
@ApiModelProperty("创建日期范围")
|
|
||||||
private List<String> betweenTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建开始时间
|
|
||||||
*/
|
|
||||||
private String createBeginTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建结束时间
|
|
||||||
*/
|
|
||||||
private String createEndTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义excel表头列表
|
|
||||||
*/
|
|
||||||
private List<String> customizeColumnNameList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询条件
|
|
||||||
*/
|
|
||||||
private String blurry;
|
|
||||||
}
|
|
|
@ -1,72 +0,0 @@
|
||||||
package com.mcwl.comment.domain;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页请求实体
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Data
|
|
||||||
public class RequestPageEntity implements Serializable {
|
|
||||||
|
|
||||||
private static final int DEFAULT_PAGE_SIZE = 10;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页码,默认从一页开始
|
|
||||||
*/
|
|
||||||
private Integer pageNo = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 每页大小,默认一页查询10条数据
|
|
||||||
*/
|
|
||||||
private Integer pageSize = DEFAULT_PAGE_SIZE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序字段
|
|
||||||
*/
|
|
||||||
private List<String> sortField;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取分页开始位置
|
|
||||||
*
|
|
||||||
* @return 分页开始位置
|
|
||||||
*/
|
|
||||||
public Integer getPageBegin() {
|
|
||||||
if (Objects.isNull(this.pageNo) || this.pageNo <= 0) {
|
|
||||||
this.pageNo = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Objects.isNull(this.pageSize)) {
|
|
||||||
this.pageSize = DEFAULT_PAGE_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (this.pageNo - 1) * this.pageSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户自定义排序集合
|
|
||||||
*
|
|
||||||
* @return 排序集合实体
|
|
||||||
*/
|
|
||||||
public String getSortString() {
|
|
||||||
List<String> sortField = this.getSortField();
|
|
||||||
if (CollectionUtil.isEmpty(sortField)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
StringBuilder sortBuilder = new StringBuilder();
|
|
||||||
for (String field : sortField) {
|
|
||||||
String[] values = field.split(",");
|
|
||||||
sortBuilder.append(String.format("%s %s", values[0], values[1])).append(",");
|
|
||||||
}
|
|
||||||
return sortBuilder.deleteCharAt(sortBuilder.length() - 1).toString();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
package com.mcwl.comment.mapper;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mcwl.comment.domain.ProductCommentConditionEntity;
|
|
||||||
import com.mcwl.comment.domain.ProductCommentEntity;
|
|
||||||
import com.mcwl.common.web.BaseMapper;
|
|
||||||
import com.mcwl.resource.domain.MallProduct;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author:ChenYan
|
|
||||||
* @Project:McWl
|
|
||||||
* @Package:com.mcwl.comment.mapper
|
|
||||||
* @Filename:CommentMapper
|
|
||||||
* @Description TODO
|
|
||||||
* @Date:2025/1/4 19:04
|
|
||||||
*/
|
|
||||||
public interface CommentMapper extends BaseMapper<ProductCommentEntity, ProductCommentConditionEntity> {
|
|
||||||
|
|
||||||
MallProduct findById(@Param("id") Long id);
|
|
||||||
|
|
||||||
int insert(ProductCommentEntity productCommentEntity);
|
|
||||||
|
|
||||||
int upda(ProductCommentEntity productCommentEntity);
|
|
||||||
|
|
||||||
List<ProductCommentEntity> findByIds(List<Long> ids);
|
|
||||||
|
|
||||||
int deleteByIds(List<Long> ids, ProductCommentEntity productCommentEntity);
|
|
||||||
}
|
|
|
@ -1,88 +0,0 @@
|
||||||
package com.mcwl.comment.service.impl;
|
|
||||||
|
|
||||||
|
|
||||||
import com.mcwl.comment.domain.ProductCommentConditionEntity;
|
|
||||||
import com.mcwl.comment.domain.ProductCommentEntity;
|
|
||||||
import com.mcwl.comment.mapper.CommentMapper;
|
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
|
||||||
import com.mcwl.common.utils.AssertUtil;
|
|
||||||
import com.mcwl.common.utils.FillUserUtil;
|
|
||||||
import com.mcwl.common.utils.ResponsePageEntity;
|
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
|
||||||
import com.mcwl.common.utils.bean.BaseService;
|
|
||||||
|
|
||||||
import com.mcwl.common.web.BaseMapper;
|
|
||||||
import com.mcwl.resource.domain.MallProduct;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import static com.mcwl.common.utils.SecurityUtils.getUsername;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author:ChenYan
|
|
||||||
* @Project:McWl
|
|
||||||
* @Package:com.mcwl.comment.service.impl
|
|
||||||
* @Filename:CommentServiceImpl
|
|
||||||
* @Description TODO
|
|
||||||
* @Date:2025/1/4 19:04
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CommentServiceImpl extends BaseService<ProductCommentEntity, ProductCommentConditionEntity> {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private CommentMapper commentMapper;
|
|
||||||
|
|
||||||
|
|
||||||
public MallProduct findById(Long id) {
|
|
||||||
return commentMapper.findById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public int insert(ProductCommentEntity productCommentEntity) {
|
|
||||||
// 获取当前用户
|
|
||||||
Long userId = SecurityUtils.getUserId();
|
|
||||||
productCommentEntity.setUserId(userId);
|
|
||||||
productCommentEntity.setCreateBy(getUsername());
|
|
||||||
checkParam(productCommentEntity);
|
|
||||||
return commentMapper.insert(productCommentEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public int update(ProductCommentEntity productCommentEntity) {
|
|
||||||
// 获取当前用户
|
|
||||||
Long userId = SecurityUtils.getUserId();
|
|
||||||
productCommentEntity.setUserId(userId);
|
|
||||||
productCommentEntity.setUpdateBy(getUsername());
|
|
||||||
checkParam(productCommentEntity);
|
|
||||||
return commentMapper.upda(productCommentEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public int deleteByIds(List<Long> ids) {
|
|
||||||
List<ProductCommentEntity> entities = commentMapper.findByIds(ids);
|
|
||||||
AssertUtil.notEmpty(entities, "商品评论已被删除");
|
|
||||||
|
|
||||||
ProductCommentEntity entity = new ProductCommentEntity();
|
|
||||||
FillUserUtil.fillUpdateUserInfo(entity);
|
|
||||||
return commentMapper.deleteByIds(ids, entity);
|
|
||||||
}
|
|
||||||
private void checkParam(ProductCommentEntity productCommentEntity) {
|
|
||||||
if (Objects.nonNull(productCommentEntity.getParentId()) && productCommentEntity.getParentId() > 0) {
|
|
||||||
MallProduct productEntity = commentMapper.findById(productCommentEntity.getParentId());
|
|
||||||
AssertUtil.notNull(productEntity, "该父评论在系统中不存在");
|
|
||||||
}
|
|
||||||
|
|
||||||
MallProduct userEntity = commentMapper.findById(productCommentEntity.getUserId());
|
|
||||||
AssertUtil.notNull(userEntity, "该用户在系统中不存在");
|
|
||||||
|
|
||||||
MallProduct productEntity = commentMapper.findById(productCommentEntity.getProductId());
|
|
||||||
AssertUtil.notNull(productEntity, "该商品在系统中不存在");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected BaseMapper getBaseMapper() {
|
|
||||||
return commentMapper;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -9,67 +9,30 @@
|
||||||
values (#{id}, #{parentId}, #{productId}, #{userId}, #{content}, #{rating}, #{createBy}, #{createTime},
|
values (#{id}, #{parentId}, #{productId}, #{userId}, #{content}, #{rating}, #{createBy}, #{createTime},
|
||||||
#{updateBy}, #{updateTime}, #{remark}, #{delFlag})
|
#{updateBy}, #{updateTime}, #{remark}, #{delFlag})
|
||||||
</insert>
|
</insert>
|
||||||
<update id="upda">
|
<update id="upda"></update>
|
||||||
update mall_product_comment
|
|
||||||
<set>
|
|
||||||
<if test="parentId != null">
|
|
||||||
parent_id = #{parentId},
|
|
||||||
</if>
|
|
||||||
<if test="productId != null">
|
|
||||||
product_id = #{productId},
|
|
||||||
</if>
|
|
||||||
<if test="userId != null">
|
|
||||||
user_id = #{userId},
|
|
||||||
</if>
|
|
||||||
<if test="content != null">
|
|
||||||
content = #{content},
|
|
||||||
</if>
|
|
||||||
<if test="rating !=null">
|
|
||||||
rating = #{rating},
|
|
||||||
</if>
|
|
||||||
<if test="createBy != null">
|
|
||||||
create_by = #{createBy},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
create_time = #{createTime},
|
|
||||||
</if>
|
|
||||||
<if test="updateBy != null">
|
|
||||||
update_by = #{updateBy},
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
update_time = #{updateTime},
|
|
||||||
</if>
|
|
||||||
<if test="remark != null">
|
|
||||||
remark = #{remark},
|
|
||||||
</if>
|
|
||||||
<if test="delFlag != null">
|
|
||||||
del_flag = #{delFlag},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="deleteByIds">
|
<delete id="deleteByIds">
|
||||||
delete
|
delete
|
||||||
from mall_product_comment
|
from model
|
||||||
where id in
|
where id in
|
||||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
<select id="findById" resultType="com.mcwl.resource.domain.MallProduct">
|
<select id="findById" resultType="com.mcwl.resource.domain.ModelProduct">
|
||||||
select productId,
|
select
|
||||||
userId,
|
id,
|
||||||
productName,
|
parent_id,
|
||||||
detail,
|
product_id,
|
||||||
model,
|
user_id,
|
||||||
amount,
|
content,
|
||||||
status,
|
create_by,
|
||||||
name,
|
create_time,
|
||||||
url,
|
update_by,
|
||||||
zipUrl,
|
update_time,
|
||||||
delFlag
|
remark,
|
||||||
from mall_product
|
del_flag
|
||||||
|
from model
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="findByIds" resultType="com.mcwl.comment.domain.ProductCommentEntity">
|
<select id="findByIds" resultType="com.mcwl.comment.domain.ProductCommentEntity">
|
||||||
|
@ -79,7 +42,6 @@
|
||||||
product_id,
|
product_id,
|
||||||
user_id,
|
user_id,
|
||||||
content,
|
content,
|
||||||
rating,
|
|
||||||
create_by,
|
create_by,
|
||||||
create_time,
|
create_time,
|
||||||
update_by,
|
update_by,
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.mcwl.common.constant;
|
||||||
|
|
||||||
|
public class ShopCodeConstants {
|
||||||
|
/**
|
||||||
|
* 模型编号
|
||||||
|
*/
|
||||||
|
public static final String MODEL = "model-";
|
||||||
|
/**
|
||||||
|
* 工作流cf编号
|
||||||
|
*/
|
||||||
|
public static final String CF = "cf-";
|
||||||
|
}
|
|
@ -58,6 +58,9 @@ public class SysUser extends BaseEntity
|
||||||
/** 密码 */
|
/** 密码 */
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
/** 钱包 */
|
||||||
|
private Long wallet;
|
||||||
|
|
||||||
/** 帐号状态(0正常 1停用) */
|
/** 帐号状态(0正常 1停用) */
|
||||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
|
@ -49,6 +49,10 @@
|
||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
<version>${mybatis-plus.version}</version>
|
<version>${mybatis-plus.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mcwl</groupId>
|
||||||
|
<artifactId>mcwl-system</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -26,4 +26,5 @@ public interface OrderTradeService extends IService<OrderTrade> {
|
||||||
|
|
||||||
|
|
||||||
void orderHandler(OrderTrade orderTrade, String suffix, Map<String, String> params);
|
void orderHandler(OrderTrade orderTrade, String suffix, Map<String, String> params);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,31 +5,17 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.mcwl.common.core.domain.entity.SysUser;
|
import com.mcwl.common.core.domain.entity.SysUser;
|
||||||
import com.mcwl.common.core.redis.RedisCache;
|
import com.mcwl.common.core.redis.RedisCache;
|
||||||
import com.mcwl.common.domain.IdsParam;
|
import com.mcwl.common.domain.IdsParam;
|
||||||
import com.mcwl.common.utils.DateUtils;
|
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
|
||||||
import com.mcwl.common.utils.StringUtils;
|
import com.mcwl.common.utils.StringUtils;
|
||||||
import com.mcwl.common.utils.uuid.IdUtils;
|
|
||||||
import com.mcwl.memberCenter.domain.Member;
|
|
||||||
import com.mcwl.memberCenter.domain.RechargeRecord;
|
|
||||||
import com.mcwl.memberCenter.service.MemberService;
|
|
||||||
import com.mcwl.memberCenter.service.RechargeRecordService;
|
|
||||||
import com.mcwl.myInvitation.domain.Commission;
|
|
||||||
import com.mcwl.myInvitation.domain.Consume;
|
|
||||||
import com.mcwl.myInvitation.service.CommissionService;
|
|
||||||
import com.mcwl.myInvitation.service.ConsumeService;
|
|
||||||
import com.mcwl.pay.domain.OrderTrade;
|
import com.mcwl.pay.domain.OrderTrade;
|
||||||
import com.mcwl.pay.domain.PaymentResult;
|
import com.mcwl.pay.domain.PaymentResult;
|
||||||
import com.mcwl.pay.domain.enums.PaymentStatus;
|
import com.mcwl.pay.domain.enums.PaymentStatus;
|
||||||
import com.mcwl.pay.domain.enums.OrderTypeEnum;
|
|
||||||
import com.mcwl.pay.mapper.OrderTradeMapper;
|
import com.mcwl.pay.mapper.OrderTradeMapper;
|
||||||
import com.mcwl.pay.service.OrderTradeService;
|
import com.mcwl.pay.service.OrderTradeService;
|
||||||
import com.mcwl.system.service.ISysUserService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.util.Collections;
|
||||||
import java.util.*;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:ChenYan
|
* @Author:ChenYan
|
||||||
|
@ -42,6 +28,14 @@ import java.util.*;
|
||||||
@Service
|
@Service
|
||||||
public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTrade> implements OrderTradeService {
|
public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTrade> implements OrderTradeService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrderTradeMapper orderTradeMapper;
|
||||||
|
@Autowired
|
||||||
|
private SysUserServiceImpl userExtensionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrderTradeService orderTradeService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrderTradeMapper orderTradeMapper;
|
private OrderTradeMapper orderTradeMapper;
|
||||||
|
|
||||||
|
@ -110,19 +104,8 @@ public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTr
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertMallProduct(OrderTrade orderTrade) {
|
public int insertMallProduct(OrderTrade orderTrade) {
|
||||||
PaymentResult paymentResult = orderTradeMapper.chargeCard(orderTrade.getTotalAmount(), orderTrade.getPaymentMethod());
|
|
||||||
|
|
||||||
if (paymentResult.isSuccess()) {
|
|
||||||
// 支付成功后的处理:更新订单状态、生成激活码、更新用户权限等
|
|
||||||
orderTrade.setOrderStatus(PaymentStatus.COMPLETED.ordinal());
|
|
||||||
|
|
||||||
// 保存订单
|
// 保存订单
|
||||||
return orderTradeMapper.insert(orderTrade);
|
return orderTradeMapper.insert(orderTrade);
|
||||||
} else {
|
|
||||||
// 支付失败处理...
|
|
||||||
orderTrade.setOrderStatus(PaymentStatus.FAILED.ordinal());
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.mcwl.pay.mapper.OrderTradeMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<update id="chargeCard">
|
||||||
|
|
||||||
|
</update>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.mcwl.resource.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**图片表
|
||||||
|
* @Author:ChenYan
|
||||||
|
* @Project:McWl
|
||||||
|
* @Package:com.mcwl.resource.domain
|
||||||
|
* @Filename:ModelImage
|
||||||
|
* @Description 图片表
|
||||||
|
* @Date:2025/1/8 19:35
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@TableName("model_image")
|
||||||
|
public class ModelImage {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 图片地址(最多8张,切割)
|
||||||
|
*/
|
||||||
|
private Long image_paths;
|
||||||
|
/**
|
||||||
|
* 是否添加水印
|
||||||
|
*/
|
||||||
|
private Long has_watermark;
|
||||||
|
/**
|
||||||
|
* 是否会员下载
|
||||||
|
*/
|
||||||
|
private Long is_member_download;
|
||||||
|
/**
|
||||||
|
* 是否不可下载
|
||||||
|
*/
|
||||||
|
private Long is_not_downloadable;
|
||||||
|
/**
|
||||||
|
* 是否隐藏生成信息
|
||||||
|
*/
|
||||||
|
private Long hide_gen_info;
|
||||||
|
/**
|
||||||
|
* 图片标题(最多30字)
|
||||||
|
*/
|
||||||
|
private Long title;
|
||||||
|
/**
|
||||||
|
* 图片标签(多个,切割)
|
||||||
|
*/
|
||||||
|
private Long tags;
|
||||||
|
/**
|
||||||
|
* 描述信息(最多500)
|
||||||
|
*/
|
||||||
|
private Long description;
|
||||||
|
/**
|
||||||
|
* 删除标志(0代表存在 2代表删除)
|
||||||
|
*/
|
||||||
|
private Long del_flag;
|
||||||
|
}
|
|
@ -10,70 +10,73 @@ import lombok.NoArgsConstructor;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 模型表
|
||||||
* @Author:ChenYan
|
* @Author:ChenYan
|
||||||
* @Project:McWl
|
* @Project:McWl
|
||||||
* @Package:com.mcwl.common.domain.resource
|
* @Package:com.mcwl.common.domain.resource
|
||||||
* @Filename:MallProduct
|
* @Filename:MallProduct
|
||||||
* @Description TODO
|
* @Description 模型表
|
||||||
* @Date:2024/12/30 17:22
|
* @Date:2024/12/30 17:22
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
@TableName("mall_product")
|
@TableName("model")
|
||||||
public class MallProduct extends BaseEntity {
|
public class ModelProduct extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID
|
* 主键ID
|
||||||
*/
|
*/
|
||||||
@TableId
|
@TableId
|
||||||
private Long productId;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 名称
|
||||||
|
*/
|
||||||
|
private String modelName;
|
||||||
|
/***
|
||||||
|
* 用户id
|
||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
/**
|
/**
|
||||||
* 商品名称
|
* 模型类型ID
|
||||||
*/
|
*/
|
||||||
private String productName;
|
private Long modelTypeId;
|
||||||
/**
|
/**
|
||||||
* 商品详情
|
* 垂类
|
||||||
*/
|
*/
|
||||||
private String detail;
|
private String category;
|
||||||
/**
|
/**
|
||||||
* 商品规格
|
* 功能
|
||||||
*/
|
*/
|
||||||
private String model;
|
private String functions;
|
||||||
/**
|
/**
|
||||||
* 金额
|
* 标签(最多三个,切割)
|
||||||
*/
|
*/
|
||||||
private BigDecimal amount;
|
private String tags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态(0全部 1未审核 2公开 3隐私 4未通过)
|
* 参与活动
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String activityParticipation;
|
||||||
/**
|
/**
|
||||||
* 图片名称
|
* 是否原创
|
||||||
*/
|
*/
|
||||||
private String name;
|
private Integer isOriginal;
|
||||||
/**
|
/**
|
||||||
* 图片url
|
* 原创作者姓名
|
||||||
*/
|
*/
|
||||||
private String url;
|
private String originalAuthorName;
|
||||||
/**
|
/**
|
||||||
* 图片url
|
* 生图次数
|
||||||
*/
|
*/
|
||||||
private String zipUrl;
|
private Integer real;
|
||||||
|
/**
|
||||||
|
* 下载次数
|
||||||
|
*/
|
||||||
|
private Integer number;
|
||||||
/**
|
/**
|
||||||
* 删除标志(0代表存在 2代表删除)
|
* 删除标志(0代表存在 2代表删除)
|
||||||
*/
|
*/
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
/**
|
|
||||||
* 下载次数
|
|
||||||
*/
|
|
||||||
private Long number;
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,101 @@
|
||||||
|
package com.mcwl.resource.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.mcwl.common.core.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.locationtech.jts.noding.SegmentString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型版本
|
||||||
|
* @Author:ChenYan
|
||||||
|
* @Project:McWl
|
||||||
|
* @Package:com.mcwl.resource.domain
|
||||||
|
* @Filename:ModelVersion
|
||||||
|
* @Description TODO
|
||||||
|
* @Date:2025/1/8 19:25
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@TableName("model_version")
|
||||||
|
public class ModelVersion extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 版本名称
|
||||||
|
*/
|
||||||
|
private String versionName;
|
||||||
|
/**
|
||||||
|
* 模型类型ID
|
||||||
|
*/
|
||||||
|
private Long modelTypeId;
|
||||||
|
/**
|
||||||
|
* 文件地址
|
||||||
|
*/
|
||||||
|
private String filePath;
|
||||||
|
/**
|
||||||
|
* 版本介绍(富文本编辑)
|
||||||
|
*/
|
||||||
|
private String versionDescription;
|
||||||
|
/**
|
||||||
|
* 触发词
|
||||||
|
*/
|
||||||
|
private String triggerWords;
|
||||||
|
/**
|
||||||
|
* 是否公开
|
||||||
|
*/
|
||||||
|
private Integer isPublic;
|
||||||
|
/**
|
||||||
|
* 是否在线使用
|
||||||
|
*/
|
||||||
|
private Integer isOnlineUse;
|
||||||
|
/**
|
||||||
|
* 允许下载生图
|
||||||
|
*/
|
||||||
|
private Integer allowDownloadImage;
|
||||||
|
/**
|
||||||
|
* 允许在软件旗下使用
|
||||||
|
*/
|
||||||
|
private Integer allowSoftwareUse;
|
||||||
|
/**
|
||||||
|
* 允许进行融合
|
||||||
|
*/
|
||||||
|
private Integer allowFusion;
|
||||||
|
/**
|
||||||
|
* 是否允许商用
|
||||||
|
*/
|
||||||
|
private Integer allowCommercialUse;
|
||||||
|
/**
|
||||||
|
* 是否允许使用
|
||||||
|
*/
|
||||||
|
private Integer allowUsage;
|
||||||
|
/**
|
||||||
|
* 是否为独家模型
|
||||||
|
*/
|
||||||
|
private Integer isExclusiveModel;
|
||||||
|
/**
|
||||||
|
* 示例图片地址(多张使用切割)
|
||||||
|
*/
|
||||||
|
private String sampleImagePaths;
|
||||||
|
/**
|
||||||
|
* 是否隐藏图片生成信息
|
||||||
|
*/
|
||||||
|
private Integer hideImageGenInfo;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 删除标志(0代表存在 2代表删除)
|
||||||
|
*/
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.mcwl.resource.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.mcwl.common.core.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**活动
|
||||||
|
* @Author:ChenYan
|
||||||
|
* @Project:McWl
|
||||||
|
* @Package:com.mcwl.resource.domain
|
||||||
|
* @Filename:ToActivity
|
||||||
|
* @Description TODO
|
||||||
|
* @Date:2025/1/8 19:23
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@TableName("to_activity")
|
||||||
|
public class ToActivity extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 活动名称
|
||||||
|
*/
|
||||||
|
private String activityName;
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.mcwl.resource.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作流表
|
||||||
|
* @Author:ChenYan
|
||||||
|
* @Project:McWl
|
||||||
|
* @Package:com.mcwl.resource.domain
|
||||||
|
* @Filename:WorkFlow
|
||||||
|
* @Description 工作流表
|
||||||
|
* @Version:1.0
|
||||||
|
* @Date:2025/1/8 19:38
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@TableName("work_flow")
|
||||||
|
public class WorkFlow {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 名称(最多30字)
|
||||||
|
*/
|
||||||
|
private String workflowName;
|
||||||
|
/**
|
||||||
|
* 垂类
|
||||||
|
*/
|
||||||
|
private String category;
|
||||||
|
/**
|
||||||
|
* 主题
|
||||||
|
*/
|
||||||
|
private String theme;
|
||||||
|
/**
|
||||||
|
* 风格
|
||||||
|
*/
|
||||||
|
private String style;
|
||||||
|
/**
|
||||||
|
* 功能
|
||||||
|
*/
|
||||||
|
private String functions;
|
||||||
|
/**
|
||||||
|
* 参与活动
|
||||||
|
*/
|
||||||
|
private String activityParticipation;
|
||||||
|
/**
|
||||||
|
* 删除标志(0代表存在 2代表删除)
|
||||||
|
*/
|
||||||
|
private String del_flag;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.mcwl.resource.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**工作流版本表
|
||||||
|
* @Author:ChenYan
|
||||||
|
* @Project:McWl
|
||||||
|
* @Package:com.mcwl.resource.domain
|
||||||
|
* @Filename:WorkFlow
|
||||||
|
* @Description TODO
|
||||||
|
* @Date:2025/1/8 19:38
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@TableName("work_flow_version")
|
||||||
|
public class WorkFlowVersion {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 版本名称
|
||||||
|
*/
|
||||||
|
private String versionName;
|
||||||
|
/**
|
||||||
|
* 版本介绍(富文本)
|
||||||
|
*/
|
||||||
|
private String versionDescription;
|
||||||
|
/**
|
||||||
|
* 文件地址
|
||||||
|
*/
|
||||||
|
private String filePath;
|
||||||
|
/**
|
||||||
|
* 图片地址(最多20张,切割)
|
||||||
|
*/
|
||||||
|
private String imagePaths;
|
||||||
|
/**
|
||||||
|
* 是否隐藏图片生成信息
|
||||||
|
*/
|
||||||
|
private String hideGenInfo;
|
||||||
|
/**
|
||||||
|
* 删除标志(0代表存在 2代表删除)
|
||||||
|
*/
|
||||||
|
private String delFlag;
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.mcwl.resource.domain.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:ChenYan
|
||||||
|
* @Project:McWl
|
||||||
|
* @Package:com.mcwl.resource.domain
|
||||||
|
* @Filename:OrderTypeEnum
|
||||||
|
* @Description TODO
|
||||||
|
* @Date:2025/1/6 19:51
|
||||||
|
*/
|
||||||
|
public enum OrderTypeEnum {
|
||||||
|
TIME("time"), NUM("num");
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
OrderTypeEnum(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,13 @@
|
||||||
package com.mcwl.resource.mapper;
|
package com.mcwl.resource.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.mcwl.resource.domain.MallProduct;
|
|
||||||
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:ChenYan
|
* @Author:ChenYan
|
||||||
* @Project:McWl
|
* @Project:McWl
|
||||||
|
@ -14,10 +17,12 @@ import org.apache.ibatis.annotations.Param;
|
||||||
* @Date:2024/12/30 18:23
|
* @Date:2024/12/30 18:23
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface MallProductMapper extends BaseMapper<MallProduct> {
|
public interface MallProductMapper extends BaseMapper<ModelProduct> {
|
||||||
|
|
||||||
|
|
||||||
String selectMallProductById(@Param("mallProductId") Long mallProductId);
|
|
||||||
|
|
||||||
Long sumNumber(@Param("userId") Long userId);
|
Long sumNumber(@Param("userId") Long userId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.mcwl.resource.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.resource.domain.MallProduct;
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,7 +12,7 @@ import com.mcwl.resource.domain.vo.MallProductVo;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface MallProductLikeService {
|
public interface MallProductLikeService {
|
||||||
Page<MallProduct> selectByUserLike(MallProductVo mallProductVo);
|
Page<ModelProduct> selectByUserLike(MallProductVo mallProductVo);
|
||||||
|
|
||||||
AjaxResult addLike(Long productId);
|
AjaxResult addLike(Long productId);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.mcwl.resource.service;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.mcwl.common.domain.IdsParam;
|
import com.mcwl.common.domain.IdsParam;
|
||||||
import com.mcwl.resource.domain.MallProduct;
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -16,21 +16,23 @@ import java.util.List;
|
||||||
* @Description TODO
|
* @Description TODO
|
||||||
* @Date:2024/12/30 18:20
|
* @Date:2024/12/30 18:20
|
||||||
*/
|
*/
|
||||||
public interface MallProductService extends IService<MallProduct> {
|
public interface MallProductService extends IService<ModelProduct> {
|
||||||
|
|
||||||
List<MallProduct> selectMallProductList(MallProduct sysJob);
|
List<ModelProduct> selectMallProductList(ModelProduct sysJob);
|
||||||
|
|
||||||
String selectMallProductById(Long mallProductId);
|
|
||||||
|
|
||||||
|
|
||||||
int insertMallProduct(MallProduct mallProduct);
|
|
||||||
|
|
||||||
int updateMallProduct(MallProduct mallProduct);
|
|
||||||
|
int insertMallProduct(ModelProduct mallProduct);
|
||||||
|
|
||||||
|
int updateMallProduct(ModelProduct mallProduct);
|
||||||
|
|
||||||
|
|
||||||
void deleteMallProductByIds(IdsParam ids);
|
void deleteMallProductByIds(IdsParam ids);
|
||||||
|
|
||||||
Page<MallProduct> selectByUserId(MallProductVo mallProductVo);
|
Page<ModelProduct> selectByUserId(MallProductVo mallProductVo);
|
||||||
|
|
||||||
|
Page<ModelProduct> pageLike(MallProductVo mallProductVo, List<Long> list);
|
||||||
|
|
||||||
|
|
||||||
Page<MallProduct> pageLike(MallProductVo mallProductVo, List<Long> list);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,11 @@ package com.mcwl.resource.service.impl;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
import com.mcwl.resource.domain.MallProduct;
|
|
||||||
import com.mcwl.resource.domain.MallProductLike;
|
import com.mcwl.resource.domain.MallProductLike;
|
||||||
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||||
import com.mcwl.resource.mapper.MallProductLikeMapper;
|
import com.mcwl.resource.mapper.MallProductLikeMapper;
|
||||||
|
import com.mcwl.resource.mapper.MallProductMapper;
|
||||||
import com.mcwl.resource.service.MallProductLikeService;
|
import com.mcwl.resource.service.MallProductLikeService;
|
||||||
import com.mcwl.resource.service.MallProductService;
|
import com.mcwl.resource.service.MallProductService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -31,12 +32,11 @@ public class MallProductLikeServiceImpl implements MallProductLikeService {
|
||||||
private MallProductService mallProductService;
|
private MallProductService mallProductService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<MallProduct> selectByUserLike(MallProductVo mallProductVo) {
|
public Page<ModelProduct> selectByUserLike(MallProductVo mallProductVo) {
|
||||||
|
|
||||||
//获取登录人
|
//获取登录人
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
List<Long> list = mallProductLikeMapper.selectByUserId(userId);
|
List<Long> list = mallProductLikeMapper.selectByUserId(userId);
|
||||||
|
|
||||||
//分页查询作品数据
|
//分页查询作品数据
|
||||||
return mallProductService.pageLike(mallProductVo, list);
|
return mallProductService.pageLike(mallProductVo, list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.mcwl.common.core.redis.RedisCache;
|
||||||
import com.mcwl.common.domain.IdsParam;
|
import com.mcwl.common.domain.IdsParam;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
import com.mcwl.resource.domain.MallProduct;
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
import com.mcwl.resource.mapper.MallProductMapper;
|
import com.mcwl.resource.mapper.MallProductMapper;
|
||||||
import com.mcwl.resource.service.MallProductService;
|
import com.mcwl.resource.service.MallProductService;
|
||||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||||
|
@ -25,33 +26,30 @@ import java.util.List;
|
||||||
* @Date:2024/12/30 18:22
|
* @Date:2024/12/30 18:22
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,MallProduct> implements MallProductService {
|
public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,ModelProduct> implements MallProductService {
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MallProductMapper postMapper;
|
private MallProductMapper postMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MallProduct> selectMallProductList(MallProduct mallProduct) {
|
public List<ModelProduct> selectMallProductList(ModelProduct mallProduct) {
|
||||||
QueryWrapper<MallProduct> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ModelProduct> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.lambda().eq(MallProduct::getProductName, mallProduct.getProductName());
|
queryWrapper.lambda().eq(ModelProduct::getModelName, mallProduct.getModelName());
|
||||||
queryWrapper.lambda().eq(MallProduct::getName, mallProduct.getName());
|
queryWrapper.lambda().eq(ModelProduct::getOriginalAuthorName, mallProduct.getOriginalAuthorName());
|
||||||
queryWrapper.lambda().eq(MallProduct::getAmount, mallProduct.getAmount());
|
|
||||||
return postMapper.selectList(queryWrapper);
|
return postMapper.selectList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String selectMallProductById(Long mallProductId) {
|
|
||||||
return postMapper.selectMallProductById(mallProductId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertMallProduct(MallProduct mallProduct) {
|
public int insertMallProduct(ModelProduct mallProduct) {
|
||||||
return postMapper.insert(mallProduct);
|
return postMapper.insert(mallProduct);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int updateMallProduct(MallProduct mallProduct) {
|
public int updateMallProduct(ModelProduct mallProduct) {
|
||||||
return postMapper.updateById(mallProduct);
|
return postMapper.updateById(mallProduct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,60 +59,55 @@ public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,MallPr
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<MallProduct> selectByUserId(MallProductVo mallProductVo) {
|
public Page<ModelProduct> selectByUserId(MallProductVo mallProductVo) {
|
||||||
|
|
||||||
// 创建分页对象
|
// 创建分页对象
|
||||||
Page<MallProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize());
|
Page<ModelProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize());
|
||||||
|
|
||||||
//获取当前登录人ID
|
//获取当前登录人ID
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
LambdaQueryWrapper<MallProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ModelProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
mallProductLambdaQueryWrapper.eq(MallProduct::getUserId,userId);
|
mallProductLambdaQueryWrapper.eq(ModelProduct::getUserId,userId);
|
||||||
mallProductLambdaQueryWrapper.eq(MallProduct::getDelFlag,0);
|
mallProductLambdaQueryWrapper.eq(ModelProduct::getDelFlag,0);
|
||||||
|
|
||||||
if (mallProductVo.getStatus() != 0){
|
|
||||||
mallProductLambdaQueryWrapper.eq(MallProduct::getStatus,mallProductVo.getStatus());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mallProductVo.getOrder() == 1){
|
|
||||||
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getProductId);
|
|
||||||
}else {
|
|
||||||
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 开始时间和结束时间过滤
|
// 开始时间和结束时间过滤
|
||||||
if (mallProductVo.getStartTime() != null && mallProductVo.getEndTime() != null) {
|
if (mallProductVo.getStartTime() != null && mallProductVo.getEndTime() != null) {
|
||||||
// 查询开始时间和结束时间之间的商品
|
// 查询开始时间和结束时间之间的商品
|
||||||
mallProductLambdaQueryWrapper.between(MallProduct::getCreateTime, mallProductVo.getStartTime(), mallProductVo.getEndTime());
|
mallProductLambdaQueryWrapper.between(ModelProduct::getCreateTime, mallProductVo.getStartTime(), mallProductVo.getEndTime());
|
||||||
} else if (mallProductVo.getStartTime() != null) {
|
} else if (mallProductVo.getStartTime() != null) {
|
||||||
// 只有开始时间,查询大于等于开始时间的商品
|
// 只有开始时间,查询大于等于开始时间的商品
|
||||||
mallProductLambdaQueryWrapper.ge(MallProduct::getCreateTime, mallProductVo.getStartTime());
|
mallProductLambdaQueryWrapper.ge(ModelProduct::getCreateTime, mallProductVo.getStartTime());
|
||||||
} else if (mallProductVo.getEndTime() != null) {
|
} else if (mallProductVo.getEndTime() != null) {
|
||||||
// 只有结束时间,查询小于等于结束时间的商品
|
// 只有结束时间,查询小于等于结束时间的商品
|
||||||
mallProductLambdaQueryWrapper.le(MallProduct::getCreateTime, mallProductVo.getEndTime());
|
mallProductLambdaQueryWrapper.le(ModelProduct::getCreateTime, mallProductVo.getEndTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
return postMapper.selectPage(mallProductPage, mallProductLambdaQueryWrapper);
|
return postMapper.selectPage(mallProductPage, mallProductLambdaQueryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<MallProduct> pageLike(MallProductVo mallProductVo, List<Long> list) {
|
public Page<ModelProduct> pageLike(MallProductVo mallProductVo, List<Long> list) {
|
||||||
|
|
||||||
// 创建分页对象
|
// 创建分页对象
|
||||||
Page<MallProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize());
|
Page<ModelProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize());
|
||||||
|
|
||||||
LambdaQueryWrapper<MallProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ModelProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
mallProductLambdaQueryWrapper.in(MallProduct::getProductId,list);
|
mallProductLambdaQueryWrapper.in(ModelProduct::getModelTypeId,list);
|
||||||
|
|
||||||
if (mallProductVo.getOrder() == 1){
|
if (mallProductVo.getOrder() == 1){
|
||||||
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getProductId);
|
mallProductLambdaQueryWrapper.orderByDesc(ModelProduct::getModelTypeId);
|
||||||
}else {
|
}else {
|
||||||
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getNumber);
|
mallProductLambdaQueryWrapper.orderByDesc(ModelProduct::getNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
return postMapper.selectPage(mallProductPage,mallProductLambdaQueryWrapper);
|
return postMapper.selectPage(mallProductPage,mallProductLambdaQueryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,27 +5,8 @@
|
||||||
<mapper namespace="com.mcwl.resource.mapper.MallProductMapper">
|
<mapper namespace="com.mcwl.resource.mapper.MallProductMapper">
|
||||||
|
|
||||||
|
|
||||||
<select id="selectMallProductById" resultType="java.lang.String">
|
|
||||||
select product_id,
|
|
||||||
user_id,
|
|
||||||
product_name,
|
|
||||||
detail,
|
|
||||||
model,
|
|
||||||
amount,
|
|
||||||
name,
|
|
||||||
status,
|
|
||||||
zip_url,
|
|
||||||
url,
|
|
||||||
create_by,
|
|
||||||
create_time,
|
|
||||||
update_by,
|
|
||||||
update_time,
|
|
||||||
remark,
|
|
||||||
del_flag
|
|
||||||
from mall_product where product_id =#{mallProductId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="sumNumber" resultType="java.lang.Long">
|
<select id="sumNumber" resultType="java.lang.Long">
|
||||||
SELECT sum(number)sum FROM mall_product where user_id = #{userId} ORDER BY(user_id);
|
SELECT sum(number)sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.mcwl.system.mapper;
|
package com.mcwl.system.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.mcwl.common.core.domain.entity.SysUser;
|
import com.mcwl.common.core.domain.entity.SysUser;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@ -132,4 +133,5 @@ public interface SysUserMapper
|
||||||
|
|
||||||
SysUser selectUserInfoById(@Param("userId") Long userId);
|
SysUser selectUserInfoById(@Param("userId") Long userId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.mcwl.system.service.impl;
|
package com.mcwl.system.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.mcwl.common.annotation.DataScope;
|
import com.mcwl.common.annotation.DataScope;
|
||||||
import com.mcwl.common.constant.UserConstants;
|
import com.mcwl.common.constant.UserConstants;
|
||||||
import com.mcwl.common.core.domain.entity.SysRole;
|
import com.mcwl.common.core.domain.entity.SysRole;
|
||||||
|
@ -617,4 +618,5 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.mcwl.system.mapper.SysUserMapper">
|
<mapper namespace="com.mcwl.system.mapper.SysUserMapper">
|
||||||
|
|
||||||
<resultMap type="SysUser" id="SysUserResult">
|
<resultMap type="SysUser" id="SysUserResult">
|
||||||
|
@ -30,13 +30,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="deptResult" type="SysDept">
|
<resultMap id="deptResult" type="SysDept">
|
||||||
<id property="deptId" column="dept_id" />
|
<id property="deptId" column="dept_id"/>
|
||||||
<result property="parentId" column="parent_id" />
|
<result property="parentId" column="parent_id"/>
|
||||||
<result property="deptName" column="dept_name" />
|
<result property="deptName" column="dept_name"/>
|
||||||
<result property="ancestors" column="ancestors" />
|
<result property="ancestors" column="ancestors"/>
|
||||||
<result property="orderNum" column="order_num" />
|
<result property="orderNum" column="order_num"/>
|
||||||
<result property="leader" column="leader" />
|
<result property="leader" column="leader"/>
|
||||||
<result property="status" column="dept_status" />
|
<result property="status" column="dept_status"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="RoleResult" type="SysRole">
|
<resultMap id="RoleResult" type="SysRole">
|
||||||
|
@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectUserVo">
|
<sql id="selectUserVo">
|
||||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.inviter_user_id,u.free_points,
|
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
||||||
from sys_user u
|
from sys_user u
|
||||||
|
|
Loading…
Reference in New Issue