From 72a737eda7487c8e3cd6179c328c6c98e87508c4 Mon Sep 17 00:00:00 2001 From: ChenYan <3139166962@qq.com> Date: Wed, 8 Jan 2025 20:08:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20sp=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mcwl/McWlApplication.java | 12 +- .../controller/comment/CommentController.java | 77 --- .../resource/MallProductController.java | 26 +- .../resource/MallProductLikeController.java | 4 +- .../java/com/mcwl/comment/domain/Comment.java | 53 -- .../domain/ProductCommentConditionEntity.java | 56 --- .../comment/domain/ProductCommentEntity.java | 50 -- .../domain/RequestConditionEntity.java | 41 -- .../comment/domain/RequestPageEntity.java | 72 --- .../mcwl/comment/mapper/CommentMapper.java | 31 -- .../service/impl/CommentServiceImpl.java | 88 ---- .../mapper/comment/CommentMapper.xml | 70 +-- .../common/constant/ShopCodeConstants.java | 12 + .../common/core/domain/entity/SysUser.java | 3 + mcwl-pay/pom.xml | 4 + .../mcwl/pay/service/OrderTradeService.java | 4 +- .../service/impl/OrderTradeServiceImpl.java | 25 +- .../resources/mapper/pay/OrderTradeMapper.xml | 11 + .../com/mcwl/resource/domain/ModelImage.java | 62 +++ .../{MallProduct.java => ModelProduct.java} | 59 +-- .../mcwl/resource/domain/ModelVersion.java | 101 ++++ .../com/mcwl/resource/domain/ToActivity.java | 30 ++ .../com/mcwl/resource/domain/WorkFlow.java | 59 +++ .../mcwl/resource/domain/WorkFlowVersion.java | 52 ++ .../resource/domain/enums/OrderTypeEnum.java | 23 + .../resource/mapper/MallProductMapper.java | 11 +- .../service/MallProductLikeService.java | 4 +- .../resource/service/MallProductService.java | 20 +- .../impl/MallProductLikeServiceImpl.java | 6 +- .../service/impl/MallProductServiceImpl.java | 63 ++- .../mapper/resource/MallProductMapper.xml | 21 +- .../com/mcwl/system/mapper/SysUserMapper.java | 2 + .../service/impl/SysUserServiceImpl.java | 2 + .../resources/mapper/system/SysUserMapper.xml | 456 ++++++++++-------- 34 files changed, 745 insertions(+), 865 deletions(-) delete mode 100644 mcwl-admin/src/main/java/com/mcwl/web/controller/comment/CommentController.java delete mode 100644 mcwl-comment/src/main/java/com/mcwl/comment/domain/Comment.java delete mode 100644 mcwl-comment/src/main/java/com/mcwl/comment/domain/ProductCommentConditionEntity.java delete mode 100644 mcwl-comment/src/main/java/com/mcwl/comment/domain/ProductCommentEntity.java delete mode 100644 mcwl-comment/src/main/java/com/mcwl/comment/domain/RequestConditionEntity.java delete mode 100644 mcwl-comment/src/main/java/com/mcwl/comment/domain/RequestPageEntity.java delete mode 100644 mcwl-comment/src/main/java/com/mcwl/comment/mapper/CommentMapper.java delete mode 100644 mcwl-comment/src/main/java/com/mcwl/comment/service/impl/CommentServiceImpl.java create mode 100644 mcwl-common/src/main/java/com/mcwl/common/constant/ShopCodeConstants.java create mode 100644 mcwl-pay/src/main/resources/mapper/pay/OrderTradeMapper.xml create mode 100644 mcwl-resource/src/main/java/com/mcwl/resource/domain/ModelImage.java rename mcwl-resource/src/main/java/com/mcwl/resource/domain/{MallProduct.java => ModelProduct.java} (55%) create mode 100644 mcwl-resource/src/main/java/com/mcwl/resource/domain/ModelVersion.java create mode 100644 mcwl-resource/src/main/java/com/mcwl/resource/domain/ToActivity.java create mode 100644 mcwl-resource/src/main/java/com/mcwl/resource/domain/WorkFlow.java create mode 100644 mcwl-resource/src/main/java/com/mcwl/resource/domain/WorkFlowVersion.java create mode 100644 mcwl-resource/src/main/java/com/mcwl/resource/domain/enums/OrderTypeEnum.java diff --git a/mcwl-admin/src/main/java/com/mcwl/McWlApplication.java b/mcwl-admin/src/main/java/com/mcwl/McWlApplication.java index f018ebf..1cf52e3 100644 --- a/mcwl-admin/src/main/java/com/mcwl/McWlApplication.java +++ b/mcwl-admin/src/main/java/com/mcwl/McWlApplication.java @@ -20,18 +20,8 @@ public class McWlApplication { public static void main(String[] args) { - // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(McWlApplication.class, args); - System.out.println("(♥◠‿◠)ノ゙ 魔创未来启动成功 ლ(´ڡ`ლ)゙ \n" + - " .-------. ____ __ \n" + - " | _ _ \\ \\ \\ / / \n" + - " | ( ' ) | \\ _. / ' \n" + - " |(_ o _) / _( )_ .' \n" + - " | (_,_).' __ ___(_ o _)' \n" + - " | |\\ \\ | || |(_,_)' \n" + - " | | \\ `' /| `-' / \n" + - " | | \\ / \\ / \n" + - " ''-' `'-' `-..-' "); + System.out.println("(♥◠‿◠)ノ゙ 魔创未来启动成功 ლ(´ڡ`ლ)゙ "); } // 序列化枚举值为前端返回值 diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/comment/CommentController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/comment/CommentController.java deleted file mode 100644 index 5739ee1..0000000 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/comment/CommentController.java +++ /dev/null @@ -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 ids) { - return commentService.deleteByIds(ids); - } - - -} diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java index 883cb2e..dc19977 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductController.java @@ -5,8 +5,7 @@ import com.mcwl.common.core.controller.BaseController; import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.domain.IdsParam; -import com.mcwl.common.utils.SecurityUtils; -import com.mcwl.resource.domain.MallProduct; +import com.mcwl.resource.domain.ModelProduct; import com.mcwl.resource.domain.vo.MallProductVo; import com.mcwl.resource.service.MallProductService; 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") - public TableDataInfo list(MallProduct sysJob) + @PostMapping("/list") + public TableDataInfo list(@RequestBody ModelProduct mallProduct) { startPage(); - List list = mallProductRuleInfoService.selectMallProductList(sysJob); + List list = mallProductRuleInfoService.selectMallProductList(mallProduct); return getDataTable(list); } @@ -99,35 +99,33 @@ public class MallProductController extends BaseController { * 获取详细信息 */ @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") - public AjaxResult add(@RequestBody MallProduct mallProduct) + public AjaxResult add(@RequestBody ModelProduct mallProduct) { - mallProduct.setUserId(SecurityUtils.getUserId()); - mallProduct.setCreateBy(getUsername()); + return toAjax(mallProductRuleInfoService.insertMallProduct(mallProduct)); } + /** * 修改 */ @PutMapping("/upda") - public AjaxResult edit(@RequestBody MallProduct mallProduct) + public AjaxResult edit(@RequestBody ModelProduct mallProduct) { mallProduct.setUpdateBy(getUsername()); return toAjax(mallProductRuleInfoService.updateMallProduct(mallProduct)); } - /** * 删除 */ @@ -145,7 +143,7 @@ public class MallProductController extends BaseController { @PostMapping("/selectByUserId") public AjaxResult selectByUserId(@RequestBody MallProductVo mallProductVo){ - Page mallProductList = mallProductRuleInfoService.selectByUserId(mallProductVo); + Page mallProductList = mallProductRuleInfoService.selectByUserId(mallProductVo); return AjaxResult.success(mallProductList); } diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductLikeController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductLikeController.java index 844e024..50e18fd 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductLikeController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/MallProductLikeController.java @@ -3,7 +3,7 @@ package com.mcwl.web.controller.resource; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mcwl.common.annotation.RepeatSubmit; 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.service.MallProductLikeService; import org.springframework.beans.factory.annotation.Autowired; @@ -31,7 +31,7 @@ public class MallProductLikeController { @PostMapping("/selectByUserLike") public AjaxResult selectByUserLike(@RequestBody MallProductVo mallProductVo){ - Page mallProductPage = mallProductLikeService.selectByUserLike(mallProductVo); + Page mallProductPage = mallProductLikeService.selectByUserLike(mallProductVo); return AjaxResult.success(mallProductPage); } diff --git a/mcwl-comment/src/main/java/com/mcwl/comment/domain/Comment.java b/mcwl-comment/src/main/java/com/mcwl/comment/domain/Comment.java deleted file mode 100644 index 858cb4e..0000000 --- a/mcwl-comment/src/main/java/com/mcwl/comment/domain/Comment.java +++ /dev/null @@ -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; -} diff --git a/mcwl-comment/src/main/java/com/mcwl/comment/domain/ProductCommentConditionEntity.java b/mcwl-comment/src/main/java/com/mcwl/comment/domain/ProductCommentConditionEntity.java deleted file mode 100644 index a2cf39e..0000000 --- a/mcwl-comment/src/main/java/com/mcwl/comment/domain/ProductCommentConditionEntity.java +++ /dev/null @@ -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 idList; - - /** - * ID - */ - private Long id; - /** - * 父评论ID - */ - private Long parentId; - /** - * 商品ID - */ - private Long productId; - - /** - * 商品ID集合 - */ - private List productIdList; - /** - * 用户ID - */ - private Long userId; - /** - * 评论内容 - */ - private String content; - /** - * 评分 - */ - private Integer rating; - /** - * 删除标志(0代表存在 2代表删除) - */ - private String delFlag; -// /** -// * 评论类型 -// */ -// private Integer type; -} diff --git a/mcwl-comment/src/main/java/com/mcwl/comment/domain/ProductCommentEntity.java b/mcwl-comment/src/main/java/com/mcwl/comment/domain/ProductCommentEntity.java deleted file mode 100644 index c3780c6..0000000 --- a/mcwl-comment/src/main/java/com/mcwl/comment/domain/ProductCommentEntity.java +++ /dev/null @@ -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; -} diff --git a/mcwl-comment/src/main/java/com/mcwl/comment/domain/RequestConditionEntity.java b/mcwl-comment/src/main/java/com/mcwl/comment/domain/RequestConditionEntity.java deleted file mode 100644 index 0522e90..0000000 --- a/mcwl-comment/src/main/java/com/mcwl/comment/domain/RequestConditionEntity.java +++ /dev/null @@ -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 betweenTime; - - /** - * 创建开始时间 - */ - private String createBeginTime; - - /** - * 创建结束时间 - */ - private String createEndTime; - - /** - * 自定义excel表头列表 - */ - private List customizeColumnNameList; - - /** - * 查询条件 - */ - private String blurry; -} diff --git a/mcwl-comment/src/main/java/com/mcwl/comment/domain/RequestPageEntity.java b/mcwl-comment/src/main/java/com/mcwl/comment/domain/RequestPageEntity.java deleted file mode 100644 index ff21aa0..0000000 --- a/mcwl-comment/src/main/java/com/mcwl/comment/domain/RequestPageEntity.java +++ /dev/null @@ -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 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 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(); - } -} diff --git a/mcwl-comment/src/main/java/com/mcwl/comment/mapper/CommentMapper.java b/mcwl-comment/src/main/java/com/mcwl/comment/mapper/CommentMapper.java deleted file mode 100644 index 4a0fcb8..0000000 --- a/mcwl-comment/src/main/java/com/mcwl/comment/mapper/CommentMapper.java +++ /dev/null @@ -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 { - - MallProduct findById(@Param("id") Long id); - - int insert(ProductCommentEntity productCommentEntity); - - int upda(ProductCommentEntity productCommentEntity); - - List findByIds(List ids); - - int deleteByIds(List ids, ProductCommentEntity productCommentEntity); -} diff --git a/mcwl-comment/src/main/java/com/mcwl/comment/service/impl/CommentServiceImpl.java b/mcwl-comment/src/main/java/com/mcwl/comment/service/impl/CommentServiceImpl.java deleted file mode 100644 index 6c43a7b..0000000 --- a/mcwl-comment/src/main/java/com/mcwl/comment/service/impl/CommentServiceImpl.java +++ /dev/null @@ -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 { - - @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 ids) { - List 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; - } -} diff --git a/mcwl-comment/src/main/resources/mapper/comment/CommentMapper.xml b/mcwl-comment/src/main/resources/mapper/comment/CommentMapper.xml index 5ce895c..a20b8f2 100644 --- a/mcwl-comment/src/main/resources/mapper/comment/CommentMapper.xml +++ b/mcwl-comment/src/main/resources/mapper/comment/CommentMapper.xml @@ -9,67 +9,30 @@ values (#{id}, #{parentId}, #{productId}, #{userId}, #{content}, #{rating}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}, #{delFlag}) - - update mall_product_comment - - - parent_id = #{parentId}, - - - product_id = #{productId}, - - - user_id = #{userId}, - - - content = #{content}, - - - rating = #{rating}, - - - create_by = #{createBy}, - - - create_time = #{createTime}, - - - update_by = #{updateBy}, - - - update_time = #{updateTime}, - - - remark = #{remark}, - - - del_flag = #{delFlag}, - - - where id = #{id} - + delete - from mall_product_comment + from model where id in #{id} - + select + id, + parent_id, + product_id, + user_id, + content, + create_by, + create_time, + update_by, + update_time, + remark, + del_flag + from model where id = #{id} - 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} - diff --git a/mcwl-system/src/main/java/com/mcwl/system/mapper/SysUserMapper.java b/mcwl-system/src/main/java/com/mcwl/system/mapper/SysUserMapper.java index 8cd762f..a866592 100644 --- a/mcwl-system/src/main/java/com/mcwl/system/mapper/SysUserMapper.java +++ b/mcwl-system/src/main/java/com/mcwl/system/mapper/SysUserMapper.java @@ -1,5 +1,6 @@ package com.mcwl.system.mapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.mcwl.common.core.domain.entity.SysUser; import org.apache.ibatis.annotations.Param; @@ -132,4 +133,5 @@ public interface SysUserMapper SysUser selectUserInfoById(@Param("userId") Long userId); + } diff --git a/mcwl-system/src/main/java/com/mcwl/system/service/impl/SysUserServiceImpl.java b/mcwl-system/src/main/java/com/mcwl/system/service/impl/SysUserServiceImpl.java index 6c203b6..c9ab419 100644 --- a/mcwl-system/src/main/java/com/mcwl/system/service/impl/SysUserServiceImpl.java +++ b/mcwl-system/src/main/java/com/mcwl/system/service/impl/SysUserServiceImpl.java @@ -1,5 +1,6 @@ package com.mcwl.system.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.mcwl.common.annotation.DataScope; import com.mcwl.common.constant.UserConstants; import com.mcwl.common.core.domain.entity.SysRole; @@ -617,4 +618,5 @@ public class SysUserServiceImpl implements ISysUserService return sb.toString(); } + } diff --git a/mcwl-system/src/main/resources/mapper/system/SysUserMapper.xml b/mcwl-system/src/main/resources/mapper/system/SysUserMapper.xml index 4c7d436..95792cd 100644 --- a/mcwl-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/mcwl-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -1,237 +1,293 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - 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, - r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status + + select u.user_id, + u.dept_id, + u.user_name, + u.nick_name, + u.email, + u.avatar, + u.phonenumber, + u.password, + u.sex, + u.wallet, + 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, + r.role_id, + r.role_name, + r.role_key, + r.role_sort, + r.data_scope, + r.status as role_status from sys_user u - left join sys_dept d on u.dept_id = d.dept_id - left join sys_user_role ur on u.user_id = ur.user_id - left join sys_role r on r.role_id = ur.role_id + left join sys_dept d on u.dept_id = d.dept_id + left join sys_user_role ur on u.user_id = ur.user_id + left join sys_role r on r.role_id = ur.role_id + select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, + u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user + u + left join sys_dept d on u.dept_id = d.dept_id + where u.del_flag = '0' + + AND u.user_id = #{userId} + + + AND u.user_name like concat('%', #{userName}, '%') + + + AND u.status = #{status} + + + AND u.phonenumber like concat('%', #{phonenumber}, '%') + + + AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') + + + AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') + + + AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, + ancestors) )) + + + ${params.dataScope} + - + - + - + - + - + - + - + - + - + - - insert into sys_user( - user_id, - dept_id, - user_name, - nick_name, - email, - avatar, - phonenumber, - sex, - password, - status, - create_by, - remark, - create_time - )values( - #{userId}, - #{deptId}, - #{userName}, - #{nickName}, - #{email}, - #{avatar}, - #{phonenumber}, - #{sex}, - #{password}, - #{status}, - #{createBy}, - #{remark}, - sysdate() - ) - + + insert into sys_user( + user_id, + dept_id, + user_name, + nick_name, + email, + avatar, + phonenumber, + sex, + password, + wallet, + status, - - update sys_user - - dept_id = #{deptId}, - user_name = #{userName}, - nick_name = #{nickName}, - email = #{email}, - phonenumber = #{phonenumber}, - sex = #{sex}, - avatar = #{avatar}, - password = #{password}, - status = #{status}, - login_ip = #{loginIp}, - login_date = #{loginDate}, - update_by = #{updateBy}, - remark = #{remark}, - update_time = sysdate() - - where user_id = #{userId} - + create_by, + remark, + create_time + )values( + #{userId}, + #{deptId}, + #{userName}, + #{nickName}, + #{email}, + #{avatar}, + #{phonenumber}, + #{sex}, + #{password}, + #{wallet}, + #{status}, + #{createBy}, + #{remark}, + sysdate() + ) + - - update sys_user set status = #{status} where user_id = #{userId} - + + update sys_user + + dept_id = #{deptId}, + user_name = #{userName}, + nick_name = #{nickName}, + email = #{email}, + phonenumber = #{phonenumber}, + sex = #{sex}, + avatar = #{avatar}, + password = #{password}, + wallet = #{wallet}, + status = #{status}, + login_ip = #{loginIp}, + login_date = #{loginDate}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where user_id = #{userId} + - - update sys_user set avatar = #{avatar} where user_name = #{userName} - + + update sys_user + set status = #{status} + where user_id = #{userId} + - - update sys_user set password = #{password} where user_name = #{userName} - + + update sys_user + set avatar = #{avatar} + where user_name = #{userName} + - - update sys_user set nick_name = #{nickName}, - avatar = #{avatar}, - brief = #{brief} - where user_id = #{userId} - + + update sys_user + set password = #{password} + where user_name = #{userName} + - - update sys_user set del_flag = '2' where user_id = #{userId} - + + update sys_user + set nick_name = #{nickName}, + avatar = #{avatar}, + brief = #{brief} + where user_id = #{userId} + - - update sys_user set del_flag = '2' where user_id in - - #{userId} + + update sys_user + set del_flag = '2' + where user_id = #{userId} + + + + update sys_user set del_flag = '2' where user_id in + + #{userId} - +