diff --git a/.image/Java监控.jpg b/.image/Java监控.jpg index 31ed243ea..6ad522ab0 100644 Binary files a/.image/Java监控.jpg and b/.image/Java监控.jpg differ diff --git a/.image/Redis.jpg b/.image/Redis.jpg index 67c52722e..956935264 100644 Binary files a/.image/Redis.jpg and b/.image/Redis.jpg differ diff --git a/.image/admin-uniapp/01.png b/.image/admin-uniapp/01.png old mode 100755 new mode 100644 index 970ea3e14..0f65d99e3 Binary files a/.image/admin-uniapp/01.png and b/.image/admin-uniapp/01.png differ diff --git a/.image/admin-uniapp/02.png b/.image/admin-uniapp/02.png old mode 100755 new mode 100644 index 679e7259a..05ec781c7 Binary files a/.image/admin-uniapp/02.png and b/.image/admin-uniapp/02.png differ diff --git a/.image/admin-uniapp/03.png b/.image/admin-uniapp/03.png old mode 100755 new mode 100644 index 2e11d247b..f400c6884 Binary files a/.image/admin-uniapp/03.png and b/.image/admin-uniapp/03.png differ diff --git a/.image/admin-uniapp/04.png b/.image/admin-uniapp/04.png old mode 100755 new mode 100644 index db9e12eb1..d5d5ea072 Binary files a/.image/admin-uniapp/04.png and b/.image/admin-uniapp/04.png differ diff --git a/.image/admin-uniapp/05.png b/.image/admin-uniapp/05.png old mode 100755 new mode 100644 index 57506fff2..1de6d8ae1 Binary files a/.image/admin-uniapp/05.png and b/.image/admin-uniapp/05.png differ diff --git a/.image/admin-uniapp/06.png b/.image/admin-uniapp/06.png old mode 100755 new mode 100644 index 527200d02..400ae90b1 Binary files a/.image/admin-uniapp/06.png and b/.image/admin-uniapp/06.png differ diff --git a/.image/admin-uniapp/07.png b/.image/admin-uniapp/07.png old mode 100755 new mode 100644 index e7d819824..2ed8c0ff6 Binary files a/.image/admin-uniapp/07.png and b/.image/admin-uniapp/07.png differ diff --git a/.image/admin-uniapp/08.png b/.image/admin-uniapp/08.png old mode 100755 new mode 100644 index bac9ecd34..090e64a67 Binary files a/.image/admin-uniapp/08.png and b/.image/admin-uniapp/08.png differ diff --git a/.image/admin-uniapp/09.png b/.image/admin-uniapp/09.png old mode 100755 new mode 100644 index d975b9d36..f2032c8a8 Binary files a/.image/admin-uniapp/09.png and b/.image/admin-uniapp/09.png differ diff --git a/.image/common/mall-feature.png b/.image/common/mall-feature.png index 4873db4db..cca05c0e6 100644 Binary files a/.image/common/mall-feature.png and b/.image/common/mall-feature.png differ diff --git a/.image/common/mall-preview.png b/.image/common/mall-preview.png index 1d1d1c6e7..f939214bf 100644 Binary files a/.image/common/mall-preview.png and b/.image/common/mall-preview.png differ diff --git a/.image/common/project-vs.png b/.image/common/project-vs.png new file mode 100644 index 000000000..561e092f4 Binary files /dev/null and b/.image/common/project-vs.png differ diff --git a/.image/common/ruoyi-vue-pro-architecture.png b/.image/common/ruoyi-vue-pro-architecture.png index 30c0bbe45..7bd7d59ab 100644 Binary files a/.image/common/ruoyi-vue-pro-architecture.png and b/.image/common/ruoyi-vue-pro-architecture.png differ diff --git a/.image/common/ruoyi-vue-pro-biz.png b/.image/common/ruoyi-vue-pro-biz.png index 5a80fb247..24a385abe 100644 Binary files a/.image/common/ruoyi-vue-pro-biz.png and b/.image/common/ruoyi-vue-pro-biz.png differ diff --git a/.image/common/yudao-cloud-architecture.png b/.image/common/yudao-cloud-architecture.png index 01e8c5a47..59416d806 100644 Binary files a/.image/common/yudao-cloud-architecture.png and b/.image/common/yudao-cloud-architecture.png differ diff --git a/.image/common/yudao-roadmap.png b/.image/common/yudao-roadmap.png new file mode 100644 index 000000000..f4becc98c Binary files /dev/null and b/.image/common/yudao-roadmap.png differ diff --git a/.image/个人中心.jpg b/.image/个人中心.jpg index e68d8abf7..ce57f6e1e 100644 Binary files a/.image/个人中心.jpg and b/.image/个人中心.jpg differ diff --git a/.image/代码生成.jpg b/.image/代码生成.jpg index ec9b77db9..751603efb 100644 Binary files a/.image/代码生成.jpg and b/.image/代码生成.jpg differ diff --git a/.image/令牌管理.jpg b/.image/令牌管理.jpg old mode 100755 new mode 100644 index 66198a05c..04abf4d21 Binary files a/.image/令牌管理.jpg and b/.image/令牌管理.jpg differ diff --git a/.image/任务列表-已办.jpg b/.image/任务列表-已办.jpg index 83cc28ba1..7a8d0fb17 100644 Binary files a/.image/任务列表-已办.jpg and b/.image/任务列表-已办.jpg differ diff --git a/.image/任务列表-待办.jpg b/.image/任务列表-待办.jpg index 3b5fb67e7..a90323fb1 100644 Binary files a/.image/任务列表-待办.jpg and b/.image/任务列表-待办.jpg differ diff --git a/.image/任务日志.jpg b/.image/任务日志.jpg index 8e8687209..599e50a9c 100644 Binary files a/.image/任务日志.jpg and b/.image/任务日志.jpg differ diff --git a/.image/在线用户.jpg b/.image/在线用户.jpg index 9d5321fd9..b183009b6 100644 Binary files a/.image/在线用户.jpg and b/.image/在线用户.jpg differ diff --git a/.image/大屏设计器-列表.jpg b/.image/大屏设计器-列表.jpg old mode 100755 new mode 100644 diff --git a/.image/大屏设计器-编辑.jpg b/.image/大屏设计器-编辑.jpg old mode 100755 new mode 100644 index 304ebeb05..63298a0c1 Binary files a/.image/大屏设计器-编辑.jpg and b/.image/大屏设计器-编辑.jpg differ diff --git a/.image/大屏设计器-预览.jpg b/.image/大屏设计器-预览.jpg old mode 100755 new mode 100644 index c9c7426b6..501d9ea2c Binary files a/.image/大屏设计器-预览.jpg and b/.image/大屏设计器-预览.jpg differ diff --git a/.image/字典数据.jpg b/.image/字典数据.jpg index d1e48b5d6..8298c893f 100644 Binary files a/.image/字典数据.jpg and b/.image/字典数据.jpg differ diff --git a/.image/字典类型.jpg b/.image/字典类型.jpg index 2188e928a..6613392f6 100644 Binary files a/.image/字典类型.jpg and b/.image/字典类型.jpg differ diff --git a/.image/定时任务.jpg b/.image/定时任务.jpg index 7fb6e8db1..d5bbd8510 100644 Binary files a/.image/定时任务.jpg and b/.image/定时任务.jpg differ diff --git a/.image/岗位管理.jpg b/.image/岗位管理.jpg index 7ff71c79a..42b64d2c6 100644 Binary files a/.image/岗位管理.jpg and b/.image/岗位管理.jpg differ diff --git a/.image/应用管理.jpg b/.image/应用管理.jpg old mode 100755 new mode 100644 index 1422c8ab0..6e7789fca Binary files a/.image/应用管理.jpg and b/.image/应用管理.jpg differ diff --git a/.image/报表设计器-打印设计.jpg b/.image/报表设计器-打印设计.jpg index 522c6cf39..bb86da64e 100644 Binary files a/.image/报表设计器-打印设计.jpg and b/.image/报表设计器-打印设计.jpg differ diff --git a/.image/报表设计器-数据报表.jpg b/.image/报表设计器-数据报表.jpg index e30d8166e..9ca5b9b64 100644 Binary files a/.image/报表设计器-数据报表.jpg and b/.image/报表设计器-数据报表.jpg differ diff --git a/.image/操作日志.jpg b/.image/操作日志.jpg index 698053f6d..4a0611a34 100644 Binary files a/.image/操作日志.jpg and b/.image/操作日志.jpg differ diff --git a/.image/敏感词.jpg b/.image/敏感词.jpg old mode 100755 new mode 100644 index 86c44b682..92a539747 Binary files a/.image/敏感词.jpg and b/.image/敏感词.jpg differ diff --git a/.image/数据库文档.jpg b/.image/数据库文档.jpg index c27d5094d..a4339d960 100644 Binary files a/.image/数据库文档.jpg and b/.image/数据库文档.jpg differ diff --git a/.image/文件管理.jpg b/.image/文件管理.jpg index 4620ef8fa..054b19f1e 100644 Binary files a/.image/文件管理.jpg and b/.image/文件管理.jpg differ diff --git a/.image/日志中心.jpg b/.image/日志中心.jpg index 9313acdbb..27c1c6cb5 100644 Binary files a/.image/日志中心.jpg and b/.image/日志中心.jpg differ diff --git a/.image/生成效果.jpg b/.image/生成效果.jpg index c618c621a..98ff2cca5 100644 Binary files a/.image/生成效果.jpg and b/.image/生成效果.jpg differ diff --git a/.image/用户管理.jpg b/.image/用户管理.jpg index 19b6fc3ff..844604a64 100644 Binary files a/.image/用户管理.jpg and b/.image/用户管理.jpg differ diff --git a/.image/登录日志.jpg b/.image/登录日志.jpg index e99fb96cc..25662d97b 100644 Binary files a/.image/登录日志.jpg and b/.image/登录日志.jpg differ diff --git a/.image/短信日志.jpg b/.image/短信日志.jpg index 5a2a70dd0..ada8e56db 100644 Binary files a/.image/短信日志.jpg and b/.image/短信日志.jpg differ diff --git a/.image/短信渠道.jpg b/.image/短信渠道.jpg index 8a01faddb..df3a5c39b 100644 Binary files a/.image/短信渠道.jpg and b/.image/短信渠道.jpg differ diff --git a/.image/系统接口.jpg b/.image/系统接口.jpg index 402240b41..6d39d4211 100644 Binary files a/.image/系统接口.jpg and b/.image/系统接口.jpg differ diff --git a/.image/菜单管理.jpg b/.image/菜单管理.jpg index 97421e96e..ad3b7979c 100644 Binary files a/.image/菜单管理.jpg and b/.image/菜单管理.jpg differ diff --git a/.image/表单构建.jpg b/.image/表单构建.jpg index 901de571e..81f037466 100644 Binary files a/.image/表单构建.jpg and b/.image/表单构建.jpg differ diff --git a/.image/角色管理.jpg b/.image/角色管理.jpg index 31fe0d30e..eed776e86 100644 Binary files a/.image/角色管理.jpg and b/.image/角色管理.jpg differ diff --git a/.image/访问日志.jpg b/.image/访问日志.jpg index deb73c829..ef301aad4 100644 Binary files a/.image/访问日志.jpg and b/.image/访问日志.jpg differ diff --git a/.image/通知公告.jpg b/.image/通知公告.jpg index ca08e3bba..97bb42fe4 100644 Binary files a/.image/通知公告.jpg and b/.image/通知公告.jpg differ diff --git a/.image/部门管理.jpg b/.image/部门管理.jpg index 06f7fc347..6eab2330c 100644 Binary files a/.image/部门管理.jpg and b/.image/部门管理.jpg differ diff --git a/.image/配置管理.jpg b/.image/配置管理.jpg index 5d6e86f0b..0abaec932 100644 Binary files a/.image/配置管理.jpg and b/.image/配置管理.jpg differ diff --git a/.image/链路追踪.jpg b/.image/链路追踪.jpg index 23c35a654..12f7aa8ef 100644 Binary files a/.image/链路追踪.jpg and b/.image/链路追踪.jpg differ diff --git a/.image/错误日志.jpg b/.image/错误日志.jpg index 2ce41fe2d..eb615ea3f 100644 Binary files a/.image/错误日志.jpg and b/.image/错误日志.jpg differ diff --git a/.image/错误码管理.jpg b/.image/错误码管理.jpg index 87a61b45b..ea91dde14 100644 Binary files a/.image/错误码管理.jpg and b/.image/错误码管理.jpg differ diff --git a/.image/首页.jpg b/.image/首页.jpg index 4778cb2d3..10a7fde76 100644 Binary files a/.image/首页.jpg and b/.image/首页.jpg differ diff --git a/README.md b/README.md index 622cc8e97..c28bae463 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ ## 🐳 项目关系 -![架构演进](https://static.iocoder.cn/yudao-roadmap.png?imageView2/2/format/webp) +![架构演进](/.image/common/yudao-roadmap.png) 三个项目的功能对比,可见社区共同整理的 [国产开源项目对比](https://www.yuque.com/xiatian-bsgny/lm0ec1/wqf8mn) 表格。 @@ -88,7 +88,7 @@ ② 代码全部开源,不会像其他项目一样,只开源部分代码,让你无法了解整个项目的架构设计。[国产开源项目对比](https://www.yuque.com/xiatian-bsgny/lm0ec1/wqf8mn) -![开源项目对比](https://static.iocoder.cn/project-vs.png?imageView2/2/format/webp/w/1280) +![开源项目对比](/.image/common/project-vs.png) ③ 代码整洁、架构整洁,遵循《阿里巴巴 Java 开发手册》规范,代码注释详细,57000 行 Java 代码,22000 行代码注释。 diff --git a/pom.xml b/pom.xml index 88a3a34eb..f0d7064c7 100644 --- a/pom.xml +++ b/pom.xml @@ -13,14 +13,14 @@ yudao-server - yudao-module-member + yudao-module-system yudao-module-infra - yudao-module-pay - yudao-module-mall + + yudao-example diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/DiscountActivityController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/DiscountActivityController.java index b3b1810fc..0685d8b24 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/DiscountActivityController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/DiscountActivityController.java @@ -1,11 +1,17 @@ package cn.iocoder.yudao.module.promotion.controller.admin.discount; +import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.product.api.spu.ProductSpuApi; +import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; import cn.iocoder.yudao.module.promotion.controller.admin.discount.vo.*; import cn.iocoder.yudao.module.promotion.convert.discount.DiscountActivityConvert; +import cn.iocoder.yudao.module.promotion.convert.seckill.seckillactivity.SeckillActivityConvert; import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountActivityDO; import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountProductDO; +import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.SeckillActivityDO; +import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.SeckillProductDO; import cn.iocoder.yudao.module.promotion.service.discount.DiscountActivityService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -17,8 +23,11 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; @Tag(name = "管理后台 - 限时折扣活动") @RestController @@ -29,6 +38,9 @@ public class DiscountActivityController { @Resource private DiscountActivityService discountActivityService; + @Resource + private ProductSpuApi productSpuApi; + @PostMapping("/create") @Operation(summary = "创建限时折扣活动") @PreAuthorize("@ss.hasPermission('promotion:discount-activity:create')") @@ -49,7 +61,7 @@ public class DiscountActivityController { @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('promotion:discount-activity:close')") public CommonResult closeRewardActivity(@RequestParam("id") Long id) { - discountActivityService.closeRewardActivity(id); + discountActivityService.closeDiscountActivity(id); return success(true); } @@ -81,7 +93,18 @@ public class DiscountActivityController { @PreAuthorize("@ss.hasPermission('promotion:discount-activity:query')") public CommonResult> getDiscountActivityPage(@Valid DiscountActivityPageReqVO pageVO) { PageResult pageResult = discountActivityService.getDiscountActivityPage(pageVO); - return success(DiscountActivityConvert.INSTANCE.convertPage(pageResult)); + + if (CollUtil.isEmpty(pageResult.getList())) { + return success(PageResult.empty(pageResult.getTotal())); + } + // 拼接数据 + List products = discountActivityService.getDiscountProductsByActivityId( + convertSet(pageResult.getList(), DiscountActivityDO::getId)); + + List spuList = productSpuApi.getSpuList( + convertSet(products, DiscountProductDO::getSpuId)); + + return success(DiscountActivityConvert.INSTANCE.convertPage(pageResult, products, spuList)); } } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityRespVO.java index 92fae75a2..9cfb22db4 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityRespVO.java @@ -7,6 +7,7 @@ import lombok.ToString; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; +import java.util.List; @Schema(description = "管理后台 - 限时折扣活动 Response VO") @Data @@ -24,4 +25,25 @@ public class DiscountActivityRespVO extends DiscountActivityBaseVO { @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDateTime createTime; + + @Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048") + private Long spuId; + + @Schema(description = "限时折扣商品", requiredMode = Schema.RequiredMode.REQUIRED) + private List products; + + + // ========== 商品字段 ========== + + @Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 name 读取 + example = "618大促") + private String spuName; + @Schema(description = "商品主图", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 picUrl 读取 + example = "https://www.iocoder.cn/xx.png") + private String picUrl; + @Schema(description = "商品市场价,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 marketPrice 读取 + example = "50") + private Integer marketPrice; + + } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/discount/DiscountActivityConvert.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/discount/DiscountActivityConvert.java index ebf53ce8a..ff9308cc7 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/discount/DiscountActivityConvert.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/discount/DiscountActivityConvert.java @@ -2,15 +2,22 @@ package cn.iocoder.yudao.module.promotion.convert.discount; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; +import cn.iocoder.yudao.framework.common.util.collection.MapUtils; +import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; import cn.iocoder.yudao.module.promotion.api.discount.dto.DiscountProductRespDTO; import cn.iocoder.yudao.module.promotion.controller.admin.discount.vo.*; +import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity.SeckillActivityRespVO; +import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.product.SeckillProductRespVO; import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountActivityDO; import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountProductDO; +import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.SeckillProductDO; import cn.iocoder.yudao.module.promotion.enums.common.PromotionDiscountTypeEnum; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; import java.util.List; +import java.util.Map; /** * 限时折扣活动 Convert @@ -29,14 +36,57 @@ public interface DiscountActivityConvert { DiscountActivityRespVO convert(DiscountActivityDO bean); List convertList(List list); + List convertList2(List list); List convertList02(List list); PageResult convertPage(PageResult page); + default PageResult convertPage(PageResult page, + List discountProductDOList, + List spuList) { + PageResult pageResult = convertPage(page); + + // 拼接商品 + Map discountActivityMap = CollectionUtils.convertMap(discountProductDOList, DiscountProductDO::getActivityId); + Map spuMap = CollectionUtils.convertMap(spuList, ProductSpuRespDTO::getId); + pageResult.getList().forEach(item -> { + item.setProducts(convertList2(discountProductDOList)); + item.setSpuId(discountActivityMap.get(item.getId())==null?null: discountActivityMap.get(item.getId()).getSpuId()); + if (item.getSpuId() != null) { + MapUtils.findAndThen(spuMap, item.getSpuId(), + spu -> item.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice())); + } + + }); + return pageResult; + } + DiscountProductDO convert(DiscountActivityBaseVO.Product bean); - DiscountActivityDetailRespVO convert(DiscountActivityDO activity, List products); + default DiscountActivityDetailRespVO convert(DiscountActivityDO activity, List products){ + if ( activity == null && products == null ) { + return null; + } + + DiscountActivityDetailRespVO discountActivityDetailRespVO = new DiscountActivityDetailRespVO(); + + if ( activity != null ) { + discountActivityDetailRespVO.setName( activity.getName() ); + discountActivityDetailRespVO.setStartTime( activity.getStartTime() ); + discountActivityDetailRespVO.setEndTime( activity.getEndTime() ); + discountActivityDetailRespVO.setRemark( activity.getRemark() ); + discountActivityDetailRespVO.setId( activity.getId() ); + discountActivityDetailRespVO.setStatus( activity.getStatus() ); + discountActivityDetailRespVO.setCreateTime( activity.getCreateTime() ); + } + if (!products.isEmpty()) { + discountActivityDetailRespVO.setSpuId(products.get(0).getSpuId()); + } + discountActivityDetailRespVO.setProducts( convertList2( products ) ); + + return discountActivityDetailRespVO; + } // =========== 比较是否相等 ========== /** diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/discount/DiscountProductMapper.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/discount/DiscountProductMapper.java index 646b60707..3984d72db 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/discount/DiscountProductMapper.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/discount/DiscountProductMapper.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.promotion.dal.mysql.discount; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountProductDO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.Collection; import java.util.List; @@ -23,4 +24,10 @@ public interface DiscountProductMapper extends BaseMapperX { return selectList(DiscountProductDO::getActivityId, activityId); } + default List selectListByActivityId(Collection activityIds) { + return selectList(DiscountProductDO::getActivityId, activityIds); + } + + + List getMatchDiscountProductList(@Param("skuIds") Collection skuIds); } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/discount/DiscountActivityService.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/discount/DiscountActivityService.java index 7473f12cd..99831c625 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/discount/DiscountActivityService.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/discount/DiscountActivityService.java @@ -48,7 +48,7 @@ public interface DiscountActivityService { * * @param id 编号 */ - void closeRewardActivity(Long id); + void closeDiscountActivity(Long id); /** * 删除限时折扣活动 @@ -81,4 +81,12 @@ public interface DiscountActivityService { */ List getDiscountProductsByActivityId(Long activityId); + /** + * 获得活动编号,对应对应的商品列表 + * + * @param activityIds 活动编号 + * @return 活动的商品列表 + */ + List getDiscountProductsByActivityId(Collection activityIds); + } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/discount/DiscountActivityServiceImpl.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/discount/DiscountActivityServiceImpl.java index 4c628ed83..e63c339bd 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/discount/DiscountActivityServiceImpl.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/discount/DiscountActivityServiceImpl.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.promotion.service.discount; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.promotion.controller.admin.discount.vo.DiscountActivityBaseVO; import cn.iocoder.yudao.module.promotion.controller.admin.discount.vo.DiscountActivityCreateReqVO; @@ -20,6 +21,7 @@ import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; import java.util.Collection; import java.util.List; +import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; @@ -41,8 +43,9 @@ public class DiscountActivityServiceImpl implements DiscountActivityService { @Override public List getMatchDiscountProductList(Collection skuIds) { - // TODO 芋艿:开启、满足 skuId、日期内 - return null; + // 芋艿:开启、满足 skuId、日期内 + List matchDiscountProductList = discountProductMapper.getMatchDiscountProductList(skuIds); + return matchDiscountProductList; } @Override @@ -66,7 +69,7 @@ public class DiscountActivityServiceImpl implements DiscountActivityService { public void updateDiscountActivity(DiscountActivityUpdateReqVO updateReqVO) { // 校验存在 DiscountActivityDO discountActivity = validateDiscountActivityExists(updateReqVO.getId()); - if (discountActivity.getStatus().equals(PromotionActivityStatusEnum.CLOSE.getStatus())) { // 已关闭的活动,不能修改噢 + if (discountActivity.getStatus().equals(CommonStatusEnum.DISABLE.getStatus())) { // 已关闭的活动,不能修改噢 throw exception(DISCOUNT_ACTIVITY_UPDATE_FAIL_STATUS_CLOSED); } // 校验商品是否冲突 @@ -99,7 +102,7 @@ public class DiscountActivityServiceImpl implements DiscountActivityService { } } - // TODO 芋艿:校验逻辑简化,只查询时间冲突的活动,开启状态的。 + // 芋艿:校验逻辑简化,只查询时间冲突的活动,开启状态的。 /** * 校验商品是否冲突 * @@ -111,27 +114,30 @@ public class DiscountActivityServiceImpl implements DiscountActivityService { return; } // 查询商品参加的活动 - List discountActivityProductList = null; + + List list = discountProductMapper.selectListByActivityId(id); + List skuIds = list.stream().map(item -> item.getSkuId()).collect(Collectors.toList()); + List matchDiscountProductList = getMatchDiscountProductList(skuIds); // getRewardProductListBySkuIds( // convertSet(products, DiscountActivityBaseVO.Product::getSkuId), // asList(PromotionActivityStatusEnum.WAIT.getStatus(), PromotionActivityStatusEnum.RUN.getStatus())); if (id != null) { // 排除自己这个活动 - discountActivityProductList.removeIf(product -> id.equals(product.getActivityId())); + matchDiscountProductList.removeIf(product -> id.equals(product.getActivityId())); } // 如果非空,则说明冲突 - if (CollUtil.isNotEmpty(discountActivityProductList)) { + if (CollUtil.isNotEmpty(matchDiscountProductList)) { throw exception(DISCOUNT_ACTIVITY_SPU_CONFLICTS); } } @Override - public void closeRewardActivity(Long id) { + public void closeDiscountActivity(Long id) { // 校验存在 DiscountActivityDO dbDiscountActivity = validateDiscountActivityExists(id); - if (dbDiscountActivity.getStatus().equals(PromotionActivityStatusEnum.CLOSE.getStatus())) { // 已关闭的活动,不能关闭噢 + if (dbDiscountActivity.getStatus().equals(CommonStatusEnum.DISABLE.getStatus())) { // 已关闭的活动,不能关闭噢 throw exception(DISCOUNT_ACTIVITY_CLOSE_FAIL_STATUS_CLOSED); } - if (dbDiscountActivity.getStatus().equals(PromotionActivityStatusEnum.END.getStatus())) { // 已关闭的活动,不能关闭噢 + if (dbDiscountActivity.getStatus().equals(CommonStatusEnum.DISABLE.getStatus())) { // 已关闭的活动,不能关闭噢 throw exception(DISCOUNT_ACTIVITY_CLOSE_FAIL_STATUS_END); } @@ -144,7 +150,7 @@ public class DiscountActivityServiceImpl implements DiscountActivityService { public void deleteDiscountActivity(Long id) { // 校验存在 DiscountActivityDO discountActivity = validateDiscountActivityExists(id); - if (!discountActivity.getStatus().equals(PromotionActivityStatusEnum.CLOSE.getStatus())) { // 未关闭的活动,不能删除噢 + if (!discountActivity.getStatus().equals(CommonStatusEnum.ENABLE.getStatus())) { // 未关闭的活动,不能删除噢 throw exception(DISCOUNT_ACTIVITY_DELETE_FAIL_STATUS_NOT_CLOSED); } @@ -175,4 +181,8 @@ public class DiscountActivityServiceImpl implements DiscountActivityService { return discountProductMapper.selectListByActivityId(activityId); } + @Override + public List getDiscountProductsByActivityId(Collection activityIds) { + return discountProductMapper.selectList("activity_id", activityIds); + } } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/resources/mapper/discount/DiscountProductMapper.xml b/yudao-module-mall/yudao-module-promotion-biz/src/main/resources/mapper/discount/DiscountProductMapper.xml new file mode 100644 index 000000000..76af37db2 --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/resources/mapper/discount/DiscountProductMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 3149e59f3..5f0d12f33 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -37,11 +37,11 @@ - - cn.iocoder.boot - yudao-module-member-biz - ${revision} - + + + + + @@ -56,11 +56,11 @@ - - cn.iocoder.boot - yudao-module-pay-biz - ${revision} - + + + + + @@ -70,26 +70,26 @@ - - cn.iocoder.boot - yudao-module-promotion-biz - ${revision} - - - cn.iocoder.boot - yudao-module-product-biz - ${revision} - - - cn.iocoder.boot - yudao-module-trade-biz - ${revision} - - - cn.iocoder.boot - yudao-module-statistics-biz - ${revision} - + + + + + + + + + + + + + + + + + + + + diff --git a/yudao-ui-admin/src/api/bpm/task.js b/yudao-ui-admin/src/api/bpm/task.js index aa32263f3..359c43af2 100644 --- a/yudao-ui-admin/src/api/bpm/task.js +++ b/yudao-ui-admin/src/api/bpm/task.js @@ -61,3 +61,25 @@ export function getTaskListByProcessInstanceId(processInstanceId) { method: 'get', }) } +export function getReturnList(taskId) { + return request({ + url: '/bpm/task/get-return-list?taskId='+ taskId, + method: 'get', + }) +} + + +export function returnTask(data) { + return request({ + url: '/bpm/task/return', + method: 'PUT', + data: data + }) +} +export function delegateTask(data) { + return request({ + url: '/bpm/task/delegate', + method: 'PUT', + data: data + }) +} diff --git a/yudao-ui-admin/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue b/yudao-ui-admin/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue index de1a693f9..2c6d83991 100644 --- a/yudao-ui-admin/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue +++ b/yudao-ui-admin/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue @@ -233,6 +233,10 @@ export default { return 'highlight-reject'; } else if (result === 4) { // 已取消 return 'highlight-cancel'; + } else if (result === 5) { // 已退回 + return 'highlight-back'; + } else if (result === 6) { // 已委派 + return 'highlight-todo'; } return ''; }, @@ -475,7 +479,33 @@ export default { :deep(.highlight-cancel.djs-connection > .djs-visual > path) { stroke: grey !important; } +/**驳回 */ +.highlight-back.djs-connection > .djs-visual > path { + stroke: #FFBA00 !important; + stroke-dasharray: 4px !important; + fill-opacity: 0.2 !important; +} +.highlight-back.djs-shape .djs-visual > :nth-child(1) { + fill: #FFBA00 !important; + stroke: #FFBA00 !important; + stroke-dasharray: 4px !important; + fill-opacity: 0.2 !important; +} + +:deep(.highlight-back.djs-connection > .djs-visual > path) { + stroke: #FFBA00 !important; + stroke-dasharray: 4px !important; + fill-opacity: 0.2 !important; + marker-end: url(#sequenceflow-end-_E7DFDF-_E7DFDF-803g1kf6zwzmcig1y2ulm5egr); +} + +:deep(.highlight-back.djs-shape .djs-visual > :nth-child(1)) { + fill: #FFBA00 !important; + stroke: #FFBA00 !important; + stroke-dasharray: 4px !important; + fill-opacity: 0.2 !important; +} .element-overlays { box-sizing: border-box; padding: 8px; diff --git a/yudao-ui-admin/src/views/bpm/processInstance/detail.vue b/yudao-ui-admin/src/views/bpm/processInstance/detail.vue index 7ecc53438..aad82e0d9 100644 --- a/yudao-ui-admin/src/views/bpm/processInstance/detail.vue +++ b/yudao-ui-admin/src/views/bpm/processInstance/detail.vue @@ -5,7 +5,7 @@
审批任务【{{ item.name }}】
- + {{ processInstance.name }} @@ -15,15 +15,20 @@ {{ processInstance.startUser.deptName }} - +
- 通过 - 不通过 - 转办 - 委派 - 退回 + 通过 + + 不通过 + + 转办 + + 委派 + + 退回 +
@@ -34,8 +39,8 @@ -
- +
+
@@ -48,7 +53,7 @@
审批记录
- +
创建时间: - + - +

{{ item.reason }}

@@ -81,15 +89,16 @@ 流程图
+ :processInstanceData="processInstance" :taskData="tasks"/> - - + + - + @@ -98,17 +107,64 @@ 取 消
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 取 消 + 确 定 + +